diff --git a/.docker/application.properties.tpl b/.docker/application.properties.tpl new file mode 100644 index 000000000..224f9df3e --- /dev/null +++ b/.docker/application.properties.tpl @@ -0,0 +1,42 @@ +# Container Configuration +# Your external IP adress, e.g. 129.69.214.56 +org.opentosca.container.hostname={{ .Env.CONTAINER_HOSTNAME }} +org.opentosca.container.port={{ .Env.CONTAINER_PORT }} + +# IA Engine Configuration (endpoint and credentials) +org.opentosca.container.engine.ia.hostname={{ .Env.ENGINE_IA_HOSTNAME }} +org.opentosca.container.engine.ia.port={{ .Env.ENGINE_IA_PORT }} +org.opentosca.container.engine.ia.plugin.tomcat.url=http://{{ .Env.ENGINE_IA_HOSTNAME }}:{{ .Env.ENGINE_IA_PORT }} +org.opentosca.container.engine.ia.plugin.tomcat.password={{ .Env.ENGINE_IA_PASSWORD }} +org.opentosca.container.engine.ia.plugin.tomcat.username={{ .Env.ENGINE_IA_USER }} + +# BPEL Plan Engine Configuration (endpoint and credentials) +org.opentosca.container.engine.plan.plugin.bpel.engine={{ .Env.ENGINE_PLAN_BPEL }} +org.opentosca.container.engine.plan.plugin.bpel.url=http://{{ .Env.ENGINE_PLAN_BPEL_HOSTNAME }}:{{ .Env.ENGINE_PLAN_BPEL_PORT }}/{{ .Env.ENGINE_PLAN_BPEL_CONTEXT }} +org.opentosca.container.engine.plan.plugin.bpel.password={{ .Env.ENGINE_PLAN_BPEL_PASSWORD }} +org.opentosca.container.engine.plan.plugin.bpel.username={{ .Env.ENGINE_PLAN_BPEL_USER }} +org.opentosca.container.engine.plan.plugin.bpel.services.url=http://{{ .Env.ENGINE_PLAN_BPEL_HOSTNAME }}:{{ .Env.ENGINE_PLAN_BPEL_PORT }}/{{ .Env.ENGINE_PLAN_BPEL_CONTEXT }}/{{ .Env.ENGINE_PLAN_BPEL_SERVICES_PATH }} + +# BPMN Plan Engine Configuration (endpoint and credentials) +org.opentosca.container.engine.plan.plugin.bpmn.engine={{ .Env.ENGINE_PLAN_BPMN }} +org.opentosca.container.engine.plan.plugin.bpmn.url=http://{{ .Env.ENGINE_PLAN_BPMN_HOSTNAME }}:{{ .Env.ENGINE_PLAN_BPMN_PORT }}/{{ .Env.ENGINE_PLAN_BPMN_CONTEXT }} +org.opentosca.container.engine.plan.plugin.bpmn.username={{ .Env.ENGINE_PLAN_BPMN_USER }} +org.opentosca.container.engine.plan.plugin.bpmn.password={{ .Env.ENGINE_PLAN_BPMN_PASSWORD }} + +# Container Mode Repository (winery) +org.opentosca.container.connector.winery.url=http://{{ .Env.CONTAINER_REPOSITORY_HOSTNAME }}:{{ .Env.CONTAINER_REPOSITORY_PORT }}/{{ .Env.CONTAINER_REPOSITORY_CONTEXT }} + +# Local MQTT broker +org.opentosca.container.broker.mqtt.port={{ .Env.MQTT_BROKER_PORT }} +org.opentosca.container.broker.mqtt.username={{ .Env.MQTT_BROKER_USER }} +org.opentosca.container.broker.mqtt.password={{ .Env.MQTT_BROKER_PASSWORD }} + +# Distributed IA deployment +org.opentosca.container.collaboration.mode={{ .Env.COLLABORATION_MODE }} +org.opentosca.container.collaboration.hostnames={{ .Env.COLLABORATION_HOSTNAMES }} +org.opentosca.container.collaboration.ports={{ .Env.COLLABORATION_PORTS }} + +# Testing +org.opentosca.deployment.tests={{ .Env.CONTAINER_DEPLOYMENT_TESTS }} +org.opentosca.bus.management.mocking={{ .Env.CONTAINER_BUS_MANAGEMENT_MOCK }} +org.opentosca.engine.ia.keepfiles={{ .Env.ENGINE_IA_KEEP_FILES }} \ No newline at end of file diff --git a/.docker/server.xml.tpl b/.docker/server.xml.tpl new file mode 100644 index 000000000..dbfb6324b --- /dev/null +++ b/.docker/server.xml.tpl @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.editorconfig b/.editorconfig index 7625b61d9..0c754adfe 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,7 +4,7 @@ root = true [*] charset = utf-8 indent_style = space -indent_size = 2 +indent_size = 4 insert_final_newline = true trim_trailing_whitespace = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..772ef6a37 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +target-definition/binaries/winery-2.0.0.jar filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index 7d5a0bacb..b67bebe01 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,15 @@ # Custom -### Intellij ### .idea - -### Eclipse ### .project .classpath +.vscode +!.idea/codeStyles +!.idea/copyright +!.idea/runConfigurations +!.idea/modules.xml # Created by https://www.gitignore.io/api/java,maven,eclipse,intellij,visualstudiocode @@ -171,5 +173,7 @@ buildNumber.properties !.vscode/extensions.json # End of https://www.gitignore.io/api/java,maven,eclipse,intellij,visualstudiocode -/org.opentosca.container.product/config.ini -/org.opentosca.container.product/org.opentosca.container.product +### Project specific overrides + +# Avoid ignoring the war project +!/org.opentosca.container.war/ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 000000000..60a9dd92d --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 000000000..480f7cb42 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/copyright/Container.xml b/.idea/copyright/Container.xml new file mode 100644 index 000000000..d6d310958 --- /dev/null +++ b/.idea/copyright/Container.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Container.xml b/.idea/runConfigurations/Container.xml new file mode 100644 index 000000000..cdecbe929 --- /dev/null +++ b/.idea/runConfigurations/Container.xml @@ -0,0 +1,76 @@ + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3476cf9de..b5a2a2126 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,49 +2,71 @@ FROM maven:3-jdk-8 as builder RUN rm /dev/random && ln -s /dev/urandom /dev/random -WORKDIR /opt/opentosca/container -COPY . /opt/opentosca/container -RUN mvn package +WORKDIR /tmp/opentosca/container +COPY . /tmp/opentosca/container +RUN mvn package -DskipTests=true -Dmaven.javadoc.skip=true -B \ + && mkdir /tmp/build \ + && unzip /tmp/opentosca/container/org.opentosca.container.war/target/OpenTOSCA-container.war -d /tmp/build/container -FROM openjdk:8 -LABEL maintainer "Johannes Wettinger , Michael Wurster " +FROM tomcat:9-jdk8 +LABEL maintainer = "Benjamin Weder , Lukas Harzenetter , Michael Wurster " -ARG DOCKERIZE_VERSION=v0.3.0 +ARG DOCKERIZE_VERSION=v0.6.1 + +ENV CONTAINER_HOSTNAME localhost +ENV CONTAINER_PORT 1337 -ENV PUBLIC_HOSTNAME localhost ENV CONTAINER_REPOSITORY_HOSTNAME localhost ENV CONTAINER_REPOSITORY_PORT 8091 +ENV CONTAINER_REPOSITORY_CONTEXT winery + +ENV CONTAINER_BUS_MANAGEMENT_MOCK false +ENV CONTAINER_DEPLOYMENT_TESTS false + ENV ENGINE_IA_HOSTNAME localhost -ENV ENGINE_IA_USER_NAME admin -ENV ENGINE_IA_PWD admin +ENV ENGINE_IA_PORT 8090 +ENV ENGINE_IA_USER admin +ENV ENGINE_IA_PASSWORD admin +ENV ENGINE_IA_KEEP_FILES true + ENV ENGINE_PLAN_BPEL ODE -ENV ENGINE_PLAN_BPEL_ROOT_URL http://localhost:9763/ode -ENV ENGINE_PLAN_BPEL_SERVICES_URL http://localhost:9763/ode/processes +ENV ENGINE_PLAN_BPEL_USER "" +ENV ENGINE_PLAN_BPEL_PASSWORD "" +ENV ENGINE_PLAN_BPEL_HOSTNAME localhost +ENV ENGINE_PLAN_BPEL_PORT 9763 +ENV ENGINE_PLAN_BPEL_CONTEXT ode +ENV ENGINE_PLAN_BPEL_SERVICES_PATH processes + ENV ENGINE_PLAN_BPMN Camunda -ENV ENGINE_PLAN_BPMN_ROOT_URL http://localhost:8092/engine-rest +ENV ENGINE_PLAN_BPMN_USER admin +ENV ENGINE_PLAN_BPMN_PASSWORD admin +ENV ENGINE_PLAN_BPMN_HOSTNAME localhost +ENV ENGINE_PLAN_BPMN_PORT 8092 +ENV ENGINE_PLAN_BPMN_CONTEXT engine-rest + +ENV MQTT_BROKER_PORT 1883 +ENV MQTT_BROKER_USER admin +ENV MQTT_BROKER_PASSWORD admin + ENV COLLABORATION_MODE false ENV COLLABORATION_HOSTNAMES "" ENV COLLABORATION_PORTS "" -ENV CONTAINER_BUS_MANAGEMENT_MOCK false RUN rm /dev/random && ln -s /dev/urandom /dev/random \ && wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz -COPY --from=builder /opt/opentosca/container/org.opentosca.container.product/target/products/org.opentosca.container.product/linux/gtk/x86_64 /opt/opentosca/container - -WORKDIR /opt/opentosca/container - -RUN ln -s /opt/opentosca/container/OpenTOSCA /usr/local/bin/opentosca-container \ - && chmod +x /usr/local/bin/opentosca-container +RUN rm -rf ${CATALINA_HOME}/webapps/* +COPY --from=builder /tmp/build/container ${CATALINA_HOME}/webapps/ROOT -ADD docker/config.ini.tpl /opt/opentosca/container/config.ini.tpl -ADD docker/OpenTOSCA.ini.tpl /opt/opentosca/container/OpenTOSCA.ini.tpl +ADD .docker/application.properties.tpl /tmp/opentosca/container/application.properties.tpl +ADD .docker/server.xml.tpl /tmp/opentosca/container/server.xml.tpl -EXPOSE 1337 +EXPOSE ${CONTAINER_PORT} -CMD dockerize -template /opt/opentosca/container/config.ini.tpl:/opt/opentosca/container/configuration/config.ini \ - -template /opt/opentosca/container/OpenTOSCA.ini.tpl:/opt/opentosca/container/OpenTOSCA.ini \ - /usr/local/bin/opentosca-container +CMD dockerize -template /tmp/opentosca/container/application.properties.tpl:${CATALINA_HOME}/webapps/ROOT/WEB-INF/classes/application.properties \ + -template /tmp/opentosca/container/server.xml.tpl:${CATALINA_HOME}/conf/server.xml \ + && export spring_config_location=${CATALINA_HOME}/webapps/ROOT/WEB-INF/classes/application.properties \ + && ${CATALINA_HOME}/bin/catalina.sh run diff --git a/PITCHME.md b/PITCHME.md deleted file mode 100644 index cda6ecfd5..000000000 --- a/PITCHME.md +++ /dev/null @@ -1,49 +0,0 @@ -# OpenTOSCA Container - -This is the OpenTOSCA runtime environment. - -First, we present the architecture. -Future things will come. Stay tuned. - ---- - -# OpenTOSCA Architecture - -Scroll down for the architecture - - -+++ - -## Components - -![ArchitekturContainerAPI](docs/graphics/ArchitekturContainerAPI.png) - -+++ - -## Current Architecture - -![ArchitekturOpenTOSCAContainerIST](docs/graphics/ArchitekturOpenTOSCAContainer-IST.png) - -+++ - -## Core Architecture - -![ArchitekturCore](docs/graphics/ArchitekturCore.png) - -+++ - -## TOSCA Engine - -![ArchitekturTOSCAEngine](docs/graphics/ArchitekturTOSCAEngine.png) - -+++ - -## Planned Architecture - -![ArchitekturOpenTOSCAContainerSOLL](docs/graphics/ArchitekturOpenTOSCAContainer-SOLL.png) - ---- - -# More things to come - -** stay tuned ** diff --git a/README.md b/README.md index 75868ccfe..340514414 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,19 @@ Part of the [OpenTOSCA Ecosystem](http://www.opentosca.org) ## Build -1. Run `mvn package` inside the root folder. -2. When completed, the built product can be found in `org.opentosca.container.product/target/products`. - - -## Setup in Eclipse -- Make sure to use the IAAS code style configuration (see [IAAS Code Style Configuration](docs/codestyle/Readme.md)) -- After checkout, import the project to Eclipse (on the root directory) and select all found projects. - - File > Import... > Maven > Existing Maven Projects > Next - - Select appropriate Root Directory - - Select all projects - - OK -- When Eclipse asks to install the Tycho Configurators, hit Yes/Okay/Install (be sure that `m2e` and it's repositories are known to your Eclipse). -- Then, in the (sub-)project `target-definition` open the file `target-definition.target` and click `Set as Target Platform` (top right; `Reload Target Platform` for newer Eclipse versions). -- To start the container, in (sub-)project `org.opentosca.container.product` open the `*.product` file and run the application. - +1. Run `git update-index --assume-unchanged ./org.opentosca.container.core/src/main/resources/application.properties` + to ignore custom configuration changes inside the application.properties. +2. Update [application.properties](org.opentosca.container.core/src/main/resources/application.properties) and + replace `localhost` with your external IP address, e.g., `192.168.1.100`. +3. Run `mvn package` inside the root folder. +4. Afterwards, the [OpenTOSCA-container.war](org.opentosca.container.war/target/OpenTOSCA-container.war) + can be deployed using a tomcat webserver. + +## Setup in IntelliJ + +1. Open the project using `File` > `Open` and navigate to the container folder. +2. Right click the [pom.xml](pom.xml) and select `Add as Maven project`. +3. Run the `Container` run configuration. ## Haftungsausschluss diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml new file mode 100644 index 000000000..7a4fe06fe --- /dev/null +++ b/checkstyle-suppressions.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/checkstyle.xml b/checkstyle.xml new file mode 100644 index 000000000..8f911704d --- /dev/null +++ b/checkstyle.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docker/OpenTOSCA.ini.tpl b/docker/OpenTOSCA.ini.tpl deleted file mode 100644 index 0be2684fa..000000000 --- a/docker/OpenTOSCA.ini.tpl +++ /dev/null @@ -1,13 +0,0 @@ --startup -plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar ---launcher.library -plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.401.v20161122-1740 --consoleLog --console ---launcher.secondThread --vmargs --Declipse.ignoreApp=true --Dosgi.noShutdown=true --Dorg.osgi.service.http.port=1337 --DREFRESH_BUNDLES=false -{{ .Env.CONTAINER_JAVA_OPTS }} diff --git a/docker/config.ini.tpl b/docker/config.ini.tpl deleted file mode 100644 index bfde547d8..000000000 --- a/docker/config.ini.tpl +++ /dev/null @@ -1,38 +0,0 @@ -# -# Container Configuration -# -osgi.framework=file\:plugins/org.eclipse.osgi_3.11.3.v20170209-1843.jar -osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.0.200.v20160504-1419.jar -osgi.bundles=reference\:file\:javax.persistence_2.1.1.v201509150925.jar@1\:start,reference\:file\:org.eclipse.equinox.simpleconfigurator_1.1.200.v20160504-1450.jar@1\:start -osgi.bundles.defaultStartLevel=4 -eclipse.product=org.opentosca.container.application.opentoscacontainer -eclipse.application=org.opentosca.container.application.application -eclipse.p2.profile=DefaultProfile -eclipse.p2.data.area=@config.dir/../p2 -equinox.use.ds=true -org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info -org.opentosca.container.engine.ia.hostname={{ .Env.ENGINE_IA_HOSTNAME }} -org.opentosca.container.engine.ia.port={{ .Env.ENGINE_IA_PORT }} -org.opentosca.container.engine.ia.plugin.tomcat.url=http\://{{ .Env.ENGINE_IA_HOSTNAME }}\:{{ .Env.ENGINE_IA_PORT }} -org.opentosca.container.engine.ia.plugin.tomcat.username={{ .Env.ENGINE_IA_USER_NAME }} -org.opentosca.container.engine.ia.plugin.tomcat.password={{ .Env.ENGINE_IA_PWD }} -org.opentosca.container.engine.plan.plugin.bpel.engine={{ .Env.ENGINE_PLAN_BPEL }} -org.opentosca.container.engine.plan.plugin.bpel.url={{ .Env.ENGINE_PLAN_BPEL_ROOT_URL }} -org.opentosca.container.engine.plan.plugin.bpel.username={{ .Env.ENGINE_PLAN_BPEL_USER_NAME }} -org.opentosca.container.engine.plan.plugin.bpel.password={{ .Env.ENGINE_PLAN_BPEL_PWD }} -org.opentosca.container.engine.plan.plugin.bpel.services.url={{ .Env.ENGINE_PLAN_BPEL_SERVICES_URL }} -org.opentosca.container.engine.plan.plugin.bpmn.engine={{ .Env.ENGINE_PLAN_BPMN }} -org.opentosca.container.engine.plan.plugin.bpmn.url={{ .Env.ENGINE_PLAN_BPMN_ROOT_URL }} -org.opentosca.container.engine.plan.plugin.bpmn.username={{ .Env.ENGINE_PLAN_BPMN_USER_NAME }} -org.opentosca.container.engine.plan.plugin.bpmn.password={{ .Env.ENGINE_PLAN_BPMN_PWD }} -org.opentosca.container.connector.winery.url=http\://{{ .Env.CONTAINER_REPOSITORY_HOSTNAME }}\:{{ .Env.CONTAINER_REPOSITORY_PORT }}/winery -org.opentosca.container.hostname={{ .Env.PUBLIC_HOSTNAME }} -org.opentosca.container.port=1337 -org.opentosca.deployment.tests={{ .Env.CONTAINER_DEPLOYMENT_TESTS }} -org.opentosca.bus.management.mocking={{ .Env.CONTAINER_BUS_MANAGEMENT_MOCK }} -org.opentosca.container.broker.mqtt.port=1883 -org.opentosca.container.broker.mqtt.username=admin -org.opentosca.container.broker.mqtt.password=admin -org.opentosca.container.collaboration.mode={{ .Env.COLLABORATION_MODE }} -org.opentosca.container.collaboration.hostnames={{ .Env.COLLABORATION_HOSTNAMES }} -org.opentosca.container.collaboration.ports={{ .Env.COLLABORATION_PORTS }} diff --git a/docs/ApplicationUploadGuide.md b/docs/ApplicationUploadGuide.md deleted file mode 100644 index c68130bc4..000000000 --- a/docs/ApplicationUploadGuide.md +++ /dev/null @@ -1,52 +0,0 @@ -## How to upload an application - -- Go to [opentosca2](localhost:8088/#/applications) -- Click on **Upload New Application** - -![Start](graphics/Start.png "Start") - -![Start2](graphics/Start2.png "Start2") - -- Select **MyTinyToDo** Application - -![Upload File](graphics/UploadFile.png "Upload File") - - -- Confirm the upload - -![Confirm Upload](graphics/ConfirmUpload.png "Confirm Upload") - -![Confirm Upload](graphics/ConfirmUpload2.png "Confirm Upload") - -![Uploaded App](graphics/UploadedApp.png "Uploaded App") - -- **Details** can be shown with the icon on the left - -![Show Details](graphics/ShowDetails.png "Show Details") - -![Application Details](graphics/Details.png "Application Details") - -![Application Details](graphics/Details2.png "Application Details") - -- Enter **9990** as the Application Port and -- **tcp://localhost: 375** as the DockerEngineURL - -![Input](graphics/Input.png "Input") - -![Input Information](graphics/Input2.png "Input Information") - -![Loading](graphics/Loading.png "Loading") - -- Click on **Open Application** - -![Open Application](graphics/OpenApplication.png "Open Application") - -![Opened Application](graphics/OpenedApplication.png "Opened Application") - -- Create a **Task** - -![Create Task](graphics/CreateTask.png "Create Task") - -- An instance is created in the **Application Instances** - -![Application Instance](graphics/ApplicationInstance.png "Application Instance") diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index be5239810..785ed24f3 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1,5 +1,3 @@ ---- ---- ![OpenTOSCA](graphics/OpenTOSCALogo.jpg) @@ -7,290 +5,66 @@ ## Table of Contents - +- [Table of Contents](#table-of-contents) - [Introduction](#introduction) -- [Eclipse Installation](#eclipse-installation) - * [Java SE Development Kit (JDK)](#java-se-development-kit-jdk) - * [Eclipse](#eclipse) -- [Set up Eclipse](#set-up-eclipse) - * [Import Code](#import-code) - * [Set Container Target Platform](#set-container-target-platform) +- [Import Code](#import-code) - [How to](#how-to) - * [Create an Eclipse Plug-in project](#create-an-eclipse-plug-in-project) - * [Create / provide a declarative service](#create--provide-a-declarative-service) - * [Consume / use a declarative service](#consume--use-a-declarative-service) - * [OpenTOSCA Target Platforms](#opentosca-target-platforms) - + [Get and add libraries](#get-and-add-libraries) - * [Start container within Eclipse](#start-container-within-eclipse) -- [Common issues] (#common-issues) - * [Resolving dependencies] - + - [Start container](#start-container) + - [Embedded Tomcat](#embedded-tomcat) + - [Deploy to Installed Tomcat](#deploy-to-installed-tomcat) + - [Configure container to run with the OpenTOSCA Docker environment](#configure-container-to-run-with-the-opentosca-docker-environment) ## Introduction -This document helps to setup Eclipse to develop the OpenTosca Container and its user interfaces (UIs). -Thereby, [Section 2](#eclipse-installation) explains the installation of Eclipse, [Section 3](#set-up-eclipse) the setup of eclipse and -[Section 4](#how-to) lists various guides regarding selected topics, e.g. how to create a declarative service. -Some subsections are optional and can be skipped. - -This introduction provides an architectural overview of the OpenTosca container including their -package names, which should help to understand the code better. Figure 1 shows an architectural -overview of the OpenTosca container including the relations of the different components. -Further details can be found in the respective architecture documentation of OpenTOSCA. - -![OpenTosca Container Architecture](graphics/ArchitekturOpenTOSCAContainer-SOLL.png) -**Fig.1: OpenTOSCA Container Architecture Overview** - -Figure 2 shows the architecture of the OpenTosca Container core which provides different shared -capabilities to the other components of the container. - -![OpenTOSCA Container Architecture or Core](graphics/ArchitectureOrCore.png) -**Fig.2: OpenTOSCA Container Architecture or Core** -___ - -## Eclipse Installation - -We use Eclipse as IDE for OpenTosca development. - -### Java SE Development Kit (JDK) - -If not installed already, download and install the most recent Java JDK from: -http://www.oracle.com/technetwork/java/javase/downloads/index.html - -### Eclipse - -If not installed already, download and install the most recent "Eclipse IDE for Java EE Developers" -from http://www.eclipse.org/downloads . -Install Eclipse by unpacking the downloaded archive to a location of your choice. - -*** +This document helps to setup your IDE to develop the OpenTosca Container and its user interfaces (UIs). +In the following we assume that you have already installed your IDE of choice as well as a Java Development Kit of version 8 or higher. +Additionally we assume that you have installed Maven, which we use as buildtool, as well as possibly necessary integration plugins for maven in your IDE. -## Set up Eclipse +The OpenTosca Container is deployed as a web archive, and therefore requires an application server to run. +In theory these application servers are interchangeable, but practice has shown that to be wrong. +As such development is focused on deploying to the popular Apache Tomcat application server. -Start Eclipse and create a new workspace at a location of your choice. +To deploy the Container, you will need to install a version of Tomcat that supports the Java Servlet Specification 3.0, implying the use of Tomcat 7 or later. +It should be immaterial which version of Tomcat specifically you install, so long as it's 7 or later. -### Import Code +Note that during development you can use a specific maven-goal that avoids an installation of Tomcat by starting an embedded Tomcat instance. +This is not feasible for "production" deployments and also comes with a significant time-overhead during development, because it does not allow for "hot-swapping" of code. +As such it's highly recommended to install and set up Tomcat. -IMPORTANT: We recommend opening useful Git views in Eclipse. If not done already, click **Window** -> **Show view** -> **Other...**. In the **Show View** window, type **Git** in the filter box and select **Git Repositories** and **Git Staging**. (Optionally you can add more views). - - 1. Copy the clone link of the Github repository. - 2. In Eclipse click **File** -> **Import...** - 3. Type **Git** in the filter box and select **Projets from Git** - 4. In the following window select **Clone URI** - 5. The copied repository link should be pasted automatically into the corresponding box. If not, paste it into the **URI** text box. - 6. Add your authentication credentials (Optional) - 7. Click **Next** - 8. Select at least the **master** branch and optionally other branches you want to develop. - 9. Click **Next** - 10. Now choose the directory you want to store the project files locally. - 11. Click **Next** and the cloning process starts. This should take a few seconds. - 12. After the download is completed, import the bundles via **File** -> **Import...** -> **Existing maven project** and select the container directory. - - IMPORTANT: In order to resolve all dependencies properly, make sure to install the required Plug-in "Tycho Configurator". The window to install this Plug-in will pop up automatically. - - Hint: To add additional projects from the repository, right click on the imported **container** repository in the **Git Repositories** view and select **Import projects...** - -### Set Container Target Platform - -An Eclipse Target Platform contains libraries (OSGI bundles) that can be used / are available in Eclipse -plug-in projects. The OpenTOSCA Target Platform is contained in the project -"**target-definition**". - -1.Open the file "target-definition.target" in the project - "**target-definition**". -2.In the appearing Target Platform Editor click on "**Set as Target Platform**" in the top right corner - (FIG. 3) -3.After building the workspace there should be no errors left. +--- -![Target Platform Editor](graphics/TargetDefinition.png) -Fig.3: Eclipse Target Platform Editor +## Import Code -After the target platform has been set properly, all bundles in the Project Explorer will appear normal. -This indicates all dependencies have been resolved properly and the workspace is good to go. +The code follows the standard maven conventions, as such importing the root project as a maven project should work out of the box. +Should it not work out of the box, make sure that recursive project discovery is enabled and that you select the pom at the version control root as your starting point. -___ +--- ## How to -### Create an Eclipse Plug-in project - -New Projects that should belong to the Container or the RAP UI must be created as Eclipse Plug-in Project (OSGI Bundle) - -1. In Eclipse go to "**New**" then "**Other...**" in the File menu. -2. Select in the list "**Plug-in Project**" and click on "**Next**". -3. Define as "project name" a name that begins with "**org.opentosca**" (it's our project namespace), - e.g. "**org.opentosca.core.file.service.impl**" (Fig. 4). At "**Target Platform**" select the radio button - "**an OSGi framework**" and in the associated drop down list "**standard**" (Fig. 4). Click on "**Next**". - -![Define Details of new Eclipse plug-in](graphics/DefineDetails.png) -**Fig.4: Define details of new Eclipse plug-in project.** - -4. Define at "**Name**" a human readable name of this project/bundle, e.g. "**Core File Service Implementation**" -5. An Activator is a class that contains the methods "**start**" and "**stop**" that will be executed when the - bundle will be started/stopped in the OSGi framework. Usually an Activator is not necessary. - Thus, deselect the checkbox "**Generate an activator...**" -6. Click on "**Finish**" to create the plug in project. - -### Create / provide a declarative service - -An OSGi service consists of an interface class and one or more implementation classes (e.g. the Core File Service -implementation for a database or Amazon S3) Interface and implementations should be in separate projects/bundles. - -_Interface project:_ - -1. Create a project that contains the interface as plug-in project like it's described in 4.1. - The project name should be "**org.opentosca...service**", e.g. - "**org.opentosca.core.file.service**" -2. In a project "**org.opentosca.core.file.service**" every class should be in a package "**org.opentosca.core.file.service**" - Thus, create a first package with the name of the project. -3. Create in this package the interface class "**IService**", e.g."ICoreFileService". - In this interface you can define the methods the service should provide. -4. Open the bundle manifest "**META-INF/MANIFEST.MF**" (relative to project root). -5. In the appearing Eclipse bundle manifest editor go to the tab "Runtime". -6. At "**Exported Packages**" click on "**Add...**", select the package that includes the interface class and click on "OK". Save the manifest. - -Define the packages as exported makes the included interface class available for implementation classes/projects. - -_Implementation project:_ - -1. Create a project that contains the implementation as plug in project like it's described in 4.1. - The project name should be "**org.openttosca.core.file.service.impl**" (Fig.4) -2. Open the bundle manifest "**META.INF/MANIFEST.MF**" (relative to project root) -3. In the appearing Eclipse bundle manifest editor go to the tab "**Dependencies**" -4. At "**Imported Packages**" click on "**Add...**", select the package in the interface project that includes - the interface class and click on "OK". Save the manifest. -5. In the project “org.opentosca.core.file.servie.impl” every class should be in the package “org.opentosca.core.file.service.impl” Thus, create a package with the name of the project. -6. In this package, create the implementation class “**ServiceImpl**.java", e.g. "CoreFileServiceImpl.java" -7. Right click on the project root and choose in the appearing context menu "**New**" then "**Folder**". -8. Define as name of the new folder "**OSGI-INF**". -9. Right click on the "**OSGI-INF**" folder and choose in the appearing context menu "**New**" then "**Other...**" -10. Open "**Plug-in development**" and select "**Component Definition**". Click on "**Next**" -11. Define as "File name" the name of the implementation class with the ending "**_component**", e.g. "**CoreFileServiceImpl_component.xml**" (Fig. 5) - -![Create Component Definition](graphics/CreateComponentDefinition.png) -**Fig.5: Create a new Component Definition.** - -12. Define in "**Class**" the fully qualified name of the implementation class, e.g. "**org.opentosca.core.file.service.impl.CoreFileServiceImpl**" - and in "**Name**" the same as in "**Class**" (Fig. 5). Finally click on "**Finish**" to create the component XML. -13. The created component XML should be automatically opened in the Eclipse component editor. - If not, manually click on the file. -14. In the component editor go to the tab "**Services**" and click at "**Provided Services**" on "**Add...**" -15. In the appearing window type in the class name of the interface project, e.g. "**ICoreFileService**" and click on "**OK**" - to publish the service interface. Save the manifest. - -Fig. 6 shows the correct project structure of the Core File Service used as example in this chapter. - -![InterfaceImplementationStructure](graphics/InterfaceImplementationStructure.png) - -**Fig. 6: Service interface and implementation project structure. The Core File Services provides the methods “getCSAR” and “storeCSAR”. Its component XML resides in the folder “OSGI-INF” in the implementation project.** - -### Consume / use a declarative service - -A service can be only consumed in a plug-in project. - -1. Create a new "Plug-in Project" called "**org.opentosca.core.file.service.consumer**" -2. Open the bundle manifest "**META-INF/MANIFEST.MF**" (relative to project root) of the plug-in - project that should consume a service. -3. In the appearing Eclipse bundle manifest editor go to the tab "**Dependencies**" -4. At "**Imported Packages**" click on "**Add...**", select the package that includes the interface of the needed service an click on "**OK**". - Save the manifest. -5. Right click in the root of the project and choose in the appearing context menu "**New**" then "**Folder**" -6. Define as name of the new folder "**OSGI-INF**". -7. Right click on the "**OSGI-INF**" folder and choose in the context menu "**New**" then "**Other...**" -8. Open "**Plug-in development**" and select "**Component Definition**". Click on "**Next**" -9. Define as "File name" the name of the class that needs the service with the ending "**_component**", - e.g. "**MyClass_component.xml**" -10. Define in "**Class**" the fully qualified name of the class that needs the service, - e.g. "**org.opentosca.util.myservice.impl.MyServiceImpl**" and in "**Name**" the same as in "**Class**". - Finally click on "**Finish**" to creat the component XML- -11. The created component XML should be automatically openend in the Eclipse component editor. - If not, manually double click on the file. -12. In the component editor go to the tab "**Services**" and click at "**Referenced Services**" on "**Add...**" -13. In the appearing window type in the interface class name of the needed service, e.g. "**ICoreFileService**" - and click on "**OK**". -14. Select the new entry in the "**Referenced services**" list and click on "**Edit...**" -15. Define at "**Bind**" a name for the method that binds the service and at "**Unbind**" a name for the - method that unbinds the service, e.g. "**bindCoreFileService**" and "**unbindCoreFileService**". - Click on "**OK**" and save the XML. -16. Create the service variable (e.g. "**coreFileService**") and the bind and unbind methods in the class - that needs the service as shown in Lst. 1 - - - -```java -public class MyServiceImpl{ - - private ICoreFileService coreFileService; - - public void process() { - File csarFile = new File("E:\\SuperApp.csar"); - coreFileService.storeCSAR(csarFile); - } - - public void bindCoreFileService(ICoreFileService coreFileService){ - if(coreFileService == null){ - System.out.println("Can't bind Core File Service."); - } - else{ - this.coreFileService = coreFileService; - System.out.println("Core File Service bound."); - } - } - - public void unbindCoreFileService(ICoreFileService coreFileService){ - this.coreFileService = null; - System.out.println("Core File Service unbound."); - } -} -``` - -**Lst. 1 "MyServiceImpl" consumes the Core File Service.** - -You can now use the service by calling the desired method(s) on the service varaible. -In Lst. 1 coreFileService.storeCSAR(csarFile) will be called in method process. - -### OpenTOSCA Target Platforms - -#### Get and add libraries - -If you need a package of a library (bundle) in a project that belongs to the Container ans it's not already available, -you must add the bundle to the Target Platform project of the Container -"**target-definition**". - -A bundle is a JAR file that contains a bundle manifest at "**META-INF\MANIFEST.MF**". -Get at first the current version of the library directly from the library website. Check in the downloaded JAR File if it -contains the bundle manifest file. Besides, the manifest must include the attribute Bundle-SymbolicName, -e.g. Bundle-SymbolicName: jcl.over.slf4j - -Otherwise the JAR file is not a bundle. - -If you can't get a bundle directly from the library website you can look in a bundle repository. +### Start container -Eclipse Orbit Repository http://download.eclipse.org/tools/orbit/downloads -Spring Repository http://ebr.springsource.com +The container can be started in basically two different ways. +Either you use the embedded tomcat goal from maven to directly run the container, or you deploy the web archive created by maven to an installed Tomcat instance. -Also you can look in the directory "**plugins**" in your Eclipse installation -(Eclipse is based in OSGi) if the necessary bundle is available. +#### Embedded Tomcat -If you found the bundle you can add it to the Target Platform. +To run the Container on the embedded tomcat, you want to execute the maven goal `tomcat7:run` in the `org.opentosca.container.war` project. +This can be accomplished by invoking the command `mvn tomcat7:run -pl :org.opentosca.container.war` or by configuring your IDE to perform the equivalent action. -1. Open the project "**target-definition**" in the package explorer -2. Move the bundle JAR file in the desired directory (e.g. "**Apache**") in the project. -3. Set the container again as it's described in 3.4. +#### Deploy to Installed Tomcat -### Start container within Eclipse +To deploy the Container to an installed Tomcat, you will need to register your local Tomcat instance with your IDE. +This process differs between IDEs, but *in general* you can configure the available application servers in the Settings panel. -The container can be started within Eclipse by navigating to the **org.opentosca.container.product** folder. -In this folder open the file named **org.opentosca.container.product**. +When setting up the Tomcat instance, remember to make sure that the HTTP/1.1 port is set to `1337`. +Do also make sure that the context path of the war you deploy is set to `/` to avoid needing special configuration for the OpenTosca UI. +It has been beneficial to set up a fully packed war deployment for troubleshooting before attempting to set up an "exploded war" deployment. -After opening this file you can click the green launch button (Fig. 7) on the top right of the editor window to start the container. -![ProductFile](graphics/ContainerProductFile.png) -**Fig. 7** ### Configure container to run with the OpenTOSCA Docker environment To run the container together with the OpenTOSCA Docker setup, remove the container configuration from the `docker-compose.yml` and `docker-compose.override.yml` files. -Afterwards, you need to configure the eclipse target platform to use the provided `config.ini` file instead of generating it. -Thererfore, go to the `Configuration` tab in the `org.opentosca.container.product/org.opentosca.container.product` file and select paste `/org.opentosca.container.product/config.ini` into the *File* textbox. -Then, replace the IP address in `org.opentosca.container.hostname=129.69.214.56` with your IP address +Afterwards, you need to configure the application properties to use your public IP as the `org.opentosca.container.hostname` address. +Find `org.opentosca.container.core/src/main/resources/application.properties` and replace the IP address with your external IP address, typically starting with `129.69.` diff --git a/docs/PITCHME.md b/docs/PITCHME.md index 0f15579d4..dea2f7562 100644 --- a/docs/PITCHME.md +++ b/docs/PITCHME.md @@ -3,7 +3,7 @@ Documentation Plan Builder The OpenTOSCA-Container uses the Tosca Runtime to generate build and termination plans, in BPEL format, out of given CSAR-Files. These BPEL-plans run through given procedures to perform activities. -![CSARtoBPEL](graphics/CSARtoBPEL.png) +![CSARtoBPEL](graphics/pitchme/CSARtoBPEL.png) The following documentation describes the build and termination plans and will give you a brief overview over the used plugins. @@ -14,7 +14,7 @@ Therefor the plan contains single components and instances. The instances define build sequences of components. In the following example, the structure of a Cloud-Service, and his belonging BuildPlan, is shown in a tree structure. -![BuildTree](graphics/Build-Tree.png) +![BuildTree](graphics/pitchme/Build-Tree.png) The graphic shows a requested structure of the Cloud-Service. Instances are represented by edges and components by nodes. @@ -47,7 +47,7 @@ In general, the advantage of build and termination plans is the possibility to e In the end, the plans are available as a BPEL-file. -![VMBPELActivity](graphics/startStopVMmitBPELFlow.png) +![VMBPELActivity](graphics/pitchme/startStopVMmitBPELFlow.png) Every component require different activities, e.g. for start-up or shutdown. Each activity is described as a BPEL flow, where also the runtime scope of the activity is defined. @@ -63,7 +63,7 @@ Skeleton Completion is part of the PlanBuilders' plugin system. It prepares (completes) a given skeleton for the execution in the OpenTOSCA Runtime. The structure of the PlugIn is build as follows: -![ProvisioningTerminals](graphics/ProvisioningTerminals.png) +![ProvisioningTerminals](graphics/pitchme/ProvisioningTerminals.png) The bool variables describes which templates can be used inside the plugin. If the bool variable shows that the template cannot be handled, an ongoing treatment is impossible. @@ -74,7 +74,7 @@ The use of a template is described in the handle method. Besides the skeleton completion, the lifecycle-plugin-system can also process node templates. The only limitation is, that the system only deals with node templates of the following form as input: -![NodeTemplateForm](graphics/NodeTemplate_Form.png) +![NodeTemplateForm](graphics/pitchme/NodeTemplate_Form.png) The PlugIn accepts operations in a fixed sequence but permits predefined skips. The node templates have to follow this sequence: @@ -86,7 +86,7 @@ This way, the corresponding code can be generated by entering a node type and it According to the definition of the node types methods an appropriate function call is made afterwards. -![NodeTypeImplementation](graphics/NT.NodeTypeImplementation.png) +![NodeTypeImplementation](graphics/pitchme/NT.NodeTypeImplementation.png) The sequence described above proceeds in the provisioning phase of the lifecycle-system. Operations can be webservices, code or typed objects. @@ -132,23 +132,23 @@ The plugins mentioned above pass different phases in their runtime: TopologyContext Plan Completion -![UbuntuPlugIn](graphics/Ubuntu.png) +![UbuntuPlugIn](graphics/pitchme/Ubuntu.png) The cloud provider checks whether Ubuntu is active and then boots the VM within the Ubuntu scope. ***DockerContainer*** -![DockerContainer](graphics/DockerContainer.png) +![DockerContainer](graphics/pitchme/DockerContainer.png) ***ConnectsTo-Type-Plug-In*** Topology Context -![ConnectPlugInTopology](graphics/connectPlugInTopology.png) +![ConnectPlugInTopology](graphics/pitchme/connectPlugInTopology.png) PlanCompletion -![ConnectPlugInTopology](graphics/connectPlugInPlanCompletion.png) +![ConnectPlugInTopology](graphics/pitchme/connectPlugInPlanCompletion.png) The connectTo plugin handles the relations instead of the nodes. This results in a synchronization of the individual services. @@ -158,6 +158,6 @@ However, as soon as the Java code contains some simple if-else-clauses, automati ***Invoker-Plug-In*** -![InvokerPlugIn](graphics/Invoker.png) +![InvokerPlugIn](graphics/pitchme/Invoker.png) The invoker plugin constitutes a special lifecycle, which is invoked independently from previous plugins. diff --git a/docs/adr/0000-use-architectural-decision-records.md b/docs/adr/0000-use-architectural-decision-records.md new file mode 100644 index 000000000..aeeb9726e --- /dev/null +++ b/docs/adr/0000-use-architectural-decision-records.md @@ -0,0 +1,22 @@ +# Use Markdown Architectural Decision Records + +## Context and Problem Statement + +We want to record architectural decisions made in this project. +Which format and structure should these records follow? + +## Considered Options + +* Follow winery project standard +* Deviate from winery project standard by using a different structure + +## Decision Outcome + +Follow winery project standard, using ["MADR 2.1.0"][MADR] + +* See the related reasoning outlined in the [winery adr 0000][winery-adr] +* Additional consistency across the projects of the OpenTOSCA ecosystem is highly beneficial + + [MADR]: https://adr.github.io/madr/ + [winery-adr]: https://github.com/eclipse/winery/tree/master/docs/adr/0000-use-architectural-decision-records.md + diff --git a/docs/adr/0001-use-maven.md b/docs/adr/0001-use-maven.md new file mode 100644 index 000000000..61aee101a --- /dev/null +++ b/docs/adr/0001-use-maven.md @@ -0,0 +1,50 @@ +# Use maven as a buildtool and dependency manager + +* Status: implemented + +## Context and Problem Statement + +To enable portability and reproducibility of building the container application, a buildtool is of utmost importance. +It simplifies the buildprocess and should preferrably allow a minimal configuration effort for IDEs. + +## Decision Drivers + +* Core Concern is management of building the container, preferrably in a single command invocation +* Support for dependency management is optional, but highly appreciated +* The tool should also support deployment of the finished web application to an application server +* Cross Platform tooling, Automation and support for Running a Test suite are also necessary + +## Considered Options + +* Maven +* Gradle +* Ant + +## Decision Outcome + +Maven was chosen both for it's maturity and integration with established IDEs. +It also was previously used to automate the container build when the container was still deployed as an OSGI application. +Additionally maven dependencies are the de-facto standard distribution mechanism in the java ecosystem. + +## Pros and Cons of the Options + +### Maven + +* Mature and tested ecosystem +* De-Facto standard for dependency distribution +* Existing maven structure for previous incarnation of container allows code reuse +* Strong support for testing, automation and known cross-platform usability + +### Gradle + +* Not quite as mature ecosystem as maven +* Dependency management is possible, but doesn't open new avenues over maven +* Cross-Platform compatibility for gradle is present, but often requires additional support through gradle-wrapper +* Support for testing and automation is present + +### Ant + +* Ecosystem is mature, but configuration over convention paradigm +* No builtin support for dependency management +* Cross-Platform compatibility is not builtin +* Support for testing is incomplete, automation with current CI providers may require additional support diff --git a/docs/adr/0002-use-spring-dependency-incjection.md b/docs/adr/0002-use-spring-dependency-incjection.md new file mode 100644 index 000000000..a4fc15f57 --- /dev/null +++ b/docs/adr/0002-use-spring-dependency-incjection.md @@ -0,0 +1,42 @@ +# Use Spring for Dependency Injection and discovery of plugins + +* Status: accepted + +## Context and Problem Statement + +To facilitate testing, a clean, object oriented architecture as well as the plugin systems for various components a configurable Inversion of Control (IOC) container is required. +This container is responsible for plugin discovery, as well as injecting services required by the API to serve it's "external" customers. + +## Decision Drivers + +* Support for a plugin system that can discover additional components not originally compiled into the deployed WAR +* Support for minimal configuration, allowing easy modification and discovery by convention + +## Considered Options + +* Spring +* Guice + +## Decision Outcome + +The chosen IoC container is Spring, because it supports plugin discovery at minimal configuration and has easy support for servlet-based injection with `spring-mvc` and `spring-web`. + +### Negative consequences + +The Plugins loaded cannot be adjusted at runtime. +At time of writing, no such capability is required or planned. + +## Pros and Cons + +### Spring + +* Well-Maintained and diverse IoC container supporting various configuration mechanisms +* No support for changes in registration during runtime +* Support for `javax.Inject` annotations as well as injection-site adaption through custom annotations +* No direct support for servlet-based injection, but available as `spring-web` + +### Guice + +* No support for XML-Based configuration +* No direct support for servlet-based injection +* At time of writing seems to be discontinued by original maintainer Google diff --git a/docs/adr/requirements.md b/docs/adr/requirements.md new file mode 100644 index 000000000..45e53d98b --- /dev/null +++ b/docs/adr/requirements.md @@ -0,0 +1,16 @@ +# Preexisting requirements + +The following is a non-exhaustive list of requirements that serve as basis for architectural decisions. +Requirements that are not imposed by the problem domain (of provisioning a TOSCA CSAR) are marked as "pragmatic requirement" + +- Availability as a REST API + - Deploy as Web Archive to a Java application server (pragmatic requirement) + - Use Tomcat as application Server (pragmatic requirement) +- Persistent Storage capabilities for CSARs as well as metadata surrounding deployment + - Use of the already existing support for persistent storage of CSARs implemented in OpenTOSCA Winery +- Support for existing "Planbuilder" service capabilities +- Support for existing Application Bus code and infrastructure +- Support for existing Management Bus code and infrastructure +- Support for Plugin-Based extension of the capabilities implemented by the Container application + - Specifically this refers to supporting the existing plugin systems of Planbuilder, Plan Engine as well as Management and Application Bus +- … \ No newline at end of file diff --git a/docs/adr/template.md b/docs/adr/template.md new file mode 100644 index 000000000..db0209fd5 --- /dev/null +++ b/docs/adr/template.md @@ -0,0 +1,47 @@ +# [short title of solved problem and solution] + +* Status: [accepted | superseeded by [ADR-0005](0005-example.md) | deprecated | …] + +Technical Story: [description | ticket/issue URL] + +## Context and Problem Statement + +[Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.] + +## Decision Drivers + +* [driver 1, e.g., a force, facing concern, …] +* [driver 2, e.g., a force, facing concern, …] +* … + +## Considered Options + +* [option 1] +* [option 2] +* [option 3] +* … + +## Decision Outcome + +Chosen option: "[option 1]", because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)]. + +### Positive Consequences + +* [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …] +* … + +### Negative consequences + +* [e.g., compromising quality attribute, follow-up decisions required, …] +* … + +## Pros and Cons of the Options + +### [option 1] + +[example | description | pointer to more information | …] + +* Good, because [argument a] +* Good, because [argument b] +* Bad, because [argument c] +* … diff --git a/docs/ApplicationBus.md b/docs/components/ApplicationBus.md similarity index 92% rename from docs/ApplicationBus.md rename to docs/components/ApplicationBus.md index 715c0430b..339a71277 100644 --- a/docs/ApplicationBus.md +++ b/docs/components/ApplicationBus.md @@ -38,7 +38,7 @@ Which is why the Application Bus engine is connected to the necessary components The Instance Data Service is used to query for and save instance data. IP addresses of deployed application components can be stored there, this makes them available to other OpenTOSCA components, for example the Application Bus. -![ApplicationBusArchitektur](graphics/ApplicationBusArchitektur.png) +![ApplicationBusArchitektur](graphics/ApplicationBus/ApplicationBusArchitektur.png) **Application Bus Architecture** @@ -55,7 +55,7 @@ This is however not obligatory. The API utilized to use the Application Bus does not have to be identical with the plugin used to invoke the operation of an application. One Application can call on the Application Bus with REST API, while the invocation of an operation from a different application can be via SOAP plugin. -![KommunikationsdiagrammApplicationBus](graphics/KommunikationsdiagrammApplicationBus.png) +![KommunikationsdiagrammApplicationBus](graphics/ApplicationBus/KommunikationsdiagrammApplicationBus.png) **Communication diagram of the Application Bus** @@ -63,7 +63,7 @@ Pictured here is the Application Buses structure with a communication diagram. Shown is the central character of the Application Bus engine, as it is needed to communicate with the necessary components of the OpenTOSCA container as well as its role as link between different APIs and plugins. An example usage of the Application Bus by an application (A), as well as the invocation of an application (B) through the Application Bus plugin is also depicted. -![OpenTOSCAArchitekturApplicationBus](graphics/OpenTOSCAArchitekturApplicationBus.png) +![OpenTOSCAArchitekturApplicationBus](graphics/ApplicationBus/OpenTOSCAArchitekturApplicationBus.png) **OpenTOSCA Architecture with Application Bus** @@ -79,7 +79,7 @@ This entails taking a closer look at the steps necessary to implement an applica This scenario uses a [Application Bus SOAP/HTTP API](#application-bus-soaphttp-api) and a [Application Bus JSON/HTTP Plugin](#application-bus-jsonhttp-plugin) as examples for an Application Bus API and plugin. The procedure stays comparable with the usage of different APIs and plugins. -![Beispielszenario](graphics/Beispielszenario.png) +![Beispielszenario](graphics/ApplicationBus/Beispielszenario.png) **Example scenario** This depicts the scenario used to explain the usage and functionality of the Application Bus. @@ -104,7 +104,7 @@ Prior to deploying an application with the OpenTOSCA container it has to be impl The [Application Bus Stub Generator](#application-bus-stub-generator) can generate the code skeletons of associated methods for an application that was modeled with TOSCA. The generation of TOSCA elements from an existing application has been planed for but is not yet implemented. -![GenerierungCodeSkelett](graphics/GenerierungCodeSkelett.png) +![GenerierungCodeSkelett](graphics/ApplicationBus/GenerierungCodeSkelett.png) **Generating a code skeleton from TOSCA** This is an example of modeling the application *TempSensors* with TOSCA. @@ -197,7 +197,7 @@ An operational stub of the operation can be generated from the TOSCA definition This stub is already programmed against the Application Bus API. Now the operation getTemp can be used within the application HausSteuerung as if it were available locally and the communication with the Application Bus is hidden with a separate communication layer. -![StubsKommunikationApplicationBus](graphics/StubsKommunkationApplicationBus.png) +![StubsKommunikationApplicationBus](graphics/ApplicationBus/StubsKommunkationApplicationBus.png) ** Usage of a generated stub to communicate with the Application Bus** This shows a generated stub. @@ -234,7 +234,7 @@ The ID can be either in the form of the *NodeInstanceID* or the *ServiceInstance This makes the definite identification by the Application Bus possible. For a more in depth look into the usage of instance IDs by the Application Bus see below. -![SetupApplicationBusAnwendung](graphics/SetupApplicationBusAnwendung.png) +![SetupApplicationBusAnwendung](graphics/ApplicationBus/SetupApplicationBusAnwendung.png) **Setup of an application that uses the Application Bus** @@ -242,7 +242,7 @@ For a more in depth look into the usage of instance IDs by the Application Bus s The example of the HausSteuerung application and the Application Bus SOAP/HTTP API is used to demonstrate communication between application and Application Bus. Because a unified protocol is used for communication, the process is comparable between different Application Bus APIs. -![KommunikationAnwendungApplicationBus](graphics/KommunikationAnwendungApplicationBus.png) +![KommunikationAnwendungApplicationBus](graphics/ApplicationBus/KommunikationAnwendungApplicationBus.png) **Communication of an application with the Application Bus** After an application has been deployed with OpenTOSCA and configured it can communicate with the Application Bus. @@ -373,7 +373,7 @@ This is what a result request looks like. How does the Application Bus communicate with a to be invoked application exemplified with the use of the TempSensors application from the example scenario. The Plugin matching the Application Bus Proxy that is used is the Application Bus JSON/HTTP Plugin. -![KommunikationApplicationBusAnwendung](graphics/KommunikationApplicationBusAnwendung.png) +![KommunikationApplicationBusAnwendung](graphics/ApplicationBus/KommunikationApplicationBusAnwendung.png) **Communication between Application Bus and application** @@ -488,31 +488,30 @@ To realized the API the Camel *Restlet* component is used and the API operates o To invoke an operation of a different application the parameters have to be formatted as content type application/json and sent as HTTP-POST method, to */OATBService/v1/appInvoker*. ```java -1 String ENDPOINT = "restlet:http://0.0.0.0:8083/OTABService/v1/appInvoker"; +String ENDPOINT = "restlet:http://0.0.0.0:8083/OTABService/v1/appInvoker"; -2 from(ENDPOINT + "?restletMethods=post") -3 .process(invocationRequestProcessor) -4 .to(TO_APP_BUS_ENDPOINT) -5 .process(exceptionProcessor); +from(ENDPOINT + "?restletMethods=post") + .process(invocationRequestProcessor) + .to(TO_APP_BUS_ENDPOINT) + .process(exceptionProcessor); -6 from(ENDPOINT + "/activeRequests/{id}?restletMethods=get") -7 .process(isFinishedRequestProcessor) -8 .to(TO_APP_BUS_ENDPOINT) -9 .process(isFinishedResponseProcessor); +from(ENDPOINT + "/activeRequests/{id}?restletMethods=get") + .process(isFinishedRequestProcessor) + .to(TO_APP_BUS_ENDPOINT) + .process(isFinishedResponseProcessor); -10 from(ENDPOINT + "/activeRequests/{id}/response?restletMethods=get") -11 .process(getResultRequestProcessor) -12 .to(TO_APP_BUS_ENDPOINT) -13 .process(getResultResponseProcessor); +from(ENDPOINT + "/activeRequests/{id}/response?restletMethods=get") + .process(getResultRequestProcessor) + .to(TO_APP_BUS_ENDPOINT) + .process(getResultResponseProcessor); -14 from(TO_APP_BUS_ENDPOINT) -15 .choice().when(APP_BUS_ENDPOINT_EXISTS) -16 .recipientList(APP_BUS_ENDPOINT) -17 .endChoice().otherwise().to("direct:handleException"); - -18 from("direct:handleException").throwException( -19 new ApplicationBusInternalException("The Application Bus is not running.")); +from(TO_APP_BUS_ENDPOINT) + .choice().when(APP_BUS_ENDPOINT_EXISTS) + .recipientList(APP_BUS_ENDPOINT) + .endChoice().otherwise().to("direct:handleException"); +from("direct:handleException").throwException( + new ApplicationBusInternalException("The Application Bus is not running.")); ``` **Routes of the Application Bus JSON/HTTP API** @@ -525,18 +524,17 @@ If the processing has finished an answer with the HTTP status code 303 (see othe If not an answer with the HTTP status code 200 (ok) and content *{\"status\": \"PENDING\"}* is returned. ```json -1 { -2 "invocation-information": { -3 "serviceInstanceID": 12, -4 "nodeTemplateID": "TempSensorsAppTemplate", -5 "interface": "TempSensors", -6 "operation": "getTemp" -7 }, -8 "params": { -9 "sensorID": "HouseFront" -10 } -11 } - +{ + "invocation-information": { + "serviceInstanceID": 12, + "nodeTemplateID": "TempSensorsAppTemplate", + "interface": "TempSensors", + "operation": "getTemp" + }, + "params": { + "sensorID": "HouseFront" + } +} ``` **Request to the Application Bus JSON/HTTP API to invoke an operation** @@ -567,8 +565,7 @@ POST /TempSensors/Operations/getTemp { "sensorID" : "HouseFront" - } - +} ``` **Request to the Application Bus REST/HTTP API to invoke an operation with specification of the ServiceInstanceID** @@ -580,8 +577,7 @@ POST /NodeInstances/42/ApplicationInterfaces/TempSensors/Operations/getTemp { "sensorID" : "HouseFront" - } - +} ``` **Request to the Application Bus REST/HTTP API to invoke an operation with a specified NodeInstanceID** @@ -605,7 +601,7 @@ There the process for the transmitted *RequestID* is checked for completion and If the result of an invocation is requested the exchange message is routed to the *getResultProcessor*. There the result filed for the specified RequestID, or in case of an error an exception is returned. -![RoutingApplicationBusEngine](graphics/RoutingApplicationBusEngine.png) +![RoutingApplicationBusEngine](graphics/ApplicationBus/RoutingApplicationBusEngine.png) **Routing within the Application Bus Engine** The invocation of a method from an another application is much more complex. @@ -623,7 +619,7 @@ After all information required for the invocation has been gathered the endpoint More on the processing within the Application Bus Plugin later. Once the plugin has completed the method invocation and returned a result, the result is stored together with the RequestID and the processing status in the polling queue is set to *true*. -![BearbeitungsablaufInvokeProcessor](graphics/BearbeitungsablaufInvokeProcessor.png) +![BearbeitungsablaufInvokeProcessor](graphics/ApplicationBus/BearbeitungsablaufInvokeProcessor.png) **Processing sequence within the Invoke-Processor** After the information has been read from the headers of the exchange message the instance data service is used to determine the specified *NodeInstance* and corresponding *NodeType*. @@ -640,20 +636,18 @@ An important requirement is the adding of plugins to expand the standards and pr This is done with the following plugin system. ```java -1 public interface IApplicationBusPluginService { -2 -3 /** -4 * @return supported InvocationTypes of this plugin. -5 */ -6 public List getSupportedInvocationTypes(); -7 -8 /** -9 * @return the routing endpoint of this plugin. -10 */ -11 public String getRoutingEndpoint(); -12 -13 } +public interface IApplicationBusPluginService { + + /** + * @return supported InvocationTypes of this plugin. + */ + public List getSupportedInvocationTypes(); + /** + * @return the routing endpoint of this plugin. + */ + public String getRoutingEndpoint(); +} ``` **Application Bus Plugin Interface** @@ -693,28 +687,27 @@ The correct endpoint is read from the previously set header. If the answer contains the intended status code (202) the polling address transmitted by the location header is set as the new endpoint and forwarded to the polling sub route. Otherwise the exception handling comes into effect. -```json -1 from(ENDPOINT) -2 .process(requestProcessor) -3 .setHeader(Exchange.HTTP_METHOD, constant("POST")) -4 .setHeader(Exchange.CONTENT_TYPE, constant("application/json")) -5 .setHeader(Exchange.HTTP_URI, INVOKE_ENDPOINT).to("http://dummyhost") -6 .choice() -7 .when(header(Exchange.HTTP_RESPONSE_CODE).isEqualTo(202)) -8 .setHeader(Exchange.HTTP_URI, simple("${header.Location}")) -9 .to("direct:polling") -10 .endChoice() -11 .otherwise().to("direct:handleException"); - -12 from("direct:polling") -13 .setHeader(Exchange.HTTP_METHOD, constant("GET")).to("http://dummyhost") -14 .choice() -15 .when(PENDING).delay(5000).to("direct:polling") -16 .endChoice() -17 .when(RESULT_RECEIVED).process(responseProcessor) -18 .endChoice() -19 .otherwise().to("direct:handleException"); - +```java +from(ENDPOINT) + .process(requestProcessor) + .setHeader(Exchange.HTTP_METHOD, constant("POST")) + .setHeader(Exchange.CONTENT_TYPE, constant("application/json")) + .setHeader(Exchange.HTTP_URI, INVOKE_ENDPOINT).to("http://dummyhost") + .choice() + .when(header(Exchange.HTTP_RESPONSE_CODE).isEqualTo(202)) + .setHeader(Exchange.HTTP_URI, simple("${header.Location}")) + .to("direct:polling") + .endChoice() + .otherwise().to("direct:handleException"); + +from("direct:polling") + .setHeader(Exchange.HTTP_METHOD, constant("GET")).to("http://dummyhost") + .choice() + .when(PENDING).delay(5000).to("direct:polling") + .endChoice() + .when(RESULT_RECEIVED).process(responseProcessor) + .endChoice() + .otherwise().to("direct:handleException"); ``` ** Route of the Application Bus JSON/HTTP Plugin ** @@ -736,7 +729,7 @@ The RequestID can then be used to request the result. Shown here is the functionality of the Application Bus Proxy as communication partner of the Application Bus as well as the usage of the transferred information to determine the method to be called with reflection. How the polling and requesting of results works in the interface has been covered above. -![FunktionsweiseApplicationBusProxy](graphics/FunktionsweiseApplicationBusProxy.png) +![FunktionsweiseApplicationBusProxy](graphics/ApplicationBus/FunktionsweiseApplicationBusProxy.png) **Functionality of the Application Bus Proxys** @@ -754,6 +747,6 @@ The compiler component compiles the generated .java classes. As a last step all classes of a NodeTemplate are combined as a .jar and stored at the previously established location. The name of the NodeTemplate is used as the .jar name. -![WorkflowApplicationBusStubGenerators](graphics/WorkflowApplicationBusStubGenerators.png) +![WorkflowApplicationBusStubGenerators](graphics/ApplicationBus/WorkflowApplicationBusStubGenerators.png) -**Workflow of the Application Bus Stub Generators** \ No newline at end of file +**Workflow of the Application Bus Stub Generators** diff --git a/docs/PlanBuilder.md b/docs/components/PlanBuilder.md similarity index 97% rename from docs/PlanBuilder.md rename to docs/components/PlanBuilder.md index 51b140257..4f0aaf897 100644 --- a/docs/PlanBuilder.md +++ b/docs/components/PlanBuilder.md @@ -11,13 +11,13 @@ The abstract control flow is then transformed into a language-dependent Skeleton After the creation of a skeleton, its placeholders are then replaced by executable code from the appropriate plugins, that either can understand a Node Type or Relationship Type and generate the needed code (See Type Plugins in Overview figure) or the types implement the expected Lifecycle operations, such as install, start and stop (See Lifecycle Plugins in Overview figure). When the creation of code and replacement of placeholder activities is finished, the now executable plan is injected into the original CSAR for further processing and usage. -![Plan Builder Overview](graphics/overview.png) +![Plan Builder Overview](graphics/PlanBuilder/overview.png) ## Build Plans A Build Plan is a Plan that is able to install, deploy and provision the modelled Node- and Relationship Templates of a given Topology Template (See Figure Build Plan Generation). The Plan Builder is able to generate these like described in the following: -![Build Plan Generation](graphics/buildplans.png) +![Build Plan Generation](graphics/PlanBuilder/buildplans.png) ##### 1. Build Plan Abstract Control Flow Generation The abstract control flow of a Build Plan contains for each Node Template and Relationship Template an abstract provisioning activity (See Abstract Control Flow). @@ -39,7 +39,7 @@ On the other hand, a lifecycle plugin doesn't understand the Node- or Relationsh A Termination Plan is a Plan that is able to deinstall, undeploy and deprovisioning the modelled Node- and Relationship Template of a given Topology Template (See Figure Termination Plan Generation). The Plan Builder is able to generate these like described in the following: -![Termination Plan Generation](graphics/terminationplans.png) +![Termination Plan Generation](graphics/PlanBuilder/terminationplans.png) ##### 1. Termination Plan Abstract Control Flow Generation The abstract control flow of a Termination Plan contains for each Node- and Relationship Template and abstract termination activity. The order of these activities is based on the Relationship Template's type between the Node Template, but in reverse order of a Build Plan (See Build Plans section). For example, the DBMS is remove before the VM is stopped as the DBMS is **hostedOn** the VM. @@ -56,7 +56,7 @@ E.g., in the Scale-Out Plan figure the goal is to create a new instance of the A The application is a member of a region and the Nodes that are connected to such a region must be annotated with a so-called Selection Strategy, that specifies with which algorithm an instance selection shall occur. The Plan Builder is able to generate Scale-Out Plans from Topology Templates with these regions as described in the following: -![Scale-Out Plan Generation](graphics/scaleoutplans.png) +![Scale-Out Plan Generation](graphics/PlanBuilder/PlanBuilder/scaleoutplans.png) ##### 1. Scale-Out Plan Abstract Control Flow Generation The Abstract Control Flow of Scale-Out Plan is generated based on the Topology Templates structure and the defined region. diff --git a/docs/ServiceInvoker.md b/docs/components/ServiceInvoker.md similarity index 85% rename from docs/ServiceInvoker.md rename to docs/components/ServiceInvoker.md index cd0eda102..711d70f74 100644 --- a/docs/ServiceInvoker.md +++ b/docs/components/ServiceInvoker.md @@ -7,7 +7,7 @@ - [Implementation](#implementation) * [Service Invocation Enum](#service-invocation-enum) * [Service Invocation SOAP API](#service-invocation-soap-api) - * [Service Invocation OSGi event API](#service-invocation-osgi-event-api) + * [Service Invocation Java API](#service-invocation-osgi-event-api) * [Service Invocation Engine](#service-invocation-engine) * [Service Invocation Plugin Interface](#service-invocation-plugin-interface) * [Service Invocation SOAP/HTTP plugin](#service-invocation-soaphttp-plugin) @@ -24,7 +24,7 @@ The main component of the service invocation interface is the SI Engine (see [SI It forms the central unit of the service invocation interface with its connection to the other important components within the OpenTOSCA container. Furthermore the Service Invocation APIs (see [SI SOAP API](#service-invocation-soap-api) and [SI OSGi event API](#service-invocation-osgi-event-api)) are an important part of the service invocation interface. -![Architektur des OpenTOSCA Containers mit Service Invocation Schnittstelle](graphics/ArchitectureOpentoscaContainerWithServiceInvocationInterface.png) +![Architektur des OpenTOSCA Containers mit Service Invocation Schnittstelle](graphics/ServiceInvoker/ArchitectureOpentoscaContainerWithServiceInvocationInterface.png) Figure 1: Architecture of the OpenTOSCA container with service invocation interface @@ -48,7 +48,7 @@ The exact processing process is explained in more detail in the following chapte In this chapter the concept of the service invocation interface and the options of the concept are explained. -![Konzeptioneller Aufbau der Komponenten](graphics/ConceptualStructureOfComponents.png) +![Konzeptioneller Aufbau der Komponenten](graphics/ServiceInvoker/ConceptualStructureOfComponents.png) Figure 2: Conceptual structure of the components @@ -56,7 +56,7 @@ Figure 2 shows that the SI engine constitutes the central component within the s It enables the communication with existing and required components of the OpenTOSCA container (TOSCA engine, endpoint service, instance data service) and provides the connection between the service invocation API and the different SI plugins, it therefore takes on the routing of messages within the service invocation interface. Figure 3 illustrates this with a layer diagram. -![Service Invocation Schnittstelle als Schichtendiagramm](graphics/ServiceInvocationInterfaceAsLayerdiagram.png) +![Service Invocation Schnittstelle als Schichtendiagramm](graphics/ServiceInvoker/ServiceInvocationInterfaceAsLayerdiagram.png) Figure 3: Service invocation interface as layer diagram @@ -75,7 +75,7 @@ But the solution with the enum, which determines the keys for the required param Figure 4 shows the sequence of an exemplary processing sequence inside the service invocation interface beginning with the invocation trough a plan, processing of the query in the SI engine and the invocation of the implementation artifact, and the response back to the plan. -![Bearbeitungsablauf zum Aufruf eines Services](graphics/WorkflowServiceInvocation.png) +![Bearbeitungsablauf zum Aufruf eines Services](graphics/ServiceInvoker/WorkflowServiceInvocation.png) Figure 4: Processing sequence to invoke a service @@ -137,7 +137,7 @@ Naturally other invocation scenarios are possible. For example the invocation of an implementation artifact implemented as a RESTful web service of an OSGi service. Furthermore there is the possibility to invoke a plan, initiated with the plan invocation engine or another plan. -![Beispielhafte Nachrichten / Aufrufe](graphics/ExamplaryMessagesInvocations.png) +![Beispielhafte Nachrichten / Aufrufe](graphics/ServiceInvoker/ExamplaryMessagesInvocations.png) Figure 5: Exemplary messages / invocations @@ -150,50 +150,50 @@ Goal of the invocation is to invoke the implementation artifact, specified in ro The specification of ReplyTo in row 19 tells the service invocation interface at which address the callback with the response should be sent. The MessageID is sent back to the plan from the service invocation interface, because it is required by the workflow engine to be able to assign the query response as well as the correct plan instance. -``` -01 -05 -06 -07 -08 DBCsar -09 -10 Instance5 -11 -12 http://CsarDBCreator.org/DB/ -13 -14 -15 DBCreator\_ServiceTemplate -16 -17 DB\_NodeTemplate -18 createDB -19 http://localhost:1337/callback -20 A7ZD70AH -21 -22 -23 -24 -25 Size -26 5 -27 -28 -29 Host -30 Azure -31 -32 -33 User -34 admin -35 -36 -37 Password -38 p8ilR6N9 -39 -40 -41 -42 -43 +```xml + + + + + DBCsar + + Instance5 + + http://CsarDBCreator.org/DB/ + + + DBCreator\_ServiceTemplate + + DB\_NodeTemplate + createDB + http://localhost:1337/callback + A7ZD70AH + + + + + Size + 5 + + + Host + Azure + + + User + admin + + + Password + p8ilR6N9 + + + + + ``` Listing 3: SOAP message of a plan to the service invocation interface to create a database @@ -212,13 +212,13 @@ This is however optional and only happens for ServiceInstanceIDs specified by th Subsequently the input parameters in the message body are replaced with the values from the instance database and updated. Like this IP addresses of a previously setup virtual machine can be used for example. -![Von der Service Invocation SOAP API an die SI-Engine gesendete Message](graphics/MessageFromInvocationApiToSiEngine.png) +![Von der Service Invocation SOAP API an die SI-Engine gesendete Message](graphics/ServiceInvoker/MessageFromInvocationApiToSiEngine.png) Figure 6: Message from the service invocation SOAP API to the SI engine Finally after the invocation type of the implementation artifact has been determined with the TOSCA engine a fitting plugin is chosen and the exchange message supplied with all necessary information is forwarded to it. -![Sequenzdiagramm SI-Engine](graphics/SequencediagramSiEngine.png) +![Sequenzdiagramm SI-Engine](graphics/ServiceInvoker/SequencediagramSiEngine.png) Figure 7: Sequence diagram of the SI engine @@ -239,7 +239,7 @@ The endpoint of the implementation artifact was determined and added as header, In this example the implementation artifact is told to create a database at Amazon Web Services (AWS) instead of at Microsoft Azure. A previously executed plan could have this saved and after checking that the prices for databases at AWS are better then at Azure. -![Durch die SI-Engine angereicherte und an ein SI-Plug-in gerichtete Message](graphics/ExpandendMessageFromSiEnginToSiPlugin.png) +![Durch die SI-Engine angereicherte und an ein SI-Plug-in gerichtete Message](graphics/ServiceInvoker/ExpandendMessageFromSiEnginToSiPlugin.png) Figure 8: A message directed to a SI plugin enriched from the SI engine @@ -248,19 +248,19 @@ What happens afterwards with this data and how the actual invocation of the impl In the case of the SOAP/HTTP plugin for example further information is read from the WSDL belonging to the implementation artifact, a SOAP message corresponding to the WSDL is created and this is sent to the implementation artifact. From the response, in the case of a SOAP message this would be the body, the output parameters are extracted and those are put into the body of the message object which gets returned to the SI engine. -``` -01 -04 -05 -06 5 -07 AWS -08 admin -09 p8ilR6N9 -10 -11 -12 +```xml + + + + 5 + AWS + admin + p8ilR6N9 + + + ``` Listing 4: SOAP message created with the SOAP/HTTP plugin @@ -268,16 +268,16 @@ Listing 4: SOAP message created with the SOAP/HTTP plugin Listing 5 shows the answer of the implementation artifact. In this example on the query to create a database the address of the database is returned as response. -``` -01 -04 -05 -06 http://s3.amazonaws.com/my-5GB-DB -07 -08 -09 +```xml + + + + http://s3.amazonaws.com/my-5GB-DB + + + ``` Listing 5: Response of the implementation artifact @@ -286,7 +286,7 @@ The body contains the information received from the implementation artifact whic To do this in the incoming SOAP message the name of the element is assigned as key and the content of the element as value. It is assumed that the names of the elements returned by the implementation artifact is identical to the return values specified by the TOSCA definition. -![R𣫧abe des SI-Plug-ins mit enthaltenen Informationen des Implementation Artifacts](graphics/ReturnFromSiPlugin.png) +![R𣫧abe des SI-Plug-ins mit enthaltenen Informationen des Implementation Artifacts](graphics/ServiceInvoker/ReturnFromSiPlugin.png) Figure 9: Return of the SI plugin with the received information of the implementation artifact @@ -298,22 +298,22 @@ A plan to invoke an implementation artifact only requires the information specif Finally the created SOAP message that was passed in the beginning from the plan to the service invocation interface is sent to the address (ReplyTo) in the header. -``` -01 -05 -06 -07 -08 A7ZD70AH -09 -10 URL -11 http://s3.amazonaws.com/my-5GB-DB -12 -13 -14 -15 +```xml + + + + + A7ZD70AH + + URL + http://s3.amazonaws.com/my-5GB-DB + + + + ``` Listing 6: Message from the SOAP API back to the invoker @@ -325,7 +325,7 @@ This plugin enables the invocation of implementation artifacts implemented as OS It should be noted that the OpenTOSCA container currently, because a suitable IA plugin is as of yet missing, is not yet able to deploy OSGi implementation artifacts, those are therefore not yet supported by the container. The service invocation interface was implemented with further implementation of artifact types in mind and has concepts in store to deal with those. -![Beispiel f𲠤ie Umsetzungsm򧬩chkeit eines weiteren Plug-in Types](graphics/UsecaseOtherPluginType.png) +![Beispiel f𲠤ie Umsetzungsm򧬩chkeit eines weiteren Plug-in Types](graphics/ServiceInvoker/UsecaseOtherPluginType.png) Figure 10: Example for the possibilities of more plugin types @@ -336,14 +336,14 @@ Based on the implemented interface and the so specified service the OSGi SI plug The endpoint of the implementation artifact in this case has to be the ID of the respective OSGi service. Listing 7 shows the methods set by the interface. -``` -01 public void invoke(String operationName, HashMap params); -03 -04 public Object invoke(String operationName, HashMap params); -06 -07 public getID(); +```java + public void invoke(String operationName, HashMap params); + + public Object invoke(String operationName, HashMap params); + + public getID(); ``` Listing 7: Methods of the OSGi implementation artifact interface @@ -358,7 +358,7 @@ The addition of further service invocation APIs can, equivalent to the plugins, Figure 11 shows the service invocation interface exemplary running on service invocation SOAP as well as service invocation REST API. As the names of the APIs suggest, this makes it possible to invoke the service invocation interface and therefore the invocation of implementation artifacts and plans with SOAP and REST at the same time. -![Beispiel f𲠥ine weitere Service Invocation API](graphics/MoreServiceInvocationApi.png) +![Beispiel f𲠥ine weitere Service Invocation API](graphics/ServiceInvoker/MoreServiceInvocationApi.png) Figure 11: Example of a further service invocation API @@ -391,7 +391,7 @@ If the operation name is not unique within a node type the name of the interface This is done with the INTERFACENAME_STRING. PLANID_QNAME is used if a plan is to be invoked and serves to identify the plan. -``` +```java public enum SIEnum { CSARID, SERVICEINSTANCEID_STRING, NODEINSTANCEID_STRING, SERVICETEMPLATEID_QNAME, NODETEMPLATEID_STRING, INTERFACENAME_STRING, OPERATIONNAME_STRING, PLANID_QNAME, ENDPOINT_URI, SPECIFICCONTENT_DOCUMENT @@ -418,32 +418,32 @@ With it a SOAP web services is started on http://localhost:8081/invoker per CXF The invoker.wsdl serves as WSDL of the web service. The service and port are defined by the WSDL. -``` -01 String INVOKE = "cxf:http://localhost: -02 8081/invoker?wsdlURL=META-INF/invoker. -03 wsdl&serviceName={http://siserver.org/wsdl} -04 SIServerInvokeService&portName={http: -05 //siserver.org/wsdl} -06 SIServerInvokePort"; - -07 String CALLBACK = "cxf:${header[ReplyTo]}?wsdlURL=META- -08 INF/invoker.wsdl&serviceName={http: -09 //siserver.org/wsdl} -10 SIServerCallback&portName={http://siserver. -11 org/wsdl}CallbackPort"; - -12 String ENGINE_IA = "bean:siengineinterface. -13 SIEngineInterface?method=invokeOperation"; - -14 String ENGINE_PLAN = "bean:siengineinterface. -15 SIEngineInterface?method=invokePlan"; - -16 from(INVOKE).unmarshal(requestJaxb).process(requestProcessor) -17 .choice().when(this.header(CxfConstants.OPERATION_NAME). -18 isEqualTo("invokeOperation")).to(ENGINE_IA).when(this.header( -19 CxfConstants.OPERATION_NAME).isEqualTo("invokePlan")). -20 to(ENGINE_PLAN).end().process(responseProcessor). -21 marshal(responseJaxb).recipientList(this.simple(CALLBACK)); +```java + String INVOKE = "cxf:http://localhost: + 8081/invoker?wsdlURL=META-INF/invoker. + wsdl&serviceName={http://siserver.org/wsdl} + SIServerInvokeService&portName={http: + //siserver.org/wsdl} + SIServerInvokePort"; + + String CALLBACK = "cxf:${header[ReplyTo]}?wsdlURL=META- + INF/invoker.wsdl&serviceName={http: + //siserver.org/wsdl} + SIServerCallback&portName={http://siserver. + org/wsdl}CallbackPort"; + + String ENGINE_IA = "bean:siengineinterface. + SIEngineInterface?method=invokeOperation"; + + String ENGINE_PLAN = "bean:siengineinterface. + SIEngineInterface?method=invokePlan"; + + from(INVOKE).unmarshal(requestJaxb).process(requestProcessor) + .choice().when(this.header(CxfConstants.OPERATION_NAME). + isEqualTo("invokeOperation")).to(ENGINE_IA).when(this.header( + CxfConstants.OPERATION_NAME).isEqualTo("invokePlan")). + to(ENGINE_PLAN).end().process(responseProcessor). + marshal(responseJaxb).recipientList(this.simple(CALLBACK)); ``` Listing 9: Route of the Service Invocation SOAP API @@ -488,7 +488,7 @@ Subsequently the exchange message is passed to the SI engine to be processed fur After the response from the SI engine returns, the service invocation OSGi event API sends the response message to more lists (Response Topic). The plan invocation engine is subscribed to this list and can so receive the response messages and process them. -![Aufruf eines Plans initiiert durch Plan Invocation Engine](graphics/PlanInvocationWithPlanInvocationEngine.png) +![Aufruf eines Plans initiiert durch Plan Invocation Engine](graphics/ServiceInvoker/PlanInvocationWithPlanInvocationEngine.png) Figure 12: Invocation of a plan initiated with the plan invocation engine @@ -501,25 +501,25 @@ The class has to implement the interface EventHandler and the corresponding meth The names of the lists (event.topics) the component is subscribed to have to be specified. In this example this is the list org_opentosca_plans/request which is used for example by the plan invocation engine to send query for the invocation of plans. -``` -01 -05 -07 -12 -13 -15 -16 -18 +```xml + + + + + + + + ``` Listing 10: Usage of the OSGi event service @@ -549,7 +549,7 @@ This enables implementation artifacts to determine current values from the insta Independently of the two methods the respective endpoint of the implementation artifact or plan is determined with the endpoint service. For the invocation of implantation artifacts the invocation type of a suitable plugin is determined with the properties queried earlier. -![Flussdiagramme der beiden SI-Engine Methoden invokeOperation und invokePlan](graphics/FlowchartInvokeoperationInvokeplan.png) +![Flussdiagramme der beiden SI-Engine Methoden invokeOperation und invokePlan](graphics/ServiceInvoker/FlowchartInvokeoperationInvokeplan.png) Figure 13: Workflow diagram of both SI engine methods invokeOperation and invokePlan @@ -563,24 +563,24 @@ With the InvocationType element the invocation type of the implementation artifa In this case SOAP/HTTP. The SI engine would then forward this request for the invocation of this implementation artifact to a plugin that can handle SOAP/HTTP. -``` -01 -03 -04 -05 -06 /services/EC2VMIAService -07 -08 -09 SOAP/HTTP -10 -11 -12 -13 -14 -16 -17 +```xml + + + + + /services/EC2VMIAService + + + SOAP/HTTP + + + + + + + ``` Listing 11: Example ArtifactTemplate with invocation type specification @@ -596,25 +596,25 @@ The plugin system is realized with declarative services. The SI plugins implement the specified interface SIPluginInterface (see [SI Plugin Interface](#service-invocation-plugin-interface)) and respectively provide the service ISIEnginePluginService. This is shown in rows four and five in Listing 12. -``` -01 -02 -03 -04 -06 -07 +```xml + + + + + + ``` Listing 12: Providing a service per OSGi XML configuration file -``` -01 -02 -03 -08 +```xml + + + + ``` Listing 13: Binding a service per OSGi XML configuration file @@ -628,21 +628,21 @@ The key is the invocation type and the value is the plugin. During the stopping of a plugin the unbind method is executed and the plugin is removed from the map (row 8 to eleven). Because of this system the SI engine always has a current list of available SI plugins and can choose a suitable plugin based on the invocation type of the implementation artifact. -``` -01 Map pluginServicesMap = Collections. -02 synchronizedMap(new HashMap()); - -. . . - -03 public void bindPluginService(ISIEnginePluginService plugin) { -04 -05 pluginServicesMap.put(plugin.getType(), plugin); -06 } -07 -08 public void unbindPluginService(ISIEnginePluginService plugin) { -09 -10 pluginServicesMap.remove(plugin.getType()); -11 } +```java + Map pluginServicesMap = Collections. + synchronizedMap(new HashMap()); + +// . . . + + public void bindPluginService(ISIEnginePluginService plugin) { + + pluginServicesMap.put(plugin.getType(), plugin); + } + + public void unbindPluginService(ISIEnginePluginService plugin) { + + pluginServicesMap.remove(plugin.getType()); + } ``` Listing 14: Implementation of the plugin system @@ -652,14 +652,14 @@ Listing 14: Implementation of the plugin system This chapter presents the interface for the SI plugins. As mentioned earlier all plugins usable by the service invocation interface have to implement this interface and provide the service ISIEnginePluginService. -``` -01 public interface ISIEnginePluginService { -02 -03 public Exchange invoke(Exchange exchange); -04 -05 public String getType(); -06 -07 } +```java + public interface ISIEnginePluginService { + + public Exchange invoke(Exchange exchange); + + public String getType(); + + } ``` Listing 15: Interface of the SI plugins @@ -698,13 +698,13 @@ Listing 16: One-Way Operation **Request-Response (In-Out)**: The client (the plugin) sends a SOAP message to the service and waits for the response message. An example of a request response operation is in shown in Listing 17. -``` -01 -02 -03 -04 -05 -06 +```xml + + + + + + ``` Listing 17: Request-Response operation @@ -720,7 +720,7 @@ To finally determine the information gotten from the WSDL additional MEPs from t Accordingly an In-Only operation (from the TOSCA definition) and an In-Only operation (from the WSDL definition) make a One-Way SOAP message (without response message) to the service. In contrast an In-Out operation (from the TOSCA definition) and an In-Only operation (from the WSDL definition) make a message exchange through request callbacks. -![Darstellung der drei von dem SOAP/HTTP-Plug-in unterst𴺴en MEPs](graphics/SupportedMeps.png) +![Darstellung der drei von dem SOAP/HTTP-Plug-in unterst𴺴en MEPs](graphics/ServiceInvoker/SupportedMeps.png) Figure 14: Presentation of the three MEPs supported by the SOAP/HTTP plugin @@ -734,18 +734,18 @@ To enable the plugin to create the message according to the implementation of th This information is determined in the SI engine with the TOSCA engine and passed to the plugin. Listing 18 shows the schema to describe mapping information, which have to be defined inside the implementation artifact (as artifact specific content). -``` -01 -02 -03 -09 + -10 -11 +```xml + + + + + + + ``` Listing 18: Schema to describe the parameter mapping diff --git a/docs/graphics/ApplicationBusArchitektur.png b/docs/components/graphics/ApplicationBus/ApplicationBusArchitektur.png similarity index 100% rename from docs/graphics/ApplicationBusArchitektur.png rename to docs/components/graphics/ApplicationBus/ApplicationBusArchitektur.png diff --git a/docs/graphics/BearbeitungsablaufInvokeProcessor.png b/docs/components/graphics/ApplicationBus/BearbeitungsablaufInvokeProcessor.png similarity index 100% rename from docs/graphics/BearbeitungsablaufInvokeProcessor.png rename to docs/components/graphics/ApplicationBus/BearbeitungsablaufInvokeProcessor.png diff --git a/docs/graphics/Beispielszenario.png b/docs/components/graphics/ApplicationBus/Beispielszenario.png similarity index 100% rename from docs/graphics/Beispielszenario.png rename to docs/components/graphics/ApplicationBus/Beispielszenario.png diff --git a/docs/graphics/FunktionsweiseApplicationBusProxy.png b/docs/components/graphics/ApplicationBus/FunktionsweiseApplicationBusProxy.png similarity index 100% rename from docs/graphics/FunktionsweiseApplicationBusProxy.png rename to docs/components/graphics/ApplicationBus/FunktionsweiseApplicationBusProxy.png diff --git a/docs/graphics/GenerierungCodeSkelett.png b/docs/components/graphics/ApplicationBus/GenerierungCodeSkelett.png similarity index 100% rename from docs/graphics/GenerierungCodeSkelett.png rename to docs/components/graphics/ApplicationBus/GenerierungCodeSkelett.png diff --git a/docs/graphics/KommunikationAnwendungApplicationBus.png b/docs/components/graphics/ApplicationBus/KommunikationAnwendungApplicationBus.png similarity index 100% rename from docs/graphics/KommunikationAnwendungApplicationBus.png rename to docs/components/graphics/ApplicationBus/KommunikationAnwendungApplicationBus.png diff --git a/docs/graphics/KommunikationApplicationBusAnwendung.png b/docs/components/graphics/ApplicationBus/KommunikationApplicationBusAnwendung.png similarity index 100% rename from docs/graphics/KommunikationApplicationBusAnwendung.png rename to docs/components/graphics/ApplicationBus/KommunikationApplicationBusAnwendung.png diff --git a/docs/graphics/KommunikationsdiagrammApplicationBus.png b/docs/components/graphics/ApplicationBus/KommunikationsdiagrammApplicationBus.png similarity index 100% rename from docs/graphics/KommunikationsdiagrammApplicationBus.png rename to docs/components/graphics/ApplicationBus/KommunikationsdiagrammApplicationBus.png diff --git a/docs/graphics/OpenTOSCAArchitekturApplicationBus.png b/docs/components/graphics/ApplicationBus/OpenTOSCAArchitekturApplicationBus.png similarity index 100% rename from docs/graphics/OpenTOSCAArchitekturApplicationBus.png rename to docs/components/graphics/ApplicationBus/OpenTOSCAArchitekturApplicationBus.png diff --git a/docs/graphics/RoutingApplicationBusEngine.png b/docs/components/graphics/ApplicationBus/RoutingApplicationBusEngine.png similarity index 100% rename from docs/graphics/RoutingApplicationBusEngine.png rename to docs/components/graphics/ApplicationBus/RoutingApplicationBusEngine.png diff --git a/docs/graphics/SetupApplicationBusAnwendung.png b/docs/components/graphics/ApplicationBus/SetupApplicationBusAnwendung.png similarity index 100% rename from docs/graphics/SetupApplicationBusAnwendung.png rename to docs/components/graphics/ApplicationBus/SetupApplicationBusAnwendung.png diff --git a/docs/graphics/StubsKommunkationApplicationBus.png b/docs/components/graphics/ApplicationBus/StubsKommunkationApplicationBus.png similarity index 100% rename from docs/graphics/StubsKommunkationApplicationBus.png rename to docs/components/graphics/ApplicationBus/StubsKommunkationApplicationBus.png diff --git a/docs/graphics/WorkflowApplicationBusStubGenerators.png b/docs/components/graphics/ApplicationBus/WorkflowApplicationBusStubGenerators.png similarity index 100% rename from docs/graphics/WorkflowApplicationBusStubGenerators.png rename to docs/components/graphics/ApplicationBus/WorkflowApplicationBusStubGenerators.png diff --git a/docs/graphics/buildplans.png b/docs/components/graphics/PlanBuilder/buildplans.png similarity index 100% rename from docs/graphics/buildplans.png rename to docs/components/graphics/PlanBuilder/buildplans.png diff --git a/docs/graphics/overview.png b/docs/components/graphics/PlanBuilder/overview.png similarity index 100% rename from docs/graphics/overview.png rename to docs/components/graphics/PlanBuilder/overview.png diff --git a/docs/graphics/scaleoutplans.png b/docs/components/graphics/PlanBuilder/scaleoutplans.png similarity index 100% rename from docs/graphics/scaleoutplans.png rename to docs/components/graphics/PlanBuilder/scaleoutplans.png diff --git a/docs/graphics/terminationplans.png b/docs/components/graphics/PlanBuilder/terminationplans.png similarity index 100% rename from docs/graphics/terminationplans.png rename to docs/components/graphics/PlanBuilder/terminationplans.png diff --git a/docs/graphics/ArchitectureOpentoscaContainerWithServiceInvocationInterface.png b/docs/components/graphics/ServiceInvoker/ArchitectureOpentoscaContainerWithServiceInvocationInterface.png similarity index 100% rename from docs/graphics/ArchitectureOpentoscaContainerWithServiceInvocationInterface.png rename to docs/components/graphics/ServiceInvoker/ArchitectureOpentoscaContainerWithServiceInvocationInterface.png diff --git a/docs/graphics/ConceptualStructureOfComponents.png b/docs/components/graphics/ServiceInvoker/ConceptualStructureOfComponents.png similarity index 100% rename from docs/graphics/ConceptualStructureOfComponents.png rename to docs/components/graphics/ServiceInvoker/ConceptualStructureOfComponents.png diff --git a/docs/graphics/ExamplaryMessagesInvocations.png b/docs/components/graphics/ServiceInvoker/ExamplaryMessagesInvocations.png similarity index 100% rename from docs/graphics/ExamplaryMessagesInvocations.png rename to docs/components/graphics/ServiceInvoker/ExamplaryMessagesInvocations.png diff --git a/docs/graphics/ExpandendMessageFromSiEnginToSiPlugin.png b/docs/components/graphics/ServiceInvoker/ExpandendMessageFromSiEnginToSiPlugin.png similarity index 100% rename from docs/graphics/ExpandendMessageFromSiEnginToSiPlugin.png rename to docs/components/graphics/ServiceInvoker/ExpandendMessageFromSiEnginToSiPlugin.png diff --git a/docs/graphics/FlowchartInvokeoperationInvokeplan.png b/docs/components/graphics/ServiceInvoker/FlowchartInvokeoperationInvokeplan.png similarity index 100% rename from docs/graphics/FlowchartInvokeoperationInvokeplan.png rename to docs/components/graphics/ServiceInvoker/FlowchartInvokeoperationInvokeplan.png diff --git a/docs/graphics/MessageFromInvocationApiToSiEngine.png b/docs/components/graphics/ServiceInvoker/MessageFromInvocationApiToSiEngine.png similarity index 100% rename from docs/graphics/MessageFromInvocationApiToSiEngine.png rename to docs/components/graphics/ServiceInvoker/MessageFromInvocationApiToSiEngine.png diff --git a/docs/graphics/MoreServiceInvocationApi.png b/docs/components/graphics/ServiceInvoker/MoreServiceInvocationApi.png similarity index 100% rename from docs/graphics/MoreServiceInvocationApi.png rename to docs/components/graphics/ServiceInvoker/MoreServiceInvocationApi.png diff --git a/docs/graphics/PlanInvocationWithPlanInvocationEngine.png b/docs/components/graphics/ServiceInvoker/PlanInvocationWithPlanInvocationEngine.png similarity index 100% rename from docs/graphics/PlanInvocationWithPlanInvocationEngine.png rename to docs/components/graphics/ServiceInvoker/PlanInvocationWithPlanInvocationEngine.png diff --git a/docs/graphics/ReturnFromSiPlugin.png b/docs/components/graphics/ServiceInvoker/ReturnFromSiPlugin.png similarity index 100% rename from docs/graphics/ReturnFromSiPlugin.png rename to docs/components/graphics/ServiceInvoker/ReturnFromSiPlugin.png diff --git a/docs/graphics/SequencediagramSiEngine.png b/docs/components/graphics/ServiceInvoker/SequencediagramSiEngine.png similarity index 100% rename from docs/graphics/SequencediagramSiEngine.png rename to docs/components/graphics/ServiceInvoker/SequencediagramSiEngine.png diff --git a/docs/graphics/ServiceInvocationInterfaceAsLayerdiagram.png b/docs/components/graphics/ServiceInvoker/ServiceInvocationInterfaceAsLayerdiagram.png similarity index 100% rename from docs/graphics/ServiceInvocationInterfaceAsLayerdiagram.png rename to docs/components/graphics/ServiceInvoker/ServiceInvocationInterfaceAsLayerdiagram.png diff --git a/docs/graphics/SupportedMeps.png b/docs/components/graphics/ServiceInvoker/SupportedMeps.png similarity index 100% rename from docs/graphics/SupportedMeps.png rename to docs/components/graphics/ServiceInvoker/SupportedMeps.png diff --git a/docs/graphics/UsecaseOtherPluginType.png b/docs/components/graphics/ServiceInvoker/UsecaseOtherPluginType.png similarity index 100% rename from docs/graphics/UsecaseOtherPluginType.png rename to docs/components/graphics/ServiceInvoker/UsecaseOtherPluginType.png diff --git a/docs/graphics/WorkflowServiceInvocation.png b/docs/components/graphics/ServiceInvoker/WorkflowServiceInvocation.png similarity index 100% rename from docs/graphics/WorkflowServiceInvocation.png rename to docs/components/graphics/ServiceInvoker/WorkflowServiceInvocation.png diff --git a/docs/graphics/ApplicationBusAnwendung.png b/docs/graphics/ApplicationBusAnwendung.png deleted file mode 100644 index a83a0283a..000000000 Binary files a/docs/graphics/ApplicationBusAnwendung.png and /dev/null differ diff --git a/docs/graphics/ApplicationInstance.png b/docs/graphics/ApplicationInstance.png deleted file mode 100644 index f2856a9a0..000000000 Binary files a/docs/graphics/ApplicationInstance.png and /dev/null differ diff --git a/docs/graphics/ArchitectureOrCore.png b/docs/graphics/ArchitectureOrCore.png deleted file mode 100644 index 8ad5455c9..000000000 Binary files a/docs/graphics/ArchitectureOrCore.png and /dev/null differ diff --git a/docs/graphics/ArchitekturCore.png b/docs/graphics/ArchitekturCore.png deleted file mode 100644 index 505ac56c9..000000000 Binary files a/docs/graphics/ArchitekturCore.png and /dev/null differ diff --git a/docs/graphics/ArchitekturOpenTOSCAContainer-IST.png b/docs/graphics/ArchitekturOpenTOSCAContainer-IST.png deleted file mode 100644 index 1b5d2d7eb..000000000 Binary files a/docs/graphics/ArchitekturOpenTOSCAContainer-IST.png and /dev/null differ diff --git a/docs/graphics/ArchitekturOpenTOSCAContainer-SOLL.png b/docs/graphics/ArchitekturOpenTOSCAContainer-SOLL.png deleted file mode 100644 index 7a4854c5d..000000000 Binary files a/docs/graphics/ArchitekturOpenTOSCAContainer-SOLL.png and /dev/null differ diff --git a/docs/graphics/ArchitekturTOSCAEngine.png b/docs/graphics/ArchitekturTOSCAEngine.png deleted file mode 100644 index 83c921f30..000000000 Binary files a/docs/graphics/ArchitekturTOSCAEngine.png and /dev/null differ diff --git a/docs/graphics/ConfirmUpload.png b/docs/graphics/ConfirmUpload.png deleted file mode 100644 index 271f2feac..000000000 Binary files a/docs/graphics/ConfirmUpload.png and /dev/null differ diff --git a/docs/graphics/ConfirmUpload2.png b/docs/graphics/ConfirmUpload2.png deleted file mode 100644 index 1972cf299..000000000 Binary files a/docs/graphics/ConfirmUpload2.png and /dev/null differ diff --git a/docs/graphics/ContainerArchitectur.png b/docs/graphics/ContainerArchitectur.png deleted file mode 100644 index 1022aad99..000000000 Binary files a/docs/graphics/ContainerArchitectur.png and /dev/null differ diff --git a/docs/graphics/ContainerProductFile.png b/docs/graphics/ContainerProductFile.png deleted file mode 100644 index a58cfe08b..000000000 Binary files a/docs/graphics/ContainerProductFile.png and /dev/null differ diff --git a/docs/graphics/CreateComponentDefinition.png b/docs/graphics/CreateComponentDefinition.png deleted file mode 100644 index fe2b5c2f0..000000000 Binary files a/docs/graphics/CreateComponentDefinition.png and /dev/null differ diff --git a/docs/graphics/CreateTask.png b/docs/graphics/CreateTask.png deleted file mode 100644 index 732391edc..000000000 Binary files a/docs/graphics/CreateTask.png and /dev/null differ diff --git a/docs/graphics/DefineDetails.png b/docs/graphics/DefineDetails.png deleted file mode 100644 index eb7b5ebaa..000000000 Binary files a/docs/graphics/DefineDetails.png and /dev/null differ diff --git a/docs/graphics/Details.png b/docs/graphics/Details.png deleted file mode 100644 index 9b87259e1..000000000 Binary files a/docs/graphics/Details.png and /dev/null differ diff --git a/docs/graphics/Details2.png b/docs/graphics/Details2.png deleted file mode 100644 index b8a871b75..000000000 Binary files a/docs/graphics/Details2.png and /dev/null differ diff --git a/docs/graphics/EclipseAdminWar.png b/docs/graphics/EclipseAdminWar.png deleted file mode 100644 index ded4dfcc6..000000000 Binary files a/docs/graphics/EclipseAdminWar.png and /dev/null differ diff --git a/docs/graphics/EclipseMarketplace.png b/docs/graphics/EclipseMarketplace.png deleted file mode 100644 index 329a89011..000000000 Binary files a/docs/graphics/EclipseMarketplace.png and /dev/null differ diff --git a/docs/graphics/EclipseMarketplaceInstall.png b/docs/graphics/EclipseMarketplaceInstall.png deleted file mode 100644 index 354a107e1..000000000 Binary files a/docs/graphics/EclipseMarketplaceInstall.png and /dev/null differ diff --git a/docs/graphics/EclipseMavenAccept.png b/docs/graphics/EclipseMavenAccept.png deleted file mode 100644 index bac81d1ef..000000000 Binary files a/docs/graphics/EclipseMavenAccept.png and /dev/null differ diff --git a/docs/graphics/EclipseMavenUpdateLink.png b/docs/graphics/EclipseMavenUpdateLink.png deleted file mode 100644 index d91de603c..000000000 Binary files a/docs/graphics/EclipseMavenUpdateLink.png and /dev/null differ diff --git a/docs/graphics/EclipseRunAsAccept.png b/docs/graphics/EclipseRunAsAccept.png deleted file mode 100644 index aba6b3fee..000000000 Binary files a/docs/graphics/EclipseRunAsAccept.png and /dev/null differ diff --git a/docs/graphics/EclipseRunAsLink.png b/docs/graphics/EclipseRunAsLink.png deleted file mode 100644 index e76047fb7..000000000 Binary files a/docs/graphics/EclipseRunAsLink.png and /dev/null differ diff --git a/docs/graphics/EclipseSetUpMavenBuildRun.png b/docs/graphics/EclipseSetUpMavenBuildRun.png deleted file mode 100644 index 8dff8436f..000000000 Binary files a/docs/graphics/EclipseSetUpMavenBuildRun.png and /dev/null differ diff --git a/docs/graphics/EclipseSetUpMavenBuildRunAccept.png b/docs/graphics/EclipseSetUpMavenBuildRunAccept.png deleted file mode 100644 index 6f429a1e4..000000000 Binary files a/docs/graphics/EclipseSetUpMavenBuildRunAccept.png and /dev/null differ diff --git a/docs/graphics/ExampleArchitectureWithEsb.png b/docs/graphics/ExampleArchitectureWithEsb.png deleted file mode 100644 index 4f913efe3..000000000 Binary files a/docs/graphics/ExampleArchitectureWithEsb.png and /dev/null differ diff --git a/docs/graphics/ExampleArchitectureWithoutEsb.png b/docs/graphics/ExampleArchitectureWithoutEsb.png deleted file mode 100644 index d14ad9171..000000000 Binary files a/docs/graphics/ExampleArchitectureWithoutEsb.png and /dev/null differ diff --git a/docs/graphics/GuiPlanInvocationEngine.png b/docs/graphics/GuiPlanInvocationEngine.png deleted file mode 100644 index b53f28f66..000000000 Binary files a/docs/graphics/GuiPlanInvocationEngine.png and /dev/null differ diff --git a/docs/graphics/Input.png b/docs/graphics/Input.png deleted file mode 100644 index ac3210b2b..000000000 Binary files a/docs/graphics/Input.png and /dev/null differ diff --git a/docs/graphics/Input2.png b/docs/graphics/Input2.png deleted file mode 100644 index cbadc9fe7..000000000 Binary files a/docs/graphics/Input2.png and /dev/null differ diff --git a/docs/graphics/InterfaceImplementationStructure.png b/docs/graphics/InterfaceImplementationStructure.png deleted file mode 100644 index 37346a17e..000000000 Binary files a/docs/graphics/InterfaceImplementationStructure.png and /dev/null differ diff --git a/docs/graphics/KommunikationApplicationBus.png b/docs/graphics/KommunikationApplicationBus.png deleted file mode 100644 index 7fa8f1c1b..000000000 Binary files a/docs/graphics/KommunikationApplicationBus.png and /dev/null differ diff --git a/docs/graphics/KommunikationMitEinerAufzurufendenAnwendung.png b/docs/graphics/KommunikationMitEinerAufzurufendenAnwendung.png deleted file mode 100644 index 5873702ea..000000000 Binary files a/docs/graphics/KommunikationMitEinerAufzurufendenAnwendung.png and /dev/null differ diff --git a/docs/graphics/Loading.png b/docs/graphics/Loading.png deleted file mode 100644 index a6a8d7bd0..000000000 Binary files a/docs/graphics/Loading.png and /dev/null differ diff --git a/docs/graphics/OpenApplication.png b/docs/graphics/OpenApplication.png deleted file mode 100644 index 61daedd35..000000000 Binary files a/docs/graphics/OpenApplication.png and /dev/null differ diff --git a/docs/graphics/OpenTOSCAArchitekturmitAB.png b/docs/graphics/OpenTOSCAArchitekturmitAB.png deleted file mode 100644 index 8a0ccf89f..000000000 Binary files a/docs/graphics/OpenTOSCAArchitekturmitAB.png and /dev/null differ diff --git a/docs/graphics/OpenedApplication.png b/docs/graphics/OpenedApplication.png deleted file mode 100644 index 78eb2084c..000000000 Binary files a/docs/graphics/OpenedApplication.png and /dev/null differ diff --git a/docs/graphics/OpentoscaArchitecture.png b/docs/graphics/OpentoscaArchitecture.png deleted file mode 100644 index 05053c477..000000000 Binary files a/docs/graphics/OpentoscaArchitecture.png and /dev/null differ diff --git a/docs/graphics/PipesAndFilterMuster.png b/docs/graphics/PipesAndFilterMuster.png deleted file mode 100644 index 30ad99e66..000000000 Binary files a/docs/graphics/PipesAndFilterMuster.png and /dev/null differ diff --git a/docs/graphics/PossibilitiesOfIntegrationtechnologies.png b/docs/graphics/PossibilitiesOfIntegrationtechnologies.png deleted file mode 100644 index f1c0d9b2e..000000000 Binary files a/docs/graphics/PossibilitiesOfIntegrationtechnologies.png and /dev/null differ diff --git a/docs/graphics/ShowDetails.png b/docs/graphics/ShowDetails.png deleted file mode 100644 index 7a2081179..000000000 Binary files a/docs/graphics/ShowDetails.png and /dev/null differ diff --git a/docs/graphics/Start.png b/docs/graphics/Start.png deleted file mode 100644 index 2e1a950dd..000000000 Binary files a/docs/graphics/Start.png and /dev/null differ diff --git a/docs/graphics/Start2.png b/docs/graphics/Start2.png deleted file mode 100644 index f95211429..000000000 Binary files a/docs/graphics/Start2.png and /dev/null differ diff --git a/docs/graphics/TargetDefinition.png b/docs/graphics/TargetDefinition.png deleted file mode 100644 index 0afd4cac9..000000000 Binary files a/docs/graphics/TargetDefinition.png and /dev/null differ diff --git a/docs/graphics/TargetDefinitionFile.png b/docs/graphics/TargetDefinitionFile.png deleted file mode 100644 index 097ea9582..000000000 Binary files a/docs/graphics/TargetDefinitionFile.png and /dev/null differ diff --git a/docs/graphics/TargetPlatformEditor.png b/docs/graphics/TargetPlatformEditor.png deleted file mode 100644 index 2b3415127..000000000 Binary files a/docs/graphics/TargetPlatformEditor.png and /dev/null differ diff --git a/docs/graphics/UploadFile.png b/docs/graphics/UploadFile.png deleted file mode 100644 index 3d64babc0..000000000 Binary files a/docs/graphics/UploadFile.png and /dev/null differ diff --git a/docs/graphics/UploadedApp.png b/docs/graphics/UploadedApp.png deleted file mode 100644 index c7867dcad..000000000 Binary files a/docs/graphics/UploadedApp.png and /dev/null differ diff --git a/docs/graphics/Build-Tree.png b/docs/graphics/pitchme/Build-Tree.png similarity index 100% rename from docs/graphics/Build-Tree.png rename to docs/graphics/pitchme/Build-Tree.png diff --git a/docs/graphics/CSARtoBPEL.png b/docs/graphics/pitchme/CSARtoBPEL.png similarity index 100% rename from docs/graphics/CSARtoBPEL.png rename to docs/graphics/pitchme/CSARtoBPEL.png diff --git a/docs/graphics/DockerContainer.png b/docs/graphics/pitchme/DockerContainer.png similarity index 100% rename from docs/graphics/DockerContainer.png rename to docs/graphics/pitchme/DockerContainer.png diff --git a/docs/graphics/Invoker.png b/docs/graphics/pitchme/Invoker.png similarity index 100% rename from docs/graphics/Invoker.png rename to docs/graphics/pitchme/Invoker.png diff --git a/docs/graphics/NT.NodeTypeImplementation.png b/docs/graphics/pitchme/NT.NodeTypeImplementation.png similarity index 100% rename from docs/graphics/NT.NodeTypeImplementation.png rename to docs/graphics/pitchme/NT.NodeTypeImplementation.png diff --git a/docs/graphics/NodeTemplate_Form.png b/docs/graphics/pitchme/NodeTemplate_Form.png similarity index 100% rename from docs/graphics/NodeTemplate_Form.png rename to docs/graphics/pitchme/NodeTemplate_Form.png diff --git a/docs/graphics/ProvisioningTerminals.png b/docs/graphics/pitchme/ProvisioningTerminals.png similarity index 100% rename from docs/graphics/ProvisioningTerminals.png rename to docs/graphics/pitchme/ProvisioningTerminals.png diff --git a/docs/graphics/Ubuntu.png b/docs/graphics/pitchme/Ubuntu.png similarity index 100% rename from docs/graphics/Ubuntu.png rename to docs/graphics/pitchme/Ubuntu.png diff --git a/docs/graphics/connectPlugInPlanCompletion.png b/docs/graphics/pitchme/connectPlugInPlanCompletion.png similarity index 100% rename from docs/graphics/connectPlugInPlanCompletion.png rename to docs/graphics/pitchme/connectPlugInPlanCompletion.png diff --git a/docs/graphics/connectPlugInTopology.png b/docs/graphics/pitchme/connectPlugInTopology.png similarity index 100% rename from docs/graphics/connectPlugInTopology.png rename to docs/graphics/pitchme/connectPlugInTopology.png diff --git a/docs/graphics/startStopVMmitBPELFlow.png b/docs/graphics/pitchme/startStopVMmitBPELFlow.png similarity index 100% rename from docs/graphics/startStopVMmitBPELFlow.png rename to docs/graphics/pitchme/startStopVMmitBPELFlow.png diff --git a/docs/graphics/pptx/CoreArchitecture.pptx b/docs/graphics/pptx/CoreArchitecture.pptx deleted file mode 100644 index 954d13dba..000000000 Binary files a/docs/graphics/pptx/CoreArchitecture.pptx and /dev/null differ diff --git a/docs/graphics/pptx/CurrentArchitecture.pptx b/docs/graphics/pptx/CurrentArchitecture.pptx deleted file mode 100644 index 4ee4fabcb..000000000 Binary files a/docs/graphics/pptx/CurrentArchitecture.pptx and /dev/null differ diff --git a/docs/graphics/pptx/ToscaEngine.pptx b/docs/graphics/pptx/ToscaEngine.pptx deleted file mode 100644 index 8c696a053..000000000 Binary files a/docs/graphics/pptx/ToscaEngine.pptx and /dev/null differ diff --git a/docs/graphics/pptx/buildplans.pptx b/docs/graphics/pptx/buildplans.pptx deleted file mode 100644 index 9a0a82aea..000000000 Binary files a/docs/graphics/pptx/buildplans.pptx and /dev/null differ diff --git a/docs/graphics/pptx/components.pptx b/docs/graphics/pptx/components.pptx deleted file mode 100644 index ef08bec87..000000000 Binary files a/docs/graphics/pptx/components.pptx and /dev/null differ diff --git a/docs/graphics/pptx/graphics_PlanBuilder.pptx b/docs/graphics/pptx/graphics_PlanBuilder.pptx deleted file mode 100644 index 1759c583f..000000000 Binary files a/docs/graphics/pptx/graphics_PlanBuilder.pptx and /dev/null differ diff --git a/docs/graphics/pptx/overview.pptx b/docs/graphics/pptx/overview.pptx deleted file mode 100644 index 89c4472b5..000000000 Binary files a/docs/graphics/pptx/overview.pptx and /dev/null differ diff --git a/docs/graphics/pptx/plannedArchitecture.pptx b/docs/graphics/pptx/plannedArchitecture.pptx deleted file mode 100644 index fd7117111..000000000 Binary files a/docs/graphics/pptx/plannedArchitecture.pptx and /dev/null differ diff --git a/docs/graphics/pptx/scaleoutplans.pptx b/docs/graphics/pptx/scaleoutplans.pptx deleted file mode 100644 index f489e4d3f..000000000 Binary files a/docs/graphics/pptx/scaleoutplans.pptx and /dev/null differ diff --git a/docs/graphics/pptx/terminationplans.pptx b/docs/graphics/pptx/terminationplans.pptx deleted file mode 100644 index 17b605825..000000000 Binary files a/docs/graphics/pptx/terminationplans.pptx and /dev/null differ diff --git a/docs/index.md b/docs/index.md index 8c6a0c378..8873dce8b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,8 +5,6 @@ ## Description of components - - - [ApplicationBus](ApplicationBus.md) - describes the architecture and implementation of the application bus - [PlanBuilder](PlanBuilder.md) - OpenTOSCA Container (OpenTOSCA Runtime) enables management of TOSCA Topologies either by executing build plans directly or by generated these based on an application topology. This describes the generation. - [ServiceInvoker](ServiceInvoker.md) - Overview on the service invocation concept diff --git a/org.opentosca.broker.mqtt/META-INF/MANIFEST.MF b/org.opentosca.broker.mqtt/META-INF/MANIFEST.MF deleted file mode 100644 index d4fb44c34..000000000 --- a/org.opentosca.broker.mqtt/META-INF/MANIFEST.MF +++ /dev/null @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.broker.mqtt -Bundle-SymbolicName: org.opentosca.broker.mqtt -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Bundle-Activator: org.opentosca.broker.mqtt.Activator -Import-Package: com.google.common.hash;version="15.0.0", - io.moquette.server, - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.container.core.common, - org.osgi.framework;version="1.8.0", - org.slf4j;version="1.7.5" diff --git a/org.opentosca.broker.mqtt/build.properties b/org.opentosca.broker.mqtt/build.properties deleted file mode 100644 index b107977f4..000000000 --- a/org.opentosca.broker.mqtt/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.broker.mqtt/pom.xml b/org.opentosca.broker.mqtt/pom.xml index 12db4e24b..4956c391f 100644 --- a/org.opentosca.broker.mqtt/pom.xml +++ b/org.opentosca.broker.mqtt/pom.xml @@ -1,6 +1,6 @@ + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 @@ -9,7 +9,33 @@ 2.0.0-SNAPSHOT + + + + jcenter + JCenter Repository + https://jcenter.bintray.com/ + + + org.opentosca.broker.mqtt - eclipse-plugin + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + + com.google.guava + guava + + + + io.moquette + moquette-broker + 0.11 + + diff --git a/org.opentosca.broker.mqtt/src/main/java/org/opentosca/broker/mqtt/BrokerSupport.java b/org.opentosca.broker.mqtt/src/main/java/org/opentosca/broker/mqtt/BrokerSupport.java new file mode 100644 index 000000000..de847bdd1 --- /dev/null +++ b/org.opentosca.broker.mqtt/src/main/java/org/opentosca/broker/mqtt/BrokerSupport.java @@ -0,0 +1,86 @@ +package org.opentosca.broker.mqtt; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Properties; + +import com.google.common.hash.Hashing; +import io.moquette.server.Server; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.impl.service.FileSystem; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.nio.file.StandardOpenOption.CREATE; +import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING; +import static java.nio.file.StandardOpenOption.WRITE; + +@Component +public class BrokerSupport { + private static final Logger LOG = LoggerFactory.getLogger(BrokerSupport.class); + + private static final String CONFIGFILE_PATH = "credentials/password.config"; + + private Server mqttBroker; + + public synchronized void start() { + if (mqttBroker != null) { + LOG.info("Registered attempt to start Broker again. Aborting!"); + return; + } + LOG.info("Starting local MQTT broker at port: {}", Settings.OPENTOSCA_BROKER_MQTT_PORT); + // get username/password from config and create hash + final String username = Settings.OPENTOSCA_BROKER_MQTT_USERNAME; + final String passwordHash = + Hashing.sha256().hashString(Settings.OPENTOSCA_BROKER_MQTT_PASSWORD, UTF_8).toString(); + final String fileEntry = username + ":" + passwordHash; + // try to create a credentials file + final Path credentialsFile = FileSystem.getTemporaryFolder().resolve(CONFIGFILE_PATH); + try { + // add username/password to the credentials file + Files.createDirectories(credentialsFile.getParent()); + Files.write(credentialsFile, fileEntry.getBytes(UTF_8), TRUNCATE_EXISTING, CREATE, WRITE); + } catch (final Exception e) { + LOG.error("Failed to create credentials file: ", e); + } + + // Set properties for the local Moquette MQTT broker + final Properties props = new Properties(); + props.setProperty("port", Settings.OPENTOSCA_BROKER_MQTT_PORT); + props.setProperty("host", "0.0.0.0"); + + // Set the max message size according to the MQTT spec + // http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os-complete.html#_Toc442180836 + props.setProperty("netty.mqtt.message_size", "268435455"); + + if (Files.exists(credentialsFile)) { + // set credentials file + props.setProperty("allow_anonymous", "false"); + props.setProperty("password_file", credentialsFile.toAbsolutePath().toString()); + } else { + // start broker without authentication + props.setProperty("allow_anonymous", "true"); + LOG.warn("Caution: Unable to create credentials file. Starting broker without authentication"); + } + + // start Moquette broker + mqttBroker = new Server(); + try { + mqttBroker.startServer(props); + } catch (IOException e) { + LOG.warn("Starting MQTT broker produced an exception", e); + } + LOG.info("MQTT broker started"); + } + + public synchronized void stop() { + LOG.info("Stopping MQTT borker"); + mqttBroker.stopServer(); + // reset local variable to allow calling start again + mqttBroker = null; + LOG.info("MQTT broker stopped"); + } +} diff --git a/org.opentosca.broker.mqtt/META-INF/credentials/password.config b/org.opentosca.broker.mqtt/src/main/resources/credentials/password.config similarity index 100% rename from org.opentosca.broker.mqtt/META-INF/credentials/password.config rename to org.opentosca.broker.mqtt/src/main/resources/credentials/password.config diff --git a/org.opentosca.broker.mqtt/src/main/resources/spring/context-mqtt-broker.xml b/org.opentosca.broker.mqtt/src/main/resources/spring/context-mqtt-broker.xml new file mode 100644 index 000000000..f022fcd25 --- /dev/null +++ b/org.opentosca.broker.mqtt/src/main/resources/spring/context-mqtt-broker.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/org.opentosca.broker.mqtt/src/org/opentosca/broker/mqtt/Activator.java b/org.opentosca.broker.mqtt/src/org/opentosca/broker/mqtt/Activator.java deleted file mode 100644 index 5eadeb219..000000000 --- a/org.opentosca.broker.mqtt/src/org/opentosca/broker/mqtt/Activator.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.opentosca.broker.mqtt; - -import java.io.File; -import java.io.PrintWriter; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.Properties; - -import org.eclipse.core.runtime.FileLocator; -import org.opentosca.container.core.common.Settings; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.hash.Hashing; - -import io.moquette.server.Server; - - -/** - * This bundle is used to start a local MQTT broker for the OpenTOSCA ecosystem. The broker is - * intended for the communication between different OpenTOSCA Container instances to, e.g., deploy - * and call IAs in a collaborative manner. However, it can also be used for other communication via - * MQTT. The port, username and password to access the MQTT broker can be defined in the global - * config.ini file.
- *
- * - * Copyright 2018 IAAS University of Stuttgart
- *
- * - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - private static final String METAINF_FOLDER = "/META-INF/"; - private static final String CONFIGFILE_PATH = "/credentials/password.config"; - - private Server mqttBroker; - - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.LOG.info("Starting local MQTT broker at port: {}", Settings.OPENTOSCA_BROKER_MQTT_PORT); - - File credentialsFile = null; - - // try to create a credentials file - try { - // get META-INF folder as File - final URL bundleResURL = bundleContext.getBundle().getEntry(METAINF_FOLDER); - final URL fileResURL = FileLocator.toFileURL(bundleResURL); - final File metainfFolder = new File(fileResURL.getPath()); - - // create a password file - credentialsFile = new File(metainfFolder.getPath() + CONFIGFILE_PATH); - credentialsFile.getParentFile().mkdirs(); - credentialsFile.createNewFile(); - - // get username/password from config and create hash - final String username = Settings.OPENTOSCA_BROKER_MQTT_USERNAME; - final String passwordHash = - Hashing.sha256().hashString(Settings.OPENTOSCA_BROKER_MQTT_PASSWORD, StandardCharsets.UTF_8).toString(); - - // add username/password to the credentials file - final PrintWriter writer = new PrintWriter(credentialsFile, "UTF-8"); - writer.println(username + ":" + passwordHash); - writer.close(); - } - catch (final Exception e) { - Activator.LOG.error("Failed to create credentials file: ", e); - } - - // Set properties for the local Moquette MQTT broker - final Properties props = new Properties(); - props.put("port", String.valueOf(Settings.OPENTOSCA_BROKER_MQTT_PORT)); - props.put("host", "0.0.0.0"); - - // Set the max message size according to the MQTT spec - // http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os-complete.html#_Toc442180836 - props.put("netty.mqtt.message_size", "268435455"); - - if (credentialsFile != null) { - // set credentials file - props.put("allow_anonymous", "false"); - props.put("password_file", credentialsFile.getPath()); - } else { - // start broker without authentication - props.put("allow_anonymous", "true"); - Activator.LOG.warn("Caution: Unable to create credentials file. Starting broker without authentication"); - } - - // start Moquette broker - this.mqttBroker = new Server(); - this.mqttBroker.startServer(props); - - Activator.LOG.info("MQTT broker started"); - } - - @Override - public void stop(final BundleContext arg0) throws Exception { - Activator.LOG.info("Stopping MQTT borker"); - - this.mqttBroker.stopServer(); - - Activator.LOG.info("MQTT broker stopped"); - } -} diff --git a/org.opentosca.bus.application.api.jsonhttp/META-INF/MANIFEST.MF b/org.opentosca.bus.application.api.jsonhttp/META-INF/MANIFEST.MF deleted file mode 100644 index 69e5fb676..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,26 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Json-Http API for Application Bus -Bundle-SymbolicName: org.opentosca.bus.application.api.jsonhttp -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.application.api.jsonhttp.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.http;version="2.10.4", - org.apache.camel.component.restlet;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.json.simple, - org.json.simple.parser, - org.osgi.framework;version="1.6.0", - org.restlet, - org.restlet.data, - org.slf4j;version="1.7.5" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.application.model;bundle-version="1.0.0", - org.opentosca.bus.application.service;bundle-version="1.0.0" -Service-Component: OSGI-INF/* -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.bus.application.api.jsonhttp/OSGI-INF/ApplicationBusServiceHandler_component.xml b/org.opentosca.bus.application.api.jsonhttp/OSGI-INF/ApplicationBusServiceHandler_component.xml deleted file mode 100644 index 456392e17..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/OSGI-INF/ApplicationBusServiceHandler_component.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/org.opentosca.bus.application.api.jsonhttp/build.properties b/org.opentosca.bus.application.api.jsonhttp/build.properties deleted file mode 100644 index 686be4f32..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.application.api.jsonhttp/pom.xml b/org.opentosca.bus.application.api.jsonhttp/pom.xml deleted file mode 100644 index 9cadd3977..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.api.jsonhttp - eclipse-plugin - - diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/Activator.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/Activator.java deleted file mode 100644 index 0b747c4fb..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/Activator.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.core.osgi.OsgiServiceRegistry; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.application.api.jsonhttp.route.Route; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * Activator of the JSON/HTTP-Application Bus-API.
- *
- * - * The activator is needed to add and start the camel routes. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - @Override - public void start(final BundleContext bundleContext) throws Exception { - - final DefaultCamelContext camelContext = new OsgiDefaultCamelContext(bundleContext); - - camelContext.addRoutes(new Route()); - - camelContext.start(); - - Activator.LOG.info("Application Bus JSON API started!"); - } - - @Override - public void stop(final BundleContext arg0) throws Exception { - - Activator.LOG.info("Application Bus JSON API stopped!"); - } - -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/ExceptionProcessor.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/ExceptionProcessor.java deleted file mode 100644 index df801b45d..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/ExceptionProcessor.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.parser.ParseException; -import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * ExceptionProcessor of the Application Bus-JSON/HTTP-API.
- *
- * - * This processor handles the exceptions and sends a reasonable response back to the caller. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ExceptionProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(ExceptionProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - ExceptionProcessor.LOG.debug("Exception handling..."); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof ParseException) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - response.setEntity("JSON is not valid: " + exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } - - else if (exchange.getIn().getBody() instanceof NullPointerException) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - response.setEntity("Needed information not specified.", MediaType.TEXT_ALL); - - } - - else if (exchange.getIn().getBody() instanceof ApplicationBusExternalException) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - } - - else if (exchange.getIn().getBody() instanceof ApplicationBusInternalException) { - response.setStatus(Status.SERVER_ERROR_INTERNAL); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - } - - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/GetResultRequestProcessor.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/GetResultRequestProcessor.java deleted file mode 100644 index a8b9a396e..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/GetResultRequestProcessor.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.application.api.jsonhttp.route.Route; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * GetResultRequestProcessor of the Application Bus-JSON/HTTP-API.
- *
- * - * This processor handles "getResult" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class GetResultRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(GetResultRequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - GetResultRequestProcessor.LOG.debug("Processing GetResult request...."); - - final Integer requestID = exchange.getIn().getHeader(Route.ID, Integer.class); - - GetResultRequestProcessor.LOG.debug("RequestID: {}", requestID); - - exchange.getIn().setBody(requestID); - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_GET_RESULT.toString()); - - } - -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/GetResultResponseProcessor.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/GetResultResponseProcessor.java deleted file mode 100644 index 6bbef96f0..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/GetResultResponseProcessor.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.JSONObject; -import org.opentosca.bus.application.api.jsonhttp.route.Route; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * GetResultResponseProcessor of the Application Bus-JSON/HTTP-API.
- *
- * - * This processor handles the responses of "getResult" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class GetResultResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(GetResultResponseProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - GetResultResponseProcessor.LOG.debug("Processing GetResult response...."); - - final String requestID = exchange.getIn().getHeader(Route.ID, String.class); - - GetResultResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof Exception) { - - response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } else { - - final String result = exchange.getIn().getBody(String.class); - - final JSONObject obj = new JSONObject(); - obj.put("result", result); - - response.setStatus(Status.SUCCESS_OK); - response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); - - } - - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/InvocationRequestProcessor.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/InvocationRequestProcessor.java deleted file mode 100644 index 2cc5dca54..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/InvocationRequestProcessor.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.processor; - -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.json.simple.parser.ContainerFactory; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * InvocationRequestProcessor of the Application Bus-JSON/HTTP-API.
- *
- * - * This processor handles "invokeOperation" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class InvocationRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(InvocationRequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws NullPointerException, ParseException { - - String nodeTemplateID = null; - Integer nodeInstanceID = null; - Integer serviceInstanceID = null; - String interfaceName = null; - String operationName = null; - LinkedHashMap params; - - InvocationRequestProcessor.LOG.debug("Processing Invocation request..."); - - final String bodyString = exchange.getIn().getBody(String.class); - - final LinkedHashMap> requestMap = requestToMap(bodyString); - - final LinkedHashMap infosMap = requestMap.get("invocation-information"); - - if (infosMap != null) { - - if (infosMap.containsKey("serviceInstanceID")) { - serviceInstanceID = ((Long) infosMap.get("serviceInstanceID")).intValue(); - InvocationRequestProcessor.LOG.debug("serviceInstanceID: {}", serviceInstanceID); - exchange.getIn().setHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), - serviceInstanceID); - - } - if (infosMap.containsKey("nodeInstanceID")) { - nodeInstanceID = ((Long) infosMap.get("nodeInstanceID")).intValue(); - InvocationRequestProcessor.LOG.debug("nodeInstanceID: {}", nodeInstanceID); - exchange.getIn().setHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), nodeInstanceID); - - } - if (infosMap.containsKey("nodeTemplateID")) { - nodeTemplateID = (String) infosMap.get("nodeTemplateID"); - InvocationRequestProcessor.LOG.debug("nodeTemplateID: {}", nodeTemplateID); - exchange.getIn().setHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), nodeTemplateID); - } - if (infosMap.containsKey("interface")) { - interfaceName = (String) infosMap.get("interface"); - InvocationRequestProcessor.LOG.debug("interfaceName: {}", interfaceName); - exchange.getIn().setHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), interfaceName); - } - if (infosMap.containsKey("operation")) { - operationName = (String) infosMap.get("operation"); - InvocationRequestProcessor.LOG.debug("operationName: {}", operationName); - exchange.getIn().setHeader(ApplicationBusConstants.OPERATION_NAME.toString(), operationName); - } - - final LinkedHashMap paramsMap = requestMap.get("params"); - - params = new LinkedHashMap<>(); - - if (paramsMap != null) { - - InvocationRequestProcessor.LOG.debug("Params:"); - - for (final Entry set : paramsMap.entrySet()) { - - final String name = set.getKey(); - InvocationRequestProcessor.LOG.debug("Name: {}", name); - - final Object value = set.getValue(); - InvocationRequestProcessor.LOG.debug("Value: {}", set.getValue()); - - params.put(name, value); - - } - - } else { - InvocationRequestProcessor.LOG.debug("No parameter specified."); - } - - } else { - InvocationRequestProcessor.LOG.warn("Needed information not specified."); - throw new NullPointerException(); - } - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); - - exchange.getIn().setBody(params); - - } - - /** - * - * Parses and maps a json String to a - * {@literal LinkedHashMap>}. - * - * @param request - * @return LinkedHashMap - * @throws IOException - * @throws ParseException - * @throws ApplicationBusInternalException - */ - private LinkedHashMap> requestToMap(final String body) throws ParseException { - - final ContainerFactory orderedKeyFactory = new ContainerFactory() { - @Override - public Map> createObjectContainer() { - return new LinkedHashMap<>(); - } - - @Override - public List creatArrayContainer() { - // TODO Auto-generated method stub - return null; - } - - }; - - final JSONParser parser = new JSONParser(); - - final Object obj = parser.parse(body, orderedKeyFactory); - - return (LinkedHashMap>) obj; - - } -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/InvocationResponseProcessor.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/InvocationResponseProcessor.java deleted file mode 100644 index ef8800ceb..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/InvocationResponseProcessor.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.opentosca.bus.application.api.jsonhttp.route.Route; -import org.restlet.Response; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * InvocationResponseProcessor of the Application Bus-JSON/HTTP-API.
- *
- * - * This processor handles the responses of "invokeOperation" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class InvocationResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(InvocationResponseProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - InvocationResponseProcessor.LOG.debug("Processing Invocation response...."); - - final String requestID = exchange.getIn().getBody(String.class); - - InvocationResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - response.setStatus(Status.SUCCESS_ACCEPTED); - response.setLocationRef(Route.POLL_ENDPOINT.replace(Route.ID_PLACEHODLER, requestID)); - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedRequestProcessor.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedRequestProcessor.java deleted file mode 100644 index 929ce8baf..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedRequestProcessor.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.application.api.jsonhttp.route.Route; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * IsFinishedRequestProcessor of the Application Bus-JSON/HTTP-API.
- *
- * - * This processor handles "isFinished" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class IsFinishedRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(IsFinishedRequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - IsFinishedRequestProcessor.LOG.debug("Processing IsFinished request...."); - - final Integer requestID = exchange.getIn().getHeader(Route.ID, Integer.class); - - IsFinishedRequestProcessor.LOG.debug("RequestID: {}", requestID); - - exchange.getIn().setBody(requestID); - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_IS_FINISHED.toString()); - - } - -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedResponseProcessor.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedResponseProcessor.java deleted file mode 100644 index 98065876d..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedResponseProcessor.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.JSONObject; -import org.opentosca.bus.application.api.jsonhttp.route.Route; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * IsFinishedResponseProcessor of the Application Bus-JSON/HTTP-API.
- *
- * - * This processor handles the responses of "isFinished" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class IsFinishedResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(IsFinishedResponseProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - IsFinishedResponseProcessor.LOG.debug("Processing IsFinished response...."); - - final String requestID = exchange.getIn().getHeader(Route.ID, String.class); - - IsFinishedResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof Exception) { - - response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } else { - - final Boolean isFinished = exchange.getIn().getBody(Boolean.class); - - if (isFinished) { - IsFinishedResponseProcessor.LOG.debug("Invocation has finished, send location of result."); - - response.setStatus(Status.REDIRECTION_SEE_OTHER); - response.setLocationRef(Route.GET_RESULT_ENDPOINT.replace(Route.ID_PLACEHODLER, requestID)); - - } else { - IsFinishedResponseProcessor.LOG.debug("Invocation has not finished yet."); - - final JSONObject obj = new JSONObject(); - obj.put("status", "PENDING"); - - response.setStatus(Status.SUCCESS_OK); - response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); - - } - exchange.getOut().setBody(response); - } - } - -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/route/Route.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/route/Route.java deleted file mode 100644 index b9a9e6ed7..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/route/Route.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.route; - -import org.apache.camel.Exchange; -import org.apache.camel.Predicate; -import org.apache.camel.builder.PredicateBuilder; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.builder.ValueBuilder; -import org.opentosca.bus.application.api.jsonhttp.processor.ExceptionProcessor; -import org.opentosca.bus.application.api.jsonhttp.processor.GetResultRequestProcessor; -import org.opentosca.bus.application.api.jsonhttp.processor.GetResultResponseProcessor; -import org.opentosca.bus.application.api.jsonhttp.processor.InvocationRequestProcessor; -import org.opentosca.bus.application.api.jsonhttp.processor.InvocationResponseProcessor; -import org.opentosca.bus.application.api.jsonhttp.processor.IsFinishedRequestProcessor; -import org.opentosca.bus.application.api.jsonhttp.processor.IsFinishedResponseProcessor; -import org.opentosca.bus.application.api.jsonhttp.servicehandler.ApplicationBusServiceHandler; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; - -/** - * Route of the Application Bus-JSON/HTTP-API.
- *
- * - * The endpoint of the JSON/HTTP-API is created here. Incoming requests will be routed to processors - * or the application bus in order to handle the requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Route extends RouteBuilder { - - - private static final String HOST = "http://localhost"; - - private static final String PORT = "8083"; - private static final String BASE_ENDPOINT = Route.HOST + ":" + Route.PORT; - - private static final String INVOKE_ENDPOINT = "/OTABService/v1/appInvoker"; - - public static final String ID = "id"; - public static final String ID_PLACEHODLER = "{" + Route.ID + "}"; - public static final String POLL_ENDPOINT = Route.INVOKE_ENDPOINT + "/activeRequests/" + Route.ID_PLACEHODLER; - public static final String GET_RESULT_ENDPOINT = Route.POLL_ENDPOINT + "/response"; - - private static final String TO_APP_BUS_ENDPOINT = "direct:toAppBus"; - - - @Override - public void configure() throws Exception { - - final ValueBuilder APP_BUS_ENDPOINT = - new ValueBuilder(this.method(ApplicationBusServiceHandler.class, "getApplicationBusRoutingEndpoint")); - final Predicate APP_BUS_ENDPOINT_EXISTS = PredicateBuilder.isNotNull(APP_BUS_ENDPOINT); - - final InvocationRequestProcessor invocationRequestProcessor = new InvocationRequestProcessor(); - final InvocationResponseProcessor invocationResponseProcessor = new InvocationResponseProcessor(); - final IsFinishedRequestProcessor isFinishedRequestProcessor = new IsFinishedRequestProcessor(); - final IsFinishedResponseProcessor isFinishedResponseProcessor = new IsFinishedResponseProcessor(); - final GetResultRequestProcessor getResultRequestProcessor = new GetResultRequestProcessor(); - final GetResultResponseProcessor getResultResponseProcessor = new GetResultResponseProcessor(); - final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); - - // handle exceptions - - this.onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) - .process(exceptionProcessor); - - // invoke route - this.from("restlet:" + Route.BASE_ENDPOINT + Route.INVOKE_ENDPOINT + "?restletMethods=post") - .process(invocationRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT).choice() - .when(property(Exchange.EXCEPTION_CAUGHT).isNull()).process(invocationResponseProcessor).removeHeaders("*") - .otherwise().process(exceptionProcessor); - - - // isFinished route - this.from("restlet:" + Route.BASE_ENDPOINT + Route.POLL_ENDPOINT + "?restletMethods=get") - .process(isFinishedRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT).process(isFinishedResponseProcessor) - .removeHeaders("*"); - - // getResult route - this.from("restlet:" + Route.BASE_ENDPOINT + Route.GET_RESULT_ENDPOINT + "?restletMethods=get") - .process(getResultRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT).process(getResultResponseProcessor) - .removeHeaders("*"); - - // applicationBus route, throws exception if Application Bus is not - // running or wasn't binded - this.from(Route.TO_APP_BUS_ENDPOINT).choice().when(APP_BUS_ENDPOINT_EXISTS).recipientList(APP_BUS_ENDPOINT) - .endChoice().otherwise().to("direct:handleException"); - - // handle exception if Application Bus is not running or wasn't binded - this.from("direct:handleException") - .throwException(new ApplicationBusInternalException("The Application Bus is not running.")); - - } - -} diff --git a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/servicehandler/ApplicationBusServiceHandler.java b/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/servicehandler/ApplicationBusServiceHandler.java deleted file mode 100644 index 9c2c032bf..000000000 --- a/org.opentosca.bus.application.api.jsonhttp/src/org/opentosca/bus/application/api/jsonhttp/servicehandler/ApplicationBusServiceHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.opentosca.bus.application.api.jsonhttp.servicehandler; - -import org.opentosca.bus.application.service.IApplicationBusService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Service Handler of the Application Bus-JSON/HTTP-API.
- *
- * - * Here the implementation of the IApplicationBusService is binded or unbinded. During the binding - * the routing endpoint of the Application Bus is handed over. - * - * - * @see IApplicationBusService - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ApplicationBusServiceHandler { - - // Routing endpoint of the IApplicationBus implementation. - private static String applicationBusRoutingEndpoint = null; - - final private static Logger LOG = LoggerFactory.getLogger(ApplicationBusServiceHandler.class); - - /** - * @return The Routing endpoint of the ApplicationBus - */ - public String getApplicationBusRoutingEndpoint() { - - return applicationBusRoutingEndpoint; - } - - /** - * Bind ApplicationBusService - * - * @param appBus - The ApplicationBusService to register. - */ - public void bindApplicationBusService(final IApplicationBusService appBus) { - - applicationBusRoutingEndpoint = appBus.getRoutingEndpoint(); - - ApplicationBusServiceHandler.LOG.debug("Bound ApplicationBusService: {} with Endpoint: {}", appBus.toString(), - applicationBusRoutingEndpoint); - - } - - /** - * Unbind ApplicationBusService. - * - * @param appBus - The ApplicationBusService to unregister. - */ - public void unbindApplicationBusService(final IApplicationBusService appBus) { - ApplicationBusServiceHandler.LOG.debug("Unbind ApplicationBusService: {} with Endpoint: {}", appBus.toString(), - applicationBusRoutingEndpoint); - applicationBusRoutingEndpoint = null; - } -} diff --git a/org.opentosca.bus.application.api.resthttp/META-INF/MANIFEST.MF b/org.opentosca.bus.application.api.resthttp/META-INF/MANIFEST.MF deleted file mode 100644 index 7aedd14ff..000000000 --- a/org.opentosca.bus.application.api.resthttp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,26 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Rest-Http API for Application Bus -Bundle-SymbolicName: org.opentosca.bus.application.api.resthttp -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.application.api.resthttp.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.restlet;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.json.simple, - org.json.simple.parser, - org.osgi.framework;version="1.6.0", - org.restlet, - org.restlet.data, - org.restlet.util, - org.slf4j;version="1.7.5" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.application.model;bundle-version="1.0.0", - org.opentosca.bus.application.service;bundle-version="1.0.0" -Service-Component: OSGI-INF/ApplicationBusServiceHandler_component.xml -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.bus.application.api.resthttp/OSGI-INF/ApplicationBusServiceHandler_component.xml b/org.opentosca.bus.application.api.resthttp/OSGI-INF/ApplicationBusServiceHandler_component.xml deleted file mode 100644 index c86738c1d..000000000 --- a/org.opentosca.bus.application.api.resthttp/OSGI-INF/ApplicationBusServiceHandler_component.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/org.opentosca.bus.application.api.resthttp/build.properties b/org.opentosca.bus.application.api.resthttp/build.properties deleted file mode 100644 index 686be4f32..000000000 --- a/org.opentosca.bus.application.api.resthttp/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.application.api.resthttp/pom.xml b/org.opentosca.bus.application.api.resthttp/pom.xml deleted file mode 100644 index 455c24c2c..000000000 --- a/org.opentosca.bus.application.api.resthttp/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.api.resthttp - eclipse-plugin - - diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/Activator.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/Activator.java deleted file mode 100644 index 4b4fa32d2..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/Activator.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opentosca.bus.application.api.resthttp; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.core.osgi.OsgiServiceRegistry; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.application.api.resthttp.route.Route; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the REST/HTTP-Application Bus-API.
- *
- * - * The activator is needed to add and start the camel routes. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - @Override - public void start(final BundleContext bundleContext) throws Exception { - - final DefaultCamelContext camelContext = new OsgiDefaultCamelContext(bundleContext); - - camelContext.addRoutes(new Route()); - - camelContext.start(); - - Activator.LOG.info("Application Bus REST API started!"); - } - - @Override - public void stop(final BundleContext arg0) throws Exception { - - Activator.LOG.info("Application Bus REST API stopped!"); - } - -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/ExceptionProcessor.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/ExceptionProcessor.java deleted file mode 100644 index 971835109..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/ExceptionProcessor.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.parser.ParseException; -import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.xml.sax.SAXParseException; - -/** - * ExceptionProcessor of the Application Bus-REST/HTTP-API.
- *
- * - * This processor handles the exceptions and sends a reasonable response back to the caller. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ExceptionProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(ExceptionProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - ExceptionProcessor.LOG.debug("Exception handling..."); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof ParseException) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - response.setEntity("JSON is not valid: " + exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } - - else if (exchange.getIn().getBody() instanceof SAXParseException) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - response.setEntity("XML is not valid: " + exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } - - else if (exchange.getIn().getBody() instanceof NullPointerException) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - response.setEntity("Needed information not specified.", MediaType.TEXT_ALL); - - } - - else if (exchange.getIn().getBody() instanceof ApplicationBusExternalException) { - - final ApplicationBusExternalException e = exchange.getIn().getBody(ApplicationBusExternalException.class); - if (e.getErrorCode() != 0) { - response.setStatus(new Status(e.getErrorCode())); - } else { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - } - - response.setEntity(e.getMessage(), MediaType.TEXT_ALL); - } - - else if (exchange.getIn().getBody() instanceof ApplicationBusInternalException) { - - final ApplicationBusInternalException e = exchange.getIn().getBody(ApplicationBusInternalException.class); - if (e.getErrorCode() != 0) { - response.setStatus(new Status(e.getErrorCode())); - } else { - response.setStatus(Status.SERVER_ERROR_INTERNAL); - } - - response.setEntity(e.getMessage(), MediaType.TEXT_ALL); - } - - else if (exchange.getIn().getBody() instanceof Exception) { - response.setStatus(Status.SERVER_ERROR_INTERNAL); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } - - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/GetResultRequestProcessor.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/GetResultRequestProcessor.java deleted file mode 100644 index 9d5ba1e7f..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/GetResultRequestProcessor.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.application.api.resthttp.route.Route; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * GetResultRequestProcessor of the Application Bus-REST/HTTP-API.
- *
- * - * This processor handles "getResult" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class GetResultRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(GetResultRequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - GetResultRequestProcessor.LOG.debug("Processing GetResult request...."); - - final Integer requestID = exchange.getIn().getHeader(Route.ID, Integer.class); - - GetResultRequestProcessor.LOG.debug("RequestID: {}", requestID); - - exchange.getIn().setBody(requestID); - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_GET_RESULT.toString()); - - } - -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/GetResultResponseProcessor.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/GetResultResponseProcessor.java deleted file mode 100644 index d440effab..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/GetResultResponseProcessor.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.JSONObject; -import org.opentosca.bus.application.api.resthttp.route.Route; -import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; -import org.restlet.Response; -import org.restlet.data.Form; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * GetResultResponseProcessor of the Application Bus-REST/HTTP-API.
- *
- * - * This processor handles the responses of "getResult" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class GetResultResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(GetResultResponseProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - GetResultResponseProcessor.LOG.debug("Processing GetResult response...."); - - final String requestID = exchange.getIn().getHeader(Route.ID, String.class); - - GetResultResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof Exception) { - - response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } else { - - final Form httpHeaders = (Form) exchange.getIn().getHeader("org.restlet.http.headers"); - final String acceptContentType = httpHeaders.getValues("Accept").toString(); - - GetResultResponseProcessor.LOG.debug("AcceptContentType: {}", acceptContentType); - - final String result = exchange.getIn().getBody(String.class); - - if (acceptContentType.equals(MediaType.APPLICATION_JSON.getName())) { - - final JSONObject obj = new JSONObject(); - obj.put("result", result); - - response.setStatus(Status.SUCCESS_OK); - response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); - - } else if (acceptContentType.equals(MediaType.APPLICATION_XML.getName())) { - - response.setStatus(Status.SUCCESS_OK); - response.setEntity("" + result + "", MediaType.APPLICATION_XML); - - } else { - GetResultResponseProcessor.LOG.warn("The requested entity media type (Accept header) is not supported. Supported types are {} and {}", - MediaType.APPLICATION_JSON.getName(), - MediaType.APPLICATION_XML.getName()); - throw new ApplicationBusExternalException( - "The requested request entity media type (Accept header) is not supported. Supported types are " - + MediaType.APPLICATION_JSON.getName() + " and " + MediaType.APPLICATION_XML.getName(), - Status.CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE.getCode()); - } - - } - - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/InvocationRequestProcessor.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/InvocationRequestProcessor.java deleted file mode 100644 index 154002b59..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/InvocationRequestProcessor.java +++ /dev/null @@ -1,185 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.processor; - -import java.io.IOException; -import java.io.StringReader; -import java.util.LinkedHashMap; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.Processor; -import org.json.simple.parser.ContainerFactory; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; -import org.opentosca.bus.application.api.resthttp.route.Route; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; -import org.restlet.data.Form; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * InvocationRequestProcessor of the Application Bus-REST/HTTP-API.
- *
- * - * This processor handles "invokeOperation" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class InvocationRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(InvocationRequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws ParseException, ApplicationBusExternalException, SAXException { - - String nodeTemplateID = null; - Integer nodeInstanceID = null; - Integer serviceInstanceID = null; - String interfaceName = null; - String operationName = null; - LinkedHashMap params = null; - - InvocationRequestProcessor.LOG.debug("Processing Invocation request..."); - - final Message message = exchange.getIn(); - - serviceInstanceID = message.getHeader(Route.SI, Integer.class); - InvocationRequestProcessor.LOG.debug("ServiceInstanceID: {}", serviceInstanceID); - exchange.getIn().setHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), serviceInstanceID); - - nodeInstanceID = message.getHeader(Route.NI, Integer.class); - InvocationRequestProcessor.LOG.debug("NodeInstanceID: {}", nodeInstanceID); - exchange.getIn().setHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), nodeInstanceID); - - nodeTemplateID = message.getHeader(Route.NT, String.class); - InvocationRequestProcessor.LOG.debug("NodeTemplateID: {}", nodeTemplateID); - exchange.getIn().setHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), nodeTemplateID); - - interfaceName = message.getHeader(Route.IN, String.class); - InvocationRequestProcessor.LOG.debug("Interface: {}", interfaceName); - exchange.getIn().setHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), interfaceName); - - operationName = message.getHeader(Route.ON, String.class); - InvocationRequestProcessor.LOG.debug("Operation: {}", operationName); - exchange.getIn().setHeader(ApplicationBusConstants.OPERATION_NAME.toString(), operationName); - - final Form httpHeaders = (Form) exchange.getIn().getHeader("org.restlet.http.headers"); - final String contentType = httpHeaders.getValues("Content-Type").toString(); - - InvocationRequestProcessor.LOG.debug("Content-Type: {}", contentType); - - final String bodyString = message.getBody(String.class); - - if (bodyString != null) { - - if (contentType != null && contentType.equals(MediaType.APPLICATION_JSON.getName())) { - - params = jsonStringToMap(bodyString); - - } else if (contentType != null && contentType.equals(MediaType.APPLICATION_XML.getName())) { - - params = xmlStringToMap(bodyString); - - } else { - InvocationRequestProcessor.LOG.warn("The request entity media type is not supported. Supported types are {} and {}", - MediaType.APPLICATION_JSON.getName(), - MediaType.APPLICATION_XML.getName()); - throw new ApplicationBusExternalException( - "The request entity media type is not supported. Supported types are " - + MediaType.APPLICATION_JSON.getName() + " and " + MediaType.APPLICATION_XML.getName(), - Status.CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE.getCode()); - } - } - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); - - exchange.getIn().setBody(params); - - } - - /** - * - * Parses and maps a json String to a {@literal LinkedHashMap}. - * - * @param request - * @return LinkedHashMap - * @throws IOException - * @throws ParseException - * @throws ApplicationBusInternalException - */ - private LinkedHashMap jsonStringToMap(final String jsonString) throws ParseException { - - final ContainerFactory orderedKeyFactory = new ContainerFactory() { - @Override - public LinkedHashMap createObjectContainer() { - return new LinkedHashMap<>(); - } - - @Override - public List creatArrayContainer() { - // TODO Auto-generated method stub - return null; - } - - }; - - final JSONParser parser = new JSONParser(); - - final Object obj = parser.parse(jsonString, orderedKeyFactory); - - return (LinkedHashMap) obj; - - } - - private LinkedHashMap xmlStringToMap(final String xmlString) throws SAXException { - - final LinkedHashMap params = new LinkedHashMap<>(); - - final Document xml = convertStringToDocument(xmlString); - final Node parent = xml.getFirstChild(); - final NodeList childs = parent.getChildNodes(); - Node child; - for (int i = 0; i < childs.getLength(); i++) { - child = childs.item(i); - - if (child.getNodeType() == Node.ELEMENT_NODE) { - params.put(child.getNodeName(), child.getTextContent()); - } - } - - return params; - } - - private static Document convertStringToDocument(final String xmlString) throws SAXException { - final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder; - - try { - builder = factory.newDocumentBuilder(); - final Document doc = builder.parse(new InputSource(new StringReader(xmlString))); - return doc; - } - catch (ParserConfigurationException | IOException e) { - e.printStackTrace(); - } - return null; - - } -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/InvocationResponseProcessor.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/InvocationResponseProcessor.java deleted file mode 100644 index 5967fff3b..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/InvocationResponseProcessor.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.opentosca.bus.application.api.resthttp.route.Route; -import org.restlet.Response; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * InvocationResponseProcessor of the Application Bus-REST/HTTP-API.
- *
- * - * This processor handles the responses of "invokeOperation" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class InvocationResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(InvocationResponseProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - InvocationResponseProcessor.LOG.debug("Processing Invocation response...."); - - final String requestID = exchange.getIn().getBody(String.class); - - InvocationResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final String invokeURI = exchange.getIn().getHeader(Exchange.HTTP_URI, String.class); - final String pollingURI = invokeURI + Route.POLL_ENDPOINT_SUFFIX.replace(Route.ID_PLACEHODLER, requestID); - - InvocationResponseProcessor.LOG.debug("Polling URI: {}", pollingURI); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - response.setStatus(Status.SUCCESS_ACCEPTED); - response.setLocationRef(pollingURI); - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/IsFinishedRequestProcessor.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/IsFinishedRequestProcessor.java deleted file mode 100644 index d953eb2d6..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/IsFinishedRequestProcessor.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.application.api.resthttp.route.Route; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * IsFinishedRequestProcessor of the Application Bus-REST/HTTP-API.
- *
- * - * This processor handles "isFinished" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class IsFinishedRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(IsFinishedRequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - IsFinishedRequestProcessor.LOG.debug("Processing IsFinished request...."); - - final Integer requestID = exchange.getIn().getHeader(Route.ID, Integer.class); - - IsFinishedRequestProcessor.LOG.debug("RequestID: {}", requestID); - - exchange.getIn().setBody(requestID); - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_IS_FINISHED.toString()); - - } - -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/IsFinishedResponseProcessor.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/IsFinishedResponseProcessor.java deleted file mode 100644 index f765919e0..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/processor/IsFinishedResponseProcessor.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.JSONObject; -import org.opentosca.bus.application.api.resthttp.route.Route; -import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * IsFinishedResponseProcessor of the Application Bus-REST/HTTP-API.
- *
- * - * This processor handles the responses of "isFinished" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class IsFinishedResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(IsFinishedResponseProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - IsFinishedResponseProcessor.LOG.debug("Processing IsFinished response...."); - - final String requestID = exchange.getIn().getHeader(Route.ID, String.class); - - IsFinishedResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof Exception) { - - response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } else { - - final Boolean isFinished = exchange.getIn().getBody(Boolean.class); - - if (isFinished) { - IsFinishedResponseProcessor.LOG.debug("Invocation has finished, send location of result."); - - final String pollingURI = exchange.getIn().getHeader(Exchange.HTTP_URI, String.class); - final String getResultURI = - pollingURI + Route.GET_RESULT_ENDPOINT_SUFFIX.replace(Route.ID_PLACEHODLER, requestID); - - IsFinishedResponseProcessor.LOG.debug("GetResult URI: {}", getResultURI); - - response.setStatus(Status.REDIRECTION_SEE_OTHER); - response.setLocationRef(getResultURI); - - } else { - IsFinishedResponseProcessor.LOG.debug("Invocation has not finished yet."); - - final String acceptContentType = exchange.getIn().getHeader(Exchange.ACCEPT_CONTENT_TYPE, String.class); - - IsFinishedResponseProcessor.LOG.debug("AcceptContentType: {}", acceptContentType); - - if (acceptContentType.equals(MediaType.APPLICATION_JSON)) { - - final JSONObject obj = new JSONObject(); - obj.put("status", "PENDING"); - - response.setStatus(Status.SUCCESS_OK); - response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); - - } else if (acceptContentType.equals(MediaType.APPLICATION_XML)) { - - response.setStatus(Status.SUCCESS_OK); - response.setEntity("PENDING", MediaType.APPLICATION_XML); - - } else { - IsFinishedResponseProcessor.LOG.warn("The requested entity media type is not supported."); - throw new ApplicationBusExternalException("The requested entity media type is not supported.", - Status.CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE.getCode()); - } - - } - exchange.getOut().setBody(response); - } - } - -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/route/Route.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/route/Route.java deleted file mode 100644 index dcfb539bd..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/route/Route.java +++ /dev/null @@ -1,137 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.route; - -import org.apache.camel.Exchange; -import org.apache.camel.Predicate; -import org.apache.camel.builder.PredicateBuilder; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.builder.ValueBuilder; -import org.opentosca.bus.application.api.resthttp.processor.ExceptionProcessor; -import org.opentosca.bus.application.api.resthttp.processor.GetResultRequestProcessor; -import org.opentosca.bus.application.api.resthttp.processor.GetResultResponseProcessor; -import org.opentosca.bus.application.api.resthttp.processor.InvocationRequestProcessor; -import org.opentosca.bus.application.api.resthttp.processor.InvocationResponseProcessor; -import org.opentosca.bus.application.api.resthttp.processor.IsFinishedRequestProcessor; -import org.opentosca.bus.application.api.resthttp.processor.IsFinishedResponseProcessor; -import org.opentosca.bus.application.api.resthttp.servicehandler.ApplicationBusServiceHandler; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; - -/** - * Route of the Application Bus-REST/HTTP-API.
- *
- * - * The endpoint of the REST/HTTP-API is created here. Incoming requests will be routed to processors - * or the application bus in order to handle the requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Route extends RouteBuilder { - - - private static final String HOST = "http://localhost"; - - private static final String PORT = "8085"; - private static final String BASE_ENDPOINT = Route.HOST + ":" + Route.PORT; - - public static final String SI = "ServiceInstanceID"; - public static final String NT = "NodeTemplateID"; - public static final String NI = "NodeInstanceID"; - public static final String IN = "InterfaceName"; - public static final String ON = "OperationName"; - - public static final String INVOKE_ENDPOINT_SI = "/OTABService/v1/ServiceInstances/{" + Route.SI + "}/Nodes/{" - + Route.NT + "}/ApplicationInterfaces/{" + Route.IN + "}/Operations/{" + Route.ON + "}"; - public static final String INVOKE_ENDPOINT_NI = "/OTABService/v1/NodeInstances/{" + Route.NI - + "}/ApplicationInterfaces/{" + Route.IN + "}/Operations/{" + Route.ON + "}"; - - public static final String ID = "id"; - public static final String ID_PLACEHODLER = "{" + Route.ID + "}"; - - public static final String POLL_ENDPOINT_SUFFIX = "/activeRequests/" + Route.ID_PLACEHODLER; - - public static final String POLL_ENDPOINT_SI = Route.INVOKE_ENDPOINT_SI + Route.POLL_ENDPOINT_SUFFIX; - public static final String POLL_ENDPOINT_NI = Route.INVOKE_ENDPOINT_NI + Route.POLL_ENDPOINT_SUFFIX; - - public static final String GET_RESULT_ENDPOINT_SUFFIX = "/response"; - - public static final String GET_RESULT_ENDPOINT_SI = Route.POLL_ENDPOINT_SI + Route.GET_RESULT_ENDPOINT_SUFFIX; - public static final String GET_RESULT_ENDPOINT_NI = Route.POLL_ENDPOINT_NI + Route.GET_RESULT_ENDPOINT_SUFFIX; - - private static final String TO_APP_BUS_ENDPOINT = "direct:toAppBus"; - - - @Override - public void configure() throws Exception { - - final ValueBuilder APP_BUS_ENDPOINT = - new ValueBuilder(this.method(ApplicationBusServiceHandler.class, "getApplicationBusRoutingEndpoint")); - final Predicate APP_BUS_ENDPOINT_EXISTS = PredicateBuilder.isNotNull(APP_BUS_ENDPOINT); - - final InvocationRequestProcessor invocationRequestProcessor = new InvocationRequestProcessor(); - final InvocationResponseProcessor invocationResponseProcessor = new InvocationResponseProcessor(); - final IsFinishedRequestProcessor isFinishedRequestProcessor = new IsFinishedRequestProcessor(); - final IsFinishedResponseProcessor isFinishedResponseProcessor = new IsFinishedResponseProcessor(); - final GetResultRequestProcessor getResultRequestProcessor = new GetResultRequestProcessor(); - final GetResultResponseProcessor getResultResponseProcessor = new GetResultResponseProcessor(); - final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); - - // handle exceptions - - this.onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) - .process(exceptionProcessor); - - // INVOKE ROUTES - // invoke route (for ServiceInstance) - this.from("restlet:" + Route.BASE_ENDPOINT + Route.INVOKE_ENDPOINT_SI + "?restletMethods=post") - .to("direct:invoke"); - - // invoke route (for NodeInstance) - this.from("restlet:" + Route.BASE_ENDPOINT + Route.INVOKE_ENDPOINT_NI + "?restletMethods=post") - .to("direct:invoke"); - - // invoke route - this.from("direct:invoke").process(invocationRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT).choice() - .when(property(Exchange.EXCEPTION_CAUGHT).isNull()).process(invocationResponseProcessor).removeHeaders("*") - .otherwise().process(exceptionProcessor); - - - // IS FINISHED ROUTES - // isFinished route (for ServiceInstance) - this.from("restlet:" + Route.BASE_ENDPOINT + Route.POLL_ENDPOINT_SI + "?restletMethods=get") - .to("direct:isFinished"); - - // isFinished route (for NodeInstance) - this.from("restlet:" + Route.BASE_ENDPOINT + Route.POLL_ENDPOINT_NI + "?restletMethods=get") - .to("direct:isFinished"); - - // isFinished route - this.from("direct:isFinished").process(isFinishedRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT) - .process(isFinishedResponseProcessor).removeHeaders("*"); - - // GET RESULT ROUTES - // getResult route (for ServiceInstance) - this.from("restlet:" + Route.BASE_ENDPOINT + Route.GET_RESULT_ENDPOINT_SI + "?restletMethods=get") - .to("direct:getResult"); - - // getResult route (for NodeInstance) - this.from("restlet:" + Route.BASE_ENDPOINT + Route.GET_RESULT_ENDPOINT_NI + "?restletMethods=get") - .to("direct:getResult"); - - // getResult route - this.from("direct:getResult").process(getResultRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT) - .process(getResultResponseProcessor).removeHeaders("*"); - - // applicationBus route, throws exception if Application Bus is not - // running or wasn't binded - this.from(Route.TO_APP_BUS_ENDPOINT).choice().when(APP_BUS_ENDPOINT_EXISTS).recipientList(APP_BUS_ENDPOINT) - .endChoice().otherwise().to("direct:handleException"); - - // handle exception if Application Bus is not running or wasn't binded - this.from("direct:handleException") - .throwException(new ApplicationBusInternalException("The Application Bus is not running.")); - - } - -} diff --git a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/servicehandler/ApplicationBusServiceHandler.java b/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/servicehandler/ApplicationBusServiceHandler.java deleted file mode 100644 index 532630338..000000000 --- a/org.opentosca.bus.application.api.resthttp/src/org/opentosca/bus/application/api/resthttp/servicehandler/ApplicationBusServiceHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.opentosca.bus.application.api.resthttp.servicehandler; - -import org.opentosca.bus.application.service.IApplicationBusService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Service Handler of the Application Bus-REST/HTTP-API.
- *
- * - * Here the implementation of the IApplicationBusService is binded or unbinded. During the binding - * the routing endpoint of the Application Bus is handed over. - * - * - * @see IApplicationBusService - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ApplicationBusServiceHandler { - - // Routing endpoint of the IApplicationBus implementation. - private static String applicationBusRoutingEndpoint = null; - - final private static Logger LOG = LoggerFactory.getLogger(ApplicationBusServiceHandler.class); - - /** - * @return The Routing endpoint of the ApplicationBus - */ - public String getApplicationBusRoutingEndpoint() { - - return applicationBusRoutingEndpoint; - } - - /** - * Bind ApplicationBusService - * - * @param appBus - The ApplicationBusService to register. - */ - public void bindApplicationBusService(final IApplicationBusService appBus) { - - applicationBusRoutingEndpoint = appBus.getRoutingEndpoint(); - - ApplicationBusServiceHandler.LOG.debug("Bound ApplicationBusService: {} with Endpoint: {}", appBus.toString(), - applicationBusRoutingEndpoint); - - } - - /** - * Unbind ApplicationBusService. - * - * @param appBus - The ApplicationBusService to unregister. - */ - public void unbindApplicationBusService(final IApplicationBusService appBus) { - ApplicationBusServiceHandler.LOG.debug("Unbind ApplicationBusService: {} with Endpoint: {}", appBus.toString(), - applicationBusRoutingEndpoint); - applicationBusRoutingEndpoint = null; - } -} diff --git a/org.opentosca.bus.application.api.soaphttp/META-INF/MANIFEST.MF b/org.opentosca.bus.application.api.soaphttp/META-INF/MANIFEST.MF deleted file mode 100644 index 3d3949163..000000000 --- a/org.opentosca.bus.application.api.soaphttp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,24 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Application Bus Soap over http API -Bundle-SymbolicName: org.opentosca.bus.application.api.soaphttp -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.application.api.soaphttp.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.cxf.common.message;version="2.10.4", - org.apache.camel.converter.jaxb;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.apache.cxf.binding.soap;version="2.7.3", - org.apache.cxf.headers;version="2.7.3", - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.7.5" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.application.model;bundle-version="1.0.0", - org.opentosca.bus.application.service;bundle-version="1.0.0" -Service-Component: OSGI-INF/* -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.bus.application.api.soaphttp/OSGI-INF/ApplicationBusServiceHandler_component.xml b/org.opentosca.bus.application.api.soaphttp/OSGI-INF/ApplicationBusServiceHandler_component.xml deleted file mode 100644 index f79077e60..000000000 --- a/org.opentosca.bus.application.api.soaphttp/OSGI-INF/ApplicationBusServiceHandler_component.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.bus.application.api.soaphttp/build.properties b/org.opentosca.bus.application.api.soaphttp/build.properties deleted file mode 100644 index 686be4f32..000000000 --- a/org.opentosca.bus.application.api.soaphttp/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.application.api.soaphttp/pom.xml b/org.opentosca.bus.application.api.soaphttp/pom.xml deleted file mode 100644 index 0f15b197f..000000000 --- a/org.opentosca.bus.application.api.soaphttp/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.api.soaphttp - eclipse-plugin - - diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/Activator.java b/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/Activator.java deleted file mode 100644 index 089fa1ceb..000000000 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/Activator.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opentosca.bus.application.api.soaphttp; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.core.osgi.OsgiServiceRegistry; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.application.api.soaphttp.route.Route; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the SOAP/HTTP-Application Bus-API.
- *
- * - * The activator is needed to add and start the camel routes. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - @Override - public void start(final BundleContext bundleContext) throws Exception { - - final DefaultCamelContext camelContext = new OsgiDefaultCamelContext(bundleContext); - - camelContext.addRoutes(new Route()); - - camelContext.start(); - - Activator.LOG.info("Application Bus SOAP API started!"); - } - - @Override - public void stop(final BundleContext arg0) throws Exception { - - Activator.LOG.info("Application Bus SOAP API stopped!"); - } - -} diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ObjectFactory.java b/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ObjectFactory.java deleted file mode 100644 index fda44d4b0..000000000 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ObjectFactory.java +++ /dev/null @@ -1,233 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2016.02.25 at 04:54:56 PM CET -// - - -package org.opentosca.bus.application.api.soaphttp.model; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.opentosca.bus.application.api.soaphttp.model package. - *

- * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _GetResultResponse_QNAME = - new QName("http://opentosca.org/appinvoker/", "getResultResponse"); - private final static QName _InvokeMethodWithNodeInstanceID_QNAME = - new QName("http://opentosca.org/appinvoker/", "invokeMethodWithNodeInstanceID"); - private final static QName _InvokeMethodWithNodeInstanceIDResponse_QNAME = - new QName("http://opentosca.org/appinvoker/", "invokeMethodWithNodeInstanceIDResponse"); - private final static QName _IsFinishedResponse_QNAME = - new QName("http://opentosca.org/appinvoker/", "isFinishedResponse"); - private final static QName _InvokeMethodWithServiceInstanceIDResponse_QNAME = - new QName("http://opentosca.org/appinvoker/", "invokeMethodWithServiceInstanceIDResponse"); - private final static QName _ApplicationBusException_QNAME = - new QName("http://opentosca.org/appinvoker/", "ApplicationBusException"); - private final static QName _GetResult_QNAME = new QName("http://opentosca.org/appinvoker/", "getResult"); - private final static QName _InvokeMethodWithServiceInstanceID_QNAME = - new QName("http://opentosca.org/appinvoker/", "invokeMethodWithServiceInstanceID"); - private final static QName _IsFinished_QNAME = new QName("http://opentosca.org/appinvoker/", "isFinished"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.opentosca.bus.application.api.soaphttp.model - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link IsFinishedResponse } - * - */ - public IsFinishedResponse createIsFinishedResponse() { - return new IsFinishedResponse(); - } - - /** - * Create an instance of {@link InvokeMethodWithNodeInstanceIDResponse } - * - */ - public InvokeMethodWithNodeInstanceIDResponse createInvokeMethodWithNodeInstanceIDResponse() { - return new InvokeMethodWithNodeInstanceIDResponse(); - } - - /** - * Create an instance of {@link InvokeMethodWithNodeInstanceID } - * - */ - public InvokeMethodWithNodeInstanceID createInvokeMethodWithNodeInstanceID() { - return new InvokeMethodWithNodeInstanceID(); - } - - /** - * Create an instance of {@link GetResultResponse } - * - */ - public GetResultResponse createGetResultResponse() { - return new GetResultResponse(); - } - - /** - * Create an instance of {@link IsFinished } - * - */ - public IsFinished createIsFinished() { - return new IsFinished(); - } - - /** - * Create an instance of {@link InvokeMethodWithServiceInstanceID } - * - */ - public InvokeMethodWithServiceInstanceID createInvokeMethodWithServiceInstanceID() { - return new InvokeMethodWithServiceInstanceID(); - } - - /** - * Create an instance of {@link GetResult } - * - */ - public GetResult createGetResult() { - return new GetResult(); - } - - /** - * Create an instance of {@link ApplicationBusException } - * - */ - public ApplicationBusException createApplicationBusException() { - return new ApplicationBusException(); - } - - /** - * Create an instance of {@link InvokeMethodWithServiceInstanceIDResponse } - * - */ - public InvokeMethodWithServiceInstanceIDResponse createInvokeMethodWithServiceInstanceIDResponse() { - return new InvokeMethodWithServiceInstanceIDResponse(); - } - - /** - * Create an instance of {@link ParamsMapItemType } - * - */ - public ParamsMapItemType createParamsMapItemType() { - return new ParamsMapItemType(); - } - - /** - * Create an instance of {@link ParamsMap } - * - */ - public ParamsMap createParamsMap() { - return new ParamsMap(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetResultResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "getResultResponse") - public JAXBElement createGetResultResponse(final GetResultResponse value) { - return new JAXBElement<>(_GetResultResponse_QNAME, GetResultResponse.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InvokeMethodWithNodeInstanceID - * }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "invokeMethodWithNodeInstanceID") - public JAXBElement createInvokeMethodWithNodeInstanceID(final InvokeMethodWithNodeInstanceID value) { - return new JAXBElement<>(_InvokeMethodWithNodeInstanceID_QNAME, InvokeMethodWithNodeInstanceID.class, null, - value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InvokeMethodWithNodeInstanceIDResponse - * }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "invokeMethodWithNodeInstanceIDResponse") - public JAXBElement createInvokeMethodWithNodeInstanceIDResponse(final InvokeMethodWithNodeInstanceIDResponse value) { - return new JAXBElement<>(_InvokeMethodWithNodeInstanceIDResponse_QNAME, - InvokeMethodWithNodeInstanceIDResponse.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link IsFinishedResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "isFinishedResponse") - public JAXBElement createIsFinishedResponse(final IsFinishedResponse value) { - return new JAXBElement<>(_IsFinishedResponse_QNAME, IsFinishedResponse.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement - * }{@code <}{@link InvokeMethodWithServiceInstanceIDResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "invokeMethodWithServiceInstanceIDResponse") - public JAXBElement createInvokeMethodWithServiceInstanceIDResponse(final InvokeMethodWithServiceInstanceIDResponse value) { - return new JAXBElement<>(_InvokeMethodWithServiceInstanceIDResponse_QNAME, - InvokeMethodWithServiceInstanceIDResponse.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link ApplicationBusException }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "ApplicationBusException") - public JAXBElement createApplicationBusException(final ApplicationBusException value) { - return new JAXBElement<>(_ApplicationBusException_QNAME, ApplicationBusException.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetResult }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "getResult") - public JAXBElement createGetResult(final GetResult value) { - return new JAXBElement<>(_GetResult_QNAME, GetResult.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InvokeMethodWithServiceInstanceID - * }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "invokeMethodWithServiceInstanceID") - public JAXBElement createInvokeMethodWithServiceInstanceID(final InvokeMethodWithServiceInstanceID value) { - return new JAXBElement<>(_InvokeMethodWithServiceInstanceID_QNAME, InvokeMethodWithServiceInstanceID.class, - null, value); - - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link IsFinished }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "isFinished") - public JAXBElement createIsFinished(final IsFinished value) { - return new JAXBElement<>(_IsFinished_QNAME, IsFinished.class, null, value); - } - -} diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ParamsMap.java b/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ParamsMap.java deleted file mode 100644 index eb749c36c..000000000 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ParamsMap.java +++ /dev/null @@ -1,77 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2016.02.25 at 04:54:56 PM CET -// - - -package org.opentosca.bus.application.api.soaphttp.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

- * Java class for ParamsMap complex type. - * - *

- * The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ParamsMap">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Param" type="{http://opentosca.org/appinvoker/}ParamsMapItemType" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ParamsMap", propOrder = {"param"}) -public class ParamsMap { - - @XmlElement(name = "Param", required = true) - protected List param; - - /** - * Gets the value of the param property. - * - *

- * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the param property. - * - *

- * For example, to add a new item, do as follows: - * - *

-     * getParam().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list {@link ParamsMapItemType } - * - * - */ - public List getParam() { - if (this.param == null) { - this.param = new ArrayList<>(); - } - return this.param; - } - -} diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ParamsMapItemType.java b/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ParamsMapItemType.java deleted file mode 100644 index ce8ded5be..000000000 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ParamsMapItemType.java +++ /dev/null @@ -1,89 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2016.02.25 at 04:54:56 PM CET -// - - -package org.opentosca.bus.application.api.soaphttp.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

- * Java class for ParamsMapItemType complex type. - * - *

- * The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ParamsMapItemType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ParamsMapItemType", propOrder = {"key", "value"}) -public class ParamsMapItemType { - - @XmlElement(required = true) - protected String key; - @XmlElement(required = true) - protected String value; - - /** - * Gets the value of the key property. - * - * @return possible object is {@link String } - * - */ - public String getKey() { - return this.key; - } - - /** - * Sets the value of the key property. - * - * @param value allowed object is {@link String } - * - */ - public void setKey(final String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return this.value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(final String value) { - this.value = value; - } - -} diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/processor/RequestProcessor.java b/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/processor/RequestProcessor.java deleted file mode 100644 index 8c64ecc94..000000000 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/processor/RequestProcessor.java +++ /dev/null @@ -1,156 +0,0 @@ -package org.opentosca.bus.application.api.soaphttp.processor; - -import java.util.LinkedHashMap; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.application.api.soaphttp.model.GetResult; -import org.opentosca.bus.application.api.soaphttp.model.InvokeMethodWithNodeInstanceID; -import org.opentosca.bus.application.api.soaphttp.model.InvokeMethodWithServiceInstanceID; -import org.opentosca.bus.application.api.soaphttp.model.IsFinished; -import org.opentosca.bus.application.api.soaphttp.model.ParamsMap; -import org.opentosca.bus.application.api.soaphttp.model.ParamsMapItemType; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * RequestProcessor of the Application Bus-SOAP/HTTP-API.
- *
- * - * This processor handles the incoming requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class RequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(RequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - String nodeTemplateID = null; - Integer nodeInstanceID = null; - Integer serviceInstanceID = null; - String interfaceName = null; - String operationName = null; - ParamsMap paramsMap = null; - String requestID = null; - - final Object request = exchange.getIn().getBody(); - - if (exchange.getIn().getBody() instanceof InvokeMethodWithServiceInstanceID) { - - RequestProcessor.LOG.debug("Processing InvokeMethodWithServiceInstanceID Request"); - - final InvokeMethodWithServiceInstanceID invoke1Request = (InvokeMethodWithServiceInstanceID) request; - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); - - serviceInstanceID = invoke1Request.getServiceInstanceID(); - RequestProcessor.LOG.debug("ServiceInstanceID: " + serviceInstanceID); - exchange.getIn().setHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), serviceInstanceID); - - nodeTemplateID = invoke1Request.getNodeTemplateID(); - RequestProcessor.LOG.debug("NodeTemplateID: " + nodeTemplateID); - exchange.getIn().setHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), nodeTemplateID); - - interfaceName = invoke1Request.getInterface(); - RequestProcessor.LOG.debug("InterfaceName: " + interfaceName); - exchange.getIn().setHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), interfaceName); - - operationName = invoke1Request.getOperation(); - RequestProcessor.LOG.debug("NodeTemplateID: " + operationName); - exchange.getIn().setHeader(ApplicationBusConstants.OPERATION_NAME.toString(), operationName); - - paramsMap = invoke1Request.getParams(); - - exchange.getIn().setBody(getParams(paramsMap)); - - } - - else if (request instanceof InvokeMethodWithNodeInstanceID) { - - RequestProcessor.LOG.debug("Processing InvokeMethodWithNodeInstanceID Request"); - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); - - final InvokeMethodWithNodeInstanceID invoke2Request = (InvokeMethodWithNodeInstanceID) request; - - nodeInstanceID = invoke2Request.getNodeInstanceID(); - RequestProcessor.LOG.debug("NodeInstanceID: " + nodeInstanceID); - exchange.getIn().setHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), nodeInstanceID); - - interfaceName = invoke2Request.getInterface(); - RequestProcessor.LOG.debug("InterfaceName: " + interfaceName); - exchange.getIn().setHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), interfaceName); - - operationName = invoke2Request.getOperation(); - RequestProcessor.LOG.debug("NodeTemplateID: " + operationName); - exchange.getIn().setHeader(ApplicationBusConstants.OPERATION_NAME.toString(), operationName); - - paramsMap = invoke2Request.getParams(); - - exchange.getIn().setBody(getParams(paramsMap)); - - } - - else if (exchange.getIn().getBody() instanceof IsFinished) { - - RequestProcessor.LOG.debug("Processing IsFinished Request"); - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_IS_FINISHED.toString()); - - final IsFinished isFinishedRequest = (IsFinished) request; - - requestID = isFinishedRequest.getRequestID(); - RequestProcessor.LOG.debug("RequestID: " + requestID); - - exchange.getIn().setBody(requestID); - - } - - else if (exchange.getIn().getBody() instanceof GetResult) { - - RequestProcessor.LOG.debug("Processing GetResult Request"); - - exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), - ApplicationBusConstants.APPLICATION_BUS_METHOD_GET_RESULT.toString()); - - final GetResult getResultRequest = (GetResult) request; - - requestID = getResultRequest.getRequestID(); - RequestProcessor.LOG.debug("RequestID: " + requestID); - - exchange.getIn().setBody(requestID); - - } - - } - - /** - * @param paramsMap - * @return LinkedHashMap with keys and values from ParamsMap - */ - private LinkedHashMap getParams(final ParamsMap paramsMap) { - - final LinkedHashMap params = new LinkedHashMap<>(); - - // put key-value params into camel exchange body as hashmap - if (paramsMap != null) { - - for (final ParamsMapItemType param : paramsMap.getParam()) { - params.put(param.getKey(), param.getValue()); - } - } - return params; - - } - -} diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/processor/ResponseProcessor.java b/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/processor/ResponseProcessor.java deleted file mode 100644 index 3d936d2c5..000000000 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/processor/ResponseProcessor.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.opentosca.bus.application.api.soaphttp.processor; - -import javax.xml.bind.JAXBElement; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.cxf.common.message.CxfConstants; -import org.opentosca.bus.application.api.soaphttp.model.GetResultResponse; -import org.opentosca.bus.application.api.soaphttp.model.InvokeMethodWithNodeInstanceIDResponse; -import org.opentosca.bus.application.api.soaphttp.model.InvokeMethodWithServiceInstanceIDResponse; -import org.opentosca.bus.application.api.soaphttp.model.IsFinishedResponse; -import org.opentosca.bus.application.api.soaphttp.model.ObjectFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * ResponseProcessor of the Application Bus-SOAP/HTTP-API.
- *
- * - * This processor handles the responses back to the caller. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(ResponseProcessor.class); - - private static ObjectFactory objectFactory = new ObjectFactory(); - - @Override - public void process(final Exchange exchange) throws Exception { - ResponseProcessor.LOG.debug("Processing the response..."); - - if (exchange.getIn().getBody() instanceof Exception) { - ResponseProcessor.LOG.debug("Exception handling"); - - final Exception exception = exchange.getIn().getBody(Exception.class); - - final org.opentosca.bus.application.api.soaphttp.model.ApplicationBusException e = - new org.opentosca.bus.application.api.soaphttp.model.ApplicationBusException(); - e.setMessage(exception.getMessage()); - - final JAXBElement jaxbElement = - objectFactory.createApplicationBusException(e); - - exchange.getIn().setBody(jaxbElement); - - return; - } - - final String operation = (String) exchange.getIn().getHeader(CxfConstants.OPERATION_NAME); - - if (operation.equals("invokeMethodWithServiceInstanceID")) { - ResponseProcessor.LOG.debug("Handling invokeMethodWithServiceInstanceID response"); - - final InvokeMethodWithServiceInstanceIDResponse invokeResponse = - new InvokeMethodWithServiceInstanceIDResponse(); - invokeResponse.setRequestID(exchange.getIn().getBody(String.class)); - - final JAXBElement jaxbElement = - objectFactory.createInvokeMethodWithServiceInstanceIDResponse(invokeResponse); - - exchange.getIn().setBody(jaxbElement); - - } - - if (operation.equals("invokeMethodWithNodeInstanceID")) { - ResponseProcessor.LOG.debug("Handling invokeMethodWithNodeInstanceID response"); - - final InvokeMethodWithNodeInstanceIDResponse invokeResponse = new InvokeMethodWithNodeInstanceIDResponse(); - invokeResponse.setRequestID(exchange.getIn().getBody(String.class)); - - final JAXBElement jaxbElement = - objectFactory.createInvokeMethodWithNodeInstanceIDResponse(invokeResponse); - - exchange.getIn().setBody(jaxbElement); - - } - - if (operation.equals("isFinished")) { - ResponseProcessor.LOG.debug("Handling isFinished response"); - - final IsFinishedResponse isFinishedResponse = new IsFinishedResponse(); - isFinishedResponse.setIsFinished(exchange.getIn().getBody(Boolean.class)); - - final JAXBElement jaxbElement = - objectFactory.createIsFinishedResponse(isFinishedResponse); - - exchange.getIn().setBody(jaxbElement); - - } - - if (operation.equals("getResult")) { - ResponseProcessor.LOG.debug("Handling getResult response"); - - final GetResultResponse resultResponse = new GetResultResponse(); - resultResponse.setResult(exchange.getIn().getBody()); - - final JAXBElement jaxbElement = objectFactory.createGetResultResponse(resultResponse); - - exchange.getIn().setBody(jaxbElement); - } - - } - -} diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/route/Route.java b/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/route/Route.java deleted file mode 100644 index ebbec51c2..000000000 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/route/Route.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.opentosca.bus.application.api.soaphttp.route; - -import java.net.URL; - -import javax.xml.bind.JAXBContext; -import javax.xml.namespace.QName; - -import org.apache.camel.Predicate; -import org.apache.camel.Processor; -import org.apache.camel.builder.PredicateBuilder; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.builder.ValueBuilder; -import org.apache.camel.converter.jaxb.JaxbDataFormat; -import org.opentosca.bus.application.api.soaphttp.processor.RequestProcessor; -import org.opentosca.bus.application.api.soaphttp.processor.ResponseProcessor; -import org.opentosca.bus.application.api.soaphttp.servicehandler.ApplicationBusServiceHandler; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; - -/** - * Route of the Application Bus-SOAP/HTTP-API.
- *
- * - * The endpoint of the SOAP/HTTP-API is created here. Incoming requests will be un/marshalled, - * routed to processors or the application bus in order to handle the requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Route extends RouteBuilder { - - private final static String ENDPOINT = "http://0.0.0.0:8084/appBus"; - - private final static QName PORT = new QName("http://opentosca.org/appinvoker/", "AppInvokerSoapWebServicePort"); - - - @Override - public void configure() throws Exception { - - final URL wsdlURL = this.getClass().getClassLoader().getResource("META-INF/wsdl/SoapAPI.wsdl"); - - // CXF Endpoint - final String SOAP_ENDPOINT = "cxf:" + ENDPOINT + "?wsdlURL=" + wsdlURL.toString() - + "&serviceName={http://opentosca.org/appinvoker/}AppInvokerSoapWebServiceService&portName=" - + Route.PORT.toString() + "&dataFormat=PAYLOAD&loggingFeatureEnabled=true"; - - final ValueBuilder APP_BUS_ENDPOINT = - new ValueBuilder(this.method(ApplicationBusServiceHandler.class, "getApplicationBusRoutingEndpoint")); - final Predicate APP_BUS_ENDPOINT_EXISTS = PredicateBuilder.isNotNull(APP_BUS_ENDPOINT); - - final ClassLoader cl = org.opentosca.bus.application.api.soaphttp.model.ObjectFactory.class.getClassLoader(); - final JAXBContext jc = JAXBContext.newInstance("org.opentosca.bus.application.api.soaphttp.model", cl); - final JaxbDataFormat jaxb = new JaxbDataFormat(jc); - - final Processor requestProcessor = new RequestProcessor(); - final Processor responseProcessor = new ResponseProcessor(); - - this.from(SOAP_ENDPOINT).unmarshal(jaxb).process(requestProcessor).choice().when(APP_BUS_ENDPOINT_EXISTS) - .recipientList(APP_BUS_ENDPOINT).to("direct:handleResponse").endChoice().otherwise() - .to("direct:handleException"); - - // handle exception if Application Bus is not running or wasn't binded - this.from("direct:handleException") - .throwException(new ApplicationBusInternalException("It seems like the Application Bus is not running.")) - .to("direct:handleResponse"); - - // handle response - this.from("direct:handleResponse").process(responseProcessor).marshal(jaxb); - - } - -} diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/servicehandler/ApplicationBusServiceHandler.java b/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/servicehandler/ApplicationBusServiceHandler.java deleted file mode 100644 index 02cafd0cc..000000000 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/servicehandler/ApplicationBusServiceHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.opentosca.bus.application.api.soaphttp.servicehandler; - -import org.opentosca.bus.application.service.IApplicationBusService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Service Handler of the Application Bus-SOAP/HTTP-API.
- *
- * - * Here the implementation of the IApplicationBusService is binded or unbinded. During the binding - * the routing endpoint of the Application Bus is handed over. - * - * - * @see IApplicationBusService - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ApplicationBusServiceHandler { - - // Routing endpoint of the IApplicationBus implementation. - private static String applicationBusRoutingEndpoint = null; - - final private static Logger LOG = LoggerFactory.getLogger(ApplicationBusServiceHandler.class); - - - /** - * @return The Routing endpoint of the ApplicationBus - */ - public String getApplicationBusRoutingEndpoint() { - - return applicationBusRoutingEndpoint; - } - - /** - * Bind ApplicationBusService - * - * @param appBus - The ApplicationBusService to register. - */ - public void bindApplicationBusService(final IApplicationBusService appBus) { - - applicationBusRoutingEndpoint = appBus.getRoutingEndpoint(); - - ApplicationBusServiceHandler.LOG.debug("Bound ApplicationBusService: {} with Endpoint: {}", appBus.toString(), - applicationBusRoutingEndpoint); - - } - - /** - * Unbind ApplicationBusService. - * - * @param appBus - The ApplicationBusService to unregister. - */ - public void unbindApplicationBusService(final IApplicationBusService appBus) { - ApplicationBusServiceHandler.LOG.debug("Unbind ApplicationBusService: {} with Endpoint: {}", appBus.toString(), - applicationBusRoutingEndpoint); - applicationBusRoutingEndpoint = null; - } -} diff --git a/org.opentosca.bus.application.model/META-INF/MANIFEST.MF b/org.opentosca.bus.application.model/META-INF/MANIFEST.MF deleted file mode 100644 index b602d2fdd..000000000 --- a/org.opentosca.bus.application.model/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Model bundle of Application Bus -Bundle-SymbolicName: org.opentosca.bus.application.model -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.opentosca.bus.application.model.constants, - org.opentosca.bus.application.model.exception diff --git a/org.opentosca.bus.application.model/build.properties b/org.opentosca.bus.application.model/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.bus.application.model/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.bus.application.model/pom.xml b/org.opentosca.bus.application.model/pom.xml deleted file mode 100644 index 897ced6cc..000000000 --- a/org.opentosca.bus.application.model/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.model - eclipse-plugin - - diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/META-INF/MANIFEST.MF b/org.opentosca.bus.application.plugin.jsonhttp.service.impl/META-INF/MANIFEST.MF deleted file mode 100644 index 8e40e3025..000000000 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Json Http Plugin of the Application Bus -Bundle-SymbolicName: org.opentosca.bus.application.plugin.jsonhttp.service.impl -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.application.plugin.jsonhttp.service.impl.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.cxf.common.message;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.json.simple, - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.7.5" -Require-Bundle: org.opentosca.bus.application.model;bundle-version="1.0.0", - org.opentosca.bus.application.plugin.service;bundle-version="1.0.0" -Service-Component: OSGI-INF/* -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/OSGI-INF/ApplicationBusJsonHttpPluginServiceImpl_component.xml b/org.opentosca.bus.application.plugin.jsonhttp.service.impl/OSGI-INF/ApplicationBusJsonHttpPluginServiceImpl_component.xml deleted file mode 100644 index 1e6059c84..000000000 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/OSGI-INF/ApplicationBusJsonHttpPluginServiceImpl_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/build.properties b/org.opentosca.bus.application.plugin.jsonhttp.service.impl/build.properties deleted file mode 100644 index 686be4f32..000000000 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/pom.xml b/org.opentosca.bus.application.plugin.jsonhttp.service.impl/pom.xml deleted file mode 100644 index 1422b1dbc..000000000 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.plugin.jsonhttp.service.impl - eclipse-plugin - - diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/Activator.java b/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/Activator.java deleted file mode 100644 index fe5d681c1..000000000 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.opentosca.bus.application.plugin.jsonhttp.service.impl; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.core.osgi.OsgiServiceRegistry; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.application.plugin.jsonhttp.service.impl.route.Route; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the JSON/HTTP-Application Bus-Plugin.
- *
- * - * The activator is needed to add and start the camel routes. The bundleID is used for generating - * the routing endpoint of this plugin. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - private static DefaultCamelContext camelContext; - - private static String bundleID; - - static String getBundleID() { - return bundleID; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework. BundleContext) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - - bundleID = bundleContext.getBundle().getSymbolicName(); - - camelContext = new OsgiDefaultCamelContext(bundleContext); - - camelContext.addRoutes(new Route()); - - camelContext.start(); - Activator.LOG.info("Application Bus JSON-HTTP plugin started!"); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.camelContext = null; - Activator.LOG.info("Application Bus JSON-HTTP plugin stopped!"); - } - -} diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/RequestProcessor.java b/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/RequestProcessor.java deleted file mode 100644 index cff5d4c4f..000000000 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/RequestProcessor.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.opentosca.bus.application.plugin.jsonhttp.service.impl.processor; - -import java.util.LinkedHashMap; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.json.simple.JSONObject; -import org.json.simple.JSONValue; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * RequestProcessor of the Application Bus-JSON/HTTP-Plugin.
- *
- * - * This processor handles the incoming requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class RequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(RequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - RequestProcessor.LOG.debug("Creation of the json request body..."); - - final String className = - exchange.getIn().getHeader(ApplicationBusConstants.CLASS_NAME.toString(), String.class); - final String operationName = - exchange.getIn().getHeader(ApplicationBusConstants.OPERATION_NAME.toString(), String.class); - - final LinkedHashMap params = exchange.getIn().getBody(LinkedHashMap.class); - - // JSON body creation - final JSONObject infoJSON = new JSONObject(); - infoJSON.put("class", className); - infoJSON.put("operation", operationName); - - final LinkedHashMap finalJSON = new LinkedHashMap<>(); - finalJSON.put("invocation-information", infoJSON); - if (params != null) { - finalJSON.put("params", params); - } - - final String finalJSONString = JSONValue.toJSONString(finalJSON); - - RequestProcessor.LOG.debug("Created json request body: {}", finalJSONString); - - exchange.getIn().setBody(finalJSONString); - - } - -} diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/ResponseProcessor.java b/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/ResponseProcessor.java deleted file mode 100644 index 5172e8ccf..000000000 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/ResponseProcessor.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.opentosca.bus.application.plugin.jsonhttp.service.impl.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.json.simple.JSONObject; -import org.json.simple.JSONValue; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * ResponseProcessor of the Application Bus-JSON/HTTP-Plugin.
- *
- * - * This processor handles the responses. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(ResponseProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - ResponseProcessor.LOG.debug("Parsing the response..."); - - final String response = exchange.getIn().getBody(String.class); - - final JSONObject obj = (JSONObject) JSONValue.parse(response); - final Object result = obj.get("result"); - - ResponseProcessor.LOG.debug("Response: {}", result); - - exchange.getIn().setBody(result); - - } - -} diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/route/Route.java b/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/route/Route.java deleted file mode 100644 index a45715e59..000000000 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/route/Route.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.opentosca.bus.application.plugin.jsonhttp.service.impl.route; - -import org.apache.camel.Exchange; -import org.apache.camel.Predicate; -import org.apache.camel.builder.PredicateBuilder; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.builder.SimpleBuilder; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; -import org.opentosca.bus.application.plugin.jsonhttp.service.impl.ApplicationBusJsonHttpPluginServiceImpl; -import org.opentosca.bus.application.plugin.jsonhttp.service.impl.processor.RequestProcessor; -import org.opentosca.bus.application.plugin.jsonhttp.service.impl.processor.ResponseProcessor; - -/** - * Route of the Application Bus-JSON/HTTP-Plugin.
- *
- * - * The endpoint of the JSON/HTTP-Plugin is created here. The Application Bus uses this endpoint to - * send the needed information to invoke an application. The request and response processing as well - * as the invocation itself are also handled in this route. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Route extends RouteBuilder { - - private static final String APPINVOKER_ENDPOINT_SUFFIX = "/OTABProxy/v1/appInvoker"; - - // returning json string indicating that the invocation is not finished yet - private static final String PENDING_STRING = "{\"status\":\"PENDING\"}"; - - // dummy endpoint; will be overwritten by HTTP_URI header - private static final String DUMMY_ENDPOINT = "http://dummyhost?throwExceptionOnFailure=false"; - - @Override - public void configure() throws Exception { - - final Predicate OK = header(Exchange.HTTP_RESPONSE_CODE).isEqualTo(200); - final Predicate PENDING = PredicateBuilder.and(OK, body().isEqualTo(PENDING_STRING)); - final Predicate RESULT_RECEIVED = PredicateBuilder.and(OK, PredicateBuilder.not(PENDING)); - - final SimpleBuilder INVOKE_ENDPOINT = simple("${header." - + ApplicationBusConstants.INVOCATION_ENDPOINT_URL.toString() + "}" + APPINVOKER_ENDPOINT_SUFFIX); - final SimpleBuilder POLL_ENDPOINT = simple("${header.Location}"); - - final RequestProcessor requestProcessor = new RequestProcessor(); - final ResponseProcessor responseProcessor = new ResponseProcessor(); - - from(ApplicationBusJsonHttpPluginServiceImpl.ENDPOINT).process(requestProcessor) - .setHeader(Exchange.HTTP_METHOD, constant("POST")) - .setHeader(Exchange.CONTENT_TYPE, - constant("application/json")) - .setHeader(Exchange.HTTP_URI, INVOKE_ENDPOINT) - .to(DUMMY_ENDPOINT).choice() - .when(header(Exchange.HTTP_RESPONSE_CODE).isEqualTo(202)) - .setHeader(Exchange.HTTP_URI, POLL_ENDPOINT) - .to("direct:polling").endChoice().otherwise() - .to("direct:throwException"); - - from("direct:polling").setHeader(Exchange.HTTP_METHOD, constant("GET")).to(DUMMY_ENDPOINT) - .convertBodyTo(String.class).choice().when(PENDING).delay(5000).to("direct:polling") - .endChoice().when(RESULT_RECEIVED).process(responseProcessor).endChoice().otherwise() - .to("direct:throwException"); - - from("direct:throwException").process(exchange -> exchange.getIn().setBody(new ApplicationBusExternalException( - exchange.getIn().getBody(String.class)))); - - } - -} diff --git a/org.opentosca.bus.application.plugin.service/META-INF/MANIFEST.MF b/org.opentosca.bus.application.plugin.service/META-INF/MANIFEST.MF deleted file mode 100644 index 7275e953a..000000000 --- a/org.opentosca.bus.application.plugin.service/META-INF/MANIFEST.MF +++ /dev/null @@ -1,9 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Interface for the Application Bus Plugins -Bundle-SymbolicName: org.opentosca.bus.application.plugin.service -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4" -Export-Package: org.opentosca.bus.application.plugin.service -Require-Bundle: org.opentosca.bus.application.model;bundle-version="1.0.0" diff --git a/org.opentosca.bus.application.plugin.service/build.properties b/org.opentosca.bus.application.plugin.service/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.bus.application.plugin.service/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.bus.application.plugin.service/pom.xml b/org.opentosca.bus.application.plugin.service/pom.xml deleted file mode 100644 index fb981824a..000000000 --- a/org.opentosca.bus.application.plugin.service/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.plugin.service - eclipse-plugin - - diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/META-INF/MANIFEST.MF b/org.opentosca.bus.application.plugin.soaphttp.service.impl/META-INF/MANIFEST.MF deleted file mode 100644 index f3f57eaab..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/META-INF/MANIFEST.MF +++ /dev/null @@ -1,31 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.application.plugin.soaphttp.service.impl -Bundle-SymbolicName: org.opentosca.bus.application.plugin.soaphttp.service.impl -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.application.plugin.soaphttp.service.impl.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: com.predic8.schema;version="1.2.2", - com.predic8.soamodel;version="1.2.2", - com.predic8.wsdl;version="1.2.2", - com.predic8.wstool.creator;version="1.2.2", - groovy.xml;version="1.8.6", - org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.cxf;version="2.10.4", - org.apache.camel.component.direct;version="2.10.4", - org.apache.camel.component.jetty;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.cxf.binding.soap;version="2.7.3", - org.apache.cxf.headers;version="2.7.3", - org.apache.cxf.helpers;version="2.7.3", - org.eclipse.osgi.util;version="1.1.0", - org.opentosca.bus.application.model.constants, - org.opentosca.bus.application.plugin.service, - org.opentosca.settings, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Service-Component: OSGI-INF/ApplicationBusPluginSoapHttpServiceImpl - component.xml -Require-Bundle: org.eclipse.equinox.ds;bundle-version="1.3.1" diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/OSGI-INF/ApplicationBusPluginSoapHttpServiceImpl - component.xml b/org.opentosca.bus.application.plugin.soaphttp.service.impl/OSGI-INF/ApplicationBusPluginSoapHttpServiceImpl - component.xml deleted file mode 100644 index 1981c68e5..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/OSGI-INF/ApplicationBusPluginSoapHttpServiceImpl - component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/build.properties b/org.opentosca.bus.application.plugin.soaphttp.service.impl/build.properties deleted file mode 100644 index 4ab6e2638..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ -source.. = src/ diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/pom.xml b/org.opentosca.bus.application.plugin.soaphttp.service.impl/pom.xml deleted file mode 100644 index 4f18d6ead..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.plugin.soaphttp.service.impl - eclipse-plugin - - diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/Activator.java b/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/Activator.java deleted file mode 100644 index 707200e7a..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/Activator.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.opentosca.bus.application.plugin.soaphttp.service.impl; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.application.plugin.soaphttp.service.impl.route.Route; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the SOAP/HTTP-Application Bus-Plug-in.
- *
- * - * - * The activator is needed to add and start the camel routes. The bundleID is - * used for generating the routing endpoint of this plugin. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - public static DefaultCamelContext camelContext; - - private static String bundleID; - - - static String getBundleID() { - return Activator.bundleID; - } - - /* - * (non-Javadoc) - * - * @see - * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext - * ) - */ - @Override - public void start(BundleContext bundleContext) throws Exception { - - Activator.bundleID = bundleContext.getBundle().getSymbolicName(); - - Activator.camelContext = new OsgiDefaultCamelContext(bundleContext); - Activator.camelContext.addRoutes(new Route()); - Activator.camelContext.start(); - Activator.LOG.info("Application Bus-SOAP-PLUGIN-STARTED"); - } - - /* - * (non-Javadoc) - * - * @see - * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.camelContext = null; - Activator.LOG.info("Application Bus-SOAP-PLUGIN-stopped"); - } - -} diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/ApplicationBusPluginSoapHttpServiceImpl.java b/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/ApplicationBusPluginSoapHttpServiceImpl.java deleted file mode 100644 index b0067442f..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/ApplicationBusPluginSoapHttpServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opentosca.bus.application.plugin.soaphttp.service.impl; - -import java.util.Arrays; -import java.util.List; - -import org.opentosca.bus.application.plugin.service.IApplicationBusPluginService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Application Bus-Plug-in for invoking a service with a SOAP message over HTTP. - *
- * - * The Plug-in gets needed information (like endpoint of the service or - * operation to invoke) from the Application Bus and creates a SOAP message out - * of it. If needed the Plug-in parses the WSDL of the service. The Plug-in - * supports synchronous request-response communication, asynchronous - * communication with callbacks and one-way invocation. - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - */ -public class ApplicationBusPluginSoapHttpServiceImpl implements IApplicationBusPluginService { - - - final private static Logger LOG = LoggerFactory.getLogger(ApplicationBusPluginSoapHttpServiceImpl.class); - - // Supported types defined in messages.properties. - private static final List invocationTypes = Arrays.asList("SOAP/HTTP"); - - // Routing endpoint of the Application Bus bundle - public static final String ENDPOINT = "direct-vm:" + Activator.getBundleID(); - - - @Override - public List getSupportedInvocationTypes() { - ApplicationBusPluginSoapHttpServiceImpl.LOG.debug("Supported Types: {}.", ApplicationBusPluginSoapHttpServiceImpl.invocationTypes); - - return ApplicationBusPluginSoapHttpServiceImpl.invocationTypes; - } - - @Override - public String getRoutingEndpoint() { - return ApplicationBusPluginSoapHttpServiceImpl.ENDPOINT; - } -} diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/AsyncProcessor.java b/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/AsyncProcessor.java deleted file mode 100644 index d52f6c992..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/AsyncProcessor.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.opentosca.bus.application.plugin.soaphttp.service.impl.processor; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.apache.camel.ConsumerTemplate; -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.Processor; -import org.apache.camel.ProducerTemplate; -import org.opentosca.bus.application.plugin.soaphttp.service.impl.Activator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.traversal.DocumentTraversal; -import org.w3c.dom.traversal.NodeFilter; -import org.w3c.dom.traversal.NodeIterator; - -/** - * Async-Processor of the Application Bus-SOAP/HTTP-Plug-in.
- * - * This processor manages the sending of the invocation message and matches - * incoming callback messages. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class AsyncProcessor implements Processor { - - - final private static Logger LOG = LoggerFactory.getLogger(AsyncProcessor.class); - - private static Map exchangeMap = Collections.synchronizedMap(new HashMap()); - - - @Override - public void process(Exchange exchange) throws Exception { - - AsyncProcessor.LOG.debug("Invoking the web service."); - - ProducerTemplate template = Activator.camelContext.createProducerTemplate(); - - ConsumerTemplate consumer = Activator.camelContext.createConsumerTemplate(); - - Document response = null; - - String messageID = exchange.getIn().getMessageId(); - - AsyncProcessor.LOG.debug("Storing exchange message with MessageID: {}", messageID); - - AsyncProcessor.exchangeMap.put(messageID, exchange); - - template.sendBody("direct:Invoke", exchange.getIn().getBody()); - - Exchange ex = null; - - while (response == null) { - - try { - - consumer.start(); - ex = consumer.receive("direct:Callback" + messageID); - consumer.stop(); - - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - Message mes = ex.getIn(); - - AsyncProcessor.LOG.debug("Got Message with ID: {}", messageID); - AsyncProcessor.LOG.debug("Stored MessageIDs: {}", AsyncProcessor.exchangeMap.keySet().toString()); - - if (AsyncProcessor.exchangeMap.containsKey(messageID)) { - AsyncProcessor.LOG.debug("MessageID found"); - exchange = AsyncProcessor.exchangeMap.get(messageID); - - response = mes.getBody(Document.class); - AsyncProcessor.exchangeMap.remove(messageID); - } - } - - AsyncProcessor.LOG.debug("Transforming Document to HashMap..."); - - HashMap responseMap = AsyncProcessor.docToMap(response, false); - - exchange.getIn().setBody(responseMap); - - AsyncProcessor.LOG.debug("Returning exchange with MessageID: {}", exchange.getIn().getMessageId()); - AsyncProcessor.LOG.debug("Returning body: {}", exchange.getIn().getBody().toString()); - - } - - /** - * Transfers s document to a map. - * - * @param document to be transfered to a map. - * @return transfered map. - */ - public static HashMap docToMap(Document document, boolean allowEmptyEntries) { - HashMap reponseMap = new HashMap(); - - DocumentTraversal traversal = (DocumentTraversal) document; - NodeIterator iterator = traversal.createNodeIterator(document.getDocumentElement(), NodeFilter.SHOW_ELEMENT, null, true); - - for (Node node = iterator.nextNode(); node != null; node = iterator.nextNode()) { - - String name = ((Element) node).getLocalName(); - StringBuilder content = new StringBuilder(); - NodeList children = node.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - if (child.getNodeType() == Node.TEXT_NODE) { - content.append(child.getTextContent()); - } - } - - if (allowEmptyEntries) { - reponseMap.put(name, content.toString()); - } else { - if (!content.toString().trim().isEmpty()) { - reponseMap.put(name, content.toString()); - } - } - - } - - return reponseMap; - } - - /** - * @return the keys of the map containing stored messageIds and exchange - * objects. - */ - public static Set getMessageIDs() { - return AsyncProcessor.exchangeMap.keySet(); - } -} diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/CallbackProcessor.java b/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/CallbackProcessor.java deleted file mode 100644 index aaa9f2124..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/CallbackProcessor.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.opentosca.bus.application.plugin.soaphttp.service.impl.processor; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.soap.MessageFactory; -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPMessage; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.cxf.binding.soap.SoapHeader; -import org.apache.cxf.headers.Header; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * Callback-Processor of the Application Bus-SOAP/HTTP-Plug-in.
- * - * This processor processes incoming soap messages. It checks if the messages - * are containing existing messageIDs. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class CallbackProcessor implements Processor { - - - final private static Logger LOG = LoggerFactory.getLogger(CallbackProcessor.class); - - - @Override - public void process(Exchange exchange) throws Exception { - - Set messageIDs = AsyncProcessor.getMessageIDs(); - - CallbackProcessor.LOG.debug("Stored messageIDs: {}", messageIDs.toString()); - - // copy SOAP headers in camel exchange header - @SuppressWarnings("unchecked") - List soapHeaders = (List) exchange.getIn().getHeader(Header.HEADER_LIST); - Element element; - if (soapHeaders != null) { - for (SoapHeader header : soapHeaders) { - element = (Element) header.getObject(); - exchange.getIn().setHeader(element.getLocalName(), element.getTextContent()); - } - } - - String message = exchange.getIn().getBody(String.class); - Map headers = exchange.getIn().getHeaders(); - - CallbackProcessor.LOG.debug("Searching the callback Message for a MessageID matching the stored ones..."); - - for (String messageID : messageIDs) { - - // checks if the callback message contains a stored messageID - if (message.matches("(?s).*\\s*[^a-zA-Z0-9-]" + messageID + "[^a-zA-Z0-9-]\\s*(?s).*") || headers.containsValue(messageID)) { - - CallbackProcessor.LOG.debug("Found MessageID: {}", messageID); - - MessageFactory messageFactory = MessageFactory.newInstance(); - - InputStream inputStream = new ByteArrayInputStream(message.getBytes("UTF-8")); - SOAPMessage soapMessage = messageFactory.createMessage(null, inputStream); - - exchange.getIn().setHeader("MessageID", messageID); - exchange.getIn().setHeader("AvailableMessageID", "true"); - - Document doc; - - try { - doc = soapMessage.getSOAPBody().extractContentAsDocument(); - exchange.getIn().setBody(doc); - - } catch (SOAPException e) { - - doc = soapMessage.getSOAPPart().getEnvelope().getOwnerDocument(); - - CallbackProcessor.LOG.warn("SOAP response body can't be parsed and/or isn't well formatted. Returning alternative response."); - exchange.getIn().setBody(doc); - } - - break; - - } - } - - } -} diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/HeaderProcessor.java b/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/HeaderProcessor.java deleted file mode 100644 index bb546ab1a..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/HeaderProcessor.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.opentosca.bus.application.plugin.soaphttp.service.impl.processor; - -import java.io.IOException; -import java.io.StringReader; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.cxf.CxfPayload; -import org.apache.cxf.binding.soap.SoapHeader; -import org.apache.cxf.helpers.DOMUtils; -import org.xml.sax.SAXException; - -/** - * Header-Processor of the Application Bus-SOAP/HTTP-Plug-in.
- * - * This processor copies all self defined header of the exchange object into - * SoapHeader of the outgoing Soap message. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class HeaderProcessor implements Processor { - - - @Override - public void process(Exchange exchange) throws Exception { - - @SuppressWarnings("unchecked") - CxfPayload payload = exchange.getIn().getBody(CxfPayload.class); - - Map headers = exchange.getIn().getHeaders(); - for (Map.Entry entry : headers.entrySet()) { - - if (entry.getKey().equalsIgnoreCase("ReplyTo")) { - - String xml1 = "" + entry.getValue().toString() + ""; - SoapHeader replyToSoapHeader = new SoapHeader(new QName("http://www.w3.org/2005/08/addressing", "ReplyTo"), DOMUtils.readXml(new StringReader(xml1)).getDocumentElement()); - payload.getHeaders().add(replyToSoapHeader); - - } else if (entry.getKey().equalsIgnoreCase("MessageID")) { - - String xml2 = "" + entry.getValue().toString() + ""; - SoapHeader messageIdSoapHeader = new SoapHeader(new QName("http://www.w3.org/2005/08/addressing", "MessageID"), DOMUtils.readXml(new StringReader(xml2)).getDocumentElement()); - payload.getHeaders().add(messageIdSoapHeader); - - } else { - - payload.getHeaders().add(this.getSoapHeader(entry.getKey(), entry.getValue().toString())); - - } - } - - exchange.getIn().setBody(payload); - - } - - /** - * Returns a SoapHeader - * - * @param key of the header - * @param content of the header - * @return SoapHeader - */ - private SoapHeader getSoapHeader(String key, String content) { - String xml = "<" + key + ">" + content + ""; - try { - return new SoapHeader(new QName(key), DOMUtils.readXml(new StringReader(xml)).getDocumentElement()); - } catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - - } - -} diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/RequestProcessor.java b/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/RequestProcessor.java deleted file mode 100644 index 5fa19663e..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/processor/RequestProcessor.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.opentosca.bus.application.plugin.soaphttp.service.impl.processor; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.Processor; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.opentosca.bus.application.plugin.soaphttp.service.impl.route.Route; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.predic8.wsdl.Binding; -import com.predic8.wsdl.BindingOperation; -import com.predic8.wsdl.Definitions; -import com.predic8.wsdl.WSDLParser; - -/** - * RequestProcessor of the Application Bus-SOAP/HTTP-Plugin.
- *
- * - * This processor handles the incoming requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class RequestProcessor implements Processor { - - - final private static Logger LOG = LoggerFactory.getLogger(RequestProcessor.class); - - - @Override - public void process(Exchange exchange) throws Exception { - - RequestProcessor.LOG.debug("Creation of the SOAP request body..."); - - Message message = exchange.getIn(); - - Object params = message.getBody(); - String operationName = message.getHeader(ApplicationBusConstants.OPERATION_NAME.toString(), String.class); - String endpoint = message.getHeader(ApplicationBusConstants.INVOCATION_ENDPOINT_URL.toString(), String.class); - - if (!endpoint.endsWith("?wsdl")) { - endpoint = endpoint.concat("?wsdl"); - } - - Map headers = new HashMap(); - - headers.put("endpoint", endpoint.replace("?wsdl", "")); - headers.put("MessageID", message.getMessageId()); - headers.put("ReplyTo", Route.CALLBACKADDRESS); - - message.setHeaders(headers); - - boolean foundFlag = false; - - Document document = null; - - if (params instanceof HashMap) { - - String rootElementNamespaceURI = null; - String rootElementName = null; - - @SuppressWarnings("unchecked") - HashMap paramsMap = (HashMap) params; - - WSDLParser parser = new WSDLParser(); - - RequestProcessor.LOG.info("Parsing WSDL at: {}.", endpoint); - - Definitions wsdl; - - // If wsdl is not accessible, try again (max wait 5 min) - int count = 0; - int maxTries = 30; - while (true) { - try { - wsdl = parser.parse(endpoint.toString()); - break; - } catch (Exception e) { - // handle exception - if (++count == maxTries) { - RequestProcessor.LOG.error("Unable to access the wsdl at: {}.", endpoint); - throw e; - } else { - RequestProcessor.LOG.warn("Problem accessing the wsdl at: {}. Retry... ({}/{})", endpoint, count, maxTries); - try { - Thread.sleep(10000); - } catch (InterruptedException e1) { - e1.printStackTrace(); - } - } - } - } - - // Jump-Label to stop both loops at once - searchOperation: for (Binding bind : wsdl.getBindings()) { - - RequestProcessor.LOG.debug("Binding: {}", bind); - - if (bind.getProtocol().toString().toLowerCase().contains("soap")) { - - for (BindingOperation op : bind.getOperations()) { - RequestProcessor.LOG.debug("Operation: {} =? {}", op.getName(), operationName); - - if (op.getName().equals(operationName)) { - String portType = bind.getPortType().getName(); - RequestProcessor.LOG.debug("PortType: {}", portType); - String rootElementWithPrefix = wsdl.getElementNameForOperation(operationName, portType); - com.predic8.schema.Element element = wsdl.getElementForOperation(operationName, portType); - rootElementName = element.getName(); - rootElementNamespaceURI = (String) element.getNamespace(rootElementWithPrefix.replace(":" + rootElementName, "")); - RequestProcessor.LOG.debug("Root ElementName: {} with NamespaceURI: {}", rootElementName, rootElementNamespaceURI); - - foundFlag = true; - - break searchOperation; - } - } - } - } - - if (foundFlag == false) { - RequestProcessor.LOG.error("No invokable operation found. Invocation aborted!"); - } - - document = this.mapToDoc(rootElementNamespaceURI, rootElementName, paramsMap); - - } - - if (params instanceof Document) { - - document = (Document) params; - } - - RequestProcessor.LOG.debug("Created SOAP request body: {}", document); - - exchange.getIn().setBody(document); - - } - - /** - * Transfers the paramsMap into a Document. - * - * @param rootElementNamespaceURI - * @param rootElementName - * @param paramsMap - * - * @return the created Document. - */ - private Document mapToDoc(String rootElementNamespaceURI, String rootElementName, HashMap paramsMap) { - - Document document; - - DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = null; - try { - documentBuilder = documentBuilderFactory.newDocumentBuilder(); - } catch (ParserConfigurationException e) { - RequestProcessor.LOG.error("Some error occured."); - e.printStackTrace(); - } - - document = documentBuilder.newDocument(); - - Element rootElement = document.createElementNS(rootElementNamespaceURI, rootElementName); - document.appendChild(rootElement); - - Element mapElement; - for (Entry entry : paramsMap.entrySet()) { - mapElement = document.createElement(entry.getKey()); - mapElement.setTextContent(entry.getValue()); - rootElement.appendChild(mapElement); - - } - - return document; - } - -} diff --git a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/route/Route.java b/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/route/Route.java deleted file mode 100644 index 93efe41a3..000000000 --- a/org.opentosca.bus.application.plugin.soaphttp.service.impl/src/org/opentosca/bus/application/plugin/soaphttp/service/impl/route/Route.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.opentosca.bus.application.plugin.soaphttp.service.impl.route; - -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.application.plugin.soaphttp.service.impl.ApplicationBusPluginSoapHttpServiceImpl; -import org.opentosca.bus.application.plugin.soaphttp.service.impl.processor.AsyncProcessor; -import org.opentosca.bus.application.plugin.soaphttp.service.impl.processor.CallbackProcessor; -import org.opentosca.bus.application.plugin.soaphttp.service.impl.processor.HeaderProcessor; -import org.opentosca.bus.application.plugin.soaphttp.service.impl.processor.RequestProcessor; -import org.opentosca.settings.Settings; - -/** - * Route of the Application Bus-SOAP/HTTP-Plugin.
- *
- * - * The endpoint of the SOAP/HTTP-Plugin is created here. The Application Bus - * uses this endpoint to send the needed information to invoke an application. - * The request and response processing as well as the invocation itself are also - * handled in this route. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Route extends RouteBuilder { - - - public final static String CALLBACKADDRESS = "http://"+ Settings.OPENTOSCA_CONTAINER_HOSTNAME +":8099/callback"; - - - @Override - public void configure() throws Exception { - - final String ENDPOINT = "cxf:${header[endpoint]}?dataFormat=PAYLOAD&loggingFeatureEnabled=true"; - - RequestProcessor requestProcessor = new RequestProcessor(); - CallbackProcessor callbackProcessor = new CallbackProcessor(); - AsyncProcessor asyncProcessor = new AsyncProcessor(); - HeaderProcessor headeProcessor = new HeaderProcessor(); - - this.from(ApplicationBusPluginSoapHttpServiceImpl.ENDPOINT).process(requestProcessor).process(asyncProcessor).end(); - - this.from("direct:Invoke").process(headeProcessor).recipientList(this.simple(ENDPOINT)).end(); - - this.from("jetty:" + Route.CALLBACKADDRESS).process(callbackProcessor).choice().when(this.header("AvailableMessageID").isEqualTo("true")).recipientList(this.simple("direct:Callback${header.MessageID}")).end(); - } - -} diff --git a/org.opentosca.bus.application.service.impl/META-INF/MANIFEST.MF b/org.opentosca.bus.application.service.impl/META-INF/MANIFEST.MF deleted file mode 100644 index 60fec74ea..000000000 --- a/org.opentosca.bus.application.service.impl/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Application Bus Service Impl -Bundle-SymbolicName: org.opentosca.bus.application.service.impl -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.application.service.impl.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.directvm;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.6.4" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.bus.application.model;bundle-version="1.0.0", - org.opentosca.bus.application.service;bundle-version="1.0.0", - org.opentosca.bus.application.plugin.service;bundle-version="1.0.0" -Service-Component: OSGI-INF/* -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.bus.application.service.impl/OSGI-INF/ApplicationBusPluginServiceHandler_component.xml b/org.opentosca.bus.application.service.impl/OSGI-INF/ApplicationBusPluginServiceHandler_component.xml deleted file mode 100644 index cda128e4c..000000000 --- a/org.opentosca.bus.application.service.impl/OSGI-INF/ApplicationBusPluginServiceHandler_component.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.bus.application.service.impl/OSGI-INF/ApplicationBusServiceImpl_component.xml b/org.opentosca.bus.application.service.impl/OSGI-INF/ApplicationBusServiceImpl_component.xml deleted file mode 100644 index 2f428e626..000000000 --- a/org.opentosca.bus.application.service.impl/OSGI-INF/ApplicationBusServiceImpl_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.application.service.impl/OSGI-INF/InstanceDataServiceHandler_component.xml b/org.opentosca.bus.application.service.impl/OSGI-INF/InstanceDataServiceHandler_component.xml deleted file mode 100644 index a42c02926..000000000 --- a/org.opentosca.bus.application.service.impl/OSGI-INF/InstanceDataServiceHandler_component.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.bus.application.service.impl/OSGI-INF/ToscaServiceHandler_component.xml b/org.opentosca.bus.application.service.impl/OSGI-INF/ToscaServiceHandler_component.xml deleted file mode 100644 index 9bf5829c5..000000000 --- a/org.opentosca.bus.application.service.impl/OSGI-INF/ToscaServiceHandler_component.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/org.opentosca.bus.application.service.impl/build.properties b/org.opentosca.bus.application.service.impl/build.properties deleted file mode 100644 index 686be4f32..000000000 --- a/org.opentosca.bus.application.service.impl/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.application.service.impl/pom.xml b/org.opentosca.bus.application.service.impl/pom.xml deleted file mode 100644 index 298e516be..000000000 --- a/org.opentosca.bus.application.service.impl/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.service.impl - eclipse-plugin - - diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/Activator.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/Activator.java deleted file mode 100644 index a320650ed..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/Activator.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.opentosca.bus.application.service.impl; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.core.osgi.OsgiServiceRegistry; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.application.service.impl.route.GetResultRoute; -import org.opentosca.bus.application.service.impl.route.InvokeOperationRoute; -import org.opentosca.bus.application.service.impl.route.IsFinishedRoute; -import org.opentosca.bus.application.service.impl.route.MainRoute; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the Application Bus.
- *
- * - * The activator is needed to add and start the camel routes. The bundleID is used for generating - * the routing endpoint of the Application Bus. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - private static DefaultCamelContext camelContext; - - private static String bundleID; - - static String getBundleID() { - return bundleID; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework. BundleContext) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - - // get bundle name, used as routing endpoint - bundleID = bundleContext.getBundle().getSymbolicName(); - - camelContext = new OsgiDefaultCamelContext(bundleContext); - - // register routes - camelContext.addRoutes(new MainRoute()); - camelContext.addRoutes(new InvokeOperationRoute()); - camelContext.addRoutes(new IsFinishedRoute()); - camelContext.addRoutes(new GetResultRoute()); - - // start camel context - camelContext.start(); - - Activator.LOG.info("Application Bus started."); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - camelContext = null; - - Activator.LOG.info("Application Bus stopped."); - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/ApplicationBusServiceImpl.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/ApplicationBusServiceImpl.java deleted file mode 100644 index 7e6f9cc7c..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/ApplicationBusServiceImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.opentosca.bus.application.service.impl; - -import org.opentosca.bus.application.service.IApplicationBusService; - -/** - * Application Bus implementation.
- *
- * - * The routing endpoint is defined here. The Application Bus APIs need this endpoint to send - * requests to the Application Bus. The endpoint is handed over during the bind process in the - * respective API implementation. - * - * - * @see IApplicationBusService - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -public class ApplicationBusServiceImpl implements IApplicationBusService { - - // Routing endpoint of the Application Bus bundle - public static final String ENDPOINT = "direct-vm:" + Activator.getBundleID(); - - - @Override - public String getRoutingEndpoint() { - return ENDPOINT; - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/ContainerProxy.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/ContainerProxy.java deleted file mode 100644 index 3940653ab..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/ContainerProxy.java +++ /dev/null @@ -1,619 +0,0 @@ -package org.opentosca.bus.application.service.impl; - -import java.io.StringWriter; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.opentosca.bus.application.service.impl.servicehandler.InstanceDataServiceHandler; -import org.opentosca.bus.application.service.impl.servicehandler.ToscaServiceHandler; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.instance.NodeInstance; -import org.opentosca.container.core.model.instance.ServiceInstance; -import org.opentosca.container.core.tosca.convention.Utils; -import org.opentosca.container.core.tosca.model.TDeploymentArtifact; -import org.opentosca.container.core.tosca.model.TEntityTemplate; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TNodeTypeImplementation; -import org.opentosca.container.core.tosca.model.TServiceTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * - * This class is used as a proxy to the ToscaEngineService & InstanceDataService. - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - * @TODO prototype: refactoring needed, integrate new methods into the ToscaEngineService and use - * them instead of xml parsing here. - * - */ -public class ContainerProxy { - - static final private String NAMESPACE = "http://www.uni-stuttgart.de/opentosca"; - static final private String INTERFACES_PROPERTIES_NAME = "ApplicationInterfacesProperties"; - static final private String INTERFACE_INFORMATIONS = "ApplicationInterfaceInformations"; - static final private String INTERFACE_INFORMATION = "ApplicationInterfaceInformation"; - static final private String RELATIVE_ENDPOINT = "Endpoint"; - static final private String PORT = "Port"; - static final private String INVOCATION_TYPE = "InvocationType"; - - static final private String HOSTED_ON_NAMESPACE = "http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes"; - static final private String HOSTED_ON_LOCALPART = "HostedOn"; - - final private static Logger LOG = LoggerFactory.getLogger(ContainerProxy.class); - - - /** - * @param serviceInstanceID - * @param nodeInstanceID - * @param nodeTemplateID - * @return NodeInstance with specified ID - */ - public static NodeInstance getNodeInstance(final Integer serviceInstanceID, final Integer nodeInstanceID, - final String nodeTemplateID) { - - ContainerProxy.LOG.debug("Searching NodeInstance with serviceInstanceID: " + serviceInstanceID - + " nodeInstanceID: " + nodeInstanceID + " nodeTemplateID: " + nodeTemplateID); - - try { - - List nodeInstances; - - if (nodeInstanceID == null) { - - final String namespace = getServiceInstance(serviceInstanceID).getServiceTemplateID().getNamespaceURI(); - final QName nodeTemplateQName = new QName(namespace, nodeTemplateID); - nodeInstances = InstanceDataServiceHandler.getInstanceDataService() - .getNodeInstances(null, nodeTemplateQName, null, - new URI(serviceInstanceID.toString())); - - if (nodeInstances.size() > 0) { - return nodeInstances.get(0); - } - - } else { - - nodeInstances = - InstanceDataServiceHandler.getInstanceDataService() - .getNodeInstances(new URI(nodeInstanceID.toString()), null, null, null); - - for (final NodeInstance nodeInstance : nodeInstances) { - if (nodeInstance.getId() == nodeInstanceID) { - return nodeInstance; - } - } - } - - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - - ContainerProxy.LOG.warn("No matching NodeInstance found."); - return null; - } - - /** - * @param id - * @return ServiceInstance with specified ID - */ - protected static ServiceInstance getServiceInstance(final Integer id) { - - ContainerProxy.LOG.debug("Searching ServiceInstance with ID: {}", id); - - try { - final List instances = - InstanceDataServiceHandler.getInstanceDataService().getServiceInstances(new URI(id.toString()), null, - null); - - for (final ServiceInstance instance : instances) { - if (instance.getDBId() == id) { - ContainerProxy.LOG.debug("ServiceInstance with matching ID found."); - return instance; - } - } - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - ContainerProxy.LOG.warn("No ServiceInstance with matching ID found."); - return null; - } - - /** - * Searches for NodeTypeImplementations and their DeploymentArtifacts as well as their - * ArtifactTemplates of the specified NodeType. If the needed properties are found, they are - * returned. - * - * - * @param csarID - * @param nodeTypeName - * @param interfaceName - * @return specified properties as Node - */ - public static Node getPropertiesNode(final CSARID csarID, final QName nodeTypeName, final String interfaceName) { - - ContainerProxy.LOG.debug("Searching ArtifactTemplate defining needed properties for Interface: " + interfaceName - + " of NodeType: " + nodeTypeName + "inside of CSAR: " + csarID); - - final List nodeTypeImplementationsIDs = - ToscaServiceHandler.getToscaEngineService().getTypeImplementationsOfType(csarID, nodeTypeName); - - ContainerProxy.LOG.debug("The NodeType: " + nodeTypeName + " has " + nodeTypeImplementationsIDs.size() - + " NodeTypeImplementations."); - - for (final QName nodeTypeImplementationID : nodeTypeImplementationsIDs) { - - // get the NodeTypeImplementation - final TNodeTypeImplementation nodeTypeImplementation = - (TNodeTypeImplementation) ToscaServiceHandler.getToscaEngineService().getToscaReferenceMapper() - .getJAXBReference(csarID, nodeTypeImplementationID); - - // if there are DAs - if (nodeTypeImplementation.getDeploymentArtifacts() != null) { - - ContainerProxy.LOG.debug("The NodeTypeImplementation: " + nodeTypeImplementation.getName() + " has " - + nodeTypeImplementation.getDeploymentArtifacts().getDeploymentArtifact().size() - + " DeploymentArtifacts."); - - for (final TDeploymentArtifact da : nodeTypeImplementation.getDeploymentArtifacts() - .getDeploymentArtifact()) { - - ContainerProxy.LOG.debug("- {}", da.getName()); - ContainerProxy.LOG.debug("Searching for ArtifactTemplates."); - - final QName artifactRef = da.getArtifactRef(); - - if (artifactRef != null) { - - ContainerProxy.LOG.debug("ArtifactTemplate for DA: " + da.getName() + " found: " + artifactRef - + ". Getting the properties of it."); - - final Document properties = - ToscaServiceHandler.getToscaEngineService().getPropertiesOfAArtifactTemplate(csarID, - artifactRef); - - if (properties != null) { - - ContainerProxy.LOG.debug("Properties of ArtifactTemplate: {} found.", artifactRef); - ContainerProxy.LOG.debug("Getting the {} elements if existing.", - INTERFACES_PROPERTIES_NAME); - - // get ApplicationInterfacesProperties - final NodeList appPropsList = - properties.getElementsByTagNameNS(NAMESPACE, INTERFACES_PROPERTIES_NAME); - - ContainerProxy.LOG.debug(appPropsList.getLength() + " " + INTERFACES_PROPERTIES_NAME - + " elements found."); - - boolean hostEndpointSpecified = false; - boolean portSpecified = false; - boolean invocationTypeSpecified = false; - boolean interfaceFound = false; - - Node propNode = null; - - for (int i = 0; i < appPropsList.getLength(); i++) { - - hostEndpointSpecified = false; - portSpecified = false; - invocationTypeSpecified = false; - interfaceFound = false; - - ContainerProxy.LOG.debug("Check if information are specified for the correct Interface."); - - propNode = appPropsList.item(i); - - // get properties like endpoint or - // invocationType - final NodeList appProps = propNode.getChildNodes(); - - for (int i2 = 0; i2 < appProps.getLength(); i2++) { - - final Node addProp = appProps.item(i2); - - if (addProp.getNodeType() == Node.ELEMENT_NODE) { - - if (addProp.getLocalName().equals(RELATIVE_ENDPOINT)) { - ContainerProxy.LOG.debug("Endpoint property found."); - hostEndpointSpecified = true; - - } else if (addProp.getLocalName().equals(PORT)) { - ContainerProxy.LOG.debug("Port property found."); - portSpecified = true; - - } else if (addProp.getLocalName().equals(INVOCATION_TYPE)) { - ContainerProxy.LOG.debug("InvocationType property found."); - invocationTypeSpecified = true; - - } else if (addProp.getLocalName().equals(INTERFACE_INFORMATIONS)) { - - // check if interface matches - final NodeList appInvInterfaceInfo = - ((Element) addProp).getElementsByTagNameNS(NAMESPACE, - INTERFACE_INFORMATION); - - ContainerProxy.LOG.debug(INTERFACE_INFORMATION + " for " - + +appInvInterfaceInfo.getLength() + " Interfaces found."); - - for (int i3 = 0; i3 < appInvInterfaceInfo.getLength(); i3++) { - - final String interfName = - appInvInterfaceInfo.item(i3).getAttributes().getNamedItem("name") - .getNodeValue(); - - if (interfName.equals(interfaceName)) { - interfaceFound = true; - ContainerProxy.LOG.debug("Properties for interface: {} found.", - interfaceName); - - } - } - } - } - } - } - if (hostEndpointSpecified && portSpecified && invocationTypeSpecified && interfaceFound) { - ContainerProxy.LOG.debug("Properties with all needed information(Endpoint & InvocationType) for interface: " - + interfaceName + " of NodeType: " + nodeTypeName + " inside CSAR: " + csarID - + " found!"); - return propNode; - } - } else { - ContainerProxy.LOG.debug("ArtifactTemplate : {} has no specified properties.", artifactRef); - } - } else { - ContainerProxy.LOG.debug("No ArtifactTemplate for DA: {} found.", da.getName()); - } - } - } else { - ContainerProxy.LOG.debug("The NodeTypeImplementation {} has no DeploymentArtifacts.", - nodeTypeImplementation.getName()); - } - } - ContainerProxy.LOG.debug("No ArtifactTemplate with needed properties for interface: " + interfaceName - + " of NodeType: " + nodeTypeName + " inside CSAR: " + csarID + " found!"); - return null; - } - - /** - * @param propNode - * @return relative endpoint, specified in properties (as Endpoint property). - */ - public static String getRelativeEndpoint(final Node propNode) { - - // get properties like endpoint or - // invocationType - final NodeList appProps = propNode.getChildNodes(); - - for (int i = 0; i < appProps.getLength(); i++) { - - final Node addProp = appProps.item(i); - - if (addProp.getNodeType() == Node.ELEMENT_NODE) { - - if (addProp.getLocalName().equals(RELATIVE_ENDPOINT)) { - - final String hostEndpoint = addProp.getTextContent().trim(); - ContainerProxy.LOG.debug("Endpoint property: {}", hostEndpoint); - return hostEndpoint; - - } - } - } - return null; - } - - /** - * @param propNode - * @return port, specified in properties (as Port property). - */ - public static Integer getPort(final Node propNode) { - - // get properties like endpoint or - // invocationType - final NodeList appProps = propNode.getChildNodes(); - - for (int i = 0; i < appProps.getLength(); i++) { - - final Node addProp = appProps.item(i); - - if (addProp.getNodeType() == Node.ELEMENT_NODE) { - - if (addProp.getLocalName().equals(PORT)) { - - final Integer port = Integer.parseInt(addProp.getTextContent().trim()); - ContainerProxy.LOG.debug("Port property: {}", port); - return port; - - } - } - } - return null; - } - - /** - * @param propNode - * @return invocationType, specified in properties (as InvocationType property). - */ - public static String getInvocationType(final Node propNode) { - - // get properties like endpoint or - // invocationType - final NodeList appProps = propNode.getChildNodes(); - - for (int i = 0; i < appProps.getLength(); i++) { - - final Node addProp = appProps.item(i); - - if (addProp.getNodeType() == Node.ELEMENT_NODE) { - - if (addProp.getLocalName().equals(INVOCATION_TYPE)) { - final String invocationType = addProp.getTextContent().trim(); - ContainerProxy.LOG.debug("InvocationType property: {}", invocationType); - return invocationType; - - } - } - } - return null; - } - - /** - * @param propNode - * @param interfaceName - * @return implementing class specified in the properties of the specified interface - */ - public static String getClass(final Node propNode, final String interfaceName) { - - // get properties like endpoint or - // invocationType - final NodeList appProps = propNode.getChildNodes(); - - for (int i = 0; i < appProps.getLength(); i++) { - - final Node addProp = appProps.item(i); - - if (addProp.getNodeType() == Node.ELEMENT_NODE) { - - if (addProp.getLocalName().equals(INTERFACE_INFORMATIONS)) { - - // check if interface matches - final NodeList appInvInterfaceInfo = - ((Element) addProp).getElementsByTagNameNS(NAMESPACE, INTERFACE_INFORMATION); - - ContainerProxy.LOG.debug(INTERFACE_INFORMATIONS + " for " + +appInvInterfaceInfo.getLength() - + " Interfaces found."); - - for (int i2 = 0; i2 < appInvInterfaceInfo.getLength(); i2++) { - - final String interfName = - appInvInterfaceInfo.item(i2).getAttributes().getNamedItem("name").getNodeValue(); - - if (interfName.equals(interfaceName)) { - final String className = - appInvInterfaceInfo.item(i2).getAttributes().getNamedItem("class").getNodeValue(); - ContainerProxy.LOG.debug("Class property: {}", className); - return className; - - } - } - } - } - } - return null; - } - - /** - * @param csarID - * @param serviceTemplateID - * @param nodeTypeQName - * @return name of a NodeTemplate of the specified NodeType inside of the specified - * serviceTemplate & csar - */ - protected static String getANodeTemplateNameOfNodeType(final CSARID csarID, final QName serviceTemplateID, - final QName nodeTypeQName) { - - ContainerProxy.LOG.debug("Searching NodeTemplate of NodeType: " + nodeTypeQName + " in the ServiceTemplate: " - + serviceTemplateID + " inside the CSAR: " + csarID); - - // get the ServiceTemplate - final TServiceTemplate serviceTemplate = - (TServiceTemplate) ToscaServiceHandler.getToscaEngineService().getToscaReferenceMapper() - .getJAXBReference(csarID, serviceTemplateID); - - for (final TEntityTemplate entity : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - - TNodeTemplate nodeTemplate = new TNodeTemplate(); - - // get NodeTemplate - if (entity instanceof TNodeTemplate) { - - nodeTemplate = (TNodeTemplate) entity; - - if (nodeTemplate.getType() != null) { - - if (nodeTemplate.getType().equals(nodeTypeQName)) { - - final String nodeTemplateID = nodeTemplate.getId(); - ContainerProxy.LOG.debug("NodeTemplate of NodeType: " + nodeTypeQName - + " in the ServiceTemplate: " + serviceTemplateID + " inside the CSAR: " + csarID - + " found. NodeTemplateID: " + nodeTemplateID); - return nodeTemplateID; - } - } - } - } - ContainerProxy.LOG.debug("No NodeTemplate of NodeType: " + nodeTypeQName + " in the ServiceTemplate: " - + serviceTemplateID + " inside the CSAR: " + csarID + " found."); - return null; - } - - /** - * Returns the first NodeTemplate underneath the defined NodeTemplate containing the IP - * property. - * - * @param csarID - * @param serviceTemplateID - * @param nodeTemplateID - * @return name of the first NodeTemplate underneath the defined NodeTemplate containing the IP - * property. - * - */ - public static String getHostedOnNodeTemplateWithSpecifiedIPProperty(final CSARID csarID, - final QName serviceTemplateID, - String nodeTemplateID) { - - ContainerProxy.LOG.debug("Searching NodeTemplate with specified IP-Property underneath the NodeTemplate: " - + nodeTemplateID + " of the ServiceTemplate :" + serviceTemplateID + " inside the CSAR: " + csarID); - - Document props = ToscaServiceHandler.getToscaEngineService().getPropertiesOfTemplate(csarID, serviceTemplateID, - nodeTemplateID); - - final QName relationshipType = new QName(HOSTED_ON_NAMESPACE, HOSTED_ON_LOCALPART); - - while (nodeTemplateID != null && getIpProperty(props) == null) { - - ContainerProxy.LOG.debug("{} isn't the searched NodeTemplate.", nodeTemplateID); - ContainerProxy.LOG.debug("Getting the underneath Node for checking if it is the searched NodeTemplate."); - - nodeTemplateID = - ToscaServiceHandler.getToscaEngineService().getRelatedNodeTemplateID(csarID, serviceTemplateID, - nodeTemplateID, relationshipType); - - if (nodeTemplateID != null) { - ContainerProxy.LOG.debug("Checking if the underneath Node: {} is the searched NodeTemplate.", - nodeTemplateID); - - props = ToscaServiceHandler.getToscaEngineService().getPropertiesOfTemplate(csarID, serviceTemplateID, - nodeTemplateID); - - } else { - ContainerProxy.LOG.debug("No underneath Node found."); - } - } - - if (nodeTemplateID != null) { - ContainerProxy.LOG.debug("NodeTemplate with specified IP-Property in the ServiceTemplate: " - + serviceTemplateID + " inside the CSAR: " + csarID + " found: " + nodeTemplateID); - } else { - ContainerProxy.LOG.debug("No NodeTemplate with specified IP-Property in the ServiceTemplate: " - + serviceTemplateID + " inside the CSAR: " + csarID + " found."); - } - return nodeTemplateID; - } - - /** - * - * Returns the in the InstanceDataService stored IP property of the specified ServiceInstance & - * NodeTemplate. - * - * - * @param serviceInstanceID - * @param nodeTemplateQName - * @return IP property - */ - public static URL getIpFromInstanceDataProperties(final URI serviceInstanceID, final QName nodeTemplateQName) { - - ContainerProxy.LOG.debug("Getting IP-Property from InstanceDataService of NodeTemplate: " + nodeTemplateQName - + " of ServiceInstanceID: " + serviceInstanceID + "."); - - final List nodeInstances = - InstanceDataServiceHandler.getInstanceDataService().getNodeInstances(null, nodeTemplateQName, null, - serviceInstanceID); - - for (final NodeInstance nodeInstance : nodeInstances) { - - final Document props = nodeInstance.getProperties(); - - final String ip = getIpProperty(props); - - if (ip != null) { - ContainerProxy.LOG.debug("IP-Property from InstanceDataService of NodeTemplate: " + nodeTemplateQName - + " ServiceInstanceID: " + serviceInstanceID + " found: " + ip); - try { - return new URL(ip); - } - catch (final MalformedURLException e) { - e.printStackTrace(); - } - } - } - ContainerProxy.LOG.debug("No IP-Property from InstanceDataService of NodeTemplate: " + nodeTemplateQName - + " ServiceInstanceID: " + serviceInstanceID + " found."); - return null; - } - - /** - * @param props to check - * @return IP property, if exist. Otherwise null. - */ - private static String getIpProperty(final Document props) { - - if (props != null) { - - ContainerProxy.LOG.debug("Checking if IP-Property is defined in the xml document: " + docToString(props)); - - final List knownIpProperties = Utils.getSupportedVirtualMachineIPPropertyNames(); - - for (final String ipProperty : knownIpProperties) { - - final NodeList list = props.getElementsByTagName(ipProperty); - - if (list.getLength() > 0) { - final String ip = list.item(0).getTextContent(); - ContainerProxy.LOG.debug("Property: {} is defined: {}", ipProperty, ip); - return ip; - } - - } - - } - ContainerProxy.LOG.debug("No IP-Property defined."); - return null; - } - - /** - * Transforms a document into a String. - * - * @param doc - * @return document content as String. - */ - private static String docToString(final Document doc) { - String output = null; - final TransformerFactory tf = TransformerFactory.newInstance(); - Transformer transformer; - try { - transformer = tf.newTransformer(); - transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); - final StringWriter writer = new StringWriter(); - transformer.transform(new DOMSource(doc), new StreamResult(writer)); - output = writer.getBuffer().toString().replaceAll("\n|\r", ""); - } - catch (final TransformerException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return output; - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/QueueMap.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/QueueMap.java deleted file mode 100644 index 29f995dbf..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/QueueMap.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.opentosca.bus.application.service.impl.model; - -import java.util.concurrent.ConcurrentHashMap; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * Map that manages the requests. RequestID is used as key of the map. The value - * of the map indicates if the invocation has finished or not. - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class QueueMap { - - final private static Logger LOG = LoggerFactory.getLogger(QueueMap.class); - - private static ConcurrentHashMap queue = new ConcurrentHashMap<>(); - - /** - * Inserts an entry into the queue (if not already existing) and set it to finished. - * - * @param id of the request - */ - public static void finished(final String id) { - - QueueMap.LOG.debug("Request with ID: {} has finished.", id); - - queue.put(id, true); - } - - /** - * Inserts an entry into the queue and set it to notFinished. Only if the id not already exists. - * - * @param id of the request - */ - public static void notFinished(final String id) { - - QueueMap.LOG.debug("Request with ID: {} hasn't finished yet.", id); - - queue.putIfAbsent(id, false); - } - - /** - * Inserts an entry into the queue. - * - * @param id of the request - * @param isFinished specifies if the invocation has finished or not - */ - public static void put(final String id, final Boolean isFinished) { - - QueueMap.LOG.debug("RequestID: {}, isFinished: {}", id, isFinished); - - queue.put(id, isFinished); - } - - /** - * @param id of the request - * @return true if the invocation has finished. Otherwise false - */ - public static boolean hasFinished(final String id) { - - return queue.get(id); - } - - /** - * @param id of the request - * @return true if the queue contains the specified requestID. Otherwise false - */ - public static boolean containsID(final String id) { - return queue.containsKey(id); - } - - /** - * Removes the entry with the specified requestID from the queue. - * - * @param id of the request - */ - public static void remove(final String id) { - queue.remove(id); - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/RequestID.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/RequestID.java deleted file mode 100644 index 63bb82df2..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/RequestID.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.opentosca.bus.application.service.impl.model; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * - * Manages the requestIDs needed to correlate the invocation-requests, the isFinished-requests as - * well as the getResult-requests. - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class RequestID { - - private static AtomicLong incrementer = new AtomicLong(0); - - /** - * @return requestID - */ - public synchronized static Long getNextID() { - - final Long id = incrementer.getAndIncrement(); - - // For the unlikely case, that MAX_Value is reached, begin with 0 - // again. Assumption: old requests were processed in the mean time. - if (id == Long.MAX_VALUE) { - incrementer.set(0); - } - - return id; - } -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/ResultMap.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/ResultMap.java deleted file mode 100644 index d1d684cee..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/model/ResultMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.opentosca.bus.application.service.impl.model; - -import java.util.concurrent.ConcurrentHashMap; - -/** - * - * Map that manages the invocation results. RequestID is used as key of the map. The - * value of the map is the result of the invocation. Or null if the invocation - * failed. - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ResultMap { - - private static ConcurrentHashMap invocations = new ConcurrentHashMap<>(); - - /** - * @param id of the request - * @param obj result of the invocation. - */ - public static void put(final String id, final Object obj) { - invocations.put(id, obj); - } - - /** - * @param id - * @return result of the invocation. Void if the invoked method was of return type - * void. null if the invocation failed. - */ - public static Object get(final String id) { - return invocations.get(id); - } - - /** - * @param id of the request - * @return true if the map contains the specified requestID. Otherwise false - */ - public static boolean containsID(final String id) { - return invocations.containsKey(id); - } - - /** - * Removes the entry with the specified requestID from the map. - * - * @param id of the request - */ - public static void remove(final String id) { - invocations.remove(id); - } -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/GetResultProcessor.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/GetResultProcessor.java deleted file mode 100644 index 449218283..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/GetResultProcessor.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.opentosca.bus.application.service.impl.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; -import org.opentosca.bus.application.service.impl.model.QueueMap; -import org.opentosca.bus.application.service.impl.model.ResultMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * GetResultProcessor of the Application Bus.
- *
- * - * This processor handles "getResult" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class GetResultProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(GetResultProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - final String requestID = exchange.getIn().getBody(String.class); - - GetResultProcessor.LOG.debug("getResult request received. RequestID: {}", requestID); - - if (ResultMap.containsID(requestID)) { - - GetResultProcessor.LOG.debug("Getting result."); - - final Object result = ResultMap.get(requestID); - - // "Garbage collection": Remove polled responses. Maybe - // client should actively delete it. - ResultMap.remove(requestID); - QueueMap.remove(requestID); - - exchange.getIn().setBody(result); - - } else if (!QueueMap.containsID(requestID)) { - GetResultProcessor.LOG.warn("Unknown RequestID: {}", requestID); - exchange.getIn().setBody(new ApplicationBusInternalException("Unknown RequestID: " + requestID)); - } else { - GetResultProcessor.LOG.warn("Error while invoking specified method."); - exchange.getIn().setBody(new ApplicationBusInternalException("Error while invoking specified method.")); - } - - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/InvocationRequestProcessor.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/InvocationRequestProcessor.java deleted file mode 100644 index 11ab1a645..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/InvocationRequestProcessor.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.opentosca.bus.application.service.impl.processor; - -import java.net.MalformedURLException; -import java.net.URL; - -import javax.xml.namespace.QName; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.Processor; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; -import org.opentosca.bus.application.service.impl.ContainerProxy; -import org.opentosca.bus.application.service.impl.route.InvokeOperationRoute; -import org.opentosca.bus.application.service.impl.servicehandler.ApplicationBusPluginServiceHandler; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.instance.NodeInstance; -import org.opentosca.container.core.model.instance.ServiceInstance; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Node; - -/** - * InvocationRequestProcessor of the Application Bus.
- *
- * - * This processor handles "invokeOperation" requests. Needed information are collected in order to - * determine the endpoint of the NodeTemplate of which the specified method should be invoked. The - * effective invocation is done by the Application Bus plugins depending on their supporting - * invocation types. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class InvocationRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(InvocationRequestProcessor.class); - - - @Override - public void process(final Exchange exchange) throws Exception { - - InvocationRequestProcessor.LOG.info("InvokeOperation request processing started..."); - - final Message message = exchange.getIn(); - - final Integer serviceInstanceID = - message.getHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), Integer.class); - InvocationRequestProcessor.LOG.debug("serviceInstanceID: {}", serviceInstanceID); - - String nodeTemplateID = message.getHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), String.class); - InvocationRequestProcessor.LOG.debug("nodeTemplateID: {}", nodeTemplateID); - - final Integer nodeInstanceID = - message.getHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), Integer.class); - InvocationRequestProcessor.LOG.debug("nodeInstanceID: {}", nodeInstanceID); - - final String interfaceName = message.getHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), String.class); - InvocationRequestProcessor.LOG.debug("interfaceName: {}", interfaceName); - - final String operationName = message.getHeader(ApplicationBusConstants.OPERATION_NAME.toString(), String.class); - InvocationRequestProcessor.LOG.debug("operationName: {}", operationName); - - String invocationType = null; - String className = null; - URL endpoint = null; - - final NodeInstance nodeInstance = - ContainerProxy.getNodeInstance(serviceInstanceID, nodeInstanceID, nodeTemplateID); - - if (nodeInstance != null) { - - final QName nodeType = nodeInstance.getNodeType(); - final ServiceInstance serviceInstance = nodeInstance.getServiceInstance(); - final CSARID csarID = serviceInstance.getCSAR_ID(); - final QName serviceTemplateID = serviceInstance.getServiceTemplateID(); - - if (nodeTemplateID == null) { - nodeTemplateID = nodeInstance.getNodeTemplateID().getLocalPart(); - } - - InvocationRequestProcessor.LOG.debug("Matching NodeInstance found: ID: " + nodeInstance.getNodeInstanceID() - + " CSAR-ID: " + csarID + " ServiceTemplateID: " + serviceTemplateID + " NodeTemplateID: " - + nodeTemplateID + " of type: " + nodeType); - - final Node properties = ContainerProxy.getPropertiesNode(csarID, nodeType, interfaceName); - - if (properties != null) { - - final String relativeHostEndpoint = ContainerProxy.getRelativeEndpoint(properties); - final Integer port = ContainerProxy.getPort(properties); - invocationType = ContainerProxy.getInvocationType(properties); - className = ContainerProxy.getClass(properties, interfaceName); - - if (relativeHostEndpoint != null && port != null && invocationType != null && className != null) { - - final String hostedOnNodeTemplateID = - ContainerProxy.getHostedOnNodeTemplateWithSpecifiedIPProperty(csarID, serviceTemplateID, - nodeTemplateID); - - if (hostedOnNodeTemplateID != null) { - - // get the Namespace from the - // serviceTemplate - final QName hostedOnNodeTemplateQName = - new QName(serviceTemplateID.getNamespaceURI(), hostedOnNodeTemplateID); - - final URL hostedOnNodeURL = - ContainerProxy.getIpFromInstanceDataProperties(serviceInstance.getServiceInstanceID(), - hostedOnNodeTemplateQName); - - if (hostedOnNodeURL != null) { - - InvocationRequestProcessor.LOG.debug("Generating endpoint for Node: {}", nodeTemplateID); - - try { - endpoint = new URL(hostedOnNodeURL.getProtocol(), hostedOnNodeURL.getAuthority(), port, - relativeHostEndpoint); - InvocationRequestProcessor.LOG.debug("Generated endpoint: " + endpoint); - - } - catch (final MalformedURLException e) { - InvocationRequestProcessor.LOG.error("Generating endpoint for Node: {} failed!", - nodeTemplateID); - e.printStackTrace(); - } - } - } - } - } - } - - if (endpoint != null) { - - message.setHeader(ApplicationBusConstants.CLASS_NAME.toString(), className); - - message.setHeader(ApplicationBusConstants.INVOCATION_ENDPOINT_URL.toString(), endpoint.toString()); - - InvocationRequestProcessor.LOG.debug("Searching an Application Bus Plugin for InvocationType: {}", - invocationType); - // set ID of the matching Application Bus Plugin bundle. Needed for - // routing. - final String appBusPluginEndpoint = - ApplicationBusPluginServiceHandler.getApplicationBusPluginBundleID(invocationType); - - if (appBusPluginEndpoint != null) { - - InvocationRequestProcessor.LOG.debug("Application Bus Plugin with matching InvocationType: {} found. Endpoint: {}", - invocationType, appBusPluginEndpoint); - exchange.getIn().setHeader(InvokeOperationRoute.APPLICATION_BUS_PLUGIN_ENDPOINT_HEADER, - appBusPluginEndpoint); - - } - - } else { - - throw new ApplicationBusInternalException("Couldn't gather all needed information."); - } - - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/IsFinishedProcessor.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/IsFinishedProcessor.java deleted file mode 100644 index 155fe2fb0..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/IsFinishedProcessor.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.bus.application.service.impl.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; -import org.opentosca.bus.application.service.impl.model.QueueMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * IsFinishedProcessor of the Application Bus.
- *
- * - * This processor handles "isFinished" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class IsFinishedProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(IsFinishedProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - final String requestID = exchange.getIn().getBody(String.class); - - IsFinishedProcessor.LOG.debug("Queue polling for RequestID: {}", requestID); - - if (QueueMap.containsID(requestID)) { - IsFinishedProcessor.LOG.debug("RequestID is known."); - - if (QueueMap.hasFinished(requestID)) { - IsFinishedProcessor.LOG.debug("Invocation has finished."); - exchange.getIn().setBody(true); - - } else { - IsFinishedProcessor.LOG.debug("Invocation has not finished yet."); - exchange.getIn().setBody(false); - } - } else { - IsFinishedProcessor.LOG.warn("Unknown RequestID: {}", requestID); - exchange.getIn().setBody(new ApplicationBusInternalException("Unknown RequestID: " + requestID)); - } - - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/ParameterCheckProcessor.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/ParameterCheckProcessor.java deleted file mode 100644 index e83f8e58d..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/processor/ParameterCheckProcessor.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.opentosca.bus.application.service.impl.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.Processor; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * ParameterCheckProcessor of the Application Bus.
- *
- * - * This processor checks if all needed parameters are specified.. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ParameterCheckProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(ParameterCheckProcessor.class); - - @Override - public void process(final Exchange exchange) throws ApplicationBusExternalException { - - ParameterCheckProcessor.LOG.info("Checking if all needed parameters are specified..."); - - final Message message = exchange.getIn(); - - final Integer serviceInstanceID = - message.getHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), Integer.class); - ParameterCheckProcessor.LOG.debug("serviceInstanceID: {}", serviceInstanceID); - - final String nodeTemplateID = - message.getHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), String.class); - ParameterCheckProcessor.LOG.debug("nodeTemplateID: {}", nodeTemplateID); - - final Integer nodeInstanceID = - message.getHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), Integer.class); - ParameterCheckProcessor.LOG.debug("nodeInstanceID: {}", nodeInstanceID); - - final String interfaceName = message.getHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), String.class); - ParameterCheckProcessor.LOG.debug("interfaceName: {}", interfaceName); - - final String operationName = message.getHeader(ApplicationBusConstants.OPERATION_NAME.toString(), String.class); - ParameterCheckProcessor.LOG.debug("operationName: {}", operationName); - - if (serviceInstanceID != null || nodeInstanceID != null) { - - final StringBuilder error = new StringBuilder(); - - if (interfaceName == null) { - error.append(" >>Interface<<"); - } - - if (operationName == null) { - error.append(" >>Operation<<"); - } - - if (serviceInstanceID != null) { - - if (nodeTemplateID == null) { - error.append(" >>NodeTemplateID<<"); - } - - } - - if (!error.toString().isEmpty()) { - ParameterCheckProcessor.LOG.warn("Can't process request: " + error.toString() + " is missing."); - throw new ApplicationBusExternalException( - "Can't process request: " + error.toString() + " is missing."); - } - - } else { - ParameterCheckProcessor.LOG.warn("Can't process request: neither >>ServiceInstanceID<< nor >>NodeInstanceID<< is specified!"); - throw new ApplicationBusExternalException( - "Can't process request: neither >>ServiceInstanceID<< nor >>NodeInstanceID<< is specified!"); - } - - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/GetResultRoute.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/GetResultRoute.java deleted file mode 100644 index e0ec560d2..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/GetResultRoute.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.opentosca.bus.application.service.impl.route; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.application.service.impl.processor.GetResultProcessor; - -/** - * GetResultRoute of the Application Bus.
- *
- * - * "getResult" requests are handed over to the GetResultProcessor. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class GetResultRoute extends RouteBuilder { - - @Override - public void configure() throws Exception { - - final Processor getResultProcessor = new GetResultProcessor(); - - // handle exceptions - onException(Exception.class).setBody(property(Exchange.EXCEPTION_CAUGHT)); - - from(MainRoute.GET_RESULT_ENDPOINT).process(getResultProcessor); - - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/InvokeOperationRoute.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/InvokeOperationRoute.java deleted file mode 100644 index 4ee690249..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/InvokeOperationRoute.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.opentosca.bus.application.service.impl.route; - -import org.apache.camel.Exchange; -import org.apache.camel.ExchangePattern; -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; -import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; -import org.opentosca.bus.application.service.impl.model.QueueMap; -import org.opentosca.bus.application.service.impl.model.RequestID; -import org.opentosca.bus.application.service.impl.model.ResultMap; -import org.opentosca.bus.application.service.impl.processor.InvocationRequestProcessor; -import org.opentosca.bus.application.service.impl.processor.ParameterCheckProcessor; - -/** - * InvokeOperationRoute of the Application Bus.
- *
- * - * "invokeOperation" requests are handled here. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class InvokeOperationRoute extends RouteBuilder { - - public final static String APPLICATION_BUS_PLUGIN_ENDPOINT_HEADER = "ApplicationBusPluginEndpoint"; - private final static String APPLICATION_BUS_REQUEST_ID_HEADER = "ApplicationBusRequestID"; - - @Override - public void configure() throws Exception { - - final ParameterCheckProcessor checkProcessor = new ParameterCheckProcessor(); - final InvocationRequestProcessor requestProcessor = new InvocationRequestProcessor(); - - // handle exceptions - onException(Exception.class).setBody(property(Exchange.EXCEPTION_CAUGHT)).to("direct:handleResponse"); - - // check if all needed parameters are specified. If this is the case set - // requestID (for the response) and send request to further processing. - from(MainRoute.INVOKE_ENDPOINT).doTry().process(checkProcessor).doCatch(ApplicationBusExternalException.class) - .end().choice().when(property(Exchange.EXCEPTION_CAUGHT).isNull()) - .setHeader(APPLICATION_BUS_REQUEST_ID_HEADER, - method(RequestID.class, "getNextID")) - .wireTap("direct:invokeProcess").end().to("direct:init").otherwise() - .setBody(property(Exchange.EXCEPTION_CAUGHT)); - - // set "isFinsihed"-flag to false for this request - from("direct:init").bean(QueueMap.class, "notFinished(${header." + APPLICATION_BUS_REQUEST_ID_HEADER + "})") - .setBody(simple("${header." + APPLICATION_BUS_REQUEST_ID_HEADER + "}")); - - // check if matching plugin is available and send request to it. - // Otherwise throw exception. - from("direct:invokeProcess").setExchangePattern(ExchangePattern.InOut).process(requestProcessor).choice() - .when(header(APPLICATION_BUS_PLUGIN_ENDPOINT_HEADER).isNotNull()) - .to("direct:toPlugin").endChoice().otherwise() - .throwException(new ApplicationBusInternalException( - "No matching Application Bus Plugin found.")); - - // send to plugin - from("direct:toPlugin").doTry().recipientList(header(APPLICATION_BUS_PLUGIN_ENDPOINT_HEADER)).end() - .doCatch(Exception.class).setBody(property(Exchange.EXCEPTION_CAUGHT)).doFinally() - .to("direct:handleResponse").end(); - - // handle response: set "isFinsihed"-flag to true and store result in - // ResultMap - from("direct:handleResponse").bean(QueueMap.class, - "finished(${header." + APPLICATION_BUS_REQUEST_ID_HEADER + "})") - .bean(ResultMap.class, - "put(${header." + APPLICATION_BUS_REQUEST_ID_HEADER + "}, ${body})") - .stop(); - - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/IsFinishedRoute.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/IsFinishedRoute.java deleted file mode 100644 index 61d14e1bf..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/IsFinishedRoute.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.opentosca.bus.application.service.impl.route; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.application.service.impl.processor.IsFinishedProcessor; - - -/** - * IsFinishedRoute of the Application Bus.
- *
- * - * "isFinished" requests are handed over to the IsFinishedProcessor. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class IsFinishedRoute extends RouteBuilder { - - @Override - public void configure() throws Exception { - - final Processor isFinishedProcessor = new IsFinishedProcessor(); - - // handle exceptions - onException(Exception.class).setBody(property(Exchange.EXCEPTION_CAUGHT)); - - from(MainRoute.IS_FINISHED_ENDPOINT).process(isFinishedProcessor); - - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/ApplicationBusPluginServiceHandler.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/ApplicationBusPluginServiceHandler.java deleted file mode 100644 index 3823ba1f4..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/ApplicationBusPluginServiceHandler.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.opentosca.bus.application.service.impl.servicehandler; - -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; - -import org.opentosca.bus.application.plugin.service.IApplicationBusPluginService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * Class to bind interface {@link IApplicationBusPluginService}. - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ApplicationBusPluginServiceHandler { - - // HashMap that stores available plug-ins. The supported InvocationType is - // used as key and the corresponding routing endpoint as value. - private static ConcurrentHashMap pluginServices = new ConcurrentHashMap<>(); - - final private static Logger LOG = LoggerFactory.getLogger(ApplicationBusPluginServiceHandler.class); - - - /** - * @param invocationType - * @return BundleID of the matching ApplicationBusPlugin - */ - public static String getApplicationBusPluginBundleID(final String invocationType) { - - return pluginServices.get(invocationType); - } - - /** - * Bind IApplicationBusPluginService and store InvocationType & BundleID in local HashMap. - * - * @param plugin - A AppInvokerPluginService to register. - */ - public void bindPluginService(final IApplicationBusPluginService plugin) { - - final List types = plugin.getSupportedInvocationTypes(); - - for (final String type : types) { - pluginServices.put(type, plugin.getRoutingEndpoint()); - ApplicationBusPluginServiceHandler.LOG.debug("Bound IApplicationBusPluginService: {} for Type: {}", - plugin.toString(), type); - } - - } - - /** - * Unbind IApplicationBusPluginService. - * - * @param plugin - A IApplicationBusPluginService to unregister. - */ - public void unbindPluginService(final IApplicationBusPluginService plugin) { - - final List types = plugin.getSupportedInvocationTypes(); - - for (final String type : types) { - final Object deletedObject = pluginServices.remove(type); - if (deletedObject != null) { - ApplicationBusPluginServiceHandler.LOG.debug("Unbound IApplicationBusPluginService: {} for Type: {}", - plugin.toString(), type); - } else { - ApplicationBusPluginServiceHandler.LOG.debug("IApplicationBusPluginService {} could not be unbound, because it is not bound!", - plugin.toString()); - } - } - } -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/InstanceDataServiceHandler.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/InstanceDataServiceHandler.java deleted file mode 100644 index 54d27f5bf..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/InstanceDataServiceHandler.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opentosca.bus.application.service.impl.servicehandler; - -import org.opentosca.container.core.service.IInstanceDataService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * Class to bind interface {@link IInstanceDataService}. - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class InstanceDataServiceHandler { - - final private static Logger LOG = LoggerFactory.getLogger(InstanceDataServiceHandler.class); - - private static IInstanceDataService instanceDataService; - - - public static IInstanceDataService getInstanceDataService() { - return InstanceDataServiceHandler.instanceDataService; - } - - /** - * Bind IInstanceDataService. - * - * @param instanceDataService - A IInstanceDataService to register. - */ - public void bindInstanceDataService(final IInstanceDataService instanceDataService) { - InstanceDataServiceHandler.LOG.debug("App-Invoker: Bind IInstanceDataService"); - InstanceDataServiceHandler.instanceDataService = instanceDataService; - } - - /** - * Unbind IInstanceDataService. - * - * @param instanceDataService - A IInstanceDataService to unregister. - */ - public void unbindInstanceDataService(final IInstanceDataService instanceDataService) { - InstanceDataServiceHandler.LOG.debug("App-Invoker: Unbind IInstanceDataService"); - InstanceDataServiceHandler.instanceDataService = null; - } - -} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/ToscaServiceHandler.java b/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/ToscaServiceHandler.java deleted file mode 100644 index 40093d084..000000000 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/servicehandler/ToscaServiceHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.opentosca.bus.application.service.impl.servicehandler; - -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.xml.IXMLSerializer; -import org.opentosca.container.core.engine.xml.IXMLSerializerService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * Class to bind interface {@link IXMLSerializerService} & {@link IXMLSerializerService}. - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ToscaServiceHandler { - - final private static Logger LOG = LoggerFactory.getLogger(ToscaServiceHandler.class); - - private static IXMLSerializerService xmlSerializerService; - private static IToscaEngineService toscaEngineService; - - - /** - * @return IXMLSerializer - */ - public static IXMLSerializer getIXMLSerializer() { - return ToscaServiceHandler.xmlSerializerService.getXmlSerializer(); - } - - /** - * Bind IXMLSerializerService. - * - * @param xmlSerializerService - A IXMLSerializerService to register. - */ - public void bindIXMLSerializerService(final IXMLSerializerService xmlSerializerService) { - ToscaServiceHandler.LOG.debug("App-Invoker: Bind IXMLSerializerService"); - ToscaServiceHandler.xmlSerializerService = xmlSerializerService; - } - - /** - * Unbind IXMLSerializerService. - * - * @param xmlSerializerService - A IXMLSerializerService to unregister. - */ - public void unbindIXMLSerializerService(final IXMLSerializerService xmlSerializerService) { - ToscaServiceHandler.LOG.debug("App-Invoker: Unbind IXMLSerializerService"); - ToscaServiceHandler.xmlSerializerService = null; - } - - /** - * @return IToscaEngineService - */ - public static IToscaEngineService getToscaEngineService() { - return ToscaServiceHandler.toscaEngineService; - } - - /** - * Bind IToscaEngineService. - * - * @param toscaEngineService - A IToscaEngineService to register. - */ - public void bindToscaEngineService(final IToscaEngineService toscaEngineService) { - ToscaServiceHandler.LOG.debug("App-Invoker: Bind IToscaEngineService"); - ToscaServiceHandler.toscaEngineService = toscaEngineService; - } - - /** - * Unbind IToscaEngineService. - * - * @param toscaEngineService - A IToscaEngineService to unregister. - */ - public void unbindToscaEngineService(final IToscaEngineService toscaEngineService) { - ToscaServiceHandler.LOG.debug("App-Invoker: Unbind IToscaEngineService"); - ToscaServiceHandler.toscaEngineService = null; - } -} diff --git a/org.opentosca.bus.application.service/META-INF/MANIFEST.MF b/org.opentosca.bus.application.service/META-INF/MANIFEST.MF deleted file mode 100644 index 01463cf17..000000000 --- a/org.opentosca.bus.application.service/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Interface of the Application Bus Service -Bundle-SymbolicName: org.opentosca.bus.application.service -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.opentosca.bus.application.service diff --git a/org.opentosca.bus.application.service/build.properties b/org.opentosca.bus.application.service/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.bus.application.service/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.bus.application.service/pom.xml b/org.opentosca.bus.application.service/pom.xml deleted file mode 100644 index 520015e87..000000000 --- a/org.opentosca.bus.application.service/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.application.service - eclipse-plugin - - diff --git a/org.opentosca.bus.management.api.osgievent/META-INF/MANIFEST.MF b/org.opentosca.bus.management.api.osgievent/META-INF/MANIFEST.MF deleted file mode 100644 index d7c2b2816..000000000 --- a/org.opentosca.bus.management.api.osgievent/META-INF/MANIFEST.MF +++ /dev/null @@ -1,31 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.api.osgievent -Bundle-SymbolicName: org.opentosca.bus.management.api.osgievent -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Service-Component: OSGI-INF/MBEventHandler - component.xml -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.dataset;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.glassfish.jersey.uri;version="2.22.2", - org.opentosca.container.core.tosca.convention, - org.opentosca.container.engine.plan.plugin, - org.opentosca.container.engine.plan.plugin.bpel, - org.opentosca.planbuilder.export, - org.opentosca.planbuilder.importer, - org.opentosca.planbuilder.model.plan, - org.opentosca.planbuilder.model.plan.bpel, - org.opentosca.planbuilder.model.tosca, - org.osgi.framework;version="1.6.0", - org.osgi.service.component;version="1.1.0", - org.osgi.service.event;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-Activator: org.opentosca.bus.management.api.osgievent.Activator -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0" -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.bus.management.api.osgievent/OSGI-INF/MBEventHandler - component.xml b/org.opentosca.bus.management.api.osgievent/OSGI-INF/MBEventHandler - component.xml deleted file mode 100644 index 159fcb745..000000000 --- a/org.opentosca.bus.management.api.osgievent/OSGI-INF/MBEventHandler - component.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - org_opentosca_plans/requests - org_opentosca_situationadaptation/requests - - diff --git a/org.opentosca.bus.management.api.osgievent/build.properties b/org.opentosca.bus.management.api.osgievent/build.properties deleted file mode 100644 index 686be4f32..000000000 --- a/org.opentosca.bus.management.api.osgievent/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.management.api.osgievent/pom.xml b/org.opentosca.bus.management.api.osgievent/pom.xml deleted file mode 100644 index 9d4428281..000000000 --- a/org.opentosca.bus.management.api.osgievent/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.api.osgievent - eclipse-plugin - - diff --git a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/Activator.java b/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/Activator.java deleted file mode 100644 index f521a24d7..000000000 --- a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/Activator.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.opentosca.bus.management.api.osgievent; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.core.osgi.OsgiServiceRegistry; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.management.api.osgievent.route.Route; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the OSGiEvent-Management Bus-API.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * The activator is needed to add and start the camel routes. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - static DefaultCamelContext camelContext; - static BundleContext ctx; - - public static String apiID; - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - - @Override - public void start(final BundleContext bundleContext) throws Exception { - - Activator.apiID = bundleContext.getBundle().getSymbolicName(); - - Activator.ctx = bundleContext; - Activator.camelContext = new OsgiDefaultCamelContext(bundleContext); - Activator.camelContext.addRoutes(new Route()); - Activator.camelContext.start(); - Activator.LOG.info("Management Bus-OSGI-Event API started!"); - - } - - @Override - public void stop(final BundleContext arg0) throws Exception { - Activator.camelContext = null; - Activator.LOG.info("Management Bus-OSGI-Event API stopped!"); - - } -} diff --git a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/MBEventHandler.java b/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/MBEventHandler.java deleted file mode 100644 index cabd389e0..000000000 --- a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/MBEventHandler.java +++ /dev/null @@ -1,693 +0,0 @@ -package org.opentosca.bus.management.api.osgievent; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -import javax.xml.bind.JAXBException; -import javax.xml.namespace.QName; - -import org.apache.camel.ConsumerTemplate; -import org.apache.camel.Exchange; -import org.apache.camel.ProducerTemplate; -import org.apache.camel.impl.DefaultExchange; -import org.glassfish.jersey.uri.UriComponent; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstanceState; -import org.opentosca.container.core.next.model.PlanInstanceInput; -import org.opentosca.container.core.next.model.PlanType; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.next.model.RelationshipTemplateInstanceState; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.repository.SituationRepository; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService; -import org.opentosca.container.engine.plan.plugin.bpel.BpelPlanEnginePlugin; -import org.opentosca.planbuilder.export.Exporter; -import org.opentosca.planbuilder.importer.Importer; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicy; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractTopologyTemplate; -import org.osgi.framework.BundleContext; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; -import org.osgi.service.event.Event; -import org.osgi.service.event.EventAdmin; -import org.osgi.service.event.EventHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * EventHandler of the Management Bus-OSGi-Event-API.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * Handles the events (receive and sent) of the Management Bus-OSGi-Event-API. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * @author Kálmán Képes - kepes@iaas.uni-stuttgart.de - */ -public class MBEventHandler implements EventHandler { - - private static final String BPMNNS = "http://www.omg.org/spec/BPMN/20100524/MODEL"; - private static final String BPELNS = "http://docs.oasis-open.org/wsbpel/2.0/process/executable"; - - private static Logger LOG = LoggerFactory.getLogger(MBEventHandler.class); - - private final ExecutorService executor = Executors.newFixedThreadPool(5); - - private EventAdmin eventAdmin; - - private ConsumerTemplate invokePlan(final String operationName, final String messageID, final boolean async, - final Long serviceInstanceID, final QName serviceTemplateID, - final Object message, final CSARID csarID, final QName planID, - final String planLanguage) { - MBEventHandler.LOG.debug("Plan invocation is asynchronous: {}", async); - - // create the headers for the Exchange which is send to the Management Bus - final Map headers = new HashMap<>(); - headers.put(MBHeader.CSARID.toString(), csarID); - headers.put(MBHeader.PLANID_QNAME.toString(), planID); - headers.put(MBHeader.OPERATIONNAME_STRING.toString(), operationName); - headers.put(MBHeader.PLANCORRELATIONID_STRING.toString(), messageID); - headers.put(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); - headers.put("OPERATION", OsgiEventOperations.INVOKE_PLAN.getHeaderValue()); - headers.put("PlanLanguage", planLanguage); - - - if (message instanceof HashMap) { - MBEventHandler.LOG.debug("Invocation body is of type HashMap."); - - URI serviceInstanceURI; - try { - serviceInstanceURI = new URI(serviceInstanceID.toString()); - headers.put(MBHeader.SERVICEINSTANCEID_URI.toString(), serviceInstanceURI); - } - catch (final URISyntaxException e) { - MBEventHandler.LOG.warn("Could not generate service instance URL: {}", e.getMessage(), e); - } - } else { - MBEventHandler.LOG.warn("Invocation body is of type: {}", message.getClass()); - } - - // templates to communicate with the Management Bus - final ProducerTemplate template = Activator.camelContext.createProducerTemplate(); - final ConsumerTemplate consumer = Activator.camelContext.createConsumerTemplate(); - - MBEventHandler.LOG.debug("Correlation id: {}", messageID); - MBEventHandler.LOG.debug("Sending message {}", message); - - // forward request to the Management Bus - final Exchange requestExchange = new DefaultExchange(Activator.camelContext); - requestExchange.getIn().setBody(message); - requestExchange.getIn().setHeaders(headers); - template.asyncSend("direct:invoke", requestExchange); - return consumer; - } - - @Override - public void handleEvent(final Event event) { - - // Handle plan invoke requests - if ("org_opentosca_plans/requests".equals(event.getTopic())) { - MBEventHandler.LOG.debug("Process event of topic \"org_opentosca_plans/requests\"."); - - final CSARID csarID = (CSARID) event.getProperty("CSARID"); - final QName planID = (QName) event.getProperty("PLANID"); - final String planLanguage = (String) event.getProperty("PLANLANGUAGE"); - - if (planLanguage.startsWith(BPMNNS) || planLanguage.startsWith(BPELNS)) { - MBEventHandler.LOG.debug("Plan invocation with plan language: {}", planLanguage); - - final String operationName = (String) event.getProperty("OPERATIONNAME"); - final String messageID = (String) event.getProperty("MESSAGEID"); - final boolean async = (boolean) event.getProperty("ASYNC"); - - // Optional parameter if message is of type HashMap. Not needed for Document. - final Long serviceInstanceID = (Long) event.getProperty("SERVICEINSTANCEID"); - final QName serviceTemplateID = (QName) event.getProperty("SERVICETEMPLATEID"); - // Should be of type Document or HashMap. Maybe better handle them - // with different topics. - // final Object message = event.getProperty("BODY"); - Map inputParameter = (Map) event.getProperty("INPUTS"); - - if (inputParameter == null) { - inputParameter = new HashMap<>(); - } - - final Map message = - createRequestBody(csarID, serviceTemplateID, serviceInstanceID, inputParameter, messageID); - - final ConsumerTemplate consumer = invokePlan(operationName, messageID, async, serviceInstanceID, - serviceTemplateID, message, csarID, planID, planLanguage); - - // Threaded reception of response - this.executor.submit(() -> { - - Object response = null; - - try { - consumer.start(); - final Exchange exchange = consumer.receive("direct:response" + messageID); - response = exchange.getIn().getBody(); - consumer.stop(); - } - catch (final Exception e) { - MBEventHandler.LOG.error("Error occured: {}", e.getMessage(), e); - return; - } - - MBEventHandler.LOG.debug("Received response for request with id {}.", messageID); - - final Map responseMap = new HashMap<>(); - responseMap.put("RESPONSE", response); - responseMap.put("MESSAGEID", messageID); - responseMap.put("PLANLANGUAGE", planLanguage); - final Event responseEvent = new Event("org_opentosca_plans/responses", responseMap); - - MBEventHandler.LOG.debug("Posting response as OSGi event."); - this.eventAdmin.postEvent(responseEvent); - }); - - } else { - MBEventHandler.LOG.warn("Unsupported plan language: {}", planLanguage); - } - } - - // Handle IA invoke requests - if ("org_opentosca_ia/requests".equals(event.getTopic())) { - MBEventHandler.LOG.debug("Process event of topic \"org_opentosca_ia/requests\"."); - - // TODO when needed. - // Adapt 'MBEventHandler - component.xml' to receive messages from this topic too... - - } - - if ("org_opentosca_situationadaptation/requests".equals(event.getTopic())) { - MBEventHandler.LOG.debug("Received SituationAware Adapatioan Event"); - final ServiceTemplateInstance instance = (ServiceTemplateInstance) event.getProperty("SERVICEINSTANCE"); - - final Map> nodeIds2situationIds = - (Map>) event.getProperty("NODE2SITUATIONS"); - - final Importer importer = new Importer(); - final Exporter exporter = new Exporter(); - - final AbstractTopologyTemplate topology = - importer.getMainDefinitions(instance.getCsarId()).getServiceTemplates().get(0).getTopologyTemplate(); - - final ServiceTemplateInstanceConfiguration currentConfig = - getCurrentServiceTemplateInstanceConfiguration(topology, instance); - final ServiceTemplateInstanceConfiguration targetConfig = - getValidServiceTemplateInstanceConfiguration(topology, nodeIds2situationIds); - - - - final Collection currentConfigNodeIds = - currentConfig.nodeTemplates.stream().map(x -> x.getId()).collect(Collectors.toList()); - final Collection currentConfigRelationIds = - currentConfig.relationshipTemplates.stream().map(x -> x.getId()).collect(Collectors.toList()); - - final Collection targetConfigNodeIds = - targetConfig.nodeTemplates.stream().map(x -> x.getId()).collect(Collectors.toList()); - final Collection targetConfigRelationIds = - targetConfig.relationshipTemplates.stream().map(x -> x.getId()).collect(Collectors.toList()); - - if (currentConfigNodeIds.equals(targetConfigNodeIds) - & currentConfigRelationIds.equals(targetConfigRelationIds)) { - MBEventHandler.LOG.debug("Current configuration is equal to target configuration, no adaptation is needed"); - return; - } - - - - final WSDLEndpoint endpoint = getAdaptationPlanEndpoint(currentConfigNodeIds, currentConfigRelationIds, - targetConfigNodeIds, targetConfigRelationIds); - final String correlationID = String.valueOf(System.currentTimeMillis()); - QName planId = null; - PlanType planType = null; - Map inputs = null; - - if (endpoint != null) { - planId = endpoint.getPlanId(); - planType = PlanType.fromString(endpoint.getMetadata().get("PLANTYPE")); - - inputs = new HashMap<>(); - - for (final String input : toStringCollection(endpoint.getMetadata().get("INPUTS"), ",")) { - inputs.put(input, null); - } - - } else { - try { - final BPELPlan adaptationPlan = - (BPELPlan) importer.generateAdaptationPlan(instance.getCsarId(), instance.getTemplateId(), - currentConfigNodeIds, currentConfigRelationIds, - targetConfigNodeIds, targetConfigRelationIds); - - planType = PlanType.fromString(adaptationPlan.getType().getString()); - inputs = createInput(adaptationPlan); - final Path tempFile = Files.createTempFile(adaptationPlan.getId(), ".zip"); - exporter.exportToPlanFile(tempFile.toUri(), adaptationPlan); - final BpelPlanEnginePlugin deployPlugin = getBpelDeployPlugin(); - - final Map endpointMetadata = - toEndpointMetadata(currentConfigNodeIds, currentConfigRelationIds, targetConfigNodeIds, - targetConfigRelationIds); - - endpointMetadata.put("PLANTYPE", planType.toString()); - endpointMetadata.put("INPUTS", toCSV(inputs.keySet())); - - planId = new QName(tempFile.getFileName().toString()); - deployPlugin.deployPlanFile(tempFile, instance.getCsarId(), planId, endpointMetadata); - } - catch (final SystemException e) { - LOG.error("Internal error", e); - return; - } - catch (final IOException e) { - LOG.error("Couldn't read files", e); - return; - } - catch (final JAXBException e) { - LOG.error("Couldn't parse files", e); - return; - } - } - - final Map requestBody = createRequestBody(instance.getCsarId(), instance.getTemplateId(), - instance.getId(), inputs, correlationID); - - final ConsumerTemplate consumer = - invokePlan("adapt", correlationID, true, instance.getId(), instance.getTemplateId(), requestBody, - instance.getCsarId(), planId, BPELNS); - - // Threaded reception of response - this.executor.submit(() -> { - - Object response = null; - - try { - consumer.start(); - final Exchange exchange = consumer.receive("direct:response" + correlationID); - response = exchange.getIn().getBody(); - consumer.stop(); - } - catch (final Exception e) { - MBEventHandler.LOG.error("Error occured: {}", e.getMessage(), e); - return; - } - - MBEventHandler.LOG.debug("Received response for request with id {}.", correlationID); - - final Map responseMap = new HashMap<>(); - responseMap.put("RESPONSE", response); - responseMap.put("MESSAGEID", correlationID); - responseMap.put("PLANLANGUAGE", BPELNS); - final Event responseEvent = new Event("org_opentosca_situationadaptation/responses", responseMap); - - MBEventHandler.LOG.debug("Posting response as OSGi event."); - this.eventAdmin.postEvent(responseEvent); - }); - - } - } - - private WSDLEndpoint getAdaptationPlanEndpoint(final Collection sourceNodeIDs, - final Collection sourceRelationIDs, - final Collection targetNodeIDs, - final Collection targetRelationIDs) { - final ICoreEndpointService endpointService = getEndpointService(); - for (final WSDLEndpoint endpoint : endpointService.getWSDLEndpoints()) { - final Collection sourceNodesMetadata = - toStringCollection(endpoint.getMetadata().get("SOURCENODES"), ","); - final Collection sourceRelationsMetadata = - toStringCollection(endpoint.getMetadata().get("SOURCERELATIONS"), ","); - final Collection targetNodesMetadata = - toStringCollection(endpoint.getMetadata().get("TARGETNODES"), ","); - final Collection targetRelationsMetadata = - toStringCollection(endpoint.getMetadata().get("TARGETRELATIONS"), ","); - - if (sourceNodeIDs.equals(sourceNodesMetadata) && sourceRelationIDs.equals(sourceRelationsMetadata) - && targetNodeIDs.equals(targetNodesMetadata) && targetRelationIDs.equals(targetRelationsMetadata)) { - return endpoint; - } - } - - return null; - } - - private Map toEndpointMetadata(final Collection sourceNodeIDs, - final Collection sourceRelationIDs, - final Collection targetNodeIDs, - final Collection targetRelationIDs) { - final Map result = new HashMap<>(); - - result.put("SOURCENODES", toCSV(sourceNodeIDs)); - result.put("SOURCERELATIONS", toCSV(sourceRelationIDs)); - result.put("TARGETNODES", toCSV(targetNodeIDs)); - result.put("TARGETRELATIONS", toCSV(targetRelationIDs)); - - return result; - } - - private Collection toStringCollection(final String data, final String separator) { - final Collection result = new ArrayList<>(); - - if (data == null || data.isEmpty()) { - return result; - } - - final String[] split = data.split(separator); - - for (final String part : split) { - if (part != null && !part.equals("") && !part.isEmpty()) { - result.add(part); - } - } - - return result; - } - - private String toCSV(final Collection strings) { - return strings.stream().collect(Collectors.joining(",")); - } - - private Set toPlanInstanceInputs(final Map inputs) { - final Set result = new HashSet<>(); - inputs.forEach((key, value) -> result.add(new PlanInstanceInput(key, value, "string"))); - return result; - } - - private Map createInput(final BPELPlan plan) { - final Collection inputs = plan.getWsdl().getInputMessageLocalNames(); - - final Map result = new HashMap<>(); - - for (final String input : inputs) { - result.put(input, null); - } - - return result; - } - - private BpelPlanEnginePlugin getBpelDeployPlugin() { - final BundleContext ctx = Activator.ctx; - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanEnginePlanRefPluginService.class.getName(), null); - if (refs != null) { - for (final ServiceReference ref : refs) { - final IPlanEnginePlanRefPluginService plugin = - (IPlanEnginePlanRefPluginService) ctx.getService(ref); - if (plugin instanceof BpelPlanEnginePlugin) { - return (BpelPlanEnginePlugin) plugin; - } - } - } - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - return null; - } - - private ICoreEndpointService getEndpointService() { - final BundleContext ctx = Activator.ctx; - try { - final ServiceReference[] refs = ctx.getAllServiceReferences(ICoreEndpointService.class.getName(), null); - if (refs != null) { - for (final ServiceReference ref : refs) { - final ICoreEndpointService plugin = (ICoreEndpointService) ctx.getService(ref); - return plugin; - } - } - } - catch (final InvalidSyntaxException e) { - LOG.error("Couldn't fetch ICoreEndpointService instance", e); - } - - return null; - } - - private ServiceTemplateInstanceConfiguration getCurrentServiceTemplateInstanceConfiguration(final AbstractTopologyTemplate topology, - final ServiceTemplateInstance instance) { - - final Collection currentlyRunningNodes = new HashSet<>(); - final Collection currentlyRunningRelations = new HashSet<>(); - - final Collection validNodeState = new HashSet<>(); - validNodeState.add(NodeTemplateInstanceState.STARTED); - validNodeState.add(NodeTemplateInstanceState.CREATED); - validNodeState.add(NodeTemplateInstanceState.CONFIGURED); - - final Collection validRelationState = new HashSet<>(); - validRelationState.add(RelationshipTemplateInstanceState.CREATED); - - for (final AbstractNodeTemplate node : topology.getNodeTemplates()) { - for (final NodeTemplateInstance inst : instance.getNodeTemplateInstances()) { - if (inst.getTemplateId().getLocalPart().equals(node.getId()) - && validNodeState.contains(inst.getState())) { - currentlyRunningNodes.add(node); - } - } - } - - for (final AbstractRelationshipTemplate relation : topology.getRelationshipTemplates()) { - for (final RelationshipTemplateInstance inst : instance.getRelationshipTemplateInstances()) { - if (inst.getTemplateId().getLocalPart().equals(relation.getId()) - && validRelationState.contains(inst.getState())) { - currentlyRunningRelations.add(relation); - } - } - } - - return new ServiceTemplateInstanceConfiguration(currentlyRunningNodes, currentlyRunningRelations); - } - - private ServiceTemplateInstanceConfiguration getValidServiceTemplateInstanceConfiguration(final AbstractTopologyTemplate topology, - final Map> nodeIds2situationIds) { - - - final Collection validNodes = new ArrayList<>(); - final Collection validRelations = new ArrayList<>(); - - for (final AbstractNodeTemplate nodeTemplate : topology.getNodeTemplates()) { - final Collection policies = getPolicies(Types.situationPolicyType, nodeTemplate); - if (policies.isEmpty()) { - validNodes.add(nodeTemplate); - } else if (isValidUnderSituations(nodeTemplate, nodeIds2situationIds)) { - validNodes.add(nodeTemplate); - } - } - - // check if node set is deployable - final Collection deployableAndValidNodeSet = - getDeployableSubgraph(validNodes, nodeIds2situationIds); - for (final AbstractRelationshipTemplate relations : topology.getRelationshipTemplates()) { - if (deployableAndValidNodeSet.contains(relations.getSource()) - & deployableAndValidNodeSet.contains(relations.getTarget())) { - validRelations.add(relations); - } - } - - return new ServiceTemplateInstanceConfiguration(deployableAndValidNodeSet, validRelations); - } - - private Collection getDeployableSubgraph(final Collection nodeTemplates, - final Map> nodeIds2situationIds) { - final Set validDeploymentSubgraph = new HashSet<>(nodeTemplates); - final Collection toRemove = new HashSet<>(); - - for (final AbstractNodeTemplate nodeTemplate : nodeTemplates) { - final Collection hostingRelations = - getOutgoingHostedOnRelations(nodeTemplate); - if (!hostingRelations.isEmpty()) { - // if we have hostedOn relations check if it is valid under the situation and is in the set - boolean foundValidHost = false; - for (final AbstractRelationshipTemplate relationshipTemplate : hostingRelations) { - final AbstractNodeTemplate hostingNode = relationshipTemplate.getTarget(); - if (isValidUnderSituations(hostingNode, nodeIds2situationIds) - && nodeTemplates.contains(hostingNode)) { - foundValidHost = true; - break; - } - } - if (!foundValidHost) { - toRemove.add(nodeTemplate); - } - } - } - - if (toRemove.isEmpty()) { - return validDeploymentSubgraph; - } else { - validDeploymentSubgraph.removeAll(toRemove); - return getDeployableSubgraph(validDeploymentSubgraph, nodeIds2situationIds); - } - } - - private boolean isValidUnderSituations(final AbstractNodeTemplate nodeTemplate, - final Map> nodeIds2situationIds) { - // check if the situation of the policy is active - Collection situationIds = null; - - if ((situationIds = nodeIds2situationIds.get(nodeTemplate.getId())) == null) { - return true; - } - - - boolean isValid = true; - for (final Long sitId : situationIds) { - isValid &= isSituationActive(sitId); - } - return isValid; - } - - private Collection getOutgoingHostedOnRelations(final AbstractNodeTemplate nodeTemplate) { - return nodeTemplate.getOutgoingRelations().stream().filter(x -> x.getType().equals(Types.hostedOnRelationType)) - .collect(Collectors.toList()); - } - - - - private Collection getPolicies(final QName policyType, final AbstractNodeTemplate nodeTemplate) { - return nodeTemplate.getPolicies().stream().filter(x -> x.getType().getId().equals(policyType)) - .collect(Collectors.toList()); - } - - private static class ServiceTemplateInstanceConfiguration { - Collection nodeTemplates; - Collection relationshipTemplates; - - public ServiceTemplateInstanceConfiguration(final Collection nodes, - final Collection relations) { - this.nodeTemplates = nodes; - this.relationshipTemplates = relations; - } - } - - private boolean isSituationActive(final Long situationId) { - return getSituationRepository().find(situationId).get().isActive(); - } - - private SituationRepository getSituationRepository() { - return new SituationRepository(); - } - - public Map createRequestBody(final CSARID csarID, final QName serviceTemplateID, - final Long serviceTemplateInstanceId, - final Map inputParameter, final String correlationID) { - - final Map map = new HashMap<>(); - - - LOG.trace("Processing a list of {} parameters", inputParameter.size()); - for (final String para : inputParameter.keySet()) { - final String value = inputParameter.get(para); - LOG.trace("Put in the parameter {} with value \"{}\".", para, value); - if (para.equalsIgnoreCase("CorrelationID")) { - LOG.debug("Found Correlation Element! Put in CorrelationID \"" + correlationID + "\"."); - map.put(para, correlationID); - } else if (para.equalsIgnoreCase("csarID")) { - LOG.debug("Found csarID Element! Put in csarID \"" + csarID + "\"."); - map.put(para, csarID.toString()); - } else if (para.equalsIgnoreCase("serviceTemplateID")) { - LOG.debug("Found serviceTemplateID Element! Put in serviceTemplateID \"" + serviceTemplateID + "\"."); - map.put(para, serviceTemplateID.toString()); - } else if (para.equalsIgnoreCase("OpenTOSCAContainerAPIServiceInstanceURL") - & serviceTemplateInstanceId != null) { - final String serviceTemplateInstanceUrl = - createServiceInstanceURI(csarID, serviceTemplateID, serviceTemplateInstanceId); - map.put(para, String.valueOf(serviceTemplateInstanceUrl)); - } else if (para.equalsIgnoreCase("containerApiAddress")) { - LOG.debug("Found containerApiAddress Element! Put in containerApiAddress \"" - + Settings.CONTAINER_API_LEGACY + "\"."); - map.put(para, Settings.CONTAINER_API_LEGACY); - } else if (para.equalsIgnoreCase("instanceDataAPIUrl")) { - LOG.debug("Found instanceDataAPIUrl Element! Put in instanceDataAPIUrl \"" - + Settings.CONTAINER_INSTANCEDATA_API + "\"."); - String str = Settings.CONTAINER_INSTANCEDATA_API; - str = str.replace("{csarid}", csarID.getFileName()); - try { - str = str.replace("{servicetemplateid}", - URLEncoder.encode(URLEncoder.encode(serviceTemplateID.toString(), "UTF-8"), - "UTF-8")); - } - catch (final UnsupportedEncodingException e) { - LOG.error("Couldn't encode Service Template URL", e); - } - LOG.debug("instance api: {}", str); - map.put(para, str); - } else if (para.equalsIgnoreCase("csarEntrypoint")) { - LOG.debug("Found csarEntrypoint Element! Put in instanceDataAPIUrl \"" - + Settings.CONTAINER_API_LEGACY + "/" + csarID + "\"."); - map.put(para, Settings.CONTAINER_API_LEGACY + "/CSARs/" + csarID); - } else { - map.put(para, value); - } - } - - return map; - } - - private String createServiceInstanceURI(final CSARID csarId, final QName serviceTemplate, - final Long serviceTemplateInstanceId) { - String url = Settings.CONTAINER_INSTANCEDATA_API + "/" + serviceTemplateInstanceId; - url = url.replace("{csarid}", csarId.getFileName()); - url = url.replace("{servicetemplateid}", - UriComponent.encode(UriComponent.encode(serviceTemplate.toString(), - UriComponent.Type.PATH_SEGMENT), - UriComponent.Type.PATH_SEGMENT)); - - return url; - } - - - public void bindEventAdmin(final EventAdmin eventAdmin) { - this.eventAdmin = eventAdmin; - } - - public void unbindEventAdmin(final EventAdmin eventAdmin) { - try { - this.executor.shutdown(); - this.executor.awaitTermination(5, TimeUnit.SECONDS); - } - catch (final InterruptedException e) { - // Ignore - } - finally { - this.executor.shutdownNow(); - } - this.eventAdmin = null; - } -} diff --git a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/OsgiEventOperations.java b/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/OsgiEventOperations.java deleted file mode 100644 index 686f32b9a..000000000 --- a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/OsgiEventOperations.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.opentosca.bus.management.api.osgievent; - -/** - * This enum defines the operations which can be invoked through the OSGi-Event API of the - * Management Bus. The enum is used by the route to forward the invocations to the correct receiver. - */ -public enum OsgiEventOperations { - - INVOKE_PLAN("invokePlan"), INVOKE_IA("invokeIA"); - - private final String headerValue; - - private OsgiEventOperations(final String headerValue) { - this.headerValue = headerValue; - } - - public String getHeaderValue() { - return this.headerValue; - } -} diff --git a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/package-info.java b/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/package-info.java deleted file mode 100644 index 2a22a06c6..000000000 --- a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This package contains the activator for starting the camel context and with it the routes of the - * Management Bus-OSGI/EVENT-API as well as the event handler that handles the incoming and outgoing - * osgi events.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.api.osgievent; diff --git a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/route/Route.java b/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/route/Route.java deleted file mode 100644 index a5fa2af55..000000000 --- a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/route/Route.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.opentosca.bus.management.api.osgievent.route; - -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.management.api.osgievent.Activator; -import org.opentosca.bus.management.api.osgievent.OsgiEventOperations; -import org.opentosca.bus.management.header.MBHeader; - -/** - * Route of the Management Bus-OSGiEvent-API.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * Incoming events are given here from the EventHandler to be routed to the Management Bus for - * further processing. The response message is given back to the EventHandler. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Route extends RouteBuilder { - - @Override - public void configure() throws Exception { - - // Management Bus Endpoints - final String MANAGEMENT_BUS_IA = - "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokeIA"; - final String MANAGEMENT_BUS_PLAN = - "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokePlan"; - - this.from("direct:invoke").to("stream:out").process(exchange -> { - - exchange.getIn().setHeader(MBHeader.APIID_STRING.toString(), Activator.apiID); - - final String messageID = - exchange.getIn().getHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), String.class); - if (messageID != null) { - exchange.getIn().setMessageId(messageID); - exchange.getIn().setHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), false); - } else { - exchange.getIn().setHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), true); - } - - }).to("stream:out").choice().when(header("OPERATION").isEqualTo(OsgiEventOperations.INVOKE_IA.getHeaderValue())) - .to("direct:invokeIA").when(header("OPERATION").isEqualTo(OsgiEventOperations.INVOKE_PLAN.getHeaderValue())) - .to("direct:invokePlan").end(); - - this.from("direct:invokeIA").to("stream:out").wireTap(MANAGEMENT_BUS_IA); - this.from("direct:invokePlan").to("stream:out").to(MANAGEMENT_BUS_PLAN).end(); - - this.from("direct-vm:" + Activator.apiID).recipientList(this.simple("direct:response${id}")).end(); - - } - -} diff --git a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/route/package-info.java b/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/route/package-info.java deleted file mode 100644 index ee36d17dd..000000000 --- a/org.opentosca.bus.management.api.osgievent/src/org/opentosca/bus/management/api/osgievent/route/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This package contains the camel routes of the Management Bus-OSGI/EVENT-API.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.api.osgievent.route; diff --git a/org.opentosca.bus.management.api.resthttp/META-INF/MANIFEST.MF b/org.opentosca.bus.management.api.resthttp/META-INF/MANIFEST.MF deleted file mode 100644 index 7e49e2483..000000000 --- a/org.opentosca.bus.management.api.resthttp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Rest-Http API for Management Bus -Bundle-SymbolicName: org.opentosca.bus.management.api.resthttp -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.management.api.resthttp.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.restlet;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.json.simple, - org.json.simple.parser, - org.osgi.framework;version="1.6.0", - org.restlet, - org.restlet.data, - org.restlet.util, - org.slf4j;version="1.7.5" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0" diff --git a/org.opentosca.bus.management.api.resthttp/build.properties b/org.opentosca.bus.management.api.resthttp/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.bus.management.api.resthttp/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.bus.management.api.resthttp/pom.xml b/org.opentosca.bus.management.api.resthttp/pom.xml deleted file mode 100644 index 122f5d141..000000000 --- a/org.opentosca.bus.management.api.resthttp/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.api.resthttp - eclipse-plugin - - diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/Activator.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/Activator.java deleted file mode 100644 index c1f0a184b..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/Activator.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.opentosca.bus.management.api.resthttp; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.core.osgi.OsgiServiceRegistry; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.management.api.resthttp.route.DeleteRoute; -import org.opentosca.bus.management.api.resthttp.route.GetResultRoute; -import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; -import org.opentosca.bus.management.api.resthttp.route.IsFinishedRoute; -import org.opentosca.bus.management.api.resthttp.route.OptionsRoute; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the Management Bus REST-API.
- *
- * - * The activator is needed to add and start the camel routes. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - public static String apiID; - - @Override - public void start(final BundleContext bundleContext) throws Exception { - - Activator.apiID = bundleContext.getBundle().getSymbolicName(); - final DefaultCamelContext camelContext = new OsgiDefaultCamelContext(bundleContext); - - camelContext.addRoutes(new InvocationRoute()); - camelContext.addRoutes(new GetResultRoute()); - camelContext.addRoutes(new IsFinishedRoute()); - camelContext.addRoutes(new DeleteRoute()); - camelContext.addRoutes(new OptionsRoute()); - - camelContext.start(); - - Activator.LOG.info("Management Bus REST API started!"); - } - - @Override - public void stop(final BundleContext arg0) throws Exception { - - Activator.LOG.info("Management Bus REST API stopped!"); - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/QueueMap.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/QueueMap.java deleted file mode 100644 index bb516dd78..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/QueueMap.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.model; - -import java.util.concurrent.ConcurrentHashMap; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * Map that manages the status of the requests. RequestID is used as key of the map. The - * value of the map indicates if the invocation has finished or not. - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class QueueMap { - - final private static Logger LOG = LoggerFactory.getLogger(QueueMap.class); - - private static ConcurrentHashMap queue = new ConcurrentHashMap<>(); - - /** - * Inserts an entry into the queue (if not already existing) and set it to finished. - * - * @param id of the request - */ - public static void finished(final String id) { - - QueueMap.LOG.debug("Request with ID: {} has finished.", id); - - queue.put(id, true); - } - - /** - * Inserts an entry into the queue and set it to notFinished. Only if the id not already exists. - * - * @param id of the request - */ - public static void notFinished(final String id) { - - QueueMap.LOG.debug("Request with ID: {} hasn't finished yet.", id); - - queue.putIfAbsent(id, false); - } - - /** - * Inserts an entry into the queue. - * - * @param id of the request - * @param isFinished specifies if the invocation has finished or not - */ - public static void put(final String id, final Boolean isFinished) { - - QueueMap.LOG.debug("RequestID: {}, isFinished: {}", id, isFinished); - - queue.put(id, isFinished); - } - - /** - * @param id of the request - * @return true if the invocation has finished. Otherwise false - */ - public static boolean hasFinished(final String id) { - - return queue.get(id); - } - - /** - * @param id of the request - * @return true if the queue contains the specified requestID. Otherwise false - */ - public static boolean containsID(final String id) { - return queue.containsKey(id); - } - - /** - * Removes the entry with the specified requestID from the queue. - * - * @param id of the request - */ - public static void remove(final String id) { - queue.remove(id); - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/RequestID.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/RequestID.java deleted file mode 100644 index f4e2e14b4..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/RequestID.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.model; - -import java.util.concurrent.atomic.AtomicLong; - -/** - * - * Manages the requestIDs needed to correlate the invocation-requests, the isFinished-requests as - * well as the getResult-requests. - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class RequestID { - - private static AtomicLong incrementer = new AtomicLong(0); - - /** - * @return requestID - */ - public synchronized static String getNextID() { - - final Long id = incrementer.getAndIncrement(); - - // Prototype: - // For the unlikely case, that MAX_Value is reached, begin with 0 - // again. Assumption: old requests were processed in the - // mean time. - if (id == Long.MAX_VALUE) { - incrementer.set(0); - } - - return Long.toString(id); - } -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/ResultMap.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/ResultMap.java deleted file mode 100644 index 9b0fdc9be..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/model/ResultMap.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.model; - -import java.util.HashMap; -import java.util.concurrent.ConcurrentHashMap; - -/** - * - * Map that manages the invocation results. RequestID is used as key of the map. The - * value of the map is the result of the invocation. Or null if the invocation - * failed. - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class ResultMap { - - private static ConcurrentHashMap> invocations = new ConcurrentHashMap<>(); - - /** - * @param id of the request - * @param result of the invocation. - */ - public static void put(final String id, final HashMap result) { - invocations.put(id, result); - } - - /** - * @param id - * @return result of the invocation. Void if the invoked method was of return type - * void. null if the invocation failed. - */ - public static HashMap get(final String id) { - return invocations.get(id); - } - - /** - * @param id of the request - * @return true if the map contains the specified requestID. Otherwise false - */ - public static boolean containsID(final String id) { - return invocations.containsKey(id); - } - - /** - * Removes the entry with the specified requestID from the map. - * - * @param id of the request - */ - public static void remove(final String id) { - invocations.remove(id); - } -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/ExceptionProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/ExceptionProcessor.java deleted file mode 100644 index edc37a33b..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/ExceptionProcessor.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.parser.ParseException; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * ExceptionProcessor of the Management Bus REST-API.
- *
- * - * This processor handles the exceptions and sends a reasonable response back to the caller. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ExceptionProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(ExceptionProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - ExceptionProcessor.LOG.debug("Exception handling..."); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof ParseException) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - final String body = exchange.getIn().getBody(String.class); - response.setEntity("JSON is not valid: " + body, MediaType.TEXT_ALL); - ExceptionProcessor.LOG.warn("JSON is not valid: {}", body); - } - - else if (exchange.getIn().getBody() instanceof NullPointerException) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - response.setEntity("Needed information not specified.", MediaType.TEXT_ALL); - ExceptionProcessor.LOG.warn("Needed information not specified."); - - } else if (exchange.getIn().getBody() instanceof Exception) { - response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - response.setEntity("Invocation failed! " + exchange.getIn().getBody().toString(), MediaType.TEXT_ALL); - ExceptionProcessor.LOG.warn("Invocation failed! " + exchange.getIn().getBody().toString()); - - } - - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultProcessor.java deleted file mode 100644 index 694fc0b76..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultProcessor.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import java.util.HashMap; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.management.api.resthttp.model.QueueMap; -import org.opentosca.bus.management.api.resthttp.model.ResultMap; -import org.opentosca.bus.management.api.resthttp.route.DeleteRoute; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * GetResultProcessor of the Management Bus.
- *
- * - * This processor handles "getResult" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class GetResultProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(GetResultProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - final String requestID = exchange.getIn().getBody(String.class); - - GetResultProcessor.LOG.debug("getResult request received. RequestID: {}", requestID); - - if (ResultMap.containsID(requestID)) { - - GetResultProcessor.LOG.debug("Getting result."); - - final HashMap result = ResultMap.get(requestID); - - if (DeleteRoute.AUTO_DELETE) { - // "Garbage collection": Remove polled responses. - ResultMap.remove(requestID); - QueueMap.remove(requestID); - } - - exchange.getIn().setBody(result); - - } else if (!QueueMap.containsID(requestID)) { - GetResultProcessor.LOG.warn("Unknown RequestID: {}", requestID); - exchange.getIn().setBody(new Exception("Unknown RequestID: " + requestID)); - } else { - GetResultProcessor.LOG.warn("Error while invoking specified method."); - exchange.getIn().setBody(new Exception("Error while invoking specified method.")); - } - - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultRequestProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultRequestProcessor.java deleted file mode 100644 index 42a6d7c1b..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultRequestProcessor.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * GetResultRequestProcessor of the Management Bus REST-API.
- *
- * - * This processor handles "getResult" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class GetResultRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(GetResultRequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - GetResultRequestProcessor.LOG.debug("Processing GetResult request...."); - - final Integer requestID = exchange.getIn().getHeader(InvocationRoute.ID, Integer.class); - - GetResultRequestProcessor.LOG.debug("RequestID: {}", requestID); - - exchange.getIn().setBody(requestID); - - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultResponseProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultResponseProcessor.java deleted file mode 100644 index c3b38b91f..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/GetResultResponseProcessor.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import java.util.HashMap; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.JSONObject; -import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * GetResultResponseProcessor of the Management Bus REST-API.
- *
- * - * This processor handles the responses of "getResult" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class GetResultResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(GetResultResponseProcessor.class); - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) throws Exception { - - GetResultResponseProcessor.LOG.debug("Processing GetResult response...."); - - final String requestID = exchange.getIn().getHeader(InvocationRoute.ID, String.class); - - GetResultResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof Exception) { - - response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } else { - - final HashMap responseMap = exchange.getIn().getBody(HashMap.class); - - final JSONObject obj = new JSONObject(); - obj.put("response", responseMap); - - response.setStatus(Status.SUCCESS_OK); - response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); - - } - - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/InvocationRequestProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/InvocationRequestProcessor.java deleted file mode 100644 index 4488fddd1..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/InvocationRequestProcessor.java +++ /dev/null @@ -1,175 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.json.simple.parser.ContainerFactory; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; -import org.opentosca.bus.management.api.resthttp.Activator; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * InvocationRequestProcessor of the Management Bus REST-API.
- *
- * - * This processor handles "invokeOperation" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class InvocationRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(InvocationRequestProcessor.class); - - - @Override - public void process(final Exchange exchange) throws Exception { - - String nodeTemplateID = null; - String relationshipTemplateID = null; - - InvocationRequestProcessor.LOG.debug("Processing Invocation request..."); - - final String bodyString = exchange.getIn().getBody(String.class); - - final LinkedHashMap> requestMap = this.requestToMap(bodyString); - - final LinkedHashMap infosMap = requestMap.get("invocation-information"); - - if (infosMap != null) { - - if (infosMap.containsKey("csarID")) { - final String csarID = infosMap.get("csarID"); - InvocationRequestProcessor.LOG.debug("csarID: {}", csarID); - exchange.getIn().setHeader(MBHeader.CSARID.toString(), new CSARID(csarID)); - - } else { - InvocationRequestProcessor.LOG.debug("Can't process request: csarID is missing!"); - throw new Exception("Can't process request: csarID is missing!"); - } - if (infosMap.containsKey("serviceTemplateID")) { - final QName serviceTemplateID = QName.valueOf(infosMap.get("serviceTemplateID")); - InvocationRequestProcessor.LOG.debug("serviceTemplateID: {}", serviceTemplateID); - exchange.getIn().setHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); - - } else { - InvocationRequestProcessor.LOG.debug("Can't process request: serviceTemplateID is missing!"); - throw new Exception("Can't process request: serviceTemplateID is missing!"); - } - if (infosMap.containsKey("serviceInstanceID")) { - final String serviceInstanceID = infosMap.get("serviceInstanceID"); - InvocationRequestProcessor.LOG.debug("serviceInstanceID: {}", serviceInstanceID); - - if (serviceInstanceID != null) { - final URI serviceInstanceURI = new URI(serviceInstanceID); - exchange.getIn().setHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), serviceInstanceURI); - } - } - if (infosMap.containsKey("nodeInstanceID")) { - final String nodeInstanceID = infosMap.get("nodeInstanceID"); - InvocationRequestProcessor.LOG.debug("nodeInstanceID: {}", nodeInstanceID); - exchange.getIn().setHeader(MBHeader.NODEINSTANCEID_STRING.toString(), nodeInstanceID); - - } - if (infosMap.containsKey("nodeTemplateID")) { - nodeTemplateID = infosMap.get("nodeTemplateID"); - InvocationRequestProcessor.LOG.debug("nodeTemplateID: {}", nodeTemplateID); - exchange.getIn().setHeader(MBHeader.NODETEMPLATEID_STRING.toString(), nodeTemplateID); - } else if (infosMap.containsKey("relationshipTemplateID")) { - relationshipTemplateID = infosMap.get("relationshipTemplateID"); - InvocationRequestProcessor.LOG.debug("relationshipTemplateID: {}", relationshipTemplateID); - exchange.getIn().setHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), relationshipTemplateID); - } - if (infosMap.containsKey("interface")) { - final String interfaceName = infosMap.get("interface"); - InvocationRequestProcessor.LOG.debug("interface: {}", interfaceName); - exchange.getIn().setHeader(MBHeader.INTERFACENAME_STRING.toString(), interfaceName); - } else { - InvocationRequestProcessor.LOG.debug("Can't process request: interface is missing!"); - throw new Exception("Can't process request: interface is missing!"); - } - if (infosMap.containsKey("operation")) { - final String operationName = infosMap.get("operation"); - InvocationRequestProcessor.LOG.debug("operationName: {}", operationName); - exchange.getIn().setHeader(MBHeader.OPERATIONNAME_STRING.toString(), operationName); - } else { - InvocationRequestProcessor.LOG.debug("Can't process request: operation is missing!"); - throw new Exception("Can't process request: operation is missing!"); - } - - if (nodeTemplateID == null && relationshipTemplateID == null) { - InvocationRequestProcessor.LOG.debug("Can't process request: Eighter nodeTemplateID or relationshipTemplateID is required!"); - throw new Exception( - "Can't process request: Eighter nodeTemplateID or relationshipTemplateID is required!"); - } - - final HashMap paramsMap = requestMap.get("params"); - - if (paramsMap != null) { - - exchange.getIn().setBody(paramsMap); - InvocationRequestProcessor.LOG.debug("Params: {}", paramsMap); - - } else { - InvocationRequestProcessor.LOG.debug("No parameter specified."); - } - - } else { - InvocationRequestProcessor.LOG.warn("Needed information not specified."); - throw new Exception("Needed information not specified."); - } - - exchange.getIn().setHeader(MBHeader.APIID_STRING.toString(), Activator.apiID); - } - - /** - * - * Parses and maps a json String to a - * {@literal LinkedHashMap>}. - * - * @param request - * @return LinkedHashMap - * @throws IOException - * @throws ParseException - * @throws ApplicationBusInternalException - */ - @SuppressWarnings("unchecked") - private LinkedHashMap> requestToMap(final String body) throws ParseException { - - final ContainerFactory orderedKeyFactory = new ContainerFactory() { - - @Override - public Map> createObjectContainer() { - return new LinkedHashMap<>(); - } - - @Override - public List creatArrayContainer() { - // TODO Auto-generated method stub - return null; - } - - }; - - final JSONParser parser = new JSONParser(); - - final Object obj = parser.parse(body, orderedKeyFactory); - - return (LinkedHashMap>) obj; - - } -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/InvocationResponseProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/InvocationResponseProcessor.java deleted file mode 100644 index 68bd297fb..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/InvocationResponseProcessor.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; -import org.restlet.Response; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * InvocationResponseProcessor of the Management Bus REST-API.
- *
- * - * This processor handles the responses of "invokeOperation" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class InvocationResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(InvocationResponseProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - InvocationResponseProcessor.LOG.debug("Processing Invocation response...."); - - final String requestID = exchange.getIn().getBody(String.class); - - InvocationResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - response.setStatus(Status.SUCCESS_ACCEPTED); - response.setLocationRef(InvocationRoute.POLL_ENDPOINT.replace(InvocationRoute.ID_PLACEHODLER, requestID)); - - exchange.getOut().setBody(response); - - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedProcessor.java deleted file mode 100644 index f4fc56fda..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedProcessor.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.management.api.resthttp.model.QueueMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * IsFinishedProcessor of the Management Bus REST-API.
- *
- * - * This processor handles "isFinished" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class IsFinishedProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(IsFinishedProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - final String requestID = exchange.getIn().getBody(String.class); - - IsFinishedProcessor.LOG.debug("Queue polling for RequestID: {}", requestID); - - if (QueueMap.containsID(requestID)) { - IsFinishedProcessor.LOG.debug("RequestID is known."); - - if (QueueMap.hasFinished(requestID)) { - IsFinishedProcessor.LOG.debug("Invocation has finished."); - exchange.getIn().setBody(true); - - } else { - IsFinishedProcessor.LOG.debug("Invocation has not finished yet."); - exchange.getIn().setBody(false); - } - } else { - IsFinishedProcessor.LOG.warn("Unknown RequestID: {}", requestID); - exchange.getIn().setBody(new Exception("Unknown RequestID: " + requestID)); - } - - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedRequestProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedRequestProcessor.java deleted file mode 100644 index 6cd2d0b56..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedRequestProcessor.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * IsFinishedRequestProcessor of the Management Bus REST-API.
- *
- * - * This processor handles "isFinished" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class IsFinishedRequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(IsFinishedRequestProcessor.class); - - @Override - public void process(final Exchange exchange) throws Exception { - - IsFinishedRequestProcessor.LOG.debug("Processing IsFinished request...."); - - final Integer requestID = exchange.getIn().getHeader(InvocationRoute.ID, Integer.class); - - IsFinishedRequestProcessor.LOG.debug("RequestID: {}", requestID); - - exchange.getIn().setBody(requestID); - - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedResponseProcessor.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedResponseProcessor.java deleted file mode 100644 index e62670862..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/IsFinishedResponseProcessor.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.processor; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.restlet.RestletConstants; -import org.json.simple.JSONObject; -import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; -import org.restlet.Response; -import org.restlet.data.MediaType; -import org.restlet.data.Status; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * IsFinishedResponseProcessor of the Management Bus REST-API.
- *
- * - * This processor handles the responses of "isFinished" requests. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class IsFinishedResponseProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(IsFinishedResponseProcessor.class); - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) throws Exception { - - IsFinishedResponseProcessor.LOG.debug("Processing IsFinished response...."); - - final String requestID = exchange.getIn().getHeader(InvocationRoute.ID, String.class); - - IsFinishedResponseProcessor.LOG.debug("RequestID: {}", requestID); - - final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); - - if (exchange.getIn().getBody() instanceof Exception) { - - response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); - response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); - - } else { - - final Boolean isFinished = exchange.getIn().getBody(Boolean.class); - - if (isFinished) { - IsFinishedResponseProcessor.LOG.debug("Invocation has finished, send location of result."); - - response.setStatus(Status.REDIRECTION_SEE_OTHER); - response.setLocationRef(InvocationRoute.GET_RESULT_ENDPOINT.replace(InvocationRoute.ID_PLACEHODLER, - requestID)); - - } else { - IsFinishedResponseProcessor.LOG.debug("Invocation has not finished yet."); - - final JSONObject obj = new JSONObject(); - obj.put("status", "PENDING"); - - response.setStatus(Status.SUCCESS_OK); - response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); - - } - exchange.getOut().setBody(response); - } - } - -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/DeleteRoute.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/DeleteRoute.java deleted file mode 100644 index ec06ab224..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/DeleteRoute.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.route; - -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.management.api.resthttp.model.QueueMap; -import org.opentosca.bus.management.api.resthttp.model.ResultMap; - -/** - * InvocationRoute of the Management Bus REST-API.
- *
- * - * The "getResult" endpoint of the REST-API is created here. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class DeleteRoute extends RouteBuilder { - - // true => invocation results will be deleted automatically after fetching - // the result - // false => invocation result needs to be deleted manually - public static final boolean AUTO_DELETE = false; - - @Override - public void configure() throws Exception { - from("restlet:" + InvocationRoute.BASE_ENDPOINT + InvocationRoute.GET_RESULT_ENDPOINT - + "?restletMethods=delete").bean(QueueMap.class, "remove(${header." + InvocationRoute.ID + "})") - .bean(ResultMap.class, "remove(${header." + InvocationRoute.ID + "})") - .removeHeaders("*"); - } -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/GetResultRoute.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/GetResultRoute.java deleted file mode 100644 index b893961f8..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/GetResultRoute.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.route; - -import org.apache.camel.Exchange; -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.management.api.resthttp.processor.ExceptionProcessor; -import org.opentosca.bus.management.api.resthttp.processor.GetResultProcessor; -import org.opentosca.bus.management.api.resthttp.processor.GetResultRequestProcessor; -import org.opentosca.bus.management.api.resthttp.processor.GetResultResponseProcessor; - -/** - * InvocationRoute of the Management Bus REST-API.
- *
- * - * The "getResult" endpoint of the REST-API is created here. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class GetResultRoute extends RouteBuilder { - - @Override - public void configure() throws Exception { - - final GetResultRequestProcessor getResultRequestProcessor = new GetResultRequestProcessor(); - final GetResultResponseProcessor getResultResponseProcessor = new GetResultResponseProcessor(); - final GetResultProcessor getResultProcessor = new GetResultProcessor(); - final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); - - - // handle exceptions - onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) - .process(exceptionProcessor); - - from("restlet:" + InvocationRoute.BASE_ENDPOINT + InvocationRoute.GET_RESULT_ENDPOINT - + "?restletMethods=get").process(getResultRequestProcessor).process(getResultProcessor) - .process(getResultResponseProcessor).removeHeaders("*"); - } -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/InvocationRoute.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/InvocationRoute.java deleted file mode 100644 index 337367fee..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/InvocationRoute.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.route; - -import org.apache.camel.Exchange; -import org.apache.camel.Predicate; -import org.apache.camel.builder.PredicateBuilder; -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.management.api.resthttp.Activator; -import org.opentosca.bus.management.api.resthttp.model.QueueMap; -import org.opentosca.bus.management.api.resthttp.model.RequestID; -import org.opentosca.bus.management.api.resthttp.model.ResultMap; -import org.opentosca.bus.management.api.resthttp.processor.ExceptionProcessor; -import org.opentosca.bus.management.api.resthttp.processor.InvocationRequestProcessor; -import org.opentosca.bus.management.api.resthttp.processor.InvocationResponseProcessor; -import org.opentosca.bus.management.header.MBHeader; - -/** - * InvocationRoute of the Management Bus REST-API.
- *
- * - * The "invoke" endpoint of the REST-API is created here. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class InvocationRoute extends RouteBuilder { - - - private static final String HOST = "http://localhost"; - - private static final String PORT = "8086"; - static final String BASE_ENDPOINT = HOST + ":" + PORT; - - public static final String INVOKE_ENDPOINT = "/ManagementBus/v1/invoker"; - - public static final String ID = "id"; - public static final String ID_PLACEHODLER = "{" + ID + "}"; - public static final String POLL_ENDPOINT = INVOKE_ENDPOINT + "/activeRequests/" + ID_PLACEHODLER; - public static final String GET_RESULT_ENDPOINT = POLL_ENDPOINT + "/response"; - - // Management Bus Endpoints - private static final String MANAGEMENT_BUS_IA = - "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokeIA"; - private static final String MANAGEMENT_BUS_PLAN = - "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokePlan"; - - private static final String MANAGEMENT_BUS_REQUEST_ID_HEADER = "ManagementBusRequestID"; - - - @Override - public void configure() throws Exception { - - // Checks if invoking a IA - final Predicate INVOKE_IA = PredicateBuilder.or(header(MBHeader.NODETEMPLATEID_STRING.toString()).isNotNull(), - header(MBHeader.PLANID_QNAME.toString()).isNotNull()); - // Checks if invoking a Plan - final Predicate INVOKE_PLAN = header(MBHeader.PLANID_QNAME.toString()).isNotNull(); - - - final InvocationRequestProcessor invocationRequestProcessor = new InvocationRequestProcessor(); - final InvocationResponseProcessor invocationResponseProcessor = new InvocationResponseProcessor(); - final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); - - // handle exceptions - this.onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) - .process(exceptionProcessor); - - // invoke main route - this.from("restlet:" + BASE_ENDPOINT + INVOKE_ENDPOINT + "?restletMethods=post").doTry() - .process(invocationRequestProcessor).doCatch(Exception.class).end().choice() - .when(property(Exchange.EXCEPTION_CAUGHT).isNull()).to("direct:invoke").otherwise().to("direct:exception") - .end().removeHeaders("*"); - - // route if no exception was caught - this.from("direct:invoke") - .setHeader(MANAGEMENT_BUS_REQUEST_ID_HEADER, this.method(RequestID.class, "getNextID")) - .wireTap("direct:toManagementBus").end().to("direct:init").process(invocationResponseProcessor); - - // route in case an exception was caught - this.from("direct:exception").setBody(property(Exchange.EXCEPTION_CAUGHT)).process(exceptionProcessor); - - // set "isFinsihed"-flag to false for this request - this.from("direct:init").bean(QueueMap.class, "notFinished(${header." + MANAGEMENT_BUS_REQUEST_ID_HEADER + "})") - .setBody(this.simple("${header." + MANAGEMENT_BUS_REQUEST_ID_HEADER + "}")); - - // route to management bus engine - this.from("direct:toManagementBus").choice().when(INVOKE_IA).to(MANAGEMENT_BUS_IA).when(INVOKE_PLAN) - .to(MANAGEMENT_BUS_PLAN).end(); - - // invoke response route - this.from("direct-vm:" + Activator.apiID) - .bean(QueueMap.class, "finished(${header." + MANAGEMENT_BUS_REQUEST_ID_HEADER + "})") - .bean(ResultMap.class, "put(${header." + MANAGEMENT_BUS_REQUEST_ID_HEADER + "}, ${body})").stop(); - - } -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/IsFinishedRoute.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/IsFinishedRoute.java deleted file mode 100644 index 398702701..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/IsFinishedRoute.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.route; - -import org.apache.camel.Exchange; -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.management.api.resthttp.processor.ExceptionProcessor; -import org.opentosca.bus.management.api.resthttp.processor.IsFinishedProcessor; -import org.opentosca.bus.management.api.resthttp.processor.IsFinishedRequestProcessor; -import org.opentosca.bus.management.api.resthttp.processor.IsFinishedResponseProcessor; - -/** - * InvocationRoute of the Management Bus REST-API.
- *
- * - * The "isFinished" endpoint of the REST-API is created here. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class IsFinishedRoute extends RouteBuilder { - - @Override - public void configure() throws Exception { - - final IsFinishedRequestProcessor isFinishedRequestProcessor = new IsFinishedRequestProcessor(); - final IsFinishedProcessor isFinishedProcessor = new IsFinishedProcessor(); - final IsFinishedResponseProcessor isFinishedResponseProcessor = new IsFinishedResponseProcessor(); - final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); - - // handle exceptions - onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) - .process(exceptionProcessor); - - from("restlet:" + InvocationRoute.BASE_ENDPOINT + InvocationRoute.POLL_ENDPOINT - + "?restletMethods=get").process(isFinishedRequestProcessor).process(isFinishedProcessor) - .process(isFinishedResponseProcessor).removeHeaders("*"); - } -} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/OptionsRoute.java b/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/OptionsRoute.java deleted file mode 100644 index 135b7a7ab..000000000 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/route/OptionsRoute.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.opentosca.bus.management.api.resthttp.route; - -import org.apache.camel.builder.RouteBuilder; - -/** - * Route of the Management Bus REST-API to handle OPTIONS requests.
- *
- * - * The "options" endpoint of the REST-API is created here. - * - * - * - * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * - */ -public class OptionsRoute extends RouteBuilder { - - @Override - public void configure() throws Exception { - // options route - // from("restlet:" + InvocationRoute.BASE_ENDPOINT + InvocationRoute.INVOKE_ENDPOINT - // + "?restletMethods=options"); - // - // from("restlet:" + InvocationRoute.BASE_ENDPOINT + InvocationRoute.GET_RESULT_ENDPOINT - // + "?restletMethods=options"); - } -} diff --git a/org.opentosca.bus.management.api.soaphttp/META-INF/MANIFEST.MF b/org.opentosca.bus.management.api.soaphttp/META-INF/MANIFEST.MF deleted file mode 100644 index 0eb613026..000000000 --- a/org.opentosca.bus.management.api.soaphttp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.api.soaphttp -Bundle-SymbolicName: org.opentosca.bus.management.api.soaphttp -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.fasterxml.jackson.databind;version="2.6.2", - com.google.gson;version="2.2.4", - org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.cxf.common.header;version="2.18.3", - org.apache.camel.component.cxf.common.message;version="2.10.4", - org.apache.camel.converter.jaxb;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.apache.commons.io;version="2.2.0", - org.apache.cxf.binding.soap;version="2.7.3", - org.apache.cxf.headers;version="2.7.3", - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.7.5" -Bundle-Activator: org.opentosca.bus.management.api.soaphttp.Activator -Service-Component: OSGI-INF/EndpointServiceHandler - component.xml -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0" -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.bus.management.api.soaphttp/OSGI-INF/EndpointServiceHandler - component.xml b/org.opentosca.bus.management.api.soaphttp/OSGI-INF/EndpointServiceHandler - component.xml deleted file mode 100644 index adb23756d..000000000 --- a/org.opentosca.bus.management.api.soaphttp/OSGI-INF/EndpointServiceHandler - component.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.bus.management.api.soaphttp/build.properties b/org.opentosca.bus.management.api.soaphttp/build.properties deleted file mode 100644 index c63d86e42..000000000 --- a/org.opentosca.bus.management.api.soaphttp/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = .,\ - META-INF/,\ - OSGI-INF/ diff --git a/org.opentosca.bus.management.api.soaphttp/pom.xml b/org.opentosca.bus.management.api.soaphttp/pom.xml deleted file mode 100644 index 132667cb9..000000000 --- a/org.opentosca.bus.management.api.soaphttp/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.api.soaphttp - eclipse-plugin - - diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/Activator.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/Activator.java deleted file mode 100644 index 49b73b81d..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/Activator.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.opentosca.bus.management.api.soaphttp; - -import org.apache.camel.component.cxf.common.header.CxfHeaderFilterStrategy; -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.core.osgi.OsgiServiceRegistry; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.management.api.soaphttp.route.Route; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the SOAP/HTTP-Management Bus-API.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * The activator is needed to add and start the camel routes. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - public static String apiID; - - public static BundleContext bundleContext; - - - @Override - public void start(final BundleContext bundleContext) throws Exception { - - Activator.apiID = bundleContext.getBundle().getSymbolicName(); - - // Set relayHeaders to false to drop all SOAP headers - final CxfHeaderFilterStrategy headerStrategy = new CxfHeaderFilterStrategy(); - headerStrategy.setRelayHeaders(false); - - bundleContext.registerService(CxfHeaderFilterStrategy.class, headerStrategy, null); - - final DefaultCamelContext camelContext = new OsgiDefaultCamelContext(bundleContext); - camelContext.addRoutes(new Route()); - camelContext.start(); - - Activator.bundleContext = bundleContext; - Activator.LOG.info("SI-SOAP/HTTP-Management Bus-API started!"); - } - - @Override - public void stop(final BundleContext arg0) throws Exception { - - Activator.LOG.info("SI-SOAP/HTTP-Management Bus-API stopped!"); - } - -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/EndpointServiceHandler.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/EndpointServiceHandler.java deleted file mode 100644 index 9e6c3279a..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/EndpointServiceHandler.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.opentosca.bus.management.api.soaphttp; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.HashMap; - -import org.opentosca.bus.management.api.soaphttp.route.Route; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class EndpointServiceHandler { - - public static ICoreEndpointService endpointService, oldEndpointService; - - private final static Logger LOG = LoggerFactory.getLogger(EndpointServiceHandler.class); - - - /** - * Bind EndpointService. - * - * @param endpointService - The endpointService to register. - */ - public void bindEndpointService(final ICoreEndpointService endpointService) { - if (endpointService != null) { - if (EndpointServiceHandler.endpointService == null) { - EndpointServiceHandler.endpointService = endpointService; - } else { - EndpointServiceHandler.oldEndpointService = endpointService; - EndpointServiceHandler.endpointService = endpointService; - } - - EndpointServiceHandler.LOG.debug("Bind Endpoint Service: {} bound.", endpointService.toString()); - - EndpointServiceHandler.LOG.debug("Storing the Management Bus SOAP-API endpoint: {} via EndpointService...", - Route.PUBLIC_ENDPOINT); - - URI uri = null; - try { - uri = new URI(Route.PUBLIC_ENDPOINT); - - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - // Stores the Management Bus endpoint in the endpointDB. "***", - // cause the MB-endpoint is csar independent. - final String localContainer = Settings.OPENTOSCA_CONTAINER_HOSTNAME; - final WSDLEndpoint endpoint = new WSDLEndpoint(uri, Route.PORTTYPE, localContainer, localContainer, - new CSARID("***"), null, null, null, null, new HashMap()); - EndpointServiceHandler.endpointService.storeWSDLEndpoint(endpoint); - - } else { - EndpointServiceHandler.LOG.error("Bind Endpoint Service: Supplied parameter is null!"); - } - - } - - /** - * Unbind EndpointService. - * - * @param endpointService - The endpointService to unregister. - */ - public void unbindEndpointService(ICoreEndpointService endpointService) { - if (EndpointServiceHandler.oldEndpointService == null) { - endpointService = null; - } else { - EndpointServiceHandler.oldEndpointService = null; - } - - EndpointServiceHandler.LOG.debug("Unbind Endpoint Service unbound."); - } -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/Doc.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/Doc.java deleted file mode 100644 index c2914cf50..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/Doc.java +++ /dev/null @@ -1,68 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2018.07.16 at 01:55:00 PM CEST -// - - -package org.opentosca.bus.management.api.soaphttp.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - - -/** - *

- * Java class for Doc complex type. - * - *

- * The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Doc">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <any processContents='skip' minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Doc", propOrder = {"any"}) -public class Doc { - - @XmlAnyElement - protected Element any; - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Element } - * - */ - public Element getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Element } - * - */ - public void setAny(final Element value) { - this.any = value; - } - -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ObjectFactory.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ObjectFactory.java deleted file mode 100644 index f4229457f..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ObjectFactory.java +++ /dev/null @@ -1,147 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2018.07.16 at 01:55:00 PM CEST -// - - -package org.opentosca.bus.management.api.soaphttp.model; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.opentosca.bus.management.api.soaphttp.model package. - *

- * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _InvokeOperationAsync_QNAME = - new QName("http://siserver.org/schema", "invokeOperationAsync"); - private final static QName _InvokePlan_QNAME = new QName("http://siserver.org/schema", "invokePlan"); - private final static QName _InvokeResponse_QNAME = new QName("http://siserver.org/schema", "invokeResponse"); - private final static QName _InvokeOperation_QNAME = new QName("http://siserver.org/schema", "invokeOperation"); - private final static QName _InvokeOperationSync_QNAME = - new QName("http://siserver.org/schema", "invokeOperationSync"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes - * for package: org.opentosca.bus.management.api.soaphttp.model - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link InvokeOperationAsync } - * - */ - public InvokeOperationAsync createInvokeOperationAsync() { - return new InvokeOperationAsync(); - } - - /** - * Create an instance of {@link InvokeResponse } - * - */ - public InvokeResponse createInvokeResponse() { - return new InvokeResponse(); - } - - /** - * Create an instance of {@link InvokePlan } - * - */ - public InvokePlan createInvokePlan() { - return new InvokePlan(); - } - - /** - * Create an instance of {@link InvokeOperationSync } - * - */ - public InvokeOperationSync createInvokeOperationSync() { - return new InvokeOperationSync(); - } - - /** - * Create an instance of {@link ParamsMapItemType } - * - */ - public ParamsMapItemType createParamsMapItemType() { - return new ParamsMapItemType(); - } - - /** - * Create an instance of {@link Doc } - * - */ - public Doc createDoc() { - return new Doc(); - } - - /** - * Create an instance of {@link ParamsMap } - * - */ - public ParamsMap createParamsMap() { - return new ParamsMap(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InvokeOperationAsync }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokeOperationAsync") - public JAXBElement createInvokeOperationAsync(final InvokeOperationAsync value) { - return new JAXBElement<>(_InvokeOperationAsync_QNAME, InvokeOperationAsync.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InvokePlan }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokePlan") - public JAXBElement createInvokePlan(final InvokePlan value) { - return new JAXBElement<>(_InvokePlan_QNAME, InvokePlan.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InvokeResponse }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokeResponse") - public JAXBElement createInvokeResponse(final InvokeResponse value) { - return new JAXBElement<>(_InvokeResponse_QNAME, InvokeResponse.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InvokeOperationAsync }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokeOperation") - public JAXBElement createInvokeOperation(final InvokeOperationAsync value) { - return new JAXBElement<>(_InvokeOperation_QNAME, InvokeOperationAsync.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link InvokeOperationSync }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokeOperationSync") - public JAXBElement createInvokeOperationSync(final InvokeOperationSync value) { - return new JAXBElement<>(_InvokeOperationSync_QNAME, InvokeOperationSync.class, null, value); - } - -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ParamsMap.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ParamsMap.java deleted file mode 100644 index 3407056fe..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ParamsMap.java +++ /dev/null @@ -1,77 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2018.07.16 at 01:55:00 PM CEST -// - - -package org.opentosca.bus.management.api.soaphttp.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

- * Java class for ParamsMap complex type. - * - *

- * The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ParamsMap">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Param" type="{http://siserver.org/schema}ParamsMapItemType" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ParamsMap", propOrder = {"param"}) -public class ParamsMap { - - @XmlElement(name = "Param", required = true) - protected List param; - - /** - * Gets the value of the param property. - * - *

- * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is - * why there is not a set method for the param property. - * - *

- * For example, to add a new item, do as follows: - * - *

-     * getParam().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list {@link ParamsMapItemType } - * - * - */ - public List getParam() { - if (this.param == null) { - this.param = new ArrayList<>(); - } - return this.param; - } - -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ParamsMapItemType.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ParamsMapItemType.java deleted file mode 100644 index 75f32d80e..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/ParamsMapItemType.java +++ /dev/null @@ -1,89 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2018.07.16 at 01:55:00 PM CEST -// - - -package org.opentosca.bus.management.api.soaphttp.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

- * Java class for ParamsMapItemType complex type. - * - *

- * The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ParamsMapItemType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ParamsMapItemType", propOrder = {"key", "value"}) -public class ParamsMapItemType { - - @XmlElement(required = true) - protected String key; - @XmlElement(required = true) - protected String value; - - /** - * Gets the value of the key property. - * - * @return possible object is {@link String } - * - */ - public String getKey() { - return this.key; - } - - /** - * Sets the value of the key property. - * - * @param value allowed object is {@link String } - * - */ - public void setKey(final String value) { - this.key = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return this.value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(final String value) { - this.value = value; - } - -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/package-info.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/package-info.java deleted file mode 100644 index f19951e02..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2018.07.16 at 01:55:00 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://siserver.org/schema", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.opentosca.bus.management.api.soaphttp.model; diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/package-info.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/package-info.java deleted file mode 100644 index 715636b07..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This package contains the activator for starting the camel context and with it the routes of the - * Management Bus-SOAP/HTTP-API.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.api.soaphttp; diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/RequestProcessor.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/RequestProcessor.java deleted file mode 100644 index bcf3b4faf..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/RequestProcessor.java +++ /dev/null @@ -1,303 +0,0 @@ -package org.opentosca.bus.management.api.soaphttp.processor; - -import java.net.URI; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.cxf.common.message.CxfConstants; -import org.apache.commons.io.FilenameUtils; -import org.apache.cxf.binding.soap.SoapHeader; -import org.apache.cxf.headers.Header; -import org.opentosca.bus.management.api.soaphttp.Activator; -import org.opentosca.bus.management.api.soaphttp.model.Doc; -import org.opentosca.bus.management.api.soaphttp.model.InvokeOperationAsync; -import org.opentosca.bus.management.api.soaphttp.model.InvokeOperationSync; -import org.opentosca.bus.management.api.soaphttp.model.InvokePlan; -import org.opentosca.bus.management.api.soaphttp.model.ParamsMap; -import org.opentosca.bus.management.api.soaphttp.model.ParamsMapItemType; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.ResolvedArtifacts; -import org.opentosca.container.core.engine.ResolvedArtifacts.ResolvedDeploymentArtifact; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.osgi.framework.ServiceReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.google.gson.Gson; - -/** - * Request-Processor of the Management Bus-SOAP/HTTP-API.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * This processor processes the incoming requests of the Management Bus-SOAP/HTTP-API. It transforms - * the incoming unmarshalled SOAP message into a from the Management Bus understandable camel - * exchange message. The MBHeader-Enum is used here to define the headers of the exchange message. - * - * @see MBHeader - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class RequestProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(RequestProcessor.class); - - - @Override - public void process(final Exchange exchange) throws Exception { - - ParamsMap paramsMap = null; - Doc doc = null; - String planCorrelationID = null; - String csarIDString = null; - String serviceInstanceID = null; - String callbackAddress = null; - String messageID = null; - String interfaceName = null; - String operationName = null; - - // copy SOAP headers in camel exchange object - RequestProcessor.LOG.debug("copy SOAP headers in camel exchange object"); - @SuppressWarnings("unchecked") - final List soapHeaders = (List) exchange.getIn().getHeader(Header.HEADER_LIST); - Element elementx; - if (soapHeaders != null) { - for (final SoapHeader header : soapHeaders) { - elementx = (Element) header.getObject(); - exchange.getIn().setHeader(elementx.getLocalName(), elementx.getTextContent()); - } - } - - if (exchange.getIn().getBody() instanceof InvokeOperationAsync) { - - RequestProcessor.LOG.debug("Processing async operation invocation"); - - final InvokeOperationAsync invokeIaRequest = (InvokeOperationAsync) exchange.getIn().getBody(); - - csarIDString = invokeIaRequest.getCsarID(); - - planCorrelationID = invokeIaRequest.getPlanCorrelationID(); - exchange.getIn().setHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), planCorrelationID); - - serviceInstanceID = invokeIaRequest.getServiceInstanceID(); - exchange.getIn().setHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), new URI(serviceInstanceID)); - - final String nodeInstanceID = invokeIaRequest.getNodeInstanceID(); - exchange.getIn().setHeader(MBHeader.NODEINSTANCEID_STRING.toString(), nodeInstanceID); - - final String serviceTemplateIDNamespaceURI = invokeIaRequest.getServiceTemplateIDNamespaceURI(); - final String serviceTemplateIDLocalPart = invokeIaRequest.getServiceTemplateIDLocalPart(); - - final QName serviceTemplateID = new QName(serviceTemplateIDNamespaceURI, serviceTemplateIDLocalPart); - - exchange.getIn().setHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); - - final String nodeTemplateID = invokeIaRequest.getNodeTemplateID(); - exchange.getIn().setHeader(MBHeader.NODETEMPLATEID_STRING.toString(), nodeTemplateID); - - final String relationshipTemplateID = invokeIaRequest.getRelationshipTemplateID(); - exchange.getIn().setHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), relationshipTemplateID); - - // Support new Deployment Artifact Header - final ServiceReference servRef = - Activator.bundleContext.getServiceReference(IToscaEngineService.class.getName()); - final IToscaEngineService toscaEngineService = - (IToscaEngineService) Activator.bundleContext.getService(servRef); - - final List resolvedDAs = new ArrayList<>(); - if (nodeTemplateID != null) { - final QName nodeTemplateQName = new QName(serviceTemplateIDNamespaceURI, nodeTemplateID); - final ResolvedArtifacts resolvedArtifacts = - toscaEngineService.getResolvedArtifactsOfNodeTemplate(new CSARID(csarIDString), nodeTemplateQName); - resolvedDAs.addAll(resolvedArtifacts.getDeploymentArtifacts()); - } - - final URL serviceInstanceIDUrl = new URL(serviceInstanceID); - final HashMap> DAs = new HashMap<>(); - for (final ResolvedDeploymentArtifact resolvedDeploymentArtifact : resolvedDAs) { - LOG.info("DA name:" + resolvedDeploymentArtifact.getName()); - final QName DAname = resolvedDeploymentArtifact.getType(); - final HashMap DAfiles = new HashMap<>(); - DAs.put(DAname, DAfiles); - for (final String s : resolvedDeploymentArtifact.getReferences()) { - LOG.info("DA getReferences:" + s); - final String url = serviceInstanceIDUrl.getProtocol() + "://" + serviceInstanceIDUrl.getHost() + ":" - + serviceInstanceIDUrl.getPort() + "/csars/" + csarIDString + "/content/"; - final String urlWithDa = url + s; - - LOG.info(urlWithDa); - DAfiles.put(FilenameUtils.getName(urlWithDa), urlWithDa); - } - } - final Gson gson = new Gson(); - exchange.getIn().setHeader(MBHeader.DEPLOYMENT_ARTIFACTS_STRING.toString(), gson.toJson(DAs)); - LOG.info("serviceInstanceID:" + serviceInstanceID); - LOG.info("OPENTOSCA_CONTAINER_HOSTNAME:" + Settings.OPENTOSCA_CONTAINER_HOSTNAME); - LOG.info("OPENTOSCA_CONTAINER_PORT:" + Settings.OPENTOSCA_CONTAINER_PORT); - LOG.info("serviceTemplateIDNamespaceURI:" + serviceTemplateIDNamespaceURI); - - interfaceName = invokeIaRequest.getInterfaceName(); - - if (interfaceName != null && !(interfaceName.equals("?") || interfaceName.isEmpty())) { - exchange.getIn().setHeader(MBHeader.INTERFACENAME_STRING.toString(), interfaceName); - } - - operationName = invokeIaRequest.getOperationName(); - - callbackAddress = invokeIaRequest.getReplyTo(); - - messageID = invokeIaRequest.getMessageID(); - - paramsMap = invokeIaRequest.getParams(); - - doc = invokeIaRequest.getDoc(); - - if (callbackAddress != null && !(callbackAddress.isEmpty() || callbackAddress.equals("?"))) { - exchange.getIn().setHeader("ReplyTo", callbackAddress); - } - - if (messageID != null && !(messageID.isEmpty() || messageID.equals("?"))) { - exchange.getIn().setHeader("MessageID", messageID); - } - - exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, "invokeIA"); - - } - - if (exchange.getIn().getBody() instanceof InvokeOperationSync) { - - RequestProcessor.LOG.debug("Processing sync operation invocation"); - - final InvokeOperationSync invokeIaRequest = (InvokeOperationSync) exchange.getIn().getBody(); - - csarIDString = invokeIaRequest.getCsarID(); - - planCorrelationID = invokeIaRequest.getPlanCorrelationID(); - exchange.getIn().setHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), planCorrelationID); - - serviceInstanceID = invokeIaRequest.getServiceInstanceID(); - exchange.getIn().setHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), new URI(serviceInstanceID)); - - final String nodeInstanceID = invokeIaRequest.getNodeInstanceID(); - exchange.getIn().setHeader(MBHeader.NODEINSTANCEID_STRING.toString(), nodeInstanceID); - - final String serviceTemplateIDNamespaceURI = invokeIaRequest.getServiceTemplateIDNamespaceURI(); - final String serviceTemplateIDLocalPart = invokeIaRequest.getServiceTemplateIDLocalPart(); - - final QName serviceTemplateID = new QName(serviceTemplateIDNamespaceURI, serviceTemplateIDLocalPart); - - exchange.getIn().setHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); - - final String nodeTemplateID = invokeIaRequest.getNodeTemplateID(); - exchange.getIn().setHeader(MBHeader.NODETEMPLATEID_STRING.toString(), nodeTemplateID); - - final String relationshipTemplateID = invokeIaRequest.getRelationshipTemplateID(); - exchange.getIn().setHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), relationshipTemplateID); - - interfaceName = invokeIaRequest.getInterfaceName(); - - if (interfaceName != null && !(interfaceName.equals("?") || interfaceName.isEmpty())) { - exchange.getIn().setHeader(MBHeader.INTERFACENAME_STRING.toString(), interfaceName); - } - - operationName = invokeIaRequest.getOperationName(); - - paramsMap = invokeIaRequest.getParams(); - - doc = invokeIaRequest.getDoc(); - - exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, "invokeIA"); - - } - - if (exchange.getIn().getBody() instanceof InvokePlan) { - - RequestProcessor.LOG.debug("Processing plan invocation"); - - final InvokePlan invokePlanRequest = (InvokePlan) exchange.getIn().getBody(); - - csarIDString = invokePlanRequest.getCsarID(); - - serviceInstanceID = invokePlanRequest.getServiceInstanceID(); - if (serviceInstanceID != null) { - exchange.getIn().setHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), new URI(serviceInstanceID)); - } - - final String planIDNamespaceURI = invokePlanRequest.getPlanIDNamespaceURI(); - final String planIDLocalPart = invokePlanRequest.getPlanIDLocalPart(); - - final QName planID = new QName(planIDNamespaceURI, planIDLocalPart); - exchange.getIn().setHeader(MBHeader.PLANID_QNAME.toString(), planID); - - operationName = invokePlanRequest.getOperationName(); - - callbackAddress = invokePlanRequest.getReplyTo(); - - messageID = invokePlanRequest.getMessageID(); - - paramsMap = invokePlanRequest.getParams(); - - doc = invokePlanRequest.getDoc(); - - if (callbackAddress != null && !(callbackAddress.isEmpty() || callbackAddress.equals("?"))) { - exchange.getIn().setHeader("ReplyTo", callbackAddress); - } - - if (messageID != null && !(messageID.isEmpty() || messageID.equals("?"))) { - exchange.getIn().setHeader("MessageID", messageID); - } - - exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, "invokePlan"); - } - - final CSARID csarID = new CSARID(csarIDString); - - exchange.getIn().setHeader(MBHeader.CSARID.toString(), csarID); - exchange.getIn().setHeader(MBHeader.OPERATIONNAME_STRING.toString(), operationName); - exchange.getIn().setHeader(MBHeader.APIID_STRING.toString(), Activator.apiID); - - if (paramsMap != null) { - // put key-value params into camel exchange body as hashmap - final HashMap params = new HashMap<>(); - - for (final ParamsMapItemType param : paramsMap.getParam()) { - params.put(param.getKey(), param.getValue()); - } - exchange.getIn().setBody(params); - - } - - else if (doc != null && doc.getAny() != null) { - final DocumentBuilderFactory dFact = DocumentBuilderFactory.newInstance(); - final DocumentBuilder build = dFact.newDocumentBuilder(); - final Document document = build.newDocument(); - - final Element element = doc.getAny(); - - document.adoptNode(element); - document.appendChild(element); - - exchange.getIn().setBody(document); - - } else { - exchange.getIn().setBody(null); - } - - } -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/ResponseProcessor.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/ResponseProcessor.java deleted file mode 100644 index f35f045ea..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/ResponseProcessor.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.opentosca.bus.management.api.soaphttp.processor; - -import java.util.HashMap; -import java.util.Map.Entry; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.opentosca.bus.management.api.soaphttp.model.Doc; -import org.opentosca.bus.management.api.soaphttp.model.InvokeResponse; -import org.opentosca.bus.management.api.soaphttp.model.ParamsMap; -import org.opentosca.bus.management.api.soaphttp.model.ParamsMapItemType; -import org.opentosca.bus.management.header.MBHeader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -/** - * Response-Processor of the Management Bus-SOAP/HTTP-API.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * This processor processes the from the Management Bus incoming response of a invoked service. The - * response is transformed into a marshallable object. - * - * @see MBHeader - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class ResponseProcessor implements Processor { - - - final private static Logger LOG = LoggerFactory.getLogger(ResponseProcessor.class); - - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) throws Exception { - - ResponseProcessor.LOG.debug("Processing the response..."); - - final InvokeResponse invokeResponse = new InvokeResponse(); - - if (exchange.getIn().getBody() instanceof HashMap) { - - ResponseProcessor.LOG.debug("Response is of type HashMap."); - - final HashMap responseMap = exchange.getIn().getBody(HashMap.class); - - ParamsMapItemType mapItem; - final ParamsMap paramsMap = new ParamsMap(); - - for (final Entry entry : responseMap.entrySet()) { - final String key = entry.getKey(); - final String value = entry.getValue(); - mapItem = new ParamsMapItemType(); - mapItem.setKey(key); - mapItem.setValue(value); - paramsMap.getParam().add(mapItem); - } - - invokeResponse.setParams(paramsMap); - - exchange.getIn().setBody(invokeResponse); - - } - - if (exchange.getIn().getBody() instanceof Document) { - - ResponseProcessor.LOG.debug("Response is of type Document."); - - final Document responseDoc = exchange.getIn().getBody(Document.class); - final NodeList nodeList = responseDoc.getChildNodes(); - - final Doc ar = new Doc(); - - for (int i = 0; i < nodeList.getLength(); i++) { - ar.setAny((Element) nodeList.item(i)); - - } - invokeResponse.setDoc(ar); - exchange.getIn().setBody(invokeResponse); - - } - - // Async - if (exchange.getIn().getHeader("MessageID") != null) { - - final String messageID = exchange.getIn().getHeader("MessageID", String.class); - - exchange.getIn().setHeader("operationName", "callback"); - exchange.getIn().setHeader("operationNamespace", "http://siserver.org/wsdl"); - - exchange.getIn().setHeader("RelatesTo", messageID); - invokeResponse.setMessageID(messageID); - - } - - } - -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/package-info.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/package-info.java deleted file mode 100644 index 34e2b3ce8..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/processor/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This package contains the two camel processors of the Management Bus-SOAP/HTTP-API. One for - * processing the request and one for processing the response.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.api.soaphttp.processor; diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/route/Route.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/route/Route.java deleted file mode 100644 index a90c7f26a..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/route/Route.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.opentosca.bus.management.api.soaphttp.route; - -import java.net.URL; - -import javax.xml.bind.JAXBContext; -import javax.xml.namespace.QName; - -import org.apache.camel.Predicate; -import org.apache.camel.Processor; -import org.apache.camel.builder.PredicateBuilder; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.cxf.common.header.CxfHeaderFilterStrategy; -import org.apache.camel.component.cxf.common.message.CxfConstants; -import org.apache.camel.converter.jaxb.JaxbDataFormat; -import org.opentosca.bus.management.api.soaphttp.Activator; -import org.opentosca.bus.management.api.soaphttp.processor.RequestProcessor; -import org.opentosca.bus.management.api.soaphttp.processor.ResponseProcessor; -import org.opentosca.container.core.common.Settings; - -/** - * Route of the Management Bus-SOAP/HTTP-API.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * Here the route an incoming invoke-request has to pass is defined. Also the web services to - * consume and produce a SOAP message are created here. An incoming SOAP message will be - * unmarshalled and with the request-processor transformed. After that the message will be given the - * Management Bus for further execution. The response will be transformed, marshalled and send to - * the recipient. Supported are both synchronous request-response communication and asynchronous - * communication with callback. MessageID and ReplyTo-address can be passed as parameter of the SOAP - * body or as WS-A header. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Route extends RouteBuilder { - - - public final static String PUBLIC_ENDPOINT = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":8081/invoker"; - private final static String ENDPOINT = "http://0.0.0.0:8081/invoker"; - public final static QName PORT = new QName("http://siserver.org/wsdl", "InvokePort"); - public final static QName PORTTYPE = new QName("http://siserver.org/wsdl", "InvokePortType"); - - - @Override - public void configure() throws Exception { - - final URL wsdlURL = this.getClass().getClassLoader().getResource("META-INF/wsdl/invoker.wsdl"); - - // CXF Endpoints - final String INVOKE_ENDPOINT = "cxf:" + ENDPOINT + "?wsdlURL=" + wsdlURL.toString() - + "&serviceName={http://siserver.org/wsdl}InvokerService&portName=" + Route.PORT.toString() - + "&dataFormat=PAYLOAD&loggingFeatureEnabled=true"; - final String CALLBACK_ENDPOINT = "cxf:${header[ReplyTo]}?wsdlURL=" + wsdlURL.toString() - + "&serviceName={http://siserver.org/wsdl}CallbackService&portName={http://siserver.org/wsdl}CallbackPort&dataFormat=PAYLOAD&loggingFeatureEnabled=true&headerFilterStrategy=#" - + CxfHeaderFilterStrategy.class.getName(); - - // Management Bus Endpoints - final String MANAGEMENT_BUS_IA = - "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokeIA"; - final String MANAGEMENT_BUS_PLAN = - "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokePlan"; - - // Checks if invoking a IA - final Predicate INVOKE_IA = header(CxfConstants.OPERATION_NAME).isEqualTo("invokeIA"); - - // Checks if invoking a Plan - final Predicate INVOKE_PLAN = header(CxfConstants.OPERATION_NAME).isEqualTo("invokePlan"); - - // Checks if invoke is sync or async - final Predicate MESSAGEID = header("MessageID").isNotNull(); - final Predicate REPLYTO = header("ReplyTo").isNotNull(); - final Predicate ASYNC = PredicateBuilder.and(MESSAGEID, REPLYTO); - - final ClassLoader cl = org.opentosca.bus.management.api.soaphttp.model.ObjectFactory.class.getClassLoader(); - final JAXBContext jc = JAXBContext.newInstance("org.opentosca.bus.management.api.soaphttp.model", cl); - final JaxbDataFormat requestJaxb = new JaxbDataFormat(jc); - final JaxbDataFormat responseJaxb = new JaxbDataFormat(jc); - responseJaxb.setPartClass("org.opentosca.bus.management.api.soaphttp.model.InvokeResponse"); - responseJaxb.setPartNamespace(new QName("http://siserver.org/schema", "invokeResponse")); - - final Processor requestProcessor = new RequestProcessor(); - final Processor responseProcessor = new ResponseProcessor(); - - this.from(INVOKE_ENDPOINT).unmarshal(requestJaxb).process(requestProcessor).choice().when(INVOKE_IA) - .to(MANAGEMENT_BUS_IA).when(INVOKE_PLAN).to(MANAGEMENT_BUS_PLAN).end(); - - this.from("direct-vm:" + Activator.apiID).process(responseProcessor).marshal(responseJaxb).choice().when(ASYNC) - .recipientList(this.simple(CALLBACK_ENDPOINT)).end(); - } -} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/route/package-info.java b/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/route/package-info.java deleted file mode 100644 index a3e58c3c5..000000000 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/route/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This package contains the camel routes of the Management Bus-SOAP/HTTP-API.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.api.soaphttp.route; diff --git a/org.opentosca.bus.management.deployment.plugin.remote/META-INF/MANIFEST.MF b/org.opentosca.bus.management.deployment.plugin.remote/META-INF/MANIFEST.MF deleted file mode 100644 index 76552c1ad..000000000 --- a/org.opentosca.bus.management.deployment.plugin.remote/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.deployment.plugin.remote -Bundle-SymbolicName: org.opentosca.bus.management.deployment.plugin.remote -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.osgi.framework;version="1.8.0", - org.slf4j;version="1.6.4" -Service-Component: OSGI-INF/* -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.bus.management.deployment.plugin;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0", - org.opentosca.container.core, - org.opentosca.bus.management.service.impl -Bundle-ActivationPolicy: lazy -Bundle-Activator: org.opentosca.bus.management.deployment.plugin.remote.Activator diff --git a/org.opentosca.bus.management.deployment.plugin.remote/OSGI-INF/ManagementBusDeploymentPluginRemote - component.xml b/org.opentosca.bus.management.deployment.plugin.remote/OSGI-INF/ManagementBusDeploymentPluginRemote - component.xml deleted file mode 100644 index eea9d9276..000000000 --- a/org.opentosca.bus.management.deployment.plugin.remote/OSGI-INF/ManagementBusDeploymentPluginRemote - component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.management.deployment.plugin.remote/build.properties b/org.opentosca.bus.management.deployment.plugin.remote/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.bus.management.deployment.plugin.remote/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.management.deployment.plugin.remote/pom.xml b/org.opentosca.bus.management.deployment.plugin.remote/pom.xml deleted file mode 100644 index fd9935ec4..000000000 --- a/org.opentosca.bus.management.deployment.plugin.remote/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.deployment.plugin.remote - eclipse-plugin - - diff --git a/org.opentosca.bus.management.deployment.plugin.remote/src/org/opentosca/bus/management/deployment/plugin/remote/Activator.java b/org.opentosca.bus.management.deployment.plugin.remote/src/org/opentosca/bus/management/deployment/plugin/remote/Activator.java deleted file mode 100644 index d42d1de54..000000000 --- a/org.opentosca.bus.management.deployment.plugin.remote/src/org/opentosca/bus/management/deployment/plugin/remote/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2018, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.bus.management.deployment.plugin.remote; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.bus.management.deployment.plugin.script/META-INF/MANIFEST.MF b/org.opentosca.bus.management.deployment.plugin.script/META-INF/MANIFEST.MF deleted file mode 100644 index 7a5974afd..000000000 --- a/org.opentosca.bus.management.deployment.plugin.script/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.deployment.plugin.script -Bundle-SymbolicName: org.opentosca.bus.management.deployment.plugin.script -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.18.3", - org.apache.cxf.message;version="3.1.10", - org.eclipse.osgi.util;version="1.1.0", - org.osgi.framework;version="1.8.0", - org.slf4j;version="1.6.4" -Service-Component: OSGI-INF/* -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.bus.management.deployment.plugin;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0" -Bundle-ActivationPolicy: lazy -Bundle-Activator: org.opentosca.bus.management.deployment.plugin.script.Activator diff --git a/org.opentosca.bus.management.deployment.plugin.script/OSGI-INF/ManagementBusDeploymentPluginScript - component.xml b/org.opentosca.bus.management.deployment.plugin.script/OSGI-INF/ManagementBusDeploymentPluginScript - component.xml deleted file mode 100644 index d7b38333c..000000000 --- a/org.opentosca.bus.management.deployment.plugin.script/OSGI-INF/ManagementBusDeploymentPluginScript - component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.management.deployment.plugin.script/build.properties b/org.opentosca.bus.management.deployment.plugin.script/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.bus.management.deployment.plugin.script/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.management.deployment.plugin.script/pom.xml b/org.opentosca.bus.management.deployment.plugin.script/pom.xml deleted file mode 100644 index 9a3b92c43..000000000 --- a/org.opentosca.bus.management.deployment.plugin.script/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.deployment.plugin.script - eclipse-plugin - - diff --git a/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/Activator.java b/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/Activator.java deleted file mode 100644 index b1a0196d1..000000000 --- a/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2018, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.bus.management.deployment.plugin.script; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/ManagementBusDeploymentPluginScript.java b/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/ManagementBusDeploymentPluginScript.java deleted file mode 100644 index aa5e69a95..000000000 --- a/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/ManagementBusDeploymentPluginScript.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.opentosca.bus.management.deployment.plugin.script; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; - -import org.apache.camel.Exchange; -import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; -import org.opentosca.bus.management.deployment.plugin.script.util.Messages; -import org.opentosca.bus.management.header.MBHeader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Management Bus-Plug-in for the deployment of Script IAs.
- *
- * - * - * - * Since Script IAs have to be executed on a host machine, they don´t have to be deployed. - * Therefore, this Plug-in is only a wrapper for the supported types and capabilities. When the - * deployment is invoked it just returns a wildcard endpoint. Likewise, it always returns success - * when the undeployment is invoked. - * - * - * - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * - * - */ -public class ManagementBusDeploymentPluginScript implements IManagementBusDeploymentPluginService { - - // In messages.properties defined plugin types and capabilities - static final private String TYPES = Messages.DeploymentPluginScript_types; - static final private String CAPABILITIES = Messages.DeploymentPluginScript_capabilities; - - static final private Logger LOG = LoggerFactory.getLogger(ManagementBusDeploymentPluginScript.class); - - @Override - public Exchange invokeImplementationArtifactDeployment(final Exchange exchange) { - URI endpoint = null; - try { - // return dummy endpoint for further processing without aborting due to missing endpoint - endpoint = new URI("ManagementBusDeploymentPluginScript:ScriptEndpoint"); - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - exchange.getIn().setHeader(MBHeader.ENDPOINT_URI.toString(), endpoint); - return exchange; - } - - @Override - public Exchange invokeImplementationArtifactUndeployment(final Exchange exchange) { - exchange.getIn().setHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), true); - return exchange; - } - - @Override - /** - * {@inheritDoc} - */ - public List getSupportedTypes() { - ManagementBusDeploymentPluginScript.LOG.debug("Getting Types: {}.", ManagementBusDeploymentPluginScript.TYPES); - final List types = new ArrayList<>(); - - for (final String type : ManagementBusDeploymentPluginScript.TYPES.split("[,;]")) { - types.add(type.trim()); - } - return types; - } - - @Override - /** - * {@inheritDoc} - */ - public List getCapabilties() { - ManagementBusDeploymentPluginScript.LOG.debug("Getting Plugin-Capabilities: {}.", - ManagementBusDeploymentPluginScript.CAPABILITIES); - final List capabilities = new ArrayList<>(); - - for (final String capability : ManagementBusDeploymentPluginScript.CAPABILITIES.split("[,;]")) { - capabilities.add(capability.trim()); - } - return capabilities; - } -} diff --git a/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/util/Messages.java b/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/util/Messages.java deleted file mode 100644 index 7d7ffaba1..000000000 --- a/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/util/Messages.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.opentosca.bus.management.deployment.plugin.script.util; - -import org.eclipse.osgi.util.NLS; - -/** - * Utility class to define Strings in messages.properties. - */ -public class Messages extends NLS { - - private static final String BUNDLE_NAME = Messages.class.getPackage().getName() + ".messages"; //$NON-NLS-1$ - public static String DeploymentPluginScript_types; - public static String DeploymentPluginScript_capabilities; - static { - // initialize resource bundle - NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class); - } - - private Messages() {} -} diff --git a/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/util/messages.properties b/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/util/messages.properties deleted file mode 100644 index 8e00c9f64..000000000 --- a/org.opentosca.bus.management.deployment.plugin.script/src/org/opentosca/bus/management/deployment/plugin/script/util/messages.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Contains the type of the plugin as well as provided capabilities. -DeploymentPluginScript_types={http://opentosca.org/artifacttypes}Chef, {http://opentosca.org/artifacttypes}Ansible, {http://www.example.com/clartigr/tosca}clartigr, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}Chef, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}Puppet, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}Juju, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}CloudFoundry, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}UnixShell, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}ScriptArtifact -DeploymentPluginScript_capabilities= \ No newline at end of file diff --git a/org.opentosca.bus.management.deployment.plugin.tomcat/META-INF/MANIFEST.MF b/org.opentosca.bus.management.deployment.plugin.tomcat/META-INF/MANIFEST.MF deleted file mode 100644 index 66bea68d8..000000000 --- a/org.opentosca.bus.management.deployment.plugin.tomcat/META-INF/MANIFEST.MF +++ /dev/null @@ -1,24 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.deployment.plugin.tomcat -Bundle-SymbolicName: org.opentosca.bus.management.deployment.plugin.tomcat -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.18.3", - org.apache.commons.io;version="2.2.0", - org.apache.commons.lang3;version="3.1.0", - org.apache.cxf.message;version="3.1.10", - org.apache.http;version="4.3.3", - org.apache.http.client;version="4.5.2", - org.apache.http.entity.mime;version="4.5.2", - org.apache.http.entity.mime.content;version="4.5.2", - org.eclipse.osgi.util;version="1.1.0", - org.osgi.framework;version="1.8.0", - org.slf4j;version="1.6.4" -Service-Component: OSGI-INF/* -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.bus.management.deployment.plugin;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0", - org.opentosca.container.core -Bundle-ActivationPolicy: lazy -Bundle-Activator: org.opentosca.bus.management.deployment.plugin.tomcat.Activator diff --git a/org.opentosca.bus.management.deployment.plugin.tomcat/OSGI-INF/ManagementBusDeploymentPluginTomcat - component.xml b/org.opentosca.bus.management.deployment.plugin.tomcat/OSGI-INF/ManagementBusDeploymentPluginTomcat - component.xml deleted file mode 100644 index cfdab209f..000000000 --- a/org.opentosca.bus.management.deployment.plugin.tomcat/OSGI-INF/ManagementBusDeploymentPluginTomcat - component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.bus.management.deployment.plugin.tomcat/build.properties b/org.opentosca.bus.management.deployment.plugin.tomcat/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.bus.management.deployment.plugin.tomcat/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.management.deployment.plugin.tomcat/pom.xml b/org.opentosca.bus.management.deployment.plugin.tomcat/pom.xml deleted file mode 100644 index b37469207..000000000 --- a/org.opentosca.bus.management.deployment.plugin.tomcat/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.deployment.plugin.tomcat - eclipse-plugin - - diff --git a/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/Activator.java b/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/Activator.java deleted file mode 100644 index 6ec043de1..000000000 --- a/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2018, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.bus.management.deployment.plugin.tomcat; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/ManagementBusDeploymentPluginTomcat.java b/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/ManagementBusDeploymentPluginTomcat.java deleted file mode 100644 index 6644190ed..000000000 --- a/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/ManagementBusDeploymentPluginTomcat.java +++ /dev/null @@ -1,486 +0,0 @@ -package org.opentosca.bus.management.deployment.plugin.tomcat; - -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.entity.mime.HttpMultipartMode; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.entity.mime.content.FileBody; -import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; -import org.opentosca.bus.management.deployment.plugin.tomcat.util.Messages; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.service.IHTTPService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Management Bus-Plug-in for the deployment of WAR IAs on an Apache Tomcat web server.
- *
- * - * - * - * This Plug-in is able to deploy and undeploy WAR Artifacts on an Apache Tomcat. It gets a camel - * exchange object from the Management Bus which contains all information that is needed for the - * deployment/undeployment.
- *
- * - * Tomcat config: Tomcat location, username and password for this Plug-in are defined in the - * class {@link Settings} or the corresponding config.ini file.
- *
- * - * Deployment: The {@link MBHeader#ARTIFACTREFERENCES_LIST_STRING} header field contains a - * list with all ArtifactReferences for the current IA. This list is used to find the reference to - * the WAR-File that has to be deployed. When a reference is found, the respective file ist - * retrieved. The {@link MBHeader#ARTIFACTSERVICEENDPOINT_STRING} header field determines whether - * the deployment is done on the management infrastructure or as part of the topology to which this - * IA belongs. If the header contains a placeholder the IA is deployed as part of the topology and - * this Plug-in just returns an endpoint. Otherwise the deployment is done via a HTTP request to the - * Apache Tomcat.
- *
- * - * Undeployment: The {@link MBHeader#ENDPOINT_URI} header field contains the endpoint of the - * deployed IA. This endpoint is used to calculate the deployment path of the IA and to send an - * undeployment request to the Tomcat.
- *
- * - * Copyright 2018 IAAS University of Stuttgart
- *
- * - * - * - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * - */ -public class ManagementBusDeploymentPluginTomcat implements IManagementBusDeploymentPluginService { - - // In messages.properties defined plugin types and capabilities - static final private String TYPES = Messages.DeploymentPluginTomcat_types; - static final private String CAPABILITIES = Messages.DeploymentPluginTomcat_capabilities; - - private IHTTPService httpService; - - static final private Logger LOG = LoggerFactory.getLogger(ManagementBusDeploymentPluginTomcat.class); - - @Override - public Exchange invokeImplementationArtifactDeployment(final Exchange exchange) { - - ManagementBusDeploymentPluginTomcat.LOG.debug("Trying to deploy IA on Tomcat."); - final Message message = exchange.getIn(); - - String endpoint = null; - - @SuppressWarnings("unchecked") - final List artifactReferences = - message.getHeader(MBHeader.ARTIFACTREFERENCES_LISTSTRING.toString(), List.class); - - // get URL of the WAR-File that has to be deployed - final URL warURL = getWARFileReference(artifactReferences); - - if (warURL != null) { - // get the WAR artifact as file - final File warFile = getWarFile(warURL); - - if (warFile != null) { - // get file name of the WAR-File - final String fileName = FilenameUtils.getBaseName(warURL.getPath()); - - // retrieve ServiceEndpoint property from exchange headers - String endpointSuffix = - message.getHeader(MBHeader.ARTIFACTSERVICEENDPOINT_STRING.toString(), String.class); - - if (endpointSuffix != null) { - ManagementBusDeploymentPluginTomcat.LOG.info("Endpoint suffix from header: {}", endpointSuffix); - } else { - ManagementBusDeploymentPluginTomcat.LOG.info("No endpoint suffix defined."); - endpointSuffix = ""; - } - - // if placeholder is defined the deployment is done in the topology - final String placeholderBegin = "/PLACEHOLDER_"; - final String placeholderEnd = "_PLACEHOLDER/"; - if (endpointSuffix.toString().contains(placeholderBegin) - && endpointSuffix.toString().contains(placeholderEnd)) { - - // just return a created endpoint and do not perform deployment - final String placeholder = - endpointSuffix.substring(endpointSuffix.indexOf(placeholderBegin), - endpointSuffix.indexOf(placeholderEnd) + placeholderEnd.length()); - - ManagementBusDeploymentPluginTomcat.LOG.info("Placeholder defined: {}. Deployment is done as part of the topology and not on the management infrastructure. ", - placeholder); - - final String endpointBegin = endpointSuffix.substring(0, endpointSuffix.indexOf(placeholderBegin)); - final String endpointEnd = - endpointSuffix.substring(endpointSuffix.lastIndexOf(placeholderEnd) + placeholderEnd.length()); - - // We assume that the WAR-File in the topology is deployed at the default port - // 8080 and only with the file name as path. Find a better solution which looks - // into the topology and determines the correct endpoint. - endpoint = endpointBegin + placeholder + ":8080/" + fileName + "/" + endpointEnd; - } else { - - // check if Tomcat is running to continue deployment - if (isRunning()) { - ManagementBusDeploymentPluginTomcat.LOG.info("Tomcat is running and can be accessed."); - - final QName typeImplementation = - message.getHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), QName.class); - - final String triggeringContainer = - message.getHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), String.class); - - // perform deployment on management infrastructure - endpoint = deployWAROnTomcat(warFile, triggeringContainer, typeImplementation, fileName); - - if (endpoint != null) { - // add endpoint suffix to endpoint of deployed WAR - endpoint = endpoint.concat(endpointSuffix); - ManagementBusDeploymentPluginTomcat.LOG.info("Complete endpoint of IA {}: {}", fileName, - endpoint); - } - } else { - ManagementBusDeploymentPluginTomcat.LOG.error("Deployment failed: Tomcat is not running or can´t be accessed"); - } - } - - // delete the temporary file - warFile.delete(); - } else { - ManagementBusDeploymentPluginTomcat.LOG.error("Deployment failed: unable to retrieve WAR-File from URL"); - } - } else { - ManagementBusDeploymentPluginTomcat.LOG.error("Deployment failed: no referenced WAR-File found"); - } - - // set endpoint and pass camel exchange back to caller - message.setHeader(MBHeader.ENDPOINT_URI.toString(), getURI(endpoint)); - return exchange; - } - - @Override - public Exchange invokeImplementationArtifactUndeployment(final Exchange exchange) { - - ManagementBusDeploymentPluginTomcat.LOG.debug("Trying to undeploy IA from Tomcat."); - final Message message = exchange.getIn(); - - // set operation state to false and only change after successful undeployment - message.setHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), false); - - // get endpoint from header to calculate deployment path - final URI endpointURI = message.getHeader(MBHeader.ENDPOINT_URI.toString(), URI.class); - - if (endpointURI != null) { - final String endpoint = endpointURI.toString(); - ManagementBusDeploymentPluginTomcat.LOG.debug("Endpoint for undeployment: {}", endpoint); - - // delete Tomcat URL prefix from endpoint - String deployPath = endpoint.replace(Settings.ENGINE_IA_TOMCAT_URL, ""); - - // delete ServiceEndpoint suffix from endpoints - deployPath = deployPath.substring(0, StringUtils.ordinalIndexOf(deployPath, "/", 4)); - - // command to perform deployment on Tomcat from local file - final String undeploymentURL = Settings.ENGINE_IA_TOMCAT_URL + "/manager/text/undeploy?path=" + deployPath; - ManagementBusDeploymentPluginTomcat.LOG.debug("Undeployment command: {}", undeploymentURL); - - try { - // perform undeployment request on Tomcat - final HttpResponse httpResponse = - this.httpService.Get(undeploymentURL, Settings.ENGINE_IA_TOMCAT_USERNAME, - Settings.ENGINE_IA_TOMCAT_PASSWORD); - final String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"); - - ManagementBusDeploymentPluginTomcat.LOG.debug("Tomcat response: {}", response); - - // check if WAR-File was undeployed successfully - if (response.contains("OK - Undeployed application at context path [" + deployPath + "]")) { - - ManagementBusDeploymentPluginTomcat.LOG.debug("IA successfully undeployed from Tomcat!"); - message.setHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), true); - - } else { - ManagementBusDeploymentPluginTomcat.LOG.error("Undeployment not successfully!"); - } - } - catch (final IOException e) { - ManagementBusDeploymentPluginTomcat.LOG.error("IOException occured while undeploying the WAR-File: {}!", - e); - } - } else { - ManagementBusDeploymentPluginTomcat.LOG.error("No endpoint defined. Undeployment not possible!"); - } - - return exchange; - } - - @Override - /** - * {@inheritDoc} - */ - public List getSupportedTypes() { - ManagementBusDeploymentPluginTomcat.LOG.debug("Getting Types: {}.", ManagementBusDeploymentPluginTomcat.TYPES); - final List types = new ArrayList<>(); - - for (final String type : ManagementBusDeploymentPluginTomcat.TYPES.split("[,;]")) { - types.add(type.trim()); - } - return types; - } - - @Override - /** - * {@inheritDoc} - */ - public List getCapabilties() { - ManagementBusDeploymentPluginTomcat.LOG.debug("Getting Plugin-Capabilities: {}.", - ManagementBusDeploymentPluginTomcat.CAPABILITIES); - final List capabilities = new ArrayList<>(); - - for (final String capability : ManagementBusDeploymentPluginTomcat.CAPABILITIES.split("[,;]")) { - capabilities.add(capability.trim()); - } - return capabilities; - } - - /** - * Check if the Tomcat which is references as the IA-engine in the container config.ini is - * running. - * - * @return true if Tomcat is running and can be accessed, false otherwise - */ - private boolean isRunning() { - ManagementBusDeploymentPluginTomcat.LOG.info("Checking if Tomcat is running on {} and can be accessed...", - Settings.ENGINE_IA_TOMCAT_URL); - - // URL to get serverinfo from Tomcat - final String url = Settings.ENGINE_IA_TOMCAT_URL + "/manager/text/serverinfo"; - - // execute HTPP GET on URL and check the response - try { - final HttpResponse httpResponse = - this.httpService.Get(url, Settings.ENGINE_IA_TOMCAT_USERNAME, Settings.ENGINE_IA_TOMCAT_PASSWORD); - - final String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"); - - ManagementBusDeploymentPluginTomcat.LOG.debug(response); - - if (response.contains("OK - Server info")) { - return true; - } - } - catch (final Exception e) { - ManagementBusDeploymentPluginTomcat.LOG.error("Error while checking for availability of the Tomcat: {}", - e.getMessage()); - } - - return false; - } - - /** - * Check if the artifact references contain a WAR-File and return the URL to the file if so. - * - * @param artifactReferences the references to check if a WAR-File is available - * @return the URL to the file or null if no file is found - */ - private URL getWARFileReference(final List artifactReferences) { - ManagementBusDeploymentPluginTomcat.LOG.info("Searching for a reference to a WAR-File..."); - - if (artifactReferences != null) { - for (final String reference : artifactReferences) { - - // check if reference targets a WAR-File - if (reference.toLowerCase().endsWith(".war")) { - ManagementBusDeploymentPluginTomcat.LOG.info("Found WAR-File reference: {}", reference); - try { - return new URL(reference); - } - catch (final MalformedURLException e) { - ManagementBusDeploymentPluginTomcat.LOG.error("Failed to convert the reference to a URL: {}", - e.getMessage()); - } - } - } - } - return null; - } - - /** - * Retrieve the WAR-File from the given URL and store it as local temp file. - * - * @param warURL the URL to the WAR-File that shall be retrieved - * @return the file if retrieval was successful, null otherwise - */ - private File getWarFile(final URL warURL) { - ManagementBusDeploymentPluginTomcat.LOG.info("Trying to retrieve WAR-File from URL: {}", warURL); - - if (warURL != null) { - try { - // store WAR artifact as temporary file - final File tempFile = File.createTempFile("Artifact", ".war"); - tempFile.deleteOnExit(); - FileUtils.copyURLToFile(warURL, tempFile); - return tempFile; - } - catch (final IOException e) { - ManagementBusDeploymentPluginTomcat.LOG.error("Failed to retrieve WAR-File: {}", e.getMessage()); - } - } - return null; - } - - - /** - * Deploy the given WAR-File on the Tomcat. As path on Tomcat the host name of the triggering - * OpenTOSCA Container and the NodeTypeImplementation with removed special characters (except - * '-' and '_') concatenated with the name of the WAR-File (without ".war") is used: - * /[Container-Hostname]/[TypeImplementationID]/[File-Name] - * - * @param warFile the WAR artifact that has to be deployed - * @param triggeringContainer the host name of the OpenTOSCA Container that triggered the IA - * deployment - * @param typeImplementation the NodeTypeImplementation or RelationshipTypeImplementation which - * is used to create a unique path where the WAR is deployed - * @param fileName the file name which is part of the deployment path - * @return - */ - private String deployWAROnTomcat(final File warFile, final String triggeringContainer, - final QName typeImplementation, final String fileName) { - - String endpoint = null; - - if (triggeringContainer != null) { - if (typeImplementation != null) { - // path where the WAR is deployed on the Tomcat - final String deployPath = "/" + getConvertedString(triggeringContainer) + "/" - + getConvertedString(typeImplementation.toString()) + "/" + fileName; - - // command to perform deployment on Tomcat from local file - final String deploymentURL = - Settings.ENGINE_IA_TOMCAT_URL + "/manager/text/deploy?update=true&path=" + deployPath; - - // create HttpEntity which contains the WAR-File - final MultipartEntityBuilder builder = MultipartEntityBuilder.create(); - builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); - final FileBody fileBody = new FileBody(warFile); - builder.addPart(fileName + ".war", fileBody); - final HttpEntity entity = builder.build(); - - try { - // perform deployment request on Tomcat - final HttpResponse httpResponse = - this.httpService.Put(deploymentURL, entity, Settings.ENGINE_IA_TOMCAT_USERNAME, - Settings.ENGINE_IA_TOMCAT_PASSWORD); - - final String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"); - - ManagementBusDeploymentPluginTomcat.LOG.info("Tomcat response to deployment request: {}", response); - - // check if WAR-File was deployed successfully. - if (response.contains("OK - Deployed application at context path " + deployPath) - | response.contains("OK - Deployed application at context path [" + deployPath + "]")) { - ManagementBusDeploymentPluginTomcat.LOG.info("Deployment was successful."); - - // concatenate service endpoint - endpoint = Settings.ENGINE_IA_TOMCAT_URL + deployPath; - - ManagementBusDeploymentPluginTomcat.LOG.info("Endpoint of deployed service: {}", endpoint); - } else { - ManagementBusDeploymentPluginTomcat.LOG.error("Deployment was not successful."); - } - } - catch (final IOException e) { - ManagementBusDeploymentPluginTomcat.LOG.error("IOException occured while deploying the WAR-File: {}!", - e); - } - } else { - ManagementBusDeploymentPluginTomcat.LOG.warn("NodeTypeImplementation ID is null. Deployment aborted because the ID is part of the deployment path on Tomcat"); - } - } else { - ManagementBusDeploymentPluginTomcat.LOG.warn("Triggering Container host name is null. Deployment aborted because it is part of the deployment path on Tomcat"); - } - - return endpoint; - } - - /** - * Remove invalid characters from the provided String. - * - * @param string the String to convert - * @return String with replaced '.' by "-" and removed remaining special characters (except '-' - * and '_'). - */ - private String getConvertedString(final String string) { - - ManagementBusDeploymentPluginTomcat.LOG.debug("Converting String: {}", string); - - // replace '.' by '-' to leave IPs unique - String convertedString = string.replace(".", "-"); - - // remove all special characters except '-' and '_' - convertedString = convertedString.replaceAll("[^-a-zA-Z0-9_]", ""); - - ManagementBusDeploymentPluginTomcat.LOG.debug("Converted string: {}", convertedString); - - return convertedString; - } - - /** - * Convert a String to an URI - * - * @param string the String that has to be converted to URI - * @return URI representation of the String if convertible, null otherwise - */ - private URI getURI(final String string) { - URI uri = null; - if (string != null) { - try { - uri = new URI(string); - } - catch (final URISyntaxException e) { - ManagementBusDeploymentPluginTomcat.LOG.error("Failed to transform String to URI: {} ", string); - } - } - return uri; - } - - /** - * Register IHTTPService. - * - * @param service - A IHTTPService to register. - */ - public void bindHTTPService(final IHTTPService httpService) { - if (httpService != null) { - this.httpService = httpService; - LOG.debug("Register IHTTPService: {} registered.", httpService.toString()); - } else { - LOG.error("Register IHTTPService: Supplied parameter is null!"); - } - } - - /** - * Unregister IHTTPService. - * - * @param service - A IHTTPService to unregister. - */ - public void unbindHTTPService(final IHTTPService httpService) { - this.httpService = null; - LOG.debug("Unregister IHTTPService: {} unregistered.", httpService.toString()); - } -} diff --git a/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/util/Messages.java b/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/util/Messages.java deleted file mode 100644 index d0e83fc98..000000000 --- a/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/util/Messages.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.opentosca.bus.management.deployment.plugin.tomcat.util; - -import org.eclipse.osgi.util.NLS; - -/** - * Utility class to define Strings in messages.properties. - */ -public class Messages extends NLS { - - private static final String BUNDLE_NAME = Messages.class.getPackage().getName() + ".messages"; //$NON-NLS-1$ - public static String DeploymentPluginTomcat_types; - public static String DeploymentPluginTomcat_capabilities; - static { - // initialize resource bundle - NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class); - } - - private Messages() {} -} diff --git a/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/util/messages.properties b/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/util/messages.properties deleted file mode 100644 index 881571708..000000000 --- a/org.opentosca.bus.management.deployment.plugin.tomcat/src/org/opentosca/bus/management/deployment/plugin/tomcat/util/messages.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Contains the type of the plugin as well as provided capabilities. -DeploymentPluginTomcat_types={http://www.example.com/ToscaTypes}WAR,{http://opentosca.org/artifacttypes}WAR -DeploymentPluginTomcat_capabilities=http://tomcat.apache.org/tomcat7.0, http://www.jcp.org/javaserverpages2.2 , http://www.jcp.org/servlet3.0 \ No newline at end of file diff --git a/org.opentosca.bus.management.deployment.plugin/META-INF/MANIFEST.MF b/org.opentosca.bus.management.deployment.plugin/META-INF/MANIFEST.MF deleted file mode 100644 index 662ee75a1..000000000 --- a/org.opentosca.bus.management.deployment.plugin/META-INF/MANIFEST.MF +++ /dev/null @@ -1,9 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.deployment.plugin -Bundle-SymbolicName: org.opentosca.bus.management.deployment.plugin -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.opentosca.bus.management.deployment.plugin -Import-Package: org.apache.camel;version="2.10.4", - org.opentosca.bus.management.header diff --git a/org.opentosca.bus.management.deployment.plugin/build.properties b/org.opentosca.bus.management.deployment.plugin/build.properties deleted file mode 100644 index b107977f4..000000000 --- a/org.opentosca.bus.management.deployment.plugin/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.bus.management.deployment.plugin/pom.xml b/org.opentosca.bus.management.deployment.plugin/pom.xml deleted file mode 100644 index 42eb3a6be..000000000 --- a/org.opentosca.bus.management.deployment.plugin/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.deployment.plugin - eclipse-plugin - - diff --git a/org.opentosca.bus.management.deployment.plugin/src/org/opentosca/bus/management/deployment/plugin/IManagementBusDeploymentPluginService.java b/org.opentosca.bus.management.deployment.plugin/src/org/opentosca/bus/management/deployment/plugin/IManagementBusDeploymentPluginService.java deleted file mode 100644 index 7d4b007f5..000000000 --- a/org.opentosca.bus.management.deployment.plugin/src/org/opentosca/bus/management/deployment/plugin/IManagementBusDeploymentPluginService.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.opentosca.bus.management.deployment.plugin; - -import java.util.List; - -import org.apache.camel.Exchange; -import org.opentosca.bus.management.header.MBHeader; - -/** - * Interface of the Management Bus Deployment Plug-ins.
- *
- * - * Copyright 2018 IAAS University of Stuttgart
- *
- * - * The interface specifies four methods. One for invoking the deployment of an Implementation - * Artifact, another for invoking the undeployment of a previously deployed Implementation Artifact - * and two methods that return the supported deployment types and the capabilities of the specific - * plug-in. - * - */ -public interface IManagementBusDeploymentPluginService { - - /** - * Invokes the deployment of an Implementation Artifact. - * - * @param exchange contains all needed information like the NodeTypeImplementation the - * ArtifactReferences to the files that have to be deployed and the "ServiceEndpoint" - * property if it is defined. - * - * @return the endpoint of the deployed Implementation Artifact as header field (see - * {@link MBHeader#ENDPOINT_URI}) of the exchange message or null if the deployment - * failed. - * - */ - public Exchange invokeImplementationArtifactDeployment(Exchange exchange); - - /** - * Invokes the undeployment of an Implementation Artifact. - * - * @param exchange contains all needed information like the endpoint of the deployed - * Implementation Artifact. - * - * @return the result of the undeployment process as header field (see - * {@link MBHeader#OPERATIONSTATE_BOOLEAN}) of the exchange message. - * - */ - public Exchange invokeImplementationArtifactUndeployment(Exchange exchange); - - /** - * Returns the supported deployment-types of the plug-in. - * - * @return list of strings each representing one supported deployment type of the plug-in. - * - */ - public List getSupportedTypes(); - - /** - * Returns the provided capabilities of the plug-in. - * - * @return list of strings each representing one capability of the plug-in. - * - */ - public List getCapabilties(); -} diff --git a/org.opentosca.bus.management.invocation.plugin.remote/META-INF/MANIFEST.MF b/org.opentosca.bus.management.invocation.plugin.remote/META-INF/MANIFEST.MF deleted file mode 100644 index 4802cd951..000000000 --- a/org.opentosca.bus.management.invocation.plugin.remote/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.invocation.plugin.remote -Bundle-SymbolicName: org.opentosca.bus.management.invocation.plugin.remote -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.management.invocation.plugin.remote.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.impl;version="2.18.3", - org.opentosca.bus.management.service.impl, - org.opentosca.bus.management.service.impl.collaboration, - org.opentosca.bus.management.service.impl.collaboration.model, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Service-Component: OSGI-INF/* -Bundle-ActivationPolicy: lazy -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0", - org.opentosca.bus.management.invocation.plugin;bundle-version="1.0.0" diff --git a/org.opentosca.bus.management.invocation.plugin.remote/OSGI-INF/ManagementBusInvocationPluginRemote - component.xml b/org.opentosca.bus.management.invocation.plugin.remote/OSGI-INF/ManagementBusInvocationPluginRemote - component.xml deleted file mode 100644 index d9b8f8776..000000000 --- a/org.opentosca.bus.management.invocation.plugin.remote/OSGI-INF/ManagementBusInvocationPluginRemote - component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.management.invocation.plugin.remote/build.properties b/org.opentosca.bus.management.invocation.plugin.remote/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.bus.management.invocation.plugin.remote/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.management.invocation.plugin.remote/pom.xml b/org.opentosca.bus.management.invocation.plugin.remote/pom.xml deleted file mode 100644 index 0bc327ab8..000000000 --- a/org.opentosca.bus.management.invocation.plugin.remote/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.invocation.plugin.remote - eclipse-plugin - - diff --git a/org.opentosca.bus.management.invocation.plugin.remote/src/org/opentosca/bus/management/invocation/plugin/remote/Activator.java b/org.opentosca.bus.management.invocation.plugin.remote/src/org/opentosca/bus/management/invocation/plugin/remote/Activator.java deleted file mode 100644 index 2b4c13e3e..000000000 --- a/org.opentosca.bus.management.invocation.plugin.remote/src/org/opentosca/bus/management/invocation/plugin/remote/Activator.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.remote; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the Remote-Invocation-Management-Bus-Plug-in.
- *
- * - * Copyright 2018 IAAS University of Stuttgart
- *
- * - * @author Benjamin Weder- st100495@stud.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - static BundleContext context; - - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.LOG.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.LOG.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.bus.management.invocation.plugin.rest/META-INF/MANIFEST.MF b/org.opentosca.bus.management.invocation.plugin.rest/META-INF/MANIFEST.MF deleted file mode 100644 index 6ffb08520..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.invocation.plugin.rest -Bundle-SymbolicName: org.opentosca.bus.management.invocation.plugin.rest -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.management.invocation.plugin.rest.Activator -Bundle-ActivationPolicy: lazy -Import-Package: com.google.gson;version="2.2.4", - org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.http;version="4.2.1", - org.apache.http.client.utils;version="4.2.0", - org.eclipse.osgi.util;version="1.1.0", - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0", - org.opentosca.bus.management.invocation.plugin;bundle-version="1.0.0" -Service-Component: OSGI-INF/* diff --git a/org.opentosca.bus.management.invocation.plugin.rest/OSGI-INF/ManagementBusInvocationPluginRest - component.xml b/org.opentosca.bus.management.invocation.plugin.rest/OSGI-INF/ManagementBusInvocationPluginRest - component.xml deleted file mode 100644 index 5d65954f7..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/OSGI-INF/ManagementBusInvocationPluginRest - component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.management.invocation.plugin.rest/build.properties b/org.opentosca.bus.management.invocation.plugin.rest/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.management.invocation.plugin.rest/pom.xml b/org.opentosca.bus.management.invocation.plugin.rest/pom.xml deleted file mode 100644 index 87bff57de..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.invocation.plugin.rest - eclipse-plugin - - diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/Activator.java b/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/Activator.java deleted file mode 100644 index cbd894c56..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.rest; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.impl.DefaultCamelContext; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the REST/HTTP-Invocation-Management Bus-Plug-in.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * The activator is needed to start the camel context. - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - public static DefaultCamelContext camelContext; - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.camelContext = new OsgiDefaultCamelContext(bundleContext); - Activator.camelContext.start(); - Activator.LOG.info("REST-INVOCATION-PLUGIN-STARTED"); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.camelContext = null; - Activator.LOG.info("REST-INVOCATION-PLUGIN-STOPPED"); - } - -} diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/ManagementBusInvocationPluginRest.java b/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/ManagementBusInvocationPluginRest.java deleted file mode 100644 index 1bb552cb4..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/ManagementBusInvocationPluginRest.java +++ /dev/null @@ -1,580 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.rest; - -import java.io.StringReader; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.ProducerTemplate; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; -import org.opentosca.bus.management.invocation.plugin.rest.model.ContentType; -import org.opentosca.bus.management.invocation.plugin.rest.model.DataAssign; -import org.opentosca.bus.management.invocation.plugin.rest.model.DataAssign.Operations.Operation; -import org.opentosca.bus.management.invocation.plugin.rest.util.Messages; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.traversal.DocumentTraversal; -import org.w3c.dom.traversal.NodeFilter; -import org.w3c.dom.traversal.NodeIterator; -import org.xml.sax.InputSource; - -import com.google.gson.JsonObject; - -/** - * Management Bus-Plug-in for invoking a service over HTTP.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * The Plug-in gets needed information (like endpoint of the service or operation to invoke) from - * the Management Bus and creates a HTTP message out of it. The Plug-in supports the transfer of - * parameters via queryString (both in the URL and the body) and xml formatted in the body. - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * @author Christian Endres - christian.endres@iaas.informatik.uni-stuttgart.de - * - */ -public class ManagementBusInvocationPluginRest implements IManagementBusInvocationPluginService { - - - final private static Logger LOG = LoggerFactory.getLogger(ManagementBusInvocationPluginRest.class); - - // Supported types defined in messages.properties. - static final private String TYPES = Messages.RestSIEnginePlugin_types; - - // Default Values of specific content - final String PARAMS = "queryString"; - final String ENDPOINT = "no"; - final String CONTENTTYPE = "urlencoded"; - final String METHOD = "POST"; - - - @SuppressWarnings("unchecked") - @Override - public Exchange invoke(Exchange exchange) { - - final Message message = exchange.getIn(); - - final Object params = message.getBody(); - final String operationName = message.getHeader(MBHeader.OPERATIONNAME_STRING.toString(), String.class); - final String interfaceName = message.getHeader(MBHeader.INTERFACENAME_STRING.toString(), String.class); - final String endpoint = message.getHeader(MBHeader.ENDPOINT_URI.toString(), String.class); - final Document specificContenet = - message.getHeader(MBHeader.SPECIFICCONTENT_DOCUMENT.toString(), Document.class); - - LOG.debug("Invoke REST call at {}.", endpoint); - - HashMap paramsMap = null; - final Document paramsDoc = null; - final boolean isDoc = false; - - if (params instanceof HashMap) { - paramsMap = (HashMap) params; - LOG.debug("params are hashmap: {}", mapToQueryString(paramsMap)); - // for (String str : paramsMap.keySet()) { - // LOG.trace(" {}: {}", str, paramsMap.get(str)); - // } - } - - else { - LOG.error("Cannot map parameters to a map."); - return null; - } - - DataAssign dataAssign = null; - - if (specificContenet != null) { - - ManagementBusInvocationPluginRest.LOG.debug("Unmarshalling provided artifact specific content."); - dataAssign = unmarshall(specificContenet); - } - - Operation operation = null; - - if (dataAssign != null) { - - ManagementBusInvocationPluginRest.LOG.debug("Searching for correct operation."); - operation = getOperation(dataAssign, operationName, interfaceName); - - } - - final Map headers = new HashMap<>(); - headers.put(Exchange.HTTP_URI, endpoint); - headers.put(Exchange.HTTP_METHOD, this.METHOD); - headers.put(Exchange.CONTENT_TYPE, "application/json"); - - Object body = null; - - final ContentType contentTypeParam = ContentType.JSON; - - ManagementBusInvocationPluginRest.LOG.debug("ParamsParam set: params into payload."); - - // ...as xml - if (contentTypeParam != null && !contentTypeParam.value().equalsIgnoreCase(this.CONTENTTYPE)) { - - ManagementBusInvocationPluginRest.LOG.debug("ContenttypeParam set: params into payload as {}.", - contentTypeParam); - - body = mapToJSON(paramsMap); - } - // ...as urlencoded String - else { - - ManagementBusInvocationPluginRest.LOG.debug("Params into payload as urlencoded String."); - - if (paramsDoc != null || paramsMap != null) { - final String queryString = getQueryString(paramsDoc, paramsMap); - body = queryString; - } - - } - - final ProducerTemplate template = Activator.camelContext.createProducerTemplate(); - // the dummyhost uri is ignored, so this is ugly but intended - - // deployment of plan may be not finished at this point, thus, poll for - // successful invocation - String responseString = null; - final long maxWaitTime = 5000; - final long startMillis = System.currentTimeMillis(); - do { - - try { - responseString = template.requestBodyAndHeaders("http://dummyhost", body, headers, String.class); - } - catch (final Exception e) { - } - LOG.trace(responseString); - - if (null != responseString) { - break; - } else if (System.currentTimeMillis() - startMillis > maxWaitTime) { - final String str = "Wait time exceeded, stop waiting for response of operation."; - LOG.error(str + "\n" + responseString); - } else { - LOG.trace("Waiting for being able to invoke Camunda BPMN plan for at most " - + (maxWaitTime - System.currentTimeMillis() + startMillis) / 1000 + " seconds."); - } - - try { - Thread.sleep(1000); - } - catch (final InterruptedException e) { - e.printStackTrace(); - } - } while (null == responseString); - - LOG.info("Response of the REST call: " + responseString); - - exchange = createResponseExchange(exchange, responseString, operationName, isDoc); - - return exchange; - } - - private Object mapToJSON(final HashMap paramsMap) { - final JsonObject vars = new JsonObject(); - for (final String key : paramsMap.keySet()) { - final JsonObject details = new JsonObject(); - details.addProperty("value", paramsMap.get(key)); - details.addProperty("type", "String"); - vars.add(key, details); - } - final JsonObject variables = new JsonObject(); - variables.add("variables", vars); - LOG.debug("JSON request body: {}", variables.toString()); - return variables.toString(); - } - - /** - * Returns the created queryString. - * - * @param paramsDoc to create queryString from. - * @param paramsMap to create queryString from. - * @return created queryString - */ - private String getQueryString(final Document paramsDoc, HashMap paramsMap) { - - ManagementBusInvocationPluginRest.LOG.debug("Creating queryString..."); - - if (paramsDoc != null) { - - paramsMap = docToMap(paramsDoc); - - } - - final String queryString = mapToQueryString(paramsMap); - - ManagementBusInvocationPluginRest.LOG.debug("Created queryString: {}", queryString); - - return queryString; - } - - /** - * Generates the queryString from the given params HashMap. - * - * @param params to generate the queryString from. - * - * @return the queryString. - */ - private String mapToQueryString(final HashMap params) { - - ManagementBusInvocationPluginRest.LOG.debug("Transfering the map: {} into a queryString...", params); - - final StringBuilder query = new StringBuilder(); - - for (final Entry entry : params.entrySet()) { - - query.append(entry.getKey()).append("=").append(entry.getValue()).append("&"); - - } - - // remove last "&" - final int length = query.length(); - - if (length > 0) { - - query.deleteCharAt(length - 1); - } - - return query.toString(); - - } - - /** - * Transfers the given string (if it is valid xml) into Document. * - * - * @param string to generate Document from. - * @return Document or null if string wasn't valid xml. - */ - private Document stringToDoc(final String string) { - - final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder; - Document doc = null; - try { - builder = factory.newDocumentBuilder(); - doc = builder.parse(new InputSource(new StringReader(string))); - - } - catch (final Exception e) { - ManagementBusInvocationPluginRest.LOG.debug("Response isn't xml."); - return null; - } - return doc; - } - - /** - * Transfers the given string (if it is a valid queryString) into a HashMap. - * - * @param queryString to generate the map from. - * @return HashMap or null if string wasn't a valid queryString. - */ - private HashMap queryStringToMap(final String queryString) { - - ManagementBusInvocationPluginRest.LOG.debug("Transfering the queryString: {} into a HashMap...", queryString); - - final String[] params = queryString.split("&"); - final HashMap map = new HashMap<>(); - for (final String param : params) { - try { - - final String name = param.split("=")[0]; - final String value = param.split("=")[1]; - - if (name.matches("\\w+")) { - - map.put(name, value); - } - - } - catch (final IndexOutOfBoundsException e) { - ManagementBusInvocationPluginRest.LOG.debug("Response isn't queryString."); - return null; - } - } - - ManagementBusInvocationPluginRest.LOG.debug("Transfered HashMap: {}", map.toString()); - return map; - } - - /** - * Returns the http path that will be concatenated to the endpoint. - * - * @param operation - * @return http path. - */ - private String getHttpPath(final Operation operation) { - - final StringBuilder httpPath = new StringBuilder(); - final String intName = operation.getInterfaceName(); - final String opName = operation.getName(); - - if (intName != null) { - httpPath.append(intName); - } - - if (opName != null) { - - if (intName != null) { - httpPath.append("/").append(opName); - - } else { - httpPath.append(opName); - } - } - - return httpPath.toString(); - } - - /** - * Searches for the correct operation of the artifact specific content. - * - * @param dataAssign containing all operations. - * @param operationName that will be searched for. - * @param interfaceName that will be searched for. - * - * @return matching operation. - */ - private Operation getOperation(final DataAssign dataAssign, final String operationName, - final String interfaceName) { - - final List operations = dataAssign.getOperations().getOperation(); - - for (final Operation op : operations) { - - final String provOpName = op.getName(); - final String provIntName = op.getInterfaceName(); - - ManagementBusInvocationPluginRest.LOG.debug("Provided operation name: {}. Needed: {}", provOpName, - operationName); - ManagementBusInvocationPluginRest.LOG.debug("Provided interface name: {}. Needed: {}", provIntName, - interfaceName); - - if (op.getName() == null && op.getInterfaceName() == null) { - ManagementBusInvocationPluginRest.LOG.debug("Operation found. No operation name nor interfaceName is specified meaning this IA implements just one operation or the provided information count for all implemented operations."); - return op; - - } else if (op.getName() != null && op.getName().equalsIgnoreCase(operationName)) { - - if (op.getInterfaceName() == null || interfaceName == null) { - ManagementBusInvocationPluginRest.LOG.debug("Operation found. No interfaceName specified."); - return op; - - } else if (op.getInterfaceName().equalsIgnoreCase(interfaceName)) { - ManagementBusInvocationPluginRest.LOG.debug("Operation found. Interface name matches too."); - return op; - - } - - } else if (op.getInterfaceName() != null && op.getName() == null - && op.getInterfaceName().equalsIgnoreCase(interfaceName)) { - ManagementBusInvocationPluginRest.LOG.debug("Operation found. Provided information count for all operations of the specified interface."); - return op; - } - } - return null; - } - - /** - * Transfers the document to a map. - * - * @param doc to be transfered to a map. - * @return transfered map. - */ - private HashMap docToMap(final Document doc) { - final HashMap map = new HashMap<>(); - - final DocumentTraversal traversal = (DocumentTraversal) doc; - final NodeIterator iterator = - traversal.createNodeIterator(doc.getDocumentElement(), NodeFilter.SHOW_ELEMENT, null, true); - - for (Node node = iterator.nextNode(); node != null; node = iterator.nextNode()) { - - final String name = ((Element) node).getTagName(); - final StringBuilder content = new StringBuilder(); - final NodeList children = node.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - final Node child = children.item(i); - if (child.getNodeType() == Node.TEXT_NODE) { - content.append(child.getTextContent()); - } - } - - if (!content.toString().trim().isEmpty()) { - map.put(name, content.toString()); - } - } - - return map; - } - - /** - * Transfers the paramsMap into a Document. - * - * @param operationName as root element. - * @param paramsMap - * - * @return the created Document. - */ - private Document mapToDoc(final String operationName, final HashMap paramsMap) { - - Document document; - - final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = null; - try { - documentBuilder = documentBuilderFactory.newDocumentBuilder(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - - document = documentBuilder.newDocument(); - - final Element rootElement = document.createElement(operationName); - document.appendChild(rootElement); - - Element mapElement; - for (final Entry entry : paramsMap.entrySet()) { - mapElement = document.createElement(entry.getKey()); - mapElement.setTextContent(entry.getValue()); - rootElement.appendChild(mapElement); - - } - - return document; - } - - /** - * Alters the exchange with the response of the invoked service depending of the type of the - * body. - * - * @param exchange to be altered. - * @param responseString containing the response of the invoked service. - * @param operationName - * @param isDoc - * @return exchange with response of the invokes service as body. - * - * @TODO: Response handling is a bit hacky. Should be updated sometime to determine the response - * type with content-type header. - */ - private Exchange createResponseExchange(final Exchange exchange, final String responseString, - final String operationName, final boolean isDoc) { - - ManagementBusInvocationPluginRest.LOG.debug("Handling the response: {}.", responseString); - - Document responseDoc = stringToDoc(responseString); - HashMap responseMap; - - // response was xml - if (responseDoc != null) { - - ManagementBusInvocationPluginRest.LOG.debug("Reponse is xml formatted."); - - if (isDoc) { - - ManagementBusInvocationPluginRest.LOG.debug("Returning response xml formatted.."); - exchange.getIn().setBody(responseDoc); - - } else { - - ManagementBusInvocationPluginRest.LOG.debug("Transfering xml response into a Hashmap..."); - responseMap = docToMap(responseDoc); - ManagementBusInvocationPluginRest.LOG.debug("Returning response as HashMap."); - exchange.getIn().setBody(responseMap); - } - } - // response should be queryString - else { - - responseMap = queryStringToMap(responseString); - - if (responseMap == null || responseMap.isEmpty()) { - ManagementBusInvocationPluginRest.LOG.debug("Response isn't neihter xml nor queryString. Returning the reponse: {} as string.", - responseString); - exchange.getIn().setBody(responseString); - } - - else if (isDoc) { - - ManagementBusInvocationPluginRest.LOG.debug("Transfering response into xml..."); - responseDoc = mapToDoc(operationName, responseMap); - - exchange.getIn().setBody(responseDoc); - - } else { - ManagementBusInvocationPluginRest.LOG.debug("Returning response as HashMap."); - exchange.getIn().setBody(responseMap); - } - } - - return exchange; - } - - /** - * Unmarshalls the provided artifact specific content. - * - * @param doc to unmarshall. - * - * @return DataAssign object. - */ - private DataAssign unmarshall(final Document doc) { - - final NodeList nodeList = - doc.getElementsByTagNameNS("http://www.siengine.restplugin.org/SpecificContentRestSchema", "DataAssign"); - - final Node node = nodeList.item(0); - - JAXBContext jc; - - try { - - jc = JAXBContext.newInstance("org.opentosca.bus.management.plugins.rest.service.impl.model"); - final Unmarshaller unmarshaller = jc.createUnmarshaller(); - final DataAssign dataAssign = (DataAssign) unmarshaller.unmarshal(node); - - ManagementBusInvocationPluginRest.LOG.debug("Artifact specific content successfully marshalled."); - - return dataAssign; - - } - catch (final JAXBException e) { - ManagementBusInvocationPluginRest.LOG.warn("Couldn't unmarshall provided artifact specific content!"); - e.printStackTrace(); - } - - ManagementBusInvocationPluginRest.LOG.debug("No unmarshallable artifact specific content provided. Using default values now."); - - return null; - } - - @Override - public List getSupportedTypes() { - ManagementBusInvocationPluginRest.LOG.debug("Getting Types: {}.", ManagementBusInvocationPluginRest.TYPES); - final List types = new ArrayList<>(); - - for (final String type : ManagementBusInvocationPluginRest.TYPES.split("[,;]")) { - types.add(type.trim()); - } - return types; - } - -} diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ObjectFactory.java b/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ObjectFactory.java deleted file mode 100644 index 5f834903a..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ObjectFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.29 at 03:39:23 PM MESZ -// - - -package org.opentosca.bus.management.invocation.plugin.rest.model; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.opentosca.bus.management.invocation.plugin.rest.model package. - *

- * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes - * for package: org.opentosca.bus.management.plugins.rest.service.impl.model - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link DataAssign } - * - */ - public DataAssign createDataAssign() { - return new DataAssign(); - } - - /** - * Create an instance of {@link DataAssign.Operations.Operation } - * - */ - public DataAssign.Operations.Operation createDataAssignOperationsOperation() { - return new DataAssign.Operations.Operation(); - } - - /** - * Create an instance of {@link DataAssign.Operations } - * - */ - public DataAssign.Operations createDataAssignOperations() { - return new DataAssign.Operations(); - } - -} diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/package-info.java b/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/package-info.java deleted file mode 100644 index 5bdea8580..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.29 at 03:39:23 PM MESZ -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.siengine.restplugin.org/SpecificContentRestSchema", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.opentosca.bus.management.invocation.plugin.rest.model; diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/util/Messages.java b/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/util/Messages.java deleted file mode 100644 index 15c24d9b4..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/util/Messages.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.rest.util; - -import org.eclipse.osgi.util.NLS; - -/** - * Utility class to define Strings in messages.properties.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - * - */ -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.opentosca.bus.management.invocation.plugin.rest.util.messages"; //$NON-NLS-1$ - public static String RestSIEnginePlugin_types; - static { - // initialize resource bundle - NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class); - } - - - private Messages() {} -} diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/util/messages.properties b/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/util/messages.properties deleted file mode 100644 index 62600da27..000000000 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/util/messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Contains the supported types of the plugin as comma separated list. -RestSIEnginePlugin_types=REST diff --git a/org.opentosca.bus.management.invocation.plugin.script/META-INF/MANIFEST.MF b/org.opentosca.bus.management.invocation.plugin.script/META-INF/MANIFEST.MF deleted file mode 100644 index 676601177..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.invocation.plugin.script -Bundle-SymbolicName: org.opentosca.bus.management.invocation.plugin.script -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Import-Package: - org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.http;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.eclipse.osgi.util;version="1.1.0", - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Service-Component: OSGI-INF/* -Bundle-Activator: org.opentosca.bus.management.invocation.plugin.script.Activator -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0", - org.opentosca.bus.management.invocation.plugin;bundle-version="1.0.0", - org.apache.commons.lang3 -Export-Package: org.opentosca.bus.management.invocation.plugin.script diff --git a/org.opentosca.bus.management.invocation.plugin.script/OSGI-INF/ManagementBusInvocationPluginScript - component.xml b/org.opentosca.bus.management.invocation.plugin.script/OSGI-INF/ManagementBusInvocationPluginScript - component.xml deleted file mode 100644 index 6bd7dbd16..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/OSGI-INF/ManagementBusInvocationPluginScript - component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.management.invocation.plugin.script/OSGI-INF/ServiceHandler - component.xml b/org.opentosca.bus.management.invocation.plugin.script/OSGI-INF/ServiceHandler - component.xml deleted file mode 100644 index 807cb822b..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/OSGI-INF/ServiceHandler - component.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/org.opentosca.bus.management.invocation.plugin.script/build.properties b/org.opentosca.bus.management.invocation.plugin.script/build.properties deleted file mode 100644 index 98d41e652..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/, diff --git a/org.opentosca.bus.management.invocation.plugin.script/pom.xml b/org.opentosca.bus.management.invocation.plugin.script/pom.xml deleted file mode 100644 index d31c455aa..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.invocation.plugin.script - eclipse-plugin - - diff --git a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/Activator.java b/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/Activator.java deleted file mode 100644 index bec0ae3bd..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/Activator.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.script; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.management.invocation.plugin.script.typeshandler.ArtifactTypesHandler; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the Script-Invocation-Management-Bus-Plug-in.
- *
- * - * - * The activator is needed to start the camel context. - * - * - * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - public static DefaultCamelContext camelContext; - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - public static String bundleID; - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - - Activator.bundleID = bundleContext.getBundle().getSymbolicName(); - Activator.camelContext = new OsgiDefaultCamelContext(bundleContext); - Activator.camelContext.start(); - - ArtifactTypesHandler.init(bundleContext); - - Activator.LOG.info("Script-IA-Management Bus-PLUGIN-STARTED"); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.camelContext = null; - Activator.LOG.info("Script-IA-Management Bus-PLUGIN-STOPPED"); - } - -} diff --git a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/ManagementBusInvocationPluginScript.java b/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/ManagementBusInvocationPluginScript.java deleted file mode 100644 index 98bd345bf..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/ManagementBusInvocationPluginScript.java +++ /dev/null @@ -1,764 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.script; - -import java.net.URI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import javax.xml.namespace.QName; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.ProducerTemplate; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.StringUtils; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; -import org.opentosca.bus.management.invocation.plugin.script.servicehandler.ServiceHandler; -import org.opentosca.bus.management.invocation.plugin.script.typeshandler.ArtifactTypesHandler; -import org.opentosca.bus.management.utils.MBUtils; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.engine.ResolvedArtifacts; -import org.opentosca.container.core.engine.ResolvedArtifacts.ResolvedDeploymentArtifact; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.container.core.tosca.convention.Types; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Management Bus-Plug-in for Script IAs which have to be executed on a host machine.
- *
- * - * - * - * The Plugin gets needed information from the Management Bus and is responsible for the uploading - * of the files and the installation of required packages on the target machine (if specified). - * - * - * - * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * - * - */ -public class ManagementBusInvocationPluginScript implements IManagementBusInvocationPluginService { - - final private static String PLACEHOLDER_TARGET_FILE_PATH = "{TARGET_FILE_PATH}"; - final private static String PLACEHOLDER_TARGET_FILE_FOLDER_PATH = "{TARGET_FILE_FOLDER_PATH}"; - final private static String PLACEHOLDER_TARGET_FILE_NAME_WITH_EXTENSION = "{TARGET_FILE_NAME_WITH_E}"; - final private static String PLACEHOLDER_TARGET_FILE_NAME_WITHOUT_EXTENSION = "{TARGET_FILE_NAME_WITHOUT_E}"; - final private static String PLACEHOLDER_DA_NAME_PATH_MAP = "{DA_NAME_PATH_MAP}"; - final private static String PLACEHOLDER_DA_INPUT_PARAMETER = "{INPUT_PARAMETER}"; - - final private static String RUN_SCRIPT_OUTPUT_PARAMETER_NAME = "ScriptResult"; - - final private static Logger LOG = LoggerFactory.getLogger(ManagementBusInvocationPluginScript.class); - - - @Override - public Exchange invoke(final Exchange exchange) { - - final Message message = exchange.getIn(); - - ManagementBusInvocationPluginScript.LOG.debug("Management Bus Script Plugin getting information..."); - - final CSARID csarID = message.getHeader(MBHeader.CSARID.toString(), CSARID.class); - ManagementBusInvocationPluginScript.LOG.debug("CsarID: {}", csarID); - final QName artifactTemplateID = message.getHeader(MBHeader.ARTIFACTTEMPLATEID_QNAME.toString(), QName.class); - ManagementBusInvocationPluginScript.LOG.debug("ArtifactTemplateID: {}", artifactTemplateID); - String nodeTemplateID = message.getHeader(MBHeader.NODETEMPLATEID_STRING.toString(), String.class); - ManagementBusInvocationPluginScript.LOG.debug("NodeTemplateID: {}", nodeTemplateID); - final String relationshipTemplateID = - message.getHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), String.class); - ManagementBusInvocationPluginScript.LOG.debug("RelationshipTemplateID: {}", relationshipTemplateID); - final QName serviceTemplateID = message.getHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), QName.class); - ManagementBusInvocationPluginScript.LOG.debug("ServiceTemplateID: {}", serviceTemplateID); - final String interfaceName = message.getHeader(MBHeader.INTERFACENAME_STRING.toString(), String.class); - ManagementBusInvocationPluginScript.LOG.debug("InterfaceName: {}", interfaceName); - final String operationName = message.getHeader(MBHeader.OPERATIONNAME_STRING.toString(), String.class); - ManagementBusInvocationPluginScript.LOG.debug("OperationName: {}", operationName); - final URI serviceInstanceID = message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), URI.class); - ManagementBusInvocationPluginScript.LOG.debug("ServiceInstanceID: {}", serviceInstanceID); - final String nodeInstanceID = message.getHeader(MBHeader.NODEINSTANCEID_STRING.toString(), String.class); - ManagementBusInvocationPluginScript.LOG.debug("NodeInstanceID: {}", nodeInstanceID); - - CSARID tempCsarID = null; - String tempNodeTemplateID = null; - QName tempServiceTemplateID = null; - - if (nodeTemplateID == null && relationshipTemplateID != null) { - - final QName relationshipTypeID = - ServiceHandler.toscaEngineService.getRelationshipTypeOfRelationshipTemplate(csarID, serviceTemplateID, - relationshipTemplateID); - - final boolean isBoundToSourceNode = - ServiceHandler.toscaEngineService.isOperationOfRelationshipBoundToSourceNode(csarID, relationshipTypeID, - interfaceName, - operationName); - - if (isBoundToSourceNode) { - nodeTemplateID = - ServiceHandler.toscaEngineService.getSourceNodeTemplateIDOfRelationshipTemplate(csarID, - serviceTemplateID, - relationshipTemplateID); - } else { - nodeTemplateID = - ServiceHandler.toscaEngineService.getTargetNodeTemplateIDOfRelationshipTemplate(csarID, - serviceTemplateID, - relationshipTemplateID); - } - } - - final QName nodeTypeID = - ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(csarID, serviceTemplateID, nodeTemplateID); - - ManagementBusInvocationPluginScript.LOG.debug("NodeType: {}", nodeTypeID); - - // Determine output parameters of the current operation - final List outputParameters = new LinkedList<>(); - final boolean hasOutputParams = - ServiceHandler.toscaEngineService.hasOperationOfATypeSpecifiedOutputParams(csarID, nodeTypeID, - interfaceName, operationName); - if (hasOutputParams) { - final Node outputParametersNode = - ServiceHandler.toscaEngineService.getOutputParametersOfATypeOperation(csarID, nodeTypeID, interfaceName, - operationName); - if (outputParametersNode != null) { - final NodeList children = outputParametersNode.getChildNodes(); - - for (int i = 0; i < children.getLength(); i++) { - final Node child = children.item(i); - - if (child.getNodeType() == Node.ELEMENT_NODE) { - final String name = ((Element) child).getAttribute("name"); - outputParameters.add(name); - } - } - } - } - for (final String param : outputParameters) { - ManagementBusInvocationPluginScript.LOG.debug("Output parameter: {}", param); - } - - final QName artifactType = - ServiceHandler.toscaEngineService.getArtifactTypeOfArtifactTemplate(csarID, artifactTemplateID); - - ManagementBusInvocationPluginScript.LOG.debug("ArtifactType of ArtifactTemplate {} : {}", artifactTemplateID, - artifactType); - - if (artifactType != null && nodeTemplateID != null) { - - // search operating system IA to upload files and run scripts on - // target machine - final Long serviceTemplateInstanceID = - Long.parseLong(StringUtils.substringAfterLast(serviceInstanceID.toString(), "/")); - final String osNodeTemplateID = - MBUtils.getOperatingSystemNodeTemplateID(csarID, serviceTemplateID, nodeTemplateID, true, - serviceTemplateInstanceID); - if (osNodeTemplateID != null) { - QName osNodeTypeID = - ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(csarID, serviceTemplateID, - osNodeTemplateID); - - if (osNodeTypeID.equals(Types.abstractOperatingSystemNodeType)) { - final NodeTemplateInstance abstractOSInstance = - MBUtils.getNodeTemplateInstance(serviceTemplateInstanceID, osNodeTemplateID); - final NodeTemplateInstance nodeTemplateInstance = - MBUtils.getAbstractOSReplacementInstance(abstractOSInstance); - if (nodeTemplateInstance != null) { - osNodeTypeID = - ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(nodeTemplateInstance.getServiceTemplateInstance() - .getCsarId(), - nodeTemplateInstance.getServiceTemplateInstance() - .getTemplateId(), - nodeTemplateInstance.getTemplateId() - .getLocalPart()); - tempNodeTemplateID = nodeTemplateInstance.getTemplateId().getLocalPart(); - tempCsarID = nodeTemplateInstance.getServiceTemplateInstance().getCsarId(); - tempServiceTemplateID = nodeTemplateInstance.getServiceTemplateInstance().getTemplateId(); - - } - } - if (osNodeTypeID != null) { - String osIAName = null; - ManagementBusInvocationPluginScript.LOG.debug("OperatingSystem-NodeType found: {}", osNodeTypeID); - final boolean abstractOSExists = - Stream.of(tempNodeTemplateID, tempCsarID, tempServiceTemplateID).allMatch(x -> x != null); - if (abstractOSExists) { - osIAName = MBUtils.getOperatingSystemIA(tempCsarID, tempServiceTemplateID, tempNodeTemplateID); - } else { - osIAName = MBUtils.getOperatingSystemIA(csarID, serviceTemplateID, osNodeTemplateID); - } - if (osIAName != null) { - - final Object params = message.getBody(); - - // create headers - final HashMap headers = new HashMap<>(); - - headers.put(MBHeader.CSARID.toString(), csarID); - headers.put(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); - headers.put(MBHeader.NODETEMPLATEID_STRING.toString(), osNodeTemplateID); - if (abstractOSExists) { - headers.put(MBHeader.INTERFACENAME_STRING.toString(), - MBUtils.getInterfaceForOperatingSystemNodeType(tempCsarID, osNodeTypeID)); - } else { - headers.put(MBHeader.INTERFACENAME_STRING.toString(), - MBUtils.getInterfaceForOperatingSystemNodeType(csarID, osNodeTypeID)); - } - headers.put(MBHeader.SERVICEINSTANCEID_URI.toString(), serviceInstanceID); - headers.put(MBHeader.NODEINSTANCEID_STRING.toString(), nodeInstanceID); - - // install packages - ManagementBusInvocationPluginScript.LOG.debug("Installing packages..."); - - installPackages(artifactType, headers); - - ManagementBusInvocationPluginScript.LOG.debug("Packages installed."); - - // get list of artifacts - final List artifactReferences = - ServiceHandler.toscaEngineService.getArtifactReferenceWithinArtifactTemplate(csarID, - artifactTemplateID); - - ManagementBusInvocationPluginScript.LOG.debug("{} contains {} artifacts. Uploading and executing them...", - artifactTemplateID, artifactReferences.size()); - - // Map which contains the output parameters - final Map resultMap = new HashMap<>(); - - final String targetBasePath = "~/" + csarID.getFileName(); - - // upload and execute all contained artifacts - for (final String artifactRef : artifactReferences) { - - final String fileSource = - Settings.CONTAINER_API + "/csars/" + csarID.getFileName() + "/content/" + artifactRef; - - final String targetFilePath = targetBasePath + "/" + artifactRef; - - final String targetFileFolderPath = FilenameUtils.getFullPathNoEndSeparator(targetFilePath); - - final String createDirCommand = "sleep 1 && mkdir -p " + targetFileFolderPath; - - ManagementBusInvocationPluginScript.LOG.debug("Uploading file: {}", fileSource); - - // create directory before uploading file - runScript(createDirCommand, headers); - - // upload file - transferFile(csarID, artifactTemplateID, fileSource, targetFilePath, headers); - - ManagementBusInvocationPluginScript.LOG.debug("File successfully uploaded."); - - // run script - ManagementBusInvocationPluginScript.LOG.debug("Running script..."); - - final String fileNameWithE = FilenameUtils.getName(targetFilePath); - final String fileNameWithoutE = FilenameUtils.getBaseName(targetFilePath); - - String artifactTypeSpecificCommand = - createArtifcatTypeSpecificCommandString(csarID, artifactType, artifactTemplateID, - params); - - ManagementBusInvocationPluginScript.LOG.debug("Replacing further generic placeholder..."); - - // replace placeholders - artifactTypeSpecificCommand = - artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_TARGET_FILE_PATH, - targetFilePath); - artifactTypeSpecificCommand = - artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_TARGET_FILE_FOLDER_PATH, - targetFileFolderPath); - artifactTypeSpecificCommand = - artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_TARGET_FILE_NAME_WITH_EXTENSION, - fileNameWithE); - artifactTypeSpecificCommand = - artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_TARGET_FILE_NAME_WITHOUT_EXTENSION, - fileNameWithoutE); - artifactTypeSpecificCommand = - artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_DA_NAME_PATH_MAP, - createDANamePathMapEnvVar(csarID, serviceTemplateID, - nodeTypeID, - nodeTemplateID) - + " CSAR='" + csarID + "' NodeInstanceID='" - + nodeInstanceID + "' ServiceInstanceID='" - + serviceInstanceID + "' "); - artifactTypeSpecificCommand = - artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_DA_INPUT_PARAMETER, - createParamsString(params)); - - if (!Boolean.valueOf(Settings.OPENTOSCA_ENGINE_IA_KEEPFILES)) { - // delete the uploaded file on the remote site to save resources - final String deleteFileCommand = "; rm -f " + targetFilePath; - artifactTypeSpecificCommand = artifactTypeSpecificCommand + deleteFileCommand; - } - - ManagementBusInvocationPluginScript.LOG.debug("Final command for the script execution: {}", - artifactTypeSpecificCommand); - - final Object result = runScript(artifactTypeSpecificCommand, headers); - - ManagementBusInvocationPluginScript.LOG.debug("Script execution result: {}", result); - - // check for output parameters in the script result and add them to the - // operation result - addOutputParametersToResultMap(resultMap, result, outputParameters); - } - - if (!Boolean.valueOf(Settings.OPENTOSCA_ENGINE_IA_KEEPFILES)) { - // remove the created directories - ManagementBusInvocationPluginScript.LOG.debug("Deleting directories..."); - final String deleteDirsCommand = "find " + targetBasePath + " -empty -type d -delete"; - runScript(deleteDirsCommand, headers); - } - - - ManagementBusInvocationPluginScript.LOG.debug("All artifacts are executed. Returning result to the Management Bus..."); - - // create dummy response in case there are no output parameters - if (resultMap.isEmpty()) { - resultMap.put("invocation", "finished"); - } - - exchange.getIn().setBody(resultMap); - } else { - ManagementBusInvocationPluginScript.LOG.warn("No OperatingSystem-IA found!"); - } - } else { - ManagementBusInvocationPluginScript.LOG.warn("No OperatingSystem-NodeType found!"); - } - } else { - ManagementBusInvocationPluginScript.LOG.warn("No OperatingSystem-NodeTemplate found!"); - } - } else { - ManagementBusInvocationPluginScript.LOG.warn("Could not determine ArtifactType of ArtifactTemplate: {}!", - artifactTemplateID); - } - return exchange; - } - - /** - * Check if the output parameters for this script service operation are returned in the script - * result and add them to the result map. - * - * @param resultMap The result map which is returned for the invocation of the script service - * operation - * @param result The returned result of the run script operation - * @param outputParameters The output parameters that are expected for the operation - */ - private void addOutputParametersToResultMap(final Map resultMap, final Object result, - final List outputParameters) { - - ManagementBusInvocationPluginScript.LOG.debug("Adding output parameters to the response message."); - - if (!outputParameters.isEmpty()) { - // process result as HashMap - if (result instanceof HashMap) { - final HashMap resultHashMap = (HashMap) result; - - // get ScriptResult part of the response which contains the parameters - if (resultHashMap.containsKey(ManagementBusInvocationPluginScript.RUN_SCRIPT_OUTPUT_PARAMETER_NAME)) { - final Object scriptResult = - resultHashMap.get(ManagementBusInvocationPluginScript.RUN_SCRIPT_OUTPUT_PARAMETER_NAME); - - if (scriptResult != null) { - final String scriptResultString = scriptResult.toString(); - - ManagementBusInvocationPluginScript.LOG.debug("{}: {}", - ManagementBusInvocationPluginScript.RUN_SCRIPT_OUTPUT_PARAMETER_NAME, - scriptResultString); - - // split result on line breaks as every parameter is returned in a separate - // "echo" command - final String[] resultParameters = scriptResultString.split("[\\r\\n]+"); - - // add each parameter that is defined in the operation and passed back - for (final String outputParameter : outputParameters) { - for (int i = resultParameters.length - 1; i >= 0; i--) { - if (resultParameters[i].startsWith(outputParameter)) { - final String value = - resultParameters[i].substring(resultParameters[i].indexOf("=") + 1); - - ManagementBusInvocationPluginScript.LOG.debug("Adding parameter {} with value: {}", - outputParameter, value); - resultMap.put(outputParameter, value); - } - } - } - } - - } else { - ManagementBusInvocationPluginScript.LOG.warn("Result contains no result entry '{}'", - ManagementBusInvocationPluginScript.RUN_SCRIPT_OUTPUT_PARAMETER_NAME); - } - - } else { - ManagementBusInvocationPluginScript.LOG.warn("Result of type {} not supported. The bus should return a HashMap as result class when it is used as input.", - result.getClass()); - } - } - } - - /** - * @param csarID - * @param serviceTemplateID - * @param nodeTypeID - * @param nodeTemplateID - * - * @return mapping with DeploymentArtifact names and their paths. - */ - private String createDANamePathMapEnvVar(final CSARID csarID, final QName serviceTemplateID, final QName nodeTypeID, - final String nodeTemplateID) { - - ManagementBusInvocationPluginScript.LOG.debug("Checking if NodeTemplate {} has DAs...", nodeTemplateID); - - final HashMap> daNameReferenceMapping = new HashMap<>(); - - final QName nodeTemplateQName = new QName(serviceTemplateID.getNamespaceURI(), nodeTemplateID); - - final ResolvedArtifacts resolvedArtifacts = - ServiceHandler.toscaEngineService.getResolvedArtifactsOfNodeTemplate(csarID, nodeTemplateQName); - - final List resolvedDAs = resolvedArtifacts.getDeploymentArtifacts(); - - List daArtifactReferences; - - for (final ResolvedDeploymentArtifact resolvedDA : resolvedDAs) { - - daArtifactReferences = resolvedDA.getReferences(); - - for (final String daArtifactReference : daArtifactReferences) { - - ManagementBusInvocationPluginScript.LOG.debug("Artifact reference for DA: {} found: {} .", - resolvedDA.getName(), daArtifactReference); - - List currentValue = daNameReferenceMapping.get(resolvedDA.getName()); - if (currentValue == null) { - currentValue = new ArrayList<>(); - daNameReferenceMapping.put(resolvedDA.getName(), currentValue); - } - currentValue.add(daArtifactReference); - } - } - - final List nodeTypeImpls = - ServiceHandler.toscaEngineService.getTypeImplementationsOfType(csarID, nodeTypeID); - - for (final QName nodeTypeImpl : nodeTypeImpls) { - final List daNames = - ServiceHandler.toscaEngineService.getDeploymentArtifactNamesOfNodeTypeImplementation(csarID, - nodeTypeImpl); - - for (final String daName : daNames) { - final QName daArtifactTemplate = - ServiceHandler.toscaEngineService.getArtifactTemplateOfADeploymentArtifactOfANodeTypeImplementation(csarID, - nodeTypeImpl, - daName); - - daArtifactReferences = - ServiceHandler.toscaEngineService.getArtifactReferenceWithinArtifactTemplate(csarID, - daArtifactTemplate); - - for (final String daArtifactReference : daArtifactReferences) { - - ManagementBusInvocationPluginScript.LOG.debug("Artifact reference for DA: {} found: {} .", daName, - daArtifactReference); - - List currentValue = daNameReferenceMapping.get(daName); - if (currentValue == null) { - currentValue = new ArrayList<>(); - daNameReferenceMapping.put(daName, currentValue); - } - currentValue.add(daArtifactReference); - } - } - } - - String daEnvMap = ""; - if (!daNameReferenceMapping.isEmpty()) { - - ManagementBusInvocationPluginScript.LOG.debug("NodeTemplate {} has {} DAs.", nodeTemplateID, - daNameReferenceMapping.size()); - - daEnvMap += "DAs=\""; - for (final Entry> da : daNameReferenceMapping.entrySet()) { - - final String daName = da.getKey(); - final List daRefs = da.getValue(); - - for (String daRef : daRefs) { - - // FIXME / is a brutal assumption - if (!daRef.startsWith("/")) { - daRef = "/" + daRef; - } - - daEnvMap += daName + "," + daRef + ";"; - } - } - daEnvMap += "\" "; - - ManagementBusInvocationPluginScript.LOG.debug("Created DA-DANamePathMapEnvVar for NodeTemplate {} : {}", - nodeTemplateID, daEnvMap); - } - - return daEnvMap; - } - - /** - * - * Installs required and specified packages of the specified ArtifactType. Required packages are in - * defined the corresponding *.xml file. - * - * @param artifactType - * @param headers - */ - private void installPackages(final QName artifactType, final HashMap headers) { - - final List requiredPackages = ArtifactTypesHandler.getRequiredPackages(artifactType); - - String requiredPackagesString = ""; - - if (!requiredPackages.isEmpty()) { - - final HashMap inputParamsMap = new HashMap<>(); - - for (final String requiredPackage : requiredPackages) { - requiredPackagesString += requiredPackage; - requiredPackagesString += " "; - } - inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_PACKAGENAMES, - requiredPackagesString); - - ManagementBusInvocationPluginScript.LOG.debug("Installing packages: {} for ArtifactType: {} ", - requiredPackages, artifactType); - - headers.put(MBHeader.OPERATIONNAME_STRING.toString(), - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_INSTALLPACKAGE); - - invokeManagementBusEngine(inputParamsMap, headers); - } else { - ManagementBusInvocationPluginScript.LOG.debug("ArtifactType: {} needs no packages to install.", - requiredPackages, artifactType); - } - } - - /** - * - * For transferring files to the target machine. - * - * @param csarID - * @param artifactTemplate - * @param source - * @param target - * @param headers - */ - private void transferFile(final CSARID csarID, final QName artifactTemplate, final String source, - final String target, final HashMap headers) { - - final HashMap inputParamsMap = new HashMap<>(); - - inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_TARGETABSOLUTPATH, - target); - inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_SOURCEURLORLOCALPATH, - source); - - ManagementBusInvocationPluginScript.LOG.debug("Uploading file. Source: {} Target: {} ", source, target); - - headers.put(MBHeader.OPERATIONNAME_STRING.toString(), - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE); - - ManagementBusInvocationPluginScript.LOG.debug("Invoking ManagementBus for transferFile with the following headers:"); - - for (final String key : headers.keySet()) { - if (headers.get(key) != null && headers.get(key) instanceof String) { - ManagementBusInvocationPluginScript.LOG.debug("Header: " + key + " Value: " + headers.get(key)); - } - } - - invokeManagementBusEngine(inputParamsMap, headers); - - } - - /** - * - * For running scripts on the target machine. Commands to be executed are defined in the - * corresponding *.xml file. - * - * @param commandsString - * @param headers - */ - private Object runScript(final String commandsString, final HashMap headers) { - - final HashMap inputParamsMap = new HashMap<>(); - - inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_SCRIPT, commandsString); - - ManagementBusInvocationPluginScript.LOG.debug("RunScript: {} ", commandsString); - - headers.put(MBHeader.OPERATIONNAME_STRING.toString(), - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT); - - ManagementBusInvocationPluginScript.LOG.debug("Invoking ManagementBus for runScript with the following headers:"); - - for (final String key : headers.keySet()) { - if (headers.get(key) != null && headers.get(key) instanceof String) { - ManagementBusInvocationPluginScript.LOG.debug("Header: " + key + " Value: " + headers.get(key)); - } - } - - return invokeManagementBusEngine(inputParamsMap, headers); - } - - /** - * - * Creates ArtifactType specific commands that should be executed on the target machine. Commands to - * be executed are defined in the corresponding *.xml file. - * - * @param csarID - * @param artifactType - * @param artifactTemplateID - * @param params - * - * @return the created command - */ - @SuppressWarnings("unchecked") - private String createArtifcatTypeSpecificCommandString(final CSARID csarID, final QName artifactType, - final QName artifactTemplateID, final Object params) { - - ManagementBusInvocationPluginScript.LOG.debug("Creating ArtifcatType specific command for artifactType {}:...", - artifactType); - - String commandsString = ""; - - final List commands = ArtifactTypesHandler.getCommands(artifactType); - - for (final String command : commands) { - commandsString += command; - commandsString += " && "; - } - - if (commandsString.endsWith(" && ")) { - commandsString = commandsString.substring(0, commandsString.length() - 4); - } - - ManagementBusInvocationPluginScript.LOG.debug("Defined generic command for ArtifactType {} : {} ", artifactType, - commandsString); - - // replace placeholder with data from inputParams and/or instance data - - if (commandsString.contains("{{") && commandsString.contains("}}")) { - - ManagementBusInvocationPluginScript.LOG.debug("Replacing the placeholder of the generic command with properties data and/or provided input parameter..."); - - HashMap paramsMap = new HashMap<>(); - - if (params instanceof HashMap) { - paramsMap = (HashMap) params; - } else if (params instanceof Document) { - final Document paramsDoc = (Document) params; - paramsMap = MBUtils.docToMap(paramsDoc, true); - } - - final Document propDoc = - ServiceHandler.toscaEngineService.getPropertiesOfAArtifactTemplate(csarID, artifactTemplateID); - - if (propDoc != null) { - paramsMap.putAll(MBUtils.docToMap(propDoc, true)); - } - - for (final Entry prop : paramsMap.entrySet()) { - commandsString = commandsString.replace("{{" + prop.getKey() + "}}", prop.getValue()); - } - - // delete not replaced placeholder - commandsString = commandsString.replaceAll("\\{\\{.*?\\}\\}", ""); - - ManagementBusInvocationPluginScript.LOG.debug("Generic command with replaced placeholder: {}", - commandsString); - } - - return commandsString; - } - - /** - * @param params - * @return whitespace separated String with parameter keys and values - */ - @SuppressWarnings("unchecked") - private String createParamsString(final Object params) { - HashMap paramsMap = new HashMap<>(); - - if (params instanceof HashMap) { - paramsMap = (HashMap) params; - } else if (params instanceof Document) { - final Document paramsDoc = (Document) params; - paramsMap = MBUtils.docToMap(paramsDoc, true); - } - - String paramsString = ""; - for (final Entry param : paramsMap.entrySet()) { - // info: - // https://stackoverflow.com/questions/3005963/how-can-i-have-a-newline-in-a-string-in-sh - // https://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings - // we have to escape single quotes in the parameter values and properly pipe newlines - // TODO(?) There is still the issue if you use commands in scipt which don't interpret - // backslashes - paramsString += param.getKey() + "=$'" + escapeSpecialCharacters(param.getValue()) + "' "; - } - - return paramsString; - } - - /** - * Escapes special charactes inside the given string conforming to bash argument values. - * - * @see e.g. - * https://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings - * - * @return a String with escaped singles quotes - */ - private String escapeSpecialCharacters(final String unenscapedString) { - return unenscapedString.replace("'", "'\"'\"'").replace("\n", "'\"\\n\"'").replace("\t", "'\"\\t\"'") - .replace(" ", "'\" \"'"); - } - - /** - * Invokes the Management Bus. - * - * @param paramsMap - * @param headers - */ - private Object invokeManagementBusEngine(final HashMap paramsMap, - final HashMap headers) { - - ManagementBusInvocationPluginScript.LOG.debug("Invoking the Management Bus..."); - - final ProducerTemplate template = Activator.camelContext.createProducerTemplate(); - - final Object response = - template.requestBodyAndHeaders("bean:org.opentosca.bus.management.service.IManagementBusService?method=invokeIA", - paramsMap, headers); - - ManagementBusInvocationPluginScript.LOG.debug("Invocation finished: {}", response); - - return response; - } - - @Override - public List getSupportedTypes() { - return ArtifactTypesHandler.getSupportedTypes().stream().map(QName::toString).collect(Collectors.toList()); - } -} diff --git a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/ObjectFactory.java b/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/ObjectFactory.java deleted file mode 100644 index 5ee7aad5b..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/ObjectFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2016.07.12 at 02:53:01 PM CEST -// - - -package org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes - * package. - *

- * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes - * for package: org.opentosca.bus.management.plugins.remote.service.impl.artifacttypes - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link Artifacttype } - * - */ - public Artifacttype createArtifacttype() { - return new Artifacttype(); - } - - /** - * Create an instance of {@link Packagestype } - * - */ - public Packagestype createPackagestype() { - return new Packagestype(); - } - - /** - * Create an instance of {@link Commandstype } - * - */ - public Commandstype createCommandstype() { - return new Commandstype(); - } - -} diff --git a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/servicehandler/ServiceHandler.java b/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/servicehandler/ServiceHandler.java deleted file mode 100644 index 2ba713c4d..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/servicehandler/ServiceHandler.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.script.servicehandler; - -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.core.service.IInstanceDataService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Helper class that handles all needed services for ManagementBus-Script-Invocation-Plugin.
- *
- * - * - * In this class the from the ScriptPlugin needed services are binded an unbinded. - * - * - * @see IManagementBusPluginService - * @see IToscaEngineService - * @see ICoreEndpointService - * - * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * - */ - -public class ServiceHandler { - - public static IInstanceDataService instanceDataService, oldInstanceDataService; - public static IToscaEngineService toscaEngineService, oldToscaEngineService; - - private final static Logger LOG = LoggerFactory.getLogger(ServiceHandler.class); - - - /** - * Bind ToscaEngineService - * - * @param toscaEngineService - */ - public void bindToscaService(final IToscaEngineService toscaEngineService) { - if (toscaEngineService != null) { - if (ServiceHandler.toscaEngineService == null) { - ServiceHandler.toscaEngineService = toscaEngineService; - } else { - ServiceHandler.oldToscaEngineService = toscaEngineService; - ServiceHandler.toscaEngineService = toscaEngineService; - } - - ServiceHandler.LOG.debug("Bind ToscaEngineService: {} bound.", toscaEngineService.toString()); - } else { - ServiceHandler.LOG.error("Bind ToscaEngineService: Supplied parameter is null!"); - } - } - - /** - * Unbind ToscaEngineService - * - * @param toscaEngineService - */ - public void unbindToscaService(IToscaEngineService toscaEngineService) { - if (ServiceHandler.oldToscaEngineService == null) { - toscaEngineService = null; - } else { - ServiceHandler.oldToscaEngineService = null; - } - - ServiceHandler.LOG.debug("ToscaEngineService unbound."); - } - - /** - * Bind InstanceDataService - * - * @param instanceDataService - */ - public void bindInstanceDataService(final IInstanceDataService instanceDataService) { - if (instanceDataService != null) { - if (ServiceHandler.instanceDataService == null) { - ServiceHandler.instanceDataService = instanceDataService; - } else { - ServiceHandler.oldInstanceDataService = instanceDataService; - ServiceHandler.instanceDataService = instanceDataService; - } - - ServiceHandler.LOG.debug("Bind InstanceDataServiceInterface: {} bound.", - ServiceHandler.instanceDataService.toString()); - } else { - ServiceHandler.LOG.error("Bind InstanceDataServiceInterface: Supplied parameter is null!"); - } - } - - /** - * Unbind InstanceDataServiceInterface - * - * @param instanceDataService - */ - public void unbindInstanceDataService(IInstanceDataService instanceDataService) { - if (ServiceHandler.oldInstanceDataService == null) { - instanceDataService = null; - } else { - ServiceHandler.oldInstanceDataService = null; - } - - ServiceHandler.LOG.debug("InstanceDataServiceInterface unbound."); - } - -} diff --git a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/typeshandler/ArtifactTypesHandler.java b/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/typeshandler/ArtifactTypesHandler.java deleted file mode 100644 index 52ae0abfb..000000000 --- a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/typeshandler/ArtifactTypesHandler.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.script.typeshandler; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.namespace.QName; - -import org.eclipse.core.runtime.FileLocator; -import org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes.Artifacttype; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * - * Handles the config files (located in artifacttypes folder) for the different supported - * ArtifactTypes. - * - * - * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * - */ -public class ArtifactTypesHandler { - - private static final String ARTIFACT_TYPES_DEFINTION_FOLDER = "/META-INF/artifacttypes"; - - final private static Logger LOG = LoggerFactory.getLogger(ArtifactTypesHandler.class); - - private static HashMap artifact_types = new HashMap<>(); - - /** - * Initially reads all ArtifactTypes config files. - * - * @param bundleContext - */ - public static void init(final BundleContext bundleContext) { - - ArtifactTypesHandler.LOG.debug("Registering the supported ArtifactTypes..."); - - File[] types_definitions_files = null; - - URL bundleResURL = null; - URL fileResURL = null; - File typesFolder = null; - - try { - bundleResURL = bundleContext.getBundle().getEntry(ARTIFACT_TYPES_DEFINTION_FOLDER); - // convert bundle resource URL to file URL - fileResURL = FileLocator.toFileURL(bundleResURL); - typesFolder = new File(fileResURL.getPath()); - } - catch (final IOException e) { - ArtifactTypesHandler.LOG.error("", e); - } - - if (typesFolder == null) { - ArtifactTypesHandler.LOG.error("Can't get ArtifactTypes configuration files."); - } - - if (typesFolder != null && typesFolder.isDirectory()) { - types_definitions_files = typesFolder.listFiles((FileFilter) pathname -> { - final String name = pathname.getName().toLowerCase(); - return name.endsWith(".xml") && pathname.isFile(); - }); - } - - if (types_definitions_files != null) { - - for (final File type_defintion_file : types_definitions_files) { - - JAXBContext jaxbContext; - - try { - - jaxbContext = JAXBContext.newInstance(Artifacttype.class); - final Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); - final Artifacttype artitacttype = (Artifacttype) jaxbUnmarshaller.unmarshal(type_defintion_file); - - final String artifactTypeName = artitacttype.getName(); - final String artifactTypeNamespace = artitacttype.getNamespace(); - - final QName artifactType = new QName(artifactTypeNamespace, artifactTypeName); - - ArtifactTypesHandler.LOG.debug("Supported ArtifactType found: {}", artifactType); - - artifact_types.put(artifactType, artitacttype); - - } - catch (final JAXBException e) { - e.printStackTrace(); - } - } - } else { - ArtifactTypesHandler.LOG.debug("No supported ArtifactTypes found."); - } - } - - /** - * Returns the required packages of the specified ArtifactType. - * - * @param artifactType - * @return the required packages of the specified ArtifactType. - */ - public static List getRequiredPackages(final QName artifactType) { - - List requiredPackages = new ArrayList<>(); - - if (artifact_types.containsKey(artifactType)) { - requiredPackages = artifact_types.get(artifactType).getPackages().getPackage(); - } else { - ArtifactTypesHandler.LOG.warn("ArtifactType: {} is not supported!", artifactType); - } - - ArtifactTypesHandler.LOG.debug("Required packages of artifactType: {} : {}", artifactType, requiredPackages); - - return requiredPackages; - } - - /** - * Returns the defined commands of the specified ArtifactType. - * - * @param artifactType - * @return the defined commands of the specified ArtifactType. - */ - public static List getCommands(final QName artifactType) { - - List commands = new ArrayList<>(); - - if (artifact_types.containsKey(artifactType)) { - commands = artifact_types.get(artifactType).getCommands().getCommand(); - } else { - ArtifactTypesHandler.LOG.warn("ArtifactType: {} is not supported!", artifactType); - } - - ArtifactTypesHandler.LOG.debug("Commands to run for artifactType: {} : {}", artifactType, commands); - - return commands; - } - - /** - * @return the supported Types of the plugin. Based on the available *.xml files. - */ - public static List getSupportedTypes() { - - final ArrayList supportedTypes = new ArrayList<>(artifact_types.keySet()); - - ArtifactTypesHandler.LOG.debug("SupportedTypes: {}", supportedTypes); - - return supportedTypes; - - } - -} diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/META-INF/MANIFEST.MF b/org.opentosca.bus.management.invocation.plugin.soaphttp/META-INF/MANIFEST.MF deleted file mode 100644 index 10c2fb8ec..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,32 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.invocation.plugin.soaphttp -Bundle-SymbolicName: org.opentosca.bus.management.invocation.plugin.soaphttp -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.bus.management.invocation.plugin.soaphttp.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.predic8.schema, - com.predic8.soamodel, - com.predic8.wsdl, - com.predic8.wstool.creator, - groovy.xml;version="1.8.6", - org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.cxf;version="2.10.4", - org.apache.camel.component.direct;version="2.10.4", - org.apache.camel.component.jetty;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.cxf.binding.soap;version="2.7.3", - org.apache.cxf.headers;version="2.7.3", - org.apache.cxf.helpers;version="2.7.3", - org.eclipse.osgi.util;version="1.1.0", - org.opentosca.container.core.tosca.convention, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Service-Component: OSGI-INF/* -Bundle-ActivationPolicy: lazy -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0", - org.opentosca.bus.management.invocation.plugin;bundle-version="1.0.0" diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/OSGI-INF/ManagementBusInvocationPluginSoapHttp - component.xml b/org.opentosca.bus.management.invocation.plugin.soaphttp/OSGI-INF/ManagementBusInvocationPluginSoapHttp - component.xml deleted file mode 100644 index 20e5a4c70..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/OSGI-INF/ManagementBusInvocationPluginSoapHttp - component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/build.properties b/org.opentosca.bus.management.invocation.plugin.soaphttp/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/pom.xml b/org.opentosca.bus.management.invocation.plugin.soaphttp/pom.xml deleted file mode 100644 index 2a810c034..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.invocation.plugin.soaphttp - eclipse-plugin - - diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/Activator.java b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/Activator.java deleted file mode 100644 index e111df106..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/Activator.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.soaphttp; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.management.invocation.plugin.soaphttp.route.AsyncRoute; -import org.opentosca.bus.management.invocation.plugin.soaphttp.route.RequestOnlyRoute; -import org.opentosca.bus.management.invocation.plugin.soaphttp.route.SyncRoute; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the SOAP/HTTP-Invocation-Management-Bus-Plug-in.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * The activator is needed to add and start the camel routes. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - static DefaultCamelContext camelContext; - static BundleContext bundleContext; - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.camelContext = new OsgiDefaultCamelContext(bundleContext); - Activator.camelContext.addRoutes(new SyncRoute()); - Activator.camelContext.addRoutes(new AsyncRoute()); - Activator.camelContext.addRoutes(new RequestOnlyRoute()); - Activator.camelContext.start(); - Activator.bundleContext = bundleContext; - Activator.LOG.info("Management Bus-SOAP-Invocation-Plugin-started"); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.camelContext = null; - Activator.LOG.info("Management Bus-SOAP-Invocation-Plugin-stopped"); - } - -} diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/ManagementBusInvocationPluginSoapHttp.java b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/ManagementBusInvocationPluginSoapHttp.java deleted file mode 100644 index 7cf4e7eef..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/ManagementBusInvocationPluginSoapHttp.java +++ /dev/null @@ -1,483 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.soaphttp; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.camel.ConsumerTemplate; -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.ProducerTemplate; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; -import org.opentosca.bus.management.invocation.plugin.soaphttp.route.AsyncRoute; -import org.opentosca.bus.management.invocation.plugin.soaphttp.util.Messages; -import org.opentosca.bus.management.utils.MBUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.predic8.wsdl.Binding; -import com.predic8.wsdl.BindingOperation; -import com.predic8.wsdl.Definitions; -import com.predic8.wsdl.WSDLParser; - -/** - * Management Bus-Plug-in for invoking a service with a SOAP message over HTTP.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * The Plug-in gets needed information (like endpoint of the service or operation to invoke) from - * the Management Bus and creates a SOAP message out of it. If needed the Plug-in parses the WSDL of - * the service. The Plug-in supports synchronous request-response communication, asynchronous - * communication with callbacks and one-way invocation. - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -public class ManagementBusInvocationPluginSoapHttp implements IManagementBusInvocationPluginService { - - final private static Logger LOG = LoggerFactory.getLogger(ManagementBusInvocationPluginSoapHttp.class); - - // Supported types defined in messages.properties. - static final private String TYPES = Messages.SoapSIEnginePlugin_types; - - private static Map exchangeMap = Collections.synchronizedMap(new HashMap()); - - final String CALLBACK = "callback"; - final String REQUST_RESPONSE = "request-response"; - final String REQUEST_ONLY = "request-only"; - - - @Override - public Exchange invoke(Exchange exchange) { - - String messagingPattern = null; - - final Message message = exchange.getIn(); - - final Object params = message.getBody(); - final String operationName = message.getHeader(MBHeader.OPERATIONNAME_STRING.toString(), String.class); - String endpoint = message.getHeader(MBHeader.ENDPOINT_URI.toString(), String.class); - - final Boolean hasOutputParams = message.getHeader(MBHeader.HASOUTPUTPARAMS_BOOLEAN.toString(), Boolean.class); - final String csarID = message.getHeader(MBHeader.CSARID.toString(), String.class); - - if (!endpoint.endsWith("?wsdl")) { - - endpoint = endpoint.concat("?wsdl"); - - } - - final Map headers = new HashMap<>(); - - // Self defined header should be part of the outgoing soap messages. - for (final MBHeader header : MBHeader.values()) { - - if (message.getHeader(header.name()) != null) { - headers.put(header.name(), message.getHeader(header.name())); - } - } - - headers.put("endpoint", endpoint.replace("?wsdl", "")); - - - Document document = null; - - ManagementBusInvocationPluginSoapHttp.LOG.info("Creating invocation message."); - - if (params instanceof HashMap) { - - message.setHeader("ParamsMode", "HashMap"); - - String rootElementNamespaceURI = null; - String rootElementName = null; - - @SuppressWarnings("unchecked") - final HashMap paramsMap = (HashMap) params; - - final WSDLParser parser = new WSDLParser(); - - ManagementBusInvocationPluginSoapHttp.LOG.info("Parsing WSDL at: {}.", endpoint); - - Definitions wsdl; - - // If wsdl is not accessible, try again (max wait 5 min) - int count = 0; - final int maxTries = 30; - while (true) { - try { - wsdl = parser.parse(endpoint.toString()); - break; - } - catch (final Exception e) { - // handle exception - if (++count == maxTries) { - ManagementBusInvocationPluginSoapHttp.LOG.error("Unable to access the wsdl at: {}.", endpoint); - throw e; - } else { - ManagementBusInvocationPluginSoapHttp.LOG.warn("Problem accessing the wsdl at: {}. Retry... ({}/{})", - endpoint, count, maxTries); - try { - Thread.sleep(10000); - } - catch (final InterruptedException e1) { - e1.printStackTrace(); - } - } - } - } - - // Jump-Label to stop both loops at once - searchOperation: for (final Binding bind : wsdl.getBindings()) { - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Binding: {}", bind); - - if (bind.getProtocol().toString().toLowerCase().contains("soap")) { - - for (final BindingOperation op : bind.getOperations()) { - ManagementBusInvocationPluginSoapHttp.LOG.debug("Operation: {} =? {}", op.getName(), - operationName); - - if (op.getName().equals(operationName)) { - final String portType = bind.getPortType().getName(); - ManagementBusInvocationPluginSoapHttp.LOG.debug("PortType: {}", portType); - final String rootElementWithPrefix = - wsdl.getElementNameForOperation(operationName, portType); - final com.predic8.schema.Element element = - wsdl.getElementForOperation(operationName, portType); - rootElementName = element.getName(); - rootElementNamespaceURI = - (String) element.getNamespace(rootElementWithPrefix.replace(":" + rootElementName, "")); - ManagementBusInvocationPluginSoapHttp.LOG.debug("Root ElementName: {} with NamespaceURI: {}", - rootElementName, rootElementNamespaceURI); - - // Check if request-response ,callback or - // request-only - if (op.getInput() != null) { - - if (op.getOutput() == null && hasOutputParams) { - messagingPattern = this.CALLBACK; - - final String callbackAddress = AsyncRoute.PUBLIC_CALLBACKADDRESS; - - String messageId = message.getMessageId(); - if (paramsMap.containsKey("CorrelationID")) { - if (paramsMap.get("CorrelationID") != null) { - messageId = paramsMap.get("CorrelationID"); - } else { - paramsMap.put("CorrelationID", messageId); - } - message.setMessageId(messageId); - - } - LOG.debug("Message ID: {}", messageId); - - if (paramsMap.containsKey("MessageID")) { - paramsMap.put("MessageID", messageId); - } else { - headers.put("MessageID", messageId); - } - - if (paramsMap.containsKey("ReplyTo")) { - paramsMap.put("ReplyTo", callbackAddress); - } else { - headers.put("ReplyTo", callbackAddress); - } - if (paramsMap.containsKey("planCallbackAddress_invoker")) { - paramsMap.put("planCallbackAddress_invoker", - "http://localhost:9763/services/" + csarID + "InvokerService/"); - } else { - headers.put("planCallbackAddress_invoker", - "http://localhost:9763/services/" + csarID + "InvokerService/"); - } - - } else if (op.getOutput() == null && !hasOutputParams) { - messagingPattern = this.REQUEST_ONLY; - - } else { - messagingPattern = this.REQUST_RESPONSE; - } - - break searchOperation; - } - } - } - } - } - - if (messagingPattern == null) { - ManagementBusInvocationPluginSoapHttp.LOG.error("No invokable operation found. Invocation aborted!"); - return null; - } - document = mapToDoc(rootElementNamespaceURI, rootElementName, paramsMap); - } - - if (params instanceof Document) { - - document = (Document) params; - - - messagingPattern = determineMP(message, operationName, hasOutputParams, endpoint); - } - - if (messagingPattern == null) { - ManagementBusInvocationPluginSoapHttp.LOG.error("Can't determine which kind of invocation is needed. Invocation aborted."); - return null; - } - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Invoking the web service."); - - final ProducerTemplate template = Activator.camelContext.createProducerTemplate(); - - final ConsumerTemplate consumer = Activator.camelContext.createConsumerTemplate(); - - Document response = null; - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Messaging pattern: {}", messagingPattern); - - if (messagingPattern.equals(this.REQUST_RESPONSE)) { - ManagementBusInvocationPluginSoapHttp.LOG.debug("Sync invocation."); - response = template.requestBodyAndHeaders("direct:Sync-WS-Invoke", document, headers, Document.class); - } - - else if (messagingPattern.equals(this.REQUEST_ONLY)) { - ManagementBusInvocationPluginSoapHttp.LOG.debug("Request-only invocation."); - template.sendBodyAndHeaders("direct:RequestOnly-WS-Invoke", document, headers); - return null; - } - - else if (messagingPattern.equals(this.CALLBACK)) { - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Async invocation."); - - final String messageID = message.getMessageId(); - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Storing exchange message with MessageID: {}", messageID); - - ManagementBusInvocationPluginSoapHttp.exchangeMap.put(messageID, exchange); - - template.sendBodyAndHeaders("direct:Async-WS-Invoke", document, headers); - - Exchange ex = null; - - while (response == null) { - - try { - - consumer.start(); - ex = consumer.receive("direct:Async-WS-Callback" + messageID); - consumer.stop(); - - } - catch (final Exception e) { - e.printStackTrace(); - } - - final Message mes = ex.getIn(); - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Got Message with ID: {}", messageID); - ManagementBusInvocationPluginSoapHttp.LOG.debug("Stored MessageIDs: {}", - ManagementBusInvocationPluginSoapHttp.exchangeMap.keySet() - .toString()); - - if (ManagementBusInvocationPluginSoapHttp.exchangeMap.containsKey(messageID)) { - ManagementBusInvocationPluginSoapHttp.LOG.debug("MessageID found"); - exchange = ManagementBusInvocationPluginSoapHttp.exchangeMap.get(messageID); - - response = mes.getBody(Document.class); - - ManagementBusInvocationPluginSoapHttp.exchangeMap.remove(messageID); - } - - } - - } - - if (exchange.getIn().getHeader("ParamsMode") != null - && exchange.getIn().getHeader("ParamsMode").equals("HashMap")) { - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Transforming Document to HashMap..."); - - final HashMap responseMap = MBUtils.docToMap(response, false); - - exchange.getIn().setBody(responseMap); - - } else { - exchange.getIn().setBody(response); - } - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Returning exchange with MessageID: {}", - exchange.getIn().getMessageId()); - ManagementBusInvocationPluginSoapHttp.LOG.debug("Returning body: {}", exchange.getIn().getBody().toString()); - - return exchange; - } - - /** - * Determine if the specified operation of the specified wsdl defines output parameter. - * - * @param endpoint of the wsdl to check. - * @param operationName to check. - * @return true if operation returns output params. Otherwise false. If - * operation can't be found null is returned. - */ - private Boolean hasOutputDefinedInWSDL(final String endpoint, final String operationName) { - - final WSDLParser parser = new WSDLParser(); - - final Definitions wsdl = parser.parse(endpoint.toString()); - - for (final Binding bind : wsdl.getBindings()) { - - if (bind.getProtocol().toString().toLowerCase().contains("soap")) { - - for (final BindingOperation op : bind.getOperations()) { - - if (op.getName().equals(operationName)) { - - if (op.getOutput() == null) { - return false; - - } else { - return true; - } - } - } - } - } - return null; - } - - /** - * Determines which kind of invocation is needed for this operation. - * - * @param message - * @param operationName - * @param hasOutputParams - * @param endpoint - * - * @return messagingPattern as String. - */ - private String determineMP(final Message message, final String operationName, final Boolean hasOutputParams, - final String endpoint) { - - // Plan should be invoked - if (message.getHeader(MBHeader.PLANID_QNAME.toString()) != null) { - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Invoking a plan with document as input."); - - // Caller already knows if invocation is sync or async. - if (message.getHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString()) != null) { - if (!message.getHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), Boolean.class)) { - return this.CALLBACK; - } else { - return this.REQUST_RESPONSE; - } - - // Plug-in needs to determine with wsdl. - } else if (operationName != null) { - - final Boolean hasOutputDefinedInWSDL = hasOutputDefinedInWSDL(endpoint, operationName); - - if (hasOutputDefinedInWSDL != null) { - if (hasOutputDefinedInWSDL) { - return this.REQUST_RESPONSE; - } else { - return this.CALLBACK; - } - } - } - - // Operation of IA should be invoked - } else { - - ManagementBusInvocationPluginSoapHttp.LOG.debug("Invoking an operation of an implementation artifact with document as input."); - - final Boolean hasOutputDefinedInWSDL = hasOutputDefinedInWSDL(endpoint, operationName); - - if (hasOutputDefinedInWSDL != null) { - - if (!hasOutputDefinedInWSDL && hasOutputParams) { - return this.CALLBACK; - - } else if (!hasOutputDefinedInWSDL && !hasOutputParams) { - return this.REQUEST_ONLY; - - } else { - return this.REQUST_RESPONSE; - } - } - } - return null; - } - - /** - * Transfers the paramsMap into a Document. - * - * @param rootElementNamespaceURI - * @param rootElementName - * @param paramsMap - * - * @return the created Document. - */ - private Document mapToDoc(final String rootElementNamespaceURI, final String rootElementName, - final HashMap paramsMap) { - - Document document; - - final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = null; - try { - documentBuilder = documentBuilderFactory.newDocumentBuilder(); - } - catch (final ParserConfigurationException e) { - ManagementBusInvocationPluginSoapHttp.LOG.error("Some error occured."); - e.printStackTrace(); - } - - document = documentBuilder.newDocument(); - - final Element rootElement = document.createElementNS(rootElementNamespaceURI, rootElementName); - document.appendChild(rootElement); - - Element mapElement; - for (final Entry entry : paramsMap.entrySet()) { - mapElement = document.createElement(entry.getKey()); - mapElement.setTextContent(entry.getValue()); - rootElement.appendChild(mapElement); - - } - - return document; - } - - /** - * @return the keys of the map containing stored messageIds and exchange objects. - */ - public static Set getMessageIDs() { - return ManagementBusInvocationPluginSoapHttp.exchangeMap.keySet(); - } - - @Override - public List getSupportedTypes() { - ManagementBusInvocationPluginSoapHttp.LOG.debug("Getting Types: {}.", - ManagementBusInvocationPluginSoapHttp.TYPES); - final List types = new ArrayList<>(); - - for (final String type : ManagementBusInvocationPluginSoapHttp.TYPES.split("[,;]")) { - types.add(type.trim()); - } - return types; - } -} diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/package-info.java b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/package-info.java deleted file mode 100644 index ef986f132..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This package contains one implementation of the - * {@link org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService}. - * This one supports the invocation of soap web services.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.invocation.plugin.soaphttp; diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/CallbackProcessor.java b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/CallbackProcessor.java deleted file mode 100644 index 809694bb6..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/CallbackProcessor.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.soaphttp.processor; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.soap.MessageFactory; -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPMessage; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.cxf.binding.soap.SoapHeader; -import org.apache.cxf.headers.Header; -import org.opentosca.bus.management.invocation.plugin.soaphttp.ManagementBusInvocationPluginSoapHttp; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * Callback-Processor of the SOAP/HTTP-Invocation-Management-Bus-Plug-in.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * This processor processes incoming soap messages. It checks if the messages are containing - * existing messageIDs. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class CallbackProcessor implements Processor { - - final private static Logger LOG = LoggerFactory.getLogger(CallbackProcessor.class); - - - @Override - public void process(final Exchange exchange) throws Exception { - - final Set messageIDs = ManagementBusInvocationPluginSoapHttp.getMessageIDs(); - - CallbackProcessor.LOG.debug("Stored messageIDs: {}", messageIDs.toString()); - - // copy SOAP headers in camel exchange header - @SuppressWarnings("unchecked") - final List soapHeaders = (List) exchange.getIn().getHeader(Header.HEADER_LIST); - Element element; - if (soapHeaders != null) { - for (final SoapHeader header : soapHeaders) { - element = (Element) header.getObject(); - exchange.getIn().setHeader(element.getLocalName(), element.getTextContent()); - } - } - - final String message = exchange.getIn().getBody(String.class); - final Map headers = exchange.getIn().getHeaders(); - - CallbackProcessor.LOG.debug("Searching the callback Message for a MessageID matching the stored ones..."); - - for (final String messageID : messageIDs) { - - // checks if the callback message contains a stored messageID - // if (message.matches("(?s).*\\s*[^a-zA-Z0-9-]" + messageID + - // "[^a-zA-Z0-9-]\\s*(?s).*") || headers.containsValue(messageID)) { - if (message.contains(messageID) || headers.containsValue(messageID)) { - - CallbackProcessor.LOG.debug("Found MessageID: {}", messageID); - - final MessageFactory messageFactory = MessageFactory.newInstance(); - - final InputStream inputStream = new ByteArrayInputStream(message.getBytes("UTF-8")); - final SOAPMessage soapMessage = messageFactory.createMessage(null, inputStream); - - exchange.getIn().setHeader("MessageID", messageID); - exchange.getIn().setHeader("AvailableMessageID", "true"); - - Document doc; - - try { - doc = soapMessage.getSOAPBody().extractContentAsDocument(); - exchange.getIn().setBody(doc); - - } - catch (final SOAPException e) { - - doc = soapMessage.getSOAPPart().getEnvelope().getOwnerDocument(); - - CallbackProcessor.LOG.warn("SOAP response body can't be parsed and/or isn't well formatted. Returning alternative response."); - exchange.getIn().setBody(doc); - } - - break; - - } - } - - } -} diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/HeaderProcessor.java b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/HeaderProcessor.java deleted file mode 100644 index b02827800..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/HeaderProcessor.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.soaphttp.processor; - -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.camel.component.cxf.CxfPayload; -import org.apache.cxf.binding.soap.SoapHeader; -import org.w3c.dom.Document; -import org.xml.sax.EntityResolver; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Header-Processor of the SOAP/HTTP-Invocation-Management-Bus-Plug-in.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * This processor copies all self defined header of the exchange object into SoapHeader of the - * outgoing Soap message. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class HeaderProcessor implements Processor { - - @Override - public void process(final Exchange exchange) throws Exception { - - @SuppressWarnings("unchecked") - final CxfPayload payload = exchange.getIn().getBody(CxfPayload.class); - - final Map headers = exchange.getIn().getHeaders(); - for (final Map.Entry entry : headers.entrySet()) { - - if (entry.getKey().equalsIgnoreCase("ReplyTo")) { - - final String xml1 = "" + entry.getValue().toString() - + ""; - final SoapHeader replyToSoapHeader = - new SoapHeader(new QName("http://www.w3.org/2005/08/addressing", "ReplyTo"), - readXml(new StringReader(xml1)).getDocumentElement()); - payload.getHeaders().add(replyToSoapHeader); - - } else if (entry.getKey().equalsIgnoreCase("MessageID")) { - - final String xml2 = "" + entry.getValue().toString() - + ""; - final SoapHeader messageIdSoapHeader = - new SoapHeader(new QName("http://www.w3.org/2005/08/addressing", "MessageID"), - readXml(new StringReader(xml2)).getDocumentElement()); - payload.getHeaders().add(messageIdSoapHeader); - - } else { - - payload.getHeaders().add(getSoapHeader(entry.getKey(), entry.getValue().toString())); - - } - } - exchange.getIn().setBody(payload); - - } - - /** - * Returns a SoapHeader - * - * @param key of the header - * @param content of the header - * @return SoapHeader - */ - private SoapHeader getSoapHeader(final String key, final String content) { - final String xml = "<" + key + ">" + content + ""; - try { - return new SoapHeader(new QName(key), readXml(new StringReader(xml)).getDocumentElement()); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final IOException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - return null; - - } - - public static Document readXml(final Reader is) throws SAXException, IOException, ParserConfigurationException { - final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - - dbf.setValidating(false); - dbf.setIgnoringComments(false); - dbf.setIgnoringElementContentWhitespace(true); - dbf.setNamespaceAware(true); - // dbf.setCoalescing(true); - // dbf.setExpandEntityReferences(true); - - DocumentBuilder db = null; - db = dbf.newDocumentBuilder(); - db.setEntityResolver(new NullResolver()); - - // db.setErrorHandler( new MyErrorHandler()); - final InputSource ips = new InputSource(is); - return db.parse(ips); - } - - - public static class NullResolver implements EntityResolver { - - @Override - public InputSource resolveEntity(final String publicId, final String systemId) throws SAXException, - IOException { - return new InputSource(new StringReader("")); - } - } -} diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/package-info.java b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/package-info.java deleted file mode 100644 index 93368df92..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This package contains a camel processor needed to handle the callback response of an asynchronous - * invocation.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.invocation.plugin.soaphttp.processor; diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/package-info.java b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/package-info.java deleted file mode 100644 index 6db0d9d73..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This package contains three camel routes needed to invoke a soap web service in synchronous, - * asynchronous with callbacks and request-only style.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.invocation.plugin.soaphttp.route; diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/util/Messages.java b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/util/Messages.java deleted file mode 100644 index 36d1a2600..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/util/Messages.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin.soaphttp.util; - -import org.eclipse.osgi.util.NLS; - -/** - * Utility class to define Strings in messages.properties.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - * - */ -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.opentosca.bus.management.invocation.plugin.soaphttp.util.messages"; //$NON-NLS-1$ - public static String SoapSIEnginePlugin_types; - static { - // initialize resource bundle - NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class); - } - - - private Messages() {} -} diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/util/messages.properties b/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/util/messages.properties deleted file mode 100644 index 00716d59d..000000000 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/util/messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Contains the supported types of the plugin as comma separated list. -SoapSIEnginePlugin_types=SOAP/HTTP \ No newline at end of file diff --git a/org.opentosca.bus.management.invocation.plugin/META-INF/MANIFEST.MF b/org.opentosca.bus.management.invocation.plugin/META-INF/MANIFEST.MF deleted file mode 100644 index d24160978..000000000 --- a/org.opentosca.bus.management.invocation.plugin/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.invocation.plugin -Bundle-SymbolicName: org.opentosca.bus.management.invocation.plugin -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.opentosca.bus.management.invocation.plugin -Import-Package: org.apache.camel;version="2.10.4" diff --git a/org.opentosca.bus.management.invocation.plugin/build.properties b/org.opentosca.bus.management.invocation.plugin/build.properties deleted file mode 100644 index b107977f4..000000000 --- a/org.opentosca.bus.management.invocation.plugin/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.bus.management.invocation.plugin/pom.xml b/org.opentosca.bus.management.invocation.plugin/pom.xml deleted file mode 100644 index 27d295bea..000000000 --- a/org.opentosca.bus.management.invocation.plugin/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.invocation.plugin - eclipse-plugin - - diff --git a/org.opentosca.bus.management.invocation.plugin/src/org/opentosca/bus/management/invocation/plugin/IManagementBusInvocationPluginService.java b/org.opentosca.bus.management.invocation.plugin/src/org/opentosca/bus/management/invocation/plugin/IManagementBusInvocationPluginService.java deleted file mode 100644 index 24d1913d0..000000000 --- a/org.opentosca.bus.management.invocation.plugin/src/org/opentosca/bus/management/invocation/plugin/IManagementBusInvocationPluginService.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.opentosca.bus.management.invocation.plugin; - -import java.util.List; - -import org.apache.camel.Exchange; - -/** - * Interface of the Management Bus Invocation Plug-ins.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * The interface specifies two methods. One for invoking a service like an operation of an - * implementation artifact or a plan and one method that returns the supported invocation-type of - * the plug-in. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public interface IManagementBusInvocationPluginService { - - /** - * Invokes a service like an ImplementationArtifact or a Plan. - * - * @param exchange contains all needed information like endpoint of the service, the operation - * to invoke and the data to be transferred. - * - * @return the response of the invoked service as body of the exchange message. - * - */ - public Exchange invoke(Exchange exchange); - - /** - * Returns the supported invocation-types of the plug-in. - * - */ - public List getSupportedTypes(); - -} diff --git a/org.opentosca.bus.management.service.impl/META-INF/MANIFEST.MF b/org.opentosca.bus.management.service.impl/META-INF/MANIFEST.MF deleted file mode 100644 index 96bbf3211..000000000 --- a/org.opentosca.bus.management.service.impl/META-INF/MANIFEST.MF +++ /dev/null @@ -1,38 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.service.impl -Bundle-SymbolicName: org.opentosca.bus.management.service.impl -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.google.gson;version="2.2.4", - com.sun.jersey.api.client;version="1.17.1", - javax.persistence;version="2.1.1", - org.apache.camel;version="2.10.4", - org.apache.camel.builder;version="2.10.4", - org.apache.camel.component.direct;version="2.10.4", - org.apache.camel.component.mqtt;version="2.10.4", - org.apache.camel.converter.jaxb;version="2.10.4", - org.apache.camel.core.osgi;version="2.10.4", - org.apache.camel.impl;version="2.10.4", - org.apache.camel.model;version="2.10.4", - org.apache.camel.spi;version="2.10.4", - org.apache.commons.io;version="2.2.0", - org.apache.commons.lang3;version="3.1.0", - org.opentosca.bus.management.invocation.plugin.script, - org.opentosca.container.api.service, - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.6.4", - org.glassfish.jersey.uri;version="2.22.2" -Bundle-Activator: org.opentosca.bus.management.service.impl.Activator -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.bus.management;bundle-version="1.0.0", - org.opentosca.bus.management.service;bundle-version="1.0.0", - org.opentosca.bus.management.invocation.plugin;bundle-version="1.0.0", - org.opentosca.bus.management.deployment.plugin;bundle-version="1.0.0", - org.apache.camel.camel-core -Export-Package: org.opentosca.bus.management.service.impl, - org.opentosca.bus.management.service.impl.collaboration, - org.opentosca.bus.management.service.impl.collaboration.model -Bundle-ActivationPolicy: lazy -Service-Component: OSGI-INF/* diff --git a/org.opentosca.bus.management.service.impl/OSGI-INF/ManagementBusServiceImpl - component.xml b/org.opentosca.bus.management.service.impl/OSGI-INF/ManagementBusServiceImpl - component.xml deleted file mode 100644 index 07970e292..000000000 --- a/org.opentosca.bus.management.service.impl/OSGI-INF/ManagementBusServiceImpl - component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.bus.management.service.impl/OSGI-INF/ServiceHandler - component.xml b/org.opentosca.bus.management.service.impl/OSGI-INF/ServiceHandler - component.xml deleted file mode 100644 index ef4c84cc7..000000000 --- a/org.opentosca.bus.management.service.impl/OSGI-INF/ServiceHandler - component.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.opentosca.bus.management.service.impl/build.properties b/org.opentosca.bus.management.service.impl/build.properties deleted file mode 100644 index 24d86faa1..000000000 --- a/org.opentosca.bus.management.service.impl/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/, diff --git a/org.opentosca.bus.management.service.impl/pom.xml b/org.opentosca.bus.management.service.impl/pom.xml deleted file mode 100644 index 9caba6b49..000000000 --- a/org.opentosca.bus.management.service.impl/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.service.impl - eclipse-plugin - - diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/Activator.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/Activator.java deleted file mode 100644 index 603d2c1f3..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/Activator.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.opentosca.bus.management.service.impl; - -import java.util.concurrent.TimeoutException; - -import org.apache.camel.ProducerTemplate; -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.management.service.impl.collaboration.route.ReceiveRequestRoute; -import org.opentosca.bus.management.service.impl.collaboration.route.ReceiveResponseRoute; -import org.opentosca.bus.management.service.impl.collaboration.route.SendRequestResponseRoute; -import org.opentosca.container.core.common.Settings; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Activator of the Management Bus.
- *
- * - * Copyright 2018 IAAS University of Stuttgart
- *
- * - * The activator is needed to start the camel context and add the routes for collaboration between - * different OpenTOSCA instances. Additionally, a producer template is created which can be used by - * all classes of this bundle to send camel messages. - */ -public class Activator implements BundleActivator { - - final private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - public static DefaultCamelContext camelContext; - - public static ProducerTemplate producer = null; - - @Override - public void start(final BundleContext bundleContext) throws Exception { - camelContext = new OsgiDefaultCamelContext(bundleContext); - camelContext.setUseBreadcrumb(false); - camelContext.start(); - - // the camel routes are only needed if collaboration is turned on - if (Boolean.parseBoolean(Settings.OPENTOSCA_COLLABORATION_MODE)) { - LOG.info("Collaboration mode is turned on. Starting camel routes..."); - - // Create a producer template for all components of the Management Bus implementation. - // This is recommended by camel to avoid the usage of too many threads. - producer = camelContext.createProducerTemplate(); - - // route to send requests/responses to other OpenTOSCA Containers - camelContext.addRoutes(new SendRequestResponseRoute(Settings.OPENTOSCA_BROKER_MQTT_USERNAME, - Settings.OPENTOSCA_BROKER_MQTT_PASSWORD)); - - // route to receive responses by other OpenTOSCA Containers - camelContext.addRoutes(new ReceiveResponseRoute(Constants.LOCAL_MQTT_BROKER, Constants.RESPONSE_TOPIC, - Settings.OPENTOSCA_BROKER_MQTT_USERNAME, Settings.OPENTOSCA_BROKER_MQTT_PASSWORD)); - - // if the setting is null or equals the empty string, this Container does not subscribe - // for requests of other Containers (acts as 'master') - if (Settings.OPENTOSCA_COLLABORATION_HOSTNAMES == null - || Settings.OPENTOSCA_COLLABORATION_HOSTNAMES.equals("") - || Settings.OPENTOSCA_COLLABORATION_PORTS == null - || Settings.OPENTOSCA_COLLABORATION_PORTS.equals("")) { - LOG.debug("No other Container defined to subscribe for requests. Only started route to send own requests and receive replies."); - - } else { - final String[] collaborationHosts = Settings.OPENTOSCA_COLLABORATION_HOSTNAMES.split(","); - final String[] collaborationPorts = Settings.OPENTOSCA_COLLABORATION_PORTS.split(","); - - if (collaborationHosts.length != collaborationPorts.length) { - LOG.error("The number of hostnames and ports of the collaborating hosts must be equal. Hosts: {} Ports: {}", - collaborationHosts.length, collaborationPorts.length); - } else { - - // one route per collaborating Container is needed - for (int i = 0; i < collaborationHosts.length; i++) { - final String brokerURL = "tcp://" + collaborationHosts[i] + ":" + collaborationPorts[i]; - LOG.debug("Connecting to broker at {}", brokerURL); - try { - camelContext.addRoutes(new ReceiveRequestRoute(brokerURL, Constants.REQUEST_TOPIC, - Settings.OPENTOSCA_BROKER_MQTT_USERNAME, Settings.OPENTOSCA_BROKER_MQTT_PASSWORD)); - } - catch (final TimeoutException e) { - LOG.error("Timeout while connecting to broker at {}. Unable to start route.", brokerURL); - } - } - } - } - } - - LOG.info("Management Bus started!"); - } - - @Override - public void stop(final BundleContext arg0) throws Exception { - // release resources - try { - if (producer != null) { - producer.stop(); - producer = null; - } - - if (camelContext != null) { - camelContext.stop(); - camelContext = null; - } - } - catch (final Exception e) { - LOG.warn("Execption while releasing resources: {}", e.getMessage()); - } - - LOG.info("Management Bus stopped!"); - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/Constants.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/Constants.java deleted file mode 100644 index 0486e0671..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/Constants.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.opentosca.bus.management.service.impl; - -import org.opentosca.container.core.common.Settings; - -/** - * This class contains constants which are used by the Management Bus classes.
- *
- * - * Copyright 2019 IAAS University of Stuttgart - */ -public class Constants { - - // region Collaboration - - /** - * URL to access the local Moquette MQTT broker - */ - public final static String LOCAL_MQTT_BROKER = - "tcp://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_BROKER_MQTT_PORT; - - /** - * Topic name where the OpenTOSCA Container sends his request to and where it expects requests at - * the MQTT broker of the 'master' OpenTOSCA Container in case it acts as a 'slave'. This topic name - * has to be consistent between interacting OpenTOSCA Containers. - */ - public final static String REQUEST_TOPIC = "opentosca/container/collaboration/request"; - - /** - * Topic name where the OpenTOSCA Container expects responses to his requests. This topic name is - * set as "reply-to" header field in requests. So, it could also be created dynamically and does not - * necessarily have to be consistent between different Containers. - */ - public final static String RESPONSE_TOPIC = "opentosca/container/collaboration/response"; - - /** - * The invocation and deployment type of the invocation/deployment plug-ins that move requests from - * the local OpenTOSCA Container to a remote one. This type has to be different from all types that - * are supported by all other invocation and deployment plug-ins. - */ - public final static String REMOTE_TYPE = "remote"; - - // endregion - - // region General - - /** - * Start and end tags for properties that have to be replaced by instance data - */ - public final static String PLACEHOLDER_START = "/PLACEHOLDER_"; - public final static String PLACEHOLDER_END = "_PLACEHOLDER/"; - - /** - * Path to access the process instances in the Camunda BPMN engine - */ - public final static String PROCESS_INSTANCE_PATH = "/process-instance?processInstanceIds="; - - /** - * Path to access the output parameters in the Camunda BPMN engine - */ - public final static String HISTORY_PATH = "/history/variable-instance"; - - // endregion -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/ManagementBusServiceImpl.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/ManagementBusServiceImpl.java deleted file mode 100644 index 0df1d6629..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/ManagementBusServiceImpl.java +++ /dev/null @@ -1,1072 +0,0 @@ -package org.opentosca.bus.management.service.impl; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import javax.xml.namespace.QName; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.camel.ProducerTemplate; -import org.apache.camel.impl.DefaultExchange; -import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; -import org.opentosca.bus.management.service.IManagementBusService; -import org.opentosca.bus.management.service.impl.collaboration.DeploymentDistributionDecisionMaker; -import org.opentosca.bus.management.service.impl.instance.plan.PlanInstanceHandler; -import org.opentosca.bus.management.service.impl.servicehandler.ServiceHandler; -import org.opentosca.bus.management.service.impl.util.DeploymentPluginCapabilityChecker; -import org.opentosca.bus.management.service.impl.util.ParameterHandler; -import org.opentosca.bus.management.service.impl.util.PluginHandler; -import org.opentosca.bus.management.service.impl.util.Util; -import org.opentosca.bus.management.utils.MBUtils; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.AbstractArtifact; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.model.PlanInstanceEvent; -import org.opentosca.container.core.next.model.PlanLanguage; -import org.opentosca.container.core.next.model.PlanType; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.repository.PlanInstanceRepository; -import org.opentosca.container.core.next.trigger.SituationTriggerInstanceListener; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.convention.Types; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Engine for delegating invoke-requests of implementation artifacts or plans to matching - * plug-ins.
- *
- * - * Copyright 2019 IAAS University of Stuttgart
- *
- * - * The engine gets the invoke-request as a camel exchange object with all needed parameters (e.g. - * CSARID, ServiceTemplateID, CorrelationID...) in the header and the actual invoke message in the - * body of it.
- *
- * - * In case of invoking an operation of an implementation artifact, the engine identifies with help - * of the ToscaEngine and the parameters from the header the right implementation artifact. - * Afterwards it checks if the implementation artifact is already deployed by using the - * EndpointService. If this is not the case it tries to deploy the implementation artifact - * by using an available deployment plug-in and stores a corresponding endpoint. When an endpoint - * was found/created the engine determines which invocation plug-in has to be used to call the - * operation. Therefore, the engine uses information like the ArtifactType of the implementation - * artifact or a specified property like {@literal <}namespace:InvocationType{@literal >}... - * {@literal <}/namespace:InvocationType{@literal >}. Finally, the engine calls the - * implementation artifact operation by passing the exchange to the invocation plug-in. The engine - * is also able to update request parameters from stored InstanceData before passing the - * request on.
- *
- * - * In case of invoking a plan no deployment is needed as this is already done when the corresponding - * CSAR is deployed on the OpenTOSCA Container. The engine determines the invocation plug-in by - * checking the language of the plan and afterwards invokes the plan via this plug-in.
- *
- * - * @see IManagementBusInvocationPluginService - * @see IManagementBusDeploymentPluginService - * @see IToscaEngineService - * @see ICoreEndpointService - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * - */ - -public class ManagementBusServiceImpl implements IManagementBusService { - - private final static Logger LOG = LoggerFactory.getLogger(ManagementBusServiceImpl.class); - - private static Map locks = new HashMap<>(); - - @Override - public void invokeIA(final Exchange exchange) { - LOG.debug("Starting Management Bus: InvokeIA"); - - // log event to monitor the IA execution time - final PlanInstanceEvent event = new PlanInstanceEvent("INFO", "IA_DURATION_LOG", ""); - - final Message message = exchange.getIn(); - - final CSARID csarID = message.getHeader(MBHeader.CSARID.toString(), CSARID.class); - LOG.debug("CSARID: {}", csarID.toString()); - - final QName serviceTemplateID = message.getHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), QName.class); - LOG.debug("serviceTemplateID: {}", serviceTemplateID); - - final URI serviceInstanceID = exchange.getIn().getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), URI.class); - LOG.debug("ServiceInstanceID: {}", serviceInstanceID); - - final String nodeTemplateID = message.getHeader(MBHeader.NODETEMPLATEID_STRING.toString(), String.class); - LOG.debug("NodeTemplateID: {}", nodeTemplateID); - - final String relationship = message.getHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), String.class); - LOG.debug("RelationshipTemplateID: {}", relationship); - - final String neededInterface = message.getHeader(MBHeader.INTERFACENAME_STRING.toString(), String.class); - LOG.debug("Interface: {}", neededInterface); - - final String neededOperation = message.getHeader(MBHeader.OPERATIONNAME_STRING.toString(), String.class); - LOG.debug("Operation: {}", neededOperation); - - final String correlationID = message.getHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), String.class); - LOG.debug("Correlation ID: {}", correlationID); - - - // get the ServiceTemplateInstance ID Long from the serviceInstanceID URI - final Long serviceTemplateInstanceID = Util.determineServiceTemplateInstanceId(serviceInstanceID); - - // operation invocation is only possible with retrieved ServiceTemplateInstance ID - if (!serviceTemplateInstanceID.equals(Long.MIN_VALUE)) { - - if (Boolean.valueOf(Settings.OPENTOSCA_BUS_MANAGEMENT_MOCK)) { - - long waitTime = System.currentTimeMillis() + 1000; - while (System.currentTimeMillis() < waitTime) { - } - - respondViaMocking(exchange, message, csarID, serviceTemplateID, nodeTemplateID, neededInterface, - neededOperation); - } else { - this.invokeIA(exchange, csarID, serviceTemplateID, serviceTemplateInstanceID, nodeTemplateID, - relationship, neededInterface, neededOperation); - } - } else { - LOG.error("Unable to invoke operation without ServiceTemplateInstance ID!"); - handleResponse(exchange); - } - - if (Objects.nonNull(correlationID)) { - // add end timestamp and log message with duration - event.setEndTimestamp(new Date()); - final long duration = event.getEndTimestamp().getTime() - event.getStartTimestamp().getTime(); - event.setMessage("Finished execution of IA for NodeTemplate '" + nodeTemplateID + "' interface '" - + neededInterface + "' and operation '" + neededOperation + "' after " + duration + "ms"); - LOG.info("IA execution duration: {}ms", duration); - event.setNodeTemplateID(nodeTemplateID); - event.setInterfaceName(neededInterface); - event.setOperationName(neededOperation); - event.setExecutionDuration(duration); - - // update plan in repository with new log event - final PlanInstanceRepository repo = new PlanInstanceRepository(); - final PlanInstance plan = repo.findByCorrelationId(correlationID); - - if (Objects.nonNull(plan)) { - plan.addEvent(event); - repo.update(plan); - } - } - } - - private void respondViaMocking(final Exchange exchange,Message message, final CSARID csarID, final QName serviceTemplateID, - final String nodeTemplateID, final String neededInterface, - final String neededOperation) { - - - - final List outputParams = - ServiceHandler.toscaEngineService.getOutputParametersOfTypeOperation(csarID, - ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(csarID, - serviceTemplateID, - nodeTemplateID), - neededInterface, neededOperation); - - final HashMap responseMap = new HashMap<>(); - - for (final String outputParam : outputParams) { - responseMap.put(outputParam, "managementBusMockValue"); - } - - final Object params = message.getBody(); - if (params != null && params instanceof HashMap && ((HashMap) params).values().contains("fault")) { - responseMap.put("Fault", "managementBusMockFaultValue"); - } - - exchange.getIn().setBody(responseMap); - - handleResponse(exchange); - } - - /** - * Searches for the NodeType/RelationshipType of the given operation, updates the input parameters - * and passes the request on to invoke the corresponding IA. - * - * @param exchange exchange containing the header fields which identify the current operation - * @param serviceTemplateInstanceID service instance which contains the instance data to update the - * input parameters - * @param neededInterface the interface of the searched operation - * @param neededOperation the searched operation - */ - private void invokeIA(final Exchange exchange, final CSARID csarID, final QName serviceTemplateID, - final Long serviceTemplateInstanceID, final String nodeTemplateID, final String relationship, - final String neededInterface, final String neededOperation) { - final Message message = exchange.getIn(); - - - - QName typeID = null; - if (Objects.nonNull(nodeTemplateID)) { - typeID = - ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(csarID, serviceTemplateID, nodeTemplateID); - } else if (Objects.nonNull(relationship)) { - typeID = - ServiceHandler.toscaEngineService.getRelationshipTypeOfRelationshipTemplate(csarID, serviceTemplateID, - relationship); - } - - // invocation is only possible with retrieved type which contains the operation - if (Objects.nonNull(typeID)) { - - // get NodeTemplateInstance object for the deployment distribution decision - NodeTemplateInstance nodeInstance = null; - RelationshipTemplateInstance relationshipInstance = null; - if (Objects.nonNull(nodeTemplateID)) { - nodeInstance = MBUtils.getNodeTemplateInstance(serviceTemplateInstanceID, nodeTemplateID); - - } else if (Objects.nonNull(relationship)) { - relationshipInstance = MBUtils.getRelationshipTemplateInstance(serviceTemplateInstanceID, relationship); - - if (Objects.nonNull(relationshipInstance)) { - - // get the NodeTemplateInstance to which the operation is bound to - if (ServiceHandler.toscaEngineService.isOperationOfRelationshipBoundToSourceNode(csarID, typeID, - neededInterface, - neededOperation)) { - nodeInstance = relationshipInstance.getSource(); - } else { - nodeInstance = relationshipInstance.getTarget(); - } - } - } - - // update input parameters for the operation call - if (message.getBody() instanceof HashMap) { - - @SuppressWarnings("unchecked") - HashMap inputParams = (HashMap) message.getBody(); - - inputParams = - ParameterHandler.updateInputParams(inputParams, csarID, nodeInstance, relationshipInstance, - neededInterface, neededOperation); - message.setBody(inputParams); - } else { - LOG.warn("There are no input parameters specified."); - } - - invokeIA(exchange, csarID, serviceTemplateInstanceID, typeID, nodeInstance, neededInterface, - neededOperation); - } else { - LOG.error("Unable to retrieve the NodeType/RelationshipType for NodeTemplate: {} and RelationshipTemplate: {}", - nodeTemplateID, relationship); - handleResponse(exchange); - } - } - - /** - * Searches the right IA for the given operation and invokes it with the given parameters. - * - * @param exchange exchange containing the input parameters of the operation - * @param csarID ID of the CSAR - * @param serviceTemplateInstanceID ID of the service instance - * @param typeID NodeType/RelationshipType that implements the operation - * @param nodeTemplateInstance NodeTemplateInstance for the deployment distribution decision - * @param neededInterface the interface of the searched operation - * @param neededOperation the searched operation - */ - private void invokeIA(final Exchange exchange, CSARID csarID, final Long serviceTemplateInstanceID, QName typeID, - NodeTemplateInstance nodeTemplateInstance, final String neededInterface, - final String neededOperation) { - - final Message message = exchange.getIn(); - - LOG.debug("NodeType/RelationshipType: {}", typeID); - - // check whether operation has output parameters - final boolean hasOutputParams = - ServiceHandler.toscaEngineService.hasOperationOfATypeSpecifiedOutputParams(csarID, typeID, neededInterface, - neededOperation); - message.setHeader(MBHeader.HASOUTPUTPARAMS_BOOLEAN.toString(), hasOutputParams); - - if (typeID.equals(Types.abstractOperatingSystemNodeType)) { - nodeTemplateInstance = MBUtils.getAbstractOSReplacementInstance(nodeTemplateInstance); - typeID = - ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(nodeTemplateInstance.getServiceTemplateInstance() - .getCsarId(), - nodeTemplateInstance.getServiceTemplateInstance() - .getTemplateId(), - nodeTemplateInstance.getTemplateId() - .getLocalPart()); - csarID = nodeTemplateInstance.getServiceTemplateInstance().getCsarId(); - } - - final List typeImplementationIDs = - ServiceHandler.toscaEngineService.getTypeImplementationsOfType(csarID, typeID); - LOG.debug("List of Node/RelationshipTypeImplementations: {}", typeImplementationIDs.toString()); - - - // Search for an IA that implements the right operation and which is deployable and - // invokable by available plug-ins - for (final QName typeImplementationID : typeImplementationIDs) { - LOG.debug("Looking for Implementation Artifacts in TypeImplementation: {}", - typeImplementationID.toString()); - - message.setHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), typeImplementationID); - - final List iaNames = - ServiceHandler.toscaEngineService.getImplementationArtifactNamesOfTypeImplementation(csarID, - typeImplementationID); - LOG.debug("List of Implementation Artifacts: {}", iaNames.toString()); - - for (final String iaName : iaNames) { - - // try to invoke the operation on the current IA - if (invokeIAOperation(exchange, csarID, serviceTemplateInstanceID, typeID, nodeTemplateInstance, - typeImplementationID, iaName, neededInterface, neededOperation)) { - // IA invocation successful. Terminate Management Bus. - return; - } - } - } - - LOG.warn("No invokable implementation artifact found that provides required interface/operation."); - handleResponse(exchange); - } - - /** - * Invokes the given operation on the given IA if it implements it. If the IA is not yet deployed, - * the deployment is performed before the invocation. - * - * @param exchange exchange containing the input parameters of the operation - * @param csarID ID of the CSAR - * @param serviceTemplateInstanceID ID of the service instance - * @param typeID NodeType/RelationshipType that implements the operation - * @param nodeTemplateInstance NodeTemplateInstance for the deployment distribution decision - * @param typeImplementationID NodeTypeImpl/RelationshipTypeImpl containing the IA - * @param iaName the name of the IA - * @param neededInterface the interface of the searched operation - * @param neededOperation the searched operation - * - * @return true if the IA implements the given operation and it was invoked successfully, - * false otherwise - */ - private boolean invokeIAOperation(Exchange exchange, final CSARID csarID, final Long serviceTemplateInstanceID, - final QName typeID, final NodeTemplateInstance nodeTemplateInstance, - final QName typeImplementationID, final String iaName, - final String neededInterface, final String neededOperation) { - - LOG.debug("Trying to invoke Implementation Artifact: {}", iaName); - - final Message message = exchange.getIn(); - - // host name of the container which triggered the IA invocation - final String triggeringContainer = Settings.OPENTOSCA_CONTAINER_HOSTNAME; - message.setHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), triggeringContainer); - - // check if requested interface/operation is provided - if (!isCorrectIA(csarID, typeID, typeImplementationID, iaName, neededOperation, neededInterface)) { - LOG.debug("Implementation Artifact does not provide the requested operation."); - return false; - } - - // get ArtifactTemplate and ArtifactType of the IA - final QName artifactTemplateID = - ServiceHandler.toscaEngineService.getArtifactTemplateOfAImplementationArtifactOfATypeImplementation(csarID, - typeImplementationID, - iaName); - LOG.debug("ArtifactTemplate: {}", artifactTemplateID.toString()); - - final String artifactType = - ServiceHandler.toscaEngineService.getArtifactTypeOfAImplementationArtifactOfATypeImplementation(csarID, - typeImplementationID, - iaName) - .toString(); - LOG.debug("ArtifactType: {}", artifactType); - - // retrieve deployment type for the IA - final String deploymentType = PluginHandler.hasSupportedDeploymentType(artifactType); - if (Objects.isNull(deploymentType)) { - LOG.debug("No deployment plug-in found which supports the deployment of ArtifactType {}", artifactType); - return false; - } - - // retrieve invocation type for the IA - final String invocationType = - PluginHandler.hasSupportedInvocationType(artifactType, csarID, artifactTemplateID); - if (Objects.isNull(invocationType)) { - LOG.debug("No invocation plug-in found which supports the invocation of ArtifactType {} and ArtifactTemplate {}", - artifactType, artifactTemplateID); - return false; - } - - LOG.debug("Deployment type {} and invocation type {} are supported.", deploymentType, invocationType); - - // retrieve portType property if specified - final QName portType = Util.getPortTypeQName(csarID, artifactTemplateID); - - // retrieve specific content for the IA if defined and add to the headers - exchange = addSpecificContent(exchange, csarID, typeImplementationID, iaName); - - // host name of the container where the IA has to be deployed - final String deploymentLocation = - DeploymentDistributionDecisionMaker.getDeploymentLocation(nodeTemplateInstance); - LOG.debug("Host name of responsible OpenTOSCA Container: {}", deploymentLocation); - - // set needed header fields for the invocation/deployment plug-ins - message.setHeader(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), deploymentLocation); - message.setHeader(MBHeader.PORTTYPE_QNAME.toString(), portType); - message.setHeader(MBHeader.INVOCATIONTYPE_STRING.toString(), invocationType); - message.setHeader(MBHeader.IMPLEMENTATIONARTIFACTNAME_STRING.toString(), iaName); - message.setHeader(MBHeader.ARTIFACTTEMPLATEID_QNAME.toString(), artifactTemplateID); - message.setHeader(MBHeader.ARTIFACTTYPEID_STRING.toString(), artifactType); - - // Prevent two threads from trying to deploy the same IA concurrently and avoid the deletion - // of an IA after successful checking that an IA is already deployed. - final String identifier = - getUniqueSynchronizationString(triggeringContainer, deploymentLocation, typeImplementationID, iaName, - serviceTemplateInstanceID.toString()); - synchronized (getLockForString(identifier)) { - - LOG.debug("Checking if IA was already deployed..."); - - // check whether there are already stored endpoints for this IA - URI endpointURI = null; - final List endpoints = - ServiceHandler.endpointService.getWSDLEndpointsForNTImplAndIAName(triggeringContainer, - deploymentLocation, - typeImplementationID, iaName); - - if (Objects.nonNull(endpoints) && !endpoints.isEmpty()) { - LOG.debug("IA is already deployed."); - - endpointURI = endpoints.get(0).getURI(); - - message.setHeader(MBHeader.ENDPOINT_URI.toString(), endpointURI); - - // store new endpoint for the IA - final WSDLEndpoint endpoint = - new WSDLEndpoint(endpointURI, portType, triggeringContainer, deploymentLocation, csarID, - serviceTemplateInstanceID, null, typeImplementationID, iaName, new HashMap()); - ServiceHandler.endpointService.storeWSDLEndpoint(endpoint); - - // Call IA, send response to caller and terminate bus - LOG.debug("Trying to invoke the operation on the deployed implementation artifact."); - handleResponse(PluginHandler.callMatchingInvocationPlugin(exchange, invocationType, - deploymentLocation)); - return true; - } else { - LOG.debug("IA not yet deployed. Trying to deploy..."); - - LOG.debug("Checking if all required features are met by the deployment plug-in or the environment."); - - final IManagementBusDeploymentPluginService deploymentPlugin = - ServiceHandler.deploymentPluginServices.get(deploymentType); - - // retrieve required features for the TypeImplementation - final List requiredFeatures = - ServiceHandler.toscaEngineService.getRequiredContainerFeaturesOfATypeImplementation(csarID, - typeImplementationID); - - // check whether all features are met and abort deployment otherwise - if (DeploymentPluginCapabilityChecker.capabilitiesAreMet(requiredFeatures, deploymentPlugin)) { - - // get all artifact references for this ArtifactTemplate - final List artifacts = - ServiceHandler.toscaEngineService.getArtifactsOfAArtifactTemplate(csarID, artifactTemplateID); - - // convert relative references to absolute references to enable access to the IA - // files from other OpenTOSCA Container nodes - LOG.debug("Searching for artifact references for this ArtifactTemplate..."); - final List artifactReferences = new ArrayList<>(); - for (final AbstractArtifact artifact : artifacts) { - // get base URL for the API to retrieve CSAR content - String absoluteArtifactReference = Settings.OPENTOSCA_CONTAINER_CONTENT_API; - - // replace placeholders with correct data for this reference - absoluteArtifactReference = absoluteArtifactReference.replace("{csarid}", csarID.getFileName()); - absoluteArtifactReference = - absoluteArtifactReference.replace("{artifactreference}", artifact.getArtifactReference()); - - artifactReferences.add(absoluteArtifactReference); - LOG.debug("Found reference: {} ", absoluteArtifactReference); - } - - if (!artifactReferences.isEmpty()) { - // add references list to header to enable access from the deployment - // plug-ins - message.setHeader(MBHeader.ARTIFACTREFERENCES_LISTSTRING.toString(), artifactReferences); - - // search ServiceEndpoint property for the artifact - final String serviceEndpoint = Util.getProperty(csarID, artifactTemplateID, "ServiceEndpoint"); - message.setHeader(MBHeader.ARTIFACTSERVICEENDPOINT_STRING.toString(), serviceEndpoint); - - if (Objects.nonNull(serviceEndpoint)) { - LOG.debug("ServiceEndpoint property: {}", serviceEndpoint); - } else { - LOG.debug("No ServiceEndpoint property defined!"); - } - - // invoke deployment - exchange = - PluginHandler.callMatchingDeploymentPlugin(exchange, deploymentType, deploymentLocation); - - endpointURI = message.getHeader(MBHeader.ENDPOINT_URI.toString(), URI.class); - - if (Objects.nonNull(endpointURI)) { - if (endpointURI.toString().contains(Constants.PLACEHOLDER_START) - && endpointURI.toString().contains(Constants.PLACEHOLDER_END)) { - - // If a placeholder is specified, the service is part of the - // topology. We do not store this endpoints as they are not part of - // the management environment. - LOG.debug("Received endpoint contains placeholders. Service is part of the topology and called without deployment."); - - endpointURI = replacePlaceholderWithInstanceData(endpointURI, nodeTemplateInstance); - - message.setHeader(MBHeader.ENDPOINT_URI.toString(), endpointURI); - } else { - LOG.debug("IA successfully deployed. Storing endpoint..."); - - // store new endpoint for the IA - final WSDLEndpoint endpoint = new WSDLEndpoint(endpointURI, portType, - triggeringContainer, deploymentLocation, csarID, serviceTemplateInstanceID, null, - typeImplementationID, iaName, new HashMap()); - ServiceHandler.endpointService.storeWSDLEndpoint(endpoint); - } - - LOG.debug("Endpoint: {}", endpointURI.toString()); - - // Call IA, send response to caller and terminate bus - LOG.debug("Trying to invoke the operation on the deployed implementation artifact."); - handleResponse(PluginHandler.callMatchingInvocationPlugin(exchange, invocationType, - deploymentLocation)); - return true; - } else { - LOG.debug("IA deployment failed."); - } - } else { - LOG.debug("No artifact references found. No deployment and invocation possible for this ArtifactTemplate."); - } - } else { - LOG.debug("Required features not completely satisfied by the plug-in."); - } - } - } - - // IA invocation was not successful - return false; - } - - @Override - public void invokePlan(Exchange exchange) { - - LOG.debug("Starting Management Bus: InvokePlan"); - - // log event to monitor the plan execution time - final PlanInstanceEvent event = new PlanInstanceEvent("INFO", "PLAN_DURATION_LOG", ""); - - final Message message = exchange.getIn(); - - String correlationID = message.getHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), String.class); - LOG.debug("Correlation ID: {}", correlationID); - - - final CSARID csarID = message.getHeader(MBHeader.CSARID.toString(), CSARID.class); - LOG.debug("CSARID: " + csarID.toString()); - - if (correlationID != null) { - - final URI serviceInstanceID = message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), URI.class); - LOG.debug("csarInstanceID: {}", serviceInstanceID); - - final QName serviceTemplateID = message.getHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), QName.class); - LOG.debug("serviceTemplateID: {}", serviceTemplateID); - - final QName planID = message.getHeader(MBHeader.PLANID_QNAME.toString(), QName.class); - LOG.debug("planID: {}", planID); - - // get the ServiceTemplateInstance ID Long from the serviceInstanceID URI - final Long serviceTemplateInstanceID = Util.determineServiceTemplateInstanceId(serviceInstanceID); - - // generate new unique correlation ID if no ID is passed - if (Objects.isNull(correlationID)) { - correlationID = PlanInstanceHandler.createCorrelationId(); - message.setHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), correlationID); - } - - // create the instance data for the plan instance to be started - PlanInstance plan = - PlanInstanceHandler.createPlanInstance(csarID, serviceTemplateID, serviceTemplateInstanceID, planID, - correlationID, message.getBody()); - - if (plan != null) { - LOG.debug("Plan ID: {}", plan.getTemplateId()); - LOG.debug("Plan language: {}", plan.getLanguage().toString()); - - LOG.debug("Getting endpoint for the plan..."); - ServiceHandler.endpointService.printPlanEndpoints(); - final WSDLEndpoint WSDLendpoint = - ServiceHandler.endpointService.getWSDLEndpointForPlanId(Settings.OPENTOSCA_CONTAINER_HOSTNAME, - csarID, plan.getTemplateId()); - - if (WSDLendpoint != null) { - - final URI endpoint = WSDLendpoint.getURI(); - LOG.debug("Endpoint for Plan {} : {} ", plan.getTemplateId(), endpoint); - - // Assumption. Should be checked with ToscaEngine - message.setHeader(MBHeader.HASOUTPUTPARAMS_BOOLEAN.toString(), true); - message.setHeader(MBHeader.ENDPOINT_URI.toString(), endpoint); - - if (plan.getLanguage().equals(PlanLanguage.BPMN)) { - exchange = PluginHandler.callMatchingInvocationPlugin(exchange, "REST", - Settings.OPENTOSCA_CONTAINER_HOSTNAME); - - } else { - exchange = PluginHandler.callMatchingInvocationPlugin(exchange, "SOAP/HTTP", - Settings.OPENTOSCA_CONTAINER_HOSTNAME); - } - - // write WCET back to Plan - final TPlan currentPlan = - ServiceHandler.toscaEngineService.getToscaReferenceMapper() - .getPlanForCSARIDAndPlanID(csarID, plan.getTemplateId()); - - // add end timestamp and log message with duration - event.setEndTimestamp(new Date()); - final long duration = event.getEndTimestamp().getTime() - event.getStartTimestamp().getTime(); - event.setMessage("Finished plan execution with correlation id " + correlationID + " after " - + duration + "ms"); - LOG.info("Plan execution duration: {}ms", duration); - - final SituationTriggerInstanceListener instanceListener = new SituationTriggerInstanceListener(); - final long calculatedWCET = instanceListener.calculateWCETForPlan(currentPlan); - // if total duration larger than calculatedWCET, use duration - if (calculatedWCET > 0 && calculatedWCET < duration) { - currentPlan.setCalculatedWCET(duration); - } - // if newly calculated WCET is larger than previous WCET, update - if (calculatedWCET > currentPlan.getCalculatedWCET()) { - currentPlan.setCalculatedWCET(calculatedWCET); - } - - // update plan in repository with new log event - final PlanInstanceRepository repo = new PlanInstanceRepository(); - plan = repo.findByCorrelationId(correlationID); - plan.addEvent(event); - repo.update(plan); - - - // Undeploy IAs for the related ServiceTemplateInstance if a termination plan - // was executed. - if (plan.getType().equals(PlanType.TERMINATION)) { - LOG.debug("Executed plan was a termination plan. Removing endpoints..."); - - final ServiceTemplateInstance serviceInstance = plan.getServiceTemplateInstance(); - - if (serviceInstance != null) { - deleteEndpointsForServiceInstance(csarID, serviceInstance); - } else { - LOG.warn("Unable to retrieve ServiceTemplateInstance related to the plan."); - } - } - - // update the output parameters in the plan instance - PlanInstanceHandler.updatePlanInstanceOutput(plan, csarID, message.getBody()); - - } else { - LOG.warn("No endpoint found for specified plan: {} of csar: {}. Invocation aborted!", - plan.getTemplateId(), csarID); - } - - } else { - LOG.warn("Unable to get plan for CorrelationID {}. Invocation aborted!", correlationID); - } - } - - handleResponse(exchange); - } - - - /** - * Checks if the defined IA provides the needed interface/operation. - * - * @param csarID of the IA to check - * @param typeID of NodeType or RelationshipType - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the IA - * @param implementationArtifactName of the implementation artifact to check - * @param neededOperation specifies the operation the implementation artifact should provide - * @param neededInterface specifies the interface the implementation artifact should provide - * - * @return true if the specified implementation artifact provides needed - * interface/operation. Otherwise false . - */ - private boolean isCorrectIA(final CSARID csarID, final QName typeID, final QName typeImplementationID, - final String implementationArtifactName, final String neededOperation, - final String neededInterface) { - - LOG.debug("Checking if IA: {} of TypeImpl: {} is the correct one.", implementationArtifactName, - typeImplementationID); - - // retrieve interface and operation names for the given IA - final String providedInterface = - ServiceHandler.toscaEngineService.getInterfaceOfAImplementationArtifactOfATypeImplementation(csarID, - typeImplementationID, - implementationArtifactName); - - final String providedOperation = - ServiceHandler.toscaEngineService.getOperationOfAImplementationArtifactOfATypeImplementation(csarID, - typeImplementationID, - implementationArtifactName); - - LOG.debug("Needed interface: {}. Provided interface: {}", neededInterface, providedInterface); - LOG.debug("Needed operation: {}. Provided operation: {}", neededOperation, providedOperation); - - // IA implements all operations of all interfaces defined in NodeType - if (providedInterface == null && providedOperation == null) { - LOG.debug("Correct IA found. IA: {} implements all operations of all interfaces defined in NodeType.", - implementationArtifactName); - return true; - } - - // IA implements all operations of one interface defined in NodeType - if (providedInterface != null && providedOperation == null && providedInterface.equals(neededInterface)) { - LOG.debug("Correct IA found. IA: {} implements all operations of one interface defined in NodeType.", - implementationArtifactName); - return true; - } - - // IA implements one operation of an interface defined in NodeType - if (providedInterface != null && providedOperation != null && providedInterface.equals(neededInterface) - && providedOperation.equals(neededOperation)) { - LOG.debug("Correct IA found. IA: {} implements one operation of an interface defined in NodeType.", - implementationArtifactName); - return true; - } - - // In this case - if there is no interface specified - the operation - // should be unique within the NodeType - if (neededInterface == null && neededOperation != null && providedInterface != null - && providedOperation == null) { - return ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, typeID, - providedInterface, - neededOperation); - } - - LOG.debug("ImplementationArtifact {} does not provide needed interface/operation", implementationArtifactName); - return false; - } - - /** - * Delete all endpoints for the given ServiceTemplateInstance from the EndpointService. In - * case an endpoint is the only one for a certain implementation artifact, it is undeployed too. - * - * @param csarID The CSAR to which the ServiceTemplateInstance belongs. - * @param serviceInstance The ServiceTemplateInstance for which the endpoints have to be removed. - */ - private void deleteEndpointsForServiceInstance(final CSARID csarID, final ServiceTemplateInstance serviceInstance) { - final Long instanceID = serviceInstance.getId(); - - LOG.debug("Deleting endpoints for ServiceTemplateInstance with ID: {}", instanceID); - - final List serviceEndpoints = - ServiceHandler.endpointService.getWSDLEndpointsForSTID(Settings.OPENTOSCA_CONTAINER_HOSTNAME, instanceID); - - LOG.debug("Found {} endpoints to delete...", serviceEndpoints.size()); - - for (final WSDLEndpoint serviceEndpoint : serviceEndpoints) { - - final String triggeringContainer = serviceEndpoint.getTriggeringContainer(); - final String deploymentLocation = serviceEndpoint.getManagingContainer(); - final QName typeImpl = serviceEndpoint.getTypeImplementation(); - final String iaName = serviceEndpoint.getIaName(); - - LOG.debug("Deleting endpoint: Triggering Container: {}; " - + "Managing Container: {}; NodeTypeImplementation: {}; IA name: {}", triggeringContainer, - deploymentLocation, typeImpl, iaName); - - final String identifier = getUniqueSynchronizationString(triggeringContainer, deploymentLocation, typeImpl, - iaName, instanceID.toString()); - - // synchronize deletion to avoid concurrency issues - synchronized (getLockForString(identifier)) { - - // get number of endpoints for the same IA - final int count = ServiceHandler.endpointService - .getWSDLEndpointsForNTImplAndIAName(triggeringContainer, - deploymentLocation, - typeImpl, iaName) - .size(); - - // only undeploy the IA if this is the only endpoint - if (count == 1) { - LOG.debug("Undeploying corresponding IA..."); - - final String artifactType = - ServiceHandler.toscaEngineService.getArtifactTypeOfAImplementationArtifactOfATypeImplementation(csarID, - typeImpl, - iaName) - .toString(); - - // create exchange for the undeployment plug-in invocation - Exchange exchange = new DefaultExchange(Activator.camelContext); - exchange.getIn().setHeader(MBHeader.ENDPOINT_URI.toString(), serviceEndpoint.getURI()); - - // get plug-in for the undeployment - IManagementBusDeploymentPluginService deploymentPlugin; - if (deploymentLocation.equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME)) { - LOG.debug("Undeployment is done locally."); - deploymentPlugin = ServiceHandler.deploymentPluginServices.get(artifactType); - } else { - LOG.debug("Undeployment is done on a remote Container."); - deploymentPlugin = ServiceHandler.deploymentPluginServices.get(Constants.REMOTE_TYPE); - - // add header fields that are needed for the undeployment on a - // remote OpenTOSCA Container - exchange.getIn().setHeader(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), deploymentLocation); - exchange.getIn().setHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), triggeringContainer); - exchange.getIn().setHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), typeImpl.toString()); - exchange.getIn().setHeader(MBHeader.IMPLEMENTATIONARTIFACTNAME_STRING.toString(), iaName); - exchange.getIn().setHeader(MBHeader.ARTIFACTTYPEID_STRING.toString(), artifactType); - } - - exchange = deploymentPlugin.invokeImplementationArtifactUndeployment(exchange); - - // print the undeployment result state - if (exchange.getIn().getHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), boolean.class)) { - LOG.debug("Undeployed IA successfully!"); - } else { - LOG.warn("Undeployment of IA failed!"); - } - } else { - LOG.debug("Found further endpoints for the IA. No undeployment!"); - } - - // delete the endpoint - ServiceHandler.endpointService.removeWSDLEndpoint(serviceEndpoint); - LOG.debug("Endpoint deleted."); - } - } - - LOG.debug("Endpoint deletion terminated."); - } - - /** - * Creates a unique String which identifies an IA on a certain OpenTOSCA Container node. The String - * can be used to synchronize the access to the management infrastructure (e.g. tomcat). - * - * @param triggeringContainer OpenTOSCA Container that triggered the deployment - * @param deploymentLocation OpenTOSCA Container where the IA is managed - * @param typeImpl QName of the NodeType/RelationshipType the IA belongs to - * @param iaName the name of the IA - * @return a unique String consisting of the given information or null if some needed - * information is missing - */ - public static String getUniqueSynchronizationString(final String triggeringContainer, - final String deploymentLocation, final QName typeImpl, - final String iaName, final String serviceInstanceId) { - - if (Objects.isNull(triggeringContainer) || Objects.isNull(deploymentLocation) || Objects.isNull(typeImpl) - || Objects.isNull(iaName) || Objects.isNull(serviceInstanceId)) { - return null; - } - - return Stream.of(triggeringContainer, deploymentLocation, typeImpl.toString(), iaName, serviceInstanceId) - .collect(Collectors.joining("/")); - } - - /** - * Returns an Object which can be used to synchronize all actions related to a certain String value. - * - * @param lockString - * @return the object which can be used for synchronization - */ - public static Object getLockForString(final String lockString) { - Objects.requireNonNull(lockString); - - Object lock = null; - synchronized (locks) { - lock = locks.get(lockString); - - if (lock == null) { - lock = new Object(); - locks.put(lockString, lock); - } - return lock; - } - } - - /** - * Add the specific content of the ImplementationArtifact to the Exchange headers if defined. - */ - private Exchange addSpecificContent(final Exchange exchange, final CSARID csarID, final QName typeImplementationID, - final String implementationArtifactName) { - final Document specificContent = - ServiceHandler.toscaEngineService.getArtifactSpecificContentOfAImplementationArtifact(csarID, - typeImplementationID, - implementationArtifactName); - if (specificContent != null) { - LOG.debug("ArtifactSpecificContent specified!"); - exchange.getIn().setHeader(MBHeader.SPECIFICCONTENT_DOCUMENT.toString(), specificContent); - } - return exchange; - } - - /** - * Checks if a certain property was specified in the Tosca.xml of the ArtifactTemplate and returns - * it if so. - * - * @param csarID the ID of the CSAR which contains the ArtifactTemplate - * @param artifactTemplateID the ID of the ArtifactTemplate - * @param propertyName the name of the property - * @return the property value if specified, null otherwise - */ - private String getProperty(final CSARID csarID, final QName artifactTemplateID, final String propertyName) { - final Document properties = - ServiceHandler.toscaEngineService.getPropertiesOfAArtifactTemplate(csarID, artifactTemplateID); - - // check if there are specified properties at all - if (properties != null) { - - final NodeList list = properties.getFirstChild().getChildNodes(); - - // iterate through properties and check name - for (int i = 0; i < list.getLength(); i++) { - - final Node propNode = list.item(i); - - final String localName = propNode.getLocalName(); - - if (localName != null && localName.equals(propertyName)) { - return propNode.getTextContent().trim(); - } - } - } - - return null; - } - - /** - * Checks if a PortType property was specified in the Tosca.xml of the ArtifactTemplate and returns - * it if so. - * - * @param csarID the ID of the CSAR which contains the ArtifactTemplate - * @param artifactTemplateID the ID of the ArtifactTemplate - * @return the PortType property value as QName if specified, null otherwise - */ - private QName getPortTypeQName(final CSARID csarID, final QName artifactTemplateID) { - QName portType = null; - try { - portType = QName.valueOf(getProperty(csarID, artifactTemplateID, "PortType")); - LOG.debug("PortType property: {}", portType.toString()); - return portType; - } - catch (final IllegalArgumentException e) { - LOG.warn("PortType property can not be parsed to QName."); - } - return null; - } - - /** - * Replaces placeholder with a matching instance data value. Placeholder is defined like - * "/PLACEHOLDER_VMIP_IP_PLACEHOLDER/" - * - * @param endpoint the endpoint URI containing the placeholder - * @param nodeTemplateInstance the NodeTemplateInstance where the endpoint belongs to - * @return the endpoint URI with replaced placeholder if matching instance data was found, the - * unchanged endpoint URI otherwise - */ - private URI replacePlaceholderWithInstanceData(URI endpoint, final NodeTemplateInstance nodeTemplateInstance) { - - if (nodeTemplateInstance != null) { - final String placeholder = - endpoint.toString().substring(endpoint.toString().lastIndexOf(Constants.PLACEHOLDER_START), - endpoint.toString().lastIndexOf(Constants.PLACEHOLDER_END) - + Constants.PLACEHOLDER_END.length()); - - LOG.debug("Placeholder: {} detected in Endpoint: {}", placeholder, endpoint.toString()); - - final String[] placeholderProperties = - placeholder.replace(Constants.PLACEHOLDER_START, "").replace(Constants.PLACEHOLDER_END, "").split("_"); - - String propertyValue = null; - - for (final String placeholderProperty : placeholderProperties) { - LOG.debug("Searching instance data value for property {} ...", placeholderProperty); - - propertyValue = MBUtils.searchProperty(nodeTemplateInstance, placeholderProperty); - - if (propertyValue != null) { - LOG.debug("Value for property {} found: {}.", placeholderProperty, propertyValue); - - try { - endpoint = new URI(endpoint.toString().replace(placeholder, propertyValue)); - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - - break; - } else { - LOG.warn("Value for property {} not found.", placeholderProperty); - } - } - } else { - LOG.warn("NodeTemplateInstance is null. Unable to replace placeholders!"); - } - - return endpoint; - } - - /** - * Handles the response from the plug-in. If needed the response is sent back to the API. - * - * - * @param exchange to handle. - */ - private void handleResponse(Exchange exchange) { - - if (exchange != null) { - - // Response message back to caller. - final ProducerTemplate template = Activator.camelContext.createProducerTemplate(); - - final String caller = exchange.getIn().getHeader(MBHeader.APIID_STRING.toString(), String.class); - - if (caller != null) { - - LOG.debug("Sending response message back to api: {}", caller); - - exchange = template.send("direct-vm:" + caller, exchange); - - if (exchange.isFailed()) { - LOG.error("Sending exchange message failed! {}", exchange.getException().getMessage()); - } - } else { - LOG.debug("Invocation was InOnly. No response message will be sent to the caller."); - } - } - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/DeploymentDistributionDecisionMaker.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/DeploymentDistributionDecisionMaker.java deleted file mode 100644 index e597a6fc3..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/DeploymentDistributionDecisionMaker.java +++ /dev/null @@ -1,353 +0,0 @@ -package org.opentosca.bus.management.service.impl.collaboration; - -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.apache.camel.Exchange; -import org.apache.camel.impl.DefaultMessage; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.bus.management.service.impl.collaboration.model.BodyType; -import org.opentosca.bus.management.service.impl.collaboration.model.CollaborationMessage; -import org.opentosca.bus.management.service.impl.collaboration.model.InstanceDataMatchingRequest; -import org.opentosca.bus.management.service.impl.collaboration.model.KeyValueMap; -import org.opentosca.bus.management.service.impl.collaboration.model.KeyValueType; -import org.opentosca.bus.management.service.impl.collaboration.model.RemoteOperations; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstanceState; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.model.PlanInstanceState; -import org.opentosca.container.core.next.model.PlanType; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; -import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; -import org.opentosca.container.core.tosca.convention.Types; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class determines on which OpenTOSCA Container instance an Implementation Artifact for a - * certain service instance has to be deployed. It returns the host name of this Container instance - * which can then be used by the deployment and invocation plug-ins to perform operations with the - * Implementation Artifact.
- *
- * - * To determine the responsible OpenTOSCA Container, a matching with the instance data of the - * different available Containers is performed. Therefore, the infrastructure NodeTemplateInstance - * of the topology stack of the IA is retrieved. Afterwards the matching of this - * NodeTemplateInstance with the instance data of the local OpenTOSCA Container is done. If this is - * not successful, a matching request is distributed to other Containers via MQTT. In case there is - * also no match, the local Container is used as default deployment location.
- *
- * - * {@link Settings#OPENTOSCA_COLLABORATION_MODE} and the respective config.ini entry can be used to - * control the matching. If the property is true, matching is performed. If it is set to - * false, all IA deployments will be performed locally. Therefore, the performance can be - * increased by disabling this setting if distributed IA deployment is not needed.
- *
- * - * Copyright 2018 IAAS University of Stuttgart - */ -public class DeploymentDistributionDecisionMaker { - - private final static Logger LOG = LoggerFactory.getLogger(DeploymentDistributionDecisionMaker.class); - - // repository to access instance data via NodeTemplate identifiers - private final static NodeTemplateInstanceRepository nodeTemplateInstanceRepository = - new NodeTemplateInstanceRepository(); - - /** - * Get the deployment location for IAs which are attached to the NodeTemplateInstance. If the - * collaboration mode is turned on, this method performs an instance data matching to determine - * the deployment location. Therefore, the infrastructure NodeTemplateInstance is searched in - * the topology. Afterwards, its type and properties are matched against local and remote - * instance data to get the correct deployment location for the IAs. If the matching is not - * successful, the local OpenTOSCA Container is returned as default deployment location. - * - * @param nodeTemplateInstance the NodeTemplateInstance for which the IAs have to be deployed - * @return the location where the IAs should be deployed - */ - public static String getDeploymentLocation(final NodeTemplateInstance nodeTemplateInstance) { - - if (Objects.isNull(nodeTemplateInstance)) { - LOG.error("NodeTemplateInstance object is null. Using local deployment."); - return Settings.OPENTOSCA_CONTAINER_HOSTNAME; - } - - if (!Boolean.parseBoolean(Settings.OPENTOSCA_COLLABORATION_MODE)) { - // only perform matching if collaboration mode is turned on - LOG.debug("Distributed IA deployment disabled. Using local deployment."); - return Settings.OPENTOSCA_CONTAINER_HOSTNAME; - } - - LOG.debug("Deployment distribution decision for IAs from NodeTemplateInstance with ID: {}", - nodeTemplateInstance.getId()); - - // check if decision is already made for this instance - if (Objects.nonNull(nodeTemplateInstance.getManagingContainer())) { - LOG.debug("ManagingContainer attribute is already set for this NodeTemplateInstance: {}", - nodeTemplateInstance.getManagingContainer()); - return nodeTemplateInstance.getManagingContainer(); - } - - // get infrastructure NodeTemplate - LOG.debug("Looking for infrastructure NodeTemplateInstance that corresponds to this NodeTemplateInstance..."); - final NodeTemplateInstance infrastructureNodeTemplateInstance = searchInfrastructureNode(nodeTemplateInstance); - - // check if "managingContainer" is already set for the infrastructure NodeTemplateInstance - if (Objects.nonNull(infrastructureNodeTemplateInstance.getManagingContainer())) { - - // no instance data matching needed, as it was already performed for the - // infrastructure NodeTemplateInstance - final String managingContainer = infrastructureNodeTemplateInstance.getManagingContainer(); - - LOG.debug("Infrastructure NodeTemplateInstance has set managingContainer attribute."); - LOG.debug("Result of deployment distribution decision: {}", managingContainer); - - // current NodeTemplateInstance is managed by the same Container as the - // infrastructure instance - nodeTemplateInstance.setManagingContainer(managingContainer); - nodeTemplateInstanceRepository.update(nodeTemplateInstance); - return managingContainer; - } - - // instance data matching has to be performed for the NodeTemplateInstance - LOG.debug("Infrastructure NodeTemplateInstance has ID: {}", infrastructureNodeTemplateInstance.getId()); - - // retrieve type and properties for the matching - final QName infrastructureNodeType = infrastructureNodeTemplateInstance.getTemplateType(); - final Map infrastructureProperties = infrastructureNodeTemplateInstance.getPropertiesAsMap(); - - LOG.debug("Infrastructure NodeTemplateInstance has NodeType: {}", infrastructureNodeType); - LOG.debug("Infrastructure NodeTemplateInstance has properties:"); - infrastructureProperties.entrySet().stream() - .forEach(entry -> LOG.debug("Key: {}; Value: {}", entry.getKey(), entry.getValue())); - - // match NodeType and properties against local instance data - LOG.debug("Performing local instance data matching..."); - String deploymentLocation = performInstanceDataMatching(infrastructureNodeType, infrastructureProperties); - if (Objects.nonNull(deploymentLocation)) { - LOG.debug("Found matching local instance data. Deployment will be done at: {}", deploymentLocation); - - // set property to speed up future matching - infrastructureNodeTemplateInstance.setManagingContainer(deploymentLocation); - nodeTemplateInstance.setManagingContainer(deploymentLocation); - - // update stored entities - nodeTemplateInstanceRepository.update(nodeTemplateInstance); - nodeTemplateInstanceRepository.update(infrastructureNodeTemplateInstance); - - return deploymentLocation; - } - - // match against instance data at remote OpenTOSCA Containers - LOG.debug("Local instance data matching had no success. Performing matching with remote instance data..."); - deploymentLocation = performRemoteInstanceDataMatching(infrastructureNodeType, infrastructureProperties); - if (Objects.nonNull(deploymentLocation)) { - LOG.debug("Found matching remote instance data. Deployment will be done on OpenTOSCA Container with host name: {}", - deploymentLocation); - - // set property to speed up future matching - infrastructureNodeTemplateInstance.setManagingContainer(deploymentLocation); - nodeTemplateInstance.setManagingContainer(deploymentLocation); - - // update stored entities - nodeTemplateInstanceRepository.update(nodeTemplateInstance); - nodeTemplateInstanceRepository.update(infrastructureNodeTemplateInstance); - - return deploymentLocation; - } - - // default (no matching): return host name of local container - LOG.debug("Remote instance data matching had no success. Returning local host name as default deployment location."); - nodeTemplateInstance.setManagingContainer(Settings.OPENTOSCA_CONTAINER_HOSTNAME); - nodeTemplateInstanceRepository.update(nodeTemplateInstance); - return Settings.OPENTOSCA_CONTAINER_HOSTNAME; - } - - /** - * Search for the infrastructure NodeTemplateInstance on which the given NodeTemplateInstance is - * hosted/deployed/based. In the context of instance data matching the infrastructure Node - * should always be the Node at the bottom of a stack in the topology. If an OpenTOSCA Container - * manages this bottom Node, it can be used to deploy all IAs attached to Nodes that are above - * the infrastructure Node in the topology. - * - * @param nodeTemplateInstance the NodeTemplateInstance for which the infrastructure is searched - * @return the infrastructure NodeTemplateInstance - */ - private static NodeTemplateInstance searchInfrastructureNode(final NodeTemplateInstance nodeTemplateInstance) { - LOG.debug("Looking for infrastructure NodeTemplate at NodeTemplate {} and below...", - nodeTemplateInstance.getTemplateId()); - - final Collection outgoingRelationships = - nodeTemplateInstance.getOutgoingRelations(); - - // terminate search if bottom NodeTemplate is found - if (outgoingRelationships.isEmpty()) { - LOG.debug("NodeTemplate {} is the infrastructure NodeTemplate", nodeTemplateInstance.getTemplateId()); - return nodeTemplateInstance; - } - - LOG.debug("NodeTemplate {} has outgoing RelationshipTemplates...", nodeTemplateInstance.getTemplateId()); - - for (final RelationshipTemplateInstance relation : outgoingRelationships) { - final QName relationType = relation.getTemplateType(); - LOG.debug("Found outgoing RelationshipTemplate of type: {}", relationType); - - // traverse topology stack downwards - if (isInfrastructureRelationshipType(relationType)) { - LOG.debug("Continue search with the target of the RelationshipTemplate..."); - return searchInfrastructureNode(relation.getTarget()); - } else { - LOG.debug("RelationshipType is not valid for infrastructure search (e.g. hostedOn)."); - } - } - - // if all outgoing relationships are not of the searched types, the NodeTemplate is the - // bottom one - return nodeTemplateInstance; - } - - /** - * Match the given NodeType and properties against instance data from the local repository. The - * matching is successful if a NodeTemplateInstance with the same NodeType and the same values - * for the properties is found in the instance data. - * - * @param infrastructureNodeType the NodeType of the NodeTemplate which has to be matched - * @param infrastructureProperties the set of properties of the NodeTemplate which has to be - * matched - * @return the deployment location if a matching NodeTemplateInstance is found, null - * otherwise. - */ - protected static String performInstanceDataMatching(final QName infrastructureNodeType, - final Map infrastructureProperties) { - - Objects.requireNonNull(infrastructureNodeType, - "QName for NodeType of infrastructure node must not be null for instance data matching"); - - // get the infrastructure properties without 'state' property for comparison - final Set> infrastructureEntrySet = getEntrySetWithoutState(infrastructureProperties); - - // search NodeTemplateInstance with matching NodeType and Properties which is already - // provisioned completely - final NodeTemplateInstance matchingInstance = - nodeTemplateInstanceRepository.findByTemplateType(infrastructureNodeType).stream() - .filter(instance -> instance.getServiceTemplateInstance().getState() - .equals(ServiceTemplateInstanceState.CREATED)) - .filter(instance -> instance.getState() - .equals(NodeTemplateInstanceState.STARTED)) - .filter(instance -> isBuildPlanFinished(instance)) - .filter(instance -> getEntrySetWithoutState(instance.getPropertiesAsMap()).equals(infrastructureEntrySet)) - .findFirst().orElse(null); - - if (Objects.nonNull(matchingInstance)) { - // check whether the matching NodeTemplateInstance is managed by this Container - if (Objects.isNull(matchingInstance.getManagingContainer())) { - // If no Container is set and the build plan is finished, this means that there - // was no IA invocation in the build plan and therefore also no remote - // deployment which means it is managed locally. - return Settings.OPENTOSCA_CONTAINER_HOSTNAME; - } else { - return matchingInstance.getManagingContainer(); - } - } - - // no matching found - return null; - } - - /** - * Match the given NodeType and properties against instance data from remote OpenTOSCA - * Containers. The matching is successful if a NodeTemplateInstance with the same NodeType and - * the same values for the properties is found in their instance data. The method sends a - * request via MQTT to all subscribed OpenTOSCA Containers. Afterwards, it waits for a reply - * which contains the host name of the OpenTOSCA Container that found matching instance data. If - * it receives a reply in time, it returns the host name. Otherwise, it returns null. - * - * @param infrastructureNodeType the NodeType of the NodeTemplate which has to be matched - * @param infrastructureProperties the set of properties of the NodeTemplate which has to be - * matched - * @return the host name of the OpenTOSCA Container which found a matching NodeTemplateInstance - * if one is found, null otherwise. - */ - private static String performRemoteInstanceDataMatching(final QName infrastructureNodeType, - final Map infrastructureProperties) { - - LOG.debug("Creating collaboration message for remote instance data matching..."); - - // transform infrastructureProperties for the message body - final KeyValueMap properties = new KeyValueMap(); - final List propertyList = properties.getKeyValuePair(); - infrastructureProperties.entrySet().forEach((entry) -> propertyList.add(new KeyValueType(entry.getKey(), - entry.getValue()))); - - // create collaboration message - final BodyType content = new BodyType(new InstanceDataMatchingRequest(infrastructureNodeType, properties)); - final CollaborationMessage collaborationMessage = new CollaborationMessage(new KeyValueMap(), content); - - // perform remote instance data matching and wait 10s for a response - final Exchange response = RequestSender.sendRequestToRemoteContainer(new DefaultMessage(), - RemoteOperations.INVOKE_INSTANCE_DATA_MATCHING, - collaborationMessage, 10000); - - if (Objects.nonNull(response)) { - LOG.debug("Received a response in time."); - - // read the deployment location from the reply - return response.getIn().getHeader(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), String.class); - } else { - LOG.debug("No response received within the timeout interval."); - return null; - } - } - - /** - * Filter out the 'State' property from the given properties Map if it is defined and return the - * corresponding entry Set. - * - * @param properties the properties as Map - * @return the properties as entry Set without 'State' property - */ - private static Set> getEntrySetWithoutState(final Map properties) { - return properties.entrySet().stream().filter((entry) -> !entry.getKey().equals("State")) - .collect(Collectors.toSet()); - } - - /** - * Check whether the build plan that corresponds to the given NodeTemplateInstance is finished. - * - * @param nodeTemplateInstance the NodeTemplateInstance for which the build plan is checked - * @return true if the build plan is found and terminated, false otherwise - */ - private static boolean isBuildPlanFinished(final NodeTemplateInstance nodeTemplateInstance) { - if (Objects.isNull(nodeTemplateInstance)) { - return false; - } - - final PlanInstance buildPlan = - nodeTemplateInstance.getServiceTemplateInstance().getPlanInstances().stream() - .filter((plan) -> plan.getType().equals(PlanType.BUILD)).findFirst().orElse(null); - - return Objects.nonNull(buildPlan) && buildPlan.getState().equals(PlanInstanceState.FINISHED); - } - - /** - * Check whether a given Relationship Type is used to connect parts of a topology stack - * (infrastructure type) or different topology stacks. - * - * @param relationType The Relationship Type to check - * @return true if the Relationship Type is hostedOn, deployedOn or dependsOn and - * false otherwise - */ - private static boolean isInfrastructureRelationshipType(final QName relationType) { - return relationType.equals(Types.hostedOnRelationType) || relationType.equals(Types.deployedOnRelationType) - || relationType.equals(Types.dependsOnRelationType); - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/RequestReceiver.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/RequestReceiver.java deleted file mode 100644 index 9e37d4c52..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/RequestReceiver.java +++ /dev/null @@ -1,555 +0,0 @@ -package org.opentosca.bus.management.service.impl.collaboration; - -import java.net.URI; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.apache.commons.lang3.StringUtils; -import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; -import org.opentosca.bus.management.service.impl.Activator; -import org.opentosca.bus.management.service.impl.ManagementBusServiceImpl; -import org.opentosca.bus.management.service.impl.collaboration.model.BodyType; -import org.opentosca.bus.management.service.impl.collaboration.model.CollaborationMessage; -import org.opentosca.bus.management.service.impl.collaboration.model.Doc; -import org.opentosca.bus.management.service.impl.collaboration.model.IAInvocationRequest; -import org.opentosca.bus.management.service.impl.collaboration.model.InstanceDataMatchingRequest; -import org.opentosca.bus.management.service.impl.collaboration.model.KeyValueMap; -import org.opentosca.bus.management.service.impl.collaboration.model.KeyValueType; -import org.opentosca.bus.management.service.impl.collaboration.route.ReceiveRequestRoute; -import org.opentosca.bus.management.service.impl.servicehandler.ServiceHandler; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * This class provides methods which can be invoked by remote OpenTOSCA Containers. The methods are - * consumer endpoints of the collaboration request route ({@link ReceiveRequestRoute}).
- *
- * - * Copyright 2018 IAAS University of Stuttgart - */ -public class RequestReceiver { - - private final static Logger LOG = LoggerFactory.getLogger(RequestReceiver.class); - - /** - * Perform instance data matching with the transferred NodeType and properties and the instance - * data of the local OpenTOSCA Container. NodeType and properties have to be passed as part of - * the {@link CollaborationMessage} in the message body of the exchange. The method sends a - * reply to the topic specified in the headers of the incoming exchange if the matching is - * successful and adds the deployment location as header to the outgoing exchange. Otherwise no - * response is send. - * - * @param exchange the exchange containing the needed information as headers and body - */ - public void invokeInstanceDataMatching(final Exchange exchange) { - - LOG.debug("Received remote operation call for instance data matching."); - final Message message = exchange.getIn(); - - // check whether the request contains the needed header fields to send a response - final Map headers = getResponseHeaders(message); - if (Objects.isNull(headers)) { - LOG.error("Request does not contain all needed header fields to send a response. Aborting operation!"); - return; - } - - if (!(message.getBody() instanceof CollaborationMessage)) { - LOG.error("Message body has invalid class: {}. Aborting operation!", message.getBody().getClass()); - return; - } - - final CollaborationMessage collMsg = (CollaborationMessage) message.getBody(); - final BodyType body = collMsg.getBody(); - - if (Objects.isNull(body)) { - LOG.error("Collaboration message contains no body. Aborting operation!"); - return; - } - - final InstanceDataMatchingRequest request = body.getInstanceDataMatchingRequest(); - - if (Objects.isNull(request)) { - LOG.error("Body contains no InstanceDataMatchingRequest. Aborting operation!"); - return; - } - - LOG.debug("InstanceDataMatchingRequest contained in incoming message. Processing it..."); - - // get NodeType and properties from the request - final QName nodeType = request.getNodeType(); - final Map properties = new HashMap<>(); - for (final KeyValueType property : request.getProperties().getKeyValuePair()) { - properties.put(property.getKey(), property.getValue()); - } - - LOG.debug("Performing matching with NodeType: {} and properties: {}", nodeType, properties.toString()); - - // perform instance data matching - final String deploymentLocation = - DeploymentDistributionDecisionMaker.performInstanceDataMatching(nodeType, properties); - if (deploymentLocation != null) { - LOG.debug("Instance data matching was successful. Sending response to requestor..."); - LOG.debug("Broker: {} Topic: {} Correlation: {}", - headers.get(MBHeader.MQTTBROKERHOSTNAME_STRING.toString()), - headers.get(MBHeader.MQTTTOPIC_STRING.toString()), - headers.get(MBHeader.CORRELATIONID_STRING.toString())); - - // add the deployment location as operation result to the headers - headers.put(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), deploymentLocation); - - // create empty reply message and transmit it with the headers - final CollaborationMessage replyBody = new CollaborationMessage(new KeyValueMap(), null); - Activator.producer.sendBodyAndHeaders("direct:SendMQTT", replyBody, headers); - } else { - // if matching is not successful, no response is needed - LOG.debug("Instance data matching was not successful."); - } - } - - /** - * Deploy the IA that is specified in the incoming exchange by using the Management Bus - * deployment Plug-ins. - * - * @param exchange the exchange containing the needed information as header fields - */ - public void invokeIADeployment(Exchange exchange) { - - LOG.debug("Received remote operation call for IA deployment."); - final Message message = exchange.getIn(); - - if (!isDestinationLocal(message)) { - LOG.debug("Request is directed to another OpenTOSCA Container. Ignoring request!"); - return; - } - - // check whether the request contains the needed header fields to send a response - final Map headers = getResponseHeaders(message); - if (Objects.isNull(headers)) { - LOG.error("Request does not contain all needed header fields to send a response. Aborting operation!"); - return; - } - - // create IA unique String from given message - final String identifier = getUniqueSynchronizationString(message); - if (Objects.isNull(identifier)) { - LOG.error("Request does not contain all needed header fields to deploy the IA. Aborting operation!"); - return; - } - - // URI of the deployed IA - URI endpointURI = null; - - // retrieve needed data from the headers - final String triggeringContainer = - message.getHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), String.class); - final String deploymentLocation = Settings.OPENTOSCA_CONTAINER_HOSTNAME; - final QName typeImplementationID = - message.getHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), QName.class); - final String implementationArtifactName = - message.getHeader(MBHeader.IMPLEMENTATIONARTIFACTNAME_STRING.toString(), String.class); - final URI serviceInstanceID = message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), URI.class); - final CSARID csarID = message.getHeader(MBHeader.CSARID.toString(), CSARID.class); - final QName portType = message.getHeader(MBHeader.PORTTYPE_QNAME.toString(), QName.class); - final String artifactType = message.getHeader(MBHeader.ARTIFACTTYPEID_STRING.toString(), String.class); - final Long serviceTemplateInstanceID = - Long.parseLong(StringUtils.substringAfterLast(serviceInstanceID.toString(), "/")); - - logInformation(triggeringContainer, deploymentLocation, typeImplementationID, implementationArtifactName, - csarID, portType, artifactType, serviceTemplateInstanceID); - - // Prevent two threads from trying to deploy the same IA concurrently and avoid the deletion - // of an IA after successful checking that an IA is already deployed. - synchronized (ManagementBusServiceImpl.getLockForString(identifier)) { - - LOG.debug("Got lock for operations on the given IA. Checking if IA is already deployed..."); - - final List endpoints = - ServiceHandler.endpointService.getWSDLEndpointsForNTImplAndIAName(triggeringContainer, - deploymentLocation, - typeImplementationID, - implementationArtifactName); - - if (endpoints != null && endpoints.size() > 0) { - - // This case should not happen, as the 'master' Container sends only one deployment - // request per IA and intercepts all other deployment actions if there is already an - // endpoint. - endpointURI = endpoints.get(0).getURI(); - - LOG.warn("IA is already deployed. Storing only one endpoint at the remote side. Endpoint URI: {}", - endpointURI); - } else { - LOG.debug("IA not yet deployed. Trying to deploy..."); - - final IManagementBusDeploymentPluginService deploymentPlugin = - ServiceHandler.deploymentPluginServices.get(artifactType); - - if (deploymentPlugin != null) { - LOG.debug("Deployment plug-in: {}. Deploying IA...", deploymentPlugin.toString()); - - // execute deployment via corresponding plug-in - exchange = deploymentPlugin.invokeImplementationArtifactDeployment(exchange); - endpointURI = exchange.getIn().getHeader(MBHeader.ENDPOINT_URI.toString(), URI.class); - - // store new endpoint for the IA - final WSDLEndpoint endpoint = - new WSDLEndpoint(endpointURI, portType, triggeringContainer, deploymentLocation, csarID, - serviceTemplateInstanceID, null, typeImplementationID, implementationArtifactName, new HashMap()); - ServiceHandler.endpointService.storeWSDLEndpoint(endpoint); - } else { - LOG.error("No matching deployment plug-in found. Aborting deployment!"); - } - } - } - - LOG.debug("Sending response message containing endpoint URI: {}", endpointURI); - - // add the endpoint URI as operation result to the headers - headers.put(MBHeader.ENDPOINT_URI.toString(), endpointURI); - - // create empty reply message and transmit it with the headers - final CollaborationMessage replyBody = new CollaborationMessage(new KeyValueMap(), null); - Activator.producer.sendBodyAndHeaders("direct:SendMQTT", replyBody, headers); - } - - /** - * Undeploy the IA that is specified in the incoming exchange by using the Management Bus - * deployment Plug-ins. - * - * @param exchange the exchange containing the needed information as header fields - */ - public void invokeIAUndeployment(Exchange exchange) { - - LOG.debug("Received remote operation call for IA undeployment."); - final Message message = exchange.getIn(); - - if (!isDestinationLocal(message)) { - LOG.debug("Request is directed to another OpenTOSCA Container. Ignoring request!"); - return; - } - - // check whether the request contains the needed header fields to send a response - final Map headers = getResponseHeaders(message); - if (Objects.isNull(headers)) { - LOG.error("Request does not contain all needed header fields to send a response. Aborting operation!"); - return; - } - - // create IA unique String from given message - final String identifier = getUniqueSynchronizationString(message); - if (Objects.isNull(identifier)) { - LOG.error("Request does not contain all needed header fields to deploy the IA. Aborting operation!"); - return; - } - - boolean undeploymentState = false; - - // retrieve needed data from the headers - final String triggeringContainer = - message.getHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), String.class); - final String deploymentLocation = Settings.OPENTOSCA_CONTAINER_HOSTNAME; - final QName typeImplementationID = - message.getHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), QName.class); - final String implementationArtifactName = - message.getHeader(MBHeader.IMPLEMENTATIONARTIFACTNAME_STRING.toString(), String.class); - final String artifactType = message.getHeader(MBHeader.ARTIFACTTYPEID_STRING.toString(), String.class); - - LOG.debug("Undeployment of IA: Triggering Container: {}, Deployment location: {}, NodeTypeImplementation ID: {}, IA name: {}, Type: {}", - triggeringContainer, deploymentLocation, typeImplementationID, implementationArtifactName, - artifactType); - - // Prevent two threads from trying to deploy the same IA concurrently and avoid the deletion - // of an IA after successful checking that an IA is already deployed. - synchronized (ManagementBusServiceImpl.getLockForString(identifier)) { - - LOG.debug("Got lock for operations on the given IA. Getting endpoints fot the IA..."); - - // get all endpoints for the given parameters - final List endpoints = - ServiceHandler.endpointService.getWSDLEndpointsForNTImplAndIAName(triggeringContainer, - deploymentLocation, - typeImplementationID, - implementationArtifactName); - - if (endpoints != null && endpoints.size() > 0) { - - // only one endpoint is stored for remote IAs - final WSDLEndpoint endpoint = endpoints.get(0); - ServiceHandler.endpointService.removeWSDLEndpoint(endpoint); - - final IManagementBusDeploymentPluginService deploymentPlugin = - ServiceHandler.deploymentPluginServices.get(artifactType); - - if (deploymentPlugin != null) { - - LOG.debug("Undeploying IA..."); - - exchange = deploymentPlugin.invokeImplementationArtifactUndeployment(exchange); - undeploymentState = - exchange.getIn().getHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), boolean.class); - } else { - LOG.error("No matching plug-in found. Aborting deployment!"); - } - } else { - LOG.error("No enpoint found for this IA. Undeployment not possible!"); - } - } - - LOG.debug("Sending response message containing undeployment state: {}", undeploymentState); - - // add the undeployment state as operation result to the headers - headers.put(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), undeploymentState); - - // create empty reply message and transmit it with the headers - final CollaborationMessage replyBody = new CollaborationMessage(new KeyValueMap(), null); - Activator.producer.sendBodyAndHeaders("direct:SendMQTT", replyBody, headers); - } - - /** - * Invoke an IA which is managed by this OpenTOSCA Container based on the request of another - * Container. The request contains all needed input parameters and the endpoint of the invoked - * IA. - * - * @param exchange the exchange containing the needed information as headers and body - */ - public void invokeIAOperation(final Exchange exchange) { - - LOG.debug("Received remote operation call for invocation of an IA operation."); - final Message message = exchange.getIn(); - - if (!isDestinationLocal(message)) { - LOG.debug("Request is directed to another OpenTOSCA Container. Ignoring request!"); - return; - } - - // check whether the request contains the needed header fields to send a response - final Map headers = getResponseHeaders(message); - if (Objects.isNull(headers)) { - LOG.error("Request does not contain all needed header fields to send a response. Aborting operation!"); - return; - } - - if (!(message.getBody() instanceof CollaborationMessage)) { - LOG.error("Message body has invalid class: {}. Aborting operation!", message.getBody().getClass()); - return; - } - - final CollaborationMessage collMsg = (CollaborationMessage) message.getBody(); - final BodyType body = collMsg.getBody(); - - if (Objects.isNull(body)) { - LOG.error("Collaboration message contains no body. Aborting operation!"); - return; - } - - final IAInvocationRequest request = body.getIAInvocationRequest(); - - if (Objects.isNull(request)) { - LOG.error("Body contains no IAInvocationRequest. Aborting operation!"); - return; - } - - LOG.debug("Request is valid. Checking for input parameters..."); - - if (request.getParams() != null) { - LOG.debug("Request contains input parameters as HashMap:"); - - final HashMap inputParamMap = new HashMap<>(); - - for (final KeyValueType inputParam : request.getParams().getKeyValuePair()) { - LOG.debug("Key: {}, Value: {}", inputParam.getKey(), inputParam.getValue()); - inputParamMap.put(inputParam.getKey(), inputParam.getValue()); - } - - message.setBody(inputParamMap, HashMap.class); - } else { - if (request.getDoc() != null) { - LOG.debug("Request contains input parameters a Document"); - - try { - final DocumentBuilderFactory dFact = DocumentBuilderFactory.newInstance(); - final DocumentBuilder build = dFact.newDocumentBuilder(); - final Document document = build.newDocument(); - - final Element element = request.getDoc().getAny(); - - document.adoptNode(element); - document.appendChild(element); - - message.setBody(document, Document.class); - } - catch (final Exception e) { - LOG.error("Unable to parse Document: {}", e.getMessage()); - } - } else { - LOG.warn("Request contains no input parameters."); - message.setBody(null); - } - } - - final String invocationType = message.getHeader(MBHeader.INVOCATIONTYPE_STRING.toString(), String.class); - - if (invocationType != null) { - - // call the operation with the related invocation plug-in - final IManagementBusInvocationPluginService invocationPlugin = - ServiceHandler.invocationPluginServices.get(invocationType); - if (invocationPlugin != null) { - LOG.debug("Invoking IA with plug-in: {}", invocationPlugin.getClass()); - final Exchange response = invocationPlugin.invoke(exchange); - - final Object responseBody = response.getIn().getBody(); - - // object to transmitt output parameters to the calling Container - final IAInvocationRequest invocationResponse = new IAInvocationRequest(); - - if (responseBody instanceof HashMap) { - LOG.debug("Response contains output parameters as HashMap"); - - @SuppressWarnings("unchecked") - final HashMap paramsMap = (HashMap) responseBody; - - final KeyValueMap invocationResponseMap = new KeyValueMap(); - final List invocationResponsePairs = invocationResponseMap.getKeyValuePair(); - - for (final Entry param : paramsMap.entrySet()) { - invocationResponsePairs.add(new KeyValueType(param.getKey(), param.getValue())); - } - - invocationResponse.setParams(invocationResponseMap); - } else { - if (body instanceof Document) { - LOG.debug("Response contains output parameters as Document."); - - final Document document = (Document) body; - invocationResponse.setDoc(new Doc(document.getDocumentElement())); - } else { - LOG.warn("No output parameters defined!"); - } - } - - // send response to calling Container - final CollaborationMessage reply = - new CollaborationMessage(new KeyValueMap(), new BodyType(invocationResponse)); - Activator.producer.sendBodyAndHeaders("direct:SendMQTT", reply, headers); - } else { - LOG.error("No invocation plug-in found for invocation type: {}", invocationType); - } - } else { - LOG.error("No invocation type specified for the IA!"); - } - } - - /** - * Get the header fields that are needed to respond to a request as Map. - * - * @param message the request message - * @return the Map containing the header fields for the response if the needed header fields are - * found in the request message, null otherwise - */ - private Map getResponseHeaders(final Message message) { - - // extract header fields - final String broker = message.getHeader(MBHeader.MQTTBROKERHOSTNAME_STRING.toString(), String.class); - final String replyTopic = message.getHeader(MBHeader.REPLYTOTOPIC_STRING.toString(), String.class); - final String correlation = message.getHeader(MBHeader.CORRELATIONID_STRING.toString(), String.class); - - // reply is only possible if all headers are set - if (Objects.isNull(broker) || Objects.isNull(replyTopic) || Objects.isNull(correlation)) { - return null; - } - - // add the header fields to the header map and return it - final Map headers = new HashMap<>(); - headers.put(MBHeader.MQTTBROKERHOSTNAME_STRING.toString(), broker); - headers.put(MBHeader.MQTTTOPIC_STRING.toString(), replyTopic); - headers.put(MBHeader.CORRELATIONID_STRING.toString(), correlation); - return headers; - } - - /** - * Check whether the request is directed to the local OpenTOSCA Container / Management Bus. This - * is the case if the {@link MBHeader#DEPLOYMENTLOCATION_STRING} header field equals the local - * host name. - * - * @param message the request message - * @return true if the request is directed to this Management Bus, false - * otherwise - */ - private boolean isDestinationLocal(final Message message) { - - final String deploymentLocation = - message.getHeader(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), String.class); - LOG.debug("Deplyoment location header: {}", deploymentLocation); - - return deploymentLocation != null && deploymentLocation.equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME); - } - - /** - * Create a String that uniquely identifies the IA that has to be deployed/undeployed for the - * given request message. The String can be used to synchronize all operations that are - * concerned with that IA. - * - * @param message the request message - * @return a String that uniquely identifies the IA or null if needed header fields are - * missing - */ - private String getUniqueSynchronizationString(final Message message) { - final String triggeringContainer = - message.getHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), String.class); - final String deploymentLocation = Settings.OPENTOSCA_CONTAINER_HOSTNAME; - final QName typeImplementationID = - message.getHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), QName.class); - final String implementationArtifactName = - message.getHeader(MBHeader.IMPLEMENTATIONARTIFACTNAME_STRING.toString(), String.class); - final String serviceInstanceURI = message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(),String.class); - final String serviceInstanceId = serviceInstanceURI.substring(serviceInstanceURI.lastIndexOf("/")); - - return ManagementBusServiceImpl.getUniqueSynchronizationString(triggeringContainer, deploymentLocation, - typeImplementationID, - implementationArtifactName,serviceInstanceId); - } - - /** - * Log the provided information. - * - * @param triggeringContainer - * @param deploymentLocation - * @param typeImplementationID - * @param implementationArtifactName - * @param csarID - * @param portType - * @param artifactType - * @param serviceTemplateInstanceID - */ - private void logInformation(final String triggeringContainer, final String deploymentLocation, - final QName typeImplementationID, final String implementationArtifactName, - final CSARID csarID, final QName portType, final String artifactType, - final Long serviceTemplateInstanceID) { - - LOG.debug("Triggering Container: {}", triggeringContainer); - LOG.debug("CSARID: {}", csarID); - LOG.debug("ServiceTemplateInstance ID: {}", serviceTemplateInstanceID); - LOG.debug("Deployment location: {}", deploymentLocation); - LOG.debug("TypeImplementation: {}", typeImplementationID); - LOG.debug("IA name: {}", implementationArtifactName); - LOG.debug("ArtifactType: {}", artifactType); - LOG.debug("Port type: {}", portType); - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/RequestSender.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/RequestSender.java deleted file mode 100644 index 5c3500d56..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/RequestSender.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.opentosca.bus.management.service.impl.collaboration; - -import static java.util.concurrent.TimeUnit.MILLISECONDS; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.UUID; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; - -import org.apache.camel.ConsumerTemplate; -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.bus.management.service.impl.Activator; -import org.opentosca.bus.management.service.impl.Constants; -import org.opentosca.bus.management.service.impl.collaboration.model.CollaborationMessage; -import org.opentosca.bus.management.service.impl.collaboration.model.RemoteOperations; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Utility class to send collaboration requests over MQTT to other OpenTOSCA Container nodes.
- *
- * - * Copyright 2018 IAAS University of Stuttgart - */ -public class RequestSender { - - static final private Logger LOG = LoggerFactory.getLogger(RequestSender.class); - - private final static ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); - - /** - * Send an operation request to a remote OpenTOSCA Container node. All information needed for the - * remote operation that shall be executed has to be defined as header fields of the given message - * or passed as CollaborationMessage. - * - * @param message the message containing the headers to send to the remote Container - * @param operation the operation to perform on the remote Container - * @param requestBody the message body of the request - * @param timeout the timeout to wait for a reply in ms. Zero means no timeout at all - * @return the exchange which is received as response of the request - */ - public static Exchange sendRequestToRemoteContainer(final Message message, final RemoteOperations operation, - final CollaborationMessage requestBody, final int timeout) { - - Objects.requireNonNull(message); - - // create an unique correlation ID for the request - final String correlationID = UUID.randomUUID().toString(); - - final Map requestHeaders = new HashMap<>(); - - // add header fields of the incoming message to the outgoing message - for (final MBHeader header : MBHeader.values()) { - if (message.getHeader(header.toString()) != null) { - requestHeaders.put(header.toString(), message.getHeader(header.toString())); - } - } - - // create header fields to forward the deployment requests - requestHeaders.put(MBHeader.MQTTBROKERHOSTNAME_STRING.toString(), Constants.LOCAL_MQTT_BROKER); - requestHeaders.put(MBHeader.MQTTTOPIC_STRING.toString(), Constants.REQUEST_TOPIC); - requestHeaders.put(MBHeader.CORRELATIONID_STRING.toString(), correlationID); - requestHeaders.put(MBHeader.REPLYTOTOPIC_STRING.toString(), Constants.RESPONSE_TOPIC); - requestHeaders.put(MBHeader.REMOTEOPERATION_STRING.toString(), operation); - - LOG.debug("Publishing request to MQTT broker at {} with topic {} and correlation ID {}", - Constants.LOCAL_MQTT_BROKER, Constants.REQUEST_TOPIC, correlationID); - - // publish the exchange over the camel route - scheduler.schedule(() -> Activator.producer.sendBodyAndHeaders("direct:SendMQTT", requestBody, requestHeaders), - 300, MILLISECONDS); - - final String callbackEndpoint = "direct:Callback-" + correlationID; - LOG.debug("Waiting for response at endpoint: {}", callbackEndpoint); - - // wait for a response at the created callback - final ConsumerTemplate consumer = Activator.camelContext.createConsumerTemplate(); - - Exchange response = null; - if (timeout == 0) { - // wait without timeout - response = consumer.receive(callbackEndpoint); - } else { - // assess request as failed after timeout and return null - response = consumer.receive(callbackEndpoint, timeout); - } - - // release resources - try { - consumer.stop(); - } - catch (final Exception e) { - LOG.warn("Unable to stop consumer: {}", e.getMessage()); - } - - return response; - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/Doc.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/Doc.java deleted file mode 100644 index 83f82d942..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/Doc.java +++ /dev/null @@ -1,66 +0,0 @@ -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2018.07.05 at 09:07:58 PM CEST - -package org.opentosca.bus.management.service.impl.collaboration.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - -/** - *

- * The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="Doc">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <any processContents='skip' minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Doc", propOrder = {"any"}) -public class Doc { - - public Doc() {} - - public Doc(final Element content) { - this.any = content; - } - - @XmlAnyElement - protected Element any; - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Element } - * - */ - public Element getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Element } - * - */ - public void setAny(final Element value) { - this.any = value; - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/ObjectFactory.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/ObjectFactory.java deleted file mode 100644 index eca105cac..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/ObjectFactory.java +++ /dev/null @@ -1,101 +0,0 @@ -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2018.07.05 at 09:07:58 PM CEST - -package org.opentosca.bus.management.service.impl.collaboration.model; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.opentosca.bus.management.service.impl.collaboration.model package. - *

- * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _CollaborationMessage_QNAME = - new QName("http://collaboration.org/schema", "CollaborationMessage"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes - * for package: org.opentosca.bus.management.service.impl.collaboration.model - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link CollaborationMessage } - * - */ - public CollaborationMessage createCollaborationMessage() { - return new CollaborationMessage(); - } - - /** - * Create an instance of {@link KeyValueMap } - * - */ - public KeyValueMap createKeyValueMap() { - return new KeyValueMap(); - } - - /** - * Create an instance of {@link KeyValueType } - * - */ - public KeyValueType createKeyValueType() { - return new KeyValueType(); - } - - /** - * Create an instance of {@link Doc } - * - */ - public Doc createDoc() { - return new Doc(); - } - - /** - * Create an instance of {@link InstanceDataMatchingRequest } - * - */ - public InstanceDataMatchingRequest createInstanceDataMatchingRequest() { - return new InstanceDataMatchingRequest(); - } - - /** - * Create an instance of {@link BodyType } - * - */ - public BodyType createBodyType() { - return new BodyType(); - } - - /** - * Create an instance of {@link IAInvocationRequest } - * - */ - public IAInvocationRequest createIAInvocationRequest() { - return new IAInvocationRequest(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link CollaborationMessage }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://collaboration.org/schema", name = "CollaborationMessage") - public JAXBElement createCollaborationMessage(final CollaborationMessage value) { - return new JAXBElement<>(_CollaborationMessage_QNAME, CollaborationMessage.class, null, value); - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/package-info.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/package-info.java deleted file mode 100644 index 7e60bd44c..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2018.07.05 at 09:07:58 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://collaboration.org/schema", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.opentosca.bus.management.service.impl.collaboration.model; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/package-info.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/package-info.java deleted file mode 100644 index 35987385b..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This package contains the classes related to collaboration between the Management Buses of - * different OpenTOSCA instances.
- *
- * - * Copyright 2018 IAAS University of Stuttgart - */ -package org.opentosca.bus.management.service.impl.collaboration; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/package-info.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/package-info.java deleted file mode 100644 index 78a690dfd..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This package contains the Camel processors which are needed for communication between Management - * Buses of different OpenTOSCA instances.
- *
- * Copyright 2018 IAAS University of Stuttgart
- *
- * - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * - */ -package org.opentosca.bus.management.service.impl.collaboration.processor; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveRequestRoute.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveRequestRoute.java deleted file mode 100644 index 573a8dfc8..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveRequestRoute.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.opentosca.bus.management.service.impl.collaboration.route; - -import javax.xml.bind.JAXBContext; - -import org.apache.camel.LoggingLevel; -import org.apache.camel.Processor; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.converter.jaxb.JaxbDataFormat; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.bus.management.service.impl.collaboration.model.RemoteOperations; -import org.opentosca.bus.management.service.impl.collaboration.processor.IncomingProcessor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This route is intended to receive requests made by other OpenTOSCA Containers.
- *
- * - * This route assumes that all interacting OpenTOSCA Containers use the same user name and - * password. Therefore, it can use the user name and password from the local config.ini file for - * authentication. If different credentials for different Containers shall be used, they all have to - * be defined in the config.ini and passed to this route via header fields.
- *
- * - * Copyright 2018 IAAS University of Stuttgart - */ -public class ReceiveRequestRoute extends RouteBuilder { - - final private static Logger LOG = LoggerFactory.getLogger(ReceiveResponseRoute.class); - - // MQTT broker credentials - final private String host; - final private String topic; - final private String username; - final private String password; - - /** - * Creates a Camel Route which can be used to receive requests from other collaborating - * OpenTOSCA Container nodes via MQTT. - * - * @param host the URL of the MQTT broker where the responses arrive - * @param topic the topic of the MQTT broker - * @param username the user name to authenticate at the MQTT broker - * @param password the password to authenticate at the MQTT broker - */ - public ReceiveRequestRoute(final String host, final String topic, final String username, final String password) { - this.host = host; - this.topic = topic; - this.username = username; - this.password = password; - } - - @Override - public void configure() throws Exception { - - // MQTT endpoint where this route waits for messages - final String consumerEndpoint = "mqtt:request?host=" + this.host + "&userName=" + this.username + "&password=" - + this.password + "&subscribeTopicNames=" + this.topic + "&qualityOfService=ExactlyOnce"; - - // endpoints to invoke the methods corresponding to requests - final String instanceMatchingEndpoint = - "bean:org.opentosca.bus.management.service.impl.collaboration.RequestReceiver?method=invokeInstanceDataMatching"; - final String deploymentEndpoint = - "bean:org.opentosca.bus.management.service.impl.collaboration.RequestReceiver?method=invokeIADeployment"; - final String undeploymentEndpoint = - "bean:org.opentosca.bus.management.service.impl.collaboration.RequestReceiver?method=invokeIAUndeployment"; - final String invocationEndpoint = - "bean:org.opentosca.bus.management.service.impl.collaboration.RequestReceiver?method=invokeIAOperation"; - - // JAXB definitions to unmarshal the incoming message body - final ClassLoader classLoader = - org.opentosca.bus.management.service.impl.collaboration.model.ObjectFactory.class.getClassLoader(); - final JAXBContext jc = - JAXBContext.newInstance("org.opentosca.bus.management.service.impl.collaboration.model", classLoader); - final JaxbDataFormat jaxb = new JaxbDataFormat(jc); - - // extracts headers from the marshaled object and adds them to the exchange - final Processor headerProcessor = new IncomingProcessor(); - - // header field which is used as routing criteria - final String remoteOperationHeader = MBHeader.REMOTEOPERATION_STRING.toString(); - - // log messages to increase the readability of the route - final String messageReceived = "Received request message via MQTT topic. Unmarshaling..."; - final String operation = "Message has remote operation header: ${header." + remoteOperationHeader + "}"; - final String noMarshalling = "Unable to unmarshal message. Ignoring it!"; - final String invalidOperation = "Remote operation header is either null or contains an invalid operation!"; - final String invokeInstanceDataMatching = "Invoking instance data matching on local OpenTOSCA Container"; - final String invokeIADeployment = "Invoking IA deployment on local OpenTOSCA Container"; - final String invokeIAUndeployment = "Invoking IA undeployment on local OpenTOSCA Container"; - final String invokeIAOperation = "Invoking IA operation on local OpenTOSCA Container"; - - // @formatter:off - this.from(consumerEndpoint) - .threads(2, 5) - .log(LoggingLevel.DEBUG, LOG, messageReceived) - .doTry() - .unmarshal(jaxb) - .process(headerProcessor) - .log(LoggingLevel.DEBUG, LOG, operation) - .choice() - .when(header(remoteOperationHeader).isEqualTo(RemoteOperations.INVOKE_INSTANCE_DATA_MATCHING)) - .log(LoggingLevel.DEBUG, LOG, invokeInstanceDataMatching) - .to(instanceMatchingEndpoint) - .endChoice() - .when(header(remoteOperationHeader).isEqualTo(RemoteOperations.INVOKE_IA_DEPLOYMENT)) - .log(LoggingLevel.DEBUG, LOG, invokeIADeployment) - .to(deploymentEndpoint) - .endChoice() - .when(header(remoteOperationHeader).isEqualTo(RemoteOperations.INVOKE_IA_UNDEPLOYMENT)) - .log(LoggingLevel.DEBUG, LOG, invokeIAUndeployment) - .to(undeploymentEndpoint) - .endChoice() - .when(header(remoteOperationHeader).isEqualTo(RemoteOperations.INVOKE_IA_OPERATION)) - .log(LoggingLevel.DEBUG, LOG, invokeIAOperation) - .to(invocationEndpoint) - .endChoice() - .otherwise() - .log(LoggingLevel.WARN, LOG, invalidOperation) - .endChoice() - .endDoTry() - .doCatch(Exception.class) - .log(LoggingLevel.ERROR, LOG, noMarshalling) - .end(); - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/package-info.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/package-info.java deleted file mode 100644 index 0e34cdaae..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This package contains the Camel routes which are needed for communication between the Management - * Buses of different OpenTOSCA instances.
- *
- * Copyright 2018 IAAS University of Stuttgart
- *
- * - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * - */ -package org.opentosca.bus.management.service.impl.collaboration.route; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/instance/plan/PlanInstanceHandler.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/instance/plan/PlanInstanceHandler.java deleted file mode 100644 index 6c3ddbc19..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/instance/plan/PlanInstanceHandler.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.opentosca.bus.management.service.impl.instance.plan; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import javax.persistence.NoResultException; -import javax.xml.namespace.QName; - -import org.opentosca.bus.management.service.impl.Constants; -import org.opentosca.bus.management.service.impl.servicehandler.ServiceHandler; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.model.PlanInstanceInput; -import org.opentosca.container.core.next.model.PlanInstanceOutput; -import org.opentosca.container.core.next.model.PlanInstanceState; -import org.opentosca.container.core.next.model.PlanLanguage; -import org.opentosca.container.core.next.model.PlanType; -import org.opentosca.container.core.next.repository.PlanInstanceRepository; -import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; -import org.opentosca.container.core.tosca.model.TParameter; -import org.opentosca.container.core.tosca.model.TPlan; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; - -/** - * Utility class which handles the creation and updating of plan instance data.
- *
- * - * Copyright 2019 IAAS University of Stuttgart - */ -public class PlanInstanceHandler { - - private final static Logger LOG = LoggerFactory.getLogger(PlanInstanceHandler.class); - - private final static ServiceTemplateInstanceRepository stiRepo = new ServiceTemplateInstanceRepository(); - private final static PlanInstanceRepository planRepo = new PlanInstanceRepository(); - - /** - * Create a plan instance for the instance API and add the details about name, type, input - * parameters, etc. - * - * @param csarId the Id of the CSAR the plan belongs to - * @param serviceTemplateId the Id of the ServiceTemplate the plan belongs to - * @param serviceTemplateInstanceId the Id of the ServiceTemplate instance the plan belongs to - * @param planId the ID of the plan - * @param correlationId the correlation Id that uniquely identifies the plan instance - * @param input the input parameters of the plan instance - * - * @return the created PlanInstance or null if the creation failed - */ - public static PlanInstance createPlanInstance(final CSARID csarId, final QName serviceTemplateId, - final long serviceTemplateInstanceId, final QName planId, - final String correlationId, final Object input) { - - final TPlan storedPlan = ServiceHandler.toscaReferenceMapper.getPlanForCSARIDAndPlanID(csarId, planId); - if (Objects.isNull(storedPlan)) { - LOG.error("Plan with ID {} in CSAR {} is null!", planId, csarId); - return null; - } - - // create a new plan instance - final PlanInstance plan = new PlanInstance(); - plan.setCorrelationId(correlationId); - plan.setLanguage(PlanLanguage.fromString(storedPlan.getPlanLanguage())); - plan.setType(PlanType.fromString(storedPlan.getPlanType())); - plan.setState(PlanInstanceState.RUNNING); - plan.setTemplateId(planId); - - // cast input parameters for the plan invocation - HashMap inputMap = new HashMap<>(); - if (input instanceof HashMap) { - inputMap = (HashMap) input; - } - - // add input parameters to the plan instance - for (final TParameter param : storedPlan.getInputParameters().getInputParameter()) { - new PlanInstanceInput(param.getName(), inputMap.getOrDefault(param.getName(), ""), - param.getType()).setPlanInstance(plan); - } - - // add connection to the service template and update the repository - stiRepo.find(serviceTemplateInstanceId) - .ifPresent(serviceTemplateInstance -> plan.setServiceTemplateInstance(serviceTemplateInstance)); - planRepo.add(plan); - - return plan; - } - - /** - * Create a unique correlation ID based on the current time. - * - * @return the unique correlation ID - */ - public static String createCorrelationId() { - // generate CorrelationId for the plan execution - while (true) { - final String correlationId = String.valueOf(System.currentTimeMillis()); - - try { - planRepo.findByCorrelationId(correlationId); - LOG.debug("CorrelationId {} already in use.", correlationId); - } - catch (final NoResultException e) { - return correlationId; - } - } - } - - /** - * Update the plan instance information with the output parameters from the plan invocation. - * - * @param plan the plan instance object to update - * @param csarId the Id of the CSAR the plan belongs to - * @param body the body of the camel envelope resulting from the invocation and containing the - * output parameters - */ - public static void updatePlanInstanceOutput(final PlanInstance plan, final CSARID csarId, final Object body) { - - final TPlan planModel = - ServiceHandler.toscaReferenceMapper.getPlanForCSARIDAndPlanID(csarId, plan.getTemplateId()); - - if (plan.getLanguage().equals(PlanLanguage.BPEL)) { - - LOG.debug("Received response from BPEL plan"); - - if (body instanceof Map) { - final Map map = (Map) body; - - // add output parameters to the PlanInstance object and update repository - for (final TParameter param : planModel.getOutputParameters().getOutputParameter()) { - new PlanInstanceOutput(param.getName(), map.get(param.getName()), - param.getType()).setPlanInstance(plan); - } - - } else { - LOG.error("Response from BPEL plan is not of type Map"); - } - - } else if (plan.getLanguage().equals(PlanLanguage.BPMN)) { - - LOG.debug("Received response from BPMN plan"); - - // parse process instance ID out of REST response - final String planInstanceID = parseRESTResponse(body); - if (Objects.isNull(planInstanceID) || planInstanceID.equals("")) { - LOG.error("The parsing of the response failed!"); - return; - } - LOG.debug("Instance ID of the plan in Camunda: {}", planInstanceID); - - // create web resource to retrieve the current state of the process instance - final Client client = Client.create(); - WebResource webResource = - Client.create() - .resource(Settings.ENGINE_PLAN_BPMN_URL + Constants.PROCESS_INSTANCE_PATH + planInstanceID); - - // wait until the process instance terminates - while (true) { - final String resp = webResource.get(ClientResponse.class).getEntity(String.class); - LOG.debug("Active process instance response: " + resp); - - try { - Thread.sleep(10000); - } - catch (final InterruptedException e) { - e.printStackTrace(); - } - - // check if history contains process instance with this ID - if (resp.equals("[]")) { - LOG.debug("The plan instance {} is not active any more.", planInstanceID); - break; - } - } - - // get output parameters of the plan from the process instance variables - for (final TParameter param : planModel.getOutputParameters().getOutputParameter()) { - final String path = Settings.ENGINE_PLAN_BPMN_URL + Constants.HISTORY_PATH; - - // get variable instances of the process instance with the param name - webResource = client.resource(path); - webResource = webResource.queryParam("processInstanceId", planInstanceID); - webResource = webResource.queryParam("activityInstanceIdIn", planInstanceID); - webResource = webResource.queryParam("variableName", param.getName()); - final String responseStr = webResource.get(ClientResponse.class).getEntity(String.class); - - if (responseStr.equals("[]")) { - LOG.warn("Unable to find variable instance for output parameter: {}", param.getName()); - continue; - } - - String value = null; - try { - final JsonParser parser = new JsonParser(); - final JsonObject json = - (JsonObject) parser.parse(responseStr.substring(1, responseStr.length() - 1)); - value = json.get("value").getAsString(); - } - catch (final ClassCastException e) { - LOG.trace("value is null"); - value = ""; - } - LOG.debug("For variable \"{}\" the output value is \"{}\"", param.getName(), value); - new PlanInstanceOutput(param.getName(), value, param.getType()).setPlanInstance(plan); - } - - } else { - LOG.error("Unable to handle response for plan invocations with the plan language: {}", plan.getLanguage()); - } - - // update the repo with the changed plan instance - planRepo.update(plan); - } - - /** - * Parse the REST response returned by Camunda BPMN - * - * @param responseBody the body of the response - * @return the Camunda instance ID identifying the plan instance - */ - private static String parseRESTResponse(final Object responseBody) { - final String resp = (String) responseBody; - final String instanceID = resp.substring(resp.indexOf("href\":\"") + 7, resp.length()); - return instanceID.substring(instanceID.lastIndexOf("/") + 1, instanceID.indexOf("\"")); - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/package-info.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/package-info.java deleted file mode 100644 index c461e93c7..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/package-info.java +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This package contains the implementation of the - * {@link org.opentosca.bus.management.service.IManagementBusService}. Determining which IA/Plan - * should be invoked as well as collecting needed information like the endpoint for example are done - * here.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.service.impl; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/servicehandler/ServiceHandler.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/servicehandler/ServiceHandler.java deleted file mode 100644 index 0da030195..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/servicehandler/ServiceHandler.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.opentosca.bus.management.service.impl.servicehandler; - -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; -import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.service.ICoreCapabilityService; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Helper class that handles all needed services for Management Bus.
- *
- * - * Copyright 2018 IAAS University of Stuttgart
- *
- * - * In this class the from the Management Bus needed services are binded an unbinded. - * - * - * @see IManagementBusInvocationPluginService - * @see IManagementBusDeploymentPluginService - * @see ICoreEndpointService - * @see IToscaEngineService - * @see ICoreCapabilityService - */ - -public class ServiceHandler { - - public static Map invocationPluginServices = - Collections.synchronizedMap(new HashMap()); - public static Map deploymentPluginServices = - Collections.synchronizedMap(new HashMap()); - public static ICoreEndpointService endpointService; - public static IToscaEngineService toscaEngineService; - public static IToscaReferenceMapper toscaReferenceMapper; - public static ICoreCapabilityService capabilityService; - - private final static Logger LOG = LoggerFactory.getLogger(ServiceHandler.class); - - /** - * Bind IToscaReferenceMapper. - * - * @param toscaEngineService - The ToscaReferenceMapper to register. - */ - public void bindToscaReferenceMapper(final IToscaReferenceMapper toscaReferenceMapper) { - if (toscaEngineService != null) { - ServiceHandler.toscaReferenceMapper = toscaReferenceMapper; - LOG.debug("Bind IToscaReferenceMapper: {} bound.", toscaReferenceMapper.toString()); - } else { - LOG.error("Bind IToscaReferenceMapper: Supplied parameter is null!"); - } - } - - /** - * Unbind IToscaReferenceMapper. - * - * @param toscaReferenceMapper - The ToscaReferenceMapper to unregister. - */ - public void unbindToscaReferenceMapper(final IToscaReferenceMapper toscaReferenceMapper) { - ServiceHandler.toscaReferenceMapper = null; - LOG.debug("Unbind IToscaReferenceMapper unbound."); - } - - /** - * Bind EndpointService. - * - * @param endpointService - The endpointService to register. - */ - public void bindEndpointService(final ICoreEndpointService endpointService) { - if (endpointService != null) { - ServiceHandler.endpointService = endpointService; - LOG.debug("Bind Endpoint Service: {} bound.", endpointService.toString()); - } else { - LOG.error("Bind Endpoint Service: Supplied parameter is null!"); - } - } - - /** - * Unbind EndpointService. - * - * @param endpointService - The endpointService to unregister. - */ - public void unbindEndpointService(final ICoreEndpointService endpointService) { - ServiceHandler.endpointService = null; - LOG.debug("Unbind Endpoint Service unbound."); - } - - /** - * Bind ToscaEngineService - * - * @param toscaEngineService - */ - public void bindToscaService(final IToscaEngineService toscaEngineService) { - if (toscaEngineService != null) { - ServiceHandler.toscaEngineService = toscaEngineService; - LOG.debug("Bind ToscaEngineService: {} bound.", toscaEngineService.toString()); - } else { - LOG.error("Bind ToscaEngineService: Supplied parameter is null!"); - } - } - - /** - * Unbind ToscaEngineService - * - * @param toscaEngineService - */ - public void unbindToscaService(final IToscaEngineService toscaEngineService) { - ServiceHandler.toscaEngineService = null; - LOG.debug("Unbind ToscaEngineService unbound."); - } - - /** - * Bind CapabilityService - * - * @param capabilityService - */ - public void bindCapabilityService(final ICoreCapabilityService capabilityService) { - if (capabilityService != null) { - ServiceHandler.capabilityService = capabilityService; - LOG.debug("Bind ICoreCapabilityService: {} bound.", ServiceHandler.capabilityService.toString()); - } else { - LOG.error("Bind ICoreCapabilityService: Supplied parameter is null!"); - } - } - - /** - * Unbind CapabilityService - * - * @param capabilityService - */ - public void unbindCapabilityService(final ICoreCapabilityService capabilityService) { - ServiceHandler.capabilityService = null; - LOG.debug("Unbind ICoreCapabilityService unbound."); - } - - /** - * Bind Management Bus Invocation plug-in Services and store them in local HashMap. - * - * @param plugin - A Management Bus Invocation plug-in to register. - */ - public void bindInvocationPluginService(final IManagementBusInvocationPluginService plugin) { - if (plugin != null) { - - final List types = plugin.getSupportedTypes(); - - for (final String type : types) { - invocationPluginServices.put(type, plugin); - LOG.debug("Bound Management Bus Invocation Plugin: {} for Type: {}", plugin.toString(), type); - } - } else { - LOG.error("Bind Management Bus Invocation Plugin: Supplied parameter is null!"); - } - } - - /** - * Unbind Management Bus Invocation plug-in Services and delete them from local Map. - * - * @param plugin - A Management Bus Invocation plug-in to unregister. - */ - public void unbindInvocationPluginService(final IManagementBusInvocationPluginService plugin) { - if (plugin != null) { - - final List types = plugin.getSupportedTypes(); - - for (final String type : types) { - final Object deletedObject = invocationPluginServices.remove(type); - if (deletedObject != null) { - LOG.debug("Unbound Management Bus Invocation Plugin Service: {} for Type: {}", plugin.toString(), - type); - } else { - LOG.debug("Management Bus Invocation Plugin {} could not be unbound, because it is not bound!", - plugin.toString()); - } - } - } - - else { - LOG.error("Unbind Management Bus Invocation Plugin: Supplied parameter is null!"); - } - } - - /** - * Bind Management Bus Deployment plug-in Services and store them in local HashMap. - * - * @param plugin - A Management Bus Deployment plug-in to register. - */ - public void bindDeploymentPluginService(final IManagementBusDeploymentPluginService plugin) { - if (plugin != null) { - - final List types = plugin.getSupportedTypes(); - - for (final String type : types) { - deploymentPluginServices.put(type, plugin); - LOG.debug("Bound Management Bus Deployment Plugin: {} for Type: {}", plugin.toString(), type); - } - } else { - LOG.error("Bind Management Bus Deployment Plugin: Supplied parameter is null!"); - } - } - - /** - * Unbind Management Bus Deployment plug-in Services and delete them from local Map. - * - * @param plugin - A Management Bus Deployment plug-in to unregister. - */ - public void unbindDeploymentPluginService(final IManagementBusDeploymentPluginService plugin) { - if (plugin != null) { - - final List types = plugin.getSupportedTypes(); - - for (final String type : types) { - final Object deletedObject = deploymentPluginServices.remove(type); - if (deletedObject != null) { - LOG.debug("Unbound Management Bus Deployment Plugin Service: {} for Type: {}", plugin.toString(), - type); - } else { - LOG.debug("Management Bus Deployment Plugin {} could not be unbound, because it is not bound!", - plugin.toString()); - } - } - } else { - LOG.error("Unbind Management Bus Deployment Plugin: Supplied parameter is null!"); - } - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/servicehandler/package-info.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/servicehandler/package-info.java deleted file mode 100644 index 885c4e06a..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/servicehandler/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This package contains methods for the binding and unbinding of needed services. This services are - * {@link org.opentosca.container.core.service.ICoreCapabilityService}, - * {@link org.opentosca.container.core.service.ICoreEndpointService}, - * {@link org.opentosca.container.core.engine.IToscaEngineServic}, - * {@link org.opentosca.container.core.service.IInstanceDataService}, - * {@link org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService} and - * {@link org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService}.
- * - * Copyright 2018 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.service.impl.servicehandler; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/DeploymentPluginCapabilityChecker.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/DeploymentPluginCapabilityChecker.java deleted file mode 100644 index 0fbd374ce..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/DeploymentPluginCapabilityChecker.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.opentosca.bus.management.service.impl.util; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; -import org.opentosca.bus.management.service.impl.servicehandler.ServiceHandler; -import org.opentosca.container.core.model.capability.provider.ProviderType; - -/** - * Analyzes if a given Implementation Artifact is deployable, meaning checking if the required - * capabilities of the Implementation Artifact are met by the container and/or available plug-ins - * (plan + deployment).
- *
- * - * Copyright 2018 IAAS University of Stuttgart
- *
- * - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * - */ - -public class DeploymentPluginCapabilityChecker { - - /** - * Checks if required features are met by chosen plug-in or container and plan. - * - * @param requiredFeatures the set of features to be satisfied - * @param plugin the deployment plug-in - * @return true if all requiredFeatures are met, false otherwise - */ - public static boolean capabilitiesAreMet(final List requiredFeatures, - final IManagementBusDeploymentPluginService plugin) { - - if (!requiredFeatures.isEmpty()) { - - // get all provided capabilities - final List capabilities = new ArrayList<>(); - capabilities.addAll(DeploymentPluginCapabilityChecker.getConAndPlanCaps()); - capabilities.addAll(plugin.getCapabilties()); - - // remove all required features that are satisfied by a capability - for (final Iterator itReqCaps = requiredFeatures.iterator(); itReqCaps.hasNext();) { - final String reqCap = itReqCaps.next(); - if (capabilities.contains(reqCap)) { - itReqCaps.remove(); - } - } - - // return true if no further requested feature exists - return requiredFeatures.isEmpty(); - } - - return true; - } - - /** - * Returns container and plan capabilities from the CoreCapabilitiyService. - * - * @return container and plan capabilities in one merged list. - */ - private static List getConAndPlanCaps() { - - final List conAndPlanCaps = new ArrayList<>(); - - final List containerCaps = - ServiceHandler.capabilityService.getCapabilities(ProviderType.CONTAINER.toString(), ProviderType.CONTAINER); - final Map> planPluginsCaps = - ServiceHandler.capabilityService.getCapabilities(ProviderType.PLAN_PLUGIN); - - conAndPlanCaps.addAll(containerCaps); - - for (final String planPlugin : planPluginsCaps.keySet()) { - conAndPlanCaps.addAll(planPluginsCaps.get(planPlugin)); - } - - return conAndPlanCaps; - } - -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/ParameterHandler.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/ParameterHandler.java deleted file mode 100644 index fe460df9e..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/ParameterHandler.java +++ /dev/null @@ -1,315 +0,0 @@ -package org.opentosca.bus.management.service.impl.util; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.bus.management.service.impl.servicehandler.ServiceHandler; -import org.opentosca.bus.management.utils.MBUtils; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.container.core.tosca.convention.Utils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Utility class which contains methods to handle input parameters for operation invocations by the - * Management Bus.
- *
- * - * Copyright 2019 IAAS University of Stuttgart - */ -public class ParameterHandler { - - private final static Logger LOG = LoggerFactory.getLogger(ParameterHandler.class); - - /** - * Updates missing input parameters for a operation on a NodeTemplate or RelationshipTemplate with - * instance data. The provided input parameters have priority, which means if one parameter is - * provided and found in the instance data, then the provided parameter is used.
- *
- * - * If nodeTemplateInstance and relationshipTemplateInstance are provided, the update will be - * performed based on the RelationshipTemplate. If one of the parameters is null the other - * one is used to perform the update. If both are null an update is not possible. - * - * @param inputParams the set of provided input parameters - * @param csarID of the CSAR containing the NodeTemplate/RelationshipTemplate - * @param nodeTemplateInstance the NodeTemplateInstance object which is used as entry point to the - * stored instance data. If it does not contain all needed parameters the search is continued - * downwards in the topology - * @param relationshipTemplateInstance the RelationshipTemplateInstance object which is used as - * entry point to the stored instance data. The update is performed based on the - * RelationshipTemplate and the source/target stack of the topology - * @param neededInterface the interface of the operation for which the update is performed - * @param neededOperation the operation for which the update is performed - * - * @return the updated input parameters. - */ - public static HashMap updateInputParams(final HashMap inputParams, - final CSARID csarID, - final NodeTemplateInstance nodeTemplateInstance, - final RelationshipTemplateInstance relationshipTemplateInstance, - final String neededInterface, - final String neededOperation) { - - if (Objects.nonNull(relationshipTemplateInstance)) { - return updateInputParamsForRelationshipTemplate(inputParams, csarID, relationshipTemplateInstance, - neededInterface, neededOperation); - - } else if (Objects.nonNull(nodeTemplateInstance)) { - return updateInputParamsForNodeTemplate(inputParams, csarID, nodeTemplateInstance, neededInterface, - neededOperation); - } else { - LOG.warn("Unable to update input parameters with nodeTemplateInstance and relationshipTemplateInstance equal to null!"); - return inputParams; - } - } - - /** - * Updates missing input parameters for a operation on a NodeTemplate with instance data. The - * provided input parameters have priority, which means if one parameter is provided and found in - * the instance data, then the provided parameter is used. - * - * @param inputParams the set of provided input parameters - * @param csarID of the CSAR containing the NodeTemplate - * @param nodeTemplateInstance the NodeTemplate instance object - * @param neededInterface the interface of the operation for which the update is performed - * @param neededOperation the operation for which the update is performed - * - * @return the updated input parameters. - */ - private static HashMap updateInputParamsForNodeTemplate(final HashMap inputParams, - final CSARID csarID, - NodeTemplateInstance nodeTemplateInstance, - final String neededInterface, - final String neededOperation) { - - Objects.requireNonNull(nodeTemplateInstance); - - LOG.debug("Updating input params for NodeTemplateInstance ID: {}", nodeTemplateInstance.getId()); - - LOG.debug("{} inital input parameters for operation: {} found: {}", inputParams.size(), neededOperation, - inputParams.toString()); - - // check if operation has input params at all - final Set unsetParameters = - getExpectedInputParams(csarID, nodeTemplateInstance.getTemplateType(), neededInterface, neededOperation); - if (unsetParameters.isEmpty()) { - LOG.debug("No input params defined for this operation."); - return inputParams; - } - - LOG.debug("Operation: {} expects {} parameters: {}", neededOperation, unsetParameters.size(), - unsetParameters.toString()); - - // use convention names for properties - final List supportedIPPropertyNames = Utils.getSupportedVirtualMachineIPPropertyNames(); - final List supportedInstanceIdPropertyNames = Utils.getSupportedVirtualMachineInstanceIdPropertyNames(); - final List supportedPasswordPropertyNames = - Utils.getSupportedVirtualMachineLoginPasswordPropertyNames(); - final List supportedUsernamePropertyNames = - Utils.getSupportedVirtualMachineLoginUserNamePropertyNames(); - - // remove already defined properties from the set - inputParams.keySet().stream().forEach(param -> unsetParameters.remove(param)); - - // search for parameters downwards in the topology until all are set - while (!unsetParameters.isEmpty()) { - if (nodeTemplateInstance.getTemplateType().equals(Types.abstractOperatingSystemNodeType)) { - nodeTemplateInstance = MBUtils.getAbstractOSReplacementInstance(nodeTemplateInstance); - } - - // retrieve stored instance data for current node - final Map propertiesMap = nodeTemplateInstance.getPropertiesAsMap(); - if (Objects.nonNull(propertiesMap)) { - - LOG.debug("Found following properties in the instance data:"); - for (final String key : propertiesMap.keySet()) { - LOG.debug("Prop: " + key + " Val: " + propertiesMap.get(key)); - } - - // update currently not set input parameters if possible - unsetParameters.stream().forEach(param -> { - if (supportedIPPropertyNames.contains(param)) { - LOG.debug("Supported IP-Property found."); - getSupportedProperty(supportedIPPropertyNames, - propertiesMap).ifPresent(foundValue -> inputParams.put(param, foundValue)); - - } else if (supportedInstanceIdPropertyNames.contains(param)) { - LOG.debug("Supported InstanceID-Property found."); - getSupportedProperty(supportedInstanceIdPropertyNames, - propertiesMap).ifPresent(foundValue -> inputParams.put(param, foundValue)); - - } else if (supportedPasswordPropertyNames.contains(param)) { - LOG.debug("Supported Password-Property found."); - getSupportedProperty(supportedPasswordPropertyNames, - propertiesMap).ifPresent(foundValue -> inputParams.put(param, foundValue)); - - } else if (supportedUsernamePropertyNames.contains(param)) { - LOG.debug("Supported Username-Property found."); - getSupportedProperty(supportedUsernamePropertyNames, - propertiesMap).ifPresent(foundValue -> inputParams.put(param, foundValue)); - - } else { - propertiesMap.keySet().stream().filter(name -> name.equals(param)).findFirst() - .ifPresent(name -> inputParams.put(param, propertiesMap.get(name))); - } - }); - - // remove found properties - inputParams.keySet().stream().forEach(param -> unsetParameters.remove(param)); - } else { - LOG.debug("No stored instance data found for current node: {}", nodeTemplateInstance.getId()); - } - - // get next node downwards in the topology - final Optional nextNode = MBUtils.getNextNodeTemplateInstance(nodeTemplateInstance); - if (nextNode.isPresent()) { - nodeTemplateInstance = nextNode.get(); - LOG.debug("Next node for parameter search: {}", nodeTemplateInstance.getId()); - } else { - LOG.warn("No next node found for parameter search. Terminating with {} unsatisfied expected parameters", - unsetParameters.size()); - break; - } - } - - LOG.debug("Final {} input parameters for operation {} : {}", inputParams.size(), neededOperation, - inputParams.toString()); - - return inputParams; - } - - /** - * Updates missing input parameters for a operation on a RelationshipTemplate with instance data. - * The provided input parameters have priority, which means if one parameter is provided and found - * in the instance data, then the provided parameter is used.
- *
- * - * Convention:
- * Input parameters without prefix are searched on the RelationshipTemplateInstance.
- * Input parameters with prefix "SRC_" are searched on the NodeTemplateInstance which is the source - * of the RelationshipTemplate.
- * Input parameters with prefix "TRG_" are searched on the NodeTemplateInstance which is the target - * of the RelationshipTemplate. - * - * @param inputParams the set of provided input parameters - * @param csarID of the CSAR containing the RelationshipTemplate - * @param relationshipTemplateInstance the RelationshipTemplate instance object - * @param neededInterface the interface of the operation for which the update is performed - * @param neededOperation the operation for which the update is performed - * - * @return the updated input parameters. - */ - private static HashMap updateInputParamsForRelationshipTemplate(final HashMap inputParams, - final CSARID csarID, - final RelationshipTemplateInstance relationshipTemplateInstance, - final String neededInterface, - final String neededOperation) { - - Objects.requireNonNull(relationshipTemplateInstance); - - LOG.debug("Updating input params for RelationshipTemplate ID: {}", relationshipTemplateInstance.getId()); - - LOG.debug("{} inital input parameters for operation: {} found: {}", inputParams.size(), neededOperation, - inputParams.toString()); - - // check if operation has input params at all - final Set expectedParams = - getExpectedInputParams(csarID, relationshipTemplateInstance.getTemplateType(), neededInterface, - neededOperation); - if (expectedParams.isEmpty()) { - LOG.debug("No input params defined for this operation."); - return inputParams; - } - - LOG.debug("Operation: {} expects {} parameters: {}", neededOperation, expectedParams.size(), - expectedParams.toString()); - - // update params with instance data - for (final String expectedParam : expectedParams) { - LOG.debug("Expected parameter: {}", expectedParam); - - if (expectedParam.startsWith("SRC_")) { - LOG.debug("Parameter is defined at the topology stack of the source NodeTemplate."); - // TODO: search on source stack - } else if (expectedParam.startsWith("TRG_")) { - LOG.debug("Parameter is defined at the topology stack of the target NodeTemplate."); - // TODO: search on target stack - } else { - LOG.debug("Parameter is defined at the RelationshipTemplate."); - // TODO: search on RelationshipTemplateInstance properties - } - } - - return inputParams; - } - - /** - * Returns the input parameters of the given operation which are specified in the TOSCA definitions - * of the NodeType or RelationshipType. - * - * @param csarID ID of the CSAR which contains the NodeType or RelationshipType with the operation - * @param typeID ID of the NodeType or RelationshipType which contains the operation - * @param interfaceName the name of the interface which contains the operation - * @param operationName the operation name for which the parameters are searched - * - * @return specified input parameters of the operation - */ - private static Set getExpectedInputParams(final CSARID csarID, final QName typeID, - final String interfaceName, final String operationName) { - - final Node definedInputParameters = - ServiceHandler.toscaEngineService.getInputParametersOfATypeOperation(csarID, typeID, interfaceName, - operationName); - - if (Objects.isNull(definedInputParameters)) { - return Collections.emptySet(); - } - - final Set inputParams = new HashSet<>(); - - final NodeList definedInputParameterList = definedInputParameters.getChildNodes(); - for (int i = 0; i < definedInputParameterList.getLength(); i++) { - - final Node currentNode = definedInputParameterList.item(i); - - if (currentNode.getNodeType() == Node.ELEMENT_NODE) { - - final String name = ((Element) currentNode).getAttribute("name"); - - inputParams.add(name); - } - } - - return inputParams; - } - - /** - * Checks if one of the supported properties is defined in the Map and returns an optional with the - * corresponding value. - * - * @param supportedProperties a List of supported properties - * @param propertiesMap a Map containing properties of a NodeTemplateInstance - * @return an Optional with the value of a supported property if one is found, an empty Optional - * otherwise - */ - private static Optional getSupportedProperty(final List supportedProperties, - final Map propertiesMap) { - - return supportedProperties.stream().filter(propertiesMap::containsKey).findFirst().map(propertiesMap::get); - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/PluginHandler.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/PluginHandler.java deleted file mode 100644 index 5a991f06e..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/PluginHandler.java +++ /dev/null @@ -1,193 +0,0 @@ -package org.opentosca.bus.management.service.impl.util; - -import javax.xml.namespace.QName; - -import org.apache.camel.Exchange; -import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; -import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; -import org.opentosca.bus.management.invocation.plugin.script.ManagementBusInvocationPluginScript; -import org.opentosca.bus.management.service.impl.Constants; -import org.opentosca.bus.management.service.impl.servicehandler.ServiceHandler; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Utility class which contains methods to handle the deployment/invocation plug-ins and their - * corresponding types.
- *
- * - * Copyright 2019 IAAS University of Stuttgart - */ -public class PluginHandler { - - private final static Logger LOG = LoggerFactory.getLogger(PluginHandler.class); - - /** - * Calls the invocation plug-in that supports the specific invocation-type and redirects invocations - * on remote OpenTOSCA Containers to the 'remote' plug-in. - * - * @param exchange the exchange that has to be passed to the plug-in. - * @param invocationType the invocation type for the IA/Plan invocation - * @param deploymentLocation the deployment location of the IA/Plan that is invoked - * - * @return the response of the called plug-in. - */ - public static Exchange callMatchingInvocationPlugin(Exchange exchange, String invocationType, - final String deploymentLocation) { - - LOG.debug("Searching a matching invocation plug-in for InvocationType {} and deployment location {}", - invocationType, deploymentLocation); - - // redirect invocation call to 'remote' plug-in if deployment location is not the - // local Container - if (!deploymentLocation.equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME)) { - - // FIXME: find better solution to avoid forwarding of script calls to the - // remote Container - if (!(ServiceHandler.invocationPluginServices.get(invocationType) instanceof ManagementBusInvocationPluginScript)) { - - LOG.debug("Deployment location is remote. Redirecting invocation to remote plug-in."); - - invocationType = Constants.REMOTE_TYPE; - } - } - - final IManagementBusInvocationPluginService invocationPlugin = - ServiceHandler.invocationPluginServices.get(invocationType); - - if (invocationPlugin != null) { - exchange = invocationPlugin.invoke(exchange); - } else { - LOG.warn("No matching plug-in found!"); - } - - return exchange; - } - - /** - * Calls the deployment plug-in that supports the specific deployment type and redirects deployments - * on remote OpenTOSCA Containers to the 'remote' plug-in. - * - * @param exchange the exchange that has to be passed to the plug-in. - * @param deploymentType the deployment type of the IA that shall be deployed - * @param deploymentLocation the deployment location of the IA - * - * @return the response of the called plug-in. - */ - public static Exchange callMatchingDeploymentPlugin(Exchange exchange, String deploymentType, - final String deploymentLocation) { - - LOG.debug("Searching a matching deployment plug-in for deployment type {} and deployment location {}", - deploymentType, deploymentLocation); - - // redirect deployment call to 'remote' plug-in if deployment location is not the - // local Container - if (!deploymentLocation.equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME)) { - LOG.debug("Deployment location is remote. Redirecting deployment to remote plug-in."); - - deploymentType = Constants.REMOTE_TYPE; - } - - final IManagementBusDeploymentPluginService deploymentPlugin = - ServiceHandler.deploymentPluginServices.get(deploymentType); - - if (deploymentPlugin != null) { - exchange = deploymentPlugin.invokeImplementationArtifactDeployment(exchange); - } else { - LOG.warn("No matching plug-in found!"); - } - - return exchange; - } - - /** - * Checks if an deployment plug-in is available that supports the specified artifact and returns the - * deployment type. - * - * @param artifactType to check if supported. - * @return the deployment type or otherwise null. - */ - public static String hasSupportedDeploymentType(final String artifactType) { - - LOG.debug("Searching if a deployment plug-in supports the type {}", artifactType); - - LOG.debug("All supported deployment types: {}", ServiceHandler.deploymentPluginServices.toString()); - - // Check if the ArtifactType can be deployed by a plug-in - if (ServiceHandler.deploymentPluginServices.containsKey(artifactType)) { - return artifactType; - } - - return null; - } - - /** - * Checks if an invocation plug-in is available that supports the specified artifact and returns the - * invocation type. - * - * @param artifactType to check if supported. - * @param csarID to get properties to check for InvocationType. - * @param artifactTemplateID to get properties to check for InvocationTyp. - * @return the invocation type or otherwise null. - */ - public static String hasSupportedInvocationType(final String artifactType, final CSARID csarID, - final QName artifactTemplateID) { - - LOG.debug("Searching if a invocation plug-in supports the type {}", artifactType); - - LOG.debug("All supported invocation types: {}", ServiceHandler.invocationPluginServices.toString()); - - // First check if a plug-in is registered that supports the ArtifactType. - if (ServiceHandler.invocationPluginServices.containsKey(artifactType)) { - return artifactType; - } else { - - final Document properties = - ServiceHandler.toscaEngineService.getPropertiesOfAArtifactTemplate(csarID, artifactTemplateID); - - // Second check if a invocation-type is specified in TOSCA definition - final String invocationType = getInvocationType(properties); - - if (invocationType != null) { - - if (ServiceHandler.invocationPluginServices.containsKey(invocationType)) { - return invocationType; - } - } - } - - return null; - } - - /** - * Checks if a InvocationType was specified in the Tosca.xml and returns it if so. - * - * @param properties to check for InvocationType. - * @return InvocationType if specified. Otherwise null. - */ - private static String getInvocationType(final Document properties) { - - // checks if there are specified properties at all. - if (properties != null) { - final NodeList list = properties.getFirstChild().getChildNodes(); - - for (int i = 0; i < list.getLength(); i++) { - - final Node propNode = list.item(i); - final String localName = propNode.getLocalName(); - - // check if the node contains the InvocationType - if (localName != null && localName.equals("InvocationType")) { - return propNode.getTextContent().trim(); - } - } - } - LOG.debug("No InvocationType found!"); - return null; - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/Util.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/Util.java deleted file mode 100644 index c5c16be13..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/Util.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.opentosca.bus.management.service.impl.util; - -import java.net.URI; -import java.util.Objects; - -import javax.xml.namespace.QName; - -import org.apache.commons.lang3.StringUtils; -import org.opentosca.bus.management.service.impl.servicehandler.ServiceHandler; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class Util { - - private final static Logger LOG = LoggerFactory.getLogger(Util.class); - - /** - * Determine the ServiceTemplateInstanceId long from the ServiceInstanceId QName. - * - * @param serviceInstanceID - * @return the ServiceTemplateInstanceId if the retrieval is successful, Long.MIN_VALUE - * otherwise - */ - public static long determineServiceTemplateInstanceId(final URI serviceInstanceID) { - if (Objects.nonNull(serviceInstanceID)) { - try { - if (serviceInstanceID.toString().contains("/")) { - return Long.parseLong(StringUtils.substringAfterLast(serviceInstanceID.toString(), "/")); - } else { - return Long.parseLong(serviceInstanceID.toString()); - } - } - catch (final NumberFormatException e) { - LOG.error("Unable to parse ServiceTemplateInstance ID out of serviceInstanceID: {}", serviceInstanceID); - } - } else { - LOG.error("Unable to parse ServiceTemplateInstance ID out of serviceInstanceID because it is null!"); - } - return Long.MIN_VALUE; - } - - /** - * Checks if a certain property was specified in the Tosca.xml of the ArtifactTemplate and returns - * it if so. - * - * @param csarID the ID of the CSAR which contains the ArtifactTemplate - * @param artifactTemplateID the ID of the ArtifactTemplate - * @param propertyName the name of the property - * @return the property value if specified, null otherwise - */ - public static String getProperty(final CSARID csarID, final QName artifactTemplateID, final String propertyName) { - final Document properties = - ServiceHandler.toscaEngineService.getPropertiesOfAArtifactTemplate(csarID, artifactTemplateID); - - // check if there are specified properties at all - if (properties != null) { - - final NodeList list = properties.getFirstChild().getChildNodes(); - - // iterate through properties and check name - for (int i = 0; i < list.getLength(); i++) { - - final Node propNode = list.item(i); - - final String localName = propNode.getLocalName(); - - if (localName != null && localName.equals(propertyName)) { - return propNode.getTextContent().trim(); - } - } - } - return null; - } - - /** - * Checks if a PortType property was specified in the Tosca.xml of the ArtifactTemplate and returns - * it if so. - * - * @param csarID the ID of the CSAR which contains the ArtifactTemplate - * @param artifactTemplateID the ID of the ArtifactTemplate - * @return the PortType property value as QName if specified, null otherwise - */ - public static QName getPortTypeQName(final CSARID csarID, final QName artifactTemplateID) { - QName portType = null; - try { - portType = QName.valueOf(getProperty(csarID, artifactTemplateID, "PortType")); - LOG.debug("PortType property: {}", portType.toString()); - return portType; - } - catch (final IllegalArgumentException e) { - LOG.warn("PortType property can not be parsed to QName."); - } - return null; - } -} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/package-info.java b/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/package-info.java deleted file mode 100644 index 3f73f596c..000000000 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/util/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This package contains the utility classes for the Management Bus implementation.
- *
- * Copyright 2018 IAAS University of Stuttgart
- *
- * - * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * - */ -package org.opentosca.bus.management.service.impl.util; diff --git a/org.opentosca.bus.management.service/META-INF/MANIFEST.MF b/org.opentosca.bus.management.service/META-INF/MANIFEST.MF deleted file mode 100644 index 74f916ead..000000000 --- a/org.opentosca.bus.management.service/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management.service -Bundle-SymbolicName: org.opentosca.bus.management.service -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.opentosca.bus.management.service -Import-Package: org.apache.camel;version="2.10.4" diff --git a/org.opentosca.bus.management.service/build.properties b/org.opentosca.bus.management.service/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.bus.management.service/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.bus.management.service/pom.xml b/org.opentosca.bus.management.service/pom.xml deleted file mode 100644 index 50f447828..000000000 --- a/org.opentosca.bus.management.service/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management.service - eclipse-plugin - - diff --git a/org.opentosca.bus.management.service/src/org/opentosca/bus/management/service/IManagementBusService.java b/org.opentosca.bus.management.service/src/org/opentosca/bus/management/service/IManagementBusService.java deleted file mode 100644 index b79aa90a1..000000000 --- a/org.opentosca.bus.management.service/src/org/opentosca/bus/management/service/IManagementBusService.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.opentosca.bus.management.service; - -import org.apache.camel.Exchange; - -/** - * Interface of the Management Bus.
- *
- * - * Copyright 2013 IAAS University of Stuttgart
- *
- * - * The interface specifies two methods. One for deploying an implementation artifact and invoking an - * operation of it. Another method can be used for invoking a plan. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public interface IManagementBusService { - - /** - * Handles the invoke-request of an implementation artifact. This includes the deployment of the - * implementation artifact on a suited infrastructure if needed. - * - * @param exchange contains all needed information like csarID, ServiceTemplateID,... to - * determine the implementation artifact and the data to be transferred to it. - * - * @return the response of the invoked implementation artifact as body of the exchange message. - * - */ - public void invokeIA(Exchange exchange); - - /** - * Handles the invoke-request of a plan. - * - * @param exchange contains all needed information like csarID, PlanID,... to get the endpoint - * of the specified plan and the data to be transferred to it. - * - * @return the response of the invoked plan as body of the exchange message. - * - */ - public void invokePlan(Exchange exchange); -} diff --git a/org.opentosca.bus.management.service/src/org/opentosca/bus/management/service/package-info.java b/org.opentosca.bus.management.service/src/org/opentosca/bus/management/service/package-info.java deleted file mode 100644 index cd9cc51a5..000000000 --- a/org.opentosca.bus.management.service/src/org/opentosca/bus/management/service/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This package contains the interface of the Management Bus. It defines two methods: One for - * invoking an ImplementationArtifact and one for invoking a Plan.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.service; diff --git a/org.opentosca.bus.management/META-INF/MANIFEST.MF b/org.opentosca.bus.management/META-INF/MANIFEST.MF deleted file mode 100644 index 4fc6780ef..000000000 --- a/org.opentosca.bus.management/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.opentosca.bus.management -Bundle-SymbolicName: org.opentosca.bus.management -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.opentosca.bus.management.header, - org.opentosca.bus.management.utils -Import-Package: org.slf4j;version="1.7.2" -Service-Component: OSGI-INF/* -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0" -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.bus.management/OSGI-INF/ServiceHandler - component.xml b/org.opentosca.bus.management/OSGI-INF/ServiceHandler - component.xml deleted file mode 100644 index 2a46255f4..000000000 --- a/org.opentosca.bus.management/OSGI-INF/ServiceHandler - component.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/org.opentosca.bus.management/build.properties b/org.opentosca.bus.management/build.properties deleted file mode 100644 index 563767dc4..000000000 --- a/org.opentosca.bus.management/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/,\ diff --git a/org.opentosca.bus.management/pom.xml b/org.opentosca.bus.management/pom.xml deleted file mode 100644 index efdadb894..000000000 --- a/org.opentosca.bus.management/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.bus.management - eclipse-plugin - - diff --git a/org.opentosca.bus.management/src/org/opentosca/bus/management/header/package-info.java b/org.opentosca.bus.management/src/org/opentosca/bus/management/header/package-info.java deleted file mode 100644 index b7f2da75c..000000000 --- a/org.opentosca.bus.management/src/org/opentosca/bus/management/header/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This package contains an enum that defines needed headers of the camel exchange message used in - * all *MB-bundles.
- *
- * Copyright 2012 IAAS University of Stuttgart
- *
- * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - */ -package org.opentosca.bus.management.header; diff --git a/org.opentosca.bus.management/src/org/opentosca/bus/management/servicehandler/ServiceHandler.java b/org.opentosca.bus.management/src/org/opentosca/bus/management/servicehandler/ServiceHandler.java deleted file mode 100644 index e050fa7bd..000000000 --- a/org.opentosca.bus.management/src/org/opentosca/bus/management/servicehandler/ServiceHandler.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.opentosca.bus.management.servicehandler; - -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.service.IInstanceDataService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Helper class that handles all needed services for MBUtils.
- *
- * - * - * - * @see IToscaEngineService - * @see IInstanceDataService - * - * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * - */ - -public class ServiceHandler { - - public static IInstanceDataService instanceDataService, oldInstanceDataService; - public static IToscaEngineService toscaEngineService, oldToscaEngineService; - - private final static Logger LOG = LoggerFactory.getLogger(ServiceHandler.class); - - - /** - * Bind ToscaEngineService - * - * @param toscaEngineService - */ - public void bindToscaService(final IToscaEngineService toscaEngineService) { - if (toscaEngineService != null) { - if (ServiceHandler.toscaEngineService == null) { - ServiceHandler.toscaEngineService = toscaEngineService; - } else { - ServiceHandler.oldToscaEngineService = toscaEngineService; - ServiceHandler.toscaEngineService = toscaEngineService; - } - - ServiceHandler.LOG.debug("Bind ToscaEngineService: {} bound.", toscaEngineService.toString()); - } else { - ServiceHandler.LOG.error("Bind ToscaEngineService: Supplied parameter is null!"); - } - } - - /** - * Unbind ToscaEngineService - * - * @param toscaEngineService - */ - public void unbindToscaService(IToscaEngineService toscaEngineService) { - if (ServiceHandler.oldToscaEngineService == null) { - toscaEngineService = null; - } else { - ServiceHandler.oldToscaEngineService = null; - } - - ServiceHandler.LOG.debug("ToscaEngineService unbound."); - } - - /** - * Bind InstanceDataService - * - * @param instanceDataService - */ - public void bindInstanceDataService(final IInstanceDataService instanceDataService) { - if (instanceDataService != null) { - if (ServiceHandler.instanceDataService == null) { - ServiceHandler.instanceDataService = instanceDataService; - } else { - ServiceHandler.oldInstanceDataService = instanceDataService; - ServiceHandler.instanceDataService = instanceDataService; - } - - ServiceHandler.LOG.debug("Bind InstanceDataServiceInterface: {} bound.", - ServiceHandler.instanceDataService.toString()); - } else { - ServiceHandler.LOG.error("Bind InstanceDataServiceInterface: Supplied parameter is null!"); - } - } - - /** - * Unbind InstanceDataServiceInterface - * - * @param instanceDataService - */ - public void unbindInstanceDataService(IInstanceDataService instanceDataService) { - if (ServiceHandler.oldInstanceDataService == null) { - instanceDataService = null; - } else { - ServiceHandler.oldInstanceDataService = null; - } - - ServiceHandler.LOG.debug("InstanceDataServiceInterface unbound."); - } - -} diff --git a/org.opentosca.bus.management/src/org/opentosca/bus/management/utils/MBUtils.java b/org.opentosca.bus.management/src/org/opentosca/bus/management/utils/MBUtils.java deleted file mode 100644 index f627c3c38..000000000 --- a/org.opentosca.bus.management/src/org/opentosca/bus/management/utils/MBUtils.java +++ /dev/null @@ -1,440 +0,0 @@ -package org.opentosca.bus.management.utils; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -import javax.xml.namespace.QName; - -import org.opentosca.bus.management.servicehandler.ServiceHandler; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstanceState; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.container.core.tosca.convention.Properties; -import org.opentosca.container.core.tosca.convention.Types; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.traversal.DocumentTraversal; -import org.w3c.dom.traversal.NodeFilter; -import org.w3c.dom.traversal.NodeIterator; - -public class MBUtils { - - final private static Logger LOG = LoggerFactory.getLogger(MBUtils.class); - - // repository to access ServiceTemplateInstance data - final private static ServiceTemplateInstanceRepository serviceTemplateInstanceRepository = - new ServiceTemplateInstanceRepository(); - - /** - * - * Returns the OperatingSystem NodeTemplate. - * - * @param csarID - * @param serviceTemplateID - * @param nodeTemplateID - * - * @return name of the OperatingSystem NodeTemplate. - */ - public static String getOperatingSystemNodeTemplateID(final CSARID csarID, final QName serviceTemplateID, - final String nodeTemplateID, final boolean mustHaveInstance, - final Long serviceTemplateInstanceID) { - - MBUtils.LOG.debug("Searching the OperatingSystemNode of NodeTemplate: {}, ServiceTemplate: {} & CSAR: {} ...", - nodeTemplateID, serviceTemplateID, csarID); - - // fetch all possible hosting nodes - final List hostingNodeTemplateIDs = new ArrayList<>(); - hostingNodeTemplateIDs.add(nodeTemplateID); - hostingNodeTemplateIDs.addAll(ServiceHandler.toscaEngineService.getTransitiveNodeTemplateIDs(csarID, - serviceTemplateID, - nodeTemplateID, - Types.hostedOnRelationType)); - hostingNodeTemplateIDs.addAll(ServiceHandler.toscaEngineService.getTransitiveNodeTemplateIDs(csarID, - serviceTemplateID, - nodeTemplateID, - Types.deployedOnRelationType)); - hostingNodeTemplateIDs.addAll(ServiceHandler.toscaEngineService.getTransitiveNodeTemplateIDs(csarID, - serviceTemplateID, - nodeTemplateID, - Types.dependsOnRelationType)); - - for (final String hostingNodeTemplateId : hostingNodeTemplateIDs) { - final QName nodeType = - ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(csarID, serviceTemplateID, - hostingNodeTemplateId); - - // check if Operating System Node and if instance is needed - if (isOperatingSystemNodeType(csarID, nodeType)) { - if (mustHaveInstance) { - if (getNodeTemplateInstance(serviceTemplateInstanceID, hostingNodeTemplateId) != null) { - return hostingNodeTemplateId; - } - } else { - return hostingNodeTemplateId; - } - } - } - - return null; - } - - public static NodeTemplateInstance getAbstractOSReplacementInstance(NodeTemplateInstance nodeTemplateInstance) { - final Map propMap = nodeTemplateInstance.getPropertiesAsMap(); - if (Objects.nonNull(propMap)) { - for (final String key : propMap.keySet()) { - // if node templ instance is of OS node type + prop is instanceRef, check for selected - // instance - if (key.equals(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_INSTANCEREF)) { - final String value = propMap.get(key); - /* - * values are sent from frontend delimited by "," in following format: - * service-template-instance-id,node-template-id - */ - final String[] setOfValues = value.split(","); - // get selected service template instance id - final Long serviceTemplateInstanceId = Long.parseLong(setOfValues[0]); - // get selected node template id - final String nodeTemplateId = setOfValues[1]; - LOG.debug("Found instanceRef Property: " + key + " with value: " + propMap.get(key)); - - // replace OS node template instance by selected node template instance - nodeTemplateInstance = MBUtils.getNodeTemplateInstance(serviceTemplateInstanceId, nodeTemplateId); - return nodeTemplateInstance; - } - } - } - // return original node template instance - return nodeTemplateInstance; - } - - /** - * - * Checks if the specified NodeType is the OperatingSystem NodeType. - * - * @param csarID - * @param nodeType - * @return true if the specified NodeType is the OperatingSystem NodeType. Otherwise false. - */ - private static boolean isOperatingSystemNodeType(final CSARID csarID, final QName nodeType) { - if (ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, nodeType, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT) - && ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, nodeType, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE)) { - return true; - } else if (ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, nodeType, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_RUNSCRIPT) - && ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, nodeType, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_TRANSFERFILE)) { - return true; - } - return false; - } - - /** - * Returns the OS interface of the given OS Node Type - * - * @param csarID the CSAR Id where the referenced Node Type is declared - * @param nodeType a QName of the Node Type to check - * @return a String containing the name of the OS interface, or if the given Node Type is not an OS - * Node Type null - */ - public static String getInterfaceForOperatingSystemNodeType(final CSARID csarID, final QName nodeType) { - if (ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, nodeType, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT) - && ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, nodeType, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE)) { - return Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM; - } else if (ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, nodeType, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_RUNSCRIPT) - && ServiceHandler.toscaEngineService.doesInterfaceOfTypeContainOperation(csarID, nodeType, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_TRANSFERFILE)) { - return Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER; - } - return null; - } - - /** - * - * Returns the name of the OperatingSystem ImplementationArtifact. - * - * @param csarID - * @param serviceTemplateID - * @param osNodeTemplateID - * - * - * @return name of the OperatingSystem ImplementationArtifact. - */ - public static String getOperatingSystemIA(final CSARID csarID, final QName serviceTemplateID, - final String osNodeTemplateID) { - - MBUtils.LOG.debug("Searching the OperatingSystem-IA of NodeTemplate: {}, ServiceTemplate: {} & CSAR: {} ...", - osNodeTemplateID, serviceTemplateID, csarID); - - final QName osNodeType = - ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(csarID, serviceTemplateID, osNodeTemplateID); - - final List osNodeTypeImpls = - ServiceHandler.toscaEngineService.getTypeImplementationsOfType(csarID, osNodeType); - - for (final QName osNodeTypeImpl : osNodeTypeImpls) { - - MBUtils.LOG.debug("NodeTypeImpl: {} ", osNodeTypeImpl); - - final List osIANames = - ServiceHandler.toscaEngineService.getImplementationArtifactNamesOfTypeImplementation(csarID, - osNodeTypeImpl); - - for (final String osIAName : osIANames) { - - MBUtils.LOG.debug("IA: {} ", osIAName); - - final String osIAInterface = - ServiceHandler.toscaEngineService.getInterfaceOfAImplementationArtifactOfATypeImplementation(csarID, - osNodeTypeImpl, - osIAName); - - MBUtils.LOG.debug("Interface: {} ", osIAInterface); - - if (osIAInterface == null - || osIAInterface.equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM) - || osIAInterface.equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER)) { - return osIAName; - } - } - } - - return null; - } - - /** - * Traverses the topology and searches for the specified property. If found, the value from the - * instance data is returned. - * - * @param nodeTemplateInstanceID the ID of the NodeTemplateInstance where the search should be - * started in downwards direction - * @param property the name of the property that is searched - * @return instance data value of searched property if found, null otherwise. - */ - public static String searchProperty(NodeTemplateInstance nodeTemplateInstance, final String property) { - - MBUtils.LOG.debug("Searching the Property: {} in or under the NodeTemplateInstance ID: {} ...", property, - nodeTemplateInstance.getId()); - - // check if property is already defined at this NodeTemplateInstance - String propertyValue = getInstanceDataPropertyValue(nodeTemplateInstance, property); - - // search until property is found or no new NodeTemplateInstance is found - boolean moreNodeTemplateInstances = true; - while (propertyValue == null && moreNodeTemplateInstances) { - MBUtils.LOG.debug("Property not found at NodeTemplate: {}", nodeTemplateInstance.getTemplateId()); - moreNodeTemplateInstances = false; - - // perform search in downwards direction in the topology - final Collection outgoingRelations = - nodeTemplateInstance.getOutgoingRelations(); - - for (final RelationshipTemplateInstance relation : outgoingRelations) { - final QName relationType = relation.getTemplateType(); - MBUtils.LOG.debug("Found outgoing relation of Type: {}", relationType); - - // only follow relations of kind hostedOn, deployedOn and dependsOn - if (relationType.equals(Types.hostedOnRelationType) || relationType.equals(Types.deployedOnRelationType) - || relationType.equals(Types.dependsOnRelationType)) { - - nodeTemplateInstance = relation.getTarget(); - moreNodeTemplateInstances = true; - - MBUtils.LOG.debug("Found new NodeTemplate: {}. Continue property search.", - nodeTemplateInstance.getTemplateId()); - - // check if new NodeTemplateInstance contains property - propertyValue = getInstanceDataPropertyValue(nodeTemplateInstance, property); - break; - } else { - MBUtils.LOG.debug("RelationshipType is not valid for property search (e.g. hostedOn)."); - } - } - } - - if (propertyValue != null) { - MBUtils.LOG.debug("Searched property: {} with value: {} found in NodeTemplate: {}.", property, - propertyValue, nodeTemplateInstance.getTemplateId()); - } else { - MBUtils.LOG.debug("Searched property: {} not found!", property); - } - - return propertyValue; - - } - - /** - * Returns the value of a certain property of a certain NodeTemplateInstance. - * - * @param nodeTemplateInstance the NodeTemplateInstance - * @param property the name of the property - * @return the value of the property if found, null otherwise. - */ - public static String getInstanceDataPropertyValue(final NodeTemplateInstance nodeTemplateInstance, - final String property) { - final Map propertiesMap = nodeTemplateInstance.getPropertiesAsMap(); - - if (propertiesMap != null) { - return propertiesMap.get(property); - } else { - return null; - } - } - - /** - * Retrieve the NodeTemplateInstance which is contained in a certain ServiceTemplateInstance and has - * a certain template ID. - * - * @param serviceTemplateInstanceID this ID identifies the ServiceTemplateInstance - * @param nodeTemplateID the template ID to identify the correct instance - * @return the found NodeTemplateInstance or null if no instance was found that matches the - * parameters - */ - public static NodeTemplateInstance getNodeTemplateInstance(final Long serviceTemplateInstanceID, - final String nodeTemplateID) { - MBUtils.LOG.debug("Trying to retrieve NodeTemplateInstance for ServiceTemplateInstance ID {} and NodeTemplate ID {} ...", - serviceTemplateInstanceID, nodeTemplateID); - - final Optional serviceTemplateInstance = - serviceTemplateInstanceRepository.find(serviceTemplateInstanceID); - - if (serviceTemplateInstance.isPresent()) { - return serviceTemplateInstance.get().getNodeTemplateInstances().stream() - .filter((nodeInstance) -> nodeInstance.getTemplateId().getLocalPart() - .equals(nodeTemplateID)) - .filter((nodeInstance) -> nodeInstance.getState() - .equals(NodeTemplateInstanceState.CREATED) - || nodeInstance.getState().equals(NodeTemplateInstanceState.STARTED)) - .findFirst().orElse(null); - } else { - MBUtils.LOG.warn("Unable to find ServiceTemplateInstance!"); - return null; - } - } - - /** - * Get the next NodeTemplateInstance connected with a HostedOn/DeployedOn/... Relation. - * - * @param currentNode the current NodeTemplateInstance - * @return an Optional containing the next NodeTemplateInstance if one is connected with one of the - * supported Relation Types or an empty Optional otherwise - */ - public static Optional getNextNodeTemplateInstance(final NodeTemplateInstance currentNode) { - - Optional nextNode = - getConnectedNodeTemplateInstance(currentNode, Types.hostedOnRelationType); - - if (!nextNode.isPresent()) { - nextNode = getConnectedNodeTemplateInstance(currentNode, Types.deployedOnRelationType); - } - - return nextNode; - } - - /** - * Get the next NodeTemplateInstance connected with a Relation of the given type. - * - * @param currentNode the current NodeTemplateInstance - * @param relationshipType the type of the Relation as QName - * @return an Optional containing the next NodeTemplateInstance if one is connected with a Relation - * of the specified type or an empty Optional otherwise - */ - private static Optional getConnectedNodeTemplateInstance(final NodeTemplateInstance currentNode, - final QName relationshipType) { - return currentNode.getOutgoingRelations().stream() - .filter(relation -> relation.getTemplateType().equals(relationshipType)).findFirst() - .map(relation -> relation.getTarget()); - } - - /** - * Retrieve the RelationshipTemplateInstance which is contained in a certain ServiceTemplateInstance - * and has a certain template ID. - * - * @param serviceTemplateInstanceID this ID identifies the ServiceTemplateInstance - * @param relationshipTemplateID the template ID to identify the correct instance - * @return the found RelationshipTemplateInstance or null if no instance was found that - * matches the parameters - */ - public static RelationshipTemplateInstance getRelationshipTemplateInstance(final Long serviceTemplateInstanceID, - final String relationshipTemplateID) { - MBUtils.LOG.debug("Trying to retrieve RelationshipTemplateInstance for ServiceTemplateInstance ID {} and RelationshipTemplate ID {} ...", - serviceTemplateInstanceID, relationshipTemplateID); - - final Optional serviceTemplateInstance = - serviceTemplateInstanceRepository.find(serviceTemplateInstanceID); - - if (serviceTemplateInstance.isPresent()) { - return serviceTemplateInstance.get().getNodeTemplateInstances().stream() - .flatMap(nodeInstance -> nodeInstance.getOutgoingRelations().stream()) - .filter(relationshipInstance -> relationshipInstance.getTemplateId() - .getLocalPart() - .equals(relationshipTemplateID)) - .findFirst().orElse(null); - } else { - MBUtils.LOG.warn("Unable to find ServiceTemplateInstance!"); - return null; - } - } - - /** - * Transfers the properties document to a map. - * - * @param propertiesDocument to be transfered to a map. - * @return transfered map. - */ - public static HashMap docToMap(final Document propertiesDocument, final boolean allowEmptyEntries) { - final HashMap reponseMap = new HashMap<>(); - - final DocumentTraversal traversal = (DocumentTraversal) propertiesDocument; - final NodeIterator iterator = - traversal.createNodeIterator(propertiesDocument.getDocumentElement(), NodeFilter.SHOW_ELEMENT, null, true); - - for (Node node = iterator.nextNode(); node != null; node = iterator.nextNode()) { - - final String name = ((Element) node).getLocalName(); - final StringBuilder content = new StringBuilder(); - final NodeList children = node.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - final Node child = children.item(i); - if (child.getNodeType() == Node.TEXT_NODE) { - content.append(child.getTextContent()); - } - } - - if (allowEmptyEntries) { - reponseMap.put(name, content.toString()); - } else { - if (!content.toString().trim().isEmpty()) { - reponseMap.put(name, content.toString()); - } - } - } - - return reponseMap; - } -} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/pom.xml b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/pom.xml new file mode 100644 index 000000000..e3134bb38 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.application.api.jsonhttp + + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + org.opentosca + org.opentosca.bus.application.model + ${project.version} + + + org.restlet.jee + org.restlet + 2.3.6 + + + org.apache.camel + camel-restlet + ${camel.version} + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + org.opentosca + org.opentosca.bus.application.service + ${project.version} + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/ExceptionProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/ExceptionProcessor.java new file mode 100644 index 000000000..f192002fa --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/ExceptionProcessor.java @@ -0,0 +1,50 @@ +package org.opentosca.bus.application.api.jsonhttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.parser.ParseException; +import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; +import org.restlet.Response; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ExceptionProcessor of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * This processor handles the exceptions and sends a reasonable response back to the caller. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class ExceptionProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(ExceptionProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + ExceptionProcessor.LOG.debug("Exception handling..."); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof ParseException) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + response.setEntity("JSON is not valid: " + exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else if (exchange.getIn().getBody() instanceof NullPointerException) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + response.setEntity("Needed information not specified.", MediaType.TEXT_ALL); + } else if (exchange.getIn().getBody() instanceof ApplicationBusExternalException) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else if (exchange.getIn().getBody() instanceof ApplicationBusInternalException) { + response.setStatus(Status.SERVER_ERROR_INTERNAL); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } + + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/GetResultRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/GetResultRequestProcessor.java new file mode 100644 index 000000000..2bc5e6e49 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/GetResultRequestProcessor.java @@ -0,0 +1,36 @@ +package org.opentosca.bus.application.api.jsonhttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.application.api.jsonhttp.route.Route; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * GetResultRequestProcessor of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * This processor handles "getResult" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class GetResultRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(GetResultRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + GetResultRequestProcessor.LOG.debug("Processing GetResult request...."); + + final Integer requestID = exchange.getIn().getHeader(Route.ID, Integer.class); + + GetResultRequestProcessor.LOG.debug("RequestID: {}", requestID); + + exchange.getIn().setBody(requestID); + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_GET_RESULT.toString()); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/GetResultResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/GetResultResponseProcessor.java new file mode 100644 index 000000000..2db29ba4d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/GetResultResponseProcessor.java @@ -0,0 +1,54 @@ +package org.opentosca.bus.application.api.jsonhttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.JSONObject; +import org.opentosca.bus.application.api.jsonhttp.route.Route; +import org.restlet.Response; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * GetResultResponseProcessor of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * This processor handles the responses of "getResult" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class GetResultResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(GetResultResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + GetResultResponseProcessor.LOG.debug("Processing GetResult response...."); + + final String requestID = exchange.getIn().getHeader(Route.ID, String.class); + + GetResultResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof Exception) { + + response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else { + + final String result = exchange.getIn().getBody(String.class); + + final JSONObject obj = new JSONObject(); + obj.put("result", result); + + response.setStatus(Status.SUCCESS_OK); + response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); + } + + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/InvocationRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/InvocationRequestProcessor.java new file mode 100644 index 000000000..fa5d9f1a0 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/InvocationRequestProcessor.java @@ -0,0 +1,134 @@ +package org.opentosca.bus.application.api.jsonhttp.processor; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.json.simple.parser.ContainerFactory; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * InvocationRequestProcessor of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * This processor handles "invokeOperation" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class InvocationRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(InvocationRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws NullPointerException, ParseException { + + String nodeTemplateID = null; + Integer nodeInstanceID = null; + Integer serviceInstanceID = null; + String interfaceName = null; + String operationName = null; + LinkedHashMap params; + + InvocationRequestProcessor.LOG.debug("Processing Invocation request..."); + + final String bodyString = exchange.getIn().getBody(String.class); + + final LinkedHashMap> requestMap = requestToMap(bodyString); + + final LinkedHashMap infosMap = requestMap.get("invocation-information"); + + if (infosMap != null) { + + if (infosMap.containsKey("serviceInstanceID")) { + serviceInstanceID = ((Long) infosMap.get("serviceInstanceID")).intValue(); + InvocationRequestProcessor.LOG.debug("serviceInstanceID: {}", serviceInstanceID); + exchange.getIn().setHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), + serviceInstanceID); + } + if (infosMap.containsKey("nodeInstanceID")) { + nodeInstanceID = ((Long) infosMap.get("nodeInstanceID")).intValue(); + InvocationRequestProcessor.LOG.debug("nodeInstanceID: {}", nodeInstanceID); + exchange.getIn().setHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), nodeInstanceID); + } + if (infosMap.containsKey("nodeTemplateID")) { + nodeTemplateID = (String) infosMap.get("nodeTemplateID"); + InvocationRequestProcessor.LOG.debug("nodeTemplateID: {}", nodeTemplateID); + exchange.getIn().setHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), nodeTemplateID); + } + if (infosMap.containsKey("interface")) { + interfaceName = (String) infosMap.get("interface"); + InvocationRequestProcessor.LOG.debug("interfaceName: {}", interfaceName); + exchange.getIn().setHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), interfaceName); + } + if (infosMap.containsKey("operation")) { + operationName = (String) infosMap.get("operation"); + InvocationRequestProcessor.LOG.debug("operationName: {}", operationName); + exchange.getIn().setHeader(ApplicationBusConstants.OPERATION_NAME.toString(), operationName); + } + + final LinkedHashMap paramsMap = requestMap.get("params"); + + params = new LinkedHashMap<>(); + + if (paramsMap != null) { + + InvocationRequestProcessor.LOG.debug("Params:"); + + for (final Entry set : paramsMap.entrySet()) { + + final String name = set.getKey(); + InvocationRequestProcessor.LOG.debug("Name: {}", name); + + final Object value = set.getValue(); + InvocationRequestProcessor.LOG.debug("Value: {}", set.getValue()); + + params.put(name, value); + } + } else { + InvocationRequestProcessor.LOG.debug("No parameter specified."); + } + } else { + InvocationRequestProcessor.LOG.warn("Needed information not specified."); + throw new NullPointerException(); + } + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); + + exchange.getIn().setBody(params); + } + + /** + * Parses and maps a json String to a {@literal LinkedHashMap>}. + * + * @return LinkedHashMap + */ + private LinkedHashMap> requestToMap(final String body) throws ParseException { + + final ContainerFactory orderedKeyFactory = new ContainerFactory() { + @Override + public Map> createObjectContainer() { + return new LinkedHashMap<>(); + } + + @Override + public List creatArrayContainer() { + // TODO Auto-generated method stub + return null; + } + }; + + final JSONParser parser = new JSONParser(); + + final Object obj = parser.parse(body, orderedKeyFactory); + + return (LinkedHashMap>) obj; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/InvocationResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/InvocationResponseProcessor.java new file mode 100644 index 000000000..44bd018f7 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/InvocationResponseProcessor.java @@ -0,0 +1,38 @@ +package org.opentosca.bus.application.api.jsonhttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.opentosca.bus.application.api.jsonhttp.route.Route; +import org.restlet.Response; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * InvocationResponseProcessor of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * This processor handles the responses of "invokeOperation" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class InvocationResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(InvocationResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + InvocationResponseProcessor.LOG.debug("Processing Invocation response...."); + + final String requestID = exchange.getIn().getBody(String.class); + + InvocationResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + response.setStatus(Status.SUCCESS_ACCEPTED); + response.setLocationRef(Route.POLL_ENDPOINT.replace(Route.ID_PLACEHODLER, requestID)); + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedRequestProcessor.java new file mode 100644 index 000000000..561cb68f2 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedRequestProcessor.java @@ -0,0 +1,36 @@ +package org.opentosca.bus.application.api.jsonhttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.application.api.jsonhttp.route.Route; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * IsFinishedRequestProcessor of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * This processor handles "isFinished" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class IsFinishedRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(IsFinishedRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + IsFinishedRequestProcessor.LOG.debug("Processing IsFinished request...."); + + final Integer requestID = exchange.getIn().getHeader(Route.ID, Integer.class); + + IsFinishedRequestProcessor.LOG.debug("RequestID: {}", requestID); + + exchange.getIn().setBody(requestID); + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_IS_FINISHED.toString()); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedResponseProcessor.java new file mode 100644 index 000000000..24400da29 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/processor/IsFinishedResponseProcessor.java @@ -0,0 +1,62 @@ +package org.opentosca.bus.application.api.jsonhttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.JSONObject; +import org.opentosca.bus.application.api.jsonhttp.route.Route; +import org.restlet.Response; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * IsFinishedResponseProcessor of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * This processor handles the responses of "isFinished" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class IsFinishedResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(IsFinishedResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + IsFinishedResponseProcessor.LOG.debug("Processing IsFinished response...."); + + final String requestID = exchange.getIn().getHeader(Route.ID, String.class); + + IsFinishedResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof Exception) { + + response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else { + + final Boolean isFinished = exchange.getIn().getBody(Boolean.class); + + if (isFinished) { + IsFinishedResponseProcessor.LOG.debug("Invocation has finished, send location of result."); + + response.setStatus(Status.REDIRECTION_SEE_OTHER); + response.setLocationRef(Route.GET_RESULT_ENDPOINT.replace(Route.ID_PLACEHODLER, requestID)); + } else { + IsFinishedResponseProcessor.LOG.debug("Invocation has not finished yet."); + + final JSONObject obj = new JSONObject(); + obj.put("status", "PENDING"); + + response.setStatus(Status.SUCCESS_OK); + response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); + } + exchange.getOut().setBody(response); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/route/Route.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/route/Route.java new file mode 100644 index 000000000..0988b3451 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/route/Route.java @@ -0,0 +1,87 @@ +package org.opentosca.bus.application.api.jsonhttp.route; + +import org.apache.camel.Exchange; +import org.apache.camel.Predicate; +import org.apache.camel.builder.PredicateBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.builder.ValueBuilder; +import org.opentosca.bus.application.api.jsonhttp.processor.ExceptionProcessor; +import org.opentosca.bus.application.api.jsonhttp.processor.GetResultRequestProcessor; +import org.opentosca.bus.application.api.jsonhttp.processor.GetResultResponseProcessor; +import org.opentosca.bus.application.api.jsonhttp.processor.InvocationRequestProcessor; +import org.opentosca.bus.application.api.jsonhttp.processor.InvocationResponseProcessor; +import org.opentosca.bus.application.api.jsonhttp.processor.IsFinishedRequestProcessor; +import org.opentosca.bus.application.api.jsonhttp.processor.IsFinishedResponseProcessor; +import org.opentosca.bus.application.api.jsonhttp.servicehandler.ApplicationBusServiceHandler; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; + +/** + * Route of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * The endpoint of the JSON/HTTP-API is created here. Incoming requests will be routed to processors or the application + * bus in order to handle the requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class Route extends RouteBuilder { + + public static final String ID = "id"; + public static final String ID_PLACEHODLER = "{" + Route.ID + "}"; + public static final String POLL_ENDPOINT = Route.INVOKE_ENDPOINT + "/activeRequests/" + Route.ID_PLACEHODLER; + public static final String GET_RESULT_ENDPOINT = Route.POLL_ENDPOINT + "/response"; + + private static final String HOST = "http://localhost"; + + private static final String PORT = "8083"; + private static final String BASE_ENDPOINT = Route.HOST + ":" + Route.PORT; + + private static final String INVOKE_ENDPOINT = "/OTABService/v1/appInvoker"; + + private static final String TO_APP_BUS_ENDPOINT = "direct:toAppBus"; + + @Override + public void configure() throws Exception { + + final ValueBuilder APP_BUS_ENDPOINT = new ValueBuilder(method(ApplicationBusServiceHandler.class, "getApplicationBusRoutingEndpoint")); + final Predicate APP_BUS_ENDPOINT_EXISTS = PredicateBuilder.isNotNull(APP_BUS_ENDPOINT); + + final InvocationRequestProcessor invocationRequestProcessor = new InvocationRequestProcessor(); + final InvocationResponseProcessor invocationResponseProcessor = new InvocationResponseProcessor(); + final IsFinishedRequestProcessor isFinishedRequestProcessor = new IsFinishedRequestProcessor(); + final IsFinishedResponseProcessor isFinishedResponseProcessor = new IsFinishedResponseProcessor(); + final GetResultRequestProcessor getResultRequestProcessor = new GetResultRequestProcessor(); + final GetResultResponseProcessor getResultResponseProcessor = new GetResultResponseProcessor(); + final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); + + // handle exceptions + + onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) + .process(exceptionProcessor); + + // invoke route + from("restlet:" + Route.BASE_ENDPOINT + Route.INVOKE_ENDPOINT + "?restletMethod=post") + .process(invocationRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT).choice() + .when(property(Exchange.EXCEPTION_CAUGHT).isNull()).process(invocationResponseProcessor).removeHeaders("*") + .otherwise().process(exceptionProcessor); + + // isFinished route + from("restlet:" + Route.BASE_ENDPOINT + Route.POLL_ENDPOINT + "?restletMethod=get") + .process(isFinishedRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT).process(isFinishedResponseProcessor) + .removeHeaders("*"); + + // getResult route + from("restlet:" + Route.BASE_ENDPOINT + Route.GET_RESULT_ENDPOINT + "?restletMethod=get") + .process(getResultRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT).process(getResultResponseProcessor) + .removeHeaders("*"); + + // applicationBus route, throws exception if Application Bus is not + // running or wasn't binded + from(Route.TO_APP_BUS_ENDPOINT).choice().when(APP_BUS_ENDPOINT_EXISTS).recipientList(APP_BUS_ENDPOINT) + .endChoice().otherwise().to("direct:handleException"); + + // handle exception if Application Bus is not running or wasn't binded + from("direct:handleException") + .throwException(new ApplicationBusInternalException("The Application Bus is not running.")); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/servicehandler/ApplicationBusServiceHandler.java b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/servicehandler/ApplicationBusServiceHandler.java new file mode 100644 index 000000000..ef3d0a184 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/java/org/opentosca/bus/application/api/jsonhttp/servicehandler/ApplicationBusServiceHandler.java @@ -0,0 +1,38 @@ +package org.opentosca.bus.application.api.jsonhttp.servicehandler; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.opentosca.bus.application.service.IApplicationBusService; +import org.springframework.stereotype.Service; + +/** + * Service Handler of the Application Bus-JSON/HTTP-API.
+ *
+ *

+ * Here the implementation of the IApplicationBusService is binded or unbinded. During the binding the routing endpoint + * of the Application Bus is handed over. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @see IApplicationBusService + */ +@Service +@Singleton +@Deprecated +public class ApplicationBusServiceHandler { + + // Routing endpoint of the IApplicationBus implementation. + private final String applicationBusRoutingEndpoint; + + @Inject + public ApplicationBusServiceHandler(String applicationBusRoutingEndpoint) { + this.applicationBusRoutingEndpoint = applicationBusRoutingEndpoint; + } + + /** + * @return The Routing endpoint of the ApplicationBus + */ + public String getApplicationBusRoutingEndpoint() { + return applicationBusRoutingEndpoint; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/resources/spring/context-bus-application-api.xml b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/resources/spring/context-bus-application-api.xml new file mode 100644 index 000000000..649e4c33f --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.jsonhttp/src/main/resources/spring/context-bus-application-api.xml @@ -0,0 +1,19 @@ + + + + + + + + org.opentosca.bus.application.api.jsonhttp.route + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/pom.xml b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/pom.xml new file mode 100644 index 000000000..d4059ee23 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + + + + Spring Plugins Public Repository + spring-plugins + http://repo.spring.io/plugins-release/ + + + + org.opentosca.bus.application.api.resthttp + + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + org.opentosca + org.opentosca.bus.application.model + ${project.version} + + + org.opentosca + org.opentosca.bus.application.service + ${project.version} + + + org.apache.camel + camel-restlet + 2.18.3 + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/ExceptionProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/ExceptionProcessor.java new file mode 100644 index 000000000..20dc9de10 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/ExceptionProcessor.java @@ -0,0 +1,71 @@ +package org.opentosca.bus.application.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.parser.ParseException; +import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; +import org.restlet.Response; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.SAXParseException; + +/** + * ExceptionProcessor of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * This processor handles the exceptions and sends a reasonable response back to the caller. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class ExceptionProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(ExceptionProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + ExceptionProcessor.LOG.debug("Exception handling..."); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof ParseException) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + response.setEntity("JSON is not valid: " + exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else if (exchange.getIn().getBody() instanceof SAXParseException) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + response.setEntity("XML is not valid: " + exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else if (exchange.getIn().getBody() instanceof NullPointerException) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + response.setEntity("Needed information not specified.", MediaType.TEXT_ALL); + } else if (exchange.getIn().getBody() instanceof ApplicationBusExternalException) { + + final ApplicationBusExternalException e = exchange.getIn().getBody(ApplicationBusExternalException.class); + if (e.getErrorCode() != 0) { + response.setStatus(new Status(e.getErrorCode())); + } else { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + } + + response.setEntity(e.getMessage(), MediaType.TEXT_ALL); + } else if (exchange.getIn().getBody() instanceof ApplicationBusInternalException) { + + final ApplicationBusInternalException e = exchange.getIn().getBody(ApplicationBusInternalException.class); + if (e.getErrorCode() != 0) { + response.setStatus(new Status(e.getErrorCode())); + } else { + response.setStatus(Status.SERVER_ERROR_INTERNAL); + } + + response.setEntity(e.getMessage(), MediaType.TEXT_ALL); + } else if (exchange.getIn().getBody() instanceof Exception) { + response.setStatus(Status.SERVER_ERROR_INTERNAL); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } + + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/GetResultRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/GetResultRequestProcessor.java new file mode 100644 index 000000000..baa39393f --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/GetResultRequestProcessor.java @@ -0,0 +1,36 @@ +package org.opentosca.bus.application.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.application.api.resthttp.route.Route; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * GetResultRequestProcessor of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * This processor handles "getResult" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class GetResultRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(GetResultRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + GetResultRequestProcessor.LOG.debug("Processing GetResult request...."); + + final Integer requestID = exchange.getIn().getHeader(Route.ID, Integer.class); + + GetResultRequestProcessor.LOG.debug("RequestID: {}", requestID); + + exchange.getIn().setBody(requestID); + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_GET_RESULT.toString()); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/GetResultResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/GetResultResponseProcessor.java new file mode 100644 index 000000000..a4d8f5b6f --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/GetResultResponseProcessor.java @@ -0,0 +1,76 @@ +package org.opentosca.bus.application.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.JSONObject; +import org.opentosca.bus.application.api.resthttp.route.Route; +import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; +import org.restlet.Response; +import org.restlet.data.Form; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * GetResultResponseProcessor of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * This processor handles the responses of "getResult" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class GetResultResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(GetResultResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + GetResultResponseProcessor.LOG.debug("Processing GetResult response...."); + + final String requestID = exchange.getIn().getHeader(Route.ID, String.class); + + GetResultResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof Exception) { + + response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else { + + final Form httpHeaders = (Form) exchange.getIn().getHeader("org.restlet.http.headers"); + final String acceptContentType = httpHeaders.getValues("Accept").toString(); + + GetResultResponseProcessor.LOG.debug("AcceptContentType: {}", acceptContentType); + + final String result = exchange.getIn().getBody(String.class); + + if (acceptContentType.equals(MediaType.APPLICATION_JSON.getName())) { + + final JSONObject obj = new JSONObject(); + obj.put("result", result); + + response.setStatus(Status.SUCCESS_OK); + response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); + } else if (acceptContentType.equals(MediaType.APPLICATION_XML.getName())) { + + response.setStatus(Status.SUCCESS_OK); + response.setEntity("" + result + "", MediaType.APPLICATION_XML); + } else { + GetResultResponseProcessor.LOG.warn("The requested entity media type (Accept header) is not supported. Supported types are {} and {}", + MediaType.APPLICATION_JSON.getName(), + MediaType.APPLICATION_XML.getName()); + throw new ApplicationBusExternalException( + "The requested request entity media type (Accept header) is not supported. Supported types are " + + MediaType.APPLICATION_JSON.getName() + " and " + MediaType.APPLICATION_XML.getName(), + Status.CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE.getCode()); + } + } + + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/InvocationRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/InvocationRequestProcessor.java new file mode 100644 index 000000000..1fa47fc0e --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/InvocationRequestProcessor.java @@ -0,0 +1,169 @@ +package org.opentosca.bus.application.api.resthttp.processor; + +import java.io.IOException; +import java.io.StringReader; +import java.util.LinkedHashMap; +import java.util.List; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.json.simple.parser.ContainerFactory; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +import org.opentosca.bus.application.api.resthttp.route.Route; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; +import org.restlet.data.Form; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * InvocationRequestProcessor of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * This processor handles "invokeOperation" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class InvocationRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(InvocationRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws ParseException, ApplicationBusExternalException, SAXException { + + String nodeTemplateID = null; + Integer nodeInstanceID = null; + Integer serviceInstanceID = null; + String interfaceName = null; + String operationName = null; + LinkedHashMap params = null; + + InvocationRequestProcessor.LOG.debug("Processing Invocation request..."); + + final Message message = exchange.getIn(); + + serviceInstanceID = message.getHeader(Route.SI, Integer.class); + InvocationRequestProcessor.LOG.debug("ServiceInstanceID: {}", serviceInstanceID); + exchange.getIn().setHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), serviceInstanceID); + + nodeInstanceID = message.getHeader(Route.NI, Integer.class); + InvocationRequestProcessor.LOG.debug("NodeInstanceID: {}", nodeInstanceID); + exchange.getIn().setHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), nodeInstanceID); + + nodeTemplateID = message.getHeader(Route.NT, String.class); + InvocationRequestProcessor.LOG.debug("NodeTemplateID: {}", nodeTemplateID); + exchange.getIn().setHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), nodeTemplateID); + + interfaceName = message.getHeader(Route.IN, String.class); + InvocationRequestProcessor.LOG.debug("Interface: {}", interfaceName); + exchange.getIn().setHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), interfaceName); + + operationName = message.getHeader(Route.ON, String.class); + InvocationRequestProcessor.LOG.debug("Operation: {}", operationName); + exchange.getIn().setHeader(ApplicationBusConstants.OPERATION_NAME.toString(), operationName); + + final Form httpHeaders = (Form) exchange.getIn().getHeader("org.restlet.http.headers"); + final String contentType = httpHeaders.getValues("Content-Type").toString(); + + InvocationRequestProcessor.LOG.debug("Content-Type: {}", contentType); + + final String bodyString = message.getBody(String.class); + + if (bodyString != null) { + + if (contentType != null && contentType.equals(MediaType.APPLICATION_JSON.getName())) { + + params = jsonStringToMap(bodyString); + } else if (contentType != null && contentType.equals(MediaType.APPLICATION_XML.getName())) { + + params = xmlStringToMap(bodyString); + } else { + InvocationRequestProcessor.LOG.warn("The request entity media type is not supported. Supported types are {} and {}", + MediaType.APPLICATION_JSON.getName(), + MediaType.APPLICATION_XML.getName()); + throw new ApplicationBusExternalException( + "The request entity media type is not supported. Supported types are " + + MediaType.APPLICATION_JSON.getName() + " and " + MediaType.APPLICATION_XML.getName(), + Status.CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE.getCode()); + } + } + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); + + exchange.getIn().setBody(params); + } + + /** + * Parses and maps a json String to a {@literal LinkedHashMap}. + * + * @return LinkedHashMap + */ + private LinkedHashMap jsonStringToMap(final String jsonString) throws ParseException { + + final ContainerFactory orderedKeyFactory = new ContainerFactory() { + @Override + public LinkedHashMap createObjectContainer() { + return new LinkedHashMap<>(); + } + + @Override + public List creatArrayContainer() { + // TODO Auto-generated method stub + return null; + } + }; + + final JSONParser parser = new JSONParser(); + + final Object obj = parser.parse(jsonString, orderedKeyFactory); + + return (LinkedHashMap) obj; + } + + private LinkedHashMap xmlStringToMap(final String xmlString) throws SAXException { + + final LinkedHashMap params = new LinkedHashMap<>(); + + final Document xml = convertStringToDocument(xmlString); + final Node parent = xml.getFirstChild(); + final NodeList childs = parent.getChildNodes(); + Node child; + for (int i = 0; i < childs.getLength(); i++) { + child = childs.item(i); + + if (child.getNodeType() == Node.ELEMENT_NODE) { + params.put(child.getNodeName(), child.getTextContent()); + } + } + + return params; + } + + private static Document convertStringToDocument(final String xmlString) throws SAXException { + final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder; + + try { + builder = factory.newDocumentBuilder(); + final Document doc = builder.parse(new InputSource(new StringReader(xmlString))); + return doc; + } catch (ParserConfigurationException | IOException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/InvocationResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/InvocationResponseProcessor.java new file mode 100644 index 000000000..efc38b366 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/InvocationResponseProcessor.java @@ -0,0 +1,43 @@ +package org.opentosca.bus.application.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.opentosca.bus.application.api.resthttp.route.Route; +import org.restlet.Response; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * InvocationResponseProcessor of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * This processor handles the responses of "invokeOperation" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class InvocationResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(InvocationResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + InvocationResponseProcessor.LOG.debug("Processing Invocation response...."); + + final String requestID = exchange.getIn().getBody(String.class); + + InvocationResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final String invokeURI = exchange.getIn().getHeader(Exchange.HTTP_URI, String.class); + final String pollingURI = invokeURI + Route.POLL_ENDPOINT_SUFFIX.replace(Route.ID_PLACEHODLER, requestID); + + InvocationResponseProcessor.LOG.debug("Polling URI: {}", pollingURI); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + response.setStatus(Status.SUCCESS_ACCEPTED); + response.setLocationRef(pollingURI); + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/IsFinishedRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/IsFinishedRequestProcessor.java new file mode 100644 index 000000000..c3c838233 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/IsFinishedRequestProcessor.java @@ -0,0 +1,36 @@ +package org.opentosca.bus.application.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.application.api.resthttp.route.Route; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * IsFinishedRequestProcessor of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * This processor handles "isFinished" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class IsFinishedRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(IsFinishedRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + IsFinishedRequestProcessor.LOG.debug("Processing IsFinished request...."); + + final Integer requestID = exchange.getIn().getHeader(Route.ID, Integer.class); + + IsFinishedRequestProcessor.LOG.debug("RequestID: {}", requestID); + + exchange.getIn().setBody(requestID); + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_IS_FINISHED.toString()); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/IsFinishedResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/IsFinishedResponseProcessor.java new file mode 100644 index 000000000..7d973ee46 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/processor/IsFinishedResponseProcessor.java @@ -0,0 +1,84 @@ +package org.opentosca.bus.application.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.JSONObject; +import org.opentosca.bus.application.api.resthttp.route.Route; +import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; +import org.restlet.Response; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * IsFinishedResponseProcessor of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * This processor handles the responses of "isFinished" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class IsFinishedResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(IsFinishedResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + IsFinishedResponseProcessor.LOG.debug("Processing IsFinished response...."); + + final String requestID = exchange.getIn().getHeader(Route.ID, String.class); + + IsFinishedResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof Exception) { + + response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else { + + final Boolean isFinished = exchange.getIn().getBody(Boolean.class); + + if (isFinished) { + IsFinishedResponseProcessor.LOG.debug("Invocation has finished, send location of result."); + + final String pollingURI = exchange.getIn().getHeader(Exchange.HTTP_URI, String.class); + final String getResultURI = + pollingURI + Route.GET_RESULT_ENDPOINT_SUFFIX.replace(Route.ID_PLACEHODLER, requestID); + + IsFinishedResponseProcessor.LOG.debug("GetResult URI: {}", getResultURI); + + response.setStatus(Status.REDIRECTION_SEE_OTHER); + response.setLocationRef(getResultURI); + } else { + IsFinishedResponseProcessor.LOG.debug("Invocation has not finished yet."); + + final String acceptContentType = exchange.getIn().getHeader(Exchange.ACCEPT_CONTENT_TYPE, String.class); + + IsFinishedResponseProcessor.LOG.debug("AcceptContentType: {}", acceptContentType); + + if (acceptContentType.equals(MediaType.APPLICATION_JSON)) { + + final JSONObject obj = new JSONObject(); + obj.put("status", "PENDING"); + + response.setStatus(Status.SUCCESS_OK); + response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); + } else if (acceptContentType.equals(MediaType.APPLICATION_XML)) { + + response.setStatus(Status.SUCCESS_OK); + response.setEntity("PENDING", MediaType.APPLICATION_XML); + } else { + IsFinishedResponseProcessor.LOG.warn("The requested entity media type is not supported."); + throw new ApplicationBusExternalException("The requested entity media type is not supported.", + Status.CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE.getCode()); + } + } + exchange.getOut().setBody(response); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/route/Route.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/route/Route.java new file mode 100644 index 000000000..146e2996d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/route/Route.java @@ -0,0 +1,129 @@ +package org.opentosca.bus.application.api.resthttp.route; + +import org.apache.camel.Exchange; +import org.apache.camel.Predicate; +import org.apache.camel.builder.PredicateBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.builder.ValueBuilder; +import org.opentosca.bus.application.api.resthttp.processor.ExceptionProcessor; +import org.opentosca.bus.application.api.resthttp.processor.GetResultRequestProcessor; +import org.opentosca.bus.application.api.resthttp.processor.GetResultResponseProcessor; +import org.opentosca.bus.application.api.resthttp.processor.InvocationRequestProcessor; +import org.opentosca.bus.application.api.resthttp.processor.InvocationResponseProcessor; +import org.opentosca.bus.application.api.resthttp.processor.IsFinishedRequestProcessor; +import org.opentosca.bus.application.api.resthttp.processor.IsFinishedResponseProcessor; +import org.opentosca.bus.application.api.resthttp.servicehandler.ApplicationBusServiceHandler; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; + +/** + * Route of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * The endpoint of the REST/HTTP-API is created here. Incoming requests will be routed to processors or the application + * bus in order to handle the requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class Route extends RouteBuilder { + + public static final String SI = "ServiceInstanceID"; + public static final String NT = "NodeTemplateID"; + public static final String NI = "NodeInstanceID"; + public static final String IN = "InterfaceName"; + public static final String ON = "OperationName"; + + public static final String INVOKE_ENDPOINT_SI = "/OTABService/v1/ServiceInstances/{" + Route.SI + "}/Nodes/{" + + Route.NT + "}/ApplicationInterfaces/{" + Route.IN + "}/Operations/{" + Route.ON + "}"; + public static final String INVOKE_ENDPOINT_NI = "/OTABService/v1/NodeInstances/{" + Route.NI + + "}/ApplicationInterfaces/{" + Route.IN + "}/Operations/{" + Route.ON + "}"; + + public static final String ID = "id"; + public static final String ID_PLACEHODLER = "{" + Route.ID + "}"; + + public static final String POLL_ENDPOINT_SUFFIX = "/activeRequests/" + Route.ID_PLACEHODLER; + + public static final String POLL_ENDPOINT_SI = Route.INVOKE_ENDPOINT_SI + Route.POLL_ENDPOINT_SUFFIX; + public static final String POLL_ENDPOINT_NI = Route.INVOKE_ENDPOINT_NI + Route.POLL_ENDPOINT_SUFFIX; + + public static final String GET_RESULT_ENDPOINT_SUFFIX = "/response"; + + public static final String GET_RESULT_ENDPOINT_SI = Route.POLL_ENDPOINT_SI + Route.GET_RESULT_ENDPOINT_SUFFIX; + public static final String GET_RESULT_ENDPOINT_NI = Route.POLL_ENDPOINT_NI + Route.GET_RESULT_ENDPOINT_SUFFIX; + + private static final String TO_APP_BUS_ENDPOINT = "direct:toAppBus"; + + private static final String HOST = "http://localhost"; + + private static final String PORT = "8085"; + private static final String BASE_ENDPOINT = Route.HOST + ":" + Route.PORT; + + @Override + public void configure() throws Exception { + + final ValueBuilder APP_BUS_ENDPOINT = + new ValueBuilder(this.method(ApplicationBusServiceHandler.class, "getApplicationBusRoutingEndpoint")); + final Predicate APP_BUS_ENDPOINT_EXISTS = PredicateBuilder.isNotNull(APP_BUS_ENDPOINT); + + final InvocationRequestProcessor invocationRequestProcessor = new InvocationRequestProcessor(); + final InvocationResponseProcessor invocationResponseProcessor = new InvocationResponseProcessor(); + final IsFinishedRequestProcessor isFinishedRequestProcessor = new IsFinishedRequestProcessor(); + final IsFinishedResponseProcessor isFinishedResponseProcessor = new IsFinishedResponseProcessor(); + final GetResultRequestProcessor getResultRequestProcessor = new GetResultRequestProcessor(); + final GetResultResponseProcessor getResultResponseProcessor = new GetResultResponseProcessor(); + final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); + + // handle exceptions + + this.onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) + .process(exceptionProcessor); + + // INVOKE ROUTES + // invoke route (for ServiceInstance) + this.from("restlet:" + Route.BASE_ENDPOINT + Route.INVOKE_ENDPOINT_SI + "?restletMethod=post") + .to("direct:invoke"); + + // invoke route (for NodeInstance) + this.from("restlet:" + Route.BASE_ENDPOINT + Route.INVOKE_ENDPOINT_NI + "?restletMethod=post") + .to("direct:invoke"); + + // invoke route + this.from("direct:invoke").process(invocationRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT).choice() + .when(property(Exchange.EXCEPTION_CAUGHT).isNull()).process(invocationResponseProcessor).removeHeaders("*") + .otherwise().process(exceptionProcessor); + + // IS FINISHED ROUTES + // isFinished route (for ServiceInstance) + this.from("restlet:" + Route.BASE_ENDPOINT + Route.POLL_ENDPOINT_SI + "?restletMethod=get") + .to("direct:isFinished"); + + // isFinished route (for NodeInstance) + this.from("restlet:" + Route.BASE_ENDPOINT + Route.POLL_ENDPOINT_NI + "?restletMethod=get") + .to("direct:isFinished"); + + // isFinished route + this.from("direct:isFinished").process(isFinishedRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT) + .process(isFinishedResponseProcessor).removeHeaders("*"); + + // GET RESULT ROUTES + // getResult route (for ServiceInstance) + this.from("restlet:" + Route.BASE_ENDPOINT + Route.GET_RESULT_ENDPOINT_SI + "?restletMethod=get") + .to("direct:getResult"); + + // getResult route (for NodeInstance) + this.from("restlet:" + Route.BASE_ENDPOINT + Route.GET_RESULT_ENDPOINT_NI + "?restletMethod=get") + .to("direct:getResult"); + + // getResult route + this.from("direct:getResult").process(getResultRequestProcessor).to(Route.TO_APP_BUS_ENDPOINT) + .process(getResultResponseProcessor).removeHeaders("*"); + + // applicationBus route, throws exception if Application Bus is not + // running or wasn't binded + this.from(Route.TO_APP_BUS_ENDPOINT).choice().when(APP_BUS_ENDPOINT_EXISTS).recipientList(APP_BUS_ENDPOINT) + .endChoice().otherwise().to("direct:handleException"); + + // handle exception if Application Bus is not running or wasn't binded + this.from("direct:handleException") + .throwException(new ApplicationBusInternalException("The Application Bus is not running.")); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/servicehandler/ApplicationBusServiceHandler.java b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/servicehandler/ApplicationBusServiceHandler.java new file mode 100644 index 000000000..f17c123f3 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/java/org/opentosca/bus/application/api/resthttp/servicehandler/ApplicationBusServiceHandler.java @@ -0,0 +1,38 @@ +package org.opentosca.bus.application.api.resthttp.servicehandler; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.opentosca.bus.application.service.IApplicationBusService; +import org.springframework.stereotype.Service; + +/** + * Service Handler of the Application Bus-REST/HTTP-API.
+ *
+ *

+ * Here the implementation of the IApplicationBusService is binded or unbinded. During the binding the routing endpoint + * of the Application Bus is handed over. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @see IApplicationBusService + */ +@Service +@Singleton +@Deprecated +public class ApplicationBusServiceHandler { + + // Routing endpoint of the IApplicationBus implementation. + private final String applicationBusRoutingEndpoint; + + @Inject + public ApplicationBusServiceHandler(String applicationBusRoutingEndpoint) { + this.applicationBusRoutingEndpoint = applicationBusRoutingEndpoint; + } + + /** + * @return The Routing endpoint of the ApplicationBus + */ + public String getApplicationBusRoutingEndpoint() { + return applicationBusRoutingEndpoint; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/resources/spring/context-bus-application-api.xml b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/resources/spring/context-bus-application-api.xml new file mode 100644 index 000000000..985a23c56 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.resthttp/src/main/resources/spring/context-bus-application-api.xml @@ -0,0 +1,19 @@ + + + + + + + + org.opentosca.bus.application.api.resthttp.route + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/pom.xml b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/pom.xml new file mode 100644 index 000000000..8aafb2966 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.application.api.soaphttp + + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + org.opentosca + org.opentosca.bus.application.model + ${project.version} + + + org.opentosca + org.opentosca.bus.application.service + ${project.version} + + + + org.apache.camel + camel-core + ${camel.version} + + + org.apache.camel + camel-cxf + ${camel.version} + + + org.apache.cxf + cxf-rt-frontend-jaxrs + + + + + org.apache.camel + camel-jaxb + ${camel.version} + + + + diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ApplicationBusException.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ApplicationBusException.java similarity index 95% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ApplicationBusException.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ApplicationBusException.java index 92b47c953..e322380ee 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/ApplicationBusException.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ApplicationBusException.java @@ -6,14 +6,12 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for ApplicationBusException complex type. @@ -32,8 +30,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ApplicationBusException", propOrder = {"message"}) @@ -45,7 +41,6 @@ public class ApplicationBusException { * Gets the value of the message property. * * @return possible object is {@link String } - * */ public String getMessage() { return this.message; @@ -55,10 +50,8 @@ public String getMessage() { * Sets the value of the message property. * * @param value allowed object is {@link String } - * */ public void setMessage(final String value) { this.message = value; } - } diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/GetResult.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/GetResult.java similarity index 95% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/GetResult.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/GetResult.java index 2634409a5..d9eff9b7a 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/GetResult.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/GetResult.java @@ -6,7 +6,6 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for getResult complex type. @@ -33,8 +31,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "getResult", propOrder = {"requestID"}) @@ -47,7 +43,6 @@ public class GetResult { * Gets the value of the requestID property. * * @return possible object is {@link String } - * */ public String getRequestID() { return this.requestID; @@ -57,10 +52,8 @@ public String getRequestID() { * Sets the value of the requestID property. * * @param value allowed object is {@link String } - * */ public void setRequestID(final String value) { this.requestID = value; } - } diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/GetResultResponse.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/GetResultResponse.java similarity index 94% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/GetResultResponse.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/GetResultResponse.java index c32e2846e..14375b064 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/GetResultResponse.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/GetResultResponse.java @@ -6,14 +6,12 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for getResultResponse complex type. @@ -32,8 +30,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "getResultResponse", propOrder = {"result"}) @@ -45,7 +41,6 @@ public class GetResultResponse { * Gets the value of the result property. * * @return possible object is {@link Object } - * */ public Object getResult() { return this.result; @@ -55,10 +50,8 @@ public Object getResult() { * Sets the value of the result property. * * @param value allowed object is {@link Object } - * */ public void setResult(final Object value) { this.result = value; } - } diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceID.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceID.java similarity index 94% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceID.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceID.java index af0d152ac..5f46e1157 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceID.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceID.java @@ -6,7 +6,6 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for invokeMethodWithNodeInstanceID complex type. @@ -36,8 +34,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "invokeMethodWithNodeInstanceID", propOrder = {"_interface", "operation", "nodeInstanceID", "params"}) @@ -55,7 +51,6 @@ public class InvokeMethodWithNodeInstanceID { * Gets the value of the interface property. * * @return possible object is {@link String } - * */ public String getInterface() { return this._interface; @@ -65,7 +60,6 @@ public String getInterface() { * Sets the value of the interface property. * * @param value allowed object is {@link String } - * */ public void setInterface(final String value) { this._interface = value; @@ -75,7 +69,6 @@ public void setInterface(final String value) { * Gets the value of the operation property. * * @return possible object is {@link String } - * */ public String getOperation() { return this.operation; @@ -85,7 +78,6 @@ public String getOperation() { * Sets the value of the operation property. * * @param value allowed object is {@link String } - * */ public void setOperation(final String value) { this.operation = value; @@ -93,7 +85,6 @@ public void setOperation(final String value) { /** * Gets the value of the nodeInstanceID property. - * */ public int getNodeInstanceID() { return this.nodeInstanceID; @@ -101,7 +92,6 @@ public int getNodeInstanceID() { /** * Sets the value of the nodeInstanceID property. - * */ public void setNodeInstanceID(final int value) { this.nodeInstanceID = value; @@ -111,7 +101,6 @@ public void setNodeInstanceID(final int value) { * Gets the value of the params property. * * @return possible object is {@link ParamsMap } - * */ public ParamsMap getParams() { return this.params; @@ -121,10 +110,8 @@ public ParamsMap getParams() { * Sets the value of the params property. * * @param value allowed object is {@link ParamsMap } - * */ public void setParams(final ParamsMap value) { this.params = value; } - } diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceIDResponse.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceIDResponse.java similarity index 95% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceIDResponse.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceIDResponse.java index 2c41c21cb..146876c24 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceIDResponse.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithNodeInstanceIDResponse.java @@ -6,7 +6,6 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for invokeMethodWithNodeInstanceIDResponse complex type. @@ -33,8 +31,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "invokeMethodWithNodeInstanceIDResponse", propOrder = {"requestID"}) @@ -47,7 +43,6 @@ public class InvokeMethodWithNodeInstanceIDResponse { * Gets the value of the requestID property. * * @return possible object is {@link String } - * */ public String getRequestID() { return this.requestID; @@ -57,10 +52,8 @@ public String getRequestID() { * Sets the value of the requestID property. * * @param value allowed object is {@link String } - * */ public void setRequestID(final String value) { this.requestID = value; } - } diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceID.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceID.java similarity index 92% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceID.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceID.java index 33cbae904..1ce85b0fc 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceID.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceID.java @@ -6,7 +6,6 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for invokeMethodWithServiceInstanceID complex type. @@ -37,12 +35,10 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "invokeMethodWithServiceInstanceID", - propOrder = {"nodeTemplateID", "_interface", "operation", "serviceInstanceID", "params"}) + propOrder = {"nodeTemplateID", "_interface", "operation", "serviceInstanceID", "params"}) public class InvokeMethodWithServiceInstanceID { @XmlElement(required = true) @@ -59,7 +55,6 @@ public class InvokeMethodWithServiceInstanceID { * Gets the value of the nodeTemplateID property. * * @return possible object is {@link String } - * */ public String getNodeTemplateID() { return this.nodeTemplateID; @@ -69,7 +64,6 @@ public String getNodeTemplateID() { * Sets the value of the nodeTemplateID property. * * @param value allowed object is {@link String } - * */ public void setNodeTemplateID(final String value) { this.nodeTemplateID = value; @@ -79,7 +73,6 @@ public void setNodeTemplateID(final String value) { * Gets the value of the interface property. * * @return possible object is {@link String } - * */ public String getInterface() { return this._interface; @@ -89,7 +82,6 @@ public String getInterface() { * Sets the value of the interface property. * * @param value allowed object is {@link String } - * */ public void setInterface(final String value) { this._interface = value; @@ -99,7 +91,6 @@ public void setInterface(final String value) { * Gets the value of the operation property. * * @return possible object is {@link String } - * */ public String getOperation() { return this.operation; @@ -109,7 +100,6 @@ public String getOperation() { * Sets the value of the operation property. * * @param value allowed object is {@link String } - * */ public void setOperation(final String value) { this.operation = value; @@ -117,7 +107,6 @@ public void setOperation(final String value) { /** * Gets the value of the serviceInstanceID property. - * */ public int getServiceInstanceID() { return this.serviceInstanceID; @@ -125,7 +114,6 @@ public int getServiceInstanceID() { /** * Sets the value of the serviceInstanceID property. - * */ public void setServiceInstanceID(final int value) { this.serviceInstanceID = value; @@ -135,7 +123,6 @@ public void setServiceInstanceID(final int value) { * Gets the value of the params property. * * @return possible object is {@link ParamsMap } - * */ public ParamsMap getParams() { return this.params; @@ -145,10 +132,8 @@ public ParamsMap getParams() { * Sets the value of the params property. * * @param value allowed object is {@link ParamsMap } - * */ public void setParams(final ParamsMap value) { this.params = value; } - } diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceIDResponse.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceIDResponse.java similarity index 95% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceIDResponse.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceIDResponse.java index b31c1716a..883c8233f 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceIDResponse.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/InvokeMethodWithServiceInstanceIDResponse.java @@ -6,7 +6,6 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for invokeMethodWithServiceInstanceIDResponse complex type. @@ -33,8 +31,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "invokeMethodWithServiceInstanceIDResponse", propOrder = {"requestID"}) @@ -47,7 +43,6 @@ public class InvokeMethodWithServiceInstanceIDResponse { * Gets the value of the requestID property. * * @return possible object is {@link String } - * */ public String getRequestID() { return this.requestID; @@ -57,10 +52,8 @@ public String getRequestID() { * Sets the value of the requestID property. * * @param value allowed object is {@link String } - * */ public void setRequestID(final String value) { this.requestID = value; } - } diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/IsFinished.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/IsFinished.java similarity index 95% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/IsFinished.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/IsFinished.java index 0d4b5ed14..f13736bde 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/IsFinished.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/IsFinished.java @@ -6,7 +6,6 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for isFinished complex type. @@ -33,8 +31,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "isFinished", propOrder = {"requestID"}) @@ -47,7 +43,6 @@ public class IsFinished { * Gets the value of the requestID property. * * @return possible object is {@link String } - * */ public String getRequestID() { return this.requestID; @@ -57,10 +52,8 @@ public String getRequestID() { * Sets the value of the requestID property. * * @param value allowed object is {@link String } - * */ public void setRequestID(final String value) { this.requestID = value; } - } diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/IsFinishedResponse.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/IsFinishedResponse.java similarity index 94% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/IsFinishedResponse.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/IsFinishedResponse.java index b86308a1d..5458eb4cc 100644 --- a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/IsFinishedResponse.java +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/IsFinishedResponse.java @@ -6,14 +6,12 @@ // Generated on: 2016.02.25 at 04:54:56 PM CET // - package org.opentosca.bus.application.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for isFinishedResponse complex type. @@ -32,8 +30,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "isFinishedResponse", propOrder = {"isFinished"}) @@ -43,7 +39,6 @@ public class IsFinishedResponse { /** * Gets the value of the isFinished property. - * */ public boolean isIsFinished() { return this.isFinished; @@ -51,10 +46,8 @@ public boolean isIsFinished() { /** * Sets the value of the isFinished property. - * */ public void setIsFinished(final boolean value) { this.isFinished = value; } - } diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ObjectFactory.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ObjectFactory.java new file mode 100644 index 000000000..a90ae402e --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ObjectFactory.java @@ -0,0 +1,204 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2016.02.25 at 04:54:56 PM CET +// + +package org.opentosca.bus.application.api.soaphttp.model; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.opentosca.bus.application.api.soaphttp.model package. + *

+ * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _GetResultResponse_QNAME = + new QName("http://opentosca.org/appinvoker/", "getResultResponse"); + private final static QName _InvokeMethodWithNodeInstanceID_QNAME = + new QName("http://opentosca.org/appinvoker/", "invokeMethodWithNodeInstanceID"); + private final static QName _InvokeMethodWithNodeInstanceIDResponse_QNAME = + new QName("http://opentosca.org/appinvoker/", "invokeMethodWithNodeInstanceIDResponse"); + private final static QName _IsFinishedResponse_QNAME = + new QName("http://opentosca.org/appinvoker/", "isFinishedResponse"); + private final static QName _InvokeMethodWithServiceInstanceIDResponse_QNAME = + new QName("http://opentosca.org/appinvoker/", "invokeMethodWithServiceInstanceIDResponse"); + private final static QName _ApplicationBusException_QNAME = + new QName("http://opentosca.org/appinvoker/", "ApplicationBusException"); + private final static QName _GetResult_QNAME = new QName("http://opentosca.org/appinvoker/", "getResult"); + private final static QName _InvokeMethodWithServiceInstanceID_QNAME = + new QName("http://opentosca.org/appinvoker/", "invokeMethodWithServiceInstanceID"); + private final static QName _IsFinished_QNAME = new QName("http://opentosca.org/appinvoker/", "isFinished"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.opentosca.bus.application.api.soaphttp.model + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link IsFinishedResponse } + */ + public IsFinishedResponse createIsFinishedResponse() { + return new IsFinishedResponse(); + } + + /** + * Create an instance of {@link InvokeMethodWithNodeInstanceIDResponse } + */ + public InvokeMethodWithNodeInstanceIDResponse createInvokeMethodWithNodeInstanceIDResponse() { + return new InvokeMethodWithNodeInstanceIDResponse(); + } + + /** + * Create an instance of {@link InvokeMethodWithNodeInstanceID } + */ + public InvokeMethodWithNodeInstanceID createInvokeMethodWithNodeInstanceID() { + return new InvokeMethodWithNodeInstanceID(); + } + + /** + * Create an instance of {@link GetResultResponse } + */ + public GetResultResponse createGetResultResponse() { + return new GetResultResponse(); + } + + /** + * Create an instance of {@link IsFinished } + */ + public IsFinished createIsFinished() { + return new IsFinished(); + } + + /** + * Create an instance of {@link InvokeMethodWithServiceInstanceID } + */ + public InvokeMethodWithServiceInstanceID createInvokeMethodWithServiceInstanceID() { + return new InvokeMethodWithServiceInstanceID(); + } + + /** + * Create an instance of {@link GetResult } + */ + public GetResult createGetResult() { + return new GetResult(); + } + + /** + * Create an instance of {@link ApplicationBusException } + */ + public ApplicationBusException createApplicationBusException() { + return new ApplicationBusException(); + } + + /** + * Create an instance of {@link InvokeMethodWithServiceInstanceIDResponse } + */ + public InvokeMethodWithServiceInstanceIDResponse createInvokeMethodWithServiceInstanceIDResponse() { + return new InvokeMethodWithServiceInstanceIDResponse(); + } + + /** + * Create an instance of {@link ParamsMapItemType } + */ + public ParamsMapItemType createParamsMapItemType() { + return new ParamsMapItemType(); + } + + /** + * Create an instance of {@link ParamsMap } + */ + public ParamsMap createParamsMap() { + return new ParamsMap(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetResultResponse }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "getResultResponse") + public JAXBElement createGetResultResponse(final GetResultResponse value) { + return new JAXBElement<>(_GetResultResponse_QNAME, GetResultResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokeMethodWithNodeInstanceID }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "invokeMethodWithNodeInstanceID") + public JAXBElement createInvokeMethodWithNodeInstanceID(final InvokeMethodWithNodeInstanceID value) { + return new JAXBElement<>(_InvokeMethodWithNodeInstanceID_QNAME, InvokeMethodWithNodeInstanceID.class, null, + value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokeMethodWithNodeInstanceIDResponse }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "invokeMethodWithNodeInstanceIDResponse") + public JAXBElement createInvokeMethodWithNodeInstanceIDResponse(final InvokeMethodWithNodeInstanceIDResponse value) { + return new JAXBElement<>(_InvokeMethodWithNodeInstanceIDResponse_QNAME, + InvokeMethodWithNodeInstanceIDResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IsFinishedResponse }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "isFinishedResponse") + public JAXBElement createIsFinishedResponse(final IsFinishedResponse value) { + return new JAXBElement<>(_IsFinishedResponse_QNAME, IsFinishedResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokeMethodWithServiceInstanceIDResponse }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "invokeMethodWithServiceInstanceIDResponse") + public JAXBElement createInvokeMethodWithServiceInstanceIDResponse(final InvokeMethodWithServiceInstanceIDResponse value) { + return new JAXBElement<>(_InvokeMethodWithServiceInstanceIDResponse_QNAME, + InvokeMethodWithServiceInstanceIDResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ApplicationBusException }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "ApplicationBusException") + public JAXBElement createApplicationBusException(final ApplicationBusException value) { + return new JAXBElement<>(_ApplicationBusException_QNAME, ApplicationBusException.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetResult }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "getResult") + public JAXBElement createGetResult(final GetResult value) { + return new JAXBElement<>(_GetResult_QNAME, GetResult.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokeMethodWithServiceInstanceID }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "invokeMethodWithServiceInstanceID") + public JAXBElement createInvokeMethodWithServiceInstanceID(final InvokeMethodWithServiceInstanceID value) { + return new JAXBElement<>(_InvokeMethodWithServiceInstanceID_QNAME, InvokeMethodWithServiceInstanceID.class, + null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IsFinished }{@code >}} + */ + @XmlElementDecl(namespace = "http://opentosca.org/appinvoker/", name = "isFinished") + public JAXBElement createIsFinished(final IsFinished value) { + return new JAXBElement<>(_IsFinished_QNAME, IsFinished.class, null, value); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ParamsMap.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ParamsMap.java new file mode 100644 index 000000000..26e4ec12b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ParamsMap.java @@ -0,0 +1,70 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2016.02.25 at 04:54:56 PM CET +// + +package org.opentosca.bus.application.api.soaphttp.model; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for ParamsMap complex type. + * + *

+ * The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ParamsMap">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Param" type="{http://opentosca.org/appinvoker/}ParamsMapItemType" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ParamsMap", propOrder = {"param"}) +public class ParamsMap { + + @XmlElement(name = "Param", required = true) + protected List param; + + /** + * Gets the value of the param property. + * + *

+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the param property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+     * getParam().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link ParamsMapItemType } + */ + public List getParam() { + if (this.param == null) { + this.param = new ArrayList<>(); + } + return this.param; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ParamsMapItemType.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ParamsMapItemType.java new file mode 100644 index 000000000..a0f624163 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/ParamsMapItemType.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2016.02.25 at 04:54:56 PM CET +// + +package org.opentosca.bus.application.api.soaphttp.model; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for ParamsMapItemType complex type. + * + *

+ * The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ParamsMapItemType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ParamsMapItemType", propOrder = {"key", "value"}) +public class ParamsMapItemType { + + @XmlElement(required = true) + protected String key; + @XmlElement(required = true) + protected String value; + + /** + * Gets the value of the key property. + * + * @return possible object is {@link String } + */ + public String getKey() { + return this.key; + } + + /** + * Sets the value of the key property. + * + * @param value allowed object is {@link String } + */ + public void setKey(final String value) { + this.key = value; + } + + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + */ + public String getValue() { + return this.value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + */ + public void setValue(final String value) { + this.value = value; + } +} diff --git a/org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/package-info.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/package-info.java similarity index 100% rename from org.opentosca.bus.application.api.soaphttp/src/org/opentosca/bus/application/api/soaphttp/model/package-info.java rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/model/package-info.java diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/processor/RequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/processor/RequestProcessor.java new file mode 100644 index 000000000..0b65a5a55 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/processor/RequestProcessor.java @@ -0,0 +1,139 @@ +package org.opentosca.bus.application.api.soaphttp.processor; + +import java.util.LinkedHashMap; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.application.api.soaphttp.model.GetResult; +import org.opentosca.bus.application.api.soaphttp.model.InvokeMethodWithNodeInstanceID; +import org.opentosca.bus.application.api.soaphttp.model.InvokeMethodWithServiceInstanceID; +import org.opentosca.bus.application.api.soaphttp.model.IsFinished; +import org.opentosca.bus.application.api.soaphttp.model.ParamsMap; +import org.opentosca.bus.application.api.soaphttp.model.ParamsMapItemType; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * RequestProcessor of the Application Bus-SOAP/HTTP-API.
+ *
+ *

+ * This processor handles the incoming requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class RequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(RequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + String nodeTemplateID = null; + Integer nodeInstanceID = null; + Integer serviceInstanceID = null; + String interfaceName = null; + String operationName = null; + ParamsMap paramsMap = null; + String requestID = null; + + final Object request = exchange.getIn().getBody(); + + if (exchange.getIn().getBody() instanceof InvokeMethodWithServiceInstanceID) { + + RequestProcessor.LOG.debug("Processing InvokeMethodWithServiceInstanceID Request"); + + final InvokeMethodWithServiceInstanceID invoke1Request = (InvokeMethodWithServiceInstanceID) request; + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); + + serviceInstanceID = invoke1Request.getServiceInstanceID(); + RequestProcessor.LOG.debug("ServiceInstanceID: " + serviceInstanceID); + exchange.getIn().setHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), serviceInstanceID); + + nodeTemplateID = invoke1Request.getNodeTemplateID(); + RequestProcessor.LOG.debug("NodeTemplateID: " + nodeTemplateID); + exchange.getIn().setHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), nodeTemplateID); + + interfaceName = invoke1Request.getInterface(); + RequestProcessor.LOG.debug("InterfaceName: " + interfaceName); + exchange.getIn().setHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), interfaceName); + + operationName = invoke1Request.getOperation(); + RequestProcessor.LOG.debug("NodeTemplateID: " + operationName); + exchange.getIn().setHeader(ApplicationBusConstants.OPERATION_NAME.toString(), operationName); + + paramsMap = invoke1Request.getParams(); + + exchange.getIn().setBody(getParams(paramsMap)); + } else if (request instanceof InvokeMethodWithNodeInstanceID) { + + RequestProcessor.LOG.debug("Processing InvokeMethodWithNodeInstanceID Request"); + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); + + final InvokeMethodWithNodeInstanceID invoke2Request = (InvokeMethodWithNodeInstanceID) request; + + nodeInstanceID = invoke2Request.getNodeInstanceID(); + RequestProcessor.LOG.debug("NodeInstanceID: " + nodeInstanceID); + exchange.getIn().setHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), nodeInstanceID); + + interfaceName = invoke2Request.getInterface(); + RequestProcessor.LOG.debug("InterfaceName: " + interfaceName); + exchange.getIn().setHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), interfaceName); + + operationName = invoke2Request.getOperation(); + RequestProcessor.LOG.debug("NodeTemplateID: " + operationName); + exchange.getIn().setHeader(ApplicationBusConstants.OPERATION_NAME.toString(), operationName); + + paramsMap = invoke2Request.getParams(); + + exchange.getIn().setBody(getParams(paramsMap)); + } else if (exchange.getIn().getBody() instanceof IsFinished) { + + RequestProcessor.LOG.debug("Processing IsFinished Request"); + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_IS_FINISHED.toString()); + + final IsFinished isFinishedRequest = (IsFinished) request; + + requestID = isFinishedRequest.getRequestID(); + RequestProcessor.LOG.debug("RequestID: " + requestID); + + exchange.getIn().setBody(requestID); + } else if (exchange.getIn().getBody() instanceof GetResult) { + + RequestProcessor.LOG.debug("Processing GetResult Request"); + + exchange.getIn().setHeader(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString(), + ApplicationBusConstants.APPLICATION_BUS_METHOD_GET_RESULT.toString()); + + final GetResult getResultRequest = (GetResult) request; + + requestID = getResultRequest.getRequestID(); + RequestProcessor.LOG.debug("RequestID: " + requestID); + + exchange.getIn().setBody(requestID); + } + } + + /** + * @return LinkedHashMap with keys and values from ParamsMap + */ + private LinkedHashMap getParams(final ParamsMap paramsMap) { + + final LinkedHashMap params = new LinkedHashMap<>(); + + // put key-value params into camel exchange body as hashmap + if (paramsMap != null) { + + for (final ParamsMapItemType param : paramsMap.getParam()) { + params.put(param.getKey(), param.getValue()); + } + } + return params; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/processor/ResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/processor/ResponseProcessor.java new file mode 100644 index 000000000..77a5d9353 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/processor/ResponseProcessor.java @@ -0,0 +1,101 @@ +package org.opentosca.bus.application.api.soaphttp.processor; + +import javax.xml.bind.JAXBElement; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.opentosca.bus.application.api.soaphttp.model.GetResultResponse; +import org.opentosca.bus.application.api.soaphttp.model.InvokeMethodWithNodeInstanceIDResponse; +import org.opentosca.bus.application.api.soaphttp.model.InvokeMethodWithServiceInstanceIDResponse; +import org.opentosca.bus.application.api.soaphttp.model.IsFinishedResponse; +import org.opentosca.bus.application.api.soaphttp.model.ObjectFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ResponseProcessor of the Application Bus-SOAP/HTTP-API.
+ *
+ *

+ * This processor handles the responses back to the caller. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class ResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(ResponseProcessor.class); + + private static ObjectFactory objectFactory = new ObjectFactory(); + + @Override + public void process(final Exchange exchange) throws Exception { + ResponseProcessor.LOG.debug("Processing the response..."); + + if (exchange.getIn().getBody() instanceof Exception) { + ResponseProcessor.LOG.debug("Exception handling"); + + final Exception exception = exchange.getIn().getBody(Exception.class); + + final org.opentosca.bus.application.api.soaphttp.model.ApplicationBusException e = + new org.opentosca.bus.application.api.soaphttp.model.ApplicationBusException(); + e.setMessage(exception.getMessage()); + + final JAXBElement jaxbElement = + objectFactory.createApplicationBusException(e); + + exchange.getIn().setBody(jaxbElement); + + return; + } + + final String operation = (String) exchange.getIn().getHeader(CxfConstants.OPERATION_NAME); + + if (operation.equals("invokeMethodWithServiceInstanceID")) { + ResponseProcessor.LOG.debug("Handling invokeMethodWithServiceInstanceID response"); + + final InvokeMethodWithServiceInstanceIDResponse invokeResponse = + new InvokeMethodWithServiceInstanceIDResponse(); + invokeResponse.setRequestID(exchange.getIn().getBody(String.class)); + + final JAXBElement jaxbElement = + objectFactory.createInvokeMethodWithServiceInstanceIDResponse(invokeResponse); + + exchange.getIn().setBody(jaxbElement); + } + + if (operation.equals("invokeMethodWithNodeInstanceID")) { + ResponseProcessor.LOG.debug("Handling invokeMethodWithNodeInstanceID response"); + + final InvokeMethodWithNodeInstanceIDResponse invokeResponse = new InvokeMethodWithNodeInstanceIDResponse(); + invokeResponse.setRequestID(exchange.getIn().getBody(String.class)); + + final JAXBElement jaxbElement = + objectFactory.createInvokeMethodWithNodeInstanceIDResponse(invokeResponse); + + exchange.getIn().setBody(jaxbElement); + } + + if (operation.equals("isFinished")) { + ResponseProcessor.LOG.debug("Handling isFinished response"); + + final IsFinishedResponse isFinishedResponse = new IsFinishedResponse(); + isFinishedResponse.setIsFinished(exchange.getIn().getBody(Boolean.class)); + + final JAXBElement jaxbElement = + objectFactory.createIsFinishedResponse(isFinishedResponse); + + exchange.getIn().setBody(jaxbElement); + } + + if (operation.equals("getResult")) { + ResponseProcessor.LOG.debug("Handling getResult response"); + + final GetResultResponse resultResponse = new GetResultResponse(); + resultResponse.setResult(exchange.getIn().getBody()); + + final JAXBElement jaxbElement = objectFactory.createGetResultResponse(resultResponse); + + exchange.getIn().setBody(jaxbElement); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/route/Route.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/route/Route.java new file mode 100644 index 000000000..8e3136c86 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/route/Route.java @@ -0,0 +1,68 @@ +package org.opentosca.bus.application.api.soaphttp.route; + +import java.net.URL; + +import javax.xml.bind.JAXBContext; +import javax.xml.namespace.QName; + +import org.apache.camel.Predicate; +import org.apache.camel.Processor; +import org.apache.camel.builder.PredicateBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.builder.ValueBuilder; +import org.apache.camel.converter.jaxb.JaxbDataFormat; +import org.opentosca.bus.application.api.soaphttp.processor.RequestProcessor; +import org.opentosca.bus.application.api.soaphttp.processor.ResponseProcessor; +import org.opentosca.bus.application.api.soaphttp.servicehandler.ApplicationBusServiceHandler; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; + +/** + * Route of the Application Bus-SOAP/HTTP-API.
+ *
+ *

+ * The endpoint of the SOAP/HTTP-API is created here. Incoming requests will be un/marshalled, routed to processors or + * the application bus in order to handle the requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class Route extends RouteBuilder { + + private final static String ENDPOINT = "http://0.0.0.0:8084/appBus"; + + private final static QName PORT = new QName("http://opentosca.org/appinvoker/", "AppInvokerSoapWebServicePort"); + + @Override + public void configure() throws Exception { + + final URL wsdlURL = this.getClass().getClassLoader().getResource("wsdl/SoapAPI.wsdl"); + + // CXF Endpoint + final String SOAP_ENDPOINT = "cxf:" + ENDPOINT + "?wsdlURL=" + wsdlURL.toString() + + "&serviceName={http://opentosca.org/appinvoker/}AppInvokerSoapWebServiceService&portName=" + + PORT.toString() + "&dataFormat=PAYLOAD&loggingFeatureEnabled=true"; + + final ValueBuilder APP_BUS_ENDPOINT = + new ValueBuilder(method(ApplicationBusServiceHandler.class, "getApplicationBusRoutingEndpoint")); + final Predicate APP_BUS_ENDPOINT_EXISTS = PredicateBuilder.isNotNull(APP_BUS_ENDPOINT); + + final ClassLoader cl = org.opentosca.bus.application.api.soaphttp.model.ObjectFactory.class.getClassLoader(); + final JAXBContext jc = JAXBContext.newInstance("org.opentosca.bus.application.api.soaphttp.model", cl); + final JaxbDataFormat jaxb = new JaxbDataFormat(jc); + + final Processor requestProcessor = new RequestProcessor(); + final Processor responseProcessor = new ResponseProcessor(); + + from(SOAP_ENDPOINT).unmarshal(jaxb).process(requestProcessor).choice().when(APP_BUS_ENDPOINT_EXISTS) + //FIXME this recipientList should be replaced with a directly injected service reference + .recipientList(APP_BUS_ENDPOINT).to("direct:handleResponse").endChoice().otherwise() + .to("direct:handleException"); + + // handle exception if Application Bus is not running or wasn't bound + from("direct:handleException") + .throwException(new ApplicationBusInternalException("It seems like the Application Bus is not running.")) + .to("direct:handleResponse"); + + // handle response + from("direct:handleResponse").process(responseProcessor).marshal(jaxb); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/servicehandler/ApplicationBusServiceHandler.java b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/servicehandler/ApplicationBusServiceHandler.java new file mode 100644 index 000000000..86197d83f --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/java/org/opentosca/bus/application/api/soaphttp/servicehandler/ApplicationBusServiceHandler.java @@ -0,0 +1,37 @@ +package org.opentosca.bus.application.api.soaphttp.servicehandler; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.opentosca.bus.application.service.IApplicationBusService; +import org.springframework.stereotype.Service; + +/** + * Service Handler of the Application Bus-SOAP/HTTP-API.
+ *
+ *

+ * Here the implementation of the IApplicationBusService is binded or unbinded. During the binding the routing endpoint + * of the Application Bus is handed over. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @see IApplicationBusService + */ +@Service +@Singleton +@Deprecated +public class ApplicationBusServiceHandler { + + private final String applicationBusRoutingEndpoint; + + @Inject + public ApplicationBusServiceHandler(String applicationBusRoutingEndpoint) { + this.applicationBusRoutingEndpoint = applicationBusRoutingEndpoint; + } + + /** + * @return The Routing endpoint of the ApplicationBus + */ + public String getApplicationBusRoutingEndpoint() { + return applicationBusRoutingEndpoint; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/resources/spring/context-bus-application-api.xml b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/resources/spring/context-bus-application-api.xml new file mode 100644 index 000000000..b864897f0 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/resources/spring/context-bus-application-api.xml @@ -0,0 +1,19 @@ + + + + + + + + org.opentosca.bus.application.api.soaphttp.route + + + + diff --git a/org.opentosca.bus.application.api.soaphttp/META-INF/wsdl/SoapAPI.wsdl b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/resources/wsdl/SoapAPI.wsdl similarity index 100% rename from org.opentosca.bus.application.api.soaphttp/META-INF/wsdl/SoapAPI.wsdl rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/resources/wsdl/SoapAPI.wsdl diff --git a/org.opentosca.bus.application.api.soaphttp/META-INF/wsdl/SoapAPI.xsd b/org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/resources/wsdl/SoapAPI.xsd similarity index 100% rename from org.opentosca.bus.application.api.soaphttp/META-INF/wsdl/SoapAPI.xsd rename to org.opentosca.bus/org.opentosca.bus.application.api.soaphttp/src/main/resources/wsdl/SoapAPI.xsd diff --git a/org.opentosca.bus/org.opentosca.bus.application.model/pom.xml b/org.opentosca.bus/org.opentosca.bus.application.model/pom.xml new file mode 100644 index 000000000..56bff18f9 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.model/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.application.model + + diff --git a/org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/constants/ApplicationBusConstants.java b/org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/constants/ApplicationBusConstants.java similarity index 87% rename from org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/constants/ApplicationBusConstants.java rename to org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/constants/ApplicationBusConstants.java index b743b18e4..3398fb9f9 100644 --- a/org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/constants/ApplicationBusConstants.java +++ b/org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/constants/ApplicationBusConstants.java @@ -3,16 +3,11 @@ /** * Enum needed for the Application Bus components.
*
- * - * This enum defines the headers of the camel exchange message that is used from the Application Bus - * components. - * - * + *

+ * This enum defines the headers of the camel exchange message that is used from the Application Bus components. * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * */ public enum ApplicationBusConstants { NODE_INSTANCE_ID_INT, SERVICE_INSTANCE_ID_INT, NODE_TEMPLATE_ID, INTERFACE_NAME, OPERATION_NAME, APPLICATION_BUS_METHOD, APPLICATION_BUS_METHOD_IS_FINISHED, APPLICATION_BUS_METHOD_GET_RESULT, APPLICATION_BUS_METHOD_INVOKE, INVOCATION_ENDPOINT_URL, CLASS_NAME; - } diff --git a/org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/exception/ApplicationBusExternalException.java b/org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/exception/ApplicationBusExternalException.java similarity index 89% rename from org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/exception/ApplicationBusExternalException.java rename to org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/exception/ApplicationBusExternalException.java index 4c50c32f9..58f766d9d 100644 --- a/org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/exception/ApplicationBusExternalException.java +++ b/org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/exception/ApplicationBusExternalException.java @@ -1,14 +1,11 @@ package org.opentosca.bus.application.model.exception; /** - * - * Exception which can be thrown if the invocation of a method failed due to an external failure - * (e.g. missing parameters). + * Exception which can be thrown if the invocation of a method failed due to an external failure (e.g. missing + * parameters). * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * */ -@SuppressWarnings("serial") public class ApplicationBusExternalException extends Exception { /** diff --git a/org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/exception/ApplicationBusInternalException.java b/org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/exception/ApplicationBusInternalException.java similarity index 93% rename from org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/exception/ApplicationBusInternalException.java rename to org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/exception/ApplicationBusInternalException.java index d951b2454..b17250534 100644 --- a/org.opentosca.bus.application.model/src/org/opentosca/bus/application/model/exception/ApplicationBusInternalException.java +++ b/org.opentosca.bus/org.opentosca.bus.application.model/src/main/java/org/opentosca/bus/application/model/exception/ApplicationBusInternalException.java @@ -1,13 +1,10 @@ package org.opentosca.bus.application.model.exception; /** - * * Exception which can be thrown if the invocation of a method failed due to an internal failure.. * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * */ -@SuppressWarnings("serial") public class ApplicationBusInternalException extends Exception { /** diff --git a/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/pom.xml b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/pom.xml new file mode 100644 index 000000000..475b2b129 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.application.plugin.jsonhttp.service.impl + + + + org.apache.camel + camel-core + 2.18.3 + + + org.apache.camel + camel-http + 2.18.3 + + + org.opentosca + org.opentosca.bus.application.plugin.service + ${project.version} + compile + + + org.opentosca + org.opentosca.bus.application.model + ${project.version} + compile + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + + diff --git a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/ApplicationBusJsonHttpPluginServiceImpl.java b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/ApplicationBusJsonHttpPluginServiceImpl.java similarity index 76% rename from org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/ApplicationBusJsonHttpPluginServiceImpl.java rename to org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/ApplicationBusJsonHttpPluginServiceImpl.java index 567be921d..6dfa0ff34 100644 --- a/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/org/opentosca/bus/application/plugin/jsonhttp/service/impl/ApplicationBusJsonHttpPluginServiceImpl.java +++ b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/ApplicationBusJsonHttpPluginServiceImpl.java @@ -8,20 +8,19 @@ /** * JSON/HTTP-Plugin of the Application Bus.
*
- * - * The supported invocationTypes and the plugin routing endpoint are defined here. During the bind - * process of the Application Bus, this information are handed over. - * - * @see IApplicationBusPluginService + *

+ * The supported invocationTypes and the plugin routing endpoint are defined here. During the bind process of the + * Application Bus, this information are handed over. * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @see IApplicationBusPluginService */ public class ApplicationBusJsonHttpPluginServiceImpl implements IApplicationBusPluginService { - private static final List invocationTypes = Arrays.asList("JSON/HTTP"); - // Routing endpoint of the Application Bus bundle - public static final String ENDPOINT = "direct-vm:" + Activator.getBundleID(); + public static final String ENDPOINT = "direct-vm:" + "org.opentosca.bus.application.plugin.jsonhttp.service.impl"; + + private static final List invocationTypes = Arrays.asList("JSON/HTTP"); @Override public List getSupportedInvocationTypes() { @@ -32,5 +31,4 @@ public List getSupportedInvocationTypes() { public String getRoutingEndpoint() { return ENDPOINT; } - } diff --git a/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/RequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/RequestProcessor.java new file mode 100644 index 000000000..46031637d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/RequestProcessor.java @@ -0,0 +1,54 @@ +package org.opentosca.bus.application.plugin.jsonhttp.service.impl.processor; + +import java.util.LinkedHashMap; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.json.simple.JSONObject; +import org.json.simple.JSONValue; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * RequestProcessor of the Application Bus-JSON/HTTP-Plugin.
+ *
+ *

+ * This processor handles the incoming requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class RequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(RequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + RequestProcessor.LOG.debug("Creation of the json request body..."); + + final String className = + exchange.getIn().getHeader(ApplicationBusConstants.CLASS_NAME.toString(), String.class); + final String operationName = + exchange.getIn().getHeader(ApplicationBusConstants.OPERATION_NAME.toString(), String.class); + + final LinkedHashMap params = exchange.getIn().getBody(LinkedHashMap.class); + + // JSON body creation + final JSONObject infoJSON = new JSONObject(); + infoJSON.put("class", className); + infoJSON.put("operation", operationName); + + final LinkedHashMap finalJSON = new LinkedHashMap<>(); + finalJSON.put("invocation-information", infoJSON); + if (params != null) { + finalJSON.put("params", params); + } + + final String finalJSONString = JSONValue.toJSONString(finalJSON); + + RequestProcessor.LOG.debug("Created json request body: {}", finalJSONString); + + exchange.getIn().setBody(finalJSONString); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/ResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/ResponseProcessor.java new file mode 100644 index 000000000..c084d8411 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/processor/ResponseProcessor.java @@ -0,0 +1,36 @@ +package org.opentosca.bus.application.plugin.jsonhttp.service.impl.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.json.simple.JSONObject; +import org.json.simple.JSONValue; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ResponseProcessor of the Application Bus-JSON/HTTP-Plugin.
+ *
+ *

+ * This processor handles the responses. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class ResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(ResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + ResponseProcessor.LOG.debug("Parsing the response..."); + + final String response = exchange.getIn().getBody(String.class); + + final JSONObject obj = (JSONObject) JSONValue.parse(response); + final Object result = obj.get("result"); + + ResponseProcessor.LOG.debug("Response: {}", result); + + exchange.getIn().setBody(result); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/route/Route.java b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/route/Route.java new file mode 100644 index 000000000..3a9171994 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/java/org/opentosca/bus/application/plugin/jsonhttp/service/impl/route/Route.java @@ -0,0 +1,67 @@ +package org.opentosca.bus.application.plugin.jsonhttp.service.impl.route; + +import org.apache.camel.Exchange; +import org.apache.camel.Predicate; +import org.apache.camel.builder.PredicateBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.builder.SimpleBuilder; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; +import org.opentosca.bus.application.plugin.jsonhttp.service.impl.ApplicationBusJsonHttpPluginServiceImpl; +import org.opentosca.bus.application.plugin.jsonhttp.service.impl.processor.RequestProcessor; +import org.opentosca.bus.application.plugin.jsonhttp.service.impl.processor.ResponseProcessor; + +/** + * Route of the Application Bus-JSON/HTTP-Plugin.
+ *
+ *

+ * The endpoint of the JSON/HTTP-Plugin is created here. The Application Bus uses this endpoint to send the needed + * information to invoke an application. The request and response processing as well as the invocation itself are also + * handled in this route. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class Route extends RouteBuilder { + + private static final String APPINVOKER_ENDPOINT_SUFFIX = "/OTABProxy/v1/appInvoker"; + + // returning json string indicating that the invocation is not finished yet + private static final String PENDING_STRING = "{\"status\":\"PENDING\"}"; + + // dummy endpoint; will be overwritten by HTTP_URI header + private static final String DUMMY_ENDPOINT = "http://dummyhost?throwExceptionOnFailure=false"; + + @Override + public void configure() throws Exception { + + final Predicate OK = header(Exchange.HTTP_RESPONSE_CODE).isEqualTo(200); + final Predicate PENDING = PredicateBuilder.and(OK, body().isEqualTo(PENDING_STRING)); + final Predicate RESULT_RECEIVED = PredicateBuilder.and(OK, PredicateBuilder.not(PENDING)); + + final SimpleBuilder INVOKE_ENDPOINT = simple("${header." + + ApplicationBusConstants.INVOCATION_ENDPOINT_URL.toString() + "}" + APPINVOKER_ENDPOINT_SUFFIX); + final SimpleBuilder POLL_ENDPOINT = simple("${header.Location}"); + + final RequestProcessor requestProcessor = new RequestProcessor(); + final ResponseProcessor responseProcessor = new ResponseProcessor(); + + from(ApplicationBusJsonHttpPluginServiceImpl.ENDPOINT).process(requestProcessor) + .setHeader(Exchange.HTTP_METHOD, constant("POST")) + .setHeader(Exchange.CONTENT_TYPE, + constant("application/json")) + .setHeader(Exchange.HTTP_URI, INVOKE_ENDPOINT) + .to(DUMMY_ENDPOINT).choice() + .when(header(Exchange.HTTP_RESPONSE_CODE).isEqualTo(202)) + .setHeader(Exchange.HTTP_URI, POLL_ENDPOINT) + .to("direct:polling").endChoice().otherwise() + .to("direct:throwException"); + + from("direct:polling").setHeader(Exchange.HTTP_METHOD, constant("GET")).to(DUMMY_ENDPOINT) + .convertBodyTo(String.class).choice().when(PENDING).delay(5000).to("direct:polling") + .endChoice().when(RESULT_RECEIVED).process(responseProcessor).endChoice().otherwise() + .to("direct:throwException"); + + from("direct:throwException").process(exchange -> exchange.getIn().setBody(new ApplicationBusExternalException( + exchange.getIn().getBody(String.class)))); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/resources/spring/context-mb-application-plugin.xml b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/resources/spring/context-mb-application-plugin.xml new file mode 100644 index 000000000..121663bb3 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.plugin.jsonhttp.service.impl/src/main/resources/spring/context-mb-application-plugin.xml @@ -0,0 +1,17 @@ + + + + + + + org.opentosca.bus.application.plugin.jsonhttp.service.impl.route + + + diff --git a/org.opentosca.bus/org.opentosca.bus.application.plugin.service/pom.xml b/org.opentosca.bus/org.opentosca.bus.application.plugin.service/pom.xml new file mode 100644 index 000000000..838583e05 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.plugin.service/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.application.plugin.service + + diff --git a/org.opentosca.bus.application.plugin.service/src/org/opentosca/bus/application/plugin/service/IApplicationBusPluginService.java b/org.opentosca.bus/org.opentosca.bus.application.plugin.service/src/main/java/org/opentosca/bus/application/plugin/service/IApplicationBusPluginService.java similarity index 78% rename from org.opentosca.bus.application.plugin.service/src/org/opentosca/bus/application/plugin/service/IApplicationBusPluginService.java rename to org.opentosca.bus/org.opentosca.bus.application.plugin.service/src/main/java/org/opentosca/bus/application/plugin/service/IApplicationBusPluginService.java index 08f9d256d..55a0c5df8 100644 --- a/org.opentosca.bus.application.plugin.service/src/org/opentosca/bus/application/plugin/service/IApplicationBusPluginService.java +++ b/org.opentosca.bus/org.opentosca.bus.application.plugin.service/src/main/java/org/opentosca/bus/application/plugin/service/IApplicationBusPluginService.java @@ -5,20 +5,16 @@ /** * Interface of the Application Bus plugins.
*
- * - * - * The interface specifies two methods. One that returns the supported invocation-types of the - * plugin and one method that returns the routing endpoint of the bundle. - * - * + *

+ *

+ * The interface specifies two methods. One that returns the supported invocation-types of the plugin and one method + * that returns the routing endpoint of the bundle. * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * */ public interface IApplicationBusPluginService { /** - * * @return supported invocation-types of the plugin. */ public List getSupportedInvocationTypes(); @@ -27,5 +23,4 @@ public interface IApplicationBusPluginService { * @return the routing endpoint of this bundle */ public String getRoutingEndpoint(); - } diff --git a/org.opentosca.bus.application.service.impl/Instructions.txt b/org.opentosca.bus/org.opentosca.bus.application.service/Instructions.txt similarity index 100% rename from org.opentosca.bus.application.service.impl/Instructions.txt rename to org.opentosca.bus/org.opentosca.bus.application.service/Instructions.txt diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/pom.xml b/org.opentosca.bus/org.opentosca.bus.application.service/pom.xml new file mode 100644 index 000000000..3b436602a --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.application.service + + + + + org.apache.camel + camel-core + ${camel.version} + + + org.apache.camel + camel-spring + ${camel.version} + + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.bus.application.plugin.service + ${project.version} + + + org.opentosca + org.opentosca.bus.application.model + ${project.version} + + + + + diff --git a/org.opentosca.bus.application.service/src/org/opentosca/bus/application/service/IApplicationBusService.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/IApplicationBusService.java similarity index 91% rename from org.opentosca.bus.application.service/src/org/opentosca/bus/application/service/IApplicationBusService.java rename to org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/IApplicationBusService.java index 89e1e7cdb..f18165124 100644 --- a/org.opentosca.bus.application.service/src/org/opentosca/bus/application/service/IApplicationBusService.java +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/IApplicationBusService.java @@ -3,14 +3,11 @@ /** * Interface of the Application Bus.
*
- * - * + *

+ *

* The interface specifies one method that returns the routing endpoint of the Application Bus. * - * - * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * */ public interface IApplicationBusService { @@ -18,5 +15,4 @@ public interface IApplicationBusService { * @return the routing endpoint of this bundle */ public String getRoutingEndpoint(); - } diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/ApplicationBusServiceImpl.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/ApplicationBusServiceImpl.java new file mode 100644 index 000000000..ff1ce9b5d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/ApplicationBusServiceImpl.java @@ -0,0 +1,24 @@ +package org.opentosca.bus.application.service.impl; + +import org.opentosca.bus.application.service.IApplicationBusService; + +/** + * Application Bus implementation.
+ *
+ *

+ * The routing endpoint is defined here. The Application Bus APIs need this endpoint to send requests to the Application + * Bus. The endpoint is handed over during the bind process in the respective API implementation. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @see IApplicationBusService + */ +public class ApplicationBusServiceImpl implements IApplicationBusService { + + // Routing endpoint of the Application Bus bundle + public static final String ENDPOINT = "direct-vm:org.opentosca.bus.application.service"; + + @Override + public String getRoutingEndpoint() { + return ENDPOINT; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/ContainerProxy.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/ContainerProxy.java new file mode 100644 index 000000000..7e29df2bc --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/ContainerProxy.java @@ -0,0 +1,500 @@ +package org.opentosca.bus.application.service.impl; + +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.List; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TDeploymentArtifact; +import org.eclipse.winery.model.tosca.TDeploymentArtifacts; +import org.eclipse.winery.model.tosca.TEntityTemplate; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TNodeType; +import org.eclipse.winery.model.tosca.TNodeTypeImplementation; +import org.eclipse.winery.model.tosca.TServiceTemplate; +import org.eclipse.winery.model.tosca.TTopologyTemplate; + +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.instance.NodeInstance; +import org.opentosca.container.core.model.instance.ServiceInstance; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.IInstanceDataService; +import org.opentosca.container.core.tosca.convention.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * This class is used as a proxy to the ToscaEngineService & InstanceDataService. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @TODO prototype: refactoring needed, integrate new methods into the ToscaEngineService and use them instead of xml + * parsing here. + * @deprecated Instead of proxying to the services here, the services should be injected directly! + */ +@Service +@Deprecated +public class ContainerProxy { + + static final private String NAMESPACE = "http://www.uni-stuttgart.de/opentosca"; + static final private String INTERFACES_PROPERTIES_NAME = "ApplicationInterfacesProperties"; + static final private String INTERFACE_INFORMATIONS = "ApplicationInterfaceInformations"; + static final private String INTERFACE_INFORMATION = "ApplicationInterfaceInformation"; + static final private String RELATIVE_ENDPOINT = "Endpoint"; + static final private String PORT = "Port"; + static final private String INVOCATION_TYPE = "InvocationType"; + + static final private String HOSTED_ON_NAMESPACE = "http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes"; + static final private String HOSTED_ON_LOCALPART = "HostedOn"; + + private static final Logger LOG = LoggerFactory.getLogger(ContainerProxy.class); + + private final IInstanceDataService instanceDataService; + private final CsarStorageService storageService; + + @Inject + public ContainerProxy(IInstanceDataService instanceDataService, CsarStorageService storageService) { + this.instanceDataService = instanceDataService; + this.storageService = storageService; + } + + /** + * @return NodeInstance with specified ID + */ + @Nullable + public NodeInstance getNodeInstance(final Integer serviceInstanceID, final Integer nodeInstanceID, + final String nodeTemplateID) { + LOG.debug("Searching NodeInstance with serviceInstanceID: " + serviceInstanceID + " nodeInstanceID: " + + nodeInstanceID + " nodeTemplateID: " + nodeTemplateID); + if (nodeInstanceID == null) { + final String namespace = getServiceInstance(serviceInstanceID).getServiceTemplateID().getNamespaceURI(); + URI serviceInstanceUri; + try { + serviceInstanceUri = new URI(serviceInstanceID.toString()); + } catch (URISyntaxException e) { + LOG.warn("No matching NodeInstance found.", e); + return null; + } + List nodeInstances = instanceDataService.getNodeInstances(null, nodeTemplateID, null, + serviceInstanceUri); + if (nodeInstances.size() > 0) { + return nodeInstances.get(0); + } + } else { + URI nodeInstanceUri; + try { + nodeInstanceUri = new URI(nodeInstanceID.toString()); + } catch (URISyntaxException e) { + LOG.warn("No matching NodeInstance found.", e); + return null; + } + List nodeInstances = + instanceDataService.getNodeInstances(nodeInstanceUri, null, null, null); + for (final NodeInstance nodeInstance : nodeInstances) { + if (nodeInstance.getId() == nodeInstanceID) { + return nodeInstance; + } + } + } + LOG.warn("No matching NodeInstance found."); + return null; + } + + /** + * @return ServiceInstance with specified ID + */ + @Nullable + protected ServiceInstance getServiceInstance(final Integer id) { + LOG.trace("Searching ServiceInstance with ID: {}", id); + final URI serviceInstanceID; + try { + serviceInstanceID = new URI(id.toString()); + } catch (final URISyntaxException e) { + LOG.warn("No ServiceInstance with matching ID found.", e); + return null; + } + final List instances = instanceDataService.getServiceInstances(serviceInstanceID, null, null); + for (final ServiceInstance instance : instances) { + if (instance.getDBId() == id) { + LOG.trace("ServiceInstance with matching ID found."); + return instance; + } + } + LOG.warn("No ServiceInstance with matching ID found."); + return null; + } + + /** + * Searches for NodeTypeImplementations and their DeploymentArtifacts as well as their ArtifactTemplates of the + * specified NodeType. If the needed properties are found, they are returned. + * + * @return specified properties as Node + */ + @Nullable + public Node getPropertiesNode(final CsarId csarId, final QName nodeTypeName, final String interfaceName) { + LOG.trace("Searching ArtifactTemplate defining needed properties for Interface [{}] of NodeType [{}] inside Csar {}", + interfaceName, nodeTypeName, csarId); + final Csar csar = storageService.findById(csarId); + // FIXME not sure whether that's equivalent! + final TNodeType nodeType; + try { + nodeType = ToscaEngine.resolveNodeTypeReference(csar, nodeTypeName); + } catch (NotFoundException missing) { + LOG.warn("Did not find NodeType requested with csarId {}, nodeTypeName: {}", csarId, nodeTypeName); + return null; + } + final List nodeTypeImplementations = ToscaEngine.nodeTypeImplementations(csar, nodeType); + LOG.trace("The NodeType [{}] has {} NodeTypeImplementations.", nodeTypeName, nodeTypeImplementations.size()); + + for (final TNodeTypeImplementation nodeTypeImplementation : nodeTypeImplementations) { + // if there are DAs + final TDeploymentArtifacts deploymentArtifacts = nodeTypeImplementation.getDeploymentArtifacts(); + if (deploymentArtifacts == null) { + LOG.warn("The NodeTypeImplementation {} has no DeploymentArtifacts.", + nodeTypeImplementation.getName()); + return null; + } + LOG.trace("The NodeTypeImplementation [{}] has {} DeploymentArtifacts.", + nodeTypeImplementation.getName(), deploymentArtifacts.getDeploymentArtifact().size()); + for (final TDeploymentArtifact da : deploymentArtifacts.getDeploymentArtifact()) { + LOG.trace("- {}", da.getName()); + LOG.trace("Searching for ArtifactTemplates."); + + final QName artifactRef = da.getArtifactRef(); + + if (artifactRef == null) { + LOG.debug("No ArtifactTemplate for DA: {} found. Skipping DA.", da.getName()); + continue; + } + LOG.trace("ArtifactTemplate for DA [{}] found: {}. Getting the properties of it.", da.getName(), artifactRef); + + final Document properties = ToscaEngine.getArtifactTemplateProperties(csar, artifactRef); + if (properties == null) { + LOG.debug("ArtifactTemplate : {} has no specified properties. Skipping DA", artifactRef); + continue; + } + LOG.trace("Properties of ArtifactTemplate: {} found.", artifactRef); + LOG.trace("Getting the {} elements if existing.", INTERFACES_PROPERTIES_NAME); + + // get ApplicationInterfacesProperties + final NodeList appPropsList = properties.getElementsByTagNameNS(NAMESPACE, INTERFACES_PROPERTIES_NAME); + + LOG.trace("{} {} elements found.", appPropsList.getLength(), INTERFACES_PROPERTIES_NAME); + + boolean hostEndpointSpecified = false; + boolean portSpecified = false; + boolean invocationTypeSpecified = false; + boolean interfaceFound = false; + + Node propNode = null; + + for (int i = 0; i < appPropsList.getLength(); i++) { + hostEndpointSpecified = false; + portSpecified = false; + invocationTypeSpecified = false; + interfaceFound = false; + + LOG.debug("Check if information are specified for the correct Interface."); + propNode = appPropsList.item(i); + // get properties like endpoint or invocationType + final NodeList appProps = propNode.getChildNodes(); + for (int i2 = 0; i2 < appProps.getLength(); i2++) { + final Node addProp = appProps.item(i2); + if (addProp.getNodeType() == Node.ELEMENT_NODE) { + if (addProp.getLocalName().equals(RELATIVE_ENDPOINT)) { + LOG.trace("Endpoint property found."); + hostEndpointSpecified = true; + } else if (addProp.getLocalName().equals(PORT)) { + LOG.trace("Port property found."); + portSpecified = true; + } else if (addProp.getLocalName().equals(INVOCATION_TYPE)) { + LOG.trace("InvocationType property found."); + invocationTypeSpecified = true; + } else if (addProp.getLocalName().equals(INTERFACE_INFORMATIONS)) { + // check if interface matches + final NodeList appInvInterfaceInfo = + ((Element) addProp).getElementsByTagNameNS(NAMESPACE, INTERFACE_INFORMATION); + + LOG.trace("{} for {} Interfaces found.", INTERFACE_INFORMATION, appInvInterfaceInfo.getLength()); + for (int i3 = 0; i3 < appInvInterfaceInfo.getLength(); i3++) { + final String interfName = appInvInterfaceInfo.item(i3).getAttributes() + .getNamedItem("name").getNodeValue(); + if (interfName.equals(interfaceName)) { + interfaceFound = true; + LOG.trace("Properties for interface: {} found.", interfaceName); + } + } + } + } + } + } + if (hostEndpointSpecified && portSpecified && invocationTypeSpecified && interfaceFound) { + LOG.debug("Properties with all needed information(Endpoint & InvocationType) for interface: " + + interfaceName + " of NodeType: " + nodeTypeName + " inside CSAR: " + csarId + " found!"); + return propNode; + } + } + } + LOG.debug("No ArtifactTemplate with needed properties for interface: " + interfaceName + " of NodeType: " + + nodeTypeName + " inside CSAR: " + csarId + " found!"); + return null; + } + + /** + * @return relative endpoint, specified in properties (as Endpoint property). + */ + @Nullable + public String getRelativeEndpoint(final Node propNode) { + // get properties like endpoint or invocationType + final NodeList appProps = propNode.getChildNodes(); + for (int i = 0; i < appProps.getLength(); i++) { + final Node addProp = appProps.item(i); + if (addProp.getNodeType() == Node.ELEMENT_NODE && addProp.getLocalName().equals(RELATIVE_ENDPOINT)) { + final String hostEndpoint = addProp.getTextContent().trim(); + LOG.debug("Endpoint property: {}", hostEndpoint); + return hostEndpoint; + } + } + return null; + } + + /** + * @return port, specified in properties (as Port property). + */ + @Nullable + public Integer getPort(final Node propNode) { + // get properties like endpoint or invocationType + final NodeList appProps = propNode.getChildNodes(); + for (int i = 0; i < appProps.getLength(); i++) { + final Node addProp = appProps.item(i); + if (addProp.getNodeType() == Node.ELEMENT_NODE) { + if (addProp.getLocalName().equals(PORT)) { + final Integer port = Integer.parseInt(addProp.getTextContent().trim()); + LOG.debug("Port property: {}", port); + return port; + } + } + } + return null; + } + + /** + * @return invocationType, specified in properties (as InvocationType property). + */ + @Nullable + public String getInvocationType(final Node propNode) { + + // get properties like endpoint or + // invocationType + final NodeList appProps = propNode.getChildNodes(); + + for (int i = 0; i < appProps.getLength(); i++) { + + final Node addProp = appProps.item(i); + + if (addProp.getNodeType() == Node.ELEMENT_NODE) { + + if (addProp.getLocalName().equals(INVOCATION_TYPE)) { + final String invocationType = addProp.getTextContent().trim(); + LOG.debug("InvocationType property: {}", invocationType); + return invocationType; + } + } + } + return null; + } + + /** + * @return implementing class specified in the properties of the specified interface + */ + @Nullable + public String getClass(final Node propNode, final String interfaceName) { + + // get properties like endpoint or + // invocationType + final NodeList appProps = propNode.getChildNodes(); + + for (int i = 0; i < appProps.getLength(); i++) { + + final Node addProp = appProps.item(i); + + if (addProp.getNodeType() == Node.ELEMENT_NODE) { + + if (addProp.getLocalName().equals(INTERFACE_INFORMATIONS)) { + + // check if interface matches + final NodeList appInvInterfaceInfo = + ((Element) addProp).getElementsByTagNameNS(NAMESPACE, INTERFACE_INFORMATION); + + LOG.debug(INTERFACE_INFORMATIONS + " for " + +appInvInterfaceInfo.getLength() + + " Interfaces found."); + + for (int i2 = 0; i2 < appInvInterfaceInfo.getLength(); i2++) { + + final String interfName = + appInvInterfaceInfo.item(i2).getAttributes().getNamedItem("name").getNodeValue(); + + if (interfName.equals(interfaceName)) { + final String className = + appInvInterfaceInfo.item(i2).getAttributes().getNamedItem("class").getNodeValue(); + LOG.debug("Class property: {}", className); + return className; + } + } + } + } + } + return null; + } + + /** + * @return name of a NodeTemplate of the specified NodeType inside of the specified serviceTemplate & csar + */ + @Nullable + protected String getANodeTemplateNameOfNodeType(final CsarId csarId, final QName serviceTemplateID, final QName nodeTypeQName) { + + LOG.debug("Searching NodeTemplate of NodeType: " + nodeTypeQName + " in the ServiceTemplate: " + + serviceTemplateID + " inside the CSAR: " + csarId); + + // get the ServiceTemplate + Csar csar = storageService.findById(csarId); + final TServiceTemplate serviceTemplate; + try { + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateID); + } catch (NotFoundException e) { + LOG.warn("Could not find containing serviceTemplate for NodeTemplate name request with arguments csarId: {}, serviceTemplateId: {}", csarId, serviceTemplateID); + return null; + } + + final TTopologyTemplate topologyTemplate = serviceTemplate.getTopologyTemplate(); + if (topologyTemplate == null) { + LOG.warn("Topology template of service template [{}] was null, even though we are not in modeling mode", serviceTemplateID); + return null; + } + for (final TEntityTemplate entity : topologyTemplate.getNodeTemplateOrRelationshipTemplate()) { + TNodeTemplate nodeTemplate = new TNodeTemplate(); + // get NodeTemplate + if (!(entity instanceof TNodeTemplate)) { + continue; + } + nodeTemplate = (TNodeTemplate) entity; + if (nodeTemplate.getType() == null || !nodeTemplate.getType().equals(nodeTypeQName)) { + continue; + } + final String nodeTemplateID = nodeTemplate.getId(); + LOG.debug("NodeTemplate of NodeType: " + nodeTypeQName + " in the ServiceTemplate: " + + serviceTemplateID + " inside the CSAR: " + csarId + " found. NodeTemplateID: " + + nodeTemplateID); + return nodeTemplateID; + } + LOG.debug("No NodeTemplate of NodeType: " + nodeTypeQName + " in the ServiceTemplate: " + serviceTemplateID + + " inside the CSAR: " + csarId + " found."); + return null; + } + + /** + * Returns the first NodeTemplate underneath the defined NodeTemplate containing the IP property. + * + * @return name of the first NodeTemplate underneath the defined NodeTemplate containing the IP property. + */ + public String getHostedOnNodeTemplateWithSpecifiedIPProperty(final CsarId csarId, + final QName serviceTemplateId, + final String nodeTemplateId) { + LOG.debug("Searching NodeTemplate with specified IP-Property underneath the NodeTemplate: " + nodeTemplateId + + " of the ServiceTemplate :" + serviceTemplateId + " inside the CSAR: " + csarId); + Csar csar = storageService.findById(csarId); + + final TServiceTemplate context; + TNodeTemplate nodeTemplate; + try { + context = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateId); + nodeTemplate = ToscaEngine.resolveNodeTemplate(context, nodeTemplateId); + } catch (NotFoundException e) { + LOG.warn("Could not find service template {} or node template {} within csar {}", serviceTemplateId, nodeTemplateId, csar); + return null; + } + Document props = ToscaEngine.getNodeTemplateProperties(nodeTemplate); + final QName relationshipType = new QName(HOSTED_ON_NAMESPACE, HOSTED_ON_LOCALPART); + while (nodeTemplate != null && getIpProperty(props) == null) { + + LOG.trace("{} isn't the searched NodeTemplate.", nodeTemplate.getId()); + LOG.trace("Getting the underneath Node for checking if it is the searched NodeTemplate."); + + nodeTemplate = ToscaEngine.getRelatedNodeTemplate(context, nodeTemplate, relationshipType); + if (nodeTemplate != null) { + LOG.trace("Checking if the underneath Node: {} is the searched NodeTemplate.", nodeTemplateId); + props = ToscaEngine.getNodeTemplateProperties(nodeTemplate); + } + } + + if (nodeTemplate != null) { + LOG.debug("NodeTemplate with specified IP-Property in the ServiceTemplate: " + serviceTemplateId + + " inside the CSAR: " + csarId + " found: " + nodeTemplate.getId()); + } else { + LOG.debug("No NodeTemplate with specified IP-Property in the ServiceTemplate: " + serviceTemplateId + + " inside the CSAR: " + csarId + " found."); + } + return nodeTemplate.getId(); + } + + /** + * Returns the in the InstanceDataService stored IP property of the specified ServiceInstance & NodeTemplate. + * + * @return IP property + */ + @Nullable + public URL getIpFromInstanceDataProperties(final URI serviceInstanceID, final String nodeTemplateID) { + + LOG.debug("Getting IP-Property from InstanceDataService of NodeTemplate: " + nodeTemplateID + " of ServiceInstanceID: " + serviceInstanceID + "."); + + final List nodeInstances = instanceDataService.getNodeInstances(null, nodeTemplateID, null, serviceInstanceID); + for (final NodeInstance nodeInstance : nodeInstances) { + final Document props = nodeInstance.getProperties(); + final String ip = getIpProperty(props); + if (ip != null) { + LOG.debug("IP-Property from InstanceDataService of NodeTemplate: " + nodeTemplateID + " ServiceInstanceID: " + serviceInstanceID + " found: " + ip); + try { + return new URL(ip); + } catch (final MalformedURLException e) { + e.printStackTrace(); + } + } + } + LOG.debug("No IP-Property from InstanceDataService of NodeTemplate: " + nodeTemplateID + " ServiceInstanceID: " + serviceInstanceID + " found."); + return null; + } + + /** + * @param props to check + * @return IP property, if exist. Otherwise null. + */ + private static String getIpProperty(final Document props) { + if (props == null) { + return null; + } + LOG.trace("Checking if IP-Property is defined in the xml document: " + props.getTextContent()); + final List knownIpProperties = Utils.getSupportedVirtualMachineIPPropertyNames(); + for (final String ipProperty : knownIpProperties) { + final NodeList list = props.getElementsByTagName(ipProperty); + if (list.getLength() > 0) { + final String ip = list.item(0).getTextContent(); + LOG.debug("Property: {} is defined: {}", ipProperty, ip); + return ip; + } + } + LOG.debug("No IP-Property defined."); + return null; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/QueueMap.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/QueueMap.java new file mode 100644 index 000000000..7e2663cae --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/QueueMap.java @@ -0,0 +1,82 @@ +package org.opentosca.bus.application.service.impl.model; + +import java.util.concurrent.ConcurrentHashMap; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Map that manages the requests. RequestID is used as key of the map. The value of the map indicates + * if the invocation has finished or not. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class QueueMap { + + final private static Logger LOG = LoggerFactory.getLogger(QueueMap.class); + + private static ConcurrentHashMap queue = new ConcurrentHashMap<>(); + + /** + * Inserts an entry into the queue (if not already existing) and set it to finished. + * + * @param id of the request + */ + public static void finished(final String id) { + + QueueMap.LOG.debug("Request with ID: {} has finished.", id); + + queue.put(id, true); + } + + /** + * Inserts an entry into the queue and set it to notFinished. Only if the id not already exists. + * + * @param id of the request + */ + public static void notFinished(final String id) { + + QueueMap.LOG.debug("Request with ID: {} hasn't finished yet.", id); + + queue.putIfAbsent(id, false); + } + + /** + * Inserts an entry into the queue. + * + * @param id of the request + * @param isFinished specifies if the invocation has finished or not + */ + public static void put(final String id, final Boolean isFinished) { + + QueueMap.LOG.debug("RequestID: {}, isFinished: {}", id, isFinished); + + queue.put(id, isFinished); + } + + /** + * @param id of the request + * @return true if the invocation has finished. Otherwise false + */ + public static boolean hasFinished(final String id) { + + return queue.get(id); + } + + /** + * @param id of the request + * @return true if the queue contains the specified requestID. Otherwise false + */ + public static boolean containsID(final String id) { + return queue.containsKey(id); + } + + /** + * Removes the entry with the specified requestID from the queue. + * + * @param id of the request + */ + public static void remove(final String id) { + queue.remove(id); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/RequestID.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/RequestID.java new file mode 100644 index 000000000..1a9a4b1c1 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/RequestID.java @@ -0,0 +1,30 @@ +package org.opentosca.bus.application.service.impl.model; + +import java.util.concurrent.atomic.AtomicLong; + +/** + * Manages the requestIDs needed to correlate the invocation-requests, the isFinished-requests as well as the + * getResult-requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class RequestID { + + private static AtomicLong incrementer = new AtomicLong(0); + + /** + * @return requestID + */ + public synchronized static Long getNextID() { + + final Long id = incrementer.getAndIncrement(); + + // For the unlikely case, that MAX_Value is reached, begin with 0 + // again. Assumption: old requests were processed in the mean time. + if (id == Long.MAX_VALUE) { + incrementer.set(0); + } + + return id; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/ResultMap.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/ResultMap.java new file mode 100644 index 000000000..2764bdb05 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/model/ResultMap.java @@ -0,0 +1,48 @@ +package org.opentosca.bus.application.service.impl.model; + +import java.util.concurrent.ConcurrentHashMap; + +/** + * Map that manages the invocation results. RequestID is used as key of the map. The + * value of the map is the result of the invocation. Or null if the invocation + * failed. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class ResultMap { + + private static ConcurrentHashMap invocations = new ConcurrentHashMap<>(); + + /** + * @param id of the request + * @param obj result of the invocation. + */ + public static void put(final String id, final Object obj) { + invocations.put(id, obj); + } + + /** + * @return result of the invocation. Void if the invoked method was of return type + * void. null if the invocation failed. + */ + public static Object get(final String id) { + return invocations.get(id); + } + + /** + * @param id of the request + * @return true if the map contains the specified requestID. Otherwise false + */ + public static boolean containsID(final String id) { + return invocations.containsKey(id); + } + + /** + * Removes the entry with the specified requestID from the map. + * + * @param id of the request + */ + public static void remove(final String id) { + invocations.remove(id); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/GetResultProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/GetResultProcessor.java new file mode 100644 index 000000000..48f57bf5d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/GetResultProcessor.java @@ -0,0 +1,50 @@ +package org.opentosca.bus.application.service.impl.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; +import org.opentosca.bus.application.service.impl.model.QueueMap; +import org.opentosca.bus.application.service.impl.model.ResultMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * GetResultProcessor of the Application Bus.
+ *
+ *

+ * This processor handles "getResult" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component(GetResultProcessor.BEAN_NAME) +@NonNullByDefault +public class GetResultProcessor implements Processor { + + public static final String BEAN_NAME = "getResultProcessor"; + + private static final Logger LOG = LoggerFactory.getLogger(GetResultProcessor.class); + + @Override + public void process(final Exchange exchange) { + final String requestID = exchange.getIn().getBody(String.class); + LOG.debug("getResult request received. RequestID: {}", requestID); + if (ResultMap.containsID(requestID)) { + LOG.debug("Getting result."); + final Object result = ResultMap.get(requestID); + + // "Garbage collection": Remove polled responses. Maybe client should actively delete it. + ResultMap.remove(requestID); + QueueMap.remove(requestID); + + exchange.getIn().setBody(result); + } else if (!QueueMap.containsID(requestID)) { + LOG.warn("Unknown RequestID: {}", requestID); + exchange.getIn().setBody(new ApplicationBusInternalException("Unknown RequestID: " + requestID)); + } else { + LOG.warn("Error while invoking specified method."); + exchange.getIn().setBody(new ApplicationBusInternalException("Error while invoking specified method.")); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/InvocationRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/InvocationRequestProcessor.java new file mode 100644 index 000000000..3ed7424e0 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/InvocationRequestProcessor.java @@ -0,0 +1,141 @@ +package org.opentosca.bus.application.service.impl.processor; + +import java.net.MalformedURLException; +import java.net.URL; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; +import org.opentosca.bus.application.service.impl.ContainerProxy; +import org.opentosca.bus.application.service.impl.route.InvokeOperationRoute; +import org.opentosca.bus.application.service.impl.servicehandler.ApplicationBusPluginRegistry; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.instance.NodeInstance; +import org.opentosca.container.core.model.instance.ServiceInstance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Node; + +/** + * InvocationRequestProcessor of the Application Bus.
+ *
+ *

+ * This processor handles "invokeOperation" requests. Needed information are collected in order to determine the + * endpoint of the NodeTemplate of which the specified method should be invoked. The effective invocation is done by the + * Application Bus plugins depending on their supporting invocation types. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component(InvocationRequestProcessor.BEAN_NAME) +@NonNullByDefault +public class InvocationRequestProcessor implements Processor { + + public static final String BEAN_NAME = "invocationRequestProcessor"; + final private static Logger LOG = LoggerFactory.getLogger(InvocationRequestProcessor.class); + + private final ContainerProxy containerProxy; + private final ApplicationBusPluginRegistry pluginRegistry; + + @Inject + public InvocationRequestProcessor(ContainerProxy containerProxy, ApplicationBusPluginRegistry pluginRegistry) { + this.containerProxy = containerProxy; + this.pluginRegistry = pluginRegistry; + } + + @Override + public void process(final Exchange exchange) throws Exception { + LOG.debug("InvokeOperation request processing started..."); + final Message message = exchange.getIn(); + + @Nullable final Integer serviceInstanceID = + message.getHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), Integer.class); + LOG.trace("serviceInstanceID: {}", serviceInstanceID); + + @Nullable + String nodeTemplateID = message.getHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), String.class); + LOG.trace("nodeTemplateID: {}", nodeTemplateID); + + @Nullable final Integer nodeInstanceID = + message.getHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), Integer.class); + LOG.trace("nodeInstanceID: {}", nodeInstanceID); + + @Nullable final String interfaceName = message.getHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), String.class); + LOG.trace("interfaceName: {}", interfaceName); + + @Nullable final String operationName = message.getHeader(ApplicationBusConstants.OPERATION_NAME.toString(), String.class); + LOG.trace("operationName: {}", operationName); + + final NodeInstance nodeInstance = + containerProxy.getNodeInstance(serviceInstanceID, nodeInstanceID, nodeTemplateID); + if (nodeInstance == null) { + throw new ApplicationBusInternalException("NodeInstance could not be found"); + } + + final QName nodeType = nodeInstance.getNodeType(); + final ServiceInstance serviceInstance = nodeInstance.getServiceInstance(); + final CsarId csarID = serviceInstance.getCsarID(); + final QName serviceTemplateID = serviceInstance.getServiceTemplateID(); + + if (nodeTemplateID == null) { + nodeTemplateID = nodeInstance.getNodeTemplateID().getLocalPart(); + } + + LOG.trace("Matching NodeInstance found: ID: " + nodeInstance.getNodeInstanceID() + + " CSAR-ID: " + csarID + " ServiceTemplateID: " + serviceTemplateID + " NodeTemplateID: " + + nodeTemplateID + " of type: " + nodeType); + + final Node properties = containerProxy.getPropertiesNode(csarID, nodeType, interfaceName); + if (properties == null) { + throw new ApplicationBusInternalException("Property Node was not found. Could not read Application Properties"); + } + + final String relativeHostEndpoint = containerProxy.getRelativeEndpoint(properties); + final Integer port = containerProxy.getPort(properties); + final String invocationType = containerProxy.getInvocationType(properties); + final String className = containerProxy.getClass(properties, interfaceName); + if (relativeHostEndpoint == null || port == null || invocationType == null || className == null) { + throw new ApplicationBusInternalException("Could not gather all necessary information from Application Properties"); + } + + final String hostedOnNodeTemplateID = containerProxy.getHostedOnNodeTemplateWithSpecifiedIPProperty(csarID, serviceTemplateID, nodeTemplateID); + if (hostedOnNodeTemplateID == null) { + throw new ApplicationBusInternalException("Could not find hosting NodeTemplate"); + } + + // get the Namespace from the serviceTemplate + final URL hostedOnNodeURL = containerProxy.getIpFromInstanceDataProperties(serviceInstance.getServiceInstanceID(), hostedOnNodeTemplateID); + if (hostedOnNodeURL == null) { + throw new ApplicationBusInternalException("Could not find node URL in instanceDataProperties"); + } + + final URL endpoint; + LOG.debug("Generating endpoint for Node: {}", nodeTemplateID); + try { + endpoint = new URL(hostedOnNodeURL.getProtocol(), hostedOnNodeURL.getAuthority(), port, relativeHostEndpoint); + LOG.debug("Generated endpoint: " + endpoint); + } catch (final MalformedURLException e) { + LOG.error("Generating endpoint for Node: {} failed!", nodeTemplateID); + e.printStackTrace(); + throw new ApplicationBusInternalException("Generating endpoint for Node " + nodeTemplateID + " failed!", e); + } + + message.setHeader(ApplicationBusConstants.CLASS_NAME.toString(), className); + message.setHeader(ApplicationBusConstants.INVOCATION_ENDPOINT_URL.toString(), endpoint.toString()); + LOG.debug("Searching an Application Bus Plugin for InvocationType: {}", invocationType); + + // set ID of the matching Application Bus Plugin bundle. Needed for routing. + final String appBusPluginEndpoint = pluginRegistry.getApplicationBusPluginBundleID(invocationType); + if (appBusPluginEndpoint != null) { + LOG.debug("Application Bus Plugin with matching InvocationType: {} found. Endpoint: {}", invocationType, appBusPluginEndpoint); + exchange.getIn().setHeader(InvokeOperationRoute.APPLICATION_BUS_PLUGIN_ENDPOINT_HEADER, appBusPluginEndpoint); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/IsFinishedProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/IsFinishedProcessor.java new file mode 100644 index 000000000..85108698b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/IsFinishedProcessor.java @@ -0,0 +1,44 @@ +package org.opentosca.bus.application.service.impl.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; +import org.opentosca.bus.application.service.impl.model.QueueMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * IsFinishedProcessor of the Application Bus.
+ *
+ *

+ * This processor handles "isFinished" requests. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component(IsFinishedProcessor.BEAN_NAME) +public class IsFinishedProcessor implements Processor { + + public static final String BEAN_NAME = "isFinishedProcessor"; + private static final Logger LOG = LoggerFactory.getLogger(IsFinishedProcessor.class); + + @Override + public void process(final Exchange exchange) { + final String requestID = exchange.getIn().getBody(String.class); + LOG.debug("Queue polling for RequestID: {}", requestID); + + if (QueueMap.containsID(requestID)) { + LOG.debug("RequestID is known."); + if (QueueMap.hasFinished(requestID)) { + LOG.debug("Invocation has finished."); + exchange.getIn().setBody(true); + } else { + LOG.debug("Invocation has not finished yet."); + exchange.getIn().setBody(false); + } + } else { + LOG.warn("Unknown RequestID: {}", requestID); + exchange.getIn().setBody(new ApplicationBusInternalException("Unknown RequestID: " + requestID)); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/ParameterCheckProcessor.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/ParameterCheckProcessor.java new file mode 100644 index 000000000..500579e05 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/processor/ParameterCheckProcessor.java @@ -0,0 +1,66 @@ +package org.opentosca.bus.application.service.impl.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.Processor; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * ParameterCheckProcessor of the Application Bus.
+ *
+ * This processor checks if all needed parameters are specified.. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component(ParameterCheckProcessor.BEAN_NAME) +@NonNullByDefault +public class ParameterCheckProcessor implements Processor { + + public static final String BEAN_NAME = "parameterCheckProcessor"; + private static final Logger LOG = LoggerFactory.getLogger(ParameterCheckProcessor.class); + + @Override + public void process(final Exchange exchange) throws ApplicationBusExternalException { + + LOG.info("Checking if all needed parameters are specified..."); + final Message message = exchange.getIn(); + + @Nullable final Integer serviceInstanceID = + message.getHeader(ApplicationBusConstants.SERVICE_INSTANCE_ID_INT.toString(), Integer.class); + LOG.debug("serviceInstanceID: {}", serviceInstanceID); + @Nullable final String nodeTemplateID = + message.getHeader(ApplicationBusConstants.NODE_TEMPLATE_ID.toString(), String.class); + LOG.debug("nodeTemplateID: {}", nodeTemplateID); + @Nullable final Integer nodeInstanceID = + message.getHeader(ApplicationBusConstants.NODE_INSTANCE_ID_INT.toString(), Integer.class); + LOG.debug("nodeInstanceID: {}", nodeInstanceID); + @Nullable final String interfaceName = message.getHeader(ApplicationBusConstants.INTERFACE_NAME.toString(), String.class); + LOG.debug("interfaceName: {}", interfaceName); + @Nullable final String operationName = message.getHeader(ApplicationBusConstants.OPERATION_NAME.toString(), String.class); + LOG.debug("operationName: {}", operationName); + + if (serviceInstanceID == null && nodeInstanceID == null) { + throw new ApplicationBusExternalException( + "Can't process request: neither >>ServiceInstanceID<< nor >>NodeInstanceID<< is specified!"); + } + final StringBuilder error = new StringBuilder(); + if (interfaceName == null) { + error.append(" >>Interface<<"); + } + if (operationName == null) { + error.append(" >>Operation<<"); + } + if (serviceInstanceID != null && nodeTemplateID == null) { + error.append(" >>NodeTemplateID<<"); + } + if (error.length() != 0) { + throw new ApplicationBusExternalException("Can't process request: " + error.toString() + " is missing."); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/GetResultRoute.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/GetResultRoute.java new file mode 100644 index 000000000..fd352acc9 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/GetResultRoute.java @@ -0,0 +1,24 @@ +package org.opentosca.bus.application.service.impl.route; + +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.application.service.impl.processor.GetResultProcessor; +import org.springframework.stereotype.Component; + +/** + * GetResultRoute of the Application Bus.
+ *
+ *

+ * "getResult" requests are handed over to the GetResultProcessor. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +public class GetResultRoute extends RouteBuilder { + @Override + public void configure() throws Exception { + // handle exceptions + onException(Exception.class).setBody(property(Exchange.EXCEPTION_CAUGHT)); + from(MainRoute.GET_RESULT_ENDPOINT).process(GetResultProcessor.BEAN_NAME); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/InvokeOperationRoute.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/InvokeOperationRoute.java new file mode 100644 index 000000000..fdd4a2088 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/InvokeOperationRoute.java @@ -0,0 +1,72 @@ +package org.opentosca.bus.application.service.impl.route; + +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.application.model.exception.ApplicationBusExternalException; +import org.opentosca.bus.application.model.exception.ApplicationBusInternalException; +import org.opentosca.bus.application.service.impl.model.QueueMap; +import org.opentosca.bus.application.service.impl.model.RequestID; +import org.opentosca.bus.application.service.impl.model.ResultMap; +import org.opentosca.bus.application.service.impl.processor.InvocationRequestProcessor; +import org.opentosca.bus.application.service.impl.processor.ParameterCheckProcessor; +import org.springframework.stereotype.Component; + +/** + * InvokeOperationRoute of the Application Bus.
+ *
+ *

+ * "invokeOperation" requests are handled here. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +public class InvokeOperationRoute extends RouteBuilder { + + public final static String APPLICATION_BUS_PLUGIN_ENDPOINT_HEADER = "ApplicationBusPluginEndpoint"; + + private final static String APPLICATION_BUS_REQUEST_ID_HEADER = "ApplicationBusRequestID"; + + @Override + public void configure() throws Exception { + + // handle exceptions + onException(Exception.class).setBody(property(Exchange.EXCEPTION_CAUGHT)).to("direct:handleResponse"); + + // check if all needed parameters are specified. If this is the case set + // requestID (for the response) and send request to further processing. + from(MainRoute.INVOKE_ENDPOINT).doTry().process(ParameterCheckProcessor.BEAN_NAME).doCatch(ApplicationBusExternalException.class) + .end().choice().when(property(Exchange.EXCEPTION_CAUGHT).isNull()) + .setHeader(APPLICATION_BUS_REQUEST_ID_HEADER, + method(RequestID.class, "getNextID")) + .wireTap("direct:invokeProcess").end().to("direct:init").otherwise() + .setBody(property(Exchange.EXCEPTION_CAUGHT)); + + // set "isFinsihed"-flag to false for this request + from("direct:init").bean(QueueMap.class, "notFinished(${header." + APPLICATION_BUS_REQUEST_ID_HEADER + "})") + .setBody(simple("${header." + APPLICATION_BUS_REQUEST_ID_HEADER + "}")); + + // check if matching plugin is available and send request to it. + // Otherwise throw exception. + from("direct:invokeProcess").setExchangePattern(ExchangePattern.InOut) + .process(InvocationRequestProcessor.BEAN_NAME) + .choice() + .when(header(APPLICATION_BUS_PLUGIN_ENDPOINT_HEADER).isNotNull()) + .to("direct:toPlugin").endChoice() + .otherwise() + .throwException(new ApplicationBusInternalException("No matching Application Bus Plugin found.")); + + // send to plugin + from("direct:toPlugin").doTry().recipientList(header(APPLICATION_BUS_PLUGIN_ENDPOINT_HEADER)).end() + .doCatch(Exception.class).setBody(property(Exchange.EXCEPTION_CAUGHT)).doFinally() + .to("direct:handleResponse").end(); + + // handle response: set "isFinsihed"-flag to true and store result in + // ResultMap + from("direct:handleResponse").bean(QueueMap.class, + "finished(${header." + APPLICATION_BUS_REQUEST_ID_HEADER + "})") + .bean(ResultMap.class, + "put(${header." + APPLICATION_BUS_REQUEST_ID_HEADER + "}, ${body})") + .stop(); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/IsFinishedRoute.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/IsFinishedRoute.java new file mode 100644 index 000000000..b4e786fb9 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/IsFinishedRoute.java @@ -0,0 +1,25 @@ +package org.opentosca.bus.application.service.impl.route; + +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.application.service.impl.processor.IsFinishedProcessor; +import org.springframework.stereotype.Component; + +/** + * IsFinishedRoute of the Application Bus.
+ *
+ *

+ * "isFinished" requests are handed over to the IsFinishedProcessor. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +public class IsFinishedRoute extends RouteBuilder { + + @Override + public void configure() throws Exception { + // handle exceptions + onException(Exception.class).setBody(property(Exchange.EXCEPTION_CAUGHT)); + from(MainRoute.IS_FINISHED_ENDPOINT).process(IsFinishedProcessor.BEAN_NAME); + } +} diff --git a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/MainRoute.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/MainRoute.java similarity index 83% rename from org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/MainRoute.java rename to org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/MainRoute.java index dc6b28fbc..fdc476eb4 100644 --- a/org.opentosca.bus.application.service.impl/src/org/opentosca/bus/application/service/impl/route/MainRoute.java +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/route/MainRoute.java @@ -1,47 +1,44 @@ -package org.opentosca.bus.application.service.impl.route; - -import org.apache.camel.Predicate; -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.bus.application.model.constants.ApplicationBusConstants; -import org.opentosca.bus.application.service.impl.ApplicationBusServiceImpl; - -/** - * MainRoute of the Application Bus.
- *
- * - * This is the main route of the Application Bus. All incoming requests of the APIs are handled here - * and distributed to the specific route. - * - * - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class MainRoute extends RouteBuilder { - - final static String INVOKE_ENDPOINT = "direct:invokeOperation"; - final static String IS_FINISHED_ENDPOINT = "direct:isFinished"; - final static String GET_RESULT_ENDPOINT = "direct:getResult"; - - @Override - public void configure() throws Exception { - - // Predicates to check if a operation should be invoked, if an - // invocation has finished or if the results of an invocation should be - // returned. Checking is based on the APPLICATION_BUS_METHOD header - final Predicate INVOKE_PREDICATE = - header(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString()).isEqualTo(ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); - - final Predicate IS_FINISHED_PREDICATE = - header(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString()).isEqualTo(ApplicationBusConstants.APPLICATION_BUS_METHOD_IS_FINISHED.toString()); - - final Predicate GET_RESULT_PREDICATE = - header(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString()).isEqualTo(ApplicationBusConstants.APPLICATION_BUS_METHOD_GET_RESULT.toString()); - - from(ApplicationBusServiceImpl.ENDPOINT).choice().when(INVOKE_PREDICATE).to(INVOKE_ENDPOINT) - .when(IS_FINISHED_PREDICATE).to(IS_FINISHED_ENDPOINT) - .when(GET_RESULT_PREDICATE).to(GET_RESULT_ENDPOINT).end(); - - } - -} +package org.opentosca.bus.application.service.impl.route; + +import org.apache.camel.Predicate; +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.application.model.constants.ApplicationBusConstants; +import org.opentosca.bus.application.service.impl.ApplicationBusServiceImpl; +import org.springframework.stereotype.Component; + +/** + * MainRoute of the Application Bus.
+ *
+ *

+ * This is the main route of the Application Bus. All incoming requests of the APIs are handled here and distributed to + * the specific route. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +public class MainRoute extends RouteBuilder { + + final static String INVOKE_ENDPOINT = "direct:invokeOperation"; + final static String IS_FINISHED_ENDPOINT = "direct:isFinished"; + final static String GET_RESULT_ENDPOINT = "direct:getResult"; + + @Override + public void configure() throws Exception { + + // Predicates to check if a operation should be invoked, if an + // invocation has finished or if the results of an invocation should be + // returned. Checking is based on the APPLICATION_BUS_METHOD header + final Predicate INVOKE_PREDICATE = + header(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString()).isEqualTo(ApplicationBusConstants.APPLICATION_BUS_METHOD_INVOKE.toString()); + + final Predicate IS_FINISHED_PREDICATE = + header(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString()).isEqualTo(ApplicationBusConstants.APPLICATION_BUS_METHOD_IS_FINISHED.toString()); + + final Predicate GET_RESULT_PREDICATE = + header(ApplicationBusConstants.APPLICATION_BUS_METHOD.toString()).isEqualTo(ApplicationBusConstants.APPLICATION_BUS_METHOD_GET_RESULT.toString()); + + from(ApplicationBusServiceImpl.ENDPOINT).choice().when(INVOKE_PREDICATE).to(INVOKE_ENDPOINT) + .when(IS_FINISHED_PREDICATE).to(IS_FINISHED_ENDPOINT) + .when(GET_RESULT_PREDICATE).to(GET_RESULT_ENDPOINT).end(); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/servicehandler/ApplicationBusPluginRegistry.java b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/servicehandler/ApplicationBusPluginRegistry.java new file mode 100644 index 000000000..69cdfe122 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/java/org/opentosca/bus/application/service/impl/servicehandler/ApplicationBusPluginRegistry.java @@ -0,0 +1,48 @@ +package org.opentosca.bus.application.service.impl.servicehandler; + +import java.util.Collection; +import java.util.concurrent.ConcurrentHashMap; + +import javax.inject.Inject; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.bus.application.plugin.service.IApplicationBusPluginService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Class to bind interface {@link IApplicationBusPluginService}. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Service +@NonNullByDefault +public class ApplicationBusPluginRegistry { + + // HashMap that stores available plug-ins. The supported InvocationType is + // used as key and the corresponding routing endpoint as value. + private static ConcurrentHashMap pluginServices = new ConcurrentHashMap<>(); + + final private static Logger LOG = LoggerFactory.getLogger(ApplicationBusPluginRegistry.class); + + @Inject + public ApplicationBusPluginRegistry(@Autowired(required = false) Collection plugins) { + if (plugins != null) { + for (IApplicationBusPluginService plugin : plugins) { + final String routingEndpoint = plugin.getRoutingEndpoint(); + plugin.getSupportedInvocationTypes().forEach(invocationType -> pluginServices.put(invocationType, routingEndpoint)); + } + } + } + + /** + * @return BundleID of the matching ApplicationBusPlugin + */ + @Nullable + public String getApplicationBusPluginBundleID(final String invocationType) { + return pluginServices.get(invocationType); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.application.service/src/main/resources/spring/context-bus-application-service.xml b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/resources/spring/context-bus-application-service.xml new file mode 100644 index 000000000..67b5ec06e --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.application.service/src/main/resources/spring/context-bus-application-service.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + org.opentosca.bus.application.service.impl.route + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.java/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.api.java/pom.xml new file mode 100644 index 000000000..6f566c3a0 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.java/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.api.java + + + + org.apache.camel + camel-core + ${camel.version} + + + org.apache.camel + camel-stream + ${camel.version} + + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + 2.0.0-SNAPSHOT + compile + + + org.opentosca + org.opentosca.planbuilder.integration + 2.0.0-SNAPSHOT + compile + + + org.opentosca + org.opentosca.container.engine.plan.plugin.bpel + 2.0.0-SNAPSHOT + compile + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/ExposedManagementBusOperations.java b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/ExposedManagementBusOperations.java new file mode 100644 index 000000000..b84f6f96b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/ExposedManagementBusOperations.java @@ -0,0 +1,20 @@ +package org.opentosca.bus.management.api.java; + +/** + * This enum defines the operations which can be invoked through the Java API of the Management Bus. The enum is used by + * the route to forward the invocations to the correct receiver. + */ +public enum ExposedManagementBusOperations { + + INVOKE_PLAN("invokePlan"), INVOKE_IA("invokeIA"); + + private final String headerValue; + + private ExposedManagementBusOperations(final String headerValue) { + this.headerValue = headerValue; + } + + public String getHeaderValue() { + return this.headerValue; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/MBJavaApi.java b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/MBJavaApi.java new file mode 100644 index 000000000..7b1f73e81 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/MBJavaApi.java @@ -0,0 +1,555 @@ +package org.opentosca.bus.management.api.java; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.inject.Singleton; +import javax.xml.bind.JAXBException; +import javax.xml.namespace.QName; + +import org.apache.camel.CamelContext; +import org.apache.camel.ConsumerTemplate; +import org.apache.camel.Exchange; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.impl.DefaultExchange; +import org.glassfish.jersey.uri.UriComponent; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.engine.management.IManagementBus; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstanceState; +import org.opentosca.container.core.next.model.PlanInstanceInput; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.next.model.RelationshipTemplateInstanceState; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.repository.SituationRepository; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.container.engine.plan.plugin.bpel.BpelPlanEnginePlugin; +import org.opentosca.planbuilder.export.Exporter; +import org.opentosca.planbuilder.importer.Importer; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractPolicy; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractTopologyTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + *

+ * Exposes the ManagementBus to the container as a java bean + *

+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @author Benjamin Weder - st100495@stud.uni-stuttgart.de + * @author Kálmán Képes - kepes@iaas.uni-stuttgart.de + * @author Clemens Lieb - liebcs@fius.informatik.uni-stuttgart.de + */ +@Component +@Singleton +public class MBJavaApi implements IManagementBus { + + private static final String BPMNNS = "http://www.omg.org/spec/BPMN/20100524/MODEL"; + private static final String BPELNS = "http://docs.oasis-open.org/wsbpel/2.0/process/executable"; + + private static Logger LOG = LoggerFactory.getLogger(MBJavaApi.class); + + private final CamelContext camelContext; + private final Importer importer; + private final Exporter exporter; + private final ICoreEndpointService endpointService; + private final BpelPlanEnginePlugin bpelDeployPlugin; + + @Inject + public MBJavaApi(CamelContext camelContext, Importer importer, Exporter exporter, + ICoreEndpointService endpointService, BpelPlanEnginePlugin bpelPlanEnginePlugin) { + this.camelContext = camelContext; + this.importer = importer; + this.exporter = exporter; + this.endpointService = endpointService; + this.bpelDeployPlugin = bpelPlanEnginePlugin; + LOG.info("Starting direct Java invocation API for Management Bus"); + } + + private void invokePlan(final String operationName, final String messageID, + final Long serviceInstanceID, final QName serviceTemplateID, + final Object message, final CsarId csarId, final QName planID, + final String planLanguage) { + + // create the headers for the Exchange which is send to the Management Bus + final Map headers = new HashMap<>(); + headers.put(MBHeader.CSARID.toString(), csarId.csarName()); + headers.put(MBHeader.PLANID_QNAME.toString(), planID); + headers.put(MBHeader.OPERATIONNAME_STRING.toString(), operationName); + headers.put(MBHeader.PLANCORRELATIONID_STRING.toString(), messageID); + headers.put(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); + // FIXME considering that this is constant, we bind to the bean directly. + // Is this used downstream? + headers.put("OPERATION", ExposedManagementBusOperations.INVOKE_PLAN.getHeaderValue()); + headers.put("PlanLanguage", planLanguage); + + if (message instanceof HashMap) { + LOG.debug("Invocation body is of type HashMap."); + + if (serviceInstanceID != null) { + URI serviceInstanceURI; + try { + serviceInstanceURI = new URI(serviceInstanceID.toString()); + headers.put(MBHeader.SERVICEINSTANCEID_URI.toString(), serviceInstanceURI); + } catch (final URISyntaxException e) { + LOG.warn("Could not generate service instance URL: {}", e.getMessage(), e); + } + } else { + LOG.warn("Service instance ID is null."); + } + } else { + LOG.warn("Invocation body is of type: {}", message.getClass()); + } + + // templates to communicate with the Management Bus + final ProducerTemplate template = camelContext.createProducerTemplate(); + final ConsumerTemplate consumer = camelContext.createConsumerTemplate(); + + LOG.debug("Correlation id: {}", messageID); + LOG.debug("Sending message {}", message); + + // forward request to the Management Bus + final Exchange requestExchange = new DefaultExchange(camelContext); + requestExchange.getIn().setBody(message); + requestExchange.getIn().setHeaders(headers); + // because the JavaAPI never uses any return values from the management bus, we discard the ConsumerTemplate + template.asyncSend("direct:invoke", requestExchange); + } + + @Override + public void invokePlan(Map eventValues) { + final String planLanguage = (String) eventValues.get("PLANLANGUAGE"); + if (!planLanguage.startsWith(BPMNNS) && !planLanguage.startsWith(BPELNS)) { + LOG.warn("Unsupported plan language: {}", planLanguage); + return; + } + LOG.debug("Plan invocation with plan language: {}", planLanguage); + + final CsarId csarID = (CsarId) eventValues.get("CSARID"); + final QName planID = (QName) eventValues.get("PLANID"); + final String operationName = (String) eventValues.get("OPERATIONNAME"); + final String messageID = (String) eventValues.get("MESSAGEID"); + + // Optional parameter if message is of type HashMap. Not needed for Document. + final Long serviceInstanceID = (Long) eventValues.get("SERVICEINSTANCEID"); + // TODO the QName retrieval here might be incorrect + final QName serviceTemplateID = (QName) eventValues.get("SERVICETEMPLATEID"); + + // Should be of type Document or HashMap. Maybe better handle them + // with different topics. + // final Object message = eventValues.get("BODY"); + @SuppressWarnings("unchecked") + Map inputParameter = (Map) eventValues.get("INPUTS"); + if (inputParameter == null) { + inputParameter = new HashMap<>(); + } + + final Map message = createRequestBody(csarID, serviceTemplateID.toString(), serviceInstanceID, inputParameter, messageID); + + // there is no necessity to set up response handling for the invocation, + // because the ManagementBus does the updating of outputs for us through the PlanInstanceHandler + invokePlan(operationName, messageID, serviceInstanceID, + serviceTemplateID, message, csarID, planID, planLanguage); + } + + @Override + public void invokeIA(Map eventValues) { + // TODO when needed. + // Adapt 'MBJavaApi - component.xml' to receive messages from this topic too... + } + + @Override + public void situationAdaption(Map eventValues) { + LOG.debug("Received SituationAware Adapation Event"); + final ServiceTemplateInstance instance = (ServiceTemplateInstance) eventValues.get("SERVICEINSTANCE"); + + @SuppressWarnings("unchecked") final Map> nodeIds2situationIds = (Map>) eventValues.get("NODE2SITUATIONS"); + + final AbstractTopologyTemplate topology = + importer.getMainDefinitions(instance.getCsarId().toOldCsarId()).getServiceTemplates().get(0).getTopologyTemplate(); + + final ServiceTemplateInstanceConfiguration currentConfig = + getCurrentServiceTemplateInstanceConfiguration(topology, instance); + final ServiceTemplateInstanceConfiguration targetConfig = + getValidServiceTemplateInstanceConfiguration(topology, nodeIds2situationIds); + + final Collection currentConfigNodeIds = + currentConfig.nodeTemplates.stream().map(x -> x.getId()).collect(Collectors.toList()); + final Collection currentConfigRelationIds = + currentConfig.relationshipTemplates.stream().map(x -> x.getId()).collect(Collectors.toList()); + + final Collection targetConfigNodeIds = + targetConfig.nodeTemplates.stream().map(x -> x.getId()).collect(Collectors.toList()); + final Collection targetConfigRelationIds = + targetConfig.relationshipTemplates.stream().map(x -> x.getId()).collect(Collectors.toList()); + + if (currentConfigNodeIds.equals(targetConfigNodeIds) + & currentConfigRelationIds.equals(targetConfigRelationIds)) { + LOG.debug("Current configuration is equal to target configuration, no adaptation is needed"); + return; + } + + final WSDLEndpoint endpoint = getAdaptationPlanEndpoint(currentConfigNodeIds, currentConfigRelationIds, + targetConfigNodeIds, targetConfigRelationIds); + final String correlationID = String.valueOf(System.currentTimeMillis()); + QName planId = null; + PlanType planType = null; + Map inputs = null; + + if (endpoint != null) { + planId = endpoint.getPlanId(); + planType = PlanType.fromString(endpoint.getMetadata().get("PLANTYPE")); + + inputs = new HashMap<>(); + + for (final String input : this.toStringCollection(endpoint.getMetadata().get("INPUTS"), ",")) { + inputs.put(input, null); + } + } else { + try { + // FIXME the QName conversion of the instance is probably a bad idea + final BPELPlan adaptationPlan = + (BPELPlan) importer.generateAdaptationPlan(instance.getCsarId().toOldCsarId(), QName.valueOf(instance.getTemplateId()), + currentConfigNodeIds, currentConfigRelationIds, + targetConfigNodeIds, targetConfigRelationIds); + + planType = PlanType.fromString(adaptationPlan.getType().toString()); + inputs = this.createInput(adaptationPlan); + final Path tempFile = Files.createTempFile(adaptationPlan.getId(), ".zip"); + exporter.exportToPlanFile(tempFile.toUri(), adaptationPlan); + + final Map endpointMetadata = + toEndpointMetadata(currentConfigNodeIds, currentConfigRelationIds, targetConfigNodeIds, + targetConfigRelationIds); + + endpointMetadata.put("PLANTYPE", planType.toString()); + endpointMetadata.put("INPUTS", toCSV(inputs.keySet())); + + planId = new QName(tempFile.getFileName().toString()); + bpelDeployPlugin.deployPlanFile(tempFile, instance.getCsarId(), planId, endpointMetadata); + } catch (final SystemException e) { + LOG.error("Internal error", e); + return; + } catch (final IOException e) { + LOG.error("Couldn't read files", e); + return; + } catch (final JAXBException e) { + LOG.error("Couldn't parse files", e); + return; + } + } + + final Map requestBody = createRequestBody(instance.getCsarId(), instance.getTemplateId(), + instance.getId(), inputs, correlationID); + + // FIXME QName natural key replacement leftover! + invokePlan("adapt", correlationID, instance.getId(), QName.valueOf(instance.getTemplateId()), + requestBody, instance.getCsarId(), planId, BPELNS); + } + + private WSDLEndpoint getAdaptationPlanEndpoint(final Collection sourceNodeIDs, + final Collection sourceRelationIDs, + final Collection targetNodeIDs, + final Collection targetRelationIDs) { + for (final WSDLEndpoint endpoint : endpointService.getWSDLEndpoints()) { + final Collection sourceNodesMetadata = + toStringCollection(endpoint.getMetadata().get("SOURCENODES"), ","); + final Collection sourceRelationsMetadata = + toStringCollection(endpoint.getMetadata().get("SOURCERELATIONS"), ","); + final Collection targetNodesMetadata = + toStringCollection(endpoint.getMetadata().get("TARGETNODES"), ","); + final Collection targetRelationsMetadata = + toStringCollection(endpoint.getMetadata().get("TARGETRELATIONS"), ","); + + if (sourceNodeIDs.equals(sourceNodesMetadata) && sourceRelationIDs.equals(sourceRelationsMetadata) + && targetNodeIDs.equals(targetNodesMetadata) && targetRelationIDs.equals(targetRelationsMetadata)) { + return endpoint; + } + } + + return null; + } + + private Map toEndpointMetadata(final Collection sourceNodeIDs, + final Collection sourceRelationIDs, + final Collection targetNodeIDs, + final Collection targetRelationIDs) { + final Map result = new HashMap<>(); + + result.put("SOURCENODES", toCSV(sourceNodeIDs)); + result.put("SOURCERELATIONS", toCSV(sourceRelationIDs)); + result.put("TARGETNODES", toCSV(targetNodeIDs)); + result.put("TARGETRELATIONS", toCSV(targetRelationIDs)); + + return result; + } + + private Collection toStringCollection(final String data, final String separator) { + Collection result = new ArrayList<>(); + + if (data == null || data.isEmpty()) { + return result; + } + + final String[] split = data.split(separator); + + for (final String part : split) { + if (part != null && !part.equals("") && !part.isEmpty()) { + result.add(part); + } + } + + return result; + } + + private String toCSV(final Collection strings) { + return strings.stream().collect(Collectors.joining(",")); + } + + private Set toPlanInstanceInputs(final Map inputs) { + final Set result = new HashSet<>(); + inputs.forEach((key, value) -> result.add(new PlanInstanceInput(key, value, "string"))); + return result; + } + + private Map createInput(final BPELPlan plan) { + final Collection inputs = plan.getWsdl().getInputMessageLocalNames(); + + final Map result = new HashMap<>(); + + for (final String input : inputs) { + result.put(input, null); + } + + return result; + } + + private ServiceTemplateInstanceConfiguration getCurrentServiceTemplateInstanceConfiguration(final AbstractTopologyTemplate topology, + final ServiceTemplateInstance instance) { + + final Collection currentlyRunningNodes = new HashSet<>(); + final Collection currentlyRunningRelations = new HashSet<>(); + + final Collection validNodeState = new HashSet<>(); + validNodeState.add(NodeTemplateInstanceState.STARTED); + validNodeState.add(NodeTemplateInstanceState.CREATED); + validNodeState.add(NodeTemplateInstanceState.CONFIGURED); + + final Collection validRelationState = new HashSet<>(); + validRelationState.add(RelationshipTemplateInstanceState.CREATED); + + for (final AbstractNodeTemplate node : topology.getNodeTemplates()) { + for (final NodeTemplateInstance inst : instance.getNodeTemplateInstances()) { + if (inst.getTemplateId().equals(node.getId()) + && validNodeState.contains(inst.getState())) { + currentlyRunningNodes.add(node); + } + } + } + + for (final AbstractRelationshipTemplate relation : topology.getRelationshipTemplates()) { + for (final RelationshipTemplateInstance inst : instance.getRelationshipTemplateInstances()) { + if (inst.getTemplateId().equals(relation.getId()) && validRelationState.contains(inst.getState())) { + currentlyRunningRelations.add(relation); + } + } + } + + return new ServiceTemplateInstanceConfiguration(currentlyRunningNodes, currentlyRunningRelations); + } + + private ServiceTemplateInstanceConfiguration getValidServiceTemplateInstanceConfiguration(final AbstractTopologyTemplate topology, + final Map> nodeIds2situationIds) { + + final Collection validNodes = new ArrayList<>(); + final Collection validRelations = new ArrayList<>(); + + for (final AbstractNodeTemplate nodeTemplate : topology.getNodeTemplates()) { + final Collection policies = getPolicies(Types.situationPolicyType, nodeTemplate); + if (policies.isEmpty()) { + validNodes.add(nodeTemplate); + } else if (isValidUnderSituations(nodeTemplate, nodeIds2situationIds)) { + validNodes.add(nodeTemplate); + } + } + + // check if node set is deployable + final Collection deployableAndValidNodeSet = + getDeployableSubgraph(validNodes, nodeIds2situationIds); + for (final AbstractRelationshipTemplate relations : topology.getRelationshipTemplates()) { + if (deployableAndValidNodeSet.contains(relations.getSource()) + & deployableAndValidNodeSet.contains(relations.getTarget())) { + validRelations.add(relations); + } + } + + return new ServiceTemplateInstanceConfiguration(deployableAndValidNodeSet, validRelations); + } + + private Collection getDeployableSubgraph(final Collection nodeTemplates, + final Map> nodeIds2situationIds) { + final Set validDeploymentSubgraph = new HashSet<>(nodeTemplates); + final Collection toRemove = new HashSet<>(); + + for (final AbstractNodeTemplate nodeTemplate : nodeTemplates) { + final Collection hostingRelations = getOutgoingHostedOnRelations(nodeTemplate); + if (!hostingRelations.isEmpty()) { + // if we have hostedOn relations check if it is valid under the situation and is in the set + boolean foundValidHost = false; + for (final AbstractRelationshipTemplate relationshipTemplate : hostingRelations) { + final AbstractNodeTemplate hostingNode = relationshipTemplate.getTarget(); + if (this.isValidUnderSituations(hostingNode, nodeIds2situationIds) + && nodeTemplates.contains(hostingNode)) { + foundValidHost = true; + break; + } + } + if (!foundValidHost) { + toRemove.add(nodeTemplate); + } + } + } + + if (toRemove.isEmpty()) { + return validDeploymentSubgraph; + } else { + validDeploymentSubgraph.removeAll(toRemove); + return getDeployableSubgraph(validDeploymentSubgraph, nodeIds2situationIds); + } + } + + private boolean isValidUnderSituations(final AbstractNodeTemplate nodeTemplate, + final Map> nodeIds2situationIds) { + // check if the situation of the policy is active + Collection situationIds = null; + + if ((situationIds = nodeIds2situationIds.get(nodeTemplate.getId())) == null) { + return true; + } + + boolean isValid = true; + for (final Long sitId : situationIds) { + isValid &= isSituationActive(sitId); + } + return isValid; + } + + private Collection getOutgoingHostedOnRelations(final AbstractNodeTemplate nodeTemplate) { + return nodeTemplate.getOutgoingRelations().stream().filter(x -> x.getType().equals(Types.hostedOnRelationType)) + .collect(Collectors.toList()); + } + + private Collection getPolicies(final QName policyType, final AbstractNodeTemplate nodeTemplate) { + return nodeTemplate.getPolicies().stream().filter(x -> x.getType().getId().equals(policyType)).collect(Collectors.toList()); + } + + private boolean isSituationActive(final Long situationId) { + return getSituationRepository().find(situationId).get().isActive(); + } + + private SituationRepository getSituationRepository() { + return new SituationRepository(); + } + + private Map createRequestBody(final CsarId csarID, final String serviceTemplateID, + final Long serviceTemplateInstanceId, + final Map inputParameter, final String correlationID) { + + final Map map = new HashMap<>(); + + LOG.trace("Processing a list of {} parameters", inputParameter.size()); + for (final String para : inputParameter.keySet()) { + final String value = inputParameter.get(para); + LOG.trace("Put in the parameter {} with value \"{}\".", para, value); + if (para.equalsIgnoreCase("CorrelationID")) { + LOG.debug("Found Correlation Element! Put in CorrelationID \"" + correlationID + "\"."); + map.put(para, correlationID); + } else if (para.equalsIgnoreCase("csarID")) { + LOG.debug("Found csarID Element! Put in csarID \"" + csarID + "\"."); + map.put(para, csarID.toString()); + } else if (para.equalsIgnoreCase("serviceTemplateID")) { + LOG.debug("Found serviceTemplateID Element! Put in serviceTemplateID \"" + serviceTemplateID + "\"."); + map.put(para, serviceTemplateID.toString()); + } else if (para.equalsIgnoreCase("OpenTOSCAContainerAPIServiceInstanceURL") + & serviceTemplateInstanceId != null) { + final String serviceTemplateInstanceUrl = createServiceInstanceURI(csarID, serviceTemplateID, serviceTemplateInstanceId); + map.put(para, serviceTemplateInstanceUrl); + } else if (para.equalsIgnoreCase("containerApiAddress")) { + LOG.debug("Found containerApiAddress Element! Put in containerApiAddress \"" + + Settings.CONTAINER_API_LEGACY + "\"."); + map.put(para, Settings.CONTAINER_API_LEGACY); + } else if (para.equalsIgnoreCase("instanceDataAPIUrl")) { + LOG.debug("Found instanceDataAPIUrl Element! Put in instanceDataAPIUrl \"" + + Settings.CONTAINER_INSTANCEDATA_API + "\"."); + String str = Settings.CONTAINER_INSTANCEDATA_API; + str = str.replace("{csarid}", csarID.csarName()); + try { + str = str.replace("{servicetemplateid}", + URLEncoder.encode(URLEncoder.encode(serviceTemplateID.toString(), "UTF-8"), + "UTF-8")); + } catch (UnsupportedEncodingException e) { + LOG.error("Couldn't encode Service Template URL", e); + } + LOG.debug("instance api: {}", str); + map.put(para, str); + } else if (para.equalsIgnoreCase("csarEntrypoint")) { + LOG.debug("Found csarEntrypoint Element! Put in instanceDataAPIUrl \"" + Settings.CONTAINER_API_LEGACY + + "/" + csarID + "\"."); + map.put(para, Settings.CONTAINER_API_LEGACY + "/CSARs/" + csarID); + } else { + map.put(para, value); + } + } + + return map; + } + + private String createServiceInstanceURI(final CsarId csarId, final String serviceTemplate, + final Long serviceTemplateInstanceId) { + String url = Settings.CONTAINER_INSTANCEDATA_API + "/" + serviceTemplateInstanceId; + url = url.replace("{csarid}", csarId.csarName()); + url = url.replace("{servicetemplateid}", + UriComponent.encode(UriComponent.encode(serviceTemplate, + UriComponent.Type.PATH_SEGMENT), + UriComponent.Type.PATH_SEGMENT)); + + return url; + } + + private static class ServiceTemplateInstanceConfiguration { + Collection nodeTemplates; + Collection relationshipTemplates; + + public ServiceTemplateInstanceConfiguration(final Collection nodes, + final Collection relations) { + this.nodeTemplates = nodes; + this.relationshipTemplates = relations; + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/package-info.java new file mode 100644 index 000000000..bc6266651 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the Management Bus Java API implementation exposed to external consumers.

+ * Copyright 2012 IAAS University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.api.java; diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/route/Route.java b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/route/Route.java new file mode 100644 index 000000000..d8c8e8a55 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/route/Route.java @@ -0,0 +1,50 @@ +package org.opentosca.bus.management.api.java.route; + +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.management.api.java.ExposedManagementBusOperations; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.service.IManagementBusService; + +/** + * Route of the Management Bus Java API.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * Incoming events are given here from the EventHandler to be routed to the Management Bus for further processing. The + * response message is given back to the EventHandler. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public class Route extends RouteBuilder { + + private final IManagementBusService managementBusService; + + public Route(IManagementBusService managementBusService) { + this.managementBusService = managementBusService; + } + + @Override + public void configure() throws Exception { + this.from("direct:invoke").to("stream:out").process(exchange -> { + final String messageID = + exchange.getIn().getHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), String.class); + if (messageID != null) { + exchange.getIn().setMessageId(messageID); + exchange.getIn().setHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), false); + } else { + exchange.getIn().setHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), true); + } + }).to("stream:out") + .choice() + .when(header("OPERATION").isEqualTo(ExposedManagementBusOperations.INVOKE_IA.getHeaderValue())) + .to("direct:invokeIA") + .when(header("OPERATION").isEqualTo(ExposedManagementBusOperations.INVOKE_PLAN.getHeaderValue())) + .to("direct:invokePlan") + .end(); + + this.from("direct:invokeIA").to("stream:out").bean(managementBusService, "invokeIA").end(); + this.from("direct:invokePlan").to("stream:out").bean(managementBusService, "invokePlan").end(); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/route/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/route/package-info.java new file mode 100644 index 000000000..e87af0907 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/java/org/opentosca/bus/management/api/java/route/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the camel routes of the Management Bus-OSGI/EVENT-API.

Copyright 2012 IAAS + * University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.api.java.route; diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/resources/spring/context-bus-management-api.xml b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/resources/spring/context-bus-management-api.xml new file mode 100644 index 000000000..b47ed4e1e --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.java/src/main/resources/spring/context-bus-management-api.xml @@ -0,0 +1,26 @@ + + + Register the beans providing the Management Bus Java API + + + + + + org.opentosca.bus.management.api.java.route + + + + + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/pom.xml new file mode 100644 index 000000000..3b026a988 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.api.resthttp + + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + org.apache.camel + camel-core + 2.18.3 + + + org.apache.camel + camel-restlet + 2.18.3 + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/QueueMap.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/QueueMap.java new file mode 100644 index 000000000..c5438ad73 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/QueueMap.java @@ -0,0 +1,82 @@ +package org.opentosca.bus.management.api.resthttp.model; + +import java.util.concurrent.ConcurrentHashMap; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Map that manages the status of the requests. RequestID is used as key of the map. The + * value of the map indicates if the invocation has finished or not. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +public class QueueMap { + + final private static Logger LOG = LoggerFactory.getLogger(QueueMap.class); + + private static ConcurrentHashMap queue = new ConcurrentHashMap<>(); + + /** + * Inserts an entry into the queue (if not already existing) and set it to finished. + * + * @param id of the request + */ + public static void finished(final String id) { + + QueueMap.LOG.debug("Request with ID: {} has finished.", id); + + queue.put(id, true); + } + + /** + * Inserts an entry into the queue and set it to notFinished. Only if the id not already exists. + * + * @param id of the request + */ + public static void notFinished(final String id) { + + QueueMap.LOG.debug("Request with ID: {} hasn't finished yet.", id); + + queue.putIfAbsent(id, false); + } + + /** + * Inserts an entry into the queue. + * + * @param id of the request + * @param isFinished specifies if the invocation has finished or not + */ + public static void put(final String id, final Boolean isFinished) { + + QueueMap.LOG.debug("RequestID: {}, isFinished: {}", id, isFinished); + + queue.put(id, isFinished); + } + + /** + * @param id of the request + * @return true if the invocation has finished. Otherwise false + */ + public static boolean hasFinished(final String id) { + + return queue.get(id); + } + + /** + * @param id of the request + * @return true if the queue contains the specified requestID. Otherwise false + */ + public static boolean containsID(final String id) { + return queue.containsKey(id); + } + + /** + * Removes the entry with the specified requestID from the queue. + * + * @param id of the request + */ + public static void remove(final String id) { + queue.remove(id); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/RequestID.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/RequestID.java new file mode 100644 index 000000000..b9ac2fec2 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/RequestID.java @@ -0,0 +1,32 @@ +package org.opentosca.bus.management.api.resthttp.model; + +import java.util.concurrent.atomic.AtomicLong; + +/** + * Manages the requestIDs needed to correlate the invocation-requests, the isFinished-requests as well as the + * getResult-requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +public class RequestID { + + private static AtomicLong incrementer = new AtomicLong(0); + + /** + * @return requestID + */ + public synchronized static String getNextID() { + + final Long id = incrementer.getAndIncrement(); + + // Prototype: + // For the unlikely case, that MAX_Value is reached, begin with 0 + // again. Assumption: old requests were processed in the + // mean time. + if (id == Long.MAX_VALUE) { + incrementer.set(0); + } + + return Long.toString(id); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/ResultMap.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/ResultMap.java new file mode 100644 index 000000000..486d37ef9 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/model/ResultMap.java @@ -0,0 +1,49 @@ +package org.opentosca.bus.management.api.resthttp.model; + +import java.util.HashMap; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Map that manages the invocation results. RequestID is used as key of the map. The + * value of the map is the result of the invocation. Or null if the invocation + * failed. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +public class ResultMap { + + private static ConcurrentHashMap> invocations = new ConcurrentHashMap<>(); + + /** + * @param id of the request + * @param result of the invocation. + */ + public static void put(final String id, final HashMap result) { + invocations.put(id, result); + } + + /** + * @return result of the invocation. Void if the invoked method was of return type + * void. null if the invocation failed. + */ + public static HashMap get(final String id) { + return invocations.get(id); + } + + /** + * @param id of the request + * @return true if the map contains the specified requestID. Otherwise false + */ + public static boolean containsID(final String id) { + return invocations.containsKey(id); + } + + /** + * Removes the entry with the specified requestID from the map. + * + * @param id of the request + */ + public static void remove(final String id) { + invocations.remove(id); + } +} diff --git a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/CORSProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/CORSProcessor.java similarity index 85% rename from org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/CORSProcessor.java rename to org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/CORSProcessor.java index 645862680..5c179b903 100644 --- a/org.opentosca.bus.management.api.resthttp/src/org/opentosca/bus/management/api/resthttp/processor/CORSProcessor.java +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/CORSProcessor.java @@ -7,16 +7,16 @@ import org.restlet.data.Form; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; /** * CORSProcessor of the Management Bus to add required cors headers.
*
* - * * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de - * */ @Deprecated +@Component public class CORSProcessor implements Processor { final private static Logger LOG = LoggerFactory.getLogger(CORSProcessor.class); @@ -37,11 +37,9 @@ public void process(final Exchange exchange) throws Exception { headers.add("Access-Control-Allow-Methods", "POST, GET, DELETE, OPTIONS"); headers.add("Access-Control-Allow-Headers", - "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"); + "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"); headers.add("Access-Control-Allow-Origin", "*"); headers.add("Access-Control-Expose-Headers", "Location, Content-Type, Expires, Last-Modified"); - } } - } diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/ExceptionProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/ExceptionProcessor.java new file mode 100644 index 000000000..6406f8316 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/ExceptionProcessor.java @@ -0,0 +1,51 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.parser.ParseException; +import org.restlet.Response; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * ExceptionProcessor of the Management Bus REST-API.
+ *
+ *

+ * This processor handles the exceptions and sends a reasonable response back to the caller. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +public class ExceptionProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(ExceptionProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + ExceptionProcessor.LOG.debug("Exception handling..."); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof ParseException) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + final String body = exchange.getIn().getBody(String.class); + response.setEntity("JSON is not valid: " + body, MediaType.TEXT_ALL); + ExceptionProcessor.LOG.warn("JSON is not valid: {}", body); + } else if (exchange.getIn().getBody() instanceof NullPointerException) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + response.setEntity("Needed information not specified.", MediaType.TEXT_ALL); + ExceptionProcessor.LOG.warn("Needed information not specified."); + } else if (exchange.getIn().getBody() instanceof Exception) { + response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST); + response.setEntity("Invocation failed! " + exchange.getIn().getBody().toString(), MediaType.TEXT_ALL); + ExceptionProcessor.LOG.warn("Invocation failed! " + exchange.getIn().getBody().toString()); + } + + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultProcessor.java new file mode 100644 index 000000000..811cc8232 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultProcessor.java @@ -0,0 +1,55 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import java.util.HashMap; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.management.api.resthttp.model.QueueMap; +import org.opentosca.bus.management.api.resthttp.model.ResultMap; +import org.opentosca.bus.management.api.resthttp.route.DeleteRoute; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * GetResultProcessor of the Management Bus.
+ *
+ *

+ * This processor handles "getResult" requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class GetResultProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(GetResultProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + final String requestID = exchange.getIn().getBody(String.class); + + GetResultProcessor.LOG.debug("getResult request received. RequestID: {}", requestID); + + if (ResultMap.containsID(requestID)) { + + GetResultProcessor.LOG.debug("Getting result."); + + final HashMap result = ResultMap.get(requestID); + + if (DeleteRoute.AUTO_DELETE) { + // "Garbage collection": Remove polled responses. + ResultMap.remove(requestID); + QueueMap.remove(requestID); + } + + exchange.getIn().setBody(result); + } else if (!QueueMap.containsID(requestID)) { + GetResultProcessor.LOG.warn("Unknown RequestID: {}", requestID); + exchange.getIn().setBody(new Exception("Unknown RequestID: " + requestID)); + } else { + GetResultProcessor.LOG.warn("Error while invoking specified method."); + exchange.getIn().setBody(new Exception("Error while invoking specified method.")); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultRequestProcessor.java new file mode 100644 index 000000000..b0e69be51 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultRequestProcessor.java @@ -0,0 +1,34 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * GetResultRequestProcessor of the Management Bus REST-API.
+ *
+ *

+ * This processor handles "getResult" requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class GetResultRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(GetResultRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + GetResultRequestProcessor.LOG.debug("Processing GetResult request...."); + + final Integer requestID = exchange.getIn().getHeader(InvocationRoute.ID, Integer.class); + + GetResultRequestProcessor.LOG.debug("RequestID: {}", requestID); + + exchange.getIn().setBody(requestID); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultResponseProcessor.java new file mode 100644 index 000000000..fd057c9bd --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/GetResultResponseProcessor.java @@ -0,0 +1,59 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import java.util.HashMap; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.JSONObject; +import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; +import org.restlet.Response; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * GetResultResponseProcessor of the Management Bus REST-API.
+ *
+ *

+ * This processor handles the responses of "getResult" requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class GetResultResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(GetResultResponseProcessor.class); + + @SuppressWarnings("unchecked") + @Override + public void process(final Exchange exchange) throws Exception { + + GetResultResponseProcessor.LOG.debug("Processing GetResult response...."); + + final String requestID = exchange.getIn().getHeader(InvocationRoute.ID, String.class); + + GetResultResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof Exception) { + + response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else { + + final HashMap responseMap = exchange.getIn().getBody(HashMap.class); + + final JSONObject obj = new JSONObject(); + obj.put("response", responseMap); + + response.setStatus(Status.SUCCESS_OK); + response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); + } + + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/InvocationRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/InvocationRequestProcessor.java new file mode 100644 index 000000000..e49242e1e --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/InvocationRequestProcessor.java @@ -0,0 +1,152 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import java.net.URI; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import javax.xml.namespace.QName; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.json.simple.parser.ContainerFactory; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.container.core.model.csar.CsarId; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * InvocationRequestProcessor of the Management Bus REST-API.
+ *
+ *

+ * This processor handles "invokeOperation" requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class InvocationRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(InvocationRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + LOG.debug("Processing Invocation request..."); + + final String bodyString = exchange.getIn().getBody(String.class); + final LinkedHashMap> requestMap = this.requestToMap(bodyString); + final LinkedHashMap infosMap = requestMap.get("invocation-information"); + + if (infosMap == null) { + LOG.warn("Needed information not specified."); + throw new Exception("Needed information not specified."); + } + checkRequiredKeys(infosMap, "csarID", "serviceTemplateID", "interface", "operation"); + String nodeTemplateID = null; + String relationshipTemplateID = null; + if (infosMap.containsKey("nodeTemplateID")) { + nodeTemplateID = infosMap.get("nodeTemplateID"); + LOG.debug("nodeTemplateID: {}", nodeTemplateID); + exchange.getIn().setHeader(MBHeader.NODETEMPLATEID_STRING.toString(), nodeTemplateID); + } + if (infosMap.containsKey("relationshipTemplateID")) { + relationshipTemplateID = infosMap.get("relationshipTemplateID"); + LOG.debug("relationshipTemplateID: {}", relationshipTemplateID); + exchange.getIn().setHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), relationshipTemplateID); + } + + if (nodeTemplateID == null && relationshipTemplateID == null) { + LOG.debug("Can't process request: Eighter nodeTemplateID or relationshipTemplateID is required!"); + throw new Exception( + "Can't process request: Eighter nodeTemplateID or relationshipTemplateID is required!"); + } + + final String csarID = infosMap.get("csarID"); + LOG.debug("csarID: {}", csarID); + exchange.getIn().setHeader(MBHeader.CSARID.toString(), new CsarId(csarID)); + + final QName serviceTemplateID = QName.valueOf(infosMap.get("serviceTemplateID")); + LOG.debug("serviceTemplateID: {}", serviceTemplateID); + exchange.getIn().setHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); + + final String interfaceName = infosMap.get("interface"); + LOG.debug("interface: {}", interfaceName); + exchange.getIn().setHeader(MBHeader.INTERFACENAME_STRING.toString(), interfaceName); + + if (infosMap.containsKey("serviceInstanceID")) { + final String serviceInstanceID = infosMap.get("serviceInstanceID"); + LOG.debug("serviceInstanceID: {}", serviceInstanceID); + if (serviceInstanceID != null) { + final URI serviceInstanceURI = new URI(serviceInstanceID); + exchange.getIn().setHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), serviceInstanceURI); + } + } + + if (infosMap.containsKey("nodeInstanceID")) { + final String nodeInstanceID = infosMap.get("nodeInstanceID"); + LOG.debug("nodeInstanceID: {}", nodeInstanceID); + exchange.getIn().setHeader(MBHeader.NODEINSTANCEID_STRING.toString(), nodeInstanceID); + } + + final String operationName = infosMap.get("operation"); + LOG.debug("operationName: {}", operationName); + exchange.getIn().setHeader(MBHeader.OPERATIONNAME_STRING.toString(), operationName); + + final HashMap paramsMap = requestMap.get("params"); + if (paramsMap != null) { + exchange.getIn().setBody(paramsMap); + LOG.debug("Params: {}", paramsMap); + } else { + LOG.debug("No parameter specified."); + } + + exchange.getIn().setHeader(MBHeader.APIID_STRING.toString(), "org.opentosca.bus.management.api.resthttp"); + } + + private void checkRequiredKeys(Map parameters, String... keys) { + Set missing = Arrays.stream(keys) + .filter(((Predicate) parameters::containsKey).negate()) + .collect(Collectors.toSet()); + if (!missing.isEmpty()) { + final String pretty = missing.stream().collect(Collectors.joining(", ")); + LOG.warn("Can not process request due to missing information. Missing key(s): {}", pretty); + throw new RuntimeException(String.format("\"Can not process request due to missing information. Missing key(s): %s", pretty)); + } + } + + /** + * Parses and maps a json String to a {@literal LinkedHashMap>}. + * + * @return LinkedHashMap + */ + @SuppressWarnings("unchecked") + private LinkedHashMap> requestToMap(final String body) throws ParseException { + + final ContainerFactory orderedKeyFactory = new ContainerFactory() { + + @Override + public Map> createObjectContainer() { + return new LinkedHashMap<>(); + } + + @Override + public List creatArrayContainer() { + // TODO Auto-generated method stub + return null; + } + }; + + final JSONParser parser = new JSONParser(); + + final Object obj = parser.parse(body, orderedKeyFactory); + + return (LinkedHashMap>) obj; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/InvocationResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/InvocationResponseProcessor.java new file mode 100644 index 000000000..4f23499ec --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/InvocationResponseProcessor.java @@ -0,0 +1,41 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; +import org.restlet.Response; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * InvocationResponseProcessor of the Management Bus REST-API.
+ *
+ *

+ * This processor handles the responses of "invokeOperation" requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class InvocationResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(InvocationResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + InvocationResponseProcessor.LOG.debug("Processing Invocation response...."); + + final String requestID = exchange.getIn().getBody(String.class); + + InvocationResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + response.setStatus(Status.SUCCESS_ACCEPTED); + response.setLocationRef(InvocationRoute.POLL_ENDPOINT.replace(InvocationRoute.ID_PLACEHODLER, requestID)); + + exchange.getOut().setBody(response); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedProcessor.java new file mode 100644 index 000000000..94bcfe418 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedProcessor.java @@ -0,0 +1,45 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.management.api.resthttp.model.QueueMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * IsFinishedProcessor of the Management Bus REST-API.
+ *
+ *

+ * This processor handles "isFinished" requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class IsFinishedProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(IsFinishedProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + final String requestID = exchange.getIn().getBody(String.class); + + IsFinishedProcessor.LOG.debug("Queue polling for RequestID: {}", requestID); + + if (QueueMap.containsID(requestID)) { + IsFinishedProcessor.LOG.debug("RequestID is known."); + + if (QueueMap.hasFinished(requestID)) { + IsFinishedProcessor.LOG.debug("Invocation has finished."); + exchange.getIn().setBody(true); + } else { + IsFinishedProcessor.LOG.debug("Invocation has not finished yet."); + exchange.getIn().setBody(false); + } + } else { + IsFinishedProcessor.LOG.warn("Unknown RequestID: {}", requestID); + exchange.getIn().setBody(new Exception("Unknown RequestID: " + requestID)); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedRequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedRequestProcessor.java new file mode 100644 index 000000000..8b7e5bbb3 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedRequestProcessor.java @@ -0,0 +1,34 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * IsFinishedRequestProcessor of the Management Bus REST-API.
+ *
+ *

+ * This processor handles "isFinished" requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class IsFinishedRequestProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(IsFinishedRequestProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + + IsFinishedRequestProcessor.LOG.debug("Processing IsFinished request...."); + + final Integer requestID = exchange.getIn().getHeader(InvocationRoute.ID, Integer.class); + + IsFinishedRequestProcessor.LOG.debug("RequestID: {}", requestID); + + exchange.getIn().setBody(requestID); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedResponseProcessor.java new file mode 100644 index 000000000..ddbe053d8 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/processor/IsFinishedResponseProcessor.java @@ -0,0 +1,66 @@ +package org.opentosca.bus.management.api.resthttp.processor; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.restlet.RestletConstants; +import org.json.simple.JSONObject; +import org.opentosca.bus.management.api.resthttp.route.InvocationRoute; +import org.restlet.Response; +import org.restlet.data.MediaType; +import org.restlet.data.Status; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * IsFinishedResponseProcessor of the Management Bus REST-API.
+ *
+ *

+ * This processor handles the responses of "isFinished" requests. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class IsFinishedResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(IsFinishedResponseProcessor.class); + + @SuppressWarnings("unchecked") + @Override + public void process(final Exchange exchange) throws Exception { + + IsFinishedResponseProcessor.LOG.debug("Processing IsFinished response...."); + + final String requestID = exchange.getIn().getHeader(InvocationRoute.ID, String.class); + + IsFinishedResponseProcessor.LOG.debug("RequestID: {}", requestID); + + final Response response = exchange.getIn().getHeader(RestletConstants.RESTLET_RESPONSE, Response.class); + + if (exchange.getIn().getBody() instanceof Exception) { + + response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); + response.setEntity(exchange.getIn().getBody(String.class), MediaType.TEXT_ALL); + } else { + + final Boolean isFinished = exchange.getIn().getBody(Boolean.class); + + if (isFinished) { + IsFinishedResponseProcessor.LOG.debug("Invocation has finished, send location of result."); + + response.setStatus(Status.REDIRECTION_SEE_OTHER); + response.setLocationRef(InvocationRoute.GET_RESULT_ENDPOINT.replace(InvocationRoute.ID_PLACEHODLER, + requestID)); + } else { + IsFinishedResponseProcessor.LOG.debug("Invocation has not finished yet."); + + final JSONObject obj = new JSONObject(); + obj.put("status", "PENDING"); + + response.setStatus(Status.SUCCESS_OK); + response.setEntity(obj.toJSONString(), MediaType.APPLICATION_JSON); + } + exchange.getOut().setBody(response); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/DeleteRoute.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/DeleteRoute.java new file mode 100644 index 000000000..f936e629c --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/DeleteRoute.java @@ -0,0 +1,31 @@ +package org.opentosca.bus.management.api.resthttp.route; + +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.management.api.resthttp.model.QueueMap; +import org.opentosca.bus.management.api.resthttp.model.ResultMap; +import org.springframework.stereotype.Component; + +/** + * InvocationRoute of the Management Bus REST-API.
+ *
+ *

+ * The "getResult" endpoint of the REST-API is created here. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class DeleteRoute extends RouteBuilder { + + // true => invocation results will be deleted automatically after fetching + // the result + // false => invocation result needs to be deleted manually + public static final boolean AUTO_DELETE = false; + + @Override + public void configure() throws Exception { + from("restlet:" + InvocationRoute.BASE_ENDPOINT + InvocationRoute.GET_RESULT_ENDPOINT + + "?restletMethod=delete").bean(QueueMap.class, "remove(${header." + InvocationRoute.ID + "})") + .bean(ResultMap.class, "remove(${header." + InvocationRoute.ID + "})") + .removeHeaders("*"); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/GetRestResultRoute.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/GetRestResultRoute.java new file mode 100644 index 000000000..ca3bd50c1 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/GetRestResultRoute.java @@ -0,0 +1,38 @@ +package org.opentosca.bus.management.api.resthttp.route; + +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.management.api.resthttp.processor.ExceptionProcessor; +import org.opentosca.bus.management.api.resthttp.processor.GetResultProcessor; +import org.opentosca.bus.management.api.resthttp.processor.GetResultRequestProcessor; +import org.opentosca.bus.management.api.resthttp.processor.GetResultResponseProcessor; +import org.springframework.stereotype.Component; + +/** + * InvocationRoute of the Management Bus REST-API.
+ *
+ *

+ * The "getResult" endpoint of the REST-API is created here. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class GetRestResultRoute extends RouteBuilder { + + @Override + public void configure() throws Exception { + + final GetResultRequestProcessor getResultRequestProcessor = new GetResultRequestProcessor(); + final GetResultResponseProcessor getResultResponseProcessor = new GetResultResponseProcessor(); + final GetResultProcessor getResultProcessor = new GetResultProcessor(); + final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); + + // handle exceptions + onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) + .process(exceptionProcessor); + + from("restlet:" + InvocationRoute.BASE_ENDPOINT + InvocationRoute.GET_RESULT_ENDPOINT + + "?restletMethod=get").process(getResultRequestProcessor).process(getResultProcessor) + .process(getResultResponseProcessor).removeHeaders("*"); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/InvocationRoute.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/InvocationRoute.java new file mode 100644 index 000000000..bdf76a64d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/InvocationRoute.java @@ -0,0 +1,104 @@ +package org.opentosca.bus.management.api.resthttp.route; + +import javax.inject.Inject; + +import org.apache.camel.Exchange; +import org.apache.camel.Predicate; +import org.apache.camel.builder.PredicateBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.management.api.resthttp.model.QueueMap; +import org.opentosca.bus.management.api.resthttp.model.RequestID; +import org.opentosca.bus.management.api.resthttp.model.ResultMap; +import org.opentosca.bus.management.api.resthttp.processor.ExceptionProcessor; +import org.opentosca.bus.management.api.resthttp.processor.InvocationRequestProcessor; +import org.opentosca.bus.management.api.resthttp.processor.InvocationResponseProcessor; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.service.IManagementBusService; +import org.springframework.stereotype.Component; + +/** + * InvocationRoute of the Management Bus REST-API.
+ *
+ *

+ * The "invoke" endpoint of the REST-API is created here. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class InvocationRoute extends RouteBuilder { + + public static final String INVOKE_ENDPOINT = "/ManagementBus/v1/invoker"; + public static final String ID = "id"; + + private static final String HOST = "http://localhost"; + private static final String PORT = "8086"; + + static final String BASE_ENDPOINT = HOST + ":" + PORT; + + public static final String ID_PLACEHODLER = "{" + ID + "}"; + public static final String POLL_ENDPOINT = INVOKE_ENDPOINT + "/activeRequests/" + ID_PLACEHODLER; + public static final String GET_RESULT_ENDPOINT = POLL_ENDPOINT + "/response"; + + private static final String MANAGEMENT_BUS_REQUEST_ID_HEADER = "ManagementBusRequestID"; + + // Checks if invoking a IA + final Predicate IS_INVOKE_IA = PredicateBuilder.or(header(MBHeader.NODETEMPLATEID_STRING.toString()).isNotNull(), + header(MBHeader.PLANID_QNAME.toString()).isNotNull()); + // Checks if invoking a Plan + final Predicate IS_INVOKE_PLAN = header(MBHeader.PLANID_QNAME.toString()).isNotNull(); + + private final IManagementBusService managementBusService; + + @Inject + public InvocationRoute(IManagementBusService managementBusService) { + this.managementBusService = managementBusService; + } + + @Override + public void configure() throws Exception { + + final InvocationRequestProcessor invocationRequestProcessor = new InvocationRequestProcessor(); + final InvocationResponseProcessor invocationResponseProcessor = new InvocationResponseProcessor(); + final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); + + // handle exceptions + onException(Exception.class).handled(true) + .setBody(property(Exchange.EXCEPTION_CAUGHT)) + .process(exceptionProcessor); + + // invoke main route + from("restlet:" + BASE_ENDPOINT + INVOKE_ENDPOINT + "?restletMethod=post") + .doTry() + .process(invocationRequestProcessor) + .doCatch(Exception.class) + .end() + .choice() + .when(property(Exchange.EXCEPTION_CAUGHT).isNull()) + .to("direct:invoke") + .otherwise() + .to("direct:exception") + .end() + .removeHeaders("*"); + + // route if no exception was caught + from("direct:invoke") + .setHeader(MANAGEMENT_BUS_REQUEST_ID_HEADER, method(RequestID.class, "getNextID")) + .wireTap("direct:toManagementBus").end().to("direct:init").process(invocationResponseProcessor); + + // route in case an exception was caught + from("direct:exception").setBody(property(Exchange.EXCEPTION_CAUGHT)).process(exceptionProcessor); + + // set "isFinsihed"-flag to false for this request + from("direct:init").bean(QueueMap.class, "notFinished(${header." + MANAGEMENT_BUS_REQUEST_ID_HEADER + "})") + .setBody(simple("${header." + MANAGEMENT_BUS_REQUEST_ID_HEADER + "}")); + + // route to management bus engine + from("direct:toManagementBus").choice().when(IS_INVOKE_IA).bean(managementBusService, "invokeIA").when(IS_INVOKE_PLAN) + .bean(managementBusService, "invokePlan").end(); + + // invoke response route + from("direct-vm:" + "org.opentosca.bus.management.api.resthttp") + .bean(QueueMap.class, "finished(${header." + MANAGEMENT_BUS_REQUEST_ID_HEADER + "})") + .bean(ResultMap.class, "put(${header." + MANAGEMENT_BUS_REQUEST_ID_HEADER + "}, ${body})").stop(); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/ResthttpApiIsFinishedRoute.java b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/ResthttpApiIsFinishedRoute.java new file mode 100644 index 000000000..ae711f63a --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/java/org/opentosca/bus/management/api/resthttp/route/ResthttpApiIsFinishedRoute.java @@ -0,0 +1,38 @@ +package org.opentosca.bus.management.api.resthttp.route; + +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.management.api.resthttp.processor.ExceptionProcessor; +import org.opentosca.bus.management.api.resthttp.processor.IsFinishedProcessor; +import org.opentosca.bus.management.api.resthttp.processor.IsFinishedRequestProcessor; +import org.opentosca.bus.management.api.resthttp.processor.IsFinishedResponseProcessor; +import org.springframework.stereotype.Component; + +/** + * InvocationRoute of the Management Bus REST-API.
+ *
+ *

+ * The "isFinished" endpoint of the REST-API is created here. + * + * @author Michael Zimmermann - zimmerml@iaas.uni-stuttgart.de + */ +@Component +public class ResthttpApiIsFinishedRoute extends RouteBuilder { + + @Override + public void configure() throws Exception { + + final IsFinishedRequestProcessor isFinishedRequestProcessor = new IsFinishedRequestProcessor(); + final IsFinishedProcessor isFinishedProcessor = new IsFinishedProcessor(); + final IsFinishedResponseProcessor isFinishedResponseProcessor = new IsFinishedResponseProcessor(); + final ExceptionProcessor exceptionProcessor = new ExceptionProcessor(); + + // handle exceptions + onException(Exception.class).handled(true).setBody(property(Exchange.EXCEPTION_CAUGHT)) + .process(exceptionProcessor); + + from("restlet:" + InvocationRoute.BASE_ENDPOINT + InvocationRoute.POLL_ENDPOINT + + "?restletMethod=get").process(isFinishedRequestProcessor).process(isFinishedProcessor) + .process(isFinishedResponseProcessor).removeHeaders("*"); + } +} diff --git a/org.opentosca.bus.management.api.resthttp/META-INF/swagger.json b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/resources/META-INF/swagger.json similarity index 100% rename from org.opentosca.bus.management.api.resthttp/META-INF/swagger.json rename to org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/resources/META-INF/swagger.json diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/resources/spring/context-bus-management-api.xml b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/resources/spring/context-bus-management-api.xml new file mode 100644 index 000000000..c96c537ac --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.resthttp/src/main/resources/spring/context-bus-management-api.xml @@ -0,0 +1,20 @@ + + + Register the beans within the resthttp bus management api + + + + + + + org.opentosca.bus.management.api.resthttp.route + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/pom.xml new file mode 100644 index 000000000..6e580da15 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.api.soaphttp + + + + org.apache.camel + camel-core + ${camel.version} + + + org.apache.camel + camel-cxf + ${camel.version} + + + org.apache.camel + camel-jaxb + ${camel.version} + + + + + org.apache.cxf + cxf-rt-transports-http-jetty + ${apache.cxf.version} + + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/Doc.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/Doc.java new file mode 100644 index 000000000..f760c2af4 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/Doc.java @@ -0,0 +1,61 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.07.16 at 01:55:00 PM CEST +// + +package org.opentosca.bus.management.api.soaphttp.model; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlType; + +import org.w3c.dom.Element; + +/** + *

+ * Java class for Doc complex type. + * + *

+ * The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Doc">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any processContents='skip' minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Doc", propOrder = {"any"}) +public class Doc { + + @XmlAnyElement + protected Element any; + + /** + * Gets the value of the any property. + * + * @return possible object is {@link Element } + */ + public Element getAny() { + return this.any; + } + + /** + * Sets the value of the any property. + * + * @param value allowed object is {@link Element } + */ + public void setAny(final Element value) { + this.any = value; + } +} diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationAsync.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationAsync.java similarity index 91% rename from org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationAsync.java rename to org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationAsync.java index 8bd3c7ee2..8d78e4070 100644 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationAsync.java +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationAsync.java @@ -6,7 +6,6 @@ // Generated on: 2018.07.16 at 01:55:00 PM CEST // - package org.opentosca.bus.management.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for invokeOperationAsync complex type. @@ -50,15 +48,13 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "invokeOperationAsync", - propOrder = {"planCorrelation", "csarID", "serviceInstanceID", "nodeInstanceID", - "serviceTemplateIDNamespaceURI", "serviceTemplateIDLocalPart", "nodeTemplateID", - "relationshipTemplateID", "interfaceName", "operationName", "replyTo", "messageID", "params", - "doc"}) + propOrder = {"planCorrelation", "csarID", "serviceInstanceID", "nodeInstanceID", + "serviceTemplateIDNamespaceURI", "serviceTemplateIDLocalPart", "nodeTemplateID", + "relationshipTemplateID", "interfaceName", "operationName", "replyTo", "messageID", "params", + "doc"}) public class InvokeOperationAsync { @XmlElement(name = "PlanCorrelationID") @@ -94,7 +90,6 @@ public class InvokeOperationAsync { * Gets the value of the PlanCorrelationID property. * * @return possible object is {@link String } - * */ public String getPlanCorrelationID() { return this.planCorrelation; @@ -104,7 +99,6 @@ public String getPlanCorrelationID() { * Sets the value of the PlanCorrelationID property. * * @param value allowed object is {@link String } - * */ public void setPlanCorrelationID(final String value) { this.planCorrelation = value; @@ -114,7 +108,6 @@ public void setPlanCorrelationID(final String value) { * Gets the value of the csarID property. * * @return possible object is {@link String } - * */ public String getCsarID() { return this.csarID; @@ -124,7 +117,6 @@ public String getCsarID() { * Sets the value of the csarID property. * * @param value allowed object is {@link String } - * */ public void setCsarID(final String value) { this.csarID = value; @@ -134,7 +126,6 @@ public void setCsarID(final String value) { * Gets the value of the serviceInstanceID property. * * @return possible object is {@link String } - * */ public String getServiceInstanceID() { return this.serviceInstanceID; @@ -144,7 +135,6 @@ public String getServiceInstanceID() { * Sets the value of the serviceInstanceID property. * * @param value allowed object is {@link String } - * */ public void setServiceInstanceID(final String value) { this.serviceInstanceID = value; @@ -154,7 +144,6 @@ public void setServiceInstanceID(final String value) { * Gets the value of the nodeInstanceID property. * * @return possible object is {@link String } - * */ public String getNodeInstanceID() { return this.nodeInstanceID; @@ -164,7 +153,6 @@ public String getNodeInstanceID() { * Sets the value of the nodeInstanceID property. * * @param value allowed object is {@link String } - * */ public void setNodeInstanceID(final String value) { this.nodeInstanceID = value; @@ -174,7 +162,6 @@ public void setNodeInstanceID(final String value) { * Gets the value of the serviceTemplateIDNamespaceURI property. * * @return possible object is {@link String } - * */ public String getServiceTemplateIDNamespaceURI() { return this.serviceTemplateIDNamespaceURI; @@ -184,7 +171,6 @@ public String getServiceTemplateIDNamespaceURI() { * Sets the value of the serviceTemplateIDNamespaceURI property. * * @param value allowed object is {@link String } - * */ public void setServiceTemplateIDNamespaceURI(final String value) { this.serviceTemplateIDNamespaceURI = value; @@ -194,7 +180,6 @@ public void setServiceTemplateIDNamespaceURI(final String value) { * Gets the value of the serviceTemplateIDLocalPart property. * * @return possible object is {@link String } - * */ public String getServiceTemplateIDLocalPart() { return this.serviceTemplateIDLocalPart; @@ -204,7 +189,6 @@ public String getServiceTemplateIDLocalPart() { * Sets the value of the serviceTemplateIDLocalPart property. * * @param value allowed object is {@link String } - * */ public void setServiceTemplateIDLocalPart(final String value) { this.serviceTemplateIDLocalPart = value; @@ -214,7 +198,6 @@ public void setServiceTemplateIDLocalPart(final String value) { * Gets the value of the nodeTemplateID property. * * @return possible object is {@link String } - * */ public String getNodeTemplateID() { return this.nodeTemplateID; @@ -224,7 +207,6 @@ public String getNodeTemplateID() { * Sets the value of the nodeTemplateID property. * * @param value allowed object is {@link String } - * */ public void setNodeTemplateID(final String value) { this.nodeTemplateID = value; @@ -234,7 +216,6 @@ public void setNodeTemplateID(final String value) { * Gets the value of the relationshipTemplateID property. * * @return possible object is {@link String } - * */ public String getRelationshipTemplateID() { return this.relationshipTemplateID; @@ -244,7 +225,6 @@ public String getRelationshipTemplateID() { * Sets the value of the relationshipTemplateID property. * * @param value allowed object is {@link String } - * */ public void setRelationshipTemplateID(final String value) { this.relationshipTemplateID = value; @@ -254,7 +234,6 @@ public void setRelationshipTemplateID(final String value) { * Gets the value of the interfaceName property. * * @return possible object is {@link String } - * */ public String getInterfaceName() { return this.interfaceName; @@ -264,7 +243,6 @@ public String getInterfaceName() { * Sets the value of the interfaceName property. * * @param value allowed object is {@link String } - * */ public void setInterfaceName(final String value) { this.interfaceName = value; @@ -274,7 +252,6 @@ public void setInterfaceName(final String value) { * Gets the value of the operationName property. * * @return possible object is {@link String } - * */ public String getOperationName() { return this.operationName; @@ -284,7 +261,6 @@ public String getOperationName() { * Sets the value of the operationName property. * * @param value allowed object is {@link String } - * */ public void setOperationName(final String value) { this.operationName = value; @@ -294,7 +270,6 @@ public void setOperationName(final String value) { * Gets the value of the replyTo property. * * @return possible object is {@link String } - * */ public String getReplyTo() { return this.replyTo; @@ -304,7 +279,6 @@ public String getReplyTo() { * Sets the value of the replyTo property. * * @param value allowed object is {@link String } - * */ public void setReplyTo(final String value) { this.replyTo = value; @@ -314,7 +288,6 @@ public void setReplyTo(final String value) { * Gets the value of the messageID property. * * @return possible object is {@link String } - * */ public String getMessageID() { return this.messageID; @@ -324,7 +297,6 @@ public String getMessageID() { * Sets the value of the messageID property. * * @param value allowed object is {@link String } - * */ public void setMessageID(final String value) { this.messageID = value; @@ -334,7 +306,6 @@ public void setMessageID(final String value) { * Gets the value of the params property. * * @return possible object is {@link ParamsMap } - * */ public ParamsMap getParams() { return this.params; @@ -344,7 +315,6 @@ public ParamsMap getParams() { * Sets the value of the params property. * * @param value allowed object is {@link ParamsMap } - * */ public void setParams(final ParamsMap value) { this.params = value; @@ -354,7 +324,6 @@ public void setParams(final ParamsMap value) { * Gets the value of the doc property. * * @return possible object is {@link Doc } - * */ public Doc getDoc() { return this.doc; @@ -364,7 +333,6 @@ public Doc getDoc() { * Sets the value of the doc property. * * @param value allowed object is {@link Doc } - * */ public void setDoc(final Doc value) { this.doc = value; diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationSync.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationSync.java similarity index 91% rename from org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationSync.java rename to org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationSync.java index bcdb37cb4..aa5861e9a 100644 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationSync.java +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeOperationSync.java @@ -6,7 +6,6 @@ // Generated on: 2018.07.16 at 01:55:00 PM CEST // - package org.opentosca.bus.management.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for invokeOperationSync complex type. @@ -48,14 +46,12 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "invokeOperationSync", - propOrder = {"planCorrelation", "csarID", "serviceInstanceID", "nodeInstanceID", - "serviceTemplateIDNamespaceURI", "serviceTemplateIDLocalPart", "nodeTemplateID", - "relationshipTemplateID", "interfaceName", "operationName", "params", "doc"}) + propOrder = {"planCorrelation", "csarID", "serviceInstanceID", "nodeInstanceID", + "serviceTemplateIDNamespaceURI", "serviceTemplateIDLocalPart", "nodeTemplateID", + "relationshipTemplateID", "interfaceName", "operationName", "params", "doc"}) public class InvokeOperationSync { @XmlElement(name = "PlanCorrelationID") @@ -87,7 +83,6 @@ public class InvokeOperationSync { * Gets the value of the PlanCorrelationID property. * * @return possible object is {@link String } - * */ public String getPlanCorrelationID() { return this.planCorrelation; @@ -97,7 +92,6 @@ public String getPlanCorrelationID() { * Sets the value of the PlanCorrelationID property. * * @param value allowed object is {@link String } - * */ public void setPlanCorrelationID(final String value) { this.planCorrelation = value; @@ -107,7 +101,6 @@ public void setPlanCorrelationID(final String value) { * Gets the value of the csarID property. * * @return possible object is {@link String } - * */ public String getCsarID() { return this.csarID; @@ -117,7 +110,6 @@ public String getCsarID() { * Sets the value of the csarID property. * * @param value allowed object is {@link String } - * */ public void setCsarID(final String value) { this.csarID = value; @@ -127,7 +119,6 @@ public void setCsarID(final String value) { * Gets the value of the serviceInstanceID property. * * @return possible object is {@link String } - * */ public String getServiceInstanceID() { return this.serviceInstanceID; @@ -137,7 +128,6 @@ public String getServiceInstanceID() { * Sets the value of the serviceInstanceID property. * * @param value allowed object is {@link String } - * */ public void setServiceInstanceID(final String value) { this.serviceInstanceID = value; @@ -147,7 +137,6 @@ public void setServiceInstanceID(final String value) { * Gets the value of the nodeInstanceID property. * * @return possible object is {@link String } - * */ public String getNodeInstanceID() { return this.nodeInstanceID; @@ -157,7 +146,6 @@ public String getNodeInstanceID() { * Sets the value of the nodeInstanceID property. * * @param value allowed object is {@link String } - * */ public void setNodeInstanceID(final String value) { this.nodeInstanceID = value; @@ -167,7 +155,6 @@ public void setNodeInstanceID(final String value) { * Gets the value of the serviceTemplateIDNamespaceURI property. * * @return possible object is {@link String } - * */ public String getServiceTemplateIDNamespaceURI() { return this.serviceTemplateIDNamespaceURI; @@ -177,7 +164,6 @@ public String getServiceTemplateIDNamespaceURI() { * Sets the value of the serviceTemplateIDNamespaceURI property. * * @param value allowed object is {@link String } - * */ public void setServiceTemplateIDNamespaceURI(final String value) { this.serviceTemplateIDNamespaceURI = value; @@ -187,7 +173,6 @@ public void setServiceTemplateIDNamespaceURI(final String value) { * Gets the value of the serviceTemplateIDLocalPart property. * * @return possible object is {@link String } - * */ public String getServiceTemplateIDLocalPart() { return this.serviceTemplateIDLocalPart; @@ -197,7 +182,6 @@ public String getServiceTemplateIDLocalPart() { * Sets the value of the serviceTemplateIDLocalPart property. * * @param value allowed object is {@link String } - * */ public void setServiceTemplateIDLocalPart(final String value) { this.serviceTemplateIDLocalPart = value; @@ -207,7 +191,6 @@ public void setServiceTemplateIDLocalPart(final String value) { * Gets the value of the nodeTemplateID property. * * @return possible object is {@link String } - * */ public String getNodeTemplateID() { return this.nodeTemplateID; @@ -217,7 +200,6 @@ public String getNodeTemplateID() { * Sets the value of the nodeTemplateID property. * * @param value allowed object is {@link String } - * */ public void setNodeTemplateID(final String value) { this.nodeTemplateID = value; @@ -227,7 +209,6 @@ public void setNodeTemplateID(final String value) { * Gets the value of the relationshipTemplateID property. * * @return possible object is {@link String } - * */ public String getRelationshipTemplateID() { return this.relationshipTemplateID; @@ -237,7 +218,6 @@ public String getRelationshipTemplateID() { * Sets the value of the relationshipTemplateID property. * * @param value allowed object is {@link String } - * */ public void setRelationshipTemplateID(final String value) { this.relationshipTemplateID = value; @@ -247,7 +227,6 @@ public void setRelationshipTemplateID(final String value) { * Gets the value of the interfaceName property. * * @return possible object is {@link String } - * */ public String getInterfaceName() { return this.interfaceName; @@ -257,7 +236,6 @@ public String getInterfaceName() { * Sets the value of the interfaceName property. * * @param value allowed object is {@link String } - * */ public void setInterfaceName(final String value) { this.interfaceName = value; @@ -267,7 +245,6 @@ public void setInterfaceName(final String value) { * Gets the value of the operationName property. * * @return possible object is {@link String } - * */ public String getOperationName() { return this.operationName; @@ -277,7 +254,6 @@ public String getOperationName() { * Sets the value of the operationName property. * * @param value allowed object is {@link String } - * */ public void setOperationName(final String value) { this.operationName = value; @@ -287,7 +263,6 @@ public void setOperationName(final String value) { * Gets the value of the params property. * * @return possible object is {@link ParamsMap } - * */ public ParamsMap getParams() { return this.params; @@ -297,7 +272,6 @@ public ParamsMap getParams() { * Sets the value of the params property. * * @param value allowed object is {@link ParamsMap } - * */ public void setParams(final ParamsMap value) { this.params = value; @@ -307,7 +281,6 @@ public void setParams(final ParamsMap value) { * Gets the value of the doc property. * * @return possible object is {@link Doc } - * */ public Doc getDoc() { return this.doc; @@ -317,10 +290,8 @@ public Doc getDoc() { * Sets the value of the doc property. * * @param value allowed object is {@link Doc } - * */ public void setDoc(final Doc value) { this.doc = value; } - } diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokePlan.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokePlan.java similarity index 93% rename from org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokePlan.java rename to org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokePlan.java index f00a2931a..b0570bf63 100644 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokePlan.java +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokePlan.java @@ -6,7 +6,6 @@ // Generated on: 2018.07.16 at 01:55:00 PM CEST // - package org.opentosca.bus.management.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for invokePlan complex type. @@ -43,12 +41,10 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "invokePlan", propOrder = {"csarID", "serviceInstanceID", "planIDNamespaceURI", "planIDLocalPart", - "operationName", "replyTo", "messageID", "params", "doc"}) + "operationName", "replyTo", "messageID", "params", "doc"}) public class InvokePlan { @XmlElement(name = "CsarID", required = true) @@ -74,7 +70,6 @@ public class InvokePlan { * Gets the value of the csarID property. * * @return possible object is {@link String } - * */ public String getCsarID() { return this.csarID; @@ -84,7 +79,6 @@ public String getCsarID() { * Sets the value of the csarID property. * * @param value allowed object is {@link String } - * */ public void setCsarID(final String value) { this.csarID = value; @@ -94,7 +88,6 @@ public void setCsarID(final String value) { * Gets the value of the serviceInstanceID property. * * @return possible object is {@link String } - * */ public String getServiceInstanceID() { return this.serviceInstanceID; @@ -104,7 +97,6 @@ public String getServiceInstanceID() { * Sets the value of the serviceInstanceID property. * * @param value allowed object is {@link String } - * */ public void setServiceInstanceID(final String value) { this.serviceInstanceID = value; @@ -114,7 +106,6 @@ public void setServiceInstanceID(final String value) { * Gets the value of the planIDNamespaceURI property. * * @return possible object is {@link String } - * */ public String getPlanIDNamespaceURI() { return this.planIDNamespaceURI; @@ -124,7 +115,6 @@ public String getPlanIDNamespaceURI() { * Sets the value of the planIDNamespaceURI property. * * @param value allowed object is {@link String } - * */ public void setPlanIDNamespaceURI(final String value) { this.planIDNamespaceURI = value; @@ -134,7 +124,6 @@ public void setPlanIDNamespaceURI(final String value) { * Gets the value of the planIDLocalPart property. * * @return possible object is {@link String } - * */ public String getPlanIDLocalPart() { return this.planIDLocalPart; @@ -144,7 +133,6 @@ public String getPlanIDLocalPart() { * Sets the value of the planIDLocalPart property. * * @param value allowed object is {@link String } - * */ public void setPlanIDLocalPart(final String value) { this.planIDLocalPart = value; @@ -154,7 +142,6 @@ public void setPlanIDLocalPart(final String value) { * Gets the value of the operationName property. * * @return possible object is {@link String } - * */ public String getOperationName() { return this.operationName; @@ -164,7 +151,6 @@ public String getOperationName() { * Sets the value of the operationName property. * * @param value allowed object is {@link String } - * */ public void setOperationName(final String value) { this.operationName = value; @@ -174,7 +160,6 @@ public void setOperationName(final String value) { * Gets the value of the replyTo property. * * @return possible object is {@link String } - * */ public String getReplyTo() { return this.replyTo; @@ -184,7 +169,6 @@ public String getReplyTo() { * Sets the value of the replyTo property. * * @param value allowed object is {@link String } - * */ public void setReplyTo(final String value) { this.replyTo = value; @@ -194,7 +178,6 @@ public void setReplyTo(final String value) { * Gets the value of the messageID property. * * @return possible object is {@link String } - * */ public String getMessageID() { return this.messageID; @@ -204,7 +187,6 @@ public String getMessageID() { * Sets the value of the messageID property. * * @param value allowed object is {@link String } - * */ public void setMessageID(final String value) { this.messageID = value; @@ -214,7 +196,6 @@ public void setMessageID(final String value) { * Gets the value of the params property. * * @return possible object is {@link ParamsMap } - * */ public ParamsMap getParams() { return this.params; @@ -224,7 +205,6 @@ public ParamsMap getParams() { * Sets the value of the params property. * * @param value allowed object is {@link ParamsMap } - * */ public void setParams(final ParamsMap value) { this.params = value; @@ -234,7 +214,6 @@ public void setParams(final ParamsMap value) { * Gets the value of the doc property. * * @return possible object is {@link Doc } - * */ public Doc getDoc() { return this.doc; @@ -244,10 +223,8 @@ public Doc getDoc() { * Sets the value of the doc property. * * @param value allowed object is {@link Doc } - * */ public void setDoc(final Doc value) { this.doc = value; } - } diff --git a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeResponse.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeResponse.java similarity index 94% rename from org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeResponse.java rename to org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeResponse.java index 0a4d93ae0..5484b22e6 100644 --- a/org.opentosca.bus.management.api.soaphttp/src/org/opentosca/bus/management/api/soaphttp/model/InvokeResponse.java +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/InvokeResponse.java @@ -6,7 +6,6 @@ // Generated on: 2018.07.16 at 01:55:00 PM CEST // - package org.opentosca.bus.management.api.soaphttp.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for invokeResponse complex type. @@ -37,8 +35,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "invokeResponse", propOrder = {"messageID", "params", "doc"}) @@ -55,7 +51,6 @@ public class InvokeResponse { * Gets the value of the messageID property. * * @return possible object is {@link String } - * */ public String getMessageID() { return this.messageID; @@ -65,7 +60,6 @@ public String getMessageID() { * Sets the value of the messageID property. * * @param value allowed object is {@link String } - * */ public void setMessageID(final String value) { this.messageID = value; @@ -75,7 +69,6 @@ public void setMessageID(final String value) { * Gets the value of the params property. * * @return possible object is {@link ParamsMap } - * */ public ParamsMap getParams() { return this.params; @@ -85,7 +78,6 @@ public ParamsMap getParams() { * Sets the value of the params property. * * @param value allowed object is {@link ParamsMap } - * */ public void setParams(final ParamsMap value) { this.params = value; @@ -95,7 +87,6 @@ public void setParams(final ParamsMap value) { * Gets the value of the doc property. * * @return possible object is {@link Doc } - * */ public Doc getDoc() { return this.doc; @@ -105,10 +96,8 @@ public Doc getDoc() { * Sets the value of the doc property. * * @param value allowed object is {@link Doc } - * */ public void setDoc(final Doc value) { this.doc = value; } - } diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ObjectFactory.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ObjectFactory.java new file mode 100644 index 000000000..05957d5b4 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ObjectFactory.java @@ -0,0 +1,131 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.07.16 at 01:55:00 PM CEST +// + +package org.opentosca.bus.management.api.soaphttp.model; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.opentosca.bus.management.api.soaphttp.model package. + *

+ * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _InvokeOperationAsync_QNAME = + new QName("http://siserver.org/schema", "invokeOperationAsync"); + private final static QName _InvokePlan_QNAME = new QName("http://siserver.org/schema", "invokePlan"); + private final static QName _InvokeResponse_QNAME = new QName("http://siserver.org/schema", "invokeResponse"); + private final static QName _InvokeOperation_QNAME = new QName("http://siserver.org/schema", "invokeOperation"); + private final static QName _InvokeOperationSync_QNAME = + new QName("http://siserver.org/schema", "invokeOperationSync"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.opentosca.bus.management.api.soaphttp.model + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link InvokeOperationAsync } + */ + public InvokeOperationAsync createInvokeOperationAsync() { + return new InvokeOperationAsync(); + } + + /** + * Create an instance of {@link InvokeResponse } + */ + public InvokeResponse createInvokeResponse() { + return new InvokeResponse(); + } + + /** + * Create an instance of {@link InvokePlan } + */ + public InvokePlan createInvokePlan() { + return new InvokePlan(); + } + + /** + * Create an instance of {@link InvokeOperationSync } + */ + public InvokeOperationSync createInvokeOperationSync() { + return new InvokeOperationSync(); + } + + /** + * Create an instance of {@link ParamsMapItemType } + */ + public ParamsMapItemType createParamsMapItemType() { + return new ParamsMapItemType(); + } + + /** + * Create an instance of {@link Doc } + */ + public Doc createDoc() { + return new Doc(); + } + + /** + * Create an instance of {@link ParamsMap } + */ + public ParamsMap createParamsMap() { + return new ParamsMap(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokeOperationAsync }{@code >}} + */ + @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokeOperationAsync") + public JAXBElement createInvokeOperationAsync(final InvokeOperationAsync value) { + return new JAXBElement<>(_InvokeOperationAsync_QNAME, InvokeOperationAsync.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokePlan }{@code >}} + */ + @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokePlan") + public JAXBElement createInvokePlan(final InvokePlan value) { + return new JAXBElement<>(_InvokePlan_QNAME, InvokePlan.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokeResponse }{@code >}} + */ + @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokeResponse") + public JAXBElement createInvokeResponse(final InvokeResponse value) { + return new JAXBElement<>(_InvokeResponse_QNAME, InvokeResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokeOperationAsync }{@code >}} + */ + @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokeOperation") + public JAXBElement createInvokeOperation(final InvokeOperationAsync value) { + return new JAXBElement<>(_InvokeOperation_QNAME, InvokeOperationAsync.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link InvokeOperationSync }{@code >}} + */ + @XmlElementDecl(namespace = "http://siserver.org/schema", name = "invokeOperationSync") + public JAXBElement createInvokeOperationSync(final InvokeOperationSync value) { + return new JAXBElement<>(_InvokeOperationSync_QNAME, InvokeOperationSync.class, null, value); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ParamsMap.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ParamsMap.java new file mode 100644 index 000000000..6973bc148 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ParamsMap.java @@ -0,0 +1,70 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.07.16 at 01:55:00 PM CEST +// + +package org.opentosca.bus.management.api.soaphttp.model; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for ParamsMap complex type. + * + *

+ * The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ParamsMap">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Param" type="{http://siserver.org/schema}ParamsMapItemType" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ParamsMap", propOrder = {"param"}) +public class ParamsMap { + + @XmlElement(name = "Param", required = true) + protected List param; + + /** + * Gets the value of the param property. + * + *

+ * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the param property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+     * getParam().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link ParamsMapItemType } + */ + public List getParam() { + if (this.param == null) { + this.param = new ArrayList<>(); + } + return this.param; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ParamsMapItemType.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ParamsMapItemType.java new file mode 100644 index 000000000..0866e6cca --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/ParamsMapItemType.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.07.16 at 01:55:00 PM CEST +// + +package org.opentosca.bus.management.api.soaphttp.model; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for ParamsMapItemType complex type. + * + *

+ * The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ParamsMapItemType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ParamsMapItemType", propOrder = {"key", "value"}) +public class ParamsMapItemType { + + @XmlElement(required = true) + protected String key; + @XmlElement(required = true) + protected String value; + + /** + * Gets the value of the key property. + * + * @return possible object is {@link String } + */ + public String getKey() { + return this.key; + } + + /** + * Sets the value of the key property. + * + * @param value allowed object is {@link String } + */ + public void setKey(final String value) { + this.key = value; + } + + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + */ + public String getValue() { + return this.value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + */ + public void setValue(final String value) { + this.value = value; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/package-info.java new file mode 100644 index 000000000..045cae6cc --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/model/package-info.java @@ -0,0 +1,11 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.07.16 at 01:55:00 PM CEST +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://siserver.org/schema", + elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.opentosca.bus.management.api.soaphttp.model; diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/package-info.java new file mode 100644 index 000000000..1bebcdcaa --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the activator for starting the camel context and with it the routes of the Management + * Bus-SOAP/HTTP-API.

Copyright 2012 IAAS University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.api.soaphttp; diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/RequestProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/RequestProcessor.java new file mode 100644 index 000000000..b68cb4599 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/RequestProcessor.java @@ -0,0 +1,286 @@ +package org.opentosca.bus.management.api.soaphttp.processor; + +import java.net.URI; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.eclipse.winery.model.tosca.TNodeTemplate; + +import com.google.gson.Gson; +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.commons.io.FilenameUtils; +import org.apache.cxf.binding.soap.SoapHeader; +import org.apache.cxf.headers.Header; +import org.opentosca.bus.management.api.soaphttp.model.Doc; +import org.opentosca.bus.management.api.soaphttp.model.InvokeOperationAsync; +import org.opentosca.bus.management.api.soaphttp.model.InvokeOperationSync; +import org.opentosca.bus.management.api.soaphttp.model.InvokePlan; +import org.opentosca.bus.management.api.soaphttp.model.ParamsMap; +import org.opentosca.bus.management.api.soaphttp.model.ParamsMapItemType; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.engine.ResolvedArtifacts; +import org.opentosca.container.core.engine.ResolvedArtifacts.ResolvedDeploymentArtifact; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.engine.next.ContainerEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Request-Processor of the Management Bus-SOAP/HTTP-API.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * This processor processes the incoming requests of the Management Bus-SOAP/HTTP-API. It transforms the incoming + * unmarshalled SOAP message into a from the Management Bus understandable camel exchange message. The MBHeader-Enum is + * used here to define the headers of the exchange message. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @see MBHeader + */ +public class RequestProcessor implements Processor { + public static final String MB_MANAGEMENT_SOAPHTTP_API_ID = "org.opentosca.bus.management.api.soaphttp"; + + private static final Logger LOG = LoggerFactory.getLogger(RequestProcessor.class); + private final CsarStorageService csarStorage; + private final ContainerEngine containerEngine; + + // manually instantiated from within the Route definition. Therefore no @Inject annotation + public RequestProcessor(CsarStorageService csarStorage, ContainerEngine containerEngine) { + this.csarStorage = csarStorage; + this.containerEngine = containerEngine; + } + + @Override + public void process(final Exchange exchange) throws Exception { + + // copy SOAP headers in camel exchange object + LOG.debug("copy SOAP headers in camel exchange object"); + @SuppressWarnings("unchecked") final List soapHeaders = (List) exchange.getIn().getHeader(Header.HEADER_LIST); + Element elementx; + if (soapHeaders != null) { + for (final SoapHeader header : soapHeaders) { + elementx = (Element) header.getObject(); + exchange.getIn().setHeader(elementx.getLocalName(), elementx.getTextContent()); + } + } + + ParamsMap paramsMap = null; + Doc doc = null; + String csarIDString = null; + String serviceInstanceID = null; + String callbackAddress = null; + String messageID = null; + String interfaceName = null; + String operationName = null; + if (exchange.getIn().getBody() instanceof InvokeOperationAsync) { + + LOG.debug("Processing async operation invocation"); + + final InvokeOperationAsync invokeIaRequest = (InvokeOperationAsync) exchange.getIn().getBody(); + + csarIDString = invokeIaRequest.getCsarID(); + + serviceInstanceID = invokeIaRequest.getServiceInstanceID(); + exchange.getIn().setHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), new URI(serviceInstanceID)); + + final String nodeInstanceID = invokeIaRequest.getNodeInstanceID(); + exchange.getIn().setHeader(MBHeader.NODEINSTANCEID_STRING.toString(), nodeInstanceID); + + final String serviceTemplateIDNamespaceURI = invokeIaRequest.getServiceTemplateIDNamespaceURI(); + final String serviceTemplateIDLocalPart = invokeIaRequest.getServiceTemplateIDLocalPart(); + + final QName serviceTemplateID = new QName(serviceTemplateIDNamespaceURI, serviceTemplateIDLocalPart); + + exchange.getIn().setHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); + + final String nodeTemplateID = invokeIaRequest.getNodeTemplateID(); + exchange.getIn().setHeader(MBHeader.NODETEMPLATEID_STRING.toString(), nodeTemplateID); + + final String relationshipTemplateID = invokeIaRequest.getRelationshipTemplateID(); + exchange.getIn().setHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), relationshipTemplateID); + + // Support new Deployment Artifact Header + final List resolvedDAs = new ArrayList<>(); + if (nodeTemplateID != null) { + final Csar csar = csarStorage.findById(new CsarId(csarIDString)); + final TNodeTemplate nodeTemplate = ToscaEngine.resolveNodeTemplate(csar, serviceTemplateID, nodeTemplateID); + + final ResolvedArtifacts resolvedArtifacts = containerEngine.resolvedDeploymentArtifacts(csar, nodeTemplate); + resolvedDAs.addAll(resolvedArtifacts.getDeploymentArtifacts()); + } + + final URL serviceInstanceIDUrl = new URL(serviceInstanceID); + final HashMap> DAs = new HashMap<>(); + for (final ResolvedDeploymentArtifact resolvedDeploymentArtifact : resolvedDAs) { + LOG.info("DA name:" + resolvedDeploymentArtifact.getName()); + final QName DAname = resolvedDeploymentArtifact.getType(); + final HashMap DAfiles = new HashMap<>(); + DAs.put(DAname, DAfiles); + for (final String s : resolvedDeploymentArtifact.getReferences()) { + LOG.info("DA getReferences:" + s); + final String url = serviceInstanceIDUrl.getProtocol() + "://" + serviceInstanceIDUrl.getHost() + ":" + + serviceInstanceIDUrl.getPort() + "/csars/" + csarIDString + "/content/"; + final String urlWithDa = url + s; + + LOG.info(urlWithDa); + DAfiles.put(FilenameUtils.getName(urlWithDa), urlWithDa); + } + } + final Gson gson = new Gson(); + exchange.getIn().setHeader(MBHeader.DEPLOYMENT_ARTIFACTS_STRING.toString(), gson.toJson(DAs)); + LOG.info("serviceInstanceID:" + serviceInstanceID); + LOG.info("OPENTOSCA_CONTAINER_HOSTNAME:" + Settings.OPENTOSCA_CONTAINER_HOSTNAME); + LOG.info("OPENTOSCA_CONTAINER_PORT:" + Settings.OPENTOSCA_CONTAINER_PORT); + LOG.info("serviceTemplateIDNamespaceURI:" + serviceTemplateIDNamespaceURI); + + interfaceName = invokeIaRequest.getInterfaceName(); + + if (interfaceName != null && !(interfaceName.equals("?") || interfaceName.isEmpty())) { + exchange.getIn().setHeader(MBHeader.INTERFACENAME_STRING.toString(), interfaceName); + } + + operationName = invokeIaRequest.getOperationName(); + + callbackAddress = invokeIaRequest.getReplyTo(); + + messageID = invokeIaRequest.getMessageID(); + + paramsMap = invokeIaRequest.getParams(); + + doc = invokeIaRequest.getDoc(); + + if (callbackAddress != null && !(callbackAddress.isEmpty() || callbackAddress.equals("?"))) { + exchange.getIn().setHeader("ReplyTo", callbackAddress); + } + + if (messageID != null && !(messageID.isEmpty() || messageID.equals("?"))) { + exchange.getIn().setHeader("MessageID", messageID); + } + + exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, "invokeIA"); + } else if (exchange.getIn().getBody() instanceof InvokeOperationSync) { + + LOG.debug("Processing sync operation invocation"); + + final InvokeOperationSync invokeIaRequest = (InvokeOperationSync) exchange.getIn().getBody(); + + csarIDString = invokeIaRequest.getCsarID(); + + serviceInstanceID = invokeIaRequest.getServiceInstanceID(); + exchange.getIn().setHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), new URI(serviceInstanceID)); + + final String nodeInstanceID = invokeIaRequest.getNodeInstanceID(); + exchange.getIn().setHeader(MBHeader.NODEINSTANCEID_STRING.toString(), nodeInstanceID); + + final String serviceTemplateIDNamespaceURI = invokeIaRequest.getServiceTemplateIDNamespaceURI(); + final String serviceTemplateIDLocalPart = invokeIaRequest.getServiceTemplateIDLocalPart(); + + final QName serviceTemplateID = new QName(serviceTemplateIDNamespaceURI, serviceTemplateIDLocalPart); + + exchange.getIn().setHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); + + final String nodeTemplateID = invokeIaRequest.getNodeTemplateID(); + exchange.getIn().setHeader(MBHeader.NODETEMPLATEID_STRING.toString(), nodeTemplateID); + + final String relationshipTemplateID = invokeIaRequest.getRelationshipTemplateID(); + exchange.getIn().setHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), relationshipTemplateID); + + interfaceName = invokeIaRequest.getInterfaceName(); + + if (interfaceName != null && !(interfaceName.equals("?") || interfaceName.isEmpty())) { + exchange.getIn().setHeader(MBHeader.INTERFACENAME_STRING.toString(), interfaceName); + } + + operationName = invokeIaRequest.getOperationName(); + + paramsMap = invokeIaRequest.getParams(); + + doc = invokeIaRequest.getDoc(); + + exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, "invokeIA"); + } else if (exchange.getIn().getBody() instanceof InvokePlan) { + + LOG.debug("Processing plan invocation"); + + final InvokePlan invokePlanRequest = (InvokePlan) exchange.getIn().getBody(); + + csarIDString = invokePlanRequest.getCsarID(); + + serviceInstanceID = invokePlanRequest.getServiceInstanceID(); + if (serviceInstanceID != null) { + exchange.getIn().setHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), new URI(serviceInstanceID)); + } + + final String planIDNamespaceURI = invokePlanRequest.getPlanIDNamespaceURI(); + final String planIDLocalPart = invokePlanRequest.getPlanIDLocalPart(); + + final QName planID = new QName(planIDNamespaceURI, planIDLocalPart); + exchange.getIn().setHeader(MBHeader.PLANID_QNAME.toString(), planID); + + operationName = invokePlanRequest.getOperationName(); + + callbackAddress = invokePlanRequest.getReplyTo(); + + messageID = invokePlanRequest.getMessageID(); + + paramsMap = invokePlanRequest.getParams(); + + doc = invokePlanRequest.getDoc(); + + if (callbackAddress != null && !(callbackAddress.isEmpty() || callbackAddress.equals("?"))) { + exchange.getIn().setHeader("ReplyTo", callbackAddress); + } + + if (messageID != null && !(messageID.isEmpty() || messageID.equals("?"))) { + exchange.getIn().setHeader("MessageID", messageID); + } + + exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, "invokePlan"); + } + + final CsarId csarID = new CsarId(csarIDString); + + exchange.getIn().setHeader(MBHeader.CSARID.toString(), csarID); + exchange.getIn().setHeader(MBHeader.OPERATIONNAME_STRING.toString(), operationName); + exchange.getIn().setHeader(MBHeader.APIID_STRING.toString(), MB_MANAGEMENT_SOAPHTTP_API_ID); + + if (paramsMap != null) { + // put key-value params into camel exchange body as hashmap + final HashMap params = new HashMap<>(); + + for (final ParamsMapItemType param : paramsMap.getParam()) { + params.put(param.getKey(), param.getValue()); + } + exchange.getIn().setBody(params); + } else if (doc != null && doc.getAny() != null) { + final DocumentBuilderFactory dFact = DocumentBuilderFactory.newInstance(); + final DocumentBuilder build = dFact.newDocumentBuilder(); + final Document document = build.newDocument(); + + final Element element = doc.getAny(); + + document.adoptNode(element); + document.appendChild(element); + + exchange.getIn().setBody(document); + } else { + exchange.getIn().setBody(null); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/ResponseProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/ResponseProcessor.java new file mode 100644 index 000000000..d820fb9c1 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/ResponseProcessor.java @@ -0,0 +1,85 @@ +package org.opentosca.bus.management.api.soaphttp.processor; + +import java.util.HashMap; +import java.util.Map.Entry; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.opentosca.bus.management.api.soaphttp.model.Doc; +import org.opentosca.bus.management.api.soaphttp.model.InvokeResponse; +import org.opentosca.bus.management.api.soaphttp.model.ParamsMap; +import org.opentosca.bus.management.api.soaphttp.model.ParamsMapItemType; +import org.opentosca.bus.management.header.MBHeader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * Response-Processor of the Management Bus-SOAP/HTTP-API.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * This processor processes the from the Management Bus incoming response of a invoked service. The response is + * transformed into a marshallable object. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @see MBHeader + */ +public class ResponseProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(ResponseProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + ResponseProcessor.LOG.debug("Processing the response..."); + final InvokeResponse invokeResponse = new InvokeResponse(); + + if (exchange.getIn().getBody() instanceof HashMap) { + + ResponseProcessor.LOG.debug("Response is of type HashMap."); + + @SuppressWarnings("unchecked") final HashMap responseMap = exchange.getIn().getBody(HashMap.class); + + final ParamsMap paramsMap = new ParamsMap(); + for (final Entry entry : responseMap.entrySet()) { + final String key = entry.getKey(); + final String value = entry.getValue(); + ParamsMapItemType mapItem = new ParamsMapItemType(); + mapItem.setKey(key); + mapItem.setValue(value); + paramsMap.getParam().add(mapItem); + } + invokeResponse.setParams(paramsMap); + exchange.getIn().setBody(invokeResponse); + } else if (exchange.getIn().getBody() instanceof Document) { + + ResponseProcessor.LOG.debug("Response is of type Document."); + + final Document responseDoc = exchange.getIn().getBody(Document.class); + final NodeList nodeList = responseDoc.getChildNodes(); + + final Doc ar = new Doc(); + + for (int i = 0; i < nodeList.getLength(); i++) { + ar.setAny((Element) nodeList.item(i)); + } + invokeResponse.setDoc(ar); + exchange.getIn().setBody(invokeResponse); + } + + // Async + if (exchange.getIn().getHeader("MessageID") != null) { + final String messageID = exchange.getIn().getHeader("MessageID", String.class); + + exchange.getIn().setHeader("operationName", "callback"); + exchange.getIn().setHeader("operationNamespace", "http://siserver.org/wsdl"); + + exchange.getIn().setHeader("RelatesTo", messageID); + invokeResponse.setMessageID(messageID); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/package-info.java new file mode 100644 index 000000000..3904203f7 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/processor/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the two camel processors of the Management Bus-SOAP/HTTP-API. One for processing the request + * and one for processing the response.

Copyright 2012 IAAS University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.api.soaphttp.processor; diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/route/Route.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/route/Route.java new file mode 100644 index 000000000..9fb670db6 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/route/Route.java @@ -0,0 +1,130 @@ +package org.opentosca.bus.management.api.soaphttp.route; + +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.HashMap; + +import javax.inject.Inject; +import javax.xml.bind.JAXBContext; +import javax.xml.namespace.QName; + +import org.apache.camel.Predicate; +import org.apache.camel.Processor; +import org.apache.camel.builder.PredicateBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.cxf.common.message.CxfConstants; +import org.apache.camel.converter.jaxb.JaxbDataFormat; +import org.opentosca.bus.management.api.soaphttp.processor.RequestProcessor; +import org.opentosca.bus.management.api.soaphttp.processor.ResponseProcessor; +import org.opentosca.bus.management.service.IManagementBusService; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.engine.next.ContainerEngine; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.springframework.stereotype.Component; + +/** + * Route of the Management Bus-SOAP/HTTP-API.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * Here the route an incoming invoke-request has to pass is defined. Also the web services to consume and produce a SOAP + * message are created here. An incoming SOAP message will be unmarshalled and with the request-processor transformed. + * After that the message will be given the Management Bus for further execution. The response will be transformed, + * marshalled and send to the recipient. Supported are both synchronous request-response communication and asynchronous + * communication with callback. MessageID and ReplyTo-address can be passed as parameter of the SOAP body or as WS-A + * header. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +// named to avoid clashing with other RouteBuilders just called Route across the project +//@Named("management-bus-soaphttp-route") +public class Route extends RouteBuilder { + + public final static String PUBLIC_ENDPOINT = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":8081/invoker"; + public final static QName PORT = new QName("http://siserver.org/wsdl", "InvokePort"); + public final static QName PORTTYPE = new QName("http://siserver.org/wsdl", "InvokePortType"); + + private final static String ENDPOINT = "http://0.0.0.0:8081/invoker"; + + // Checks if invoking a IA + final Predicate IS_INVOKE_IA = header(CxfConstants.OPERATION_NAME).isEqualTo("invokeIA"); + + // Checks if invoking a Plan + final Predicate IS_INVOKE_PLAN = header(CxfConstants.OPERATION_NAME).isEqualTo("invokePlan"); + + private final CsarStorageService csarStorageService; + private final IManagementBusService managementBusService; + private final ICoreEndpointService endpointService; + private final ContainerEngine containerEngine; + + @Inject + public Route(CsarStorageService csarStorageService, IManagementBusService managementBusService, + ICoreEndpointService endpointService, ContainerEngine containerEngine) { + this.csarStorageService = csarStorageService; + this.managementBusService = managementBusService; + this.endpointService = endpointService; + this.containerEngine = containerEngine; + + storeManagementEndpoint(); + } + + private void storeManagementEndpoint() { + try { + URI uri = new URI(Route.PUBLIC_ENDPOINT); + final String localContainer = Settings.OPENTOSCA_CONTAINER_HOSTNAME; + final WSDLEndpoint endpoint = new WSDLEndpoint(uri, Route.PORTTYPE, localContainer, localContainer, + new CsarId("***"), null, null, null, null, new HashMap()); + endpointService.storeWSDLEndpoint(endpoint); + } catch (final URISyntaxException e) { + e.printStackTrace(); + } + } + + @Override + public void configure() throws Exception { + final URL wsdlURL = this.getClass().getClassLoader().getResource("wsdl/invoker.wsdl"); + + // CXF Endpoints + final String INVOKE_ENDPOINT = "cxf:" + ENDPOINT + "?wsdlURL=" + wsdlURL.toString() + + "&serviceName={http://siserver.org/wsdl}InvokerService&portName=" + Route.PORT.toString() + + "&dataFormat=PAYLOAD&loggingFeatureEnabled=true"; + final String CALLBACK_ENDPOINT = "cxf:${header[ReplyTo]}?wsdlURL=" + wsdlURL.toString() + + "&headerFilterStrategy=#dropAllMessageHeadersStrategy" + + "&serviceName={http://siserver.org/wsdl}CallbackService&portName={http://siserver.org/wsdl}CallbackPort" + + "&dataFormat=PAYLOAD&loggingFeatureEnabled=true"; + + // Checks if invoke is sync or async + final Predicate MESSAGEID = header("MessageID").isNotNull(); + final Predicate REPLYTO = header("ReplyTo").isNotNull(); + final Predicate ASYNC = PredicateBuilder.and(MESSAGEID, REPLYTO); + + final ClassLoader cl = org.opentosca.bus.management.api.soaphttp.model.ObjectFactory.class.getClassLoader(); + final JAXBContext jc = JAXBContext.newInstance("org.opentosca.bus.management.api.soaphttp.model", cl); + final JaxbDataFormat requestJaxb = new JaxbDataFormat(jc); + final JaxbDataFormat responseJaxb = new JaxbDataFormat(jc); + responseJaxb.setPartClass("org.opentosca.bus.management.api.soaphttp.model.InvokeResponse"); + responseJaxb.setPartNamespace(new QName("http://siserver.org/schema", "invokeResponse")); + + final Processor requestProcessor = new RequestProcessor(csarStorageService, containerEngine); + final Processor responseProcessor = new ResponseProcessor(); + + this.from(INVOKE_ENDPOINT) + .unmarshal(requestJaxb) + .process(requestProcessor) + .choice().when(IS_INVOKE_IA) + .bean(managementBusService, "invokeIA") + .when(IS_INVOKE_PLAN) + .bean(managementBusService, "invokePlan") + .end(); + + this.from("direct-vm:" + RequestProcessor.MB_MANAGEMENT_SOAPHTTP_API_ID).process(responseProcessor).marshal(responseJaxb).choice().when(ASYNC) + .recipientList(this.simple(CALLBACK_ENDPOINT)).end(); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/route/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/route/package-info.java new file mode 100644 index 000000000..5427c80ba --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/java/org/opentosca/bus/management/api/soaphttp/route/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the camel routes of the Management Bus-SOAP/HTTP-API.

Copyright 2012 IAAS + * University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.api.soaphttp.route; diff --git a/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/resources/spring/context-bus-management-api.xml b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/resources/spring/context-bus-management-api.xml new file mode 100644 index 000000000..54812f36c --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/resources/spring/context-bus-management-api.xml @@ -0,0 +1,23 @@ + + + + + + + org.opentosca.bus.management.api.soaphttp.route + + + + + + + + + diff --git a/org.opentosca.bus.management.api.soaphttp/META-INF/wsdl/invoker.wsdl b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/resources/wsdl/invoker.wsdl similarity index 100% rename from org.opentosca.bus.management.api.soaphttp/META-INF/wsdl/invoker.wsdl rename to org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/resources/wsdl/invoker.wsdl diff --git a/org.opentosca.bus.management.api.soaphttp/META-INF/wsdl/invoker.xsd b/org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/resources/wsdl/invoker.xsd similarity index 100% rename from org.opentosca.bus.management.api.soaphttp/META-INF/wsdl/invoker.xsd rename to org.opentosca.bus/org.opentosca.bus.management.api.soaphttp/src/main/resources/wsdl/invoker.xsd diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/pom.xml new file mode 100644 index 000000000..edc6ad24b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.deployment.plugin.remote + + + + org.apache.camel + camel-core + ${camel.version} + + + org.opentosca + org.opentosca.bus.management.deployment.plugin + ${project.version} + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + + diff --git a/org.opentosca.bus.management.deployment.plugin.remote/src/org/opentosca/bus/management/deployment/plugin/remote/ManagementBusDeploymentPluginRemote.java b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/src/main/java/org/opentosca/bus/management/deployment/plugin/remote/ManagementBusDeploymentPluginRemote.java similarity index 78% rename from org.opentosca.bus.management.deployment.plugin.remote/src/org/opentosca/bus/management/deployment/plugin/remote/ManagementBusDeploymentPluginRemote.java rename to org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/src/main/java/org/opentosca/bus/management/deployment/plugin/remote/ManagementBusDeploymentPluginRemote.java index 4c0253e5b..afc5d3eb4 100644 --- a/org.opentosca.bus.management.deployment.plugin.remote/src/org/opentosca/bus/management/deployment/plugin/remote/ManagementBusDeploymentPluginRemote.java +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/src/main/java/org/opentosca/bus/management/deployment/plugin/remote/ManagementBusDeploymentPluginRemote.java @@ -5,6 +5,8 @@ import java.util.Collections; import java.util.List; +import javax.inject.Inject; + import org.apache.camel.Exchange; import org.apache.camel.Message; import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; @@ -16,37 +18,42 @@ import org.opentosca.bus.management.service.impl.collaboration.model.RemoteOperations; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; /** * Management Bus-Plug-in for the deployment of IAs on a remote OpenTOSCA Container.
*
- * - * This Plug-in is able to deploy and undeploy all kind of IAs which are supported by one of the - * other available deployment plug-ins on a remote OpenTOSCA Container. It gets a camel exchange - * object from the Management Bus which contains all information that is needed for the - * deployment/undeployment. Afterwards it forwards the information via MQTT to the remote Container - * and waits for a response. When the response arrives the result of the deployment/undeployment is - * extracted, added to the incoming exchange and passed back to the caller.
+ *

+ * This Plug-in is able to deploy and undeploy all kind of IAs which are supported by one of the other available + * deployment plug-ins on a remote OpenTOSCA Container. It gets a camel exchange object from the Management Bus which + * contains all information that is needed for the deployment/undeployment. Afterwards it forwards the information via + * MQTT to the remote Container and waits for a response. When the response arrives the result of the + * deployment/undeployment is extracted, added to the incoming exchange and passed back to the caller.
*
- * + *

* Copyright 2018 IAAS University of Stuttgart */ +@Component public class ManagementBusDeploymentPluginRemote implements IManagementBusDeploymentPluginService { static final private Logger LOG = LoggerFactory.getLogger(ManagementBusDeploymentPluginRemote.class); + private final RequestSender requestSender; + + @Inject + public ManagementBusDeploymentPluginRemote(RequestSender requestSender) { + this.requestSender = requestSender; + } + @Override public Exchange invokeImplementationArtifactDeployment(final Exchange exchange) { - LOG.debug("Trying to deploy IA on remote OpenTOSCA Container."); final Message message = exchange.getIn(); // create empty request message (only headers needed) final CollaborationMessage requestBody = new CollaborationMessage(new KeyValueMap(), null); - // perform remote deployment - final Exchange response = - RequestSender.sendRequestToRemoteContainer(message, RemoteOperations.INVOKE_IA_DEPLOYMENT, requestBody, 0); + final Exchange response = requestSender.sendRequestToRemoteContainer(message, RemoteOperations.INVOKE_IA_DEPLOYMENT, requestBody, 0); // extract the endpoint URI from the response final URI endpointURI = response.getIn().getHeader(MBHeader.ENDPOINT_URI.toString(), URI.class); @@ -59,17 +66,14 @@ public Exchange invokeImplementationArtifactDeployment(final Exchange exchange) @Override public Exchange invokeImplementationArtifactUndeployment(final Exchange exchange) { - LOG.debug("Trying to undeploy IA on remote OpenTOSCA Container."); final Message message = exchange.getIn(); // create empty request message (only headers needed) final CollaborationMessage requestBody = new CollaborationMessage(new KeyValueMap(), null); - // perform remote undeployment - final Exchange response = - RequestSender.sendRequestToRemoteContainer(message, RemoteOperations.INVOKE_IA_UNDEPLOYMENT, requestBody, - 0); + final Exchange response = requestSender.sendRequestToRemoteContainer(message, RemoteOperations.INVOKE_IA_UNDEPLOYMENT, requestBody, + 0); // extract the undeployment state from the response final boolean state = response.getIn().getHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), boolean.class); @@ -85,7 +89,6 @@ public Exchange invokeImplementationArtifactUndeployment(final Exchange exchange * {@inheritDoc} */ public List getSupportedTypes() { - // This plug-in supports only the special type 'remote' which is used to forward deployment // requests to other OpenTOSCA Containers. return Collections.singletonList(Constants.REMOTE_TYPE); @@ -96,7 +99,6 @@ public List getSupportedTypes() { * {@inheritDoc} */ public List getCapabilties() { - // This plug-in is intended to move deployment requests from one OpenTOSCA Container to // another one. At the destination OpenTOSCA Container the deployment is done by one of the // other available deployment plug-ins. Therefore, it has to be checked if this other diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/src/main/resources/spring/context-bus-deployment-plugin.xml b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/src/main/resources/spring/context-bus-deployment-plugin.xml new file mode 100644 index 000000000..7add8934d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.remote/src/main/resources/spring/context-bus-deployment-plugin.xml @@ -0,0 +1,17 @@ + + + + Register the beans within the tomcat management bus deployment plugin. + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/pom.xml new file mode 100644 index 000000000..b544627e7 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.deployment.plugin.script + + + + org.apache.camel + camel-core + 2.18.3 + + + org.opentosca + org.opentosca.bus.management.deployment.plugin + ${project.version} + compile + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/src/main/java/org/opentosca/bus/management/deployment/plugin/script/ManagementBusDeploymentPluginScript.java b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/src/main/java/org/opentosca/bus/management/deployment/plugin/script/ManagementBusDeploymentPluginScript.java new file mode 100644 index 000000000..6b9e4098a --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/src/main/java/org/opentosca/bus/management/deployment/plugin/script/ManagementBusDeploymentPluginScript.java @@ -0,0 +1,79 @@ +package org.opentosca.bus.management.deployment.plugin.script; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.camel.Exchange; +import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; +import org.opentosca.bus.management.header.MBHeader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Management Bus-Plug-in for the deployment of Script IAs.
+ *
+ *

+ *

+ *

+ * Since Script IAs have to be executed on a host machine, they don´t have to be deployed. Therefore, this Plug-in is + * only a wrapper for the supported types and capabilities. When the deployment is invoked it just returns a wildcard + * endpoint. Likewise, it always returns success when the undeployment is invoked. + * + * @author Benjamin Weder - st100495@stud.uni-stuttgart.de + */ +public class ManagementBusDeploymentPluginScript implements IManagementBusDeploymentPluginService { + + static final private String TYPES = "{http://opentosca.org/artifacttypes}Chef, {http://opentosca.org/artifacttypes}Ansible, {http://www.example.com/clartigr/tosca}clartigr, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}Chef, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}Puppet, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}Juju, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}CloudFoundry, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}UnixShell, {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}ScriptArtifact"; + static final private String CAPABILITIES = ""; + + static final private Logger LOG = LoggerFactory.getLogger(ManagementBusDeploymentPluginScript.class); + + @Override + public Exchange invokeImplementationArtifactDeployment(final Exchange exchange) { + URI endpoint = null; + try { + // return dummy endpoint for further processing without aborting due to missing endpoint + endpoint = new URI("ManagementBusDeploymentPluginScript:ScriptEndpoint"); + } catch (final URISyntaxException e) { + e.printStackTrace(); + } + exchange.getIn().setHeader(MBHeader.ENDPOINT_URI.toString(), endpoint); + return exchange; + } + + @Override + public Exchange invokeImplementationArtifactUndeployment(final Exchange exchange) { + exchange.getIn().setHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), true); + return exchange; + } + + @Override + /** + * {@inheritDoc} + */ + public List getSupportedTypes() { + LOG.debug("Getting Types: {}.", TYPES); + final List types = new ArrayList<>(); + + for (final String type : TYPES.split("[,;]")) { + types.add(type.trim()); + } + return types; + } + + @Override + /** + * {@inheritDoc} + */ + public List getCapabilties() { + LOG.debug("Getting Plugin-Capabilities: {}.", CAPABILITIES); + final List capabilities = new ArrayList<>(); + + for (final String capability : CAPABILITIES.split("[,;]")) { + capabilities.add(capability.trim()); + } + return capabilities; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/src/main/resources/spring/context-bus-deployment-plugin.xml b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/src/main/resources/spring/context-bus-deployment-plugin.xml new file mode 100644 index 000000000..443ff263f --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.script/src/main/resources/spring/context-bus-deployment-plugin.xml @@ -0,0 +1,17 @@ + + + + Register the beans within the script management bus deployment plugin. + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/pom.xml new file mode 100644 index 000000000..7fb638369 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.deployment.plugin.tomcat + + + + org.apache.camel + camel-core + 2.18.3 + + + commons-io + commons-io + 2.6 + + + org.apache.httpcomponents + httpcore + 4.4.8 + + + org.apache.httpcomponents + httpmime + 4.5.1 + + + org.apache.commons + commons-lang3 + 3.7 + + + org.opentosca + org.opentosca.bus.management + ${project.version} + compile + + + org.opentosca + org.opentosca.container.core + ${project.version} + compile + + + org.opentosca + org.opentosca.bus.management.deployment.plugin + ${project.version} + compile + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/src/main/java/org/opentosca/bus/management/deployment/plugin/tomcat/ManagementBusDeploymentPluginTomcat.java b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/src/main/java/org/opentosca/bus/management/deployment/plugin/tomcat/ManagementBusDeploymentPluginTomcat.java new file mode 100644 index 000000000..ebf54ebc7 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/src/main/java/org/opentosca/bus/management/deployment/plugin/tomcat/ManagementBusDeploymentPluginTomcat.java @@ -0,0 +1,429 @@ +package org.opentosca.bus.management.deployment.plugin.tomcat; + +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.entity.mime.HttpMultipartMode; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.FileBody; +import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.service.IHTTPService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * Management Bus-Plug-in for the deployment of WAR IAs on an Apache Tomcat web server.
+ *
+ *

+ *

+ *

+ * This Plug-in is able to deploy and undeploy WAR Artifacts on an Apache Tomcat. It gets a camel exchange object from + * the Management Bus which contains all information that is needed for the deployment/undeployment.
+ *
+ * + * Tomcat config: Tomcat location, username and password for this Plug-in are defined in the + * class {@link Settings} or the corresponding config.ini file.
+ *
+ * + * Deployment: The {@link MBHeader#ARTIFACTREFERENCES_LIST_STRING} header field contains a + * list with all ArtifactReferences for the current IA. This list is used to find the reference to the WAR-File that has + * to be deployed. When a reference is found, the respective file ist retrieved. The {@link + * MBHeader#ARTIFACTSERVICEENDPOINT_STRING} header field determines whether the deployment is done on the management + * infrastructure or as part of the topology to which this IA belongs. If the header contains a placeholder the IA is + * deployed as part of the topology and this Plug-in just returns an endpoint. Otherwise the deployment is done via a + * HTTP request to the Apache Tomcat.
+ *
+ * + * Undeployment: The {@link MBHeader#ENDPOINT_URI} header field contains the endpoint of the + * deployed IA. This endpoint is used to calculate the deployment path of the IA and to send an undeployment request to + * the Tomcat.
+ *
+ *

+ * Copyright 2018 IAAS University of Stuttgart
+ *
+ * + * @author Benjamin Weder - st100495@stud.uni-stuttgart.de + */ +@Component +public class ManagementBusDeploymentPluginTomcat implements IManagementBusDeploymentPluginService { + + // In messages.properties defined plugin types and capabilities + private static final String TYPES = "{http://www.example.com/ToscaTypes}WAR,{http://opentosca.org/artifacttypes}WAR"; + private static final String CAPABILITIES = "http://tomcat.apache.org/tomcat7.0, http://www.jcp.org/javaserverpages2.2 , http://www.jcp.org/servlet3.0"; + + private static final Logger LOG = LoggerFactory.getLogger(ManagementBusDeploymentPluginTomcat.class); + + private final IHTTPService httpService; + + @Inject + public ManagementBusDeploymentPluginTomcat(IHTTPService httpService) { + this.httpService = httpService; + } + + @Override + public Exchange invokeImplementationArtifactDeployment(final Exchange exchange) { + + LOG.debug("Trying to deploy IA on Tomcat."); + final Message message = exchange.getIn(); + @SuppressWarnings("unchecked") final List artifactReferences = + message.getHeader(MBHeader.ARTIFACTREFERENCES_LISTSTRING.toString(), List.class); + + // get URL of the WAR-File that has to be deployed + final URL warURL = getWARFileReference(artifactReferences); + if (warURL == null) { + LOG.error("Deployment failed: no referenced WAR-File found"); + message.setHeader(MBHeader.ENDPOINT_URI.toString(), null); + return exchange; + } + + // get the WAR artifact as file + final File warFile = getWarFile(warURL); + if (warFile == null) { + LOG.error("Deployment failed: unable to retrieve WAR-File from URL"); + message.setHeader(MBHeader.ENDPOINT_URI.toString(), null); + return exchange; + } + + // get file name of the WAR-File + final String fileName = FilenameUtils.getBaseName(warURL.getPath()); + // retrieve ServiceEndpoint property from exchange headers + final String endpointSuffix = + message.getHeader(MBHeader.ARTIFACTSERVICEENDPOINT_STRING.toString(), "", String.class); + + if (endpointSuffix.equals("")) { + LOG.info("No endpoint suffix defined."); + } else { + LOG.info("Endpoint suffix from header: {}", endpointSuffix); + } + + // if placeholder is defined the deployment is done in the topology + final String placeholderBegin = "/PLACEHOLDER_"; + final String placeholderEnd = "_PLACEHOLDER/"; + String endpoint = null; + if (endpointSuffix.toString().contains(placeholderBegin) + && endpointSuffix.toString().contains(placeholderEnd)) { + + // just return a created endpoint and do not perform deployment + final String placeholder = + endpointSuffix.substring(endpointSuffix.indexOf(placeholderBegin), + endpointSuffix.indexOf(placeholderEnd) + placeholderEnd.length()); + + LOG.info("Placeholder defined: {}. Deployment is done as part of the topology and not on the management infrastructure. ", + placeholder); + + final String endpointBegin = endpointSuffix.substring(0, endpointSuffix.indexOf(placeholderBegin)); + final String endpointEnd = + endpointSuffix.substring(endpointSuffix.lastIndexOf(placeholderEnd) + placeholderEnd.length()); + + // We assume that the WAR-File in the topology is deployed at the default port + // 8080 and only with the file name as path. Find a better solution which looks + // into the topology and determines the correct endpoint. + endpoint = endpointBegin + placeholder + ":8080/" + fileName + "/" + endpointEnd; + } else { + + // check if Tomcat is running to continue deployment + if (!isRunning()) { + LOG.error("Deployment failed: Tomcat is not running or can´t be accessed"); + message.setHeader(MBHeader.ENDPOINT_URI.toString(), null); + return exchange; + } + LOG.info("Tomcat is running and can be accessed."); + + final QName typeImplementation = + message.getHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), QName.class); + + final String triggeringContainer = + message.getHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), String.class); + + // perform deployment on management infrastructure + endpoint = deployWAROnTomcat(warFile, triggeringContainer, typeImplementation, fileName); + + if (endpoint != null) { + // add endpoint suffix to endpoint of deployed WAR + endpoint = endpoint.concat(endpointSuffix); + LOG.info("Complete endpoint of IA {}: {}", fileName, endpoint); + } + } + + // delete the temporary file + // it's not terrible if we don't get to clean this up, it will be deleted once the JVM terminates or we overwrite it + warFile.delete(); + + // set endpoint and pass camel exchange back to caller + message.setHeader(MBHeader.ENDPOINT_URI.toString(), getURI(endpoint)); + return exchange; + } + + @Override + public Exchange invokeImplementationArtifactUndeployment(final Exchange exchange) { + LOG.debug("Trying to undeploy IA from Tomcat."); + final Message message = exchange.getIn(); + // set operation state to false and only change after successful undeployment + message.setHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), false); + // get endpoint from header to calculate deployment path + final URI endpointURI = message.getHeader(MBHeader.ENDPOINT_URI.toString(), URI.class); + + if (endpointURI == null) { + LOG.error("No endpoint defined. Undeployment not possible!"); + return exchange; + } + + final String endpoint = endpointURI.toString(); + LOG.debug("Endpoint for undeployment: {}", endpoint); + // delete Tomcat URL prefix from endpoint + String deployPath = endpoint.replace(Settings.ENGINE_IA_TOMCAT_URL, ""); + // delete ServiceEndpoint suffix from endpoints + deployPath = deployPath.substring(0, StringUtils.ordinalIndexOf(deployPath, "/", 4)); + + // command to perform deployment on Tomcat from local file + final String undeploymentURL = Settings.ENGINE_IA_TOMCAT_URL + "/manager/text/undeploy?path=" + deployPath; + LOG.debug("Undeployment command: {}", undeploymentURL); + + try { + // perform undeployment request on Tomcat + final HttpResponse httpResponse = this.httpService.Get(undeploymentURL, Settings.ENGINE_IA_TOMCAT_USERNAME, Settings.ENGINE_IA_TOMCAT_PASSWORD); + final String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"); + + LOG.debug("Tomcat response: {}", response); + + // check if WAR-File was undeployed successfully + if (response.contains("OK - Undeployed application at context path [" + deployPath + "]")) { + LOG.debug("IA successfully undeployed from Tomcat!"); + message.setHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), true); + } else { + LOG.error("Undeployment not successfully!"); + } + } catch (final IOException e) { + LOG.error("IOException occured while undeploying the WAR-File: {}!", e); + } + return exchange; + } + + @Override + /** + * {@inheritDoc} + */ + public List getSupportedTypes() { + LOG.debug("Getting Types: {}.", TYPES); + final List types = new ArrayList<>(); + + for (final String type : TYPES.split("[,;]")) { + types.add(type.trim()); + } + return types; + } + + @Override + /** + * {@inheritDoc} + */ + public List getCapabilties() { + LOG.debug("Getting Plugin-Capabilities: {}.", CAPABILITIES); + final List capabilities = new ArrayList<>(); + + for (final String capability : CAPABILITIES.split("[,;]")) { + capabilities.add(capability.trim()); + } + return capabilities; + } + + /** + * Check if the Tomcat which is references as the IA-engine in the container config.ini is running. + * + * @return true if Tomcat is running and can be accessed, false otherwise + */ + private boolean isRunning() { + LOG.info("Checking if Tomcat is running on {} and can be accessed...", + Settings.ENGINE_IA_TOMCAT_URL); + + // URL to get serverinfo from Tomcat + final String url = Settings.ENGINE_IA_TOMCAT_URL + "/manager/text/serverinfo"; + + // execute HTPP GET on URL and check the response + try { + final HttpResponse httpResponse = this.httpService.Get(url, Settings.ENGINE_IA_TOMCAT_USERNAME, Settings.ENGINE_IA_TOMCAT_PASSWORD); + final String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"); + + LOG.debug(response); + if (response.contains("OK - Server info")) { + return true; + } + } catch (final Exception e) { + LOG.error("Error while checking for availability of the Tomcat: {}", + e.getMessage()); + } + return false; + } + + /** + * Check if the artifact references contain a WAR-File and return the URL to the file if so. + * + * @param artifactReferences the references to check if a WAR-File is available + * @return the URL to the file or null if no file is found + */ + private URL getWARFileReference(final List artifactReferences) { + LOG.info("Searching for a reference to a WAR-File..."); + + if (artifactReferences == null) { + return null; + } + for (final String reference : artifactReferences) { + // check if reference targets a WAR-File + if (reference.toLowerCase().endsWith(".war")) { + LOG.info("Found WAR-File reference: {}", reference); + try { + return new URL(reference); + } catch (final MalformedURLException e) { + LOG.error("Failed to convert the reference to a URL: {}", + e.getMessage()); + } + } + } + return null; + } + + /** + * Retrieve the WAR-File from the given URL and store it as local temp file. + * + * @param warURL the URL to the WAR-File that shall be retrieved + * @return the file if retrieval was successful, null otherwise + */ + private File getWarFile(final URL warURL) { + LOG.info("Trying to retrieve WAR-File from URL: {}", warURL); + + if (warURL == null) { + return null; + } + try { + // store WAR artifact as temporary file + final File tempFile = File.createTempFile("Artifact", ".war"); + tempFile.deleteOnExit(); + FileUtils.copyURLToFile(warURL, tempFile); + return tempFile; + } catch (final IOException e) { + LOG.error("Failed to retrieve WAR-File: {}", e.getMessage()); + } + return null; + } + + /** + * Deploy the given WAR-File on the Tomcat. As path on Tomcat the host name of the triggering OpenTOSCA Container + * and the NodeTypeImplementation with removed special characters (except '-' and '_') concatenated with the name of + * the WAR-File (without ".war") is used: + * /[Container-Hostname]/[TypeImplementationID]/[File-Name] + * + * @param warFile the WAR artifact that has to be deployed + * @param triggeringContainer the host name of the OpenTOSCA Container that triggered the IA deployment + * @param typeImplementation the NodeTypeImplementation or RelationshipTypeImplementation which is used to create a + * unique path where the WAR is deployed + * @param fileName the file name which is part of the deployment path + */ + private String deployWAROnTomcat(final File warFile, final String triggeringContainer, + final QName typeImplementation, final String fileName) { + + if (triggeringContainer == null) { + LOG.warn("Triggering Container host name is null. Deployment aborted because it is part of the deployment path on Tomcat"); + return null; + } + if (typeImplementation == null) { + LOG.warn("NodeTypeImplementation ID is null. Deployment aborted because the ID is part of the deployment path on Tomcat"); + return null; + } + // path where the WAR is deployed on the Tomcat + final String deployPath = "/" + getConvertedString(triggeringContainer) + "/" + + getConvertedString(typeImplementation.toString()) + "/" + fileName; + + // command to perform deployment on Tomcat from local file + final String deploymentURL = + Settings.ENGINE_IA_TOMCAT_URL + "/manager/text/deploy?update=true&path=" + deployPath; + + // create HttpEntity which contains the WAR-File + final MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); + final FileBody fileBody = new FileBody(warFile); + builder.addPart(fileName + ".war", fileBody); + final HttpEntity entity = builder.build(); + + try { + // perform deployment request on Tomcat + final HttpResponse httpResponse = + this.httpService.Put(deploymentURL, entity, Settings.ENGINE_IA_TOMCAT_USERNAME, + Settings.ENGINE_IA_TOMCAT_PASSWORD); + + final String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"); + + LOG.info("Tomcat response to deployment request: {}", response); + + // check if WAR-File was deployed successfully. + if (response.contains("OK - Deployed application at context path " + deployPath) + || response.contains("OK - Deployed application at context path [" + deployPath + "]")) { + LOG.info("Deployment was successful."); + + // concatenate service endpoint + String endpoint = Settings.ENGINE_IA_TOMCAT_URL + deployPath; + LOG.info("Endpoint of deployed service: {}", endpoint); + return endpoint; + } else { + LOG.error("Deployment was not successful."); + } + } catch (final IOException e) { + LOG.error("IOException occured while deploying the WAR-File: {}!", + e); + } + return null; + } + + /** + * Remove invalid characters from the provided String. + * + * @param string the String to convert + * @return String with replaced '.' by "-" and removed remaining special characters (except '-' and '_'). + */ + private String getConvertedString(final String string) { + LOG.debug("Converting String: {}", string); + + // replace '.' by '-' to leave IPs unique + String convertedString = string.replace(".", "-"); + // remove all special characters except '-' and '_' + convertedString = convertedString.replaceAll("[^-a-zA-Z0-9_]", ""); + LOG.debug("Converted string: {}", convertedString); + return convertedString; + } + + /** + * Convert a String to an URI + * + * @param string the String that has to be converted to URI + * @return URI representation of the String if convertible, null otherwise + */ + private URI getURI(final String string) { + if (string != null) { + try { + return new URI(string); + } catch (final URISyntaxException e) { + LOG.error("Failed to transform String to URI: {} ", string); + } + } + return null; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/src/main/resources/spring/context-bus-deployment-plugin.xml b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/src/main/resources/spring/context-bus-deployment-plugin.xml new file mode 100644 index 000000000..12b69949d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin.tomcat/src/main/resources/spring/context-bus-deployment-plugin.xml @@ -0,0 +1,17 @@ + + + + Register the beans within the tomcat management bus deployment plugin. + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin/pom.xml new file mode 100644 index 000000000..603a6bc5a --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.deployment.plugin + + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.apache.camel + camel-core + 2.18.3 + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin/src/main/java/org/opentosca/bus/management/deployment/plugin/IManagementBusDeploymentPluginService.java b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin/src/main/java/org/opentosca/bus/management/deployment/plugin/IManagementBusDeploymentPluginService.java new file mode 100644 index 000000000..c4a3c7d28 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.deployment.plugin/src/main/java/org/opentosca/bus/management/deployment/plugin/IManagementBusDeploymentPluginService.java @@ -0,0 +1,53 @@ +package org.opentosca.bus.management.deployment.plugin; + +import java.util.List; + +import org.apache.camel.Exchange; +import org.opentosca.bus.management.header.MBHeader; + +/** + * Interface of the Management Bus Deployment Plug-ins.
+ *
+ *

+ * Copyright 2018 IAAS University of Stuttgart
+ *
+ *

+ * The interface specifies four methods. One for invoking the deployment of an Implementation Artifact, another for + * invoking the undeployment of a previously deployed Implementation Artifact and two methods that return the supported + * deployment types and the capabilities of the specific plug-in. + */ +public interface IManagementBusDeploymentPluginService { + + /** + * Invokes the deployment of an Implementation Artifact. + * + * @param exchange contains all needed information like the NodeTypeImplementation the ArtifactReferences to the + * files that have to be deployed and the "ServiceEndpoint" property if it is defined. + * @return the endpoint of the deployed Implementation Artifact as header field (see {@link MBHeader#ENDPOINT_URI}) + * of the exchange message or null if the deployment failed. + */ + public Exchange invokeImplementationArtifactDeployment(Exchange exchange); + + /** + * Invokes the undeployment of an Implementation Artifact. + * + * @param exchange contains all needed information like the endpoint of the deployed Implementation Artifact. + * @return the result of the undeployment process as header field (see {@link MBHeader#OPERATIONSTATE_BOOLEAN}) of + * the exchange message. + */ + public Exchange invokeImplementationArtifactUndeployment(Exchange exchange); + + /** + * Returns the supported deployment-types of the plug-in. + * + * @return list of strings each representing one supported deployment type of the plug-in. + */ + public List getSupportedTypes(); + + /** + * Returns the provided capabilities of the plug-in. + * + * @return list of strings each representing one capability of the plug-in. + */ + public List getCapabilties(); +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/pom.xml new file mode 100644 index 000000000..4cf7f4420 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.invocation.plugin.remote + + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.apache.camel + camel-core + 2.18.3 + + + org.opentosca + org.opentosca.bus.management.invocation.plugin + ${project.version} + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + + diff --git a/org.opentosca.bus.management.invocation.plugin.remote/src/org/opentosca/bus/management/invocation/plugin/remote/ManagementBusInvocationPluginRemote.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/src/main/java/org/opentosca/bus/management/invocation/plugin/remote/ManagementBusInvocationPluginRemote.java similarity index 87% rename from org.opentosca.bus.management.invocation.plugin.remote/src/org/opentosca/bus/management/invocation/plugin/remote/ManagementBusInvocationPluginRemote.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/src/main/java/org/opentosca/bus/management/invocation/plugin/remote/ManagementBusInvocationPluginRemote.java index fdda3937d..669567725 100644 --- a/org.opentosca.bus.management.invocation.plugin.remote/src/org/opentosca/bus/management/invocation/plugin/remote/ManagementBusInvocationPluginRemote.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/src/main/java/org/opentosca/bus/management/invocation/plugin/remote/ManagementBusInvocationPluginRemote.java @@ -6,6 +6,7 @@ import java.util.Map.Entry; import java.util.Objects; +import javax.inject.Inject; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -23,23 +24,31 @@ import org.opentosca.bus.management.service.impl.collaboration.model.RemoteOperations; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; import org.w3c.dom.Document; import org.w3c.dom.Element; /** * Management Bus-Plug-in for invoking an IA on a remote OpenTOSCA Container.
*
- * - * The plug-in gets all needed information for the invocation and forwards it to the remote - * Container over MQTT. When it gets the response, it copies the result body to the exchange and - * returns it to the Management Bus. - * + *

+ * The plug-in gets all needed information for the invocation and forwards it to the remote Container over MQTT. When it + * gets the response, it copies the result body to the exchange and returns it to the Management Bus. + *

* Copyright 2018 IAAS University of Stuttgart */ +@Service public class ManagementBusInvocationPluginRemote implements IManagementBusInvocationPluginService { final private static Logger LOG = LoggerFactory.getLogger(ManagementBusInvocationPluginRemote.class); + private final RequestSender requestSender; + + @Inject + public ManagementBusInvocationPluginRemote(RequestSender requestSender) { + this.requestSender = requestSender; + } + @Override public Exchange invoke(final Exchange exchange) { @@ -55,8 +64,7 @@ public Exchange invoke(final Exchange exchange) { final CollaborationMessage request = new CollaborationMessage(new KeyValueMap(), requestBody); // perform remote IA operation - final Exchange responseExchange = - RequestSender.sendRequestToRemoteContainer(message, RemoteOperations.INVOKE_IA_OPERATION, request, 0); + final Exchange responseExchange = requestSender.sendRequestToRemoteContainer(message, RemoteOperations.INVOKE_IA_OPERATION, request, 0); LOG.debug("Received a response for the invocation request!"); @@ -107,8 +115,7 @@ public Exchange invoke(final Exchange exchange) { document.appendChild(element); message.setBody(document, Document.class); - } - catch (final Exception e) { + } catch (final Exception e) { LOG.error("Unable to parse Document: {}", e.getMessage()); } } else { @@ -122,19 +129,18 @@ public Exchange invoke(final Exchange exchange) { @Override public List getSupportedTypes() { - // This plug-in supports only the special type 'remote' which is used to forward invocation // requests to other OpenTOSCA Containers. return Collections.singletonList(Constants.REMOTE_TYPE); } /** - * Reads the input parameters of the invocation from the exchange body and adds them to a - * IAInvocationRequest object. + * Reads the input parameters of the invocation from the exchange body and adds them to a IAInvocationRequest + * object. * * @param body the body of the exchange containing the invocation request - * @return IAInvocationRequest object with given parameters in the Doc or Params element, if input - * parameters are given as Hash Map or as Document. + * @return IAInvocationRequest object with given parameters in the Doc or Params element, if input parameters are + * given as Hash Map or as Document. */ private IAInvocationRequest parseBodyToInvocationRequest(final Object body) { @@ -145,8 +151,7 @@ private IAInvocationRequest parseBodyToInvocationRequest(final Object body) { if (body instanceof HashMap) { LOG.debug("Adding input params from incoming HashMap to the request."); - @SuppressWarnings("unchecked") - final HashMap paramsMap = (HashMap) body; + @SuppressWarnings("unchecked") final HashMap paramsMap = (HashMap) body; final KeyValueMap invocationRequestMap = new KeyValueMap(); final List invocationRequestPairs = invocationRequestMap.getKeyValuePair(); diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/src/main/resources/spring/context-bus-invocation-plugin.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/src/main/resources/spring/context-bus-invocation-plugin.xml new file mode 100644 index 000000000..116ad6326 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.remote/src/main/resources/spring/context-bus-invocation-plugin.xml @@ -0,0 +1,17 @@ + + + + Register the beans within the remote management bus invocation plugin. + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/pom.xml new file mode 100644 index 000000000..9405e558b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.invocation.plugin.rest + + + + org.apache.camel + camel-core + ${camel.version} + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.opentosca + org.opentosca.bus.management.invocation.plugin + ${project.version} + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/ManagementBusInvocationPluginRest.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/ManagementBusInvocationPluginRest.java new file mode 100644 index 000000000..53827e394 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/ManagementBusInvocationPluginRest.java @@ -0,0 +1,462 @@ +package org.opentosca.bus.management.invocation.plugin.rest; + +import java.io.StringReader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import com.google.gson.JsonObject; +import org.apache.camel.CamelContext; +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.ProducerTemplate; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; +import org.opentosca.bus.management.invocation.plugin.rest.model.ContentType; +import org.opentosca.bus.management.invocation.plugin.rest.model.DataAssign; +import org.opentosca.bus.management.invocation.plugin.rest.model.DataAssign.Operations.Operation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.traversal.DocumentTraversal; +import org.w3c.dom.traversal.NodeFilter; +import org.w3c.dom.traversal.NodeIterator; +import org.xml.sax.InputSource; + +/** + * Management Bus-Plug-in for invoking a service over HTTP.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * The Plug-in gets needed information (like endpoint of the service or operation to invoke) from the Management Bus and + * creates a HTTP message out of it. The Plug-in supports the transfer of parameters via queryString (both in the URL + * and the body) and xml formatted in the body. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @author Christian Endres - christian.endres@iaas.informatik.uni-stuttgart.de + */ +@Component +public class ManagementBusInvocationPluginRest implements IManagementBusInvocationPluginService { + final private static Logger LOG = LoggerFactory.getLogger(ManagementBusInvocationPluginRest.class); + + // Supported types defined in messages.properties. + private static final String TYPES = "REST"; + // Default Values of specific content + private static final String PARAMS = "queryString"; + private static final String ENDPOINT = "no"; + private static final String CONTENTTYPE = "urlencoded"; + private static final String METHOD = "POST"; + + private final CamelContext camelContext; + + @Inject + public ManagementBusInvocationPluginRest(@Named("fallback") CamelContext camelContext) { + this.camelContext = camelContext; + } + + @SuppressWarnings("unchecked") + @Override + public Exchange invoke(Exchange exchange) { + final Message message = exchange.getIn(); + final Object params = message.getBody(); + final String endpoint = message.getHeader(MBHeader.ENDPOINT_URI.toString(), String.class); + + LOG.debug("Invoke REST call at {}.", endpoint); + final Map paramsMap; + if (params instanceof HashMap) { + paramsMap = (HashMap) params; + } else { + LOG.error("Cannot map parameters to a map."); + return null; + } + + final Document specificContent = message.getHeader(MBHeader.SPECIFICCONTENT_DOCUMENT.toString(), Document.class); + final Document paramsDoc = null; + DataAssign dataAssign = null; + if (specificContent != null) { + LOG.debug("Unmarshalling provided artifact specific content."); + dataAssign = unmarshall(specificContent); + } + + final String operationName = message.getHeader(MBHeader.OPERATIONNAME_STRING.toString(), String.class); + final String interfaceName = message.getHeader(MBHeader.INTERFACENAME_STRING.toString(), String.class); + Operation operation = null; + final boolean isDoc = false; + if (dataAssign != null) { + LOG.debug("Searching for correct operation."); + operation = getOperation(dataAssign, operationName, interfaceName); + } + + final Map headers = new HashMap<>(); + headers.put(Exchange.HTTP_URI, endpoint); + headers.put(Exchange.HTTP_METHOD, this.METHOD); + headers.put(Exchange.CONTENT_TYPE, "application/json"); + + final ContentType contentTypeParam = ContentType.JSON; + + LOG.debug("ParamsParam set: params into payload."); + + // ...as xml + final Object body; + if (contentTypeParam != null && !contentTypeParam.value().equalsIgnoreCase(this.CONTENTTYPE)) { + LOG.debug("ContenttypeParam set: params into payload as {}.", contentTypeParam); + body = mapToJSON(paramsMap); + } else { + // ...as urlencoded String + LOG.debug("Params into payload as urlencoded String."); + if (paramsDoc != null || paramsMap != null) { + final String queryString = getQueryString(paramsDoc, paramsMap); + body = queryString; + } else { + body = null; + } + } + + final ProducerTemplate template = camelContext.createProducerTemplate(); + // the dummyhost uri is ignored, so this is ugly but intended + + // deployment of plan may be not finished at this point, thus, poll for successful invocation + String responseString = null; + final long maxWaitTime = 5000; + final long startMillis = System.currentTimeMillis(); + do { + + try { + responseString = template.requestBodyAndHeaders("http://dummyhost", body, headers, String.class); + } catch (final Exception e) { + } + LOG.trace(responseString); + + if (null != responseString) { + break; + } else if (System.currentTimeMillis() - startMillis > maxWaitTime) { + final String str = "Wait time exceeded, stop waiting for response of operation."; + LOG.error(str + "\n" + responseString); + } else { + LOG.trace("Waiting for being able to invoke Camunda BPMN plan for at most " + + (maxWaitTime - System.currentTimeMillis() + startMillis) / 1000 + " seconds."); + } + + try { + Thread.sleep(1000); + } catch (final InterruptedException e) { + e.printStackTrace(); + } + } while (null == responseString); + LOG.info("Response of the REST call: " + responseString); + + return createResponseExchange(exchange, responseString, operationName, isDoc); + } + + private Object mapToJSON(final Map paramsMap) { + final JsonObject vars = new JsonObject(); + for (final String key : paramsMap.keySet()) { + final JsonObject details = new JsonObject(); + details.addProperty("value", paramsMap.get(key)); + details.addProperty("type", "String"); + vars.add(key, details); + } + final JsonObject variables = new JsonObject(); + variables.add("variables", vars); + LOG.debug("JSON request body: {}", variables.toString()); + return variables.toString(); + } + + /** + * Returns the created queryString. + * + * @param paramsDoc to create queryString from. + * @param paramsMap to create queryString from. + * @return created queryString + */ + private String getQueryString(final Document paramsDoc, Map paramsMap) { + LOG.debug("Creating queryString..."); + if (paramsDoc != null) { + paramsMap = docToMap(paramsDoc); + } + final String queryString = mapToQueryString(paramsMap); + LOG.debug("Created queryString: {}", queryString); + return queryString; + } + + /** + * Generates the queryString from the given params HashMap. + * + * @param params to generate the queryString from. + * @return the queryString. + */ + private String mapToQueryString(final Map params) { + LOG.debug("Transfering the map: {} into a queryString...", params); + final StringBuilder query = new StringBuilder(); + for (final Entry entry : params.entrySet()) { + query.append(entry.getKey()).append("=").append(entry.getValue()).append("&"); + } + // remove last "&" + final int length = query.length(); + if (length > 0) { + query.deleteCharAt(length - 1); + } + return query.toString(); + } + + /** + * Transfers the given string (if it is valid xml) into Document. * + * + * @param string to generate Document from. + * @return Document or null if string wasn't valid xml. + */ + private Document stringToDoc(final String string) { + final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder; + Document doc = null; + try { + builder = factory.newDocumentBuilder(); + doc = builder.parse(new InputSource(new StringReader(string))); + } catch (final Exception e) { + LOG.debug("Response isn't xml."); + return null; + } + return doc; + } + + /** + * Transfers the given string (if it is a valid queryString) into a HashMap. + * + * @param queryString to generate the map from. + * @return HashMap or null if string wasn't a valid queryString. + */ + private Map queryStringToMap(final String queryString) { + LOG.debug("Transfering the queryString: {} into a HashMap...", queryString); + final String[] params = queryString.split("&"); + final Map map = new HashMap<>(); + for (final String param : params) { + try { + final String name = param.split("=")[0]; + final String value = param.split("=")[1]; + if (name.matches("\\w+")) { + map.put(name, value); + } + } catch (final IndexOutOfBoundsException e) { + LOG.debug("Response isn't queryString."); + return null; + } + } + LOG.debug("Transfered HashMap: {}", map.toString()); + return map; + } + + /** + * Returns the http path that will be concatenated to the endpoint. + * + * @return http path. + */ + private String getHttpPath(final Operation operation) { + final StringBuilder httpPath = new StringBuilder(); + final String intName = operation.getInterfaceName(); + final String opName = operation.getName(); + if (intName != null) { + httpPath.append(intName); + } + if (opName != null) { + if (intName != null) { + httpPath.append("/"); + } + httpPath.append(opName); + } + return httpPath.toString(); + } + + /** + * Searches for the correct operation of the artifact specific content. + * + * @param dataAssign containing all operations. + * @param operationName that will be searched for. + * @param interfaceName that will be searched for. + * @return matching operation. + */ + private Operation getOperation(final DataAssign dataAssign, final String operationName, + final String interfaceName) { + final List operations = dataAssign.getOperations().getOperation(); + for (final Operation op : operations) { + final String provOpName = op.getName(); + final String provIntName = op.getInterfaceName(); + LOG.debug("Provided operation name: {}. Needed: {}", provOpName, operationName); + LOG.debug("Provided interface name: {}. Needed: {}", provIntName, interfaceName); + if (op.getName() == null && op.getInterfaceName() == null) { + LOG.debug("Operation found. No operation name nor interfaceName is specified meaning this IA implements just one operation or the provided information count for all implemented operations."); + return op; + } else if (op.getName() != null && op.getName().equalsIgnoreCase(operationName)) { + if (op.getInterfaceName() == null || interfaceName == null) { + LOG.debug("Operation found. No interfaceName specified."); + return op; + } else if (op.getInterfaceName().equalsIgnoreCase(interfaceName)) { + LOG.debug("Operation found. Interface name matches too."); + return op; + } + } else if (op.getInterfaceName() != null && op.getName() == null + && op.getInterfaceName().equalsIgnoreCase(interfaceName)) { + LOG.debug("Operation found. Provided information count for all operations of the specified interface."); + return op; + } + } + return null; + } + + /** + * Transfers the document to a map. + * + * @param doc to be transfered to a map. + * @return transfered map. + */ + private Map docToMap(final Document doc) { + final Map map = new HashMap<>(); + + final DocumentTraversal traversal = (DocumentTraversal) doc; + final NodeIterator iterator = traversal.createNodeIterator(doc.getDocumentElement(), NodeFilter.SHOW_ELEMENT, null, true); + + for (Node node = iterator.nextNode(); node != null; node = iterator.nextNode()) { + final String name = ((Element) node).getTagName(); + final StringBuilder content = new StringBuilder(); + final NodeList children = node.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + final Node child = children.item(i); + if (child.getNodeType() == Node.TEXT_NODE) { + content.append(child.getTextContent()); + } + } + if (!content.toString().trim().isEmpty()) { + map.put(name, content.toString()); + } + } + return map; + } + + /** + * Transfers the paramsMap into a Document. + * + * @param operationName as root element. + * @return the created Document. + */ + private Document mapToDoc(final String operationName, final Map paramsMap) { + Document document; + final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + final DocumentBuilder documentBuilder; + try { + documentBuilder = documentBuilderFactory.newDocumentBuilder(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + return null; + } + document = documentBuilder.newDocument(); + + final Element rootElement = document.createElement(operationName); + document.appendChild(rootElement); + for (final Entry entry : paramsMap.entrySet()) { + final Element mapElement = document.createElement(entry.getKey()); + mapElement.setTextContent(entry.getValue()); + rootElement.appendChild(mapElement); + } + return document; + } + + /** + * Alters the exchange with the response of the invoked service depending of the type of the body. + * + * @param exchange to be altered. + * @param responseString containing the response of the invoked service. + * @return exchange with response of the invokes service as body. + * @TODO: Response handling is a bit hacky. Should be updated sometime to determine the response type with + * content-type header. + */ + private Exchange createResponseExchange(final Exchange exchange, final String responseString, + final String operationName, final boolean isDoc) { + LOG.debug("Handling the response: {}.", responseString); + Document responseDoc = stringToDoc(responseString); + + // response was xml + if (responseDoc != null) { + LOG.debug("Reponse is xml formatted."); + if (isDoc) { + LOG.debug("Returning response xml formatted.."); + exchange.getIn().setBody(responseDoc); + } else { + LOG.debug("Transfering xml response into a Hashmap..."); + Map responseMap = docToMap(responseDoc); + LOG.debug("Returning response as HashMap."); + exchange.getIn().setBody(responseMap); + } + } else { + // response should be queryString + Map responseMap = queryStringToMap(responseString); + if (responseMap == null || responseMap.isEmpty()) { + LOG.debug("Response isn't neihter xml nor queryString. Returning the reponse: {} as string.", + responseString); + exchange.getIn().setBody(responseString); + } else if (isDoc) { + LOG.debug("Transfering response into xml..."); + responseDoc = mapToDoc(operationName, responseMap); + exchange.getIn().setBody(responseDoc); + } else { + LOG.debug("Returning response as HashMap."); + exchange.getIn().setBody(responseMap); + } + } + + return exchange; + } + + /** + * Unmarshalls the provided artifact specific content. + * + * @param doc to unmarshall. + * @return DataAssign object. + */ + private DataAssign unmarshall(final Document doc) { + + final NodeList nodeList = + doc.getElementsByTagNameNS("http://www.siengine.restplugin.org/SpecificContentRestSchema", "DataAssign"); + + final Node node = nodeList.item(0); + try { + final JAXBContext jc = JAXBContext.newInstance("org.opentosca.bus.management.plugins.rest.service.impl.model"); + final Unmarshaller unmarshaller = jc.createUnmarshaller(); + final DataAssign dataAssign = (DataAssign) unmarshaller.unmarshal(node); + + LOG.debug("Artifact specific content successfully unmarshalled."); + return dataAssign; + } catch (final JAXBException e) { + LOG.warn("Couldn't unmarshall provided artifact specific content!"); + e.printStackTrace(); + } + LOG.debug("No unmarshallable artifact specific content provided. Using default values now."); + return null; + } + + @Override + public List getSupportedTypes() { + LOG.debug("Getting Types: {}.", ManagementBusInvocationPluginRest.TYPES); + final List types = new ArrayList<>(); + + for (final String type : ManagementBusInvocationPluginRest.TYPES.split("[,;]")) { + types.add(type.trim()); + } + return types; + } +} diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ContentType.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ContentType.java similarity index 99% rename from org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ContentType.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ContentType.java index 87e317a3a..9ea543acc 100644 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ContentType.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ContentType.java @@ -6,14 +6,12 @@ // Generated on: 2013.07.29 at 03:39:23 PM MESZ // - package org.opentosca.bus.management.invocation.plugin.rest.model; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for ContentType. @@ -30,7 +28,6 @@ * </restriction> * </simpleType> * - * */ @XmlType(name = "ContentType") @XmlEnum @@ -58,5 +55,4 @@ public static ContentType fromValue(final String v) { } throw new IllegalArgumentException(v); } - } diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/DataAssign.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/DataAssign.java similarity index 95% rename from org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/DataAssign.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/DataAssign.java index 9848d4964..c61a1b4b8 100644 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/DataAssign.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/DataAssign.java @@ -6,7 +6,6 @@ // Generated on: 2013.07.29 at 03:39:23 PM MESZ // - package org.opentosca.bus.management.invocation.plugin.rest.model; import java.util.ArrayList; @@ -19,7 +18,6 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for anonymous complex type. @@ -63,8 +61,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {"operations"}) @@ -78,7 +74,6 @@ public class DataAssign { * Gets the value of the operations property. * * @return possible object is {@link DataAssign.Operations } - * */ public DataAssign.Operations getOperations() { return this.operations; @@ -88,13 +83,11 @@ public DataAssign.Operations getOperations() { * Sets the value of the operations property. * * @param value allowed object is {@link DataAssign.Operations } - * */ public void setOperations(final DataAssign.Operations value) { this.operations = value; } - /** *

* Java class for anonymous complex type. @@ -128,8 +121,6 @@ public void setOperations(final DataAssign.Operations value) { * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {"operation"}) @@ -142,9 +133,9 @@ public static class Operations { * Gets the value of the operation property. * *

- * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the operation property. + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the operation property. * *

* For example, to add a new item, do as follows: @@ -156,8 +147,6 @@ public static class Operations { * *

* Objects of the following type(s) are allowed in the list {@link DataAssign.Operations.Operation } - * - * */ public List getOperation() { if (this.operation == null) { @@ -166,7 +155,6 @@ public List getOperation() { return this.operation; } - /** *

* Java class for anonymous complex type. @@ -190,8 +178,6 @@ public List getOperation() { * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {"endpoint", "params", "contentType", "methode"}) @@ -214,7 +200,6 @@ public static class Operation { * Gets the value of the endpoint property. * * @return possible object is {@link EndpointType } - * */ public EndpointType getEndpoint() { return this.endpoint; @@ -224,7 +209,6 @@ public EndpointType getEndpoint() { * Sets the value of the endpoint property. * * @param value allowed object is {@link EndpointType } - * */ public void setEndpoint(final EndpointType value) { this.endpoint = value; @@ -234,7 +218,6 @@ public void setEndpoint(final EndpointType value) { * Gets the value of the params property. * * @return possible object is {@link ParamsType } - * */ public ParamsType getParams() { return this.params; @@ -244,7 +227,6 @@ public ParamsType getParams() { * Sets the value of the params property. * * @param value allowed object is {@link ParamsType } - * */ public void setParams(final ParamsType value) { this.params = value; @@ -254,7 +236,6 @@ public void setParams(final ParamsType value) { * Gets the value of the contentType property. * * @return possible object is {@link ContentType } - * */ public ContentType getContentType() { return this.contentType; @@ -264,7 +245,6 @@ public ContentType getContentType() { * Sets the value of the contentType property. * * @param value allowed object is {@link ContentType } - * */ public void setContentType(final ContentType value) { this.contentType = value; @@ -274,7 +254,6 @@ public void setContentType(final ContentType value) { * Gets the value of the methode property. * * @return possible object is {@link MethodeType } - * */ public MethodeType getMethode() { return this.methode; @@ -284,7 +263,6 @@ public MethodeType getMethode() { * Sets the value of the methode property. * * @param value allowed object is {@link MethodeType } - * */ public void setMethode(final MethodeType value) { this.methode = value; @@ -294,7 +272,6 @@ public void setMethode(final MethodeType value) { * Gets the value of the name property. * * @return possible object is {@link String } - * */ public String getName() { return this.name; @@ -304,7 +281,6 @@ public String getName() { * Sets the value of the name property. * * @param value allowed object is {@link String } - * */ public void setName(final String value) { this.name = value; @@ -314,7 +290,6 @@ public void setName(final String value) { * Gets the value of the interfaceName property. * * @return possible object is {@link String } - * */ public String getInterfaceName() { return this.interfaceName; @@ -324,14 +299,10 @@ public String getInterfaceName() { * Sets the value of the interfaceName property. * * @param value allowed object is {@link String } - * */ public void setInterfaceName(final String value) { this.interfaceName = value; } - } - } - } diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/EndpointType.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/EndpointType.java similarity index 99% rename from org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/EndpointType.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/EndpointType.java index 9eed0afac..1f693e4b8 100644 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/EndpointType.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/EndpointType.java @@ -6,14 +6,12 @@ // Generated on: 2013.07.29 at 03:39:23 PM MESZ // - package org.opentosca.bus.management.invocation.plugin.rest.model; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for EndpointType. @@ -30,7 +28,6 @@ * </restriction> * </simpleType> * - * */ @XmlType(name = "EndpointType") @XmlEnum @@ -57,5 +54,4 @@ public static EndpointType fromValue(final String v) { } throw new IllegalArgumentException(v); } - } diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/MethodeType.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/MethodeType.java similarity index 99% rename from org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/MethodeType.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/MethodeType.java index 0fd8dfd57..f5caad058 100644 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/MethodeType.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/MethodeType.java @@ -6,13 +6,11 @@ // Generated on: 2013.07.29 at 03:39:23 PM MESZ // - package org.opentosca.bus.management.invocation.plugin.rest.model; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for MethodeType. @@ -29,7 +27,6 @@ * </restriction> * </simpleType> * - * */ @XmlType(name = "MethodeType") @XmlEnum @@ -44,5 +41,4 @@ public String value() { public static MethodeType fromValue(final String v) { return valueOf(v); } - } diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ObjectFactory.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ObjectFactory.java new file mode 100644 index 000000000..becea1789 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ObjectFactory.java @@ -0,0 +1,52 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.07.29 at 03:39:23 PM MESZ +// + +package org.opentosca.bus.management.invocation.plugin.rest.model; + +import javax.xml.bind.annotation.XmlRegistry; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.opentosca.bus.management.invocation.plugin.rest.model package. + *

+ * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.opentosca.bus.management.plugins.rest.service.impl.model + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link DataAssign } + */ + public DataAssign createDataAssign() { + return new DataAssign(); + } + + /** + * Create an instance of {@link DataAssign.Operations.Operation } + */ + public DataAssign.Operations.Operation createDataAssignOperationsOperation() { + return new DataAssign.Operations.Operation(); + } + + /** + * Create an instance of {@link DataAssign.Operations } + */ + public DataAssign.Operations createDataAssignOperations() { + return new DataAssign.Operations(); + } +} diff --git a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ParamsType.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ParamsType.java similarity index 99% rename from org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ParamsType.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ParamsType.java index 52e56aab4..5acd5d043 100644 --- a/org.opentosca.bus.management.invocation.plugin.rest/src/org/opentosca/bus/management/invocation/plugin/rest/model/ParamsType.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/ParamsType.java @@ -6,14 +6,12 @@ // Generated on: 2013.07.29 at 03:39:23 PM MESZ // - package org.opentosca.bus.management.invocation.plugin.rest.model; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for ParamsType. @@ -30,7 +28,6 @@ * </restriction> * </simpleType> * - * */ @XmlType(name = "ParamsType") @XmlEnum @@ -57,5 +54,4 @@ public static ParamsType fromValue(final String v) { } throw new IllegalArgumentException(v); } - } diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/package-info.java new file mode 100644 index 000000000..d3dbd3643 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/java/org/opentosca/bus/management/invocation/plugin/rest/model/package-info.java @@ -0,0 +1,11 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.07.29 at 03:39:23 PM MESZ +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.siengine.restplugin.org/SpecificContentRestSchema", + elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.opentosca.bus.management.invocation.plugin.rest.model; diff --git a/org.opentosca.bus.management.invocation.plugin.rest/META-INF/schema/SpecificContentRestSchema.xsd b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/resources/schema/SpecificContentRestSchema.xsd similarity index 100% rename from org.opentosca.bus.management.invocation.plugin.rest/META-INF/schema/SpecificContentRestSchema.xsd rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/resources/schema/SpecificContentRestSchema.xsd diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/resources/spring/context-bus-invocation-plugin.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/resources/spring/context-bus-invocation-plugin.xml new file mode 100644 index 000000000..d58dfd100 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.rest/src/main/resources/spring/context-bus-invocation-plugin.xml @@ -0,0 +1,17 @@ + + + + Register the beans within the rest management bus invocation plugin. + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/pom.xml new file mode 100644 index 000000000..8e3691dc5 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.invocation.plugin.script + + + + commons-io + commons-io + 2.6 + + + org.apache.camel + camel-core + ${camel.version} + + + + org.opentosca + org.opentosca.bus.management.invocation.plugin + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/ManagementBusInvocationPluginScript.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/ManagementBusInvocationPluginScript.java new file mode 100644 index 000000000..a2f31943a --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/ManagementBusInvocationPluginScript.java @@ -0,0 +1,551 @@ +package org.opentosca.bus.management.invocation.plugin.script; + +import java.net.URI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TArtifactReference; +import org.eclipse.winery.model.tosca.TArtifactTemplate; +import org.eclipse.winery.model.tosca.TArtifactType; +import org.eclipse.winery.model.tosca.TDeploymentArtifact; +import org.eclipse.winery.model.tosca.TDeploymentArtifacts; +import org.eclipse.winery.model.tosca.TImplementationArtifact; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TNodeType; +import org.eclipse.winery.model.tosca.TNodeTypeImplementation; +import org.eclipse.winery.model.tosca.TOperation; +import org.eclipse.winery.model.tosca.TParameter; +import org.eclipse.winery.model.tosca.TRelationshipTemplate; +import org.eclipse.winery.model.tosca.TRelationshipType; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.apache.camel.CamelContext; +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.ProducerTemplate; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; +import org.opentosca.bus.management.invocation.plugin.script.typeshandler.ArtifactTypesHandler; +import org.opentosca.bus.management.utils.MBUtils; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.engine.ResolvedArtifacts; +import org.opentosca.container.core.engine.ResolvedArtifacts.ResolvedDeploymentArtifact; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.engine.next.ContainerEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.tosca.convention.Interfaces; +import org.opentosca.container.core.tosca.convention.Types; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; + +/** + * Management Bus-Plug-in for Script IAs which have to be executed on a host machine.
+ *
+ * The Plugin gets needed information from the Management Bus and is responsible for the uploading of the files and the + * installation of required packages on the target machine (if specified). + * + * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de + */ +@Service +public class ManagementBusInvocationPluginScript implements IManagementBusInvocationPluginService { + + final private static String PLACEHOLDER_TARGET_FILE_PATH = "{TARGET_FILE_PATH}"; + final private static String PLACEHOLDER_TARGET_FILE_FOLDER_PATH = "{TARGET_FILE_FOLDER_PATH}"; + final private static String PLACEHOLDER_TARGET_FILE_NAME_WITH_EXTENSION = "{TARGET_FILE_NAME_WITH_E}"; + final private static String PLACEHOLDER_TARGET_FILE_NAME_WITHOUT_EXTENSION = "{TARGET_FILE_NAME_WITHOUT_E}"; + final private static String PLACEHOLDER_DA_NAME_PATH_MAP = "{DA_NAME_PATH_MAP}"; + final private static String PLACEHOLDER_DA_INPUT_PARAMETER = "{INPUT_PARAMETER}"; + + final private static String RUN_SCRIPT_OUTPUT_PARAMETER_NAME = "ScriptResult"; + + final private static Logger LOG = LoggerFactory.getLogger(ManagementBusInvocationPluginScript.class); + + private final ArtifactTypesHandler typesHandler; + private final CsarStorageService storage; + private final ContainerEngine containerEngine; + + private final CamelContext camelContext; + + @Inject + public ManagementBusInvocationPluginScript(ArtifactTypesHandler typesHandler, CsarStorageService storage, ContainerEngine containerEngine, @Named("fallback") CamelContext camelContext) { + this.typesHandler = typesHandler; + this.storage = storage; + this.containerEngine = containerEngine; + this.camelContext = camelContext; + } + + @Override + public Exchange invoke(final Exchange exchange) { + LOG.debug("Management Bus Script Plugin getting information..."); + + final Message message = exchange.getIn(); + final CsarId csarID = message.getHeader(MBHeader.CSARID.toString(), CsarId.class); + LOG.debug("CsarID: {}", csarID); + final QName artifactTemplateID = message.getHeader(MBHeader.ARTIFACTTEMPLATEID_QNAME.toString(), QName.class); + LOG.debug("ArtifactTemplateID: {}", artifactTemplateID); + final String relationshipTemplateID = message.getHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), String.class); + LOG.debug("RelationshipTemplateID: {}", relationshipTemplateID); + final QName serviceTemplateID = message.getHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), QName.class); + LOG.debug("ServiceTemplateID: {}", serviceTemplateID); + + final String interfaceName = message.getHeader(MBHeader.INTERFACENAME_STRING.toString(), String.class); + LOG.debug("InterfaceName: {}", interfaceName); + final String operationName = message.getHeader(MBHeader.OPERATIONNAME_STRING.toString(), String.class); + LOG.debug("OperationName: {}", operationName); + final Csar csar = storage.findById(csarID); + try { + final TServiceTemplate serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateID); + final TArtifactTemplate artifactTemplate = ToscaEngine.resolveArtifactTemplate(csar, artifactTemplateID); + final TArtifactType artifactType = ToscaEngine.resolveArtifactType(csar, artifactTemplate.getType()); + // the relationship template does not need to be present + final TRelationshipTemplate relationshipTemplate = ToscaEngine.getRelationshipTemplate(serviceTemplate, relationshipTemplateID).orElse(null); + final TNodeTemplate nodeTemplate = getNodeTemplate(message, csar, relationshipTemplate, serviceTemplate, interfaceName, operationName); + final TNodeType nodeType = ToscaEngine.resolveNodeTypeReference(csar, nodeTemplate.getType()); + final TOperation operation = ToscaEngine.resolveOperation(nodeType, interfaceName, operationName); + + return handleExchangeInternal(exchange, message, csarID, serviceTemplateID, csar, serviceTemplate, artifactTemplate, artifactType, nodeTemplate, nodeType, operation); + } catch (NotFoundException e) { + LOG.warn("Failed to resolve a strongly typed CSAR content reference, invocation failed!", e); + return exchange; + } + } + + private Exchange handleExchangeInternal(Exchange exchange, Message message, CsarId csarID, QName serviceTemplateID, Csar csar, TServiceTemplate serviceTemplate, TArtifactTemplate artifactTemplate, TArtifactType artifactType, TNodeTemplate nodeTemplate, TNodeType nodeType, TOperation operation) throws NotFoundException { + if (artifactType == null || nodeTemplate == null) { + LOG.warn("Could not determine ArtifactType of ArtifactTemplate: {}!", artifactTemplate.getId()); + return exchange; + } + LOG.debug("ArtifactType of ArtifactTemplate {} : {}", artifactTemplate.getId(), artifactType.getQName()); + final URI serviceInstanceID = message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), URI.class); + LOG.debug("ServiceInstanceID: {}", serviceInstanceID); + // search operating system IA to upload files and run scripts on target machine + final long serviceTemplateInstanceId = Long.parseLong(StringUtils.substringAfterLast(serviceInstanceID.toString(), "/")); + TNodeTemplate osNodeTemplate = MBUtils.getOperatingSystemNodeTemplate(csar, serviceTemplate, nodeTemplate, true, + serviceTemplateInstanceId); + + if (osNodeTemplate == null) { + LOG.warn("No OperatingSystem-NodeTemplate found!"); + return exchange; + } + + if (osNodeTemplate.getType().equals(Types.abstractOperatingSystemNodeType)) { + final NodeTemplateInstance abstractOSInstance = MBUtils.getNodeTemplateInstance(serviceTemplateInstanceId, osNodeTemplate); + final NodeTemplateInstance replacementInstance = MBUtils.getAbstractOSReplacementInstance(abstractOSInstance); + if (replacementInstance != null) { + // overwrite computed intermediate result based on replacement + csar = storage.findById(replacementInstance.getServiceTemplateInstance().getCsarId()); + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, replacementInstance.getServiceTemplateInstance().getTemplateId()); + osNodeTemplate = ToscaEngine.resolveNodeTemplate(serviceTemplate, replacementInstance.getTemplateId()); + } + } + final TNodeType osNodeType = ToscaEngine.resolveNodeTypeReference(csar, osNodeTemplate.getType()); + LOG.debug("OperatingSystem-NodeType found: {}", osNodeType.getQName()); + final TImplementationArtifact osIA = MBUtils.getOperatingSystemIA(csar, serviceTemplate, osNodeType); + + if (osIA == null) { + LOG.warn("No OperatingSystem-IA found!"); + return exchange; + } + + final String nodeInstanceID = message.getHeader(MBHeader.NODEINSTANCEID_STRING.toString(), String.class); + LOG.debug("NodeInstanceID: {}", nodeInstanceID); + + final Object params = message.getBody(); + // create headers + final Map headers = new HashMap<>(); + + headers.put(MBHeader.CSARID.toString(), csarID); + headers.put(MBHeader.SERVICETEMPLATEID_QNAME.toString(), serviceTemplateID); + headers.put(MBHeader.NODETEMPLATEID_STRING.toString(), osNodeTemplate.getIdFromIdOrNameField()); + headers.put(MBHeader.INTERFACENAME_STRING.toString(), MBUtils.getInterfaceForOperatingSystemNodeType(osNodeType)); + headers.put(MBHeader.SERVICEINSTANCEID_URI.toString(), serviceInstanceID); + headers.put(MBHeader.NODEINSTANCEID_STRING.toString(), nodeInstanceID); + + // install packages + LOG.debug("Installing packages..."); + installPackages(artifactType, headers); + LOG.debug("Packages installed."); + + // get list of artifacts + final List artifactReferences = (artifactTemplate.getArtifactReferences() == null) + ? Collections.emptyList() + : artifactTemplate.getArtifactReferences().getArtifactReference(); + LOG.debug("{} contains {} artifacts. Uploading and executing them...", artifactTemplate.getId(), artifactReferences.size()); + + // Map which contains the output parameters + final Map resultMap = new HashMap<>(); + final String targetBasePath = "~/" + csarID.csarName(); + + // upload and execute all contained artifacts + for (final TArtifactReference artifactRef : artifactReferences) { + final String fileSource = Settings.CONTAINER_API + "/csars/" + csarID.csarName() + "/content/" + artifactRef.getReference(); + final String targetFilePath = targetBasePath + "/" + artifactRef.getReference(); + final String targetFileFolderPath = FilenameUtils.getFullPathNoEndSeparator(targetFilePath); + final String createDirCommand = "sleep 1 && mkdir -p " + targetFileFolderPath; + + LOG.debug("Uploading file: {}", fileSource); + // create directory before uploading file + runScript(createDirCommand, headers); + // upload file + transferFile(fileSource, targetFilePath, headers); + LOG.debug("File successfully uploaded."); + + // run script + LOG.debug("Running script..."); + final String fileNameWithE = FilenameUtils.getName(targetFilePath); + final String fileNameWithoutE = FilenameUtils.getBaseName(targetFilePath); + + String artifactTypeSpecificCommand = createArtifactTypeSpecificCommandString(csar, artifactType, artifactTemplate, params); + LOG.debug("Replacing further generic placeholder..."); + // replace placeholders + artifactTypeSpecificCommand = artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_TARGET_FILE_PATH, targetFilePath); + artifactTypeSpecificCommand = artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_TARGET_FILE_FOLDER_PATH, targetFileFolderPath); + artifactTypeSpecificCommand = artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_TARGET_FILE_NAME_WITH_EXTENSION, fileNameWithE); + artifactTypeSpecificCommand = artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_TARGET_FILE_NAME_WITHOUT_EXTENSION, fileNameWithoutE); + artifactTypeSpecificCommand = artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_DA_NAME_PATH_MAP, + createDANamePathMapEnvVar(csar, nodeType, nodeTemplate) + " CSAR='" + csarID + "' NodeInstanceID='" + nodeInstanceID + "' ServiceInstanceID='" + serviceInstanceID + "' "); + artifactTypeSpecificCommand = artifactTypeSpecificCommand.replace(ManagementBusInvocationPluginScript.PLACEHOLDER_DA_INPUT_PARAMETER, createParamsString(params)); + + if (!Boolean.valueOf(Settings.OPENTOSCA_ENGINE_IA_KEEPFILES)) { + // delete the uploaded file on the remote site to save resources + final String deleteFileCommand = "; rm -f " + targetFilePath; + artifactTypeSpecificCommand = artifactTypeSpecificCommand + deleteFileCommand; + } + + LOG.debug("Final command for the script execution: {}", artifactTypeSpecificCommand); + final Object result = runScript(artifactTypeSpecificCommand, headers); + LOG.debug("Script execution result: {}", result); + + // check for output parameters in the script result and add them to the + // operation result + addOutputParametersToResultMap(resultMap, result, operation); + } + + if (!Boolean.valueOf(Settings.OPENTOSCA_ENGINE_IA_KEEPFILES)) { + // remove the created directories + LOG.debug("Deleting directories..."); + final String deleteDirsCommand = "find " + targetBasePath + " -empty -type d -delete"; + runScript(deleteDirsCommand, headers); + } + + LOG.debug("All artifacts are executed. Returning result to the Management Bus..."); + + // create dummy response in case there are no output parameters + if (resultMap.isEmpty()) { + resultMap.put("invocation", "finished"); + } + + exchange.getIn().setBody(resultMap); + return exchange; + } + + private TNodeTemplate getNodeTemplate(Message message, Csar csar, TRelationshipTemplate relationshipTemplate, TServiceTemplate serviceTemplate, String interfaceName, String operationName) throws NotFoundException { + String nodeTemplateID = message.getHeader(MBHeader.NODETEMPLATEID_STRING.toString(), String.class); + LOG.debug("NodeTemplateID: {}", nodeTemplateID); + if (nodeTemplateID == null && relationshipTemplate != null) { + // backfill the node template from the relationship template + final TRelationshipType relationshipType = ToscaEngine.resolveRelationshipTypeReference(csar, relationshipTemplate.getType()); + final boolean isBoundToSourceNode = ToscaEngine.isOperationBoundToSourceNode(relationshipType, interfaceName, operationName); + return isBoundToSourceNode + ? (TNodeTemplate) relationshipTemplate.getSourceElement().getRef() + : (TNodeTemplate) relationshipTemplate.getTargetElement().getRef(); + } + return ToscaEngine.resolveNodeTemplate(serviceTemplate, nodeTemplateID); + } + + /** + * Check if the output parameters for this script service operation are returned in the script result and add them + * to the result map. + * + * @param resultMap The result map which is returned for the invocation of the script service operation + * @param result The returned result of the run script operation + * @param operation The script service operation to check + */ + private void addOutputParametersToResultMap(final Map resultMap, final Object result, final TOperation operation) { + final boolean hasOutputParams = operation.getOutputParameters() != null; + if (!hasOutputParams) { + return; + } + if (!(result instanceof HashMap)) { + LOG.warn("Result of type {} not supported. The bus should return a HashMap as result class when it is used as input.", result.getClass()); + return; + } + LOG.debug("Adding output parameters to the response message."); + final Map resultHashMap = (HashMap) result; + + // get ScriptResult part of the response which contains the parameters + if (!resultHashMap.containsKey(ManagementBusInvocationPluginScript.RUN_SCRIPT_OUTPUT_PARAMETER_NAME)) { + LOG.warn("Result contains no result entry '{}'", ManagementBusInvocationPluginScript.RUN_SCRIPT_OUTPUT_PARAMETER_NAME); + return; + } + final Object scriptResult = resultHashMap.get(ManagementBusInvocationPluginScript.RUN_SCRIPT_OUTPUT_PARAMETER_NAME); + if (scriptResult == null) { + return; + } + + final String scriptResultString = scriptResult.toString(); + LOG.debug("{}: {}", ManagementBusInvocationPluginScript.RUN_SCRIPT_OUTPUT_PARAMETER_NAME, scriptResultString); + + // split result on line breaks as every parameter is returned in a separate "echo" command + final String[] resultParameters = scriptResultString.split("[\\r\\n]+"); + + // add each parameter that is defined in the operation and passed back + for (final TParameter outputParameter : operation.getOutputParameters().getOutputParameter()) { + for (int i = resultParameters.length - 1; i >= 0; i--) { + if (resultParameters[i].startsWith(outputParameter.getName())) { + final String value = resultParameters[i].substring(resultParameters[i].indexOf("=") + 1); + + LOG.debug("Adding parameter {} with value: {}", outputParameter, value); + resultMap.put(outputParameter.getName(), value); + } + } + } + } + + /** + * @return mapping with DeploymentArtifact names and their paths. + */ + private String createDANamePathMapEnvVar(final Csar csar, final TNodeType nodeType, final TNodeTemplate nodeTemplate) { + LOG.debug("Checking if NodeTemplate {} has DAs...", nodeTemplate.getName()); + List daArtifactReferences; + + final Map> daNameReferenceMapping = new HashMap<>(); + + final ResolvedArtifacts resolvedArtifacts = containerEngine.resolvedDeploymentArtifacts(csar, nodeTemplate); + for (final ResolvedDeploymentArtifact resolvedDA : resolvedArtifacts.getDeploymentArtifacts()) { + daArtifactReferences = resolvedDA.getReferences(); + + for (final String daArtifactReference : daArtifactReferences) { + LOG.debug("Artifact reference for DA: {} found: {} .", resolvedDA.getName(), daArtifactReference); + List currentValue = daNameReferenceMapping.computeIfAbsent(resolvedDA.getName(), k -> new ArrayList<>()); + currentValue.add(daArtifactReference); + } + } + + final List nodeTypeImpls = ToscaEngine.getNodeTypeImplementations(csar, nodeType); + for (final TNodeTypeImplementation nodeTypeImpl : nodeTypeImpls) { + TDeploymentArtifacts das = nodeTypeImpl.getDeploymentArtifacts(); + if (das == null) { + continue; + } + for (final TDeploymentArtifact da : das.getDeploymentArtifact()) { + final TArtifactTemplate daArtifactTemplate; + try { + daArtifactTemplate = ToscaEngine.resolveArtifactTemplate(csar, da.getArtifactRef()); + } catch (NotFoundException e) { + LOG.warn("Failed to find ArtifactTemplate with reference [{}] for DeploymentArtifact {}", da.getArtifactRef(), da.getName()); + continue; + } + if (daArtifactTemplate.getArtifactReferences() == null) { + continue; + } + for (final TArtifactReference daArtifactReference : daArtifactTemplate.getArtifactReferences().getArtifactReference()) { + LOG.debug("Artifact reference for DA: {} found: {} .", da.getName(), daArtifactReference); + + List currentValue = daNameReferenceMapping.computeIfAbsent(da.getName(), k -> new ArrayList<>()); + currentValue.add(daArtifactReference.getReference()); + } + } + } + String daEnvMap = ""; + if (!daNameReferenceMapping.isEmpty()) { + LOG.debug("NodeTemplate {} has {} DAs.", nodeTemplate.getName(), daNameReferenceMapping.size()); + daEnvMap += "DAs=\""; + for (final Entry> da : daNameReferenceMapping.entrySet()) { + final String daName = da.getKey(); + final List daRefs = da.getValue(); + for (String daRef : daRefs) { + // FIXME / is a brutal assumption + if (!daRef.startsWith("/")) { + daRef = "/" + daRef; + } + daEnvMap += daName + "," + daRef + ";"; + } + } + daEnvMap += "\" "; + LOG.debug("Created DA-DANamePathMapEnvVar for NodeTemplate {} : {}", + nodeTemplate.getName(), daEnvMap); + } + + return daEnvMap; + } + + /** + * Installs required and specified packages of the specified ArtifactType. Required packages are in defined the + * corresponding *.xml file. + */ + private void installPackages(final TArtifactType artifactType, final Map headers) { + final List requiredPackages = typesHandler.getRequiredPackages(artifactType.getQName()); + if (requiredPackages.isEmpty()) { + LOG.debug("ArtifactType: {} needs no packages to install.", requiredPackages, artifactType); + return; + } + final String requiredPackagesString = String.join(" ", requiredPackages); + final Map inputParamsMap = new HashMap<>(); + inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_PACKAGENAMES, requiredPackagesString); + + LOG.debug("Installing packages: {} for ArtifactType: {} ", requiredPackages, artifactType); + headers.put(MBHeader.OPERATIONNAME_STRING.toString(), Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_INSTALLPACKAGE); + invokeManagementBusEngine(inputParamsMap, headers); + } + + /** + * For transferring files to the target machine. + */ + private void transferFile(final String source, final String target, final Map headers) { + final Map inputParamsMap = new HashMap<>(); + inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_TARGETABSOLUTPATH, target); + inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_SOURCEURLORLOCALPATH, source); + + LOG.debug("Uploading file. Source: {} Target: {} ", source, target); + headers.put(MBHeader.OPERATIONNAME_STRING.toString(), Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE); + LOG.debug("Invoking ManagementBus for transferFile with the following headers:"); + + for (final String key : headers.keySet()) { + if (headers.get(key) != null && headers.get(key) instanceof String) { + LOG.debug("Header: " + key + " Value: " + headers.get(key)); + } + } + invokeManagementBusEngine(inputParamsMap, headers); + } + + /** + * For running scripts on the target machine. Commands to be executed are defined in the corresponding *.xml file. + */ + private Object runScript(final String commandsString, final Map headers) { + LOG.debug("RunScript: {} ", commandsString); + final HashMap inputParamsMap = new HashMap<>(); + inputParamsMap.put(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_SCRIPT, commandsString); + headers.put(MBHeader.OPERATIONNAME_STRING.toString(), Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT); + + LOG.debug("Invoking ManagementBus for runScript with the following headers:"); + for (final String key : headers.keySet()) { + if (headers.get(key) != null && headers.get(key) instanceof String) { + LOG.debug("Header: " + key + " Value: " + headers.get(key)); + } + } + return invokeManagementBusEngine(inputParamsMap, headers); + } + + /** + * Creates ArtifactType specific commands that should be executed on the target machine. Commands to be executed are + * defined in the corresponding *.xml file. + * + * @return the created command + */ + private String createArtifactTypeSpecificCommandString(final Csar csar, + final TArtifactType artifactType, + final TArtifactTemplate artifactTemplate, + final Object params) { + LOG.debug("Creating ArtifactType specific command for artifactType {}:...", artifactType); + + final List commands = typesHandler.getCommands(artifactType.getQName()); + String commandsString = String.join(" && ", commands); + LOG.debug("Defined generic command for ArtifactType {} : {} ", artifactType, commandsString); + + // replace placeholder with data from inputParams and/or instance data + if (commandsString.contains("{{") && commandsString.contains("}}")) { + LOG.debug("Replacing the placeholder of the generic command with properties data and/or provided input parameter..."); + + final Map paramsMap; + if (params instanceof HashMap) { + paramsMap = (HashMap) params; + } else if (params instanceof Document) { + final Document paramsDoc = (Document) params; + paramsMap = MBUtils.docToMap(paramsDoc, true); + } else { + paramsMap = new HashMap<>(); + } + + final Document propDoc = ToscaEngine.getEntityTemplateProperties(artifactTemplate); + if (propDoc != null) { + paramsMap.putAll(MBUtils.docToMap(propDoc, true)); + } + + for (final Entry prop : paramsMap.entrySet()) { + commandsString = commandsString.replace("{{" + prop.getKey() + "}}", prop.getValue()); + } + // delete not replaced placeholder + commandsString = commandsString.replaceAll("\\{\\{.*?\\}\\}", ""); + LOG.debug("Generic command with replaced placeholder: {}", commandsString); + } + return commandsString; + } + + /** + * @return whitespace separated String with parameter keys and values + */ + @SuppressWarnings("unchecked") + private String createParamsString(final Object params) { + HashMap paramsMap = new HashMap<>(); + + if (params instanceof HashMap) { + paramsMap = (HashMap) params; + } else if (params instanceof Document) { + final Document paramsDoc = (Document) params; + paramsMap = MBUtils.docToMap(paramsDoc, true); + } + + String paramsString = ""; + for (final Entry param : paramsMap.entrySet()) { + // info: + // https://stackoverflow.com/questions/3005963/how-can-i-have-a-newline-in-a-string-in-sh + // https://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings + // we have to escape single quotes in the parameter values and properly pipe newlines + // TODO(?) There is still the issue if you use commands in scipt which don't interpret backslashes + paramsString += param.getKey() + "=$'" + escapeSpecialCharacters(param.getValue()) + "' "; + } + + return paramsString; + } + + /** + * Escapes special characters inside the given string conforming to bash argument values. + *

+ * See e.g. Stackoverflow: + * Escape single quites within single quoted string + * + * @return a String with escaped singles quotes + */ + private String escapeSpecialCharacters(final String unenscapedString) { + return unenscapedString.replace("'", "'\"'\"'") + .replace("\n", "'\"\\n\"'") + .replace("\t", "'\"\\t\"'") + .replace(" ", "'\" \"'"); + } + + /** + * Invokes the Management Bus. + */ + private Object invokeManagementBusEngine(final Map paramsMap, + final Map headers) { + LOG.debug("Invoking the Management Bus..."); + + final ProducerTemplate template = camelContext.createProducerTemplate(); + final Object response = template.requestBodyAndHeaders("bean:managementBusService?method=invokeIA", paramsMap, headers); + LOG.debug("Invocation finished: {}", response); + return response; + } + + @Override + public List getSupportedTypes() { + return typesHandler.getSupportedTypes().stream().map(QName::toString).collect(Collectors.toList()); + } +} diff --git a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Artifacttype.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Artifacttype.java similarity index 95% rename from org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Artifacttype.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Artifacttype.java index 46b4c7f2c..114cb14fe 100644 --- a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Artifacttype.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Artifacttype.java @@ -6,7 +6,6 @@ // Generated on: 2016.07.12 at 02:53:01 PM CEST // - package org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes; import javax.xml.bind.annotation.XmlAccessType; @@ -17,7 +16,6 @@ import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for anonymous complex type. @@ -39,8 +37,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {"packages", "commands"}) @@ -61,7 +57,6 @@ public class Artifacttype { * Gets the value of the packages property. * * @return possible object is {@link Packagestype } - * */ public Packagestype getPackages() { return this.packages; @@ -71,7 +66,6 @@ public Packagestype getPackages() { * Sets the value of the packages property. * * @param value allowed object is {@link Packagestype } - * */ public void setPackages(final Packagestype value) { this.packages = value; @@ -81,7 +75,6 @@ public void setPackages(final Packagestype value) { * Gets the value of the commands property. * * @return possible object is {@link Commandstype } - * */ public Commandstype getCommands() { return this.commands; @@ -91,7 +84,6 @@ public Commandstype getCommands() { * Sets the value of the commands property. * * @param value allowed object is {@link Commandstype } - * */ public void setCommands(final Commandstype value) { this.commands = value; @@ -101,7 +93,6 @@ public void setCommands(final Commandstype value) { * Gets the value of the name property. * * @return possible object is {@link String } - * */ public String getName() { return this.name; @@ -111,7 +102,6 @@ public String getName() { * Sets the value of the name property. * * @param value allowed object is {@link String } - * */ public void setName(final String value) { this.name = value; @@ -121,7 +111,6 @@ public void setName(final String value) { * Gets the value of the namespace property. * * @return possible object is {@link String } - * */ public String getNamespace() { return this.namespace; @@ -131,10 +120,16 @@ public String getNamespace() { * Sets the value of the namespace property. * * @param value allowed object is {@link String } - * */ public void setNamespace(final String value) { this.namespace = value; } + @Override + public String toString() { + return "Artifacttype{" + + "name='" + name + '\'' + + ", namespace='" + namespace + '\'' + + '}'; + } } diff --git a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Commandstype.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Commandstype.java similarity index 81% rename from org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Commandstype.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Commandstype.java index f91580b7a..39ed0529e 100644 --- a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Commandstype.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Commandstype.java @@ -6,17 +6,16 @@ // Generated on: 2016.07.12 at 02:53:01 PM CEST // - package org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for commandstype complex type. @@ -35,8 +34,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "commandstype", propOrder = {"command"}) @@ -48,9 +45,9 @@ public class Commandstype { * Gets the value of the command property. * *

- * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the command property. + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the command property. * *

* For example, to add a new item, do as follows: @@ -62,8 +59,6 @@ public class Commandstype { * *

* Objects of the following type(s) are allowed in the list {@link String } - * - * */ public List getCommand() { if (this.command == null) { @@ -72,4 +67,10 @@ public List getCommand() { return this.command; } + @Override + public String toString() { + return "Commandstype{" + + "command=" + command.stream().collect(Collectors.joining(", ")) + + '}'; + } } diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/ObjectFactory.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/ObjectFactory.java new file mode 100644 index 000000000..ace10030b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/ObjectFactory.java @@ -0,0 +1,52 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2016.07.12 at 02:53:01 PM CEST +// + +package org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes; + +import javax.xml.bind.annotation.XmlRegistry; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes package. + *

+ * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.opentosca.bus.management.plugins.remote.service.impl.artifacttypes + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Artifacttype } + */ + public Artifacttype createArtifacttype() { + return new Artifacttype(); + } + + /** + * Create an instance of {@link Packagestype } + */ + public Packagestype createPackagestype() { + return new Packagestype(); + } + + /** + * Create an instance of {@link Commandstype } + */ + public Commandstype createCommandstype() { + return new Commandstype(); + } +} diff --git a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Packagestype.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Packagestype.java similarity index 82% rename from org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Packagestype.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Packagestype.java index 54c35b1d5..3d9ccf8e7 100644 --- a/org.opentosca.bus.management.invocation.plugin.script/src/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Packagestype.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/model/artifacttypes/Packagestype.java @@ -6,18 +6,17 @@ // Generated on: 2016.07.12 at 02:53:01 PM CEST // - package org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* Java class for packagestype complex type. @@ -36,8 +35,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "packagestype", propOrder = {"_package"}) @@ -50,9 +47,9 @@ public class Packagestype { * Gets the value of the package property. * *

- * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the package property. + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the package property. * *

* For example, to add a new item, do as follows: @@ -64,8 +61,6 @@ public class Packagestype { * *

* Objects of the following type(s) are allowed in the list {@link String } - * - * */ public List getPackage() { if (this._package == null) { @@ -74,4 +69,10 @@ public List getPackage() { return this._package; } + @Override + public String toString() { + return "Packagestype{" + + "package=" + _package.stream().collect(Collectors.joining(", ")) + + '}'; + } } diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/typeshandler/ArtifactTypesHandler.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/typeshandler/ArtifactTypesHandler.java new file mode 100644 index 000000000..4305de0d9 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/java/org/opentosca/bus/management/invocation/plugin/script/typeshandler/ArtifactTypesHandler.java @@ -0,0 +1,137 @@ +package org.opentosca.bus.management.invocation.plugin.script.typeshandler; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.inject.Singleton; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.namespace.QName; + +import org.opentosca.bus.management.invocation.plugin.script.model.artifacttypes.Artifacttype; +import org.opentosca.container.core.common.file.ResourceAccess; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * Handles the config files (located in artifacttypes folder) for the different supported ArtifactTypes. + * + * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de + */ +@Service +@Singleton +public class ArtifactTypesHandler { + private static final String ARTIFACT_TYPES_DEFINTION_FOLDER = "artifacttypes"; + private static final Logger LOG = LoggerFactory.getLogger(ArtifactTypesHandler.class); + + private final Map artifactTypes = new HashMap<>(); + + public ArtifactTypesHandler() { + LOG.debug("Registering the supported ArtifactTypes..."); + URL artifactTypeFolder = getClass().getClassLoader().getResource(ARTIFACT_TYPES_DEFINTION_FOLDER); + try { + readArtifactTypes(ResourceAccess.resolveUrl(artifactTypeFolder)); + } catch (final IOException e) { + LOG.error("Failed to read artifacttype definitions from {} with exception", artifactTypeFolder, e); + } catch (final IllegalArgumentException e) { + LOG.error("Failed to transform resource URL to File reference", e); + } + // Do not under any circumstances blow up the containing JVM by throwing something here + catch (final Throwable e) { + LOG.error("Failed to instantiate ArtifactTypesHandler with unexpected Throwable", e); + } + LOG.info("Registered {} Artifact Types", artifactTypes.size()); + } + + private void readArtifactTypes(Path baseDirectory) { + Path[] xmlFiles; + try { + xmlFiles = Files.find(baseDirectory, 1, (path, attrs) -> path.getFileName().toString().endsWith(".xml")).toArray(Path[]::new); + } catch (IOException e) { + LOG.warn("Failed to iterate artifact type containers", e); + return; + } + + if (xmlFiles.length == 0) { + LOG.debug("No supported ArtifactTypes found."); + return; + } + + final JAXBContext jaxbContext; + final Unmarshaller jaxbUnmarshaller; + try { + jaxbContext = JAXBContext.newInstance(Artifacttype.class); + jaxbUnmarshaller = jaxbContext.createUnmarshaller(); + } catch (final JAXBException e) { + LOG.error("Could not create JAXBContext for Artifacttype deserialization", e); + return; + } + for (final Path typeDefinition : xmlFiles) { + final Artifacttype artifactType; + try (InputStream is = Files.newInputStream(typeDefinition)) { + artifactType = (Artifacttype) jaxbUnmarshaller.unmarshal(is); + } catch (JAXBException e) { + LOG.warn("Failed to deserialize type definition {} with JAXBException", typeDefinition, e); + continue; + } catch (IOException e) { + LOG.warn("Failed to read typeDefinition {} with IOException", typeDefinition, e); + continue; + } + final String artifactTypeName = artifactType.getName(); + final String artifactTypeNamespace = artifactType.getNamespace(); + final QName qName = new QName(artifactTypeNamespace, artifactTypeName); + + LOG.debug("Supported ArtifactType found: {}", artifactType); + artifactTypes.put(qName, artifactType); + } + } + + /** + * Returns the required packages of the specified ArtifactType. + * + * @return the required packages of the specified ArtifactType. + */ + public List getRequiredPackages(final QName artifactType) { + if (!artifactTypes.containsKey(artifactType)) { + LOG.warn("ArtifactType: {} is not supported!", artifactType); + return Collections.emptyList(); + } + List requiredPackages = artifactTypes.get(artifactType).getPackages().getPackage(); + LOG.debug("Required packages of artifactType: {} : {}", artifactType, requiredPackages); + return requiredPackages; + } + + /** + * Returns the defined commands of the specified ArtifactType. + * + * @return the defined commands of the specified ArtifactType. + */ + public List getCommands(final QName artifactType) { + if (!artifactTypes.containsKey(artifactType)) { + LOG.warn("ArtifactType: {} is not supported!", artifactType); + return Collections.emptyList(); + } + List commands = artifactTypes.get(artifactType).getCommands().getCommand(); + LOG.debug("Commands to run for artifactType: {} : {}", artifactType, commands); + return commands; + } + + /** + * @return the supported Types of the plugin. Based on the available *.xml files. + */ + public List getSupportedTypes() { + final ArrayList supportedTypes = new ArrayList<>(artifactTypes.keySet()); + LOG.debug("SupportedTypes: {}", supportedTypes); + return supportedTypes; + } +} diff --git a/org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/Ansible.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/Ansible.xml similarity index 100% rename from org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/Ansible.xml rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/Ansible.xml diff --git a/org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/Chef.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/Chef.xml similarity index 100% rename from org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/Chef.xml rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/Chef.xml diff --git a/org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/Script.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/Script.xml similarity index 100% rename from org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/Script.xml rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/Script.xml diff --git a/org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/TypesSchema.xsd b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/TypesSchema.xsd similarity index 100% rename from org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/TypesSchema.xsd rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/TypesSchema.xsd diff --git a/org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/Wheel.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/Wheel.xml similarity index 100% rename from org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/Wheel.xml rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/Wheel.xml diff --git a/org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/readme.txt b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/readme.txt similarity index 100% rename from org.opentosca.bus.management.invocation.plugin.script/META-INF/artifacttypes/readme.txt rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/artifacttypes/readme.txt diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/spring/context-bus-invocation-plugin.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/spring/context-bus-invocation-plugin.xml new file mode 100644 index 000000000..a59cfcde6 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.script/src/main/resources/spring/context-bus-invocation-plugin.xml @@ -0,0 +1,21 @@ + + + + Register the beans within the script management bus invocation plugin. + + + + + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/pom.xml new file mode 100644 index 000000000..9367586c3 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.invocation.plugin.soaphttp + + + + org.apache.camel + camel-core + ${camel.version} + + + org.apache.camel + camel-cxf + ${camel.version} + + + org.apache.cxf + cxf-rt-frontend-jaxrs + + + + + org.apache.camel + camel-jetty + ${camel.version} + + + org.apache.cxf + cxf-rt-bindings-soap + ${apache.cxf.version} + + + org.apache.cxf + cxf-rt-wsdl + ${apache.cxf.version} + + + + wsdl4j + wsdl4j + + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.opentosca + org.opentosca.bus.management.invocation.plugin + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/ManagementBusInvocationPluginSoapHttp.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/ManagementBusInvocationPluginSoapHttp.java new file mode 100644 index 000000000..4d69e502b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/ManagementBusInvocationPluginSoapHttp.java @@ -0,0 +1,397 @@ +package org.opentosca.bus.management.invocation.plugin.soaphttp; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import javax.inject.Inject; +import javax.wsdl.Binding; +import javax.wsdl.BindingOperation; +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPathVariableResolver; + +import org.apache.camel.CamelContext; +import org.apache.camel.ConsumerTemplate; +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.ProducerTemplate; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; +import org.opentosca.bus.management.invocation.plugin.soaphttp.route.AsyncRoute; +import org.opentosca.bus.management.utils.MBUtils; +import org.opentosca.container.core.model.csar.CsarId; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Management Bus-Plug-in for invoking a service with a SOAP message over HTTP.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * The Plug-in gets needed information (like endpoint of the service or operation to invoke) from the Management Bus and + * creates a SOAP message out of it. If needed the Plug-in parses the WSDL of the service. The Plug-in supports + * synchronous request-response communication, asynchronous communication with callbacks and one-way invocation. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +public class ManagementBusInvocationPluginSoapHttp implements IManagementBusInvocationPluginService { + + private static final Logger LOG = LoggerFactory.getLogger(ManagementBusInvocationPluginSoapHttp.class); + + // Supported types defined in messages.properties. + private static final String TYPES = "SOAP/HTTP"; + + private enum MessagingPattern { + CALLBACK, REQUEST_RESPONSE, REQUEST_ONLY + } + + private static Map EXCHANGE_MAP = Collections.synchronizedMap(new HashMap()); + + private final CamelContext camelContext; + + @Inject + public ManagementBusInvocationPluginSoapHttp(CamelContext camelContext) { + this.camelContext = camelContext; + } + + @Override + public Exchange invoke(Exchange exchange) { + final Message message = exchange.getIn(); + + final Object params = message.getBody(); + final String operationName = message.getHeader(MBHeader.OPERATIONNAME_STRING.toString(), String.class); + final String endpoint = message.getHeader(MBHeader.ENDPOINT_URI.toString(), String.class); + + final Boolean hasOutputParams = message.getHeader(MBHeader.HASOUTPUTPARAMS_BOOLEAN.toString(), Boolean.class); + final CsarId csarID = new CsarId(message.getHeader(MBHeader.CSARID.toString(), String.class)); + + final Map headers = new HashMap<>(); + // Self defined header should be part of the outgoing soap messages. + for (final MBHeader header : MBHeader.values()) { + if (message.getHeader(header.name()) != null) { + headers.put(header.name(), message.getHeader(header.name())); + } + } + headers.put("endpoint", endpoint.replace("?wsdl", "")); +// headers.put("SOAPAction", operationName); + headers.put("operationName", operationName); + + Document document = null; + MessagingPattern messagingPattern = null; + LOG.info("Creating invocation message."); + if (params instanceof HashMap) { + Definition wsdl = pullWsdlDefinitions(endpoint); + BindingOperation operation = findOperation(wsdl, operationName); + if (operation == null) { + LOG.error("Invoked operation was not exposed on the given endpoint. Aborting invocation!"); + return null; + } +// final QName messageType = operation.getOperation().getInput().getMessage().getQName(); + final QName messagePayloadType = ((javax.wsdl.Part) operation.getOperation().getInput().getMessage().getOrderedParts(null).get(0)).getElementName(); +// final QName messagePayloadType = operation.getOperation().getInput().getMessage().getPart(messagePayloadPart).getElementName(); + // getting the port name involves this mess +// String portName = getPortName(wsdl, operation); + headers.put("SOAPEndpoint", endpoint); + + messagingPattern = determineMP(message, operationName, operation, hasOutputParams); + if (messagingPattern == null) { + LOG.error("No invokable operation found. Invocation aborted!"); + return null; + } + message.setHeader("ParamsMode", "HashMap"); + @SuppressWarnings("unchecked") final HashMap paramsMap = (HashMap) params; + // special handling for CALLBACK messages + if (messagingPattern == MessagingPattern.CALLBACK) { + String messageId = message.getMessageId(); + if (paramsMap.containsKey("CorrelationID")) { + if (paramsMap.get("CorrelationID") != null) { + messageId = paramsMap.get("CorrelationID"); + } else { + paramsMap.put("CorrelationID", messageId); + } + message.setMessageId(messageId); + } + LOG.debug("Message ID: {}", messageId); + if (paramsMap.containsKey("MessageID")) { + paramsMap.put("MessageID", messageId); + } else { + headers.put("MessageID", messageId); + } + if (paramsMap.containsKey("ReplyTo")) { + paramsMap.put("ReplyTo", AsyncRoute.PUBLIC_CALLBACKADDRESS); + } else { + headers.put("ReplyTo", AsyncRoute.PUBLIC_CALLBACKADDRESS); + } + if (paramsMap.containsKey("planCallbackAddress_invoker")) { + paramsMap.put("planCallbackAddress_invoker", "http://localhost:9763/services/" + csarID.csarName() + "InvokerService/"); + } else { + headers.put("planCallbackAddress_invoker", "http://localhost:9763/services/" + csarID.csarName() + "InvokerService/"); + } + } + + document = mapToDoc(messagePayloadType.getNamespaceURI(), messagePayloadType.getLocalPart(), paramsMap); + } + + if (params instanceof Document) { + document = (Document) params; + messagingPattern = determineMP(message, operationName, null, hasOutputParams); + } + + if (messagingPattern == null) { + LOG.error("Can't determine which kind of invocation is needed. Invocation aborted."); + return null; + } + + LOG.debug("Invoking the web service."); + + final ProducerTemplate template = camelContext.createProducerTemplate(); + final ConsumerTemplate consumer = camelContext.createConsumerTemplate(); + + Document response = null; + LOG.debug("Messaging pattern: {}", messagingPattern); + + switch (messagingPattern) { + case REQUEST_RESPONSE: + LOG.debug("Sync invocation."); + response = template.requestBodyAndHeaders("direct:Sync-WS-Invoke", document, headers, Document.class); + break; + case REQUEST_ONLY: + LOG.debug("Request-only invocation."); + template.sendBodyAndHeaders("direct:RequestOnly-WS-Invoke", document, headers); + return null; + case CALLBACK: + LOG.debug("Async invocation."); + final String messageID = message.getMessageId(); + LOG.debug("Storing exchange message with MessageID: {}", messageID); + EXCHANGE_MAP.put(messageID, exchange); + + template.sendBodyAndHeaders("direct:Async-WS-Invoke", document, headers); + Exchange ex = null; + while (response == null) { + try { + consumer.start(); + ex = consumer.receive("direct:Async-WS-Callback" + messageID); + consumer.stop(); + } catch (final Exception e) { + e.printStackTrace(); + } + + final Message mes = ex.getIn(); + LOG.debug("Got Message with ID: {}", messageID); + LOG.debug("Stored MessageIDs: {}", EXCHANGE_MAP.keySet().toString()); + if (EXCHANGE_MAP.containsKey(messageID)) { + LOG.debug("MessageID found"); + exchange = EXCHANGE_MAP.get(messageID); + response = mes.getBody(Document.class); + EXCHANGE_MAP.remove(messageID); + } + } + break; + default: + LOG.error("Unhandled messaging pattern \"{}\" in management bus soaphttp invocation plugin!", messagingPattern); + return null; + } + + if (exchange.getIn().getHeader("ParamsMode") != null + && exchange.getIn().getHeader("ParamsMode").equals("HashMap")) { + LOG.debug("Transforming Document to HashMap..."); + final HashMap responseMap = MBUtils.docToMap(response, false); + exchange.getIn().setBody(responseMap); + } else { + exchange.getIn().setBody(response); + } + + LOG.debug("Returning exchange with MessageID: {}", exchange.getIn().getMessageId()); + LOG.debug("Returning body: {}", exchange.getIn().getBody().toString()); + + return exchange; + } + + private String getPortName(Definition wsdl, BindingOperation operation) { + Binding binding = null; + final Map bindings = wsdl.getBindings(); + for (Map.Entry entry : bindings.entrySet()) { + Binding examined = wsdl.getBinding((QName) entry.getKey()); + if (examined.getBindingOperations().contains(operation)) { + binding = examined; + break; + } + } + Map services = wsdl.getServices(); + for (Service service : services.values()) { + Map ports = service.getPorts(); + for (Port port : ports.values()) { + if (port.getBinding().equals(binding)) { + return port.getName(); + } + } + } + return ""; + } + + private Definition pullWsdlDefinitions(String endpoint) { + if (!endpoint.endsWith("?wsdl")) { + endpoint = endpoint + "?wsdl"; + } + LOG.info("Parsing WSDL at: {}.", endpoint); + WSDLFactory wsdlFactory = null; + try { + wsdlFactory = WSDLFactory.newInstance(); + WSDLReader wsdlDefinitionReader = wsdlFactory.newWSDLReader(); + return wsdlDefinitionReader.readWSDL(endpoint); + } catch (WSDLException e) { + LOG.warn("Could not read WSDL definitions from endpoint {} due to WSDLException", endpoint, e); + } + return null; + } + + private BindingOperation findOperation(final Definition wsdl, final String operationName) { + if (wsdl == null) { + return null; + } + Map bindings = wsdl.getBindings(); + for (Map.Entry entry : bindings.entrySet()) { + Binding binding = wsdl.getBinding((QName) entry.getKey()); + List definedOperations = binding.getBindingOperations(); + for (BindingOperation operation : definedOperations) { + if (operation.getName().equalsIgnoreCase(operationName)) { + return operation; + } + } + } + return null; + } + + /** + * Determine if the specified operation of the specified wsdl defines output parameter. + * + * @return true if operation returns output params. Otherwise false. + * If operation can't be found null is returned. + */ + private boolean hasOutputDefined(final BindingOperation operation) { + // If wsdl is not accessible, try again (max wait 5 min) + return operation.getBindingOutput() != null; + } + + /** + * Determines which kind of invocation is needed for this operation. + * + * @return messagingPattern as String. + */ + private MessagingPattern determineMP(final Message message, final String operationName, final BindingOperation operation, final Boolean hasOutputParams) { + + // Plan should be invoked + if (message.getHeader(MBHeader.PLANID_QNAME.toString()) != null) { + LOG.debug("Invoking a plan with document as input."); + // Caller already knows if invocation is sync or async. + if (message.getHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString()) != null) { + if (!message.getHeader(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), Boolean.class)) { + return MessagingPattern.CALLBACK; + } else { + return MessagingPattern.REQUEST_RESPONSE; + } + } else if (operationName != null) { + // Plug-in needs to determine with wsdl. + final boolean hasOutputDefinedInWSDL = hasOutputDefined(operation); + if (hasOutputDefinedInWSDL) { + return MessagingPattern.REQUEST_RESPONSE; + } else { + return MessagingPattern.CALLBACK; + } + } + return null; + } else { + // Operation of IA should be invoked + LOG.debug("Invoking an operation of an implementation artifact."); + + final boolean hasOutputDefinedInWSDL = hasOutputDefined(operation); + if (hasOutputDefinedInWSDL) { + return MessagingPattern.REQUEST_RESPONSE; + } else if (hasOutputParams) { + return MessagingPattern.CALLBACK; + } else { + return MessagingPattern.REQUEST_ONLY; + } + } + } + + /** + * Transfers the paramsMap into a Document. + */ + private Document mapToDoc(final String rootElementNamespaceURI, final String rootElementName, + final Map paramsMap) { + final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = null; + try { + documentBuilder = documentBuilderFactory.newDocumentBuilder(); + } catch (final ParserConfigurationException e) { + LOG.error("Some error occured."); + e.printStackTrace(); + // return null to avoid NRE in this method + return null; + } + Document document = documentBuilder.newDocument(); + + final Element rootElement = document.createElementNS(rootElementNamespaceURI, rootElementName); + document.appendChild(rootElement); + for (final Entry entry : paramsMap.entrySet()) { + Element mapElement = document.createElement(entry.getKey()); + mapElement.setTextContent(entry.getValue()); + rootElement.appendChild(mapElement); + } + + return document; + } + + /** + * @return the keys of the map containing stored messageIds and exchange objects. + */ + public static Set getMessageIDs() { + return EXCHANGE_MAP.keySet(); + } + + @Override + public List getSupportedTypes() { + LOG.debug("Getting Types: {}.", + ManagementBusInvocationPluginSoapHttp.TYPES); + final List types = new ArrayList<>(); + + for (final String type : ManagementBusInvocationPluginSoapHttp.TYPES.split("[,;]")) { + types.add(type.trim()); + } + return types; + } + + private static class VariableMap implements XPathVariableResolver { + + Map values = new HashMap<>(); + + public void setVariable(QName variable, Object value) { + values.put(variable, value); + } + + @Override + public Object resolveVariable(QName qName) { + return values.get(qName); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/package-info.java new file mode 100644 index 000000000..a48940d60 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/package-info.java @@ -0,0 +1,8 @@ +/** + * This package contains one implementation of the {@link org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService}. + * This one supports the invocation of soap web services.

Copyright 2012 IAAS University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.invocation.plugin.soaphttp; diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/CallbackProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/CallbackProcessor.java new file mode 100644 index 000000000..3b30feb4b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/CallbackProcessor.java @@ -0,0 +1,86 @@ +package org.opentosca.bus.management.invocation.plugin.soaphttp.processor; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.xml.soap.MessageFactory; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPMessage; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.cxf.binding.soap.SoapHeader; +import org.apache.cxf.headers.Header; +import org.opentosca.bus.management.invocation.plugin.soaphttp.ManagementBusInvocationPluginSoapHttp; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Callback-Processor of the SOAP/HTTP-Invocation-Management-Bus-Plug-in.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * This processor processes incoming soap messages. It checks if the messages are containing existing messageIDs. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +public class CallbackProcessor implements Processor { + + final private static Logger LOG = LoggerFactory.getLogger(CallbackProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + final Set messageIDs = ManagementBusInvocationPluginSoapHttp.getMessageIDs(); + LOG.debug("Stored messageIDs: {}", messageIDs.toString()); + + // copy SOAP headers in camel exchange header + @SuppressWarnings("unchecked") final List soapHeaders = (List) exchange.getIn().getHeader(Header.HEADER_LIST); + Element element; + if (soapHeaders != null) { + for (final SoapHeader header : soapHeaders) { + element = (Element) header.getObject(); + exchange.getIn().setHeader(element.getLocalName(), element.getTextContent()); + } + } + + final String message = exchange.getIn().getBody(String.class); + final Map headers = exchange.getIn().getHeaders(); + + LOG.debug("Searching the callback Message for a MessageID matching the stored ones..."); + for (final String messageID : messageIDs) { + // checks if the callback message contains a stored messageID + // if (message.matches("(?s).*\\s*[^a-zA-Z0-9-]" + messageID + + // "[^a-zA-Z0-9-]\\s*(?s).*") || headers.containsValue(messageID)) { + if (message.contains(messageID) || headers.containsValue(messageID)) { + LOG.debug("Found MessageID: {}", messageID); + final MessageFactory messageFactory = MessageFactory.newInstance(); + + final InputStream inputStream = new ByteArrayInputStream(message.getBytes("UTF-8")); + final SOAPMessage soapMessage = messageFactory.createMessage(null, inputStream); + + exchange.getIn().setHeader("MessageID", messageID); + exchange.getIn().setHeader("AvailableMessageID", "true"); + + Document doc; + try { + doc = soapMessage.getSOAPBody().extractContentAsDocument(); + exchange.getIn().setBody(doc); + } catch (final SOAPException e) { + doc = soapMessage.getSOAPPart().getEnvelope().getOwnerDocument(); + LOG.warn("SOAP response body can't be parsed and/or isn't well formatted. Returning alternative response."); + exchange.getIn().setBody(doc); + } + break; + } + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/HeaderProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/HeaderProcessor.java new file mode 100644 index 000000000..148f570ef --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/HeaderProcessor.java @@ -0,0 +1,118 @@ +package org.opentosca.bus.management.invocation.plugin.soaphttp.processor; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.util.Map; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.apache.camel.Exchange; +import org.apache.camel.Processor; +import org.apache.camel.component.cxf.CxfPayload; +import org.apache.cxf.binding.soap.SoapHeader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Header-Processor of the Management Bus-SOAP/HTTP-Plug-in.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * This processor copies all self defined header of the exchange object into SoapHeader of the outgoing Soap message. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +@Component +public class HeaderProcessor implements Processor { + + private static final Logger LOG = LoggerFactory.getLogger(HeaderProcessor.class); + + @Override + public void process(final Exchange exchange) throws Exception { + final CxfPayload payload = exchange.getIn().getBody(CxfPayload.class); + + final Map headers = exchange.getIn().getHeaders(); + if (!headers.containsKey("SOAPEndpoint")) { + headers.put("SOAPEndpoint", headers.get("endpoint")); + } + for (final Map.Entry entry : headers.entrySet()) { + + if (entry.getKey().equalsIgnoreCase("ReplyTo")) { + + final String xml1 = "" + entry.getValue().toString() + + ""; + final SoapHeader replyToSoapHeader = + new SoapHeader(new QName("http://www.w3.org/2005/08/addressing", "ReplyTo"), + readXml(new StringReader(xml1)).getDocumentElement()); + payload.getHeaders().add(replyToSoapHeader); + } else if (entry.getKey().equalsIgnoreCase("MessageID")) { + final String xml2 = "" + entry.getValue().toString() + + ""; + final SoapHeader messageIdSoapHeader = + new SoapHeader(new QName("http://www.w3.org/2005/08/addressing", "MessageID"), + readXml(new StringReader(xml2)).getDocumentElement()); + payload.getHeaders().add(messageIdSoapHeader); + } else { + payload.getHeaders().add(this.getSoapHeader(entry.getKey(), entry.getValue().toString())); + } + } + exchange.getIn().setBody(payload); + } + + /** + * Returns a SoapHeader + * + * @param key of the header + * @param content of the header + * @return SoapHeader + */ + private SoapHeader getSoapHeader(final String key, final String content) { + final String xml = "<" + key + ">" + content + ""; + try { + return new SoapHeader(new QName(key), readXml(new StringReader(xml)).getDocumentElement()); + } catch (final SAXException | IOException | ParserConfigurationException e) { + LOG.warn("Failed to read SOAP Header {} -> {} with exception", key, content, e); + } + return null; + } + + public static Document readXml(final Reader is) throws SAXException, IOException, ParserConfigurationException { + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + + dbf.setValidating(false); + dbf.setIgnoringComments(false); + dbf.setIgnoringElementContentWhitespace(true); + dbf.setNamespaceAware(true); + // dbf.setCoalescing(true); + // dbf.setExpandEntityReferences(true); + + DocumentBuilder db = null; + db = dbf.newDocumentBuilder(); + db.setEntityResolver(new NullResolver()); + + // db.setErrorHandler( new MyErrorHandler()); + final InputSource ips = new InputSource(is); + return db.parse(ips); + } + + public static class NullResolver implements EntityResolver { + @Override + public InputSource resolveEntity(final String publicId, final String systemId) throws SAXException, + IOException { + return new InputSource(new StringReader("")); + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/package-info.java new file mode 100644 index 000000000..e2e608b5a --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/processor/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains a camel processor needed to handle the callback response of an asynchronous invocation.
+ *
Copyright 2012 IAAS University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.invocation.plugin.soaphttp.processor; diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/AsyncRoute.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/AsyncRoute.java similarity index 80% rename from org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/AsyncRoute.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/AsyncRoute.java index 7022d839d..848b77994 100644 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/AsyncRoute.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/AsyncRoute.java @@ -9,38 +9,30 @@ /** * Asynchronous route of SOAP/HTTP-Invocation-Management-Bus-Plug-in.
*
- * + *

* Copyright 2013 IAAS University of Stuttgart
*
- * - * This class manages the asynchronous communication with a service. Both invoking and handling the - * callback are done here. - * - * + *

+ * This class manages the asynchronous communication with a service. Both invoking and handling the callback are done + * here. * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * */ public class AsyncRoute extends RouteBuilder { - - public final static String PUBLIC_CALLBACKADDRESS = - "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":8087/callback"; + public final static String PUBLIC_CALLBACKADDRESS = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":8087/callback"; private final static String CALLBACKADDRESS = "http://0.0.0.0:8087/callback"; @Override public void configure() throws Exception { - final String ENDPOINT = "cxf:${header[endpoint]}?dataFormat=PAYLOAD&loggingFeatureEnabled=true"; + final String ENDPOINT = "cxf:${header[SOAPEndpoint]}?wsdlURL=${header[endpoint]}?wsdl&dataFormat=PAYLOAD&loggingFeatureEnabled=true"; final Processor headerProcessor = new HeaderProcessor(); - this.from("direct:Async-WS-Invoke").process(headerProcessor).recipientList(this.simple(ENDPOINT)).end(); final Processor callbackProcessor = new CallbackProcessor(); - this.from("jetty:" + AsyncRoute.CALLBACKADDRESS).to("stream:out").process(callbackProcessor).choice() .when(header("AvailableMessageID").isEqualTo("true")) .recipientList(this.simple("direct:Async-WS-Callback${header.MessageID}")).end(); } - } diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/RequestOnlyRoute.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/RequestOnlyRoute.java similarity index 98% rename from org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/RequestOnlyRoute.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/RequestOnlyRoute.java index cb4f365ff..033a81d38 100644 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/RequestOnlyRoute.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/RequestOnlyRoute.java @@ -7,27 +7,21 @@ /** * Request-only route of SOAP/HTTP-Invocation-Management-Bus-Plug-in.
*
- * + *

* Copyright 2013 IAAS University of Stuttgart
*
- * + *

* This class manages the request-only invocation of an service. * - * - * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * */ public class RequestOnlyRoute extends RouteBuilder { @Override public void configure() throws Exception { - final String ENDPOINT = "cxf:${header[endpoint]}?dataFormat=PAYLOAD&loggingFeatureEnabled=true"; final Processor headerProcessor = new HeaderProcessor(); - this.from("direct:RequestOnly-WS-Invoke").process(headerProcessor).recipientList(this.simple(ENDPOINT)); } - } diff --git a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/SyncRoute.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/SyncRoute.java similarity index 91% rename from org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/SyncRoute.java rename to org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/SyncRoute.java index 2cabf03a4..5e276db52 100644 --- a/org.opentosca.bus.management.invocation.plugin.soaphttp/src/org/opentosca/bus/management/invocation/plugin/soaphttp/route/SyncRoute.java +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/SyncRoute.java @@ -7,17 +7,14 @@ /** * Synchronous route of SOAP/HTTP-Invocation-Management-Bus-Plug-in.
*
- * + *

* Copyright 2013 IAAS University of Stuttgart
*
- * - * This class manages the synchronous communication with a service.It invokes the service and waits - * for the response from it. - * - * + *

+ * This class manages the synchronous communication with a service.It invokes the service and waits for the response + * from it. * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * */ public class SyncRoute extends RouteBuilder { @@ -26,7 +23,6 @@ public void configure() throws Exception { final String ENDPOINT = "cxf:${header[endpoint]}?dataFormat=PAYLOAD&loggingFeatureEnabled=true"; final Processor headerProcessor = new HeaderProcessor(); - this.from("direct:Sync-WS-Invoke").process(headerProcessor).recipientList(this.simple(ENDPOINT)); } } diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/package-info.java new file mode 100644 index 000000000..b2b89a4ea --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/java/org/opentosca/bus/management/invocation/plugin/soaphttp/route/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains three camel routes needed to invoke a soap web service in synchronous, asynchronous with + * callbacks and request-only style.

Copyright 2012 IAAS University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.invocation.plugin.soaphttp.route; diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/resources/spring/context-bus-invocation-plugin.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/resources/spring/context-bus-invocation-plugin.xml new file mode 100644 index 000000000..67366de33 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin.soaphttp/src/main/resources/spring/context-bus-invocation-plugin.xml @@ -0,0 +1,28 @@ + + + + Register the beans within the soaphttp management bus invocation plugin. + + + + + + + + org.opentosca.bus.management.invocation.plugin.soaphttp.route + + + + + + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin/pom.xml new file mode 100644 index 000000000..819918659 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + org.opentosca.bus.management.invocation.plugin + + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + + + org.apache.camel + camel-core + ${camel.version} + + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin/src/main/java/org/opentosca/bus/management/invocation/plugin/IManagementBusInvocationPluginService.java b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin/src/main/java/org/opentosca/bus/management/invocation/plugin/IManagementBusInvocationPluginService.java new file mode 100644 index 000000000..7a7d7b0db --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.invocation.plugin/src/main/java/org/opentosca/bus/management/invocation/plugin/IManagementBusInvocationPluginService.java @@ -0,0 +1,34 @@ +package org.opentosca.bus.management.invocation.plugin; + +import java.util.List; + +import org.apache.camel.Exchange; + +/** + * Interface of the Management Bus Invocation Plug-ins.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * The interface specifies two methods. One for invoking a service like an operation of an implementation artifact or a + * plan and one method that returns the supported invocation-type of the plug-in. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public interface IManagementBusInvocationPluginService { + + /** + * Invokes a service like an ImplementationArtifact or a Plan. + * + * @param exchange contains all needed information like endpoint of the service, the operation to invoke and the + * data to be transferred. + * @return the response of the invoked service as body of the exchange message. + */ + Exchange invoke(Exchange exchange); + + /** + * Returns the supported invocation-types of the plug-in. + */ + List getSupportedTypes(); +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/pom.xml b/org.opentosca.bus/org.opentosca.bus.management.service/pom.xml new file mode 100644 index 000000000..409b5bec3 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/pom.xml @@ -0,0 +1,57 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management.service + + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.bus.management.deployment.plugin + ${project.version} + + + org.opentosca + org.opentosca.bus.management.invocation.plugin + ${project.version} + + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + + + + org.apache.camel + camel-jaxb + ${camel.version} + + + org.apache.camel + camel-core + ${camel.version} + + + org.apache.camel + camel-spring + ${camel.version} + + + diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/extensions/SimpleFunctionConverter.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/extensions/SimpleFunctionConverter.java new file mode 100644 index 000000000..686caf7e3 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/extensions/SimpleFunctionConverter.java @@ -0,0 +1,86 @@ +package org.opentosca.bus.management.extensions; + +import java.util.function.Function; + +import org.apache.camel.Exchange; +import org.apache.camel.NoTypeConversionAvailableException; +import org.apache.camel.TypeConversionException; +import org.apache.camel.TypeConverter; +import org.eclipse.jdt.annotation.Nullable; + +public class SimpleFunctionConverter implements TypeConverter { + + private final Function conversion; + private final Class fromType; + private final Class toType; + private final boolean allowNull; + + public SimpleFunctionConverter(Function conversion, Class fromType, Class toType, boolean allowNull) { + this.conversion = conversion; + this.fromType = fromType; + this.toType = toType; + this.allowNull = allowNull; + } + + @Override + public boolean allowNull() { + return allowNull; + } + + @Override + @Nullable + public T convertTo(Class type, Object value) throws TypeConversionException { + if (value == null && !allowNull) { + return null; + } + if (!fromType.isAssignableFrom(value.getClass())) { + return null; + } + O result = conversion.apply(fromType.cast(value)); + if (type.isAssignableFrom(toType)) { + return type.cast(result); + } + return null; + } + + @Override + public T convertTo(Class type, Exchange exchange, Object value) throws TypeConversionException { + return convertTo(type, value); + } + + @Override + public T mandatoryConvertTo(Class type, Object value) throws TypeConversionException, + NoTypeConversionAvailableException { + if (value == null && !allowNull) { + throw new NoTypeConversionAvailableException(value, type); + } + if (!fromType.isAssignableFrom(value.getClass())) { + throw new NoTypeConversionAvailableException(value, type); + } + O result = conversion.apply(fromType.cast(value)); + if (type.isAssignableFrom(toType)) { + return type.cast(result); + } + throw new NoTypeConversionAvailableException(value, type); + } + + @Override + public T mandatoryConvertTo(Class type, Exchange exchange, Object value) throws TypeConversionException, + NoTypeConversionAvailableException { + return mandatoryConvertTo(type, value); + } + + @Override + public T tryConvertTo(Class type, Object value) { + try { + return convertTo(type, value); + } catch (TypeConversionException swallow) { + return null; + } + } + + @Override + public T tryConvertTo(Class type, Exchange exchange, Object value) { + return tryConvertTo(type, value); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/IManagementBusService.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/IManagementBusService.java new file mode 100644 index 000000000..b994008e2 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/IManagementBusService.java @@ -0,0 +1,37 @@ +package org.opentosca.bus.management.service; + +import org.apache.camel.Exchange; + +/** + * Interface of the Management Bus.
+ *
+ *

+ * Copyright 2013 IAAS University of Stuttgart
+ *
+ *

+ * The interface specifies two methods. One for deploying an implementation artifact and invoking an operation of it. + * Another method can be used for invoking a plan. + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +public interface IManagementBusService { + + /** + * Handles the invoke-request of an implementation artifact. This includes the deployment of the implementation + * artifact on a suited infrastructure if needed. + * + * @param exchange contains all needed information like csarID, ServiceTemplateID,... to determine the + * implementation artifact and the data to be transferred to it. + * @return the response of the invoked implementation artifact as body of the exchange message. + */ + void invokeIA(Exchange exchange); + + /** + * Handles the invoke-request of a plan. + * + * @param exchange contains all needed information like csarID, PlanID,... to get the endpoint of the specified plan + * and the data to be transferred to it. + * @return the response of the invoked plan as body of the exchange message. + */ + void invokePlan(Exchange exchange); +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/Constants.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/Constants.java new file mode 100644 index 000000000..9f8ee422f --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/Constants.java @@ -0,0 +1,63 @@ +package org.opentosca.bus.management.service.impl; + +import org.opentosca.container.core.common.Settings; + +/** + * This class contains constants which are used by the Management Bus classes.
+ *
+ *

+ * Copyright 2019 IAAS University of Stuttgart + */ +public class Constants { + + // region Collaboration + + /** + * URL to access the local Moquette MQTT broker + */ + public final static String LOCAL_MQTT_BROKER = + "tcp://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_BROKER_MQTT_PORT; + + /** + * Topic name where the OpenTOSCA Container sends his request to and where it expects requests at the MQTT broker of + * the 'master' OpenTOSCA Container in case it acts as a 'slave'. This topic name has to be consistent between + * interacting OpenTOSCA Containers. + */ + public final static String REQUEST_TOPIC = "opentosca/container/collaboration/request"; + + /** + * Topic name where the OpenTOSCA Container expects responses to his requests. This topic name is set as "reply-to" + * header field in requests. So, it could also be created dynamically and does not necessarily have to be consistent + * between different Containers. + */ + public final static String RESPONSE_TOPIC = "opentosca/container/collaboration/response"; + + /** + * The invocation and deployment type of the invocation/deployment plug-ins that move requests from the local + * OpenTOSCA Container to a remote one. This type has to be different from all types that are supported by all other + * invocation and deployment plug-ins. + */ + public final static String REMOTE_TYPE = "remote"; + + // endregion + + // region General + + /** + * Start and end tags for properties that have to be replaced by instance data + */ + public final static String PLACEHOLDER_START = "/PLACEHOLDER_"; + public final static String PLACEHOLDER_END = "_PLACEHOLDER/"; + + /** + * Path to access the process instances in the Camunda BPMN engine + */ + public final static String PROCESS_INSTANCE_PATH = "/process-instance?processInstanceIds="; + + /** + * Path to access the output parameters in the Camunda BPMN engine + */ + public final static String HISTORY_PATH = "/history/variable-instance"; + + // endregion +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/ManagementBusServiceImpl.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/ManagementBusServiceImpl.java new file mode 100644 index 000000000..475cc60e4 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/ManagementBusServiceImpl.java @@ -0,0 +1,1063 @@ +package org.opentosca.bus.management.service.impl; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.xml.namespace.QName; + +import org.eclipse.winery.common.ids.definitions.ArtifactTemplateId; +import org.eclipse.winery.model.tosca.TArtifactReference; +import org.eclipse.winery.model.tosca.TArtifactTemplate; +import org.eclipse.winery.model.tosca.TEntityType; +import org.eclipse.winery.model.tosca.TEntityTypeImplementation; +import org.eclipse.winery.model.tosca.TImplementationArtifact; +import org.eclipse.winery.model.tosca.TImplementationArtifacts; +import org.eclipse.winery.model.tosca.TInterface; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TOperation; +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TRelationshipTemplate; +import org.eclipse.winery.model.tosca.TRelationshipType; +import org.eclipse.winery.model.tosca.TRequiredContainerFeatures; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.impl.DefaultExchange; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.service.IManagementBusService; +import org.opentosca.bus.management.service.impl.collaboration.CollaborationContext; +import org.opentosca.bus.management.service.impl.collaboration.DeploymentDistributionDecisionMaker; +import org.opentosca.bus.management.service.impl.instance.plan.PlanInstanceHandler; +import org.opentosca.bus.management.service.impl.util.DeploymentPluginCapabilityChecker; +import org.opentosca.bus.management.service.impl.util.ParameterHandler; +import org.opentosca.bus.management.service.impl.util.PluginHandler; +import org.opentosca.bus.management.service.impl.util.Util; +import org.opentosca.bus.management.utils.MBUtils; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.common.xml.XMLHelper; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.engine.next.ContainerEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanInstanceEvent; +import org.opentosca.container.core.next.model.PlanLanguage; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.repository.PlanInstanceRepository; +import org.opentosca.container.core.next.trigger.SituationTriggerInstanceListener; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.opentosca.container.core.tosca.convention.Types; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Engine for delegating invoke-requests of implementation artifacts or plans to matching plug-ins.
+ *
+ *

+ * Copyright 2019 IAAS University of Stuttgart
+ *
+ *

+ * The engine gets the invoke-request as a camel exchange object with all needed parameters (e.g. CSARID, + * ServiceTemplateID, CorrelationID...) in the header and the actual invoke message in the body of it.
+ *
+ *

+ * In case of invoking an operation of an implementation artifact, the engine identifies with help of the + * ToscaEngine and the parameters from the header the right implementation artifact. Afterwards it checks if + * the implementation artifact is already deployed by using the + * EndpointService. If this is not the case it tries to deploy the implementation artifact + * by using an available deployment plug-in and stores a corresponding endpoint. When an endpoint was found/created the + * engine determines which invocation plug-in has to be used to call the operation. Therefore, the engine uses + * information like the ArtifactType of the implementation artifact or a specified property like {@literal + * <}namespace:InvocationType{@literal >}... {@literal <}/namespace:InvocationType{@literal >}. Finally, the engine + * calls the implementation artifact operation by passing the exchange to the invocation plug-in. The engine is also + * able to update request parameters from stored InstanceData before passing the request on.
+ *
+ *

+ * In case of invoking a plan no deployment is needed as this is already done when the corresponding CSAR is deployed on + * the OpenTOSCA Container. The engine determines the invocation plug-in by checking the language of the plan and + * afterwards invokes the plan via this plug-in.
+ *
+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @author Benjamin Weder - st100495@stud.uni-stuttgart.de + * @see IManagementBusDeploymentPluginService + * @see ICoreEndpointService + */ + +@Service +@Named("managementBusService") +public class ManagementBusServiceImpl implements IManagementBusService { + + private final static Logger LOG = LoggerFactory.getLogger(ManagementBusServiceImpl.class); + + private final static Map locks = new HashMap<>(); + + private final DeploymentDistributionDecisionMaker decisionMaker; + private final CollaborationContext collaborationContext; + private final ICoreEndpointService endpointService; + private final ParameterHandler parameterHandler; + private final PluginHandler pluginHandler; + private final PluginRegistry pluginRegistry; + private final DeploymentPluginCapabilityChecker capabilityChecker; + private final ContainerEngine containerEngine; + + private final CsarStorageService storage; + + @Inject + public ManagementBusServiceImpl(DeploymentDistributionDecisionMaker decisionMaker, + CollaborationContext collaborationContext, + ICoreEndpointService endpointService, + ParameterHandler parameterHandler, + PluginHandler pluginHandler, + PluginRegistry pluginRegistry, + DeploymentPluginCapabilityChecker capabilityChecker, + ContainerEngine containerEngine, CsarStorageService storage) { + LOG.info("Instantiating ManagementBus Service"); + this.decisionMaker = decisionMaker; + this.collaborationContext = collaborationContext; + this.endpointService = endpointService; + this.parameterHandler = parameterHandler; + this.pluginHandler = pluginHandler; + this.pluginRegistry = pluginRegistry; + this.capabilityChecker = capabilityChecker; + this.storage = storage; + this.containerEngine = containerEngine; + } + + @Override + public void invokeIA(final Exchange exchange) { + final Message message = exchange.getIn(); + + final URI serviceInstanceID = message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), URI.class); + LOG.debug("ServiceInstanceID: {}", serviceInstanceID); + // get the ServiceTemplateInstance ID Long from the serviceInstanceID URI + final Long serviceTemplateInstanceID = Util.determineServiceTemplateInstanceId(serviceInstanceID); + + final CsarId csarID = message.getHeader(MBHeader.CSARID.toString(), CsarId.class); + LOG.debug("CSARID: {}", csarID.toString()); + final QName serviceTemplateID = message.getHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), QName.class); + LOG.debug("serviceTemplateID: {}", serviceTemplateID); + + final String nodeTemplateID = message.getHeader(MBHeader.NODETEMPLATEID_STRING.toString(), String.class); + LOG.debug("NodeTemplateID: {}", nodeTemplateID); + + final String relationship = message.getHeader(MBHeader.RELATIONSHIPTEMPLATEID_STRING.toString(), String.class); + LOG.debug("RelationshipTemplateID: {}", relationship); + + final String neededInterface = message.getHeader(MBHeader.INTERFACENAME_STRING.toString(), String.class); + LOG.debug("Interface: {}", neededInterface); + + final String neededOperation = message.getHeader(MBHeader.OPERATIONNAME_STRING.toString(), String.class); + LOG.debug("Operation: {}", neededOperation); + + // log event to monitor the IA execution time + final PlanInstanceEvent event; + // operation invocation is only possible with retrieved ServiceTemplateInstance ID + if (!serviceTemplateInstanceID.equals(Long.MIN_VALUE)) { + + final IAInvocationArguments arguments = new IAInvocationArguments(csarID, serviceInstanceID, serviceTemplateID, serviceTemplateInstanceID, + nodeTemplateID, relationship, neededInterface, neededOperation); + event = internalInvokeIA(arguments, exchange); + LOG.info("IA execution duration: {}", event.getDuration()); + } else { + LOG.error("Unable to invoke operation without ServiceTemplateInstance ID!"); + handleResponse(exchange); + event = new PlanInstanceEvent("WARN", "IA_DURATION_LOG", "Unable to invoke operation without ServiceTemplateInstance ID!"); + } + + final String correlationID = message.getHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), String.class); + LOG.debug("Correlation ID: {}", correlationID); + if (Objects.nonNull(correlationID)) { + // update plan in repository with new log event + final PlanInstanceRepository repo = new PlanInstanceRepository(); + final PlanInstance plan = repo.findByCorrelationId(correlationID); + if (Objects.nonNull(plan)) { + plan.addEvent(event); + repo.update(plan); + } + } + + if (Objects.nonNull(correlationID)) { + // add end timestamp and log message with duration + event.setEndTimestamp(new Date()); + final long duration = event.getEndTimestamp().getTime() - event.getStartTimestamp().getTime(); + event.setMessage("Finished execution of IA for NodeTemplate '" + nodeTemplateID + "' interface '" + + neededInterface + "' and operation '" + neededOperation + "' after " + duration + "ms"); + LOG.info("IA execution duration: {}ms", duration); + event.setNodeTemplateID(nodeTemplateID); + event.setInterfaceName(neededInterface); + event.setOperationName(neededOperation); + event.setExecutionDuration(duration); + + // update plan in repository with new log event + final PlanInstanceRepository repo = new PlanInstanceRepository(); + final PlanInstance plan = repo.findByCorrelationId(correlationID); + + if (Objects.nonNull(plan)) { + plan.addEvent(event); + repo.update(plan); + } + } + } + + private void respondViaMocking(final TOperation.@Nullable OutputParameters outputParameters, final Exchange exchange) { + + final long waitTime = System.currentTimeMillis() + 1000; + while (System.currentTimeMillis() > waitTime) { + // busy waiting here... + } + + final Message message = exchange.getIn(); + final Map responseMap = new HashMap<>(); + + final Object params = message.getBody(); + if (params != null && params instanceof HashMap && ((HashMap) params).values().contains("fault")) { + responseMap.put("Fault", "managementBusMockFaultValue"); + } + + if (outputParameters == null || outputParameters.getOutputParameter().isEmpty()) { + return; + } + + outputParameters.getOutputParameter() + .forEach(param -> { + responseMap.put(param.getName(), "managementBusMockValue"); + }); + + exchange.getIn().setBody(responseMap); + handleResponse(exchange); + } + + /** + * Searches for the NodeType/RelationshipType of the given operation, updates the input parameters and passes the + * request on to invoke the corresponding IA. + * + * @param exchange exchange containing the header fields which identify the current operation + * @param arguments a bundle-object containing all relevant invocation arguments + */ + private PlanInstanceEvent internalInvokeIA(IAInvocationArguments arguments, Exchange exchange) { + LOG.debug("Starting Management Bus: InvokeIA"); + + final Message message = exchange.getIn(); + + // log event to monitor the IA execution time + final PlanInstanceEvent event = new PlanInstanceEvent("INFO", "IA_DURATION_LOG", + "Finished execution of IA for NodeTemplate '" + arguments.nodeTemplateId + "' interface '" + arguments.interfaceName + "' and operation '" + arguments.operationName + "'"); + + final Csar csar = storage.findById(arguments.csarId); + final TServiceTemplate serviceTemplate; + try { + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, arguments.serviceTemplateId); + } catch (NotFoundException e) { + LOG.error("ServiceTemplate {} does not exist within Csar {}. Aborting IA Invocation", arguments.serviceTemplateId, arguments.csarId.csarName()); + event.setEndTimestamp(new Date()); + return event; + } + + QName typeID = null; + if (Objects.nonNull(arguments.nodeTemplateId)) { + Optional nodeTemplate = ToscaEngine.getNodeTemplate(serviceTemplate, arguments.nodeTemplateId); + if (nodeTemplate.isPresent()) { + typeID = nodeTemplate.get().getType(); + } + } else if (Objects.nonNull(arguments.relationshipTemplateId)) { + Optional relTemplate = ToscaEngine.getRelationshipTemplate(serviceTemplate, arguments.relationshipTemplateId); + if (relTemplate.isPresent()) { + typeID = relTemplate.get().getType(); + } + } + if (typeID == null) { + LOG.error(String.format("Could not resolve a type for the given nodeTemplateId/relationshipTemplateId [%s/%s]", + arguments.nodeTemplateId, arguments.relationshipTemplateId)); + handleResponse(exchange); + event.setEndTimestamp(new Date()); + return event; + } + + // invocation is only possible with retrieved type which contains the operation + TEntityType type; + try { + type = ToscaEngine.resolveEntityTypeReference(csar, typeID); + } catch (NotFoundException e) { + type = null; + } + if (!Objects.nonNull(typeID) || !Objects.nonNull(type)) { + LOG.error("Unable to retrieve the NodeType/RelationshipType for NodeTemplate: {} and RelationshipTemplate: {}", + arguments.nodeTemplateId, arguments.relationshipTemplateId); + handleResponse(exchange); + event.setEndTimestamp(new Date()); + return event; + } + + // get NodeTemplateInstance object for the deployment distribution decision + NodeTemplateInstance nodeInstance; + final RelationshipTemplateInstance relationshipInstance; + if (Objects.nonNull(arguments.nodeTemplateId)) { + nodeInstance = MBUtils.getNodeTemplateInstance(arguments.serviceTemplateInstanceId, arguments.nodeTemplateId); + relationshipInstance = null; + } else if (Objects.nonNull(arguments.relationshipTemplateId)) { + relationshipInstance = MBUtils.getRelationshipTemplateInstance(arguments.serviceTemplateInstanceId, arguments.relationshipTemplateId); + // assuming type is a TRelationshipType, because otherwise this should be unreachable + TRelationshipType relationshipType = (TRelationshipType) type; + if (Objects.nonNull(relationshipInstance) && Objects.nonNull(relationshipType)) { + nodeInstance = containerEngine.resolveRelationshipOperationTarget(relationshipInstance, + relationshipType, + arguments.interfaceName, arguments.operationName); + } else { + nodeInstance = null; + } + } else { + relationshipInstance = null; + nodeInstance = null; + } + + Csar replacementCsar = null; + if (typeID.equals(Types.abstractOperatingSystemNodeType)) { + // replace abstract operating system node instance + nodeInstance = MBUtils.getAbstractOSReplacementInstance(nodeInstance); + assert (nodeInstance != null); // if not, we're fucked anyways + final ServiceTemplateInstance replacementSTI = nodeInstance.getServiceTemplateInstance(); + replacementCsar = storage.findById(replacementSTI.getCsarId()); + try { + final TServiceTemplate replacementST = ToscaEngine.resolveServiceTemplate(replacementCsar, replacementSTI.getTemplateId()); + final TNodeTemplate replacementTemplate = ToscaEngine.resolveNodeTemplate(replacementST, nodeInstance.getTemplateId()); + type = ToscaEngine.resolveNodeType(replacementCsar, replacementTemplate); + } catch (NotFoundException e) { + LOG.error("Could not compute replacing type for abstract Operating System Node replacement. Aborting IA invocation.", e); + handleResponse(exchange); + event.setEndTimestamp(new Date()); + return event; + } + } + + // update input parameters for the operation call + if (message.getBody() instanceof HashMap) { + @SuppressWarnings("unchecked") + Map inputParams = (Map) message.getBody(); + + inputParams = parameterHandler.updateInputParams(inputParams, replacementCsar == null ? csar : replacementCsar, + nodeInstance, relationshipInstance, arguments.interfaceName, arguments.operationName); + message.setBody(inputParams); + } else { + LOG.warn("There are no input parameters specified."); + } + + internalInvokeIA(exchange, replacementCsar != null ? replacementCsar : csar, arguments.serviceTemplateInstanceId, type, nodeInstance, arguments.interfaceName, arguments.operationName); + event.setEndTimestamp(new Date()); + return event; + } + + /** + * Searches the right IA for the given operation and invokes it with the given parameters. + * + * @param exchange exchange containing the input parameters of the operation + * @param csar the CSAR + * @param serviceTemplateInstanceID ID of the service instance + * @param type NodeType/RelationshipType that implements the operation + * @param nodeTemplateInstance NodeTemplateInstance for the deployment distribution decision + * @param neededInterface the interface of the searched operation + * @param neededOperation the searched operation + */ + private void internalInvokeIA(final Exchange exchange, final Csar csar, final Long serviceTemplateInstanceID, + final TEntityType type, final NodeTemplateInstance nodeTemplateInstance, + final String neededInterface, final String neededOperation) { + + LOG.debug("NodeType/RelationshipType: {}", type.getQName()); + final Message message = exchange.getIn(); + + // check whether operation has output parameters + final boolean hasOutputParams; + try { + TInterface nodeTypeInterface = ToscaEngine.resolveInterfaceAbstract(type, neededInterface); + TOperation operation = ToscaEngine.resolveOperation(nodeTypeInterface, neededOperation); + hasOutputParams = operation.getOutputParameters() != null && !operation.getOutputParameters().getOutputParameter().isEmpty(); + if (Boolean.parseBoolean(Settings.OPENTOSCA_BUS_MANAGEMENT_MOCK)) { + respondViaMocking(operation.getOutputParameters(), exchange); + return; + } + } catch (NotFoundException notFound) { + LOG.warn("Tried to invoke an unknown operation on an IA"); + return; + } + message.setHeader(MBHeader.HASOUTPUTPARAMS_BOOLEAN.toString(), hasOutputParams); + + final List typeImplementations = ToscaEngine.getTypeImplementations(csar, type); + + LOG.debug("List of Node/RelationshipTypeImplementations: {}", typeImplementations.toString()); + + // Search for an IA that implements the right operation and which is deployable and + // invokable by available plug-ins + for (TEntityTypeImplementation implementation : typeImplementations) { + message.setHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), implementation.getQName()); + final List ias = Optional.ofNullable(implementation.getImplementationArtifacts()) + .map(TImplementationArtifacts::getImplementationArtifact) + .orElse(Collections.emptyList()); + LOG.debug("List of Implementation Artifacts: {}", ias.stream().map(ia -> { + return String.format("{%s, %s %s}", ia.getIdFromIdOrNameField(), ia.getOperationName(), ia.getArtifactRef()); + }).collect(Collectors.joining(", "))); + + for (final TImplementationArtifact ia : ias) { + // try to invoke the operation on the current IA + if (invokeIAOperation(exchange, csar, serviceTemplateInstanceID, type, nodeTemplateInstance, + implementation, ia, neededInterface, neededOperation)) { + LOG.info("Successfully invoked Operation {} on IA {}", neededOperation, ia.getName()); + return; + } + } + } + + LOG.warn("No invokable implementation artifact found that provides required interface/operation."); + handleResponse(exchange); + } + + /** + * Invokes the given operation on the given IA if it implements it. If the IA is not yet deployed, the deployment is + * performed before the invocation. + * + * @param exchange exchange containing the input parameters of the operation + * @param csar The CSAR + * @param serviceTemplateInstanceID ID of the service instance + * @param type NodeType/RelationshipType that implements the operation + * @param nodeTemplateInstance NodeTemplateInstance for the deployment distribution decision + * @param typeImplementation NodeTypeImpl/RelationshipTypeImpl containing the IA + * @param ia the Implementation Artifact itself + * @param neededInterface the interface of the searched operation + * @param neededOperation the searched operation + * @return true if the IA implements the given operation and it was invoked + * successfully, false otherwise + */ + private boolean invokeIAOperation(Exchange exchange, final Csar csar, final Long serviceTemplateInstanceID, + final TEntityType type, final NodeTemplateInstance nodeTemplateInstance, + final TEntityTypeImplementation typeImplementation, final TImplementationArtifact ia, + final String neededInterface, final String neededOperation) { + LOG.debug("Trying to invoke Implementation Artifact: {}", ia.getName()); + final Message message = exchange.getIn(); + + // host name of the container which triggered the IA invocation + final String triggeringContainer = Settings.OPENTOSCA_CONTAINER_HOSTNAME; + message.setHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), triggeringContainer); + + // check if requested interface/operation is provided + if (!iaProvidesRequestedOperation(csar, ia, type, neededInterface, neededOperation)) { + LOG.debug("Implementation Artifact does not provide the requested operation."); + return false; + } + + // get ArtifactTemplate and ArtifactType of the IA + ArtifactTemplateId artifactTemplateId = new ArtifactTemplateId(ia.getArtifactRef()); + TArtifactTemplate artifactTemplate = (TArtifactTemplate) csar.queryRepository(artifactTemplateId); + LOG.debug("ArtifactTemplate: {}", artifactTemplate.toString()); + + final QName artifactTypeQName = ia.getArtifactType(); + LOG.debug("ArtifactType: {}", artifactTypeQName); + + // retrieve deployment type for the IA + final String deploymentType = pluginHandler.getSupportedDeploymentType(artifactTypeQName); + if (Objects.isNull(deploymentType)) { + LOG.debug("No deployment plug-in found which supports the deployment of ArtifactType {}", artifactTypeQName); + return false; + } + + // retrieve invocation type for the IA + final String invocationType = pluginHandler.getSupportedInvocationType(artifactTypeQName, artifactTemplate); + if (Objects.isNull(invocationType)) { + LOG.debug("No invocation plug-in found which supports the invocation of ArtifactType {} and ArtifactTemplate {}", + artifactTypeQName, artifactTemplate.getId()); + return false; + } + + LOG.debug("Deployment type {} and invocation type {} are supported.", deploymentType, invocationType); + + // retrieve portType property if specified + final QName portType = Util.getPortTypeQName(artifactTemplate); + + // retrieve specific content for the IA if defined and add to the headers + exchange = addSpecificContent(exchange, ia); + + // host name of the container where the IA has to be deployed + final String deploymentLocation = decisionMaker.getDeploymentLocation(nodeTemplateInstance); + LOG.debug("Host name of responsible OpenTOSCA Container: {}", deploymentLocation); + + // set needed header fields for the invocation/deployment plug-ins + message.setHeader(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), deploymentLocation); + message.setHeader(MBHeader.PORT_TYPE_QNAME.toString(), portType); + message.setHeader(MBHeader.INVOCATIONTYPE_STRING.toString(), invocationType); + message.setHeader(MBHeader.IMPLEMENTATION_ARTIFACT_NAME_STRING.toString(), ia.getName()); + message.setHeader(MBHeader.ARTIFACTTEMPLATEID_QNAME.toString(), artifactTemplateId.getQName()); + message.setHeader(MBHeader.ARTIFACTTYPEID_STRING.toString(), artifactTypeQName); + + // Prevent two threads from trying to deploy the same IA concurrently and avoid the deletion + // of an IA after successful checking that an IA is already deployed. + final String identifier = getUniqueSynchronizationString(triggeringContainer, deploymentLocation, typeImplementation.getQName(), ia.getName(), serviceTemplateInstanceID.toString()); + synchronized (getLockForString(identifier)) { + + LOG.debug("Checking whether IA [{}] was already deployed", ia.getName()); + + // check whether there are already stored endpoints for this IA + final List endpoints = endpointService.getWSDLEndpointsForNTImplAndIAName(triggeringContainer, deploymentLocation, typeImplementation.getQName(), ia.getName()); + + if (Objects.nonNull(endpoints) && !endpoints.isEmpty()) { + LOG.debug("IA is already deployed."); + + URI endpointURI = endpoints.get(0).getURI(); + message.setHeader(MBHeader.ENDPOINT_URI.toString(), endpointURI); + + Optional currentEndpoint = endpoints.stream() + .filter(wsdlEndpoint -> wsdlEndpoint.getServiceTemplateInstanceID().equals(serviceTemplateInstanceID)) + .findFirst(); + + if (!currentEndpoint.isPresent()) { + // store new endpoint for the IA + final WSDLEndpoint endpoint = new WSDLEndpoint(endpointURI, portType, triggeringContainer, + deploymentLocation, csar.id(), serviceTemplateInstanceID, null, typeImplementation.getQName(), ia.getName(), new HashMap<>()); + endpointService.storeWSDLEndpoint(endpoint); + } + + // Call IA, send response to caller and terminate bus + LOG.debug("Trying to invoke the operation on the deployed implementation artifact."); + handleResponse(pluginHandler.callMatchingInvocationPlugin(exchange, invocationType, deploymentLocation)); + return true; + } + LOG.debug("IA not yet deployed. Trying to deploy..."); + LOG.debug("Checking if all required features are met by the deployment plug-in or the environment."); + + final IManagementBusDeploymentPluginService deploymentPlugin = pluginRegistry.getDeploymentPluginServices().get(deploymentType); + // retrieve required features for the TypeImplementation + final TRequiredContainerFeatures requiredFeatures = typeImplementation.getRequiredContainerFeatures(); + + // check whether all features are met and abort deployment otherwise + if (!capabilityChecker.capabilitiesAreMet(requiredFeatures, deploymentPlugin)) { + LOG.debug("Required features not completely satisfied by the plug-in."); + return false; + } + + // get all artifact references for this ArtifactTemplate + final List artifacts = Optional.ofNullable(artifactTemplate.getArtifactReferences()) + .map(TArtifactTemplate.ArtifactReferences::getArtifactReference) + .orElse(Collections.emptyList()); + + // convert relative references to absolute references to enable access to the IA + // files from other OpenTOSCA Container nodes + LOG.debug("Searching for artifact references for ArtifactTemplate {}", artifactTemplate.getIdFromIdOrNameField()); + final List artifactReferences = new ArrayList<>(); + for (final TArtifactReference artifact : artifacts) { + // XML validated to be anyUri, therefore must be parsable as URI + URI reference = URI.create(artifact.getReference().trim()); + if (reference.getScheme() != null) { + LOG.warn("ArtifactReference {} of Csar {} is not supported", artifact.getReference(), csar.id()); + continue; + } + // artifact is exposed via the content endpoint + String absoluteArtifactReference = Settings.OPENTOSCA_CONTAINER_CONTENT_API + .replace("{csarid}", csar.id().csarName()) + // reference here is relative to CSAR basedirectory, with spaces being URLEncoded + .replace("{artifactreference}", artifact.getReference().trim().replaceAll(" ", "%20")); + + artifactReferences.add(absoluteArtifactReference); + LOG.debug("Found reference: {} ", absoluteArtifactReference); + } + + if (artifactReferences.isEmpty()) { + LOG.debug("No artifact references found. No deployment and invocation possible for this ArtifactTemplate."); + return false; + } + // add references list to header to enable access from the deployment plug-ins + message.setHeader(MBHeader.ARTIFACTREFERENCES_LISTSTRING.toString(), artifactReferences); + + // search ServiceEndpoint property for the artifact + final String serviceEndpoint = Util.getProperty(artifactTemplate, "ServiceEndpoint"); + message.setHeader(MBHeader.ARTIFACTSERVICEENDPOINT_STRING.toString(), serviceEndpoint); + + if (Objects.nonNull(serviceEndpoint)) { + LOG.debug("ServiceEndpoint property: {}", serviceEndpoint); + } else { + LOG.debug("No ServiceEndpoint property defined!"); + } + + // invoke deployment + exchange = pluginHandler.callMatchingDeploymentPlugin(exchange, deploymentType, deploymentLocation); + URI endpointURI = message.getHeader(MBHeader.ENDPOINT_URI.toString(), URI.class); + + if (!Objects.nonNull(endpointURI)) { + LOG.debug("IA deployment failed."); + return false; + } + if (endpointURI.toString().contains(Constants.PLACEHOLDER_START) + && endpointURI.toString().contains(Constants.PLACEHOLDER_END)) { + + // If a placeholder is specified, the service is part of the topology. + // We do not store this endpoints as they are not part of the management environment. + LOG.debug("Received endpoint contains placeholders. Service is part of the topology and called without deployment."); + endpointURI = replacePlaceholderWithInstanceData(endpointURI, nodeTemplateInstance); + message.setHeader(MBHeader.ENDPOINT_URI.toString(), endpointURI); + } else { + LOG.debug("IA successfully deployed. Storing endpoint..."); + + // store new endpoint for the IA + final WSDLEndpoint endpoint = + new WSDLEndpoint(endpointURI, portType, triggeringContainer, deploymentLocation, + csar.id(), serviceTemplateInstanceID, null, typeImplementation.getQName(), ia.getName(), new HashMap<>()); + endpointService.storeWSDLEndpoint(endpoint); + } + LOG.debug("Endpoint: {}", endpointURI.toString()); + + // Call IA, send response to caller and terminate bus + LOG.debug("Trying to invoke the operation on the deployed implementation artifact."); + handleResponse(pluginHandler.callMatchingInvocationPlugin(exchange, invocationType, deploymentLocation)); + return true; + } + } + + @Override + public void invokePlan(Exchange exchange) { + LOG.debug("Parsing Camel Exchange message to PlanInvocationArguments"); + + final Message message = exchange.getIn(); + String correlationID = message.getHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), String.class); + LOG.trace("Correlation ID: {}", correlationID); + // generate new unique correlation ID if no ID is passed + if (Objects.isNull(correlationID)) { + correlationID = PlanInstanceHandler.createCorrelationId(); + message.setHeader(MBHeader.PLANCORRELATIONID_STRING.toString(), correlationID); + } + + final CsarId csarID = new CsarId(message.getHeader(MBHeader.CSARID.toString(), String.class)); + LOG.trace("CSARID: " + csarID.csarName()); + + final URI serviceInstanceID = message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), URI.class); + LOG.trace("csarInstanceID: {}", serviceInstanceID); + + final QName serviceTemplateID = message.getHeader(MBHeader.SERVICETEMPLATEID_QNAME.toString(), QName.class); + LOG.debug("serviceTemplateID: {}", serviceTemplateID); + + final QName planID = message.getHeader(MBHeader.PLANID_QNAME.toString(), QName.class); + LOG.debug("planID: {}", planID); + + // get the ServiceTemplateInstance ID Long from the serviceInstanceID URI + final Long serviceTemplateInstanceID = Util.determineServiceTemplateInstanceId(serviceInstanceID); + final Csar csar = storage.findById(csarID); + + internalInvokePlan(new PlanInvocationArguments(csar, serviceTemplateID, serviceTemplateInstanceID, planID, correlationID), exchange); + } + + private void internalInvokePlan(PlanInvocationArguments arguments, Exchange exchange) { + LOG.debug("Running Management Bus: InvokePlan"); + // log event to monitor the plan execution time + final PlanInstanceEvent event = new PlanInstanceEvent("INFO", "PLAN_DURATION_LOG", "Plan execution with correlation id " + arguments.correlationId + "."); + + // create the instance data for the plan instance to be started + PlanInstance plan = PlanInstanceHandler.createPlanInstance(arguments.csar, arguments.serviceTemplateId, + arguments.serviceTemplateInstanceId, arguments.planId, arguments.correlationId, exchange.getIn().getBody()); + if (plan == null) { + LOG.warn("Unable to get plan for CorrelationID {}. Invocation aborted!", arguments.correlationId); + handleResponse(exchange); + return; + } + LOG.debug("Plan ID: {}", plan.getTemplateId()); + LOG.debug("Plan language: {}", plan.getLanguage().toString()); + + LOG.debug("Getting endpoint for the plan..."); + endpointService.printPlanEndpoints(); + final WSDLEndpoint WSDLendpoint = endpointService.getWSDLEndpointForPlanId(Settings.OPENTOSCA_CONTAINER_HOSTNAME, + arguments.csar.id(), plan.getTemplateId()); + + if (WSDLendpoint == null) { + LOG.warn("No endpoint found for specified plan: {} of csar: {}. Invocation aborted!", plan.getTemplateId(), + arguments.csar.id().csarName()); + handleResponse(exchange); + return; + } + + final URI endpoint = WSDLendpoint.getURI(); + LOG.debug("Endpoint for Plan {} : {} ", plan.getTemplateId(), endpoint); + + // Assumption. Should be checked with ToscaEngine + exchange.getIn().setHeader(MBHeader.HASOUTPUTPARAMS_BOOLEAN.toString(), true); + exchange.getIn().setHeader(MBHeader.ENDPOINT_URI.toString(), endpoint); + + if (plan.getLanguage().equals(PlanLanguage.BPMN)) { + exchange = pluginHandler.callMatchingInvocationPlugin(exchange, "REST", + Settings.OPENTOSCA_CONTAINER_HOSTNAME); + } else { + exchange = pluginHandler.callMatchingInvocationPlugin(exchange, "SOAP/HTTP", + Settings.OPENTOSCA_CONTAINER_HOSTNAME); + } + + // write WCET back to Plan + TPlan currentPlan = null; + try { + currentPlan = ToscaEngine.resolvePlanReference(arguments.csar, arguments.planId); + } catch (NotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // add end timestamp and log message with duration + event.setEndTimestamp(new Date()); + final long duration = event.getEndTimestamp().getTime() - event.getStartTimestamp().getTime(); + event.setMessage("Finished plan execution with correlation id " + arguments.correlationId + " after " + + duration + "ms"); + LOG.info("Plan execution duration: {}ms", duration); + + final SituationTriggerInstanceListener instanceListener = new SituationTriggerInstanceListener(); + final long calculatedWCET = instanceListener.calculateWCETForPlan(currentPlan); + // if total duration larger than calculatedWCET, use duration + if (calculatedWCET > 0 && calculatedWCET < duration) { + currentPlan.getOtherAttributes().put(new QName("http://opentosca.org", "WCET"), String.valueOf(duration)); + } + // if newly calculated WCET is larger than previous WCET, update + + long currentPlanWCET = Long.valueOf(currentPlan.getOtherAttributes().getOrDefault(new QName("http://opentosca.org", "WCET"), String.valueOf(0))); + + if (calculatedWCET > currentPlanWCET) { + currentPlan.getOtherAttributes().put(new QName("http://opentosca.org", "WCET"), String.valueOf(calculatedWCET)); + } + + // update plan in repository with new log event + final PlanInstanceRepository repo = new PlanInstanceRepository(); + plan = repo.findByCorrelationId(arguments.correlationId); + plan.addEvent(event); + repo.update(plan); + + // Undeploy IAs for the related ServiceTemplateInstance if a termination plan + // was executed. + if (plan.getType().equals(PlanType.TERMINATION)) { + LOG.debug("Executed plan was a termination plan. Removing endpoints..."); + final ServiceTemplateInstance serviceInstance = plan.getServiceTemplateInstance(); + if (serviceInstance != null) { + deleteEndpointsForServiceInstance(arguments.csar.id(), serviceInstance); + } else { + LOG.warn("Unable to retrieve ServiceTemplateInstance related to the plan."); + } + } + // add end timestamp and log message with duration + event.setEndTimestamp(new Date()); + LOG.info("Plan execution duration: {}ms", event.getDuration()); + + // update plan in repository with new log event + + plan = repo.findByCorrelationId(arguments.correlationId); + plan.addEvent(event); + repo.update(plan); + + // update the output parameters in the plan instance + PlanInstanceHandler.updatePlanInstanceOutput(plan, arguments.csar, exchange.getIn().getBody()); + + handleResponse(exchange); + } + + private boolean iaProvidesRequestedOperation(Csar csar, TImplementationArtifact ia, TEntityType type, String neededInterface, String neededOperation) { + final String providedOperation = ia.getOperationName(); + final String providedInterface = ia.getInterfaceName(); + + LOG.debug("Needed interface: {}. Provided interface: {}", neededInterface, providedInterface); + LOG.debug("Needed operation: {}. Provided operation: {}", neededOperation, providedOperation); + + if (providedInterface == null && providedOperation == null) { + // IA implements all operations of all interfaces defined in the node type + LOG.debug("Correct IA found. IA: {} implements all operations of all interfaces defined in NodeType.", ia.getName()); + return true; + } + + // IA implements all operations of one interface defined in NodeType + if (providedInterface != null && providedOperation == null && providedInterface.equals(neededInterface)) { + LOG.debug("Correct IA found. IA: {} implements all operations of one interface defined in NodeType.", ia.getName()); + return true; + } + + // IA implements one operation of an interface defined in NodeType + if (providedInterface != null && providedOperation != null + && providedInterface.equals(neededInterface) && providedOperation.equals(neededOperation)) { + LOG.debug("Correct IA found. IA: {} implements one operation of an interface defined in NodeType.", ia.getName()); + return true; + } + + // In this case - if there is no interface specified - the operation + // should be unique within the NodeType + if (neededInterface == null && neededOperation != null + && providedInterface != null && providedOperation == null) { + return ToscaEngine.isOperationUniqueInType(csar, type, providedInterface, neededOperation); + } + + LOG.debug("ImplementationArtifact {} does not provide needed interface/operation", ia.getName()); + return false; + } + + /** + * Delete all endpoints for the given ServiceTemplateInstance from the EndpointService. In case an endpoint + * is the only one for a certain implementation artifact, it is undeployed too. + * + * @param csarID The CSAR to which the ServiceTemplateInstance belongs. + * @param serviceInstance The ServiceTemplateInstance for which the endpoints have to be removed. + */ + private void deleteEndpointsForServiceInstance(final CsarId csarID, final ServiceTemplateInstance serviceInstance) { + final Long instanceID = serviceInstance.getId(); + LOG.debug("Deleting endpoints for ServiceTemplateInstance with ID: {}", instanceID); + + final Csar csar = storage.findById(csarID); + + final List serviceEndpoints = + endpointService.getWSDLEndpointsForSTID(Settings.OPENTOSCA_CONTAINER_HOSTNAME, instanceID); + LOG.debug("Found {} endpoints to delete...", serviceEndpoints.size()); + + for (final WSDLEndpoint serviceEndpoint : serviceEndpoints) { + + final String triggeringContainer = serviceEndpoint.getTriggeringContainer(); + final String deploymentLocation = serviceEndpoint.getManagingContainer(); + final QName typeImpl = serviceEndpoint.getTypeImplementation(); + final String iaName = serviceEndpoint.getIaName(); + + LOG.debug("Deleting endpoint: Triggering Container: {}; " + + "Managing Container: {}; NodeTypeImplementation: {}; IA name: {}", triggeringContainer, + deploymentLocation, typeImpl, iaName); + + final String identifier = + getUniqueSynchronizationString(triggeringContainer, deploymentLocation, typeImpl, iaName, instanceID.toString()); + + // synchronize deletion to avoid concurrency issues + synchronized (getLockForString(identifier)) { + + // get number of endpoints for the same IA + final int count = endpointService + .getWSDLEndpointsForNTImplAndIAName(triggeringContainer, + deploymentLocation, + typeImpl, iaName) + .size(); + + // only undeploy the IA if this is the only endpoint + if (count == 1) { + LOG.debug("Undeploying corresponding IA..."); + final TImplementationArtifact ia; + try { + TEntityTypeImplementation typeImplementation = ToscaEngine.resolveTypeImplementation(csar, typeImpl); + ia = ToscaEngine.resolveImplementationArtifact(typeImplementation, iaName); + } catch (NotFoundException e) { + LOG.warn("Could not find ImplementationArtifact {} for existing WSDLEndpoint [{}] in Csar [{}]", iaName, serviceEndpoint, csar.id()); + continue; + } + final String artifactType = ia.getArtifactType().toString(); + + // create exchange for the undeployment plug-in invocation + Exchange exchange = new DefaultExchange(collaborationContext.getCamelContext()); + exchange.getIn().setHeader(MBHeader.ENDPOINT_URI.toString(), serviceEndpoint.getURI()); + + // get plug-in for the undeployment + IManagementBusDeploymentPluginService deploymentPlugin; + if (deploymentLocation.equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME)) { + LOG.debug("Undeployment is done locally."); + deploymentPlugin = pluginRegistry.getDeploymentPluginServices().get(artifactType); + } else { + LOG.debug("Undeployment is done on a remote Container."); + deploymentPlugin = pluginRegistry.getDeploymentPluginServices().get(Constants.REMOTE_TYPE); + + // add header fields that are needed for the undeployment on a + // remote OpenTOSCA Container + exchange.getIn().setHeader(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), deploymentLocation); + exchange.getIn().setHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), triggeringContainer); + exchange.getIn().setHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), typeImpl.toString()); + exchange.getIn().setHeader(MBHeader.IMPLEMENTATION_ARTIFACT_NAME_STRING.toString(), iaName); + exchange.getIn().setHeader(MBHeader.ARTIFACTTYPEID_STRING.toString(), artifactType); + } + + exchange = deploymentPlugin.invokeImplementationArtifactUndeployment(exchange); + + // print the undeployment result state + if (exchange.getIn().getHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), boolean.class)) { + LOG.debug("Undeployed IA successfully!"); + } else { + LOG.warn("Undeployment of IA failed!"); + } + } else { + LOG.debug("Found further endpoints for the IA. No undeployment!"); + } + + // delete the endpoint + endpointService.removeWSDLEndpoint(serviceEndpoint); + LOG.debug("Endpoint deleted."); + } + } + + LOG.debug("Endpoint deletion terminated."); + } + + /** + * Creates a unique String which identifies an IA on a certain OpenTOSCA Container node. The String can be used to + * synchronize the access to the management infrastructure (e.g. tomcat). + * + * @param triggeringContainer OpenTOSCA Container that triggered the deployment + * @param deploymentLocation OpenTOSCA Container where the IA is managed + * @param typeImpl QName of the NodeType/RelationshipType the IA belongs to + * @param iaName the name of the IA + * @return a unique String consisting of the given information or null if some needed information is + * missing + */ + public static String getUniqueSynchronizationString(final String triggeringContainer, + final String deploymentLocation, final QName typeImpl, + final String iaName, final String serviceInstanceId) { + + if (Objects.isNull(triggeringContainer) || Objects.isNull(deploymentLocation) || Objects.isNull(typeImpl) + || Objects.isNull(iaName) || Objects.isNull(serviceInstanceId)) { + return null; + } + + return String.join("/", triggeringContainer, deploymentLocation, typeImpl.toString(), iaName, serviceInstanceId); + } + + /** + * Returns an Object which can be used to synchronize all actions related to a certain String value. + * + * @return the object which can be used for synchronization + */ + public static Object getLockForString(final String lockString) { + Objects.requireNonNull(lockString); + + synchronized (locks) { + return locks.computeIfAbsent(lockString, (i) -> new Object()); + } + } + + /** + * Add the specific content of the ImplementationArtifact to the Exchange headers if defined. + */ + private Exchange addSpecificContent(final Exchange exchange, + final TImplementationArtifact implementationArtifact) { + Object any = implementationArtifact.getAny(); + Document specificContent = any instanceof Element ? XMLHelper.fromRootNode((Element) any) : null; + if (specificContent != null) { + LOG.debug("ArtifactSpecificContent specified!"); + exchange.getIn().setHeader(MBHeader.SPECIFICCONTENT_DOCUMENT.toString(), specificContent); + } + return exchange; + } + + /** + * Replaces placeholder with a matching instance data value. Placeholder is defined like + * "/PLACEHOLDER_VMIP_IP_PLACEHOLDER/" + * + * @param endpoint the endpoint URI containing the placeholder + * @param nodeTemplateInstance the NodeTemplateInstance where the endpoint belongs to + * @return the endpoint URI with replaced placeholder if matching instance data was found, the unchanged endpoint + * URI otherwise + */ + private URI replacePlaceholderWithInstanceData(URI endpoint, final NodeTemplateInstance nodeTemplateInstance) { + + if (nodeTemplateInstance == null) { + LOG.warn("NodeTemplateInstance is null. Unable to replace placeholders!"); + return endpoint; + } + final String placeholder = + endpoint.toString() + .substring(endpoint.toString().lastIndexOf(Constants.PLACEHOLDER_START), + endpoint.toString().lastIndexOf(Constants.PLACEHOLDER_END) + Constants.PLACEHOLDER_END.length()); + + LOG.debug("Placeholder: {} detected in Endpoint: {}", placeholder, endpoint.toString()); + final String[] placeholderProperties = + placeholder.replace(Constants.PLACEHOLDER_START, "").replace(Constants.PLACEHOLDER_END, "").split("_"); + + for (final String placeholderProperty : placeholderProperties) { + LOG.debug("Searching instance data value for property {} ...", placeholderProperty); + String propertyValue = MBUtils.searchProperty(nodeTemplateInstance, placeholderProperty); + if (propertyValue == null) { + LOG.warn("Value for property {} not found.", placeholderProperty); + continue; + } + LOG.debug("Value for property {} found: {}.", placeholderProperty, propertyValue); + try { + endpoint = new URI(endpoint.toString().replace(placeholder, propertyValue)); + } catch (final URISyntaxException e) { + e.printStackTrace(); + } + break; + } + + return endpoint; + } + + /** + * Handles the response from the plug-in. If needed the response is sent back to the API. + * + * @param exchange to handle. + */ + private void handleResponse(Exchange exchange) { + if (exchange == null) { + return; + } + // Response message back to caller. + final ProducerTemplate template = collaborationContext.getProducer(); + final String caller = exchange.getIn().getHeader(MBHeader.APIID_STRING.toString(), String.class); + + if (caller == null) { + // notably the Java API does not set the APIID, because it never uses the information returned. + LOG.debug("Invocation was InOnly. No response message will be sent to the caller."); + return; + } + + LOG.debug("Sending response message back to api: {}", caller); + exchange = template.send("direct-vm:" + caller, exchange); + if (exchange.isFailed()) { + LOG.error("Sending exchange message failed! {}", exchange.getException().getMessage()); + } + } + + private static class PlanInvocationArguments { + public final Csar csar; + public final QName serviceTemplateId; + public final Long serviceTemplateInstanceId; + public final QName planId; + public final String correlationId; + + public PlanInvocationArguments(Csar csar, QName serviceTemplateID, Long serviceTemplateInstanceID, QName planID, String correlationID) { + this.csar = csar; + this.serviceTemplateId = serviceTemplateID; + this.serviceTemplateInstanceId = serviceTemplateInstanceID; + this.planId = planID; + this.correlationId = correlationID; + } + } + + private static class IAInvocationArguments { + public final CsarId csarId; + public final URI serviceInstanceId; + public final QName serviceTemplateId; + public final long serviceTemplateInstanceId; + public final String nodeTemplateId; + public final String relationshipTemplateId; + public final String interfaceName; + public final String operationName; + + public IAInvocationArguments(CsarId csarId, URI serviceInstanceId, QName serviceTemplateId, long serviceTemplateInstanceId, String nodeTemplateId, String relationshipTemplateId, String interfaceName, String operationName) { + this.csarId = csarId; + this.serviceInstanceId = serviceInstanceId; + this.serviceTemplateId = serviceTemplateId; + this.serviceTemplateInstanceId = serviceTemplateInstanceId; + this.nodeTemplateId = nodeTemplateId; + this.relationshipTemplateId = relationshipTemplateId; + this.interfaceName = interfaceName; + this.operationName = operationName; + } + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/PluginRegistry.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/PluginRegistry.java new file mode 100644 index 000000000..1b1ce3677 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/PluginRegistry.java @@ -0,0 +1,47 @@ +package org.opentosca.bus.management.service.impl; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; +import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +@Singleton +public class PluginRegistry { + + private final static Logger LOG = LoggerFactory.getLogger(PluginRegistry.class); + + private final Map invocationPluginServices = Collections.synchronizedMap(new HashMap<>()); + private final Map deploymentPluginServices = Collections.synchronizedMap(new HashMap<>()); + + @Inject + public PluginRegistry(@Autowired(required = false) Collection deploymentPlugins, + @Autowired(required = false) Collection invocationPlugins) { + // must be marked as not required to allow having no plugin at all discovered + // unfortunately Spring then injects null instead of an empty collection + if (deploymentPlugins != null) { + deploymentPlugins.forEach(plugin -> plugin.getSupportedTypes().forEach(type -> deploymentPluginServices.put(type, plugin))); + } + if (invocationPlugins != null) { + invocationPlugins.forEach(plugin -> plugin.getSupportedTypes().forEach(type -> invocationPluginServices.put(type, plugin))); + } + } + + public Map getInvocationPluginServices() { + return invocationPluginServices; + } + + public Map getDeploymentPluginServices() { + return deploymentPluginServices; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/CollaborationContext.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/CollaborationContext.java new file mode 100644 index 000000000..850cb1617 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/CollaborationContext.java @@ -0,0 +1,98 @@ +package org.opentosca.bus.management.service.impl.collaboration; + +import java.util.concurrent.TimeoutException; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.apache.camel.CamelContext; +import org.apache.camel.ProducerTemplate; +import org.opentosca.bus.management.service.impl.Constants; +import org.opentosca.bus.management.service.impl.collaboration.route.ReceiveRequestRoute; +import org.opentosca.bus.management.service.impl.collaboration.route.ReceiveResponseRoute; +import org.opentosca.bus.management.service.impl.collaboration.route.SendRequestResponseRoute; +import org.opentosca.container.core.common.Settings; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * CollaborationContext of the Management Bus.
+ *
+ *

+ * Copyright 2018 IAAS University of Stuttgart
+ *
+ *

+ * The activator is needed to start the camel context and add the routes for collaboration between different OpenTOSCA + * instances. Additionally, a producer template is created which can be used by all classes of this bundle to send camel + * messages. + */ +@Service +public class CollaborationContext { + + final private static Logger LOG = LoggerFactory.getLogger(CollaborationContext.class); + + private final CamelContext camelContext; + private final ProducerTemplate producer; + + @Inject + public CollaborationContext(@Named("collaboration-camel-context") CamelContext camelContext) { + this.camelContext = camelContext; + // Create a producer template for all components of the Management Bus implementation. + // This is recommended by camel to avoid the usage of too many threads. + this.producer = camelContext.createProducerTemplate(); + + LOG.info("Starting management bus"); + camelContext.setUseBreadcrumb(false); + try { + camelContext.start(); + // the camel routes are only needed if collaboration is turned on + if (!Boolean.parseBoolean(Settings.OPENTOSCA_COLLABORATION_MODE)) { + LOG.info("Collaboration mode is turned off. Skipping collaboration routing."); + return; + } + + LOG.info("Collaboration mode is turned on. Starting camel routes..."); + // route to send requests/responses to other OpenTOSCA Containers + camelContext.addRoutes(new SendRequestResponseRoute(Settings.OPENTOSCA_BROKER_MQTT_USERNAME, Settings.OPENTOSCA_BROKER_MQTT_PASSWORD)); + // route to receive responses by other OpenTOSCA Containers + camelContext.addRoutes(new ReceiveResponseRoute(Constants.LOCAL_MQTT_BROKER, Constants.RESPONSE_TOPIC, Settings.OPENTOSCA_BROKER_MQTT_USERNAME, Settings.OPENTOSCA_BROKER_MQTT_PASSWORD)); + + // if the setting is null or equals the empty string, this Container does not subscribe + // for requests of other Containers (acts as 'master') + if (Settings.OPENTOSCA_COLLABORATION_HOSTNAMES == null || Settings.OPENTOSCA_COLLABORATION_HOSTNAMES.equals("") + || Settings.OPENTOSCA_COLLABORATION_PORTS == null || Settings.OPENTOSCA_COLLABORATION_PORTS.equals("")) { + LOG.debug("No other Container defined to subscribe for requests. Only started route to send own requests and receive replies."); + return; + } + final String[] collaborationHosts = Settings.OPENTOSCA_COLLABORATION_HOSTNAMES.split(","); + final String[] collaborationPorts = Settings.OPENTOSCA_COLLABORATION_PORTS.split(","); + + if (collaborationHosts.length != collaborationPorts.length) { + LOG.error("The number of hostnames and ports of the collaborating hosts must be equal. Hosts: {} Ports: {}", collaborationHosts.length, collaborationPorts.length); + return; + } + // one route per collaborating Container is needed + for (int i = 0; i < collaborationHosts.length; i++) { + final String brokerURL = "tcp://" + collaborationHosts[i] + ":" + collaborationPorts[i]; + LOG.debug("Connecting to broker at {}", brokerURL); + try { + camelContext.addRoutes(new ReceiveRequestRoute(brokerURL, Constants.REQUEST_TOPIC, + Settings.OPENTOSCA_BROKER_MQTT_USERNAME, Settings.OPENTOSCA_BROKER_MQTT_PASSWORD)); + } catch (final TimeoutException e) { + LOG.error("Timeout while connecting to broker at {}. Unable to start route.", brokerURL); + } + } + } catch (Exception e) { + LOG.warn("Collaboration routing failed with an exception", e); + } + } + + public CamelContext getCamelContext() { + return camelContext; + } + + public ProducerTemplate getProducer() { + return producer; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/DeploymentDistributionDecisionMaker.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/DeploymentDistributionDecisionMaker.java new file mode 100644 index 000000000..be2ba142b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/DeploymentDistributionDecisionMaker.java @@ -0,0 +1,353 @@ +package org.opentosca.bus.management.service.impl.collaboration; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.xml.namespace.QName; + +import org.apache.camel.Exchange; +import org.apache.camel.impl.DefaultMessage; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.service.impl.collaboration.model.BodyType; +import org.opentosca.bus.management.service.impl.collaboration.model.CollaborationMessage; +import org.opentosca.bus.management.service.impl.collaboration.model.InstanceDataMatchingRequest; +import org.opentosca.bus.management.service.impl.collaboration.model.KeyValueMap; +import org.opentosca.bus.management.service.impl.collaboration.model.KeyValueType; +import org.opentosca.bus.management.service.impl.collaboration.model.RemoteOperations; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstanceState; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanInstanceState; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; +import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; +import org.opentosca.container.core.tosca.convention.Types; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * This class determines on which OpenTOSCA Container instance an Implementation Artifact for a certain service instance + * has to be deployed. It returns the host name of this Container instance which can then be used by the deployment and + * invocation plug-ins to perform operations with the Implementation Artifact.
+ *
+ *

+ * To determine the responsible OpenTOSCA Container, a matching with the instance data of the different available + * Containers is performed. Therefore, the infrastructure NodeTemplateInstance of the topology stack of the IA is + * retrieved. Afterwards the matching of this NodeTemplateInstance with the instance data of the local OpenTOSCA + * Container is done. If this is not successful, a matching request is distributed to other Containers via MQTT. In case + * there is also no match, the local Container is used as default deployment location.
+ *
+ *

+ * {@link Settings#OPENTOSCA_COLLABORATION_MODE} and the respective config.ini entry can be used to control the + * matching. If the property is true, matching is performed. If it is set to + * false, all IA deployments will be performed locally. Therefore, the performance can be + * increased by disabling this setting if distributed IA deployment is not needed.
+ *
+ *

+ * Copyright 2018 IAAS University of Stuttgart + */ +@Service +public class DeploymentDistributionDecisionMaker { + + private final static Logger LOG = LoggerFactory.getLogger(DeploymentDistributionDecisionMaker.class); + + // repository to access instance data via NodeTemplate identifiers + private final static NodeTemplateInstanceRepository nodeTemplateInstanceRepository = + new NodeTemplateInstanceRepository(); + + private final RequestSender sender; + + public DeploymentDistributionDecisionMaker(RequestSender sender) { + this.sender = sender; + } + + /** + * Get the deployment location for IAs which are attached to the NodeTemplateInstance. If the collaboration mode is + * turned on, this method performs an instance data matching to determine the deployment location. Therefore, the + * infrastructure NodeTemplateInstance is searched in the topology. Afterwards, its type and properties are matched + * against local and remote instance data to get the correct deployment location for the IAs. If the matching is not + * successful, the local OpenTOSCA Container is returned as default deployment location. + * + * @param nodeTemplateInstance the NodeTemplateInstance for which the IAs have to be deployed + * @return the location where the IAs should be deployed + */ + public String getDeploymentLocation(final NodeTemplateInstance nodeTemplateInstance) { + + if (Objects.isNull(nodeTemplateInstance)) { + LOG.error("NodeTemplateInstance object is null. Using local deployment."); + return Settings.OPENTOSCA_CONTAINER_HOSTNAME; + } + + if (!Boolean.parseBoolean(Settings.OPENTOSCA_COLLABORATION_MODE)) { + // only perform matching if collaboration mode is turned on + LOG.debug("Distributed IA deployment disabled. Using local deployment."); + return Settings.OPENTOSCA_CONTAINER_HOSTNAME; + } + + LOG.debug("Deployment distribution decision for IAs from NodeTemplateInstance with ID: {}", + nodeTemplateInstance.getId()); + + // check if decision is already made for this instance + if (Objects.nonNull(nodeTemplateInstance.getManagingContainer())) { + LOG.debug("ManagingContainer attribute is already set for this NodeTemplateInstance: {}", + nodeTemplateInstance.getManagingContainer()); + return nodeTemplateInstance.getManagingContainer(); + } + + // get infrastructure NodeTemplate + LOG.debug("Looking for infrastructure NodeTemplateInstance that corresponds to this NodeTemplateInstance..."); + final NodeTemplateInstance infrastructureNodeTemplateInstance = searchInfrastructureNode(nodeTemplateInstance); + + // check if "managingContainer" is already set for the infrastructure NodeTemplateInstance + if (Objects.nonNull(infrastructureNodeTemplateInstance.getManagingContainer())) { + + // no instance data matching needed, as it was already performed for the + // infrastructure NodeTemplateInstance + final String managingContainer = infrastructureNodeTemplateInstance.getManagingContainer(); + + LOG.debug("Infrastructure NodeTemplateInstance has set managingContainer attribute."); + LOG.debug("Result of deployment distribution decision: {}", managingContainer); + + // current NodeTemplateInstance is managed by the same Container as the + // infrastructure instance + nodeTemplateInstance.setManagingContainer(managingContainer); + nodeTemplateInstanceRepository.update(nodeTemplateInstance); + return managingContainer; + } + + // instance data matching has to be performed for the NodeTemplateInstance + LOG.debug("Infrastructure NodeTemplateInstance has ID: {}", infrastructureNodeTemplateInstance.getId()); + + // retrieve type and properties for the matching + final QName infrastructureNodeType = infrastructureNodeTemplateInstance.getTemplateType(); + final Map infrastructureProperties = infrastructureNodeTemplateInstance.getPropertiesAsMap(); + + LOG.debug("Infrastructure NodeTemplateInstance has NodeType: {}", infrastructureNodeType); + LOG.debug("Infrastructure NodeTemplateInstance has properties:"); + infrastructureProperties.entrySet().stream() + .forEach(entry -> LOG.debug("Key: {}; Value: {}", entry.getKey(), entry.getValue())); + + // match NodeType and properties against local instance data + LOG.debug("Performing local instance data matching..."); + String deploymentLocation = performInstanceDataMatching(infrastructureNodeType, infrastructureProperties); + if (Objects.nonNull(deploymentLocation)) { + LOG.debug("Found matching local instance data. Deployment will be done at: {}", deploymentLocation); + + // set property to speed up future matching + infrastructureNodeTemplateInstance.setManagingContainer(deploymentLocation); + nodeTemplateInstance.setManagingContainer(deploymentLocation); + + // update stored entities + nodeTemplateInstanceRepository.update(nodeTemplateInstance); + nodeTemplateInstanceRepository.update(infrastructureNodeTemplateInstance); + + return deploymentLocation; + } + + // match against instance data at remote OpenTOSCA Containers + LOG.debug("Local instance data matching had no success. Performing matching with remote instance data..."); + deploymentLocation = performRemoteInstanceDataMatching(infrastructureNodeType, infrastructureProperties); + if (Objects.nonNull(deploymentLocation)) { + LOG.debug("Found matching remote instance data. Deployment will be done on OpenTOSCA Container with host name: {}", + deploymentLocation); + + // set property to speed up future matching + infrastructureNodeTemplateInstance.setManagingContainer(deploymentLocation); + nodeTemplateInstance.setManagingContainer(deploymentLocation); + + // update stored entities + nodeTemplateInstanceRepository.update(nodeTemplateInstance); + nodeTemplateInstanceRepository.update(infrastructureNodeTemplateInstance); + + return deploymentLocation; + } + + // default (no matching): return host name of local container + LOG.debug("Remote instance data matching had no success. Returning local host name as default deployment location."); + nodeTemplateInstance.setManagingContainer(Settings.OPENTOSCA_CONTAINER_HOSTNAME); + nodeTemplateInstanceRepository.update(nodeTemplateInstance); + return Settings.OPENTOSCA_CONTAINER_HOSTNAME; + } + + /** + * Search for the infrastructure NodeTemplateInstance on which the given NodeTemplateInstance is + * hosted/deployed/based. In the context of instance data matching the infrastructure Node should always be the Node + * at the bottom of a stack in the topology. If an OpenTOSCA Container manages this bottom Node, it can be used to + * deploy all IAs attached to Nodes that are above the infrastructure Node in the topology. + * + * @param nodeTemplateInstance the NodeTemplateInstance for which the infrastructure is searched + * @return the infrastructure NodeTemplateInstance + */ + private NodeTemplateInstance searchInfrastructureNode(final NodeTemplateInstance nodeTemplateInstance) { + LOG.debug("Looking for infrastructure NodeTemplate at NodeTemplate {} and below...", + nodeTemplateInstance.getTemplateId()); + + final Collection outgoingRelationships = + nodeTemplateInstance.getOutgoingRelations(); + + // terminate search if bottom NodeTemplate is found + if (outgoingRelationships.isEmpty()) { + LOG.debug("NodeTemplate {} is the infrastructure NodeTemplate", nodeTemplateInstance.getTemplateId()); + return nodeTemplateInstance; + } + + LOG.debug("NodeTemplate {} has outgoing RelationshipTemplates...", nodeTemplateInstance.getTemplateId()); + + for (final RelationshipTemplateInstance relation : outgoingRelationships) { + final QName relationType = relation.getTemplateType(); + LOG.debug("Found outgoing RelationshipTemplate of type: {}", relationType); + + // traverse topology stack downwards + if (isInfrastructureRelationshipType(relationType)) { + LOG.debug("Continue search with the target of the RelationshipTemplate..."); + return searchInfrastructureNode(relation.getTarget()); + } else { + LOG.debug("RelationshipType is not valid for infrastructure search (e.g. hostedOn)."); + } + } + + // if all outgoing relationships are not of the searched types, the NodeTemplate is the + // bottom one + return nodeTemplateInstance; + } + + /** + * Match the given NodeType and properties against instance data from the local repository. The matching is + * successful if a NodeTemplateInstance with the same NodeType and the same values for the properties is found in + * the instance data. + * + * @param infrastructureNodeType the NodeType of the NodeTemplate which has to be matched + * @param infrastructureProperties the set of properties of the NodeTemplate which has to be matched + * @return the deployment location if a matching NodeTemplateInstance is found, null otherwise. + */ + protected String performInstanceDataMatching(final QName infrastructureNodeType, + final Map infrastructureProperties) { + + Objects.requireNonNull(infrastructureNodeType, + "QName for NodeType of infrastructure node must not be null for instance data matching"); + + // get the infrastructure properties without 'state' property for comparison + final Set> infrastructureEntrySet = getEntrySetWithoutState(infrastructureProperties); + + // search NodeTemplateInstance with matching NodeType and Properties which is already + // provisioned completely + final NodeTemplateInstance matchingInstance = + nodeTemplateInstanceRepository.findByTemplateType(infrastructureNodeType).stream() + .filter(instance -> instance.getServiceTemplateInstance().getState() + .equals(ServiceTemplateInstanceState.CREATED)) + .filter(instance -> instance.getState() + .equals(NodeTemplateInstanceState.STARTED)) + .filter(instance -> isBuildPlanFinished(instance)) + .filter(instance -> getEntrySetWithoutState(instance.getPropertiesAsMap()).equals(infrastructureEntrySet)) + .findFirst().orElse(null); + + if (Objects.nonNull(matchingInstance)) { + // check whether the matching NodeTemplateInstance is managed by this Container + if (Objects.isNull(matchingInstance.getManagingContainer())) { + // If no Container is set and the build plan is finished, this means that there + // was no IA invocation in the build plan and therefore also no remote + // deployment which means it is managed locally. + return Settings.OPENTOSCA_CONTAINER_HOSTNAME; + } else { + return matchingInstance.getManagingContainer(); + } + } + + // no matching found + return null; + } + + /** + * Match the given NodeType and properties against instance data from remote OpenTOSCA Containers. The matching is + * successful if a NodeTemplateInstance with the same NodeType and the same values for the properties is found in + * their instance data. The method sends a request via MQTT to all subscribed OpenTOSCA Containers. Afterwards, it + * waits for a reply which contains the host name of the OpenTOSCA Container that found matching instance data. If + * it receives a reply in time, it returns the host name. Otherwise, it returns null. + * + * @param infrastructureNodeType the NodeType of the NodeTemplate which has to be matched + * @param infrastructureProperties the set of properties of the NodeTemplate which has to be matched + * @return the host name of the OpenTOSCA Container which found a matching NodeTemplateInstance if one is found, + * null otherwise. + */ + private String performRemoteInstanceDataMatching(final QName infrastructureNodeType, + final Map infrastructureProperties) { + + LOG.debug("Creating collaboration message for remote instance data matching..."); + + // transform infrastructureProperties for the message body + final KeyValueMap properties = new KeyValueMap(); + final List propertyList = properties.getKeyValuePair(); + infrastructureProperties.entrySet().forEach((entry) -> propertyList.add(new KeyValueType(entry.getKey(), + entry.getValue()))); + + // create collaboration message + final BodyType content = new BodyType(new InstanceDataMatchingRequest(infrastructureNodeType, properties)); + final CollaborationMessage collaborationMessage = new CollaborationMessage(new KeyValueMap(), content); + + // perform remote instance data matching and wait 10s for a response + final Exchange response = sender.sendRequestToRemoteContainer(new DefaultMessage(), + RemoteOperations.INVOKE_INSTANCE_DATA_MATCHING, + collaborationMessage, 10000); + + if (Objects.nonNull(response)) { + LOG.debug("Received a response in time."); + + // read the deployment location from the reply + return response.getIn().getHeader(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), String.class); + } else { + LOG.debug("No response received within the timeout interval."); + return null; + } + } + + /** + * Filter out the 'State' property from the given properties Map if it is defined and return the corresponding entry + * Set. + * + * @param properties the properties as Map + * @return the properties as entry Set without 'State' property + */ + private static Set> getEntrySetWithoutState(final Map properties) { + return properties.entrySet().stream().filter((entry) -> !entry.getKey().equals("State")) + .collect(Collectors.toSet()); + } + + /** + * Check whether the build plan that corresponds to the given NodeTemplateInstance is finished. + * + * @param nodeTemplateInstance the NodeTemplateInstance for which the build plan is checked + * @return true if the build plan is found and terminated, false otherwise + */ + private static boolean isBuildPlanFinished(final NodeTemplateInstance nodeTemplateInstance) { + if (Objects.isNull(nodeTemplateInstance)) { + return false; + } + + final PlanInstance buildPlan = + nodeTemplateInstance.getServiceTemplateInstance().getPlanInstances().stream() + .filter((plan) -> plan.getType().equals(PlanType.BUILD)).findFirst().orElse(null); + + return Objects.nonNull(buildPlan) && buildPlan.getState().equals(PlanInstanceState.FINISHED); + } + + /** + * Check whether a given Relationship Type is used to connect parts of a topology stack (infrastructure type) or + * different topology stacks. + * + * @param relationType The Relationship Type to check + * @return true if the Relationship Type is hostedOn, deployedOn or dependsOn and + * false otherwise + */ + private static boolean isInfrastructureRelationshipType(final QName relationType) { + return relationType.equals(Types.hostedOnRelationType) || relationType.equals(Types.deployedOnRelationType) + || relationType.equals(Types.dependsOnRelationType); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/RequestReceiver.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/RequestReceiver.java new file mode 100644 index 000000000..697369194 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/RequestReceiver.java @@ -0,0 +1,538 @@ +package org.opentosca.bus.management.service.impl.collaboration; + +import java.net.URI; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; + +import javax.inject.Inject; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.commons.lang3.StringUtils; +import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; +import org.opentosca.bus.management.service.impl.ManagementBusServiceImpl; +import org.opentosca.bus.management.service.impl.PluginRegistry; +import org.opentosca.bus.management.service.impl.collaboration.model.BodyType; +import org.opentosca.bus.management.service.impl.collaboration.model.CollaborationMessage; +import org.opentosca.bus.management.service.impl.collaboration.model.Doc; +import org.opentosca.bus.management.service.impl.collaboration.model.IAInvocationRequest; +import org.opentosca.bus.management.service.impl.collaboration.model.InstanceDataMatchingRequest; +import org.opentosca.bus.management.service.impl.collaboration.model.KeyValueMap; +import org.opentosca.bus.management.service.impl.collaboration.model.KeyValueType; +import org.opentosca.bus.management.service.impl.collaboration.route.ReceiveRequestRoute; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * This class provides methods which can be invoked by remote OpenTOSCA Containers. The methods are consumer endpoints + * of the collaboration request route ({@link ReceiveRequestRoute}).
+ *
+ *

+ * Copyright 2018 IAAS University of Stuttgart + */ +@Service +public class RequestReceiver { + + private final static Logger LOG = LoggerFactory.getLogger(RequestReceiver.class); + + private final CollaborationContext collaborationContext; + private final DeploymentDistributionDecisionMaker decisionMaker; + private final ICoreEndpointService endpointService; + private final PluginRegistry pluginRegistry; + + @Inject + public RequestReceiver(CollaborationContext context, + DeploymentDistributionDecisionMaker decisionMaker, + ICoreEndpointService endpointService, + PluginRegistry pluginRegistry) { + this.collaborationContext = context; + this.decisionMaker = decisionMaker; + this.endpointService = endpointService; + this.pluginRegistry = pluginRegistry; + } + + /** + * Perform instance data matching with the transferred NodeType and properties and the instance data of the local + * OpenTOSCA Container. NodeType and properties have to be passed as part of the {@link CollaborationMessage} in the + * message body of the exchange. The method sends a reply to the topic specified in the headers of the incoming + * exchange if the matching is successful and adds the deployment location as header to the outgoing exchange. + * Otherwise no response is send. + * + * @param exchange the exchange containing the needed information as headers and body + */ + public void invokeInstanceDataMatching(final Exchange exchange) { + + LOG.debug("Received remote operation call for instance data matching."); + final Message message = exchange.getIn(); + + // check whether the request contains the needed header fields to send a response + final Map headers = getResponseHeaders(message); + if (Objects.isNull(headers)) { + LOG.error("Request does not contain all needed header fields to send a response. Aborting operation!"); + return; + } + + if (!(message.getBody() instanceof CollaborationMessage)) { + LOG.error("Message body has invalid class: {}. Aborting operation!", message.getBody().getClass()); + return; + } + + final CollaborationMessage collMsg = (CollaborationMessage) message.getBody(); + final BodyType body = collMsg.getBody(); + + if (Objects.isNull(body)) { + LOG.error("Collaboration message contains no body. Aborting operation!"); + return; + } + + final InstanceDataMatchingRequest request = body.getInstanceDataMatchingRequest(); + + if (Objects.isNull(request)) { + LOG.error("Body contains no InstanceDataMatchingRequest. Aborting operation!"); + return; + } + + LOG.debug("InstanceDataMatchingRequest contained in incoming message. Processing it..."); + + // get NodeType and properties from the request + final QName nodeType = request.getNodeType(); + final Map properties = new HashMap<>(); + for (final KeyValueType property : request.getProperties().getKeyValuePair()) { + properties.put(property.getKey(), property.getValue()); + } + + LOG.debug("Performing matching with NodeType: {} and properties: {}", nodeType, properties.toString()); + + // perform instance data matching + final String deploymentLocation = decisionMaker.performInstanceDataMatching(nodeType, properties); + if (deploymentLocation != null) { + LOG.debug("Instance data matching was successful. Sending response to requestor..."); + LOG.debug("Broker: {} Topic: {} Correlation: {}", + headers.get(MBHeader.MQTTBROKERHOSTNAME_STRING.toString()), + headers.get(MBHeader.MQTTTOPIC_STRING.toString()), + headers.get(MBHeader.CORRELATIONID_STRING.toString())); + + // add the deployment location as operation result to the headers + headers.put(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), deploymentLocation); + + // create empty reply message and transmit it with the headers + final CollaborationMessage replyBody = new CollaborationMessage(new KeyValueMap(), null); + collaborationContext.getProducer().sendBodyAndHeaders("direct:SendMQTT", replyBody, headers); + } else { + // if matching is not successful, no response is needed + LOG.debug("Instance data matching was not successful."); + } + } + + /** + * Deploy the IA that is specified in the incoming exchange by using the Management Bus deployment Plug-ins. + * + * @param exchange the exchange containing the needed information as header fields + */ + public void invokeIADeployment(Exchange exchange) { + + LOG.debug("Received remote operation call for IA deployment."); + final Message message = exchange.getIn(); + + if (!isDestinationLocal(message)) { + LOG.debug("Request is directed to another OpenTOSCA Container. Ignoring request!"); + return; + } + + // check whether the request contains the needed header fields to send a response + final Map headers = getResponseHeaders(message); + if (Objects.isNull(headers)) { + LOG.error("Request does not contain all needed header fields to send a response. Aborting operation!"); + return; + } + + // create IA unique String from given message + final String identifier = getUniqueSynchronizationString(message); + if (Objects.isNull(identifier)) { + LOG.error("Request does not contain all needed header fields to deploy the IA. Aborting operation!"); + return; + } + + // URI of the deployed IA + + // retrieve needed data from the headers + final String triggeringContainer = message.getHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), String.class); + final QName typeImplementationID = message.getHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), QName.class); + final String implementationArtifactName = message.getHeader(MBHeader.IMPLEMENTATION_ARTIFACT_NAME_STRING.toString(), String.class); + final URI serviceInstanceID = message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), URI.class); + final CSARID csarID = message.getHeader(MBHeader.CSARID.toString(), CSARID.class); + final QName portType = message.getHeader(MBHeader.PORT_TYPE_QNAME.toString(), QName.class); + final String artifactType = message.getHeader(MBHeader.ARTIFACTTYPEID_STRING.toString(), String.class); + final Long serviceTemplateInstanceID = Long.parseLong(StringUtils.substringAfterLast(serviceInstanceID.toString(), "/")); + + final String deploymentLocation = Settings.OPENTOSCA_CONTAINER_HOSTNAME; +// logInformation(triggeringContainer, deploymentLocation, typeImplementationID, implementationArtifactName, +// csarID, portType, artifactType, serviceTemplateInstanceID); + + URI endpointURI = null; + // Prevent two threads from trying to deploy the same IA concurrently and avoid the deletion + // of an IA after successful checking that an IA is already deployed. + synchronized (ManagementBusServiceImpl.getLockForString(identifier)) { + + LOG.debug("Got lock for operations on the given IA. Checking if IA is already deployed..."); + + final List endpoints = endpointService.getWSDLEndpointsForNTImplAndIAName(triggeringContainer, + deploymentLocation, + typeImplementationID, + implementationArtifactName); + + if (endpoints != null && endpoints.size() > 0) { + + // This case should not happen, as the 'master' Container sends only one deployment + // request per IA and intercepts all other deployment actions if there is already an + // endpoint. + endpointURI = endpoints.get(0).getURI(); + + LOG.warn("IA is already deployed. Storing only one endpoint at the remote side. Endpoint URI: {}", + endpointURI); + } else { + LOG.debug("IA not yet deployed. Trying to deploy..."); + + final IManagementBusDeploymentPluginService deploymentPlugin = + pluginRegistry.getDeploymentPluginServices().get(artifactType); + + if (deploymentPlugin != null) { + LOG.debug("Deployment plug-in: {}. Deploying IA...", deploymentPlugin.toString()); + + // execute deployment via corresponding plug-in + exchange = deploymentPlugin.invokeImplementationArtifactDeployment(exchange); + endpointURI = exchange.getIn().getHeader(MBHeader.ENDPOINT_URI.toString(), URI.class); + + // store new endpoint for the IA + final WSDLEndpoint endpoint = + new WSDLEndpoint(endpointURI, portType, triggeringContainer, deploymentLocation, new CsarId(csarID), + serviceTemplateInstanceID, null, typeImplementationID, implementationArtifactName, new HashMap<>()); + endpointService.storeWSDLEndpoint(endpoint); + } else { + LOG.error("No matching deployment plug-in found. Aborting deployment!"); + } + } + } + + LOG.debug("Sending response message containing endpoint URI: {}", endpointURI); + + // add the endpoint URI as operation result to the headers + headers.put(MBHeader.ENDPOINT_URI.toString(), endpointURI); + + // create empty reply message and transmit it with the headers + final CollaborationMessage replyBody = new CollaborationMessage(new KeyValueMap(), null); + collaborationContext.getProducer().sendBodyAndHeaders("direct:SendMQTT", replyBody, headers); + } + + /** + * Undeploy the IA that is specified in the incoming exchange by using the Management Bus deployment Plug-ins. + * + * @param exchange the exchange containing the needed information as header fields + */ + public void invokeIAUndeployment(Exchange exchange) { + + LOG.debug("Received remote operation call for IA undeployment."); + final Message message = exchange.getIn(); + + if (!isDestinationLocal(message)) { + LOG.debug("Request is directed to another OpenTOSCA Container. Ignoring request!"); + return; + } + + // check whether the request contains the needed header fields to send a response + final Map headers = getResponseHeaders(message); + if (Objects.isNull(headers)) { + LOG.error("Request does not contain all needed header fields to send a response. Aborting operation!"); + return; + } + + // create IA unique String from given message + final String identifier = getUniqueSynchronizationString(message); + if (Objects.isNull(identifier)) { + LOG.error("Request does not contain all needed header fields to deploy the IA. Aborting operation!"); + return; + } + + boolean undeploymentState = false; + + // retrieve needed data from the headers + final String triggeringContainer = message.getHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), String.class); + final QName typeImplementationID = message.getHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), QName.class); + final String implementationArtifactName = message.getHeader(MBHeader.IMPLEMENTATION_ARTIFACT_NAME_STRING.toString(), String.class); + final String artifactType = message.getHeader(MBHeader.ARTIFACTTYPEID_STRING.toString(), String.class); + final String deploymentLocation = Settings.OPENTOSCA_CONTAINER_HOSTNAME; + + LOG.debug("Undeployment of IA: Triggering Container: {}, Deployment location: {}, NodeTypeImplementation ID: {}, IA name: {}, Type: {}", + triggeringContainer, deploymentLocation, typeImplementationID, implementationArtifactName, + artifactType); + + // Prevent two threads from trying to deploy the same IA concurrently and avoid the deletion + // of an IA after successful checking that an IA is already deployed. + synchronized (ManagementBusServiceImpl.getLockForString(identifier)) { + + LOG.debug("Got lock for operations on the given IA. Getting endpoints fot the IA..."); + + // get all endpoints for the given parameters + final List endpoints = + endpointService.getWSDLEndpointsForNTImplAndIAName(triggeringContainer, + deploymentLocation, + typeImplementationID, + implementationArtifactName); + + if (endpoints != null && endpoints.size() > 0) { + // only one endpoint is stored for remote IAs + final WSDLEndpoint endpoint = endpoints.get(0); + endpointService.removeWSDLEndpoint(endpoint); + + final IManagementBusDeploymentPluginService deploymentPlugin = pluginRegistry.getDeploymentPluginServices().get(artifactType); + if (deploymentPlugin != null) { + LOG.debug("Undeploying IA..."); + exchange = deploymentPlugin.invokeImplementationArtifactUndeployment(exchange); + undeploymentState = exchange.getIn().getHeader(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), boolean.class); + } else { + LOG.error("No matching plug-in found. Aborting deployment!"); + } + } else { + LOG.error("No enpoint found for this IA. Undeployment not possible!"); + } + } + + LOG.debug("Sending response message containing undeployment state: {}", undeploymentState); + + // add the undeployment state as operation result to the headers + headers.put(MBHeader.OPERATIONSTATE_BOOLEAN.toString(), undeploymentState); + + // create empty reply message and transmit it with the headers + final CollaborationMessage replyBody = new CollaborationMessage(new KeyValueMap(), null); + collaborationContext.getProducer().sendBodyAndHeaders("direct:SendMQTT", replyBody, headers); + } + + /** + * Invoke an IA which is managed by this OpenTOSCA Container based on the request of another Container. The request + * contains all needed input parameters and the endpoint of the invoked IA. + * + * @param exchange the exchange containing the needed information as headers and body + */ + public void invokeIAOperation(final Exchange exchange) { + + LOG.debug("Received remote operation call for invocation of an IA operation."); + final Message message = exchange.getIn(); + + if (!isDestinationLocal(message)) { + LOG.debug("Request is directed to another OpenTOSCA Container. Ignoring request!"); + return; + } + + // check whether the request contains the needed header fields to send a response + final Map headers = getResponseHeaders(message); + if (Objects.isNull(headers)) { + LOG.error("Request does not contain all needed header fields to send a response. Aborting operation!"); + return; + } + + if (!(message.getBody() instanceof CollaborationMessage)) { + LOG.error("Message body has invalid class: {}. Aborting operation!", message.getBody().getClass()); + return; + } + + final CollaborationMessage collMsg = (CollaborationMessage) message.getBody(); + final BodyType body = collMsg.getBody(); + + if (Objects.isNull(body)) { + LOG.error("Collaboration message contains no body. Aborting operation!"); + return; + } + + final IAInvocationRequest request = body.getIAInvocationRequest(); + if (Objects.isNull(request)) { + LOG.error("Body contains no IAInvocationRequest. Aborting operation!"); + return; + } + + LOG.debug("Request is valid. Checking for input parameters..."); + + if (request.getParams() != null) { + LOG.debug("Request contains input parameters as HashMap:"); + + final HashMap inputParamMap = new HashMap<>(); + for (final KeyValueType inputParam : request.getParams().getKeyValuePair()) { + LOG.debug("Key: {}, Value: {}", inputParam.getKey(), inputParam.getValue()); + inputParamMap.put(inputParam.getKey(), inputParam.getValue()); + } + + message.setBody(inputParamMap, HashMap.class); + } else { + if (request.getDoc() != null) { + LOG.debug("Request contains input parameters a Document"); + + try { + final DocumentBuilderFactory dFact = DocumentBuilderFactory.newInstance(); + final DocumentBuilder build = dFact.newDocumentBuilder(); + final Document document = build.newDocument(); + + final Element element = request.getDoc().getAny(); + + document.adoptNode(element); + document.appendChild(element); + + message.setBody(document, Document.class); + } catch (final Exception e) { + LOG.error("Unable to parse Document: {}", e.getMessage()); + } + } else { + LOG.warn("Request contains no input parameters."); + message.setBody(null); + } + } + + final String invocationType = message.getHeader(MBHeader.INVOCATIONTYPE_STRING.toString(), String.class); + if (invocationType == null) { + LOG.error("No invocation type specified for the IA!"); + return; + } + + // call the operation with the related invocation plug-in + final IManagementBusInvocationPluginService invocationPlugin = pluginRegistry.getInvocationPluginServices().get(invocationType); + if (invocationPlugin == null) { + LOG.error("No invocation plug-in found for invocation type: {}", invocationType); + return; + } + LOG.debug("Invoking IA with plug-in: {}", invocationPlugin.getClass()); + final Exchange response = invocationPlugin.invoke(exchange); + + final Object responseBody = response.getIn().getBody(); + + // object to transmitt output parameters to the calling Container + final IAInvocationRequest invocationResponse = new IAInvocationRequest(); + + if (responseBody instanceof HashMap) { + LOG.debug("Response contains output parameters as HashMap"); + + @SuppressWarnings("unchecked") final HashMap paramsMap = (HashMap) responseBody; + + final KeyValueMap invocationResponseMap = new KeyValueMap(); + final List invocationResponsePairs = invocationResponseMap.getKeyValuePair(); + + for (final Entry param : paramsMap.entrySet()) { + invocationResponsePairs.add(new KeyValueType(param.getKey(), param.getValue())); + } + + invocationResponse.setParams(invocationResponseMap); + } else { + if (body instanceof Document) { + LOG.debug("Response contains output parameters as Document."); + + final Document document = (Document) body; + invocationResponse.setDoc(new Doc(document.getDocumentElement())); + } else { + LOG.warn("No output parameters defined!"); + } + } + + // send response to calling Container + final CollaborationMessage reply = new CollaborationMessage(new KeyValueMap(), new BodyType(invocationResponse)); + collaborationContext.getProducer().sendBodyAndHeaders("direct:SendMQTT", reply, headers); + } + + /** + * Get the header fields that are needed to respond to a request as Map. + * + * @param message the request message + * @return the Map containing the header fields for the response if the needed header fields are found in the + * request message, null otherwise + */ + private Map getResponseHeaders(final Message message) { + + // extract header fields + final String broker = message.getHeader(MBHeader.MQTTBROKERHOSTNAME_STRING.toString(), String.class); + final String replyTopic = message.getHeader(MBHeader.REPLYTOTOPIC_STRING.toString(), String.class); + final String correlation = message.getHeader(MBHeader.CORRELATIONID_STRING.toString(), String.class); + + // reply is only possible if all headers are set + if (Objects.isNull(broker) || Objects.isNull(replyTopic) || Objects.isNull(correlation)) { + return null; + } + + // add the header fields to the header map and return it + final Map headers = new HashMap<>(); + headers.put(MBHeader.MQTTBROKERHOSTNAME_STRING.toString(), broker); + headers.put(MBHeader.MQTTTOPIC_STRING.toString(), replyTopic); + headers.put(MBHeader.CORRELATIONID_STRING.toString(), correlation); + return headers; + } + + /** + * Check whether the request is directed to the local OpenTOSCA Container / Management Bus. This is the case if the + * {@link MBHeader#DEPLOYMENTLOCATION_STRING} header field equals the local host name. + * + * @param message the request message + * @return true if the request is directed to this Management Bus, false + * otherwise + */ + private boolean isDestinationLocal(final Message message) { + + final String deploymentLocation = + message.getHeader(MBHeader.DEPLOYMENTLOCATION_STRING.toString(), String.class); + LOG.debug("Deplyoment location header: {}", deploymentLocation); + + return deploymentLocation != null && deploymentLocation.equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME); + } + + /** + * Create a String that uniquely identifies the IA that has to be deployed/undeployed for the given request message. + * The String can be used to synchronize all operations that are concerned with that IA. + * + * @param message the request message + * @return a String that uniquely identifies the IA or null if needed header fields are missing + */ + private String getUniqueSynchronizationString(final Message message) { + + final String triggeringContainer = + message.getHeader(MBHeader.TRIGGERINGCONTAINER_STRING.toString(), String.class); + final String deploymentLocation = Settings.OPENTOSCA_CONTAINER_HOSTNAME; + final QName typeImplementationID = + message.getHeader(MBHeader.TYPEIMPLEMENTATIONID_QNAME.toString(), QName.class); + final String implementationArtifactName = + message.getHeader(MBHeader.IMPLEMENTATION_ARTIFACT_NAME_STRING.toString(), String.class); + final String serviceInstanceURI = + message.getHeader(MBHeader.SERVICEINSTANCEID_URI.toString(), String.class); + final String serviceInstanceId = serviceInstanceURI.substring(serviceInstanceURI.lastIndexOf("/")); + + return ManagementBusServiceImpl.getUniqueSynchronizationString(triggeringContainer, deploymentLocation, + typeImplementationID, implementationArtifactName, serviceInstanceId); + } + + /** + * Log the provided information. + */ + private void logInformation(final String triggeringContainer, final String deploymentLocation, + final QName typeImplementationID, final String implementationArtifactName, + final CSARID csarID, final QName portType, final String artifactType, + final Long serviceTemplateInstanceID) { + + LOG.debug("Triggering Container: {}", triggeringContainer); + LOG.debug("CSARID: {}", csarID); + LOG.debug("ServiceTemplateInstance ID: {}", serviceTemplateInstanceID); + LOG.debug("Deployment location: {}", deploymentLocation); + LOG.debug("TypeImplementation: {}", typeImplementationID); + LOG.debug("IA name: {}", implementationArtifactName); + LOG.debug("ArtifactType: {}", artifactType); + LOG.debug("Port type: {}", portType); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/RequestSender.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/RequestSender.java new file mode 100644 index 000000000..4fa83cf8e --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/RequestSender.java @@ -0,0 +1,111 @@ +package org.opentosca.bus.management.service.impl.collaboration; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +import javax.inject.Inject; + +import org.apache.camel.ConsumerTemplate; +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.service.impl.Constants; +import org.opentosca.bus.management.service.impl.collaboration.model.CollaborationMessage; +import org.opentosca.bus.management.service.impl.collaboration.model.RemoteOperations; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import static java.util.concurrent.TimeUnit.MILLISECONDS; + +/** + * Utility class to send collaboration requests over MQTT to other OpenTOSCA Container nodes.
+ *
+ *

+ * Copyright 2018 IAAS University of Stuttgart + */ +@Service +public class RequestSender { + + static final private Logger LOG = LoggerFactory.getLogger(RequestSender.class); + + private final static ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); + + private final CollaborationContext collaborationContext; + + @Inject + public RequestSender(CollaborationContext context) { + collaborationContext = context; + } + + /** + * Send an operation request to a remote OpenTOSCA Container node. All information needed for the remote operation + * that shall be executed has to be defined as header fields of the given message or passed as + * CollaborationMessage. + * + * @param message the message containing the headers to send to the remote Container + * @param operation the operation to perform on the remote Container + * @param requestBody the message body of the request + * @param timeout the timeout to wait for a reply in ms. Zero means no timeout at all + * @return the exchange which is received as response of the request + */ + public Exchange sendRequestToRemoteContainer(final Message message, final RemoteOperations operation, + final CollaborationMessage requestBody, final int timeout) { + + Objects.requireNonNull(message); + + // create an unique correlation ID for the request + final String correlationID = UUID.randomUUID().toString(); + + final Map requestHeaders = new HashMap<>(); + + // add header fields of the incoming message to the outgoing message + for (final MBHeader header : MBHeader.values()) { + if (message.getHeader(header.toString()) != null) { + requestHeaders.put(header.toString(), message.getHeader(header.toString())); + } + } + + // create header fields to forward the deployment requests + requestHeaders.put(MBHeader.MQTTBROKERHOSTNAME_STRING.toString(), Constants.LOCAL_MQTT_BROKER); + requestHeaders.put(MBHeader.MQTTTOPIC_STRING.toString(), Constants.REQUEST_TOPIC); + requestHeaders.put(MBHeader.CORRELATIONID_STRING.toString(), correlationID); + requestHeaders.put(MBHeader.REPLYTOTOPIC_STRING.toString(), Constants.RESPONSE_TOPIC); + requestHeaders.put(MBHeader.REMOTEOPERATION_STRING.toString(), operation); + + LOG.debug("Publishing request to MQTT broker at {} with topic {} and correlation ID {}", + Constants.LOCAL_MQTT_BROKER, Constants.REQUEST_TOPIC, correlationID); + + // publish the exchange over the camel route + scheduler.schedule(() -> collaborationContext.getProducer().sendBodyAndHeaders("direct:SendMQTT", requestBody, requestHeaders), + 300, MILLISECONDS); + + final String callbackEndpoint = "direct:Callback-" + correlationID; + LOG.debug("Waiting for response at endpoint: {}", callbackEndpoint); + + // wait for a response at the created callback + final ConsumerTemplate consumer = collaborationContext.getCamelContext().createConsumerTemplate(); + + Exchange response = null; + if (timeout == 0) { + // wait without timeout + response = consumer.receive(callbackEndpoint); + } else { + // assess request as failed after timeout and return null + response = consumer.receive(callbackEndpoint, timeout); + } + + // release resources + try { + consumer.stop(); + } catch (final Exception e) { + LOG.warn("Unable to stop consumer: {}", e.getMessage()); + } + + return response; + } +} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/BodyType.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/BodyType.java similarity index 98% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/BodyType.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/BodyType.java index d74aaa8f9..6b38653ac 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/BodyType.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/BodyType.java @@ -27,8 +27,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "BodyType", propOrder = {"instanceDataMatchingRequest", "iaInvocationRequest"}) @@ -39,7 +37,8 @@ public class BodyType { @XmlElement(name = "IAInvocationRequest") protected IAInvocationRequest iaInvocationRequest; - public BodyType() {} + public BodyType() { + } public BodyType(final IAInvocationRequest iaInvocationRequest) { this.iaInvocationRequest = iaInvocationRequest; @@ -53,7 +52,6 @@ public BodyType(final InstanceDataMatchingRequest instanceDataMatchingRequest) { * Gets the value of the instanceDataMatchingRequest property. * * @return possible object is {@link InstanceDataMatchingRequest } - * */ public InstanceDataMatchingRequest getInstanceDataMatchingRequest() { return this.instanceDataMatchingRequest; @@ -63,7 +61,6 @@ public InstanceDataMatchingRequest getInstanceDataMatchingRequest() { * Sets the value of the instanceDataMatchingRequest property. * * @param value allowed object is {@link InstanceDataMatchingRequest } - * */ public void setInstanceDataMatchingRequest(final InstanceDataMatchingRequest value) { this.instanceDataMatchingRequest = value; @@ -73,7 +70,6 @@ public void setInstanceDataMatchingRequest(final InstanceDataMatchingRequest val * Gets the value of the iaInvocationRequest property. * * @return possible object is {@link IAInvocationRequest } - * */ public IAInvocationRequest getIAInvocationRequest() { return this.iaInvocationRequest; @@ -83,7 +79,6 @@ public IAInvocationRequest getIAInvocationRequest() { * Sets the value of the iaInvocationRequest property. * * @param value allowed object is {@link IAInvocationRequest } - * */ public void setIAInvocationRequest(final IAInvocationRequest value) { this.iaInvocationRequest = value; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/CollaborationMessage.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/CollaborationMessage.java similarity index 97% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/CollaborationMessage.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/CollaborationMessage.java index 6d78c595d..b26b9367d 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/CollaborationMessage.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/CollaborationMessage.java @@ -6,7 +6,6 @@ // Generated on: 2018.07.05 at 09:07:58 PM CEST // - package org.opentosca.bus.management.service.impl.collaboration.model; import javax.xml.bind.annotation.XmlAccessType; @@ -14,7 +13,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* The following schema fragment specifies the expected content contained within this class. @@ -31,8 +29,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CollaborationMessage", propOrder = {"headerMap", "body"}) @@ -43,7 +39,8 @@ public class CollaborationMessage { @XmlElement(name = "Body") protected BodyType body; - public CollaborationMessage() {} + public CollaborationMessage() { + } public CollaborationMessage(final KeyValueMap headerMap, final BodyType body) { this.headerMap = headerMap; @@ -54,7 +51,6 @@ public CollaborationMessage(final KeyValueMap headerMap, final BodyType body) { * Gets the value of the headerMap property. * * @return possible object is {@link KeyValueMap } - * */ public KeyValueMap getHeaderMap() { return this.headerMap; @@ -64,7 +60,6 @@ public KeyValueMap getHeaderMap() { * Sets the value of the headerMap property. * * @param value allowed object is {@link KeyValueMap } - * */ public void setHeaderMap(final KeyValueMap value) { this.headerMap = value; @@ -74,7 +69,6 @@ public void setHeaderMap(final KeyValueMap value) { * Gets the value of the body property. * * @return possible object is {@link BodyType } - * */ public BodyType getBody() { return this.body; @@ -84,7 +78,6 @@ public BodyType getBody() { * Sets the value of the body property. * * @param value allowed object is {@link BodyType } - * */ public void setBody(final BodyType value) { this.body = value; diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/Doc.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/Doc.java new file mode 100644 index 000000000..f382ef3e7 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/Doc.java @@ -0,0 +1,63 @@ +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.07.05 at 09:07:58 PM CEST + +package org.opentosca.bus.management.service.impl.collaboration.model; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlType; + +import org.w3c.dom.Element; + +/** + *

+ * The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Doc">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any processContents='skip' minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Doc", propOrder = {"any"}) +public class Doc { + + @XmlAnyElement + protected Element any; + + public Doc() { + } + + public Doc(final Element content) { + this.any = content; + } + + /** + * Gets the value of the any property. + * + * @return possible object is {@link Element } + */ + public Element getAny() { + return this.any; + } + + /** + * Sets the value of the any property. + * + * @param value allowed object is {@link Element } + */ + public void setAny(final Element value) { + this.any = value; + } +} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/IAInvocationRequest.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/IAInvocationRequest.java similarity index 98% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/IAInvocationRequest.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/IAInvocationRequest.java index 96a489b80..353dee7c0 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/IAInvocationRequest.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/IAInvocationRequest.java @@ -27,8 +27,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "IAInvocationRequest", propOrder = {"params", "doc"}) @@ -43,7 +41,6 @@ public class IAInvocationRequest { * Gets the value of the params property. * * @return possible object is {@link KeyValueMap } - * */ public KeyValueMap getParams() { return this.params; @@ -53,7 +50,6 @@ public KeyValueMap getParams() { * Sets the value of the params property. * * @param value allowed object is {@link KeyValueMap } - * */ public void setParams(final KeyValueMap value) { this.params = value; @@ -63,7 +59,6 @@ public void setParams(final KeyValueMap value) { * Gets the value of the doc property. * * @return possible object is {@link Doc } - * */ public Doc getDoc() { return this.doc; @@ -73,7 +68,6 @@ public Doc getDoc() { * Sets the value of the doc property. * * @param value allowed object is {@link Doc } - * */ public void setDoc(final Doc value) { this.doc = value; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/InstanceDataMatchingRequest.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/InstanceDataMatchingRequest.java similarity index 97% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/InstanceDataMatchingRequest.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/InstanceDataMatchingRequest.java index f648ff948..2e79ef1f8 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/InstanceDataMatchingRequest.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/InstanceDataMatchingRequest.java @@ -12,7 +12,6 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; - /** *

* The following schema fragment specifies the expected content contained within this class. @@ -29,8 +28,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InstanceDataMatchingRequest", propOrder = {"nodeType", "properties"}) @@ -41,7 +38,8 @@ public class InstanceDataMatchingRequest { @XmlElement(name = "Properties", required = true) protected KeyValueMap properties; - public InstanceDataMatchingRequest() {} + public InstanceDataMatchingRequest() { + } public InstanceDataMatchingRequest(final QName nodeType, final KeyValueMap properties) { this.nodeType = nodeType; @@ -52,7 +50,6 @@ public InstanceDataMatchingRequest(final QName nodeType, final KeyValueMap prope * Gets the value of the nodeType property. * * @return possible object is {@link QName } - * */ public QName getNodeType() { return this.nodeType; @@ -62,7 +59,6 @@ public QName getNodeType() { * Sets the value of the nodeType property. * * @param value allowed object is {@link QName } - * */ public void setNodeType(final QName value) { this.nodeType = value; @@ -72,7 +68,6 @@ public void setNodeType(final QName value) { * Gets the value of the properties property. * * @return possible object is {@link KeyValueMap } - * */ public KeyValueMap getProperties() { return this.properties; @@ -82,7 +77,6 @@ public KeyValueMap getProperties() { * Sets the value of the properties property. * * @param value allowed object is {@link KeyValueMap } - * */ public void setProperties(final KeyValueMap value) { this.properties = value; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueMap.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueMap.java similarity index 89% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueMap.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueMap.java index f1b776cc0..38aec6e8e 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueMap.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueMap.java @@ -6,8 +6,6 @@ // Generated on: 2018.07.05 at 09:07:58 PM CEST // - - package org.opentosca.bus.management.service.impl.collaboration.model; import java.util.ArrayList; @@ -18,7 +16,6 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; - /** *

* The following schema fragment specifies the expected content contained within this class. @@ -34,8 +31,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "KeyValueMap", propOrder = {"keyValuePair"}) @@ -48,9 +43,9 @@ public class KeyValueMap { * Gets the value of the KeyValuePair property. * *

- * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is - * why there is not a set method for the keyValuePair property. + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the keyValuePair property. * *

* For example, to add a new item, do as follows: @@ -62,8 +57,6 @@ public class KeyValueMap { * *

* Objects of the following type(s) are allowed in the list {@link KeyValueType } - * - * */ public List getKeyValuePair() { if (this.keyValuePair == null) { diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueType.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueType.java similarity index 97% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueType.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueType.java index 89b776467..5f2c8d493 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueType.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/KeyValueType.java @@ -6,7 +6,6 @@ // Generated on: 2018.07.05 at 09:07:58 PM CEST // - package org.opentosca.bus.management.service.impl.collaboration.model; import javax.xml.bind.annotation.XmlAccessType; @@ -30,8 +29,6 @@ * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "KeyValueType", propOrder = {"key", "value"}) @@ -42,7 +39,8 @@ public class KeyValueType { @XmlElement(name = "Value", required = true) protected String value; - public KeyValueType() {} + public KeyValueType() { + } public KeyValueType(final String key, final String value) { this.key = key; @@ -53,7 +51,6 @@ public KeyValueType(final String key, final String value) { * Gets the value of the key property. * * @return possible object is {@link String } - * */ public String getKey() { return this.key; @@ -63,7 +60,6 @@ public String getKey() { * Sets the value of the key property. * * @param value allowed object is {@link String } - * */ public void setKey(final String value) { this.key = value; @@ -73,7 +69,6 @@ public void setKey(final String value) { * Gets the value of the value property. * * @return possible object is {@link String } - * */ public String getValue() { return this.value; @@ -83,10 +78,8 @@ public String getValue() { * Sets the value of the value property. * * @param value allowed object is {@link String } - * */ public void setValue(final String value) { this.value = value; } - } diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/ObjectFactory.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/ObjectFactory.java new file mode 100644 index 000000000..28ac05b0d --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/ObjectFactory.java @@ -0,0 +1,92 @@ +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.07.05 at 09:07:58 PM CEST + +package org.opentosca.bus.management.service.impl.collaboration.model; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.opentosca.bus.management.service.impl.collaboration.model package. + *

+ * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _CollaborationMessage_QNAME = + new QName("http://collaboration.org/schema", "CollaborationMessage"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.opentosca.bus.management.service.impl.collaboration.model + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link CollaborationMessage } + */ + public CollaborationMessage createCollaborationMessage() { + return new CollaborationMessage(); + } + + /** + * Create an instance of {@link KeyValueMap } + */ + public KeyValueMap createKeyValueMap() { + return new KeyValueMap(); + } + + /** + * Create an instance of {@link KeyValueType } + */ + public KeyValueType createKeyValueType() { + return new KeyValueType(); + } + + /** + * Create an instance of {@link Doc } + */ + public Doc createDoc() { + return new Doc(); + } + + /** + * Create an instance of {@link InstanceDataMatchingRequest } + */ + public InstanceDataMatchingRequest createInstanceDataMatchingRequest() { + return new InstanceDataMatchingRequest(); + } + + /** + * Create an instance of {@link BodyType } + */ + public BodyType createBodyType() { + return new BodyType(); + } + + /** + * Create an instance of {@link IAInvocationRequest } + */ + public IAInvocationRequest createIAInvocationRequest() { + return new IAInvocationRequest(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CollaborationMessage }{@code >}} + */ + @XmlElementDecl(namespace = "http://collaboration.org/schema", name = "CollaborationMessage") + public JAXBElement createCollaborationMessage(final CollaborationMessage value) { + return new JAXBElement<>(_CollaborationMessage_QNAME, CollaborationMessage.class, null, value); + } +} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/RemoteOperations.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/RemoteOperations.java similarity index 75% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/RemoteOperations.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/RemoteOperations.java index f5649264e..3b6673bbd 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/model/RemoteOperations.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/RemoteOperations.java @@ -1,17 +1,17 @@ package org.opentosca.bus.management.service.impl.collaboration.model; /** - * Enum which contains all possible operations which can currently be requested on other OpenTOSCA - * Containers by sending a collaboration message via MQTT.
+ * Enum which contains all possible operations which can currently be requested on other OpenTOSCA Containers by sending + * a collaboration message via MQTT.
*
- * + *

* Copyright 2018 IAAS University of Stuttgart */ public enum RemoteOperations { /** - * Requests the conduct of instance data matching between the local instance data and the - * NodeType and properties contained in the collaboration message. + * Requests the conduct of instance data matching between the local instance data and the NodeType and properties + * contained in the collaboration message. */ INVOKE_INSTANCE_DATA_MATCHING, diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/package-info.java new file mode 100644 index 000000000..a1edf1a80 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/model/package-info.java @@ -0,0 +1,11 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.4-2 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.07.05 at 09:07:58 PM CEST +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://collaboration.org/schema", + elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.opentosca.bus.management.service.impl.collaboration.model; diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/package-info.java new file mode 100644 index 000000000..0ae576b15 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the classes related to collaboration between the Management Buses of different OpenTOSCA + * instances.

+ *

+ * Copyright 2018 IAAS University of Stuttgart + */ +package org.opentosca.bus.management.service.impl.collaboration; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/IncomingProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/IncomingProcessor.java similarity index 88% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/IncomingProcessor.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/IncomingProcessor.java index c5aae0fb7..c225afe12 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/IncomingProcessor.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/IncomingProcessor.java @@ -22,17 +22,16 @@ import org.w3c.dom.Document; /** - * This processor checks if the body type of the incoming message is valid for further processing. - * Additionally, it reads all header fields which are marshaled into the body because they can't be - * transmitted over MQTT as exchange headers. The headers are converted to their original type if - * possible and added to the exchange which is forwarded afterwards.
+ * This processor checks if the body type of the incoming message is valid for further processing. Additionally, it + * reads all header fields which are marshaled into the body because they can't be transmitted over MQTT as exchange + * headers. The headers are converted to their original type if possible and added to the exchange which is forwarded + * afterwards.
*
- * + *

* Copyright 2018 IAAS University of Stuttgart
*
* * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * */ public class IncomingProcessor implements Processor { @@ -41,7 +40,7 @@ public class IncomingProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { - IncomingProcessor.LOG.debug("Processing incoming message..."); + LOG.debug("Processing incoming message..."); final Message message = exchange.getIn(); // only exchanges with body class CollaborationMessage are valid @@ -85,16 +84,14 @@ public void process(final Exchange exchange) throws Exception { case "QNAME": try { message.setHeader(header.getKey(), QName.valueOf(header.getValue())); - } - catch (final IllegalArgumentException e) { + } catch (final IllegalArgumentException e) { LOG.warn("Unable to parse header to type QName. Ignoring it."); } break; case "URI": try { message.setHeader(header.getKey(), new URI(header.getValue())); - } - catch (final Exception e) { + } catch (final Exception e) { LOG.warn("Unable to parse header to type URI. Ignoring it."); } break; @@ -108,8 +105,7 @@ public void process(final Exchange exchange) throws Exception { final Document document = db.parse(new ByteArrayInputStream(header.getValue().getBytes("UTF-8"))); message.setHeader(header.getKey(), document); - } - catch (final Exception e) { + } catch (final Exception e) { LOG.warn("Unable to parse header to type Document. Ignoring it."); } break; diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/OutgoingProcessor.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/OutgoingProcessor.java similarity index 85% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/OutgoingProcessor.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/OutgoingProcessor.java index eae6628dc..61c857555 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/processor/OutgoingProcessor.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/OutgoingProcessor.java @@ -26,16 +26,15 @@ import org.w3c.dom.Document; /** - * This processor is intended to extract the header fields from the envelope and add them into an - * object which can be transfered in XML format over MQTT. Therefore, the header fields can be - * preserved although MQTT does not support header fields.
+ * This processor is intended to extract the header fields from the envelope and add them into an object which can be + * transfered in XML format over MQTT. Therefore, the header fields can be preserved although MQTT does not support + * header fields.
*
- * + *

* Copyright 2018 IAAS University of Stuttgart
*
* * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * */ public class OutgoingProcessor implements Processor { @@ -44,7 +43,7 @@ public class OutgoingProcessor implements Processor { @Override public void process(final Exchange exchange) throws Exception { - OutgoingProcessor.LOG.debug("Processing outgoing message..."); + LOG.debug("Processing outgoing message..."); final Message message = exchange.getIn(); // only outgoing messages with body type CollaborationMessage are valid @@ -68,8 +67,8 @@ public void process(final Exchange exchange) throws Exception { stringRepresentation = header.getValue().toString(); } - OutgoingProcessor.LOG.debug("Adding header field with key {} and value {}", header.getKey(), - stringRepresentation); + LOG.debug("Adding header field with key {} and value {}", header.getKey(), + stringRepresentation); final KeyValueType keyValue = new KeyValueType(header.getKey(), stringRepresentation); headerList.add(keyValue); @@ -86,7 +85,7 @@ public void process(final Exchange exchange) throws Exception { message.setBody(jaxbCollaborationMessage); - OutgoingProcessor.LOG.trace("Forwarding message in XML format: {}", toXMLString(jaxbCollaborationMessage)); + LOG.trace("Forwarding message in XML format: {}", toXMLString(jaxbCollaborationMessage)); } } @@ -105,9 +104,8 @@ private String toXMLString(final JAXBElement element) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); marshaller.marshal(element, baos); return baos.toString(); - } - catch (final Exception e) { - OutgoingProcessor.LOG.debug("Error converting JAXb element to String: {}", e.getMessage()); + } catch (final Exception e) { + LOG.debug("Error converting JAXb element to String: {}", e.getMessage()); return ""; } } @@ -130,9 +128,8 @@ private String toXMLString(final Document doc) { transformer.transform(new DOMSource(doc), new StreamResult(sw)); return sw.toString(); - } - catch (final Exception e) { - OutgoingProcessor.LOG.debug("Error converting Document to String: {}", e.getMessage()); + } catch (final Exception e) { + LOG.debug("Error converting Document to String: {}", e.getMessage()); return ""; } } diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/package-info.java new file mode 100644 index 000000000..5863e447b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/processor/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the Camel processors which are needed for communication between Management Buses of different + * OpenTOSCA instances.

Copyright 2018 IAAS University of Stuttgart

+ * + * @author Benjamin Weder - st100495@stud.uni-stuttgart.de + */ +package org.opentosca.bus.management.service.impl.collaboration.processor; diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveRequestRoute.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveRequestRoute.java new file mode 100644 index 000000000..36af97ec2 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveRequestRoute.java @@ -0,0 +1,127 @@ +package org.opentosca.bus.management.service.impl.collaboration.route; + +import javax.xml.bind.JAXBContext; + +import org.apache.camel.LoggingLevel; +import org.apache.camel.Processor; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.converter.jaxb.JaxbDataFormat; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.service.impl.collaboration.model.ObjectFactory; +import org.opentosca.bus.management.service.impl.collaboration.model.RemoteOperations; +import org.opentosca.bus.management.service.impl.collaboration.processor.IncomingProcessor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This route is intended to receive requests made by other OpenTOSCA Containers.
+ *
+ *

+ * This route assumes that all interacting OpenTOSCA Containers use the same user name and password. Therefore, + * it can use the user name and password from the local config.ini file for authentication. If different credentials for + * different Containers shall be used, they all have to be defined in the config.ini and passed to this route via header + * fields.
+ *
+ *

+ * Copyright 2018 IAAS University of Stuttgart + */ +public class ReceiveRequestRoute extends RouteBuilder { + + final private static Logger LOG = LoggerFactory.getLogger(ReceiveResponseRoute.class); + + // MQTT broker credentials + final private String host; + final private String topic; + final private String username; + final private String password; + + /** + * Creates a Camel Route which can be used to receive requests from other collaborating OpenTOSCA Container nodes + * via MQTT. + * + * @param host the URL of the MQTT broker where the responses arrive + * @param topic the topic of the MQTT broker + * @param username the user name to authenticate at the MQTT broker + * @param password the password to authenticate at the MQTT broker + */ + public ReceiveRequestRoute(final String host, final String topic, final String username, final String password) { + this.host = host; + this.topic = topic; + this.username = username; + this.password = password; + } + + @Override + public void configure() throws Exception { + + // MQTT endpoint where this route waits for messages + final String consumerEndpoint = "mqtt:request?host=" + this.host + "&userName=" + this.username + "&password=" + + this.password + "&subscribeTopicNames=" + this.topic + "&qualityOfService=ExactlyOnce"; + + // endpoints to invoke the methods corresponding to requests + final String instanceMatchingEndpoint = + "bean:org.opentosca.bus.management.service.impl.collaboration.RequestReceiver?method=invokeInstanceDataMatching"; + final String deploymentEndpoint = + "bean:org.opentosca.bus.management.service.impl.collaboration.RequestReceiver?method=invokeIADeployment"; + final String undeploymentEndpoint = + "bean:org.opentosca.bus.management.service.impl.collaboration.RequestReceiver?method=invokeIAUndeployment"; + final String invocationEndpoint = + "bean:org.opentosca.bus.management.service.impl.collaboration.RequestReceiver?method=invokeIAOperation"; + + // JAXB definitions to unmarshal the incoming message body + final ClassLoader classLoader = + ObjectFactory.class.getClassLoader(); + final JAXBContext jc = + JAXBContext.newInstance("org.opentosca.bus.management.service.impl.collaboration.model", classLoader); + final JaxbDataFormat jaxb = new JaxbDataFormat(jc); + + // extracts headers from the marshaled object and adds them to the exchange + final Processor headerProcessor = new IncomingProcessor(); + + // header field which is used as routing criteria + final String remoteOperationHeader = MBHeader.REMOTEOPERATION_STRING.toString(); + + // log messages to increase the readability of the route + final String messageReceived = "Received request message via MQTT topic. Unmarshaling..."; + final String operation = "Message has remote operation header: ${header." + remoteOperationHeader + "}"; + final String noMarshalling = "Unable to unmarshal message. Ignoring it!"; + final String invalidOperation = "Remote operation header is either null or contains an invalid operation!"; + final String invokeInstanceDataMatching = "Invoking instance data matching on local OpenTOSCA Container"; + final String invokeIADeployment = "Invoking IA deployment on local OpenTOSCA Container"; + final String invokeIAUndeployment = "Invoking IA undeployment on local OpenTOSCA Container"; + final String invokeIAOperation = "Invoking IA operation on local OpenTOSCA Container"; + + // @formatter:off + this.from(consumerEndpoint) + .threads(2, 5) + .log(LoggingLevel.DEBUG, LOG, messageReceived) + .doTry() + .unmarshal(jaxb) + .process(headerProcessor) + .log(LoggingLevel.DEBUG, LOG, operation) + .choice() + .when(header(remoteOperationHeader).isEqualTo(RemoteOperations.INVOKE_INSTANCE_DATA_MATCHING)) + .log(LoggingLevel.DEBUG, LOG, invokeInstanceDataMatching) + .to(instanceMatchingEndpoint) + .endChoice() + .when(header(remoteOperationHeader).isEqualTo(RemoteOperations.INVOKE_IA_DEPLOYMENT)) + .log(LoggingLevel.DEBUG, LOG, invokeIADeployment) + .to(deploymentEndpoint) + .endChoice() + .when(header(remoteOperationHeader).isEqualTo(RemoteOperations.INVOKE_IA_UNDEPLOYMENT)) + .log(LoggingLevel.DEBUG, LOG, invokeIAUndeployment) + .to(undeploymentEndpoint) + .endChoice() + .when(header(remoteOperationHeader).isEqualTo(RemoteOperations.INVOKE_IA_OPERATION)) + .log(LoggingLevel.DEBUG, LOG, invokeIAOperation) + .to(invocationEndpoint) + .endChoice() + .otherwise() + .log(LoggingLevel.WARN, LOG, invalidOperation) + .endChoice() + .endDoTry() + .doCatch(Exception.class) + .log(LoggingLevel.ERROR, LOG, noMarshalling) + .end(); + } +} diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveResponseRoute.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveResponseRoute.java similarity index 77% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveResponseRoute.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveResponseRoute.java index 288b0e210..a28d468d8 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveResponseRoute.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/ReceiveResponseRoute.java @@ -8,15 +8,16 @@ import org.apache.camel.component.direct.DirectConsumerNotAvailableException; import org.apache.camel.converter.jaxb.JaxbDataFormat; import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.service.impl.collaboration.model.ObjectFactory; import org.opentosca.bus.management.service.impl.collaboration.processor.IncomingProcessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * This route is intended to forward responses to requests made by this OpenTOSCA Container to the - * corresponding callback methods.
+ * This route is intended to forward responses to requests made by this OpenTOSCA Container to the corresponding + * callback methods.
*
- * + *

* Copyright 2018 IAAS University of Stuttgart */ public class ReceiveResponseRoute extends RouteBuilder { @@ -30,11 +31,11 @@ public class ReceiveResponseRoute extends RouteBuilder { final private String password; /** - * Creates a Camel Route which can be used to receive responses from other collaborating - * OpenTOSCA Container nodes via MQTT. + * Creates a Camel Route which can be used to receive responses from other collaborating OpenTOSCA Container nodes + * via MQTT. * - * @param host the URL of the MQTT broker where the responses arrive - * @param topic the topic of the MQTT broker + * @param host the URL of the MQTT broker where the responses arrive + * @param topic the topic of the MQTT broker * @param username the user name to authenticate at the MQTT broker * @param password the password to authenticate at the MQTT broker */ @@ -59,7 +60,7 @@ public void configure() throws Exception { // JAXB definitions to unmarshal the incoming message body final ClassLoader classLoader = - org.opentosca.bus.management.service.impl.collaboration.model.ObjectFactory.class.getClassLoader(); + ObjectFactory.class.getClassLoader(); final JAXBContext jc = JAXBContext.newInstance("org.opentosca.bus.management.service.impl.collaboration.model", classLoader); final JaxbDataFormat jaxb = new JaxbDataFormat(jc); @@ -80,22 +81,22 @@ public void configure() throws Exception { this.from(consumerEndpoint) .log(LoggingLevel.DEBUG, LOG, messageReceived) .doTry() - .unmarshal(jaxb) - .process(headerProcessor) - .log(LoggingLevel.DEBUG, LOG, correlationID) - .choice() - .when(header(correlationHeader).isNotNull()) - .log(LoggingLevel.DEBUG, LOG, correlationNotNull) - .recipientList(this.simple(producerEndpoint)) - .endChoice() - .otherwise() - .log(LoggingLevel.WARN, LOG, noCorrelation) - .endChoice() + .unmarshal(jaxb) + .process(headerProcessor) + .log(LoggingLevel.DEBUG, LOG, correlationID) + .choice() + .when(header(correlationHeader).isNotNull()) + .log(LoggingLevel.DEBUG, LOG, correlationNotNull) + .recipientList(this.simple(producerEndpoint)) + .endChoice() + .otherwise() + .log(LoggingLevel.WARN, LOG, noCorrelation) + .endChoice() .endDoTry() .doCatch(DirectConsumerNotAvailableException.class) - .log(LoggingLevel.ERROR, LOG, noDirectException) + .log(LoggingLevel.ERROR, LOG, noDirectException) .doCatch(Exception.class) - .log(LoggingLevel.ERROR, LOG, noMarshalling) + .log(LoggingLevel.ERROR, LOG, noMarshalling) .end(); } } diff --git a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/SendRequestResponseRoute.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/SendRequestResponseRoute.java similarity index 75% rename from org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/SendRequestResponseRoute.java rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/SendRequestResponseRoute.java index e1a3a53ae..1ef782982 100644 --- a/org.opentosca.bus.management.service.impl/src/org/opentosca/bus/management/service/impl/collaboration/route/SendRequestResponseRoute.java +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/SendRequestResponseRoute.java @@ -7,21 +7,22 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.converter.jaxb.JaxbDataFormat; import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.bus.management.service.impl.collaboration.model.ObjectFactory; import org.opentosca.bus.management.service.impl.collaboration.processor.OutgoingProcessor; import org.slf4j.LoggerFactory; /** - * This route can be used to send Camel Exchanges via MQTT to other OpenTOSCA Containers. The broker - * details (IP + Port) and the topic are read from the header fields of the passed Exchange. - * Therefore, this route can be used to send requests and responses independent of the target.
+ * This route can be used to send Camel Exchanges via MQTT to other OpenTOSCA Containers. The broker details (IP + Port) + * and the topic are read from the header fields of the passed Exchange. Therefore, this route can be used to send + * requests and responses independent of the target.
*
- * - * This route assumes that all interacting OpenTOSCA Containers use the same user name and - * password. Therefore, it can use the user name and password from the local config.ini file for - * authentication. If different credentials for different Containers shall be used, they all have to - * be defined in the config.ini and passed to this route via header fields.
+ *

+ * This route assumes that all interacting OpenTOSCA Containers use the same user name and password. Therefore, + * it can use the user name and password from the local config.ini file for authentication. If different credentials for + * different Containers shall be used, they all have to be defined in the config.ini and passed to this route via header + * fields.
*
- * + *

* Copyright 2018 IAAS University of Stuttgart */ public class SendRequestResponseRoute extends RouteBuilder { @@ -31,8 +32,8 @@ public class SendRequestResponseRoute extends RouteBuilder { final private String password; /** - * Creates a Camel Route which can be used to send messages to other collaborating OpenTOSCA - * Container nodes via MQTT. + * Creates a Camel Route which can be used to send messages to other collaborating OpenTOSCA Container nodes via + * MQTT. * * @param username the user name to authenticate at the MQTT broker * @param password the password to authenticate at the MQTT broker @@ -60,7 +61,7 @@ public void configure() throws Exception { // JAXB definitions to marshal the outgoing message body final ClassLoader classLoader = - org.opentosca.bus.management.service.impl.collaboration.model.ObjectFactory.class.getClassLoader(); + ObjectFactory.class.getClassLoader(); final JAXBContext jc = JAXBContext.newInstance("org.opentosca.bus.management.service.impl.collaboration.model", classLoader); final JaxbDataFormat jaxb = new JaxbDataFormat(jc); @@ -73,11 +74,11 @@ public void configure() throws Exception { .log(LoggingLevel.DEBUG, LoggerFactory.getLogger(SendRequestResponseRoute.class), loggerMessage) .process(outgoingProcessor) .doTry() - .marshal(jaxb) - .recipientList(this.simple(producerEndpoint)) + .marshal(jaxb) + .recipientList(this.simple(producerEndpoint)) .endDoTry() .doCatch(Exception.class) - .log(LoggingLevel.ERROR, LoggerFactory.getLogger(SendRequestResponseRoute.class), exception) + .log(LoggingLevel.ERROR, LoggerFactory.getLogger(SendRequestResponseRoute.class), exception) .end(); } } diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/package-info.java new file mode 100644 index 000000000..2689ea1c9 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/collaboration/route/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the Camel routes which are needed for communication between the Management Buses of different + * OpenTOSCA instances.

Copyright 2018 IAAS University of Stuttgart

+ * + * @author Benjamin Weder - st100495@stud.uni-stuttgart.de + */ +package org.opentosca.bus.management.service.impl.collaboration.route; diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/instance/plan/PlanInstanceHandler.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/instance/plan/PlanInstanceHandler.java new file mode 100644 index 000000000..c29ec5e41 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/instance/plan/PlanInstanceHandler.java @@ -0,0 +1,228 @@ +package org.opentosca.bus.management.service.impl.instance.plan; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import javax.persistence.NoResultException; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TParameter; +import org.eclipse.winery.model.tosca.TPlan; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import org.glassfish.jersey.client.JerseyClient; +import org.glassfish.jersey.client.JerseyClientBuilder; +import org.glassfish.jersey.client.JerseyWebTarget; +import org.opentosca.bus.management.service.impl.Constants; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanInstanceInput; +import org.opentosca.container.core.next.model.PlanInstanceOutput; +import org.opentosca.container.core.next.model.PlanInstanceState; +import org.opentosca.container.core.next.model.PlanLanguage; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.next.repository.PlanInstanceRepository; +import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Utility class which handles the creation and updating of plan instance data.
+ *
+ *

+ * Copyright 2019 IAAS University of Stuttgart + */ +public class PlanInstanceHandler { + + private final static Logger LOG = LoggerFactory.getLogger(PlanInstanceHandler.class); + + private final static ServiceTemplateInstanceRepository stiRepo = new ServiceTemplateInstanceRepository(); + private final static PlanInstanceRepository planRepo = new PlanInstanceRepository(); + + /** + * Create a plan instance for the instance API and add the details about name, type, input parameters, etc. + * + * @param csar the CSAR the plan belongs to + * @param serviceTemplateId the Id of the ServiceTemplate the plan belongs to + * @param serviceTemplateInstanceId the Id of the ServiceTemplate instance the plan belongs to + * @param planId the ID of the plan + * @param correlationId the correlation Id that uniquely identifies the plan instance + * @param input the input parameters of the plan instance + * @return the created PlanInstance or null if the creation failed + */ + public static PlanInstance createPlanInstance(final Csar csar, final QName serviceTemplateId, + final long serviceTemplateInstanceId, final QName planId, + final String correlationId, final Object input) { + + final TPlan storedPlan; + try { + storedPlan = ToscaEngine.resolvePlanReference(csar, planId); + } catch (NotFoundException e) { + LOG.error("Plan with ID {} does not exist in CSAR {}!", planId, csar.id().csarName()); + return null; + } + + // create a new plan instance + final PlanInstance plan = new PlanInstance(); + plan.setCorrelationId(correlationId); + plan.setLanguage(PlanLanguage.fromString(storedPlan.getPlanLanguage())); + plan.setType(PlanType.fromString(storedPlan.getPlanType())); + plan.setState(PlanInstanceState.RUNNING); + plan.setTemplateId(planId); + + // cast input parameters for the plan invocation + Map inputMap = new HashMap<>(); + if (input instanceof HashMap) { + inputMap = (HashMap) input; + } + + // add input parameters to the plan instance + for (final TParameter param : storedPlan.getInputParameters().getInputParameter()) { + new PlanInstanceInput(param.getName(), inputMap.getOrDefault(param.getName(), ""), + param.getType()).setPlanInstance(plan); + } + + // add connection to the service template and update the repository + stiRepo.find(serviceTemplateInstanceId) + .ifPresent(serviceTemplateInstance -> plan.setServiceTemplateInstance(serviceTemplateInstance)); + planRepo.add(plan); + + return plan; + } + + /** + * Create a unique correlation ID based on the current time. + * + * @return the unique correlation ID + */ + public static String createCorrelationId() { + // generate CorrelationId for the plan execution + while (true) { + final String correlationId = String.valueOf(System.currentTimeMillis()); + + try { + planRepo.findByCorrelationId(correlationId); + LOG.debug("CorrelationId {} already in use.", correlationId); + } catch (final NoResultException e) { + return correlationId; + } + } + } + + /** + * Update the plan instance information with the output parameters from the plan invocation. + * + * @param plan the plan instance object to update + * @param csar the Id of the CSAR the plan belongs to + * @param body the body of the camel envelope resulting from the invocation and containing the output parameters + */ + public static void updatePlanInstanceOutput(final PlanInstance plan, final Csar csar, final Object body) { + + final TPlan planModel; + try { + planModel = ToscaEngine.resolvePlanReference(csar, plan.getTemplateId()); + } catch (NotFoundException e) { + LOG.warn("Could not find plan with id {} corresponding to instance {} in csar {}! Aborting output update.", + plan.getTemplateId(), plan.getCorrelationId(), csar.id().csarName()); + return; + } + + if (plan.getLanguage().equals(PlanLanguage.BPEL)) { + LOG.debug("Received response from BPEL plan"); + if (body instanceof Map) { + @SuppressWarnings("unchecked") final Map map = (Map) body; + // add output parameters to the PlanInstance object and update repository + for (final TParameter param : planModel.getOutputParameters().getOutputParameter()) { + new PlanInstanceOutput(param.getName(), map.get(param.getName()), + param.getType()).setPlanInstance(plan); + } + } else { + LOG.error("Response from BPEL plan is not of type Map"); + } + } else if (plan.getLanguage().equals(PlanLanguage.BPMN)) { + LOG.debug("Received response from BPMN plan"); + // parse process instance ID out of REST response + final String planInstanceID = parseRESTResponse(body); + if (Objects.isNull(planInstanceID) || planInstanceID.equals("")) { + LOG.error("The parsing of the response failed!"); + return; + } + LOG.debug("Instance ID of the plan in Camunda: {}", planInstanceID); + + // create web resource to retrieve the current state of the process instance + final JerseyClient client = JerseyClientBuilder.createClient(); + JerseyWebTarget webResource = + client.target(Settings.ENGINE_PLAN_BPMN_URL + Constants.PROCESS_INSTANCE_PATH + planInstanceID); + + // wait until the process instance terminates + while (true) { + final String resp = webResource.request().get().readEntity(String.class); + LOG.debug("Active process instance response: " + resp); + + try { + Thread.sleep(10000); + } catch (final InterruptedException e) { + e.printStackTrace(); + } + + // check if history contains process instance with this ID + if (resp.equals("[]")) { + LOG.debug("The plan instance {} is not active any more.", planInstanceID); + break; + } + } + + // get output parameters of the plan from the process instance variables + for (final TParameter param : planModel.getOutputParameters().getOutputParameter()) { + final String path = Settings.ENGINE_PLAN_BPMN_URL + Constants.HISTORY_PATH; + + // get variable instances of the process instance with the param name + webResource = client.target(path); + webResource = webResource.queryParam("processInstanceId", planInstanceID); + webResource = webResource.queryParam("activityInstanceIdIn", planInstanceID); + webResource = webResource.queryParam("variableName", param.getName()); + final String responseStr = webResource.request().get().readEntity(String.class); + + if (responseStr.equals("[]")) { + LOG.warn("Unable to find variable instance for output parameter: {}", param.getName()); + continue; + } + + String value = null; + try { + final JsonParser parser = new JsonParser(); + final JsonObject json = + (JsonObject) parser.parse(responseStr.substring(1, responseStr.length() - 1)); + value = json.get("value").getAsString(); + } catch (final ClassCastException e) { + LOG.trace("value is null"); + value = ""; + } + LOG.debug("For variable \"{}\" the output value is \"{}\"", param.getName(), value); + new PlanInstanceOutput(param.getName(), value, param.getType()).setPlanInstance(plan); + } + } else { + LOG.error("Unable to handle response for plan invocations with the plan language: {}", plan.getLanguage()); + } + + // update the repo with the changed plan instance + planRepo.update(plan); + } + + /** + * Parse the REST response returned by Camunda BPMN + * + * @param responseBody the body of the response + * @return the Camunda instance ID identifying the plan instance + */ + private static String parseRESTResponse(final Object responseBody) { + final String resp = (String) responseBody; + final String instanceID = resp.substring(resp.indexOf("href\":\"") + 7, resp.length()); + return instanceID.substring(instanceID.lastIndexOf("/") + 1, instanceID.indexOf("\"")); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/package-info.java new file mode 100644 index 000000000..a109bb197 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/package-info.java @@ -0,0 +1,8 @@ +/** + * This package contains the implementation of the {@link org.opentosca.bus.management.service.IManagementBusService}. + * Determining which IA/Plan should be invoked as well as collecting needed information like the endpoint for example + * are done here.

Copyright 2012 IAAS University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.service.impl; diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/DeploymentPluginCapabilityChecker.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/DeploymentPluginCapabilityChecker.java new file mode 100644 index 000000000..c19f9c72a --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/DeploymentPluginCapabilityChecker.java @@ -0,0 +1,97 @@ +package org.opentosca.bus.management.service.impl.util; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import javax.inject.Inject; + +import org.eclipse.winery.model.tosca.TRequiredContainerFeature; +import org.eclipse.winery.model.tosca.TRequiredContainerFeatures; + +import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; +import org.opentosca.container.core.model.capability.provider.ProviderType; +import org.opentosca.container.core.service.ICoreCapabilityService; +import org.springframework.stereotype.Service; + +/** + * Analyzes if a given Implementation Artifact is deployable, meaning checking if the required capabilities of the + * Implementation Artifact are met by the container and/or available plug-ins (plan + deployment).
+ *
+ *

+ * Copyright 2018 IAAS University of Stuttgart
+ *
+ * + * @author Benjamin Weder - st100495@stud.uni-stuttgart.de + */ + +@Service +public class DeploymentPluginCapabilityChecker { + + private final ICoreCapabilityService capabilityService; + + @Inject + public DeploymentPluginCapabilityChecker(ICoreCapabilityService capabilityService) { + this.capabilityService = capabilityService; + } + + public boolean capabilitiesAreMet(final TRequiredContainerFeatures requiredFeatures, final IManagementBusDeploymentPluginService plugin) { + if (requiredFeatures == null || requiredFeatures.getRequiredContainerFeature().isEmpty()) { + return true; + } + return capabilitiesAreMet(requiredFeatures.getRequiredContainerFeature().stream().map(TRequiredContainerFeature::getFeature).collect(Collectors.toList()), plugin); + } + + /** + * Checks if required features are met by chosen plug-in or container and plan. + * + * @param requiredFeatures the set of features to be satisfied + * @param plugin the deployment plug-in + * @return true if all requiredFeatures are met, false otherwise + */ + public boolean capabilitiesAreMet(final List requiredFeatures, + final IManagementBusDeploymentPluginService plugin) { + if (requiredFeatures.isEmpty()) { + return true; + } + + // get all provided capabilities + final List capabilities = new ArrayList<>(); + capabilities.addAll(getContainerAndPlanCapabilities()); + capabilities.addAll(plugin.getCapabilties()); + + // remove all required features that are satisfied by a capability + for (final Iterator itReqCaps = requiredFeatures.iterator(); itReqCaps.hasNext(); ) { + final String reqCap = itReqCaps.next(); + if (capabilities.contains(reqCap)) { + itReqCaps.remove(); + } + } + + // return true if no further requested feature exists + return requiredFeatures.isEmpty(); + } + + /** + * Returns container and plan capabilities from the CoreCapabilitiyService. + * + * @return container and plan capabilities in one merged list. + */ + private List getContainerAndPlanCapabilities() { + + final List conAndPlanCaps = new ArrayList<>(); + + final List containerCaps = capabilityService.getCapabilities(ProviderType.CONTAINER.toString(), ProviderType.CONTAINER); + final Map> planPluginsCaps = capabilityService.getCapabilities(ProviderType.PLAN_PLUGIN); + + conAndPlanCaps.addAll(containerCaps); + + for (final String planPlugin : planPluginsCaps.keySet()) { + conAndPlanCaps.addAll(planPluginsCaps.get(planPlugin)); + } + + return conAndPlanCaps; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/ParameterHandler.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/ParameterHandler.java new file mode 100644 index 000000000..8cc373ee1 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/ParameterHandler.java @@ -0,0 +1,289 @@ +package org.opentosca.bus.management.service.impl.util; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TEntityType; +import org.eclipse.winery.model.tosca.TInterface; +import org.eclipse.winery.model.tosca.TOperation; +import org.eclipse.winery.model.tosca.TParameter; + +import org.opentosca.bus.management.utils.MBUtils; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.engine.xml.IXMLSerializer; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.container.core.tosca.convention.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * Utility class which contains methods to handle input parameters for operation invocations by the Management Bus.
+ *
+ *

+ * Copyright 2019 IAAS University of Stuttgart + */ +@Service +public class ParameterHandler { + + private final static Logger LOG = LoggerFactory.getLogger(ParameterHandler.class); + private final IXMLSerializer xmlSerializer; + + @Inject + public ParameterHandler(IXMLSerializer xmlSerializer) { + this.xmlSerializer = xmlSerializer; + } + + /** + * Updates missing input parameters for a operation on a NodeTemplate or RelationshipTemplate with instance data. + * The provided input parameters have priority, which means if one parameter is provided and found in the instance + * data, then the provided parameter is used.
+ *
+ *

+ * If nodeTemplateInstance and relationshipTemplateInstance are provided, the update will be performed based on the + * RelationshipTemplate. If one of the parameters is null the other one is used to perform the update. If + * both are null an update is not possible. + * + * @param inputParams the set of provided input parameters + * @param csar containing the NodeTemplate/RelationshipTemplate + * @param nodeTemplateInstance the NodeTemplateInstance object which is used as entry point to the stored + * instance data. If it does not contain all needed parameters the search is + * continued downwards in the topology + * @param relationshipTemplateInstance the RelationshipTemplateInstance object which is used as entry point to the + * stored instance data. The update is performed based on the + * RelationshipTemplate and the source/target stack of the topology + * @param neededInterface the interface of the operation for which the update is performed + * @param neededOperation the operation for which the update is performed + * @return the updated input parameters. + */ + public Map updateInputParams(final Map inputParams, + final Csar csar, + final NodeTemplateInstance nodeTemplateInstance, + final RelationshipTemplateInstance relationshipTemplateInstance, + final String neededInterface, + final String neededOperation) { + if (Objects.nonNull(relationshipTemplateInstance)) { + return updateInputParamsForRelationshipTemplate(inputParams, csar, relationshipTemplateInstance, neededInterface, neededOperation); + } else if (Objects.nonNull(nodeTemplateInstance)) { + return updateInputParamsForNodeTemplate(inputParams, csar, nodeTemplateInstance, neededInterface, neededOperation); + } else { + LOG.warn("Unable to update input parameters with nodeTemplateInstance and relationshipTemplateInstance equal to null!"); + return inputParams; + } + } + + /** + * Updates missing input parameters for a operation on a NodeTemplate with instance data. The provided input + * parameters have priority, which means if one parameter is provided and found in the instance data, then the + * provided parameter is used. + * + * @param inputParams the set of provided input parameters + * @param csar containing the NodeTemplate + * @param nodeTemplateInstance the NodeTemplate instance object + * @param neededInterface the interface of the operation for which the update is performed + * @param neededOperation the operation for which the update is performed + * @return the updated input parameters. + */ + private Map updateInputParamsForNodeTemplate(final Map inputParams, + final Csar csar, + NodeTemplateInstance nodeTemplateInstance, + final String neededInterface, + final String neededOperation) { + Objects.requireNonNull(nodeTemplateInstance); + + LOG.debug("Updating input params for NodeTemplateInstance ID: {}", nodeTemplateInstance.getId()); + LOG.debug("{} inital input parameters for operation: {} found: {}", inputParams.size(), neededOperation, inputParams.toString()); + + // check if operation has input params at all + final Set unsetParameters = getExpectedInputParams(csar, nodeTemplateInstance.getTemplateType(), neededInterface, neededOperation); + if (unsetParameters.isEmpty()) { + LOG.debug("No input params defined for this operation."); + return inputParams; + } + + LOG.debug("Operation: {} expects {} parameters: {}", neededOperation, unsetParameters.size(), unsetParameters.toString()); + + // use convention names for properties + final List supportedIPPropertyNames = Utils.getSupportedVirtualMachineIPPropertyNames(); + final List supportedInstanceIdPropertyNames = Utils.getSupportedVirtualMachineInstanceIdPropertyNames(); + final List supportedPasswordPropertyNames = Utils.getSupportedVirtualMachineLoginPasswordPropertyNames(); + final List supportedUsernamePropertyNames = Utils.getSupportedVirtualMachineLoginUserNamePropertyNames(); + + // remove already defined properties from the set + unsetParameters.removeAll(inputParams.keySet()); + + // search for parameters downwards in the topology until all are set + while (!unsetParameters.isEmpty()) { + if (nodeTemplateInstance.getTemplateType().equals(Types.abstractOperatingSystemNodeType)) { + nodeTemplateInstance = MBUtils.getAbstractOSReplacementInstance(nodeTemplateInstance); + } + + // retrieve stored instance data for current node + final Map propertiesMap = nodeTemplateInstance.getPropertiesAsMap(); + if (Objects.nonNull(propertiesMap)) { + + LOG.debug("Found following properties in the instance data:"); + for (final String key : propertiesMap.keySet()) { + LOG.debug("Prop: " + key + " Val: " + propertiesMap.get(key)); + } + + // update currently not set input parameters if possible + unsetParameters.stream().forEach(param -> { + if (supportedIPPropertyNames.contains(param)) { + LOG.debug("Supported IP-Property found."); + getSupportedProperty(supportedIPPropertyNames, propertiesMap) + .ifPresent(foundValue -> inputParams.put(param, foundValue)); + } else if (supportedInstanceIdPropertyNames.contains(param)) { + LOG.debug("Supported InstanceID-Property found."); + getSupportedProperty(supportedInstanceIdPropertyNames, propertiesMap) + .ifPresent(foundValue -> inputParams.put(param, foundValue)); + } else if (supportedPasswordPropertyNames.contains(param)) { + LOG.debug("Supported Password-Property found."); + getSupportedProperty(supportedPasswordPropertyNames, propertiesMap) + .ifPresent(foundValue -> inputParams.put(param, foundValue)); + } else if (supportedUsernamePropertyNames.contains(param)) { + LOG.debug("Supported Username-Property found."); + getSupportedProperty(supportedUsernamePropertyNames, propertiesMap) + .ifPresent(foundValue -> inputParams.put(param, foundValue)); + } else { + propertiesMap.keySet().stream() + .filter(name -> name.equals(param)).findFirst() + .ifPresent(name -> inputParams.put(param, propertiesMap.get(name))); + } + }); + + // remove found properties + unsetParameters.removeAll(inputParams.keySet()); + } else { + LOG.debug("No stored instance data found for current node: {}", nodeTemplateInstance.getId()); + } + + // get next node downwards in the topology + final Optional nextNode = MBUtils.getNextNodeTemplateInstance(nodeTemplateInstance); + if (nextNode.isPresent()) { + nodeTemplateInstance = nextNode.get(); + LOG.debug("Next node for parameter search: {}", nodeTemplateInstance.getId()); + } else { + LOG.warn("No next node found for parameter search. Terminating with {} unsatisfied expected parameters", + unsetParameters.size()); + break; + } + } + + LOG.debug("Final {} input parameters for operation {} : {}", inputParams.size(), neededOperation, inputParams.toString()); + + return inputParams; + } + + /** + * Updates missing input parameters for a operation on a RelationshipTemplate with instance data. The provided input + * parameters have priority, which means if one parameter is provided and found in the instance data, then the + * provided parameter is used.
+ *
+ * + * Convention:
+ * Input parameters without prefix are searched on the RelationshipTemplateInstance.
Input parameters with + * prefix "SRC_" are searched on the NodeTemplateInstance which is the source of the RelationshipTemplate.
+ * Input parameters with prefix "TRG_" are searched on the NodeTemplateInstance which is the target of the + * RelationshipTemplate. + * + * @param inputParams the set of provided input parameters + * @param csar containing the RelationshipTemplate + * @param relationshipTemplateInstance the RelationshipTemplate instance object + * @param neededInterface the interface of the operation for which the update is performed + * @param neededOperation the operation for which the update is performed + * @return the updated input parameters. + */ + private Map updateInputParamsForRelationshipTemplate(final Map inputParams, + final Csar csar, + final RelationshipTemplateInstance relationshipTemplateInstance, + final String neededInterface, + final String neededOperation) { + + Objects.requireNonNull(relationshipTemplateInstance); + + LOG.debug("Updating input params for RelationshipTemplate ID: {}", relationshipTemplateInstance.getId()); + LOG.debug("{} inital input parameters for operation: {} found: {}", inputParams.size(), neededOperation, inputParams.toString()); + + // check if operation has input params at all + final Set expectedParams = getExpectedInputParams(csar, relationshipTemplateInstance.getTemplateType(), neededInterface, neededOperation); + if (expectedParams.isEmpty()) { + LOG.debug("No input params defined for this operation."); + return inputParams; + } + + LOG.debug("Operation: {} expects {} parameters: {}", neededOperation, expectedParams.size(), expectedParams.toString()); + + // update params with instance data + for (final String expectedParam : expectedParams) { + LOG.debug("Expected parameter: {}", expectedParam); + + if (expectedParam.startsWith("SRC_")) { + LOG.debug("Parameter is defined at the topology stack of the source NodeTemplate."); + // TODO: search on source stack + } else if (expectedParam.startsWith("TRG_")) { + LOG.debug("Parameter is defined at the topology stack of the target NodeTemplate."); + // TODO: search on target stack + } else { + LOG.debug("Parameter is defined at the RelationshipTemplate."); + // TODO: search on RelationshipTemplateInstance properties + } + } + + return inputParams; + } + + /** + * Returns the input parameters of the given operation which are specified in the TOSCA definitions of the NodeType + * or RelationshipType. + * + * @param csar The CSAR which contains the NodeType or RelationshipType with the operation + * @param typeID ID of the NodeType or RelationshipType which contains the operation + * @param interfaceName the name of the interface which contains the operation + * @param operationName the operation name for which the parameters are searched + * @return specified input parameters of the operation + */ + private Set getExpectedInputParams(final Csar csar, final QName typeID, + final String interfaceName, final String operationName) { + + final TOperation resolvedOperation; + try { + TEntityType entityType = ToscaEngine.resolveEntityTypeReference(csar, typeID); + TInterface typeInterface = ToscaEngine.resolveInterfaceAbstract(entityType, interfaceName); + resolvedOperation = ToscaEngine.resolveOperation(typeInterface, operationName); + } catch (NotFoundException e) { + LOG.warn("Could not resolve Operation {} on Interface {} for Type {}", operationName, interfaceName, typeID); + return Collections.emptySet(); + } + + return Optional.ofNullable(resolvedOperation.getInputParameters()) + .map(TOperation.InputParameters::getInputParameter) + .map(l -> l.stream().map(TParameter::getName).collect(Collectors.toSet())) + .orElse(Collections.emptySet()); + } + + /** + * Checks if one of the supported properties is defined in the Map and returns an optional with the corresponding + * value. + * + * @param supportedProperties a List of supported properties + * @param propertiesMap a Map containing properties of a NodeTemplateInstance + * @return an Optional with the value of a supported property if one is found, an empty Optional otherwise + */ + private static Optional getSupportedProperty(final List supportedProperties, + final Map propertiesMap) { + return supportedProperties.stream().filter(propertiesMap::containsKey).findFirst().map(propertiesMap::get); + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/PluginHandler.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/PluginHandler.java new file mode 100644 index 000000000..88524d9f3 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/PluginHandler.java @@ -0,0 +1,176 @@ +package org.opentosca.bus.management.service.impl.util; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TArtifactTemplate; + +import org.apache.camel.Exchange; +import org.opentosca.bus.management.deployment.plugin.IManagementBusDeploymentPluginService; +import org.opentosca.bus.management.invocation.plugin.IManagementBusInvocationPluginService; +import org.opentosca.bus.management.service.impl.Constants; +import org.opentosca.bus.management.service.impl.PluginRegistry; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.tosca.convention.Types; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * Utility class which contains methods to handle the deployment/invocation plug-ins and their corresponding types.
+ *
+ *

+ * Copyright 2019 IAAS University of Stuttgart + */ +@Service +public class PluginHandler { + + private final static Logger LOG = LoggerFactory.getLogger(PluginHandler.class); + + private final PluginRegistry pluginRegistry; + + @Inject + public PluginHandler(PluginRegistry pluginRegistry) { + this.pluginRegistry = pluginRegistry; + } + + /** + * Calls the invocation plug-in that supports the specific invocation-type and redirects invocations on remote + * OpenTOSCA Containers to the 'remote' plug-in. + * + * @param exchange the exchange that has to be passed to the plug-in. + * @param invocationType the invocation type for the IA/Plan invocation + * @param deploymentLocation the deployment location of the IA/Plan that is invoked + * @return the response of the called plug-in. + */ + public Exchange callMatchingInvocationPlugin(Exchange exchange, String invocationType, + final String deploymentLocation) { + LOG.debug("Searching a matching invocation plug-in for InvocationType {} and deployment location {}", + invocationType, deploymentLocation); + + IManagementBusInvocationPluginService invocationPlugin = pluginRegistry.getInvocationPluginServices().get(invocationType); + // redirect invocation call to 'remote' plug-in if deployment location is not the local Container and we're invoking the Script plugin + if (!deploymentLocation.equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME)) { + if (invocationPlugin.getSupportedTypes().contains(Types.scriptArtifactType.toString())) { + LOG.debug("Deployment location is remote. Redirecting invocation to remote plug-in."); + invocationPlugin = pluginRegistry.getInvocationPluginServices().get(Constants.REMOTE_TYPE); + } + } + if (invocationPlugin != null) { + exchange = invocationPlugin.invoke(exchange); + } else { + LOG.warn("No matching invocation plug-in found for invocation type {}!", invocationType); + } + return exchange; + } + + /** + * Calls the deployment plug-in that supports the specific deployment type and redirects deployments on remote + * OpenTOSCA Containers to the 'remote' plug-in. + * + * @param exchange the exchange that has to be passed to the plug-in. + * @param deploymentType the deployment type of the IA that shall be deployed + * @param deploymentLocation the deployment location of the IA + * @return the response of the called plug-in. + */ + public Exchange callMatchingDeploymentPlugin(Exchange exchange, String deploymentType, + final String deploymentLocation) { + + LOG.debug("Searching a matching deployment plug-in for deployment type {} and deployment location {}", + deploymentType, deploymentLocation); + + // redirect deployment call to 'remote' plug-in if deployment location is not the local Container + if (!deploymentLocation.equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME)) { + LOG.debug("Deployment location is remote. Redirecting deployment to remote plug-in."); + + deploymentType = Constants.REMOTE_TYPE; + } + + final IManagementBusDeploymentPluginService deploymentPlugin = pluginRegistry.getDeploymentPluginServices().get(deploymentType); + if (deploymentPlugin != null) { + exchange = deploymentPlugin.invokeImplementationArtifactDeployment(exchange); + } else { + LOG.warn("No matching deployment plug-in found for deployment type {}!", deploymentType); + } + return exchange; + } + + /** + * Checks if an deployment plug-in is available that supports the specified artifact and returns the deployment + * type. + * + * @param artifactType to check if supported. + * @return the deployment type or otherwise null. + */ + public String getSupportedDeploymentType(final QName artifactType) { + LOG.debug("Searching if a deployment plug-in supports the type {}", artifactType); + // Check if the ArtifactType can be deployed by a plug-in + if (pluginRegistry.getDeploymentPluginServices().containsKey(artifactType.toString())) { + return artifactType.toString(); + } + + LOG.debug("Did not find a plugin in the list of currently known plugins: {}", pluginRegistry.getDeploymentPluginServices().toString()); + return null; + } + + /** + * Checks if an invocation plug-in is available that supports the specified artifact and returns the invocation + * type. + * + * @param artifactType to check if supported. + * @param artifactTemplate to get properties to check for InvocationType. + * @return the invocation type or otherwise null. + */ + public String getSupportedInvocationType(final QName artifactType, final TArtifactTemplate artifactTemplate) { + + LOG.debug("Searching if a invocation plug-in supports the type {}", artifactType); + // First check if a plug-in is registered that supports the ArtifactType. + if (pluginRegistry.getInvocationPluginServices().containsKey(artifactType.toString())) { + return artifactType.toString(); + } else { + final Document properties = ToscaEngine.getEntityTemplateProperties(artifactTemplate); + // Second check if a invocation-type is specified in TOSCA definition + final String invocationType = getInvocationType(properties); + if (invocationType != null) { + if (pluginRegistry.getInvocationPluginServices().containsKey(invocationType)) { + LOG.debug("Found a supported invocation type in the artifact template properties"); + return invocationType; + } + } + } + + LOG.debug("Artifact type was not found in the list of currently supported types: {}", pluginRegistry.getInvocationPluginServices().toString()); + return null; + } + + /** + * Checks if a InvocationType was specified in the Tosca.xml and returns it if so. + * + * @param properties to check for InvocationType. + * @return InvocationType if specified. Otherwise null. + */ + private static String getInvocationType(final Document properties) { + + // checks if there are specified properties at all. + if (properties != null) { + final NodeList list = properties.getFirstChild().getChildNodes(); + + for (int i = 0; i < list.getLength(); i++) { + + final Node propNode = list.item(i); + final String localName = propNode.getLocalName(); + + // check if the node contains the InvocationType + if (localName != null && localName.equals("InvocationType")) { + return propNode.getTextContent().trim(); + } + } + } + LOG.debug("No InvocationType found!"); + return null; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/Util.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/Util.java new file mode 100644 index 000000000..2493ddfc7 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/Util.java @@ -0,0 +1,86 @@ +package org.opentosca.bus.management.service.impl.util; + +import java.net.URI; +import java.util.Objects; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TArtifactTemplate; + +import org.apache.commons.lang3.StringUtils; +import org.opentosca.container.core.engine.ToscaEngine; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class Util { + + private final static Logger LOG = LoggerFactory.getLogger(Util.class); + + /** + * Determine the ServiceTemplateInstanceId long from the ServiceInstanceId QName. + * + * @return the ServiceTemplateInstanceId if the retrieval is successful, Long.MIN_VALUE otherwise + */ + public static long determineServiceTemplateInstanceId(final URI serviceInstanceID) { + if (Objects.nonNull(serviceInstanceID)) { + try { + if (serviceInstanceID.toString().contains("/")) { + return Long.parseLong(StringUtils.substringAfterLast(serviceInstanceID.toString(), "/")); + } else { + return Long.parseLong(serviceInstanceID.toString()); + } + } catch (final NumberFormatException e) { + LOG.error("Unable to parse ServiceTemplateInstance ID out of serviceInstanceID: {}", serviceInstanceID); + } + } else { + LOG.error("Unable to parse ServiceTemplateInstance ID out of serviceInstanceID because it is null!"); + } + return Long.MIN_VALUE; + } + + /** + * Checks if a certain property was specified in the Tosca.xml of the ArtifactTemplate and returns it if so. + * + * @param artifactTemplate the ID of the ArtifactTemplate + * @param propertyName the name of the property + * @return the property value if specified, null otherwise + */ + public static String getProperty(final TArtifactTemplate artifactTemplate, final String propertyName) { + final Document properties = ToscaEngine.getEntityTemplateProperties(artifactTemplate); + // check if there are specified properties at all + if (properties == null) { + return null; + } + + final NodeList list = properties.getFirstChild().getChildNodes(); + // iterate through properties and check name + for (int i = 0; i < list.getLength(); i++) { + final Node propNode = list.item(i); + final String localName = propNode.getLocalName(); + if (localName != null && localName.equals(propertyName)) { + return propNode.getTextContent().trim(); + } + } + return null; + } + + /** + * Checks if a PortType property was specified in the Tosca.xml of the ArtifactTemplate and returns it if so. + * + * @param artifactTemplate the ArtifactTemplate + * @return the PortType property value as QName if specified, null otherwise + */ + public static QName getPortTypeQName(final TArtifactTemplate artifactTemplate) { + try { + QName portType = QName.valueOf(getProperty(artifactTemplate, "PortType")); + LOG.debug("PortType property: {}", portType.toString()); + return portType; + } catch (final IllegalArgumentException e) { + LOG.warn("PortType property can not be parsed to QName."); + } + return null; + } +} diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/package-info.java new file mode 100644 index 000000000..1e0a7903c --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/impl/util/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains the utility classes for the Management Bus implementation.

Copyright 2018 IAAS + * University of Stuttgart

+ * + * @author Benjamin Weder - st100495@stud.uni-stuttgart.de + */ +package org.opentosca.bus.management.service.impl.util; diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/package-info.java b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/package-info.java new file mode 100644 index 000000000..b60a05c2a --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/java/org/opentosca/bus/management/service/package-info.java @@ -0,0 +1,8 @@ +/** + * This package contains the interface of the Management Bus. It defines two methods: One for invoking an + * ImplementationArtifact and one for invoking a Plan.

Copyright 2012 IAAS University of Stuttgart
+ *
+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.service; diff --git a/org.opentosca.bus/org.opentosca.bus.management.service/src/main/resources/spring/context-bus-management-service.xml b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/resources/spring/context-bus-management-service.xml new file mode 100644 index 000000000..13243d0e3 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/resources/spring/context-bus-management-service.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/org.opentosca.bus.management.service.impl/META-INF/xsd/collaboration.xsd b/org.opentosca.bus/org.opentosca.bus.management.service/src/main/resources/xsd/collaboration.xsd similarity index 100% rename from org.opentosca.bus.management.service.impl/META-INF/xsd/collaboration.xsd rename to org.opentosca.bus/org.opentosca.bus.management.service/src/main/resources/xsd/collaboration.xsd diff --git a/org.opentosca.bus/org.opentosca.bus.management/pom.xml b/org.opentosca.bus/org.opentosca.bus.management/pom.xml new file mode 100644 index 000000000..5dfafd87e --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.bus + 2.0.0-SNAPSHOT + + + org.opentosca.bus.management + + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.container.legacy + ${project.version} + + + diff --git a/org.opentosca.bus.management/src/org/opentosca/bus/management/header/MBHeader.java b/org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/header/MBHeader.java similarity index 77% rename from org.opentosca.bus.management/src/org/opentosca/bus/management/header/MBHeader.java rename to org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/header/MBHeader.java index 19e86c326..3ce2db2b0 100644 --- a/org.opentosca.bus.management/src/org/opentosca/bus/management/header/MBHeader.java +++ b/org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/header/MBHeader.java @@ -1,28 +1,21 @@ package org.opentosca.bus.management.header; -import org.opentosca.container.core.model.csar.id.CSARID; - /** * Enum needed for the MB-components.
*
- * + *

* Copyright 2018 IAAS University of Stuttgart
*
- * - * This enum defines the headers of the camel exchange message that is used from all - * MB-components.
+ *

+ * This enum defines the headers of the camel exchange message that is used from all MB-components.
*
- * - * All header fields must end with their type after the last underscore of the name, otherwise they - * can not be used by the collaboration classes. This is because the header fields have to be - * transformed to String to be transmitted over MQTT and the information is needed to recreate the - * corresponding type afterwards. - * - * + *

+ * All header fields must end with their type after the last underscore of the name, otherwise they can not be used by + * the collaboration classes. This is because the header fields have to be transformed to String to be transmitted over + * MQTT and the information is needed to recreate the corresponding type afterwards. * * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de * @author Benjamin Weder - st100495@stud.uni-stuttgart.de - * */ public enum MBHeader { @@ -30,14 +23,14 @@ public enum MBHeader { /** * TRIGGERINGCONTAINER_STRING This header field contains the host name of the OpenTOSCA - * Container where the invoke request in this exchange was initiated. It makes all other - * identifying header fields unique if multiple OpenTOSCA Containers interact. + * Container where the invoke request in this exchange was initiated. It makes all other identifying header fields + * unique if multiple OpenTOSCA Containers interact. */ TRIGGERINGCONTAINER_STRING, /** * CSARID This header field contains an identifier for a CSAR file in OpenTOSCA (see - * {@link CSARID}). + * {@link org.opentosca.container.core.model.csar.CsarId}). */ CSARID, @@ -59,8 +52,7 @@ public enum MBHeader { /** * OPERATIONNAME_STRING This header field specifies the interface which contains the - * operation that shall be executed by passing the camel exchange message to an invocation - * plug-in. + * operation that shall be executed by passing the camel exchange message to an invocation plug-in. */ INTERFACENAME_STRING, @@ -98,9 +90,8 @@ public enum MBHeader { /** * ARTIFACTTEMPLATEID_QNAME This header field contains a QName that identifies an - * ArtifactTemplate. The ArtifactTemplate is part of the NodeTypeImplementation or - * RelationshipTypeImplementation that is specified by - * {@link MBHeader#TYPEIMPLEMENTATIONID_QNAME}. + * ArtifactTemplate. The ArtifactTemplate is part of the NodeTypeImplementation or RelationshipTypeImplementation + * that is specified by {@link MBHeader#TYPEIMPLEMENTATIONID_QNAME}. */ ARTIFACTTEMPLATEID_QNAME, @@ -114,52 +105,51 @@ public enum MBHeader { * PORTTYPE_QNAME This header field contains the PortType of the ArtifactTemplate * represented by {@link MBHeader#ARTIFACTTEMPLATEID_QNAME} if one is specified. */ - PORTTYPE_QNAME, + PORT_TYPE_QNAME, /** - * IMPLEMENTATIONARTIFACTNAME_STRING This header field contains the name of the + * IMPLEMENTATION_ARTIFACT_NAME_STRING This header field contains the name of the * Implementation Artifact which shall be invoked by the camel exchange. */ - IMPLEMENTATIONARTIFACTNAME_STRING, + IMPLEMENTATION_ARTIFACT_NAME_STRING, /** * ARTIFACTREFERENCES_LISTURL This header field contains a list of Strings. Each String - * represents an ArifactReference that is defined in the TOSCA file of the ArtifactTemplate - * represented by {@link MBHeader#ARTIFACTTEMPLATEID_QNAME}. + * represents an ArifactReference that is defined in the TOSCA file of the ArtifactTemplate represented by {@link + * MBHeader#ARTIFACTTEMPLATEID_QNAME}. */ ARTIFACTREFERENCES_LISTSTRING, /** * ARTIFACTSERVICEENDPOINT_STRING This header field contains the ServiceEndpoint property - * of the ArtifactTemplate represented by {@link MBHeader#ARTIFACTTEMPLATEID_QNAME} if it is - * defined and null otherwise. + * of the ArtifactTemplate represented by {@link MBHeader#ARTIFACTTEMPLATEID_QNAME} if it is defined and null + * otherwise. */ ARTIFACTSERVICEENDPOINT_STRING, /** - * DEPLOYMENT_ARTIFACTS_STRING TODO: What is this header used for? Only referenced once - * where it is added but never extracted from the headers. Used by some IAs which access the - * SOAP headers? + * DEPLOYMENT_ARTIFACTS_STRING + * TODO: What is this header used for? Only referenced once where it is added but never extracted from the headers. + * Used by some IAs which access the SOAP headers? */ DEPLOYMENT_ARTIFACTS_STRING, /** * OPERATIONSTATE_BOOLEAN This header field contains the state of an operation or method - * that is called by passing the camel exchange message to a service or plug-in. It is true if - * the operation was called successful and false otherwise. + * that is called by passing the camel exchange message to a service or plug-in. It is true if the operation was + * called successful and false otherwise. */ OPERATIONSTATE_BOOLEAN, /** * DEPLOYMENTLOCATION_STRING This header field contains the host name of the OpenTOSCA - * Container where the ArtifactTemplate identified by {@link MBHeader#ARTIFACTTEMPLATEID_QNAME} - * has to be deployed. + * Container where the ArtifactTemplate identified by {@link MBHeader#ARTIFACTTEMPLATEID_QNAME} has to be deployed. */ DEPLOYMENTLOCATION_STRING, /** * INVOCATIONTYPE_STRING This header field contains the invocation type of the - * Implementation Artifact identified by {@link MBHeader#IMPLEMENTATIONARTIFACTNAME_STRING}. + * Implementation Artifact identified by {@link MBHeader#IMPLEMENTATION_ARTIFACT_NAME_STRING}. */ INVOCATIONTYPE_STRING, @@ -167,8 +157,7 @@ public enum MBHeader { /** * CORRELATIONID_STRING This header field contains a unique ID to identify to which - * request a response belongs. It is set by the requester and copied to the answer by the - * responding component. + * request a response belongs. It is set by the requester and copied to the answer by the responding component. */ CORRELATIONID_STRING, @@ -186,8 +175,7 @@ public enum MBHeader { /** * REPLYTOTOPIC_STRING This header field is only used for request messages. It contains a - * MQTT topic name which has to be used by receivers of the request as the destination for their - * replies. + * MQTT topic name which has to be used by receivers of the request as the destination for their replies. */ REPLYTOTOPIC_STRING, diff --git a/org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/header/package-info.java b/org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/header/package-info.java new file mode 100644 index 000000000..2410f8762 --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/header/package-info.java @@ -0,0 +1,7 @@ +/** + * This package contains an enum that defines needed headers of the camel exchange message used in all *MB-bundles.

Copyright 2012 IAAS University of Stuttgart

+ * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + */ +package org.opentosca.bus.management.header; diff --git a/org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/utils/MBUtils.java b/org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/utils/MBUtils.java new file mode 100644 index 000000000..3b6108a0b --- /dev/null +++ b/org.opentosca.bus/org.opentosca.bus.management/src/main/java/org/opentosca/bus/management/utils/MBUtils.java @@ -0,0 +1,413 @@ +package org.opentosca.bus.management.utils; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Map; +import java.util.Optional; +import java.util.Queue; +import java.util.Set; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TImplementationArtifact; +import org.eclipse.winery.model.tosca.TInterface; +import org.eclipse.winery.model.tosca.TInterfaces; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TNodeType; +import org.eclipse.winery.model.tosca.TNodeTypeImplementation; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstanceState; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; +import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; +import org.opentosca.container.core.tosca.convention.Interfaces; +import org.opentosca.container.core.tosca.convention.Properties; +import org.opentosca.container.core.tosca.convention.Types; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.traversal.DocumentTraversal; +import org.w3c.dom.traversal.NodeFilter; +import org.w3c.dom.traversal.NodeIterator; + +//FIXME this piece of ... needs to do actual transaction management, because Hibernate actually follows the JPA spec! +@NonNullByDefault +public class MBUtils { + + private static final Logger LOG = LoggerFactory.getLogger(MBUtils.class); + + // repository to access ServiceTemplateInstance data + private static final ServiceTemplateInstanceRepository serviceTemplateInstanceRepository = new ServiceTemplateInstanceRepository(); + private static final NodeTemplateInstanceRepository nodeTemplateInstanceRepository = new NodeTemplateInstanceRepository(); + + /** + * Finds the operating system node template, optionally requiring that it has a NodeInstance associated with a given + * serviceTemplateInstanceId. + * + * @return The OperatingSystem NodeTemplate. + */ + @Nullable + public static TNodeTemplate getOperatingSystemNodeTemplate(final Csar csar, + final TServiceTemplate serviceTemplate, + final TNodeTemplate nodeTemplate, + boolean mustHaveNodeInstance, + Long serviceTemplateInstanceId) { + + // Need to do exhaustive checking of all osNodeTypes for NodeInstance criteria + final Queue osNodeTemplates = new LinkedList<>(); + final Queue nodeTemplateGraph = new LinkedList<>(); + final Set traversedTemplates = new HashSet<>(); + nodeTemplateGraph.add(nodeTemplate); + while (!nodeTemplateGraph.isEmpty()) { + final TNodeTemplate current = nodeTemplateGraph.poll(); + if (!traversedTemplates.add(current)) { + // skip templates we already traversed + continue; + } + final TNodeType currentNodeType = ToscaEngine.resolveNodeType(csar, current); + if (isOperatingSystemNodeType(currentNodeType)) { + // just return the first result if we don't need to check for a node instance + if (!mustHaveNodeInstance) { + return current; + } + osNodeTemplates.add(current); + continue; + } + // nodeType was not an OS node type, therefore traverse the Graph "downwards" + ToscaEngine.getRelatedNodeTemplates(serviceTemplate, current, + Types.hostedOnRelationType, Types.deployedOnRelationType, Types.dependsOnRelationType) + // avoid cycles in the graph + .filter(t -> !traversedTemplates.contains(t)) + .forEach(nodeTemplateGraph::add); + } + // return the first result that has an instance + for (TNodeTemplate osTemplate : osNodeTemplates) { + if (getNodeTemplateInstance(serviceTemplateInstanceId, osTemplate) != null) { + return osTemplate; + } + } + return null; + } + + @Nullable // contaminated by MBUtils#getNodeTemplateInstances + public static NodeTemplateInstance getAbstractOSReplacementInstance(NodeTemplateInstance nodeTemplateInstance) { + final Map propMap = nodeTemplateInstance.getPropertiesAsMap(); + if (propMap == null) { + // return original node template instance + return nodeTemplateInstance; + } + if (!propMap.containsKey(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_INSTANCEREF)) { + // no instance reference stored in the node template instance, so no replacement available + return nodeTemplateInstance; + } + LOG.debug("Found instanceRef Property with value: {}", propMap.get(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_INSTANCEREF)); + /* + * values are sent from fontend delimited by "," in the following format: + * service-template-instance-id,node-template-id + */ + final String[] values = propMap.get(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_INSTANCEREF).split(","); + if (values.length != 2) { + LOG.warn("input format for instanceref was incorrect. Received value {}", values); + // to avoid messing this up + return nodeTemplateInstance; + } + final Long serviceTemplateInstanceId = Long.parseLong(values[0]); + final String nodeTemplateId = values[1]; + + // return the actual replacement + return MBUtils.getNodeTemplateInstance(serviceTemplateInstanceId, nodeTemplateId); + } + + /** + * Checks if the specified NodeType is the OperatingSystem NodeType. + * + * @return true if the specified NodeType is one of the OperatingSystem NodeTypes. Otherwise false. + */ + private static boolean isOperatingSystemNodeType(final TNodeType nodeType) { + TInterfaces exposedInterfaces = nodeType.getInterfaces(); + boolean isOs = exposedInterfaces.getInterface().stream() + .filter(tInterface -> Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM.equals(tInterface.getName())) + .anyMatch(os -> doesInterfaceContainOperation(os, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT) + && doesInterfaceContainOperation(os, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE)); + boolean isDocker = exposedInterfaces.getInterface().stream() + .filter(tInterface -> Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER.equals(tInterface.getName())) + .anyMatch(os -> doesInterfaceContainOperation(os, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_RUNSCRIPT) + && doesInterfaceContainOperation(os, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_TRANSFERFILE)); + return isOs || isDocker; + } + + private static boolean doesInterfaceContainOperation(TNodeType nodeType, String interfaceName, String operationName) { + try { + return doesInterfaceContainOperation(ToscaEngine.resolveInterface(nodeType, interfaceName), operationName); + } catch (NotFoundException e) { + return false; + } + } + + private static boolean doesInterfaceContainOperation(TInterface tInterface, String operationName) { + return tInterface.getOperation().stream().anyMatch(op -> operationName.equals(op.getName())); + } + + /** + * Returns the OS interface of the given OS Node Type + * + * @param nodeType The Node Type to check + * @return a String containing the name of the OS interface, or if the given Node Type is not an OS Node Type null + */ + @Nullable + public static String getInterfaceForOperatingSystemNodeType(final TNodeType nodeType) { + if (doesInterfaceContainOperation(nodeType, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT) + && doesInterfaceContainOperation(nodeType, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE)) { + return Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM; + } else if (doesInterfaceContainOperation(nodeType, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_RUNSCRIPT) + && doesInterfaceContainOperation(nodeType, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_TRANSFERFILE)) { + return Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER; + } + return null; + } + + /** + * Returns the name of the OperatingSystem ImplementationArtifact. + * + * @return name of the OperatingSystem ImplementationArtifact. + */ + @Nullable + public static TImplementationArtifact getOperatingSystemIA(final Csar csar, final TServiceTemplate serviceTemplate, final TNodeType osNodeType) { + LOG.debug("Searching the OperatingSystem-IA of OS-NodeType: {}, ServiceTemplate: {} & CSAR: {} ...", osNodeType, serviceTemplate, csar); + + for (final TNodeTypeImplementation implementation : ToscaEngine.getNodeTypeImplementations(csar, osNodeType)) { + for (final TImplementationArtifact artifact : ToscaEngine.implementationArtifacts(implementation)) { + @Nullable final String interfaceName = artifact.getInterfaceName(); + if (interfaceName != null && + (interfaceName.equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM) + || interfaceName.equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER))) { + return artifact; + } + } + } + return null; + } + + /** + * Traverses the topology and searches for the specified property. If found, the value from the instance data is + * returned. + * + * @param nodeTemplateInstance the NodeTemplateInstance where the search should be started in downwards direction + * @param property the name of the property that is searched + * @return instance data value of searched property if found, null otherwise. + */ + @Nullable + public static String searchProperty(NodeTemplateInstance nodeTemplateInstance, final String property) { + + LOG.debug("Searching the Property: {} in or under the NodeTemplateInstance ID: {} ...", property, nodeTemplateInstance.getId()); + + // check if property is already defined at this NodeTemplateInstance + @Nullable + String propertyValue = getInstanceDataPropertyValue(nodeTemplateInstance, property); + + // search until property is found or no new NodeTemplateInstance is found + boolean moreNodeTemplateInstances = true; + while (propertyValue == null && moreNodeTemplateInstances) { + LOG.debug("Property not found at NodeTemplate: {}", nodeTemplateInstance.getTemplateId()); + moreNodeTemplateInstances = false; + + // perform search in downwards direction in the topology + final Collection outgoingRelations = nodeTemplateInstance.getOutgoingRelations(); + + for (final RelationshipTemplateInstance relation : outgoingRelations) { + final QName relationType = relation.getTemplateType(); + LOG.debug("Found outgoing relation of Type: {}", relationType); + + // only follow relations of kind hostedOn, deployedOn and dependsOn + if (!relationType.equals(Types.hostedOnRelationType) + && !relationType.equals(Types.deployedOnRelationType) + && !relationType.equals(Types.dependsOnRelationType)) { + LOG.debug("RelationshipType is not valid for property search (e.g. hostedOn)."); + continue; + } + + nodeTemplateInstance = relation.getTarget(); + moreNodeTemplateInstances = true; + LOG.debug("Found new NodeTemplate: {}. Continue property search.", nodeTemplateInstance.getTemplateId()); + // check if new NodeTemplateInstance contains property + propertyValue = getInstanceDataPropertyValue(nodeTemplateInstance, property); + break; + } + } + + if (propertyValue != null) { + LOG.debug("Searched property: {} with value: {} found in NodeTemplate: {}.", property, propertyValue, nodeTemplateInstance.getTemplateId()); + } else { + LOG.debug("Searched property: {} not found!", property); + } + + return propertyValue; + } + + /** + * Returns the value of a certain property of a certain NodeTemplateInstance. + * + * @param nodeTemplateInstance the NodeTemplateInstance + * @param property the name of the property + * @return the value of the property if found, null otherwise. + */ + @Nullable + public static String getInstanceDataPropertyValue(final NodeTemplateInstance nodeTemplateInstance, + final String property) { + final Map propertiesMap = nodeTemplateInstance.getPropertiesAsMap(); + + if (propertiesMap != null) { + return propertiesMap.get(property); + } else { + return null; + } + } + + @Nullable + public static NodeTemplateInstance getNodeTemplateInstance(final Long serviceTemplateInstanceId, final TNodeTemplate nodeTemplate) { + return getNodeTemplateInstance(serviceTemplateInstanceId, nodeTemplate.getId()); + } + + /** + * Retrieve the NodeTemplateInstance which is contained in a certain ServiceTemplateInstance and has a certain + * template ID. + * + * @param serviceTemplateInstanceID this ID identifies the ServiceTemplateInstance + * @param nodeTemplateID the template ID to identify the correct instance + * @return the found NodeTemplateInstance or null if no instance was found that matches the parameters + */ + @Nullable + public static NodeTemplateInstance getNodeTemplateInstance(final Long serviceTemplateInstanceID, + final String nodeTemplateID) { + LOG.debug("Trying to retrieve NodeTemplateInstance for ServiceTemplateInstance ID {} and NodeTemplate ID {} ...", + serviceTemplateInstanceID, nodeTemplateID); + + final Optional serviceTemplateInstance = serviceTemplateInstanceRepository.find(serviceTemplateInstanceID); + + if (serviceTemplateInstance.isPresent()) { + return nodeTemplateInstanceRepository.find(serviceTemplateInstance.get(), nodeTemplateID) + .stream().filter(nti -> nti.getState() == NodeTemplateInstanceState.CREATED || nti.getState() == NodeTemplateInstanceState.STARTED) + .findFirst().orElse(null); + } else { + LOG.warn("Unable to find ServiceTemplateInstance!"); + return null; + } + } + + /** + * Get the next NodeTemplateInstance connected with a HostedOn/DeployedOn/... Relation. + * + * @param currentNode the current NodeTemplateInstance + * @return an Optional containing the next NodeTemplateInstance if one is connected with one of the supported + * Relation Types or an empty Optional otherwise + */ + public static Optional getNextNodeTemplateInstance(final NodeTemplateInstance currentNode) { + + Optional nextNode = getConnectedNodeTemplateInstance(currentNode, Types.hostedOnRelationType); + + if (!nextNode.isPresent()) { + nextNode = getConnectedNodeTemplateInstance(currentNode, Types.deployedOnRelationType); + } + + // quick hack to ensure instantiated properties - this should be done somehow in the RelationshipTemplates + if (nextNode.isPresent()) { + return nodeTemplateInstanceRepository.find(nextNode.get().getId()); + } + + return Optional.empty(); + } + + /** + * Get the next NodeTemplateInstance connected with a Relation of the given type. + * + * @param currentNode the current NodeTemplateInstance + * @param relationshipType the type of the Relation as QName + * @return an Optional containing the next NodeTemplateInstance if one is connected with a Relation of the specified + * type or an empty Optional otherwise + */ + private static Optional getConnectedNodeTemplateInstance(final NodeTemplateInstance currentNode, + final QName relationshipType) { + return currentNode.getOutgoingRelations().stream() + .filter(relation -> relation.getTemplateType().equals(relationshipType)).findFirst() + .map(RelationshipTemplateInstance::getTarget); + } + + /** + * Retrieve the RelationshipTemplateInstance which is contained in a certain ServiceTemplateInstance and has a + * certain template ID. + * + * @param serviceTemplateInstanceID this ID identifies the ServiceTemplateInstance + * @param relationshipTemplateName the template ID to identify the correct instance + * @return the found RelationshipTemplateInstance or null if no instance was found that matches the + * parameters + */ + @Nullable + public static RelationshipTemplateInstance getRelationshipTemplateInstance(final Long serviceTemplateInstanceID, + final String relationshipTemplateName) { + LOG.debug("Trying to retrieve RelationshipTemplateInstance for ServiceTemplateInstance ID {} and RelationshipTemplate ID {} ...", + serviceTemplateInstanceID, relationshipTemplateName); + + final Optional serviceTemplateInstance = + serviceTemplateInstanceRepository.find(serviceTemplateInstanceID); + + if (serviceTemplateInstance.isPresent()) { + return serviceTemplateInstance.get().getNodeTemplateInstances().stream() + .flatMap(nodeInstance -> nodeInstance.getOutgoingRelations().stream()) + .filter(relationshipInstance -> relationshipInstance.getTemplateId().equals(relationshipTemplateName)) + .findFirst().orElse(null); + } else { + LOG.warn("Unable to find ServiceTemplateInstance!"); + return null; + } + } + + /** + * Transfers the properties document to a map. + * + * @param propertiesDocument to be transfered to a map. + * @return transfered map. + */ + public static HashMap docToMap(final Document propertiesDocument, final boolean allowEmptyEntries) { + final HashMap reponseMap = new HashMap<>(); + + final DocumentTraversal traversal = (DocumentTraversal) propertiesDocument; + final NodeIterator iterator = + traversal.createNodeIterator(propertiesDocument.getDocumentElement(), NodeFilter.SHOW_ELEMENT, null, true); + + for (Node node = iterator.nextNode(); node != null; node = iterator.nextNode()) { + + final String name = ((Element) node).getLocalName(); + final StringBuilder content = new StringBuilder(); + final NodeList children = node.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + final Node child = children.item(i); + if (child.getNodeType() == Node.TEXT_NODE) { + content.append(child.getTextContent()); + } + } + + if (allowEmptyEntries) { + reponseMap.put(name, content.toString()); + } else { + if (!content.toString().trim().isEmpty()) { + reponseMap.put(name, content.toString()); + } + } + } + + return reponseMap; + } +} diff --git a/org.opentosca.bus/pom.xml b/org.opentosca.bus/pom.xml new file mode 100644 index 000000000..7eb65c824 --- /dev/null +++ b/org.opentosca.bus/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + + org.opentosca + container + 2.0.0-SNAPSHOT + + + org.opentosca.bus + pom + + + org.opentosca.bus.application.api.jsonhttp + org.opentosca.bus.application.api.resthttp + org.opentosca.bus.application.api.soaphttp + org.opentosca.bus.application.model + org.opentosca.bus.application.plugin.jsonhttp.service.impl + org.opentosca.bus.application.plugin.service + org.opentosca.bus.application.service + org.opentosca.bus.management + org.opentosca.bus.management.api.java + org.opentosca.bus.management.api.resthttp + org.opentosca.bus.management.api.soaphttp + org.opentosca.bus.management.deployment.plugin + org.opentosca.bus.management.deployment.plugin.script + org.opentosca.bus.management.deployment.plugin.tomcat + org.opentosca.bus.management.deployment.plugin.remote + org.opentosca.bus.management.invocation.plugin + org.opentosca.bus.management.invocation.plugin.script + org.opentosca.bus.management.invocation.plugin.rest + org.opentosca.bus.management.invocation.plugin.soaphttp + org.opentosca.bus.management.invocation.plugin.remote + org.opentosca.bus.management.service + + diff --git a/org.opentosca.container.api/META-INF/MANIFEST.MF b/org.opentosca.container.api/META-INF/MANIFEST.MF deleted file mode 100644 index 9f7d70d61..000000000 --- a/org.opentosca.container.api/META-INF/MANIFEST.MF +++ /dev/null @@ -1,53 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container API -Bundle-SymbolicName: org.opentosca.container.api -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.container.api.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.eclipsesource.jaxrs.publisher;version="5.3.1", - com.fasterxml.jackson.annotation;version="2.5.0", - com.fasterxml.jackson.core;version="2.5.0", - com.fasterxml.jackson.databind;version="2.5.0", - com.fasterxml.jackson.databind.annotation;version="2.5.0", - com.fasterxml.jackson.databind.module;version="2.5.0", - com.google.common.collect;version="15.0.0", - dk.nykredit.jackson.dataformat.hal, - dk.nykredit.jackson.dataformat.hal.annotation, - io.swagger.annotations;version="1.5.7.SNAPSHOT", - javax.servlet;version="2.4.0", - javax.servlet.annotation;version="3.1.0", - javax.servlet.http;version="2.4.0", - javax.ws.rs;version="2.0.1", - javax.ws.rs.container;version="2.0.1", - javax.ws.rs.core;version="2.0.1", - javax.ws.rs.ext;version="2.0.1", - org.apache.commons.io;version="2.2.0", - org.eclipse.persistence.core.sessions;version="2.6.3", - org.glassfish.jersey.filter;version="2.22.1", - org.glassfish.jersey.jackson;version="2.22.1", - org.glassfish.jersey.media.multipart;version="2.22.1", - org.glassfish.jersey.server;version="2.22.2", - org.glassfish.jersey.server.model;version="2.22.2", - org.glassfish.jersey.uri;version="2.22.2", - org.osgi.framework;version="1.3.0", - org.osgi.service.cm;version="1.5.0", - org.slf4j;version="1.7.10" -Bundle-ActivationPolicy: lazy -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.impl;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.container.control;bundle-version="1.0.0", - org.opentosca.container.connector.bps;bundle-version="1.0.0", - org.opentosca.container.connector.winery;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.integration;bundle-version="1.0.0", - org.opentosca.planbuilder.service;bundle-version="1.0.0", - org.opentosca.container.portability;bundle-version="1.0.0", - org.opentosca.deployment.checks;bundle-version="2.0.0" -Service-Component: OSGI-INF/* -Export-Package: org.opentosca.container.api.controller, - org.opentosca.container.api.dto, - org.opentosca.container.api.dto.request, - org.opentosca.container.api.service, - org.opentosca.container.api.util diff --git a/org.opentosca.container.api/OSGI-INF/BoundaryDefinitionController.xml b/org.opentosca.container.api/OSGI-INF/BoundaryDefinitionController.xml deleted file mode 100644 index 9d691ff17..000000000 --- a/org.opentosca.container.api/OSGI-INF/BoundaryDefinitionController.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.opentosca.container.api/OSGI-INF/CsarController.xml b/org.opentosca.container.api/OSGI-INF/CsarController.xml deleted file mode 100644 index 0f9fba493..000000000 --- a/org.opentosca.container.api/OSGI-INF/CsarController.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/org.opentosca.container.api/OSGI-INF/CsarService.xml b/org.opentosca.container.api/OSGI-INF/CsarService.xml deleted file mode 100644 index cccbdb3c4..000000000 --- a/org.opentosca.container.api/OSGI-INF/CsarService.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - > - diff --git a/org.opentosca.container.api/OSGI-INF/InstanceService.xml b/org.opentosca.container.api/OSGI-INF/InstanceService.xml deleted file mode 100644 index c6eea2cd8..000000000 --- a/org.opentosca.container.api/OSGI-INF/InstanceService.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/org.opentosca.container.api/OSGI-INF/NodeTemplateService.xml b/org.opentosca.container.api/OSGI-INF/NodeTemplateService.xml deleted file mode 100644 index c4d6d5897..000000000 --- a/org.opentosca.container.api/OSGI-INF/NodeTemplateService.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.opentosca.container.api/OSGI-INF/PlanService.xml b/org.opentosca.container.api/OSGI-INF/PlanService.xml deleted file mode 100644 index b58b72cac..000000000 --- a/org.opentosca.container.api/OSGI-INF/PlanService.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.opentosca.container.api/OSGI-INF/RelationshipTemplateService.xml b/org.opentosca.container.api/OSGI-INF/RelationshipTemplateService.xml deleted file mode 100644 index 5b822a568..000000000 --- a/org.opentosca.container.api/OSGI-INF/RelationshipTemplateService.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.opentosca.container.api/OSGI-INF/ServiceTemplateController.xml b/org.opentosca.container.api/OSGI-INF/ServiceTemplateController.xml deleted file mode 100644 index e468b8cec..000000000 --- a/org.opentosca.container.api/OSGI-INF/ServiceTemplateController.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/org.opentosca.container.api/OSGI-INF/ServiceTemplateService.xml b/org.opentosca.container.api/OSGI-INF/ServiceTemplateService.xml deleted file mode 100644 index 8c13694f2..000000000 --- a/org.opentosca.container.api/OSGI-INF/ServiceTemplateService.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.opentosca.container.api/OSGI-INF/SituationsController.xml b/org.opentosca.container.api/OSGI-INF/SituationsController.xml deleted file mode 100644 index ae8968dd8..000000000 --- a/org.opentosca.container.api/OSGI-INF/SituationsController.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.opentosca.container.api/build.properties b/org.opentosca.container.api/build.properties deleted file mode 100644 index 24c3042d7..000000000 --- a/org.opentosca.container.api/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = .,\ - OSGI-INF/,\ - META-INF/ diff --git a/org.opentosca.container.api/pom.xml b/org.opentosca.container.api/pom.xml index eeb68b3cb..7a362f103 100644 --- a/org.opentosca.container.api/pom.xml +++ b/org.opentosca.container.api/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 @@ -10,6 +10,144 @@ org.opentosca.container.api - eclipse-plugin + + 3.1.4.Final + 4.3.18.RELEASE + + + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.container.control + ${project.version} + + + org.opentosca + org.opentosca.container.connector.winery + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.integration + ${project.version} + + + org.opentosca + org.opentosca.deployment.checks + ${project.version} + + + org.opentosca + org.opentosca.container.engine.plan + ${project.version} + + + + com.github.opentosca.winery + org.eclipse.winery.repository + + + com.github.opentosca.winery + org.eclipse.winery.model.selfservice + + + com.github.opentosca.winery + org.eclipse.winery.model.tosca + + + + commons-io + commons-io + ${commons-io.version} + + + com.google.collections + google-collections + 1.0 + + + + dk.nykredit.jackson.dataformat + jackson-dataformat-hal + 1.0.1 + + + io.swagger + swagger-annotations + ${swagger.version} + + + + + com.h2database + h2 + 1.4.199 + + + + org.hibernate + hibernate-core + 5.4.1.Final + provided + + + + + + + + + + org.springframework + spring-aop + ${spring.version} + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-context-support + ${spring.version} + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey.version} + + diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/config/CorsFilter.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/CorsFilter.java similarity index 96% rename from org.opentosca.container.api/src/org/opentosca/container/api/config/CorsFilter.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/CorsFilter.java index 0f0fe6389..4053457e0 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/config/CorsFilter.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/CorsFilter.java @@ -22,13 +22,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; @Provider +@Component public class CorsFilter implements ContainerResponseFilter { private static final Logger logger = LoggerFactory.getLogger(CorsFilter.class.getName()); - @Override public void filter(final ContainerRequestContext request, final ContainerResponseContext response) throws IOException { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/config/JAXBContextProvider.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/JAXBContextProvider.java similarity index 95% rename from org.opentosca.container.api/src/org/opentosca/container/api/config/JAXBContextProvider.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/JAXBContextProvider.java index e6b9b79db..1ee8d5429 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/config/JAXBContextProvider.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/JAXBContextProvider.java @@ -19,7 +19,6 @@ public class JAXBContextProvider implements ContextResolver { private final Map, JAXBContext> contextMap = Collections.synchronizedMap(new HashMap<>()); - @Override public JAXBContext getContext(final Class type) { @@ -30,8 +29,7 @@ public JAXBContext getContext(final Class type) { logger.debug("Creating JAXBContext for type \"{}\"", type.getName()); context = JAXBContext.newInstance(type); this.contextMap.put(type, context); - } - catch (final JAXBException e) { + } catch (final JAXBException e) { logger.error("Error creating JAXBContext: {}", e.getMessage(), e); } } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/config/LogFilter.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/LogFilter.java similarity index 93% rename from org.opentosca.container.api/src/org/opentosca/container/api/config/LogFilter.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/LogFilter.java index a3f4e3267..2c7986db7 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/config/LogFilter.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/LogFilter.java @@ -21,13 +21,12 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.ext.Provider; +import com.google.common.collect.Lists; import org.apache.commons.io.IOUtils; -import org.opentosca.container.api.util.UriUtil; +import org.opentosca.container.core.common.uri.UriUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.Lists; - @Provider public class LogFilter implements ContainerRequestFilter { @@ -44,7 +43,7 @@ public void filter(final ContainerRequestContext request) throws IOException { } final List mediaTypes = Lists.newArrayList(MediaType.APPLICATION_JSON_TYPE, MediaType.APPLICATION_XML_TYPE, - MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_XML_TYPE, MediaType.TEXT_HTML_TYPE); + MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_XML_TYPE, MediaType.TEXT_HTML_TYPE); if (request.getMediaType() != null && mediaTypes.contains(request.getMediaType())) { if (request.hasEntity()) { final String body = IOUtils.toString(request.getEntityStream()); diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/LoggingExceptionMapper.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/LoggingExceptionMapper.java new file mode 100644 index 000000000..79d9eadd6 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/LoggingExceptionMapper.java @@ -0,0 +1,29 @@ +package org.opentosca.container.api.config; + +import javax.ws.rs.NotAcceptableException; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.ext.ExceptionMapper; +import javax.ws.rs.ext.Provider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Provider +public class LoggingExceptionMapper implements ExceptionMapper { + + private static final Logger logger = LoggerFactory.getLogger(LoggingExceptionMapper.class); + + @Override + public Response toResponse(Throwable exception) { + logger.error("An exception was not handled: " + exception.toString()); + if (exception instanceof NotFoundException) { + return Response.status(Status.NOT_FOUND).build(); + } else if (exception instanceof NotAcceptableException) { + return Response.status(Status.NOT_ACCEPTABLE).build(); + } + + return Response.serverError().entity(exception).build(); + } +} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/config/ObjectMapperProvider.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/ObjectMapperProvider.java similarity index 80% rename from org.opentosca.container.api/src/org/opentosca/container/api/config/ObjectMapperProvider.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/ObjectMapperProvider.java index 791566bec..935f9efff 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/config/ObjectMapperProvider.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/ObjectMapperProvider.java @@ -19,32 +19,31 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.PropertyNamingStrategy; - import dk.nykredit.jackson.dataformat.hal.HALMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @Provider public class ObjectMapperProvider implements ContextResolver { - private ObjectMapper objectMapper; + private static final Logger LOG = LoggerFactory.getLogger(ObjectMapperProvider.class); + private ObjectMapper objectMapper; @Override public ObjectMapper getContext(final Class type) { if (this.objectMapper == null) { this.objectMapper = createDefaultMapper(); } + LOG.trace("Retrieving Jackson Object Mapper"); return this.objectMapper; } - public static ObjectMapper createSimpleMapper() { + private static ObjectMapper createDefaultMapper() { final ObjectMapper om = new HALMapper(); om.setSerializationInclusion(JsonInclude.Include.NON_NULL); - return om; - } - - public static ObjectMapper createDefaultMapper() { - final ObjectMapper om = createSimpleMapper(); - om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES); + om.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); + LOG.info("Created Jackson ObjectMapper"); return om; } } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/config/PlainTextMessageBodyWriter.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/PlainTextMessageBodyWriter.java similarity index 100% rename from org.opentosca.container.api/src/org/opentosca/container/api/config/PlainTextMessageBodyWriter.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/PlainTextMessageBodyWriter.java diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/config/URI2XMLMessageBodyWriter.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/URI2XMLMessageBodyWriter.java similarity index 100% rename from org.opentosca.container.api/src/org/opentosca/container/api/config/URI2XMLMessageBodyWriter.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/config/URI2XMLMessageBodyWriter.java diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/BoundaryDefinitionController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/BoundaryDefinitionController.java new file mode 100644 index 000000000..1bec72378 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/BoundaryDefinitionController.java @@ -0,0 +1,271 @@ +package org.opentosca.container.api.controller; + +import java.net.URI; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Request; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import org.eclipse.winery.model.tosca.TBoundaryDefinitions; +import org.eclipse.winery.model.tosca.TEntityTemplate; +import org.eclipse.winery.model.tosca.TExportedInterface; +import org.eclipse.winery.model.tosca.TExportedOperation; +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPropertyMapping; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.NodeOperationDTO; +import org.opentosca.container.api.dto.ResourceSupport; +import org.opentosca.container.api.dto.boundarydefinitions.InterfaceDTO; +import org.opentosca.container.api.dto.boundarydefinitions.InterfaceListDTO; +import org.opentosca.container.api.dto.boundarydefinitions.OperationDTO; +import org.opentosca.container.api.dto.boundarydefinitions.PropertiesDTO; +import org.opentosca.container.api.dto.boundarydefinitions.PropertyMappingDTO; +import org.opentosca.container.api.dto.plan.PlanDTO; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +@Api +@Path("/csars/{csar}/servicetemplates/{servicetemplate}/boundarydefinitions") +@Component +public class BoundaryDefinitionController { + + private final Logger logger = LoggerFactory.getLogger(BoundaryDefinitionController.class); + private final CsarStorageService storage; + private final ServiceTemplateInstanceRepository serviceTemplateInstanceRepository = new ServiceTemplateInstanceRepository(); + @Context + private UriInfo uriInfo; + @Context + private Request request; + + @Inject + public BoundaryDefinitionController(CsarStorageService storage) { + this.storage = storage; + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response getBoundaryDefinitions(@PathParam("csar") final String csarId, + @PathParam("servicetemplate") final String servicetemplate) { + logger.debug("Invoking getBoundaryDefinitions"); + + final Csar csar = this.storage.findById(new CsarId(csarId)); + final TServiceTemplate serviceTemplate; + try { + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, servicetemplate); + } catch (org.opentosca.container.core.common.NotFoundException e) { + throw new NotFoundException(e); + } + + final ResourceSupport links = new ResourceSupport(); + links.add(UriUtil.generateSubResourceLink(this.uriInfo, "properties", false, "properties")); + links.add(UriUtil.generateSubResourceLink(this.uriInfo, "interfaces", false, "interfaces")); + + // TODO This resource seems to be unused and not implemented + // links.add(Link.fromUri(UriUtils.encode(this.uriInfo.getAbsolutePathBuilder().path("propertyconstraints").build())).rel("propertyconstraints").build()); + // TODO This resource seems to be unused and not implemented + // links.add(Link.fromUri(UriUtils.encode(this.uriInfo.getAbsolutePathBuilder().path("requirements").build())).rel("requirements").build()); + // TODO This resource seems to be unused and not implemented + // links.add(Link.fromUri(UriUtils.encode(this.uriInfo.getAbsolutePathBuilder().path("capabilities").build())).rel("capabilities").build()); + // TODO: This resource seems to be unused and not implemented + // links.add(Link.fromUri(UriUtils.encode(this.uriInfo.getAbsolutePathBuilder().path("policies").build())).rel("policies").build()); + links.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("self").build()); + + return Response.ok(links).build(); + } + + @GET + @Path("/properties") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get properties of a service tempate", response = PropertiesDTO.class) + public Response getBoundaryDefinitionProperties(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String servicetemplate) { + logger.debug("Invoking getBoundaryDefinitionProperties"); + final Csar csar = this.storage.findById(new CsarId(csarId)); + final TServiceTemplate serviceTemplate; + try { + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, servicetemplate); + } catch (org.opentosca.container.core.common.NotFoundException e) { + throw new NotFoundException(e); + } + + if (Objects.isNull(serviceTemplate)) { + return Response.status(Response.Status.NOT_FOUND).entity("ServiceTemplate not found!").build(); + } + + TBoundaryDefinitions boundary = serviceTemplate.getBoundaryDefinitions(); + if (Objects.isNull(boundary)) { + return Response.status(Response.Status.NOT_FOUND).entity("BoundaryDefinitions not found!").build(); + } + + List propertyMappings = + Optional.of(boundary) + .map(TBoundaryDefinitions::getProperties).map(TBoundaryDefinitions.Properties::getPropertyMappings) + .map(TBoundaryDefinitions.Properties.PropertyMappings::getPropertyMapping) + .orElse(Collections.emptyList()); + logger.debug("Found <{}> property mappings", propertyMappings.size()); + + final List propertyMappingDTOs = propertyMappings.stream().map(mapping -> { + + final PropertyMappingDTO result = new PropertyMappingDTO(); + result.setServiceTemplatePropertyRef(mapping.getServiceTemplatePropertyRef()); + result.setTargetPropertyRef(mapping.getTargetPropertyRef()); + + if (!(mapping.getTargetObjectRef() instanceof TEntityTemplate)) { + logger.error("Unexpected mapping target detected for the property (" + + mapping.getServiceTemplatePropertyRef() + ")"); + } else { + result.setTargetObjectRef(((TEntityTemplate) mapping.getTargetObjectRef()).getId()); + } + + return result; + }).collect(Collectors.toList()); + + final PropertiesDTO dto = new PropertiesDTO(); + if (Objects.nonNull(boundary.getProperties())) { + dto.setXmlFragment(boundary.getProperties().getAny()); + if (!propertyMappingDTOs.isEmpty()) { + dto.setPropertyMappings(propertyMappingDTOs); + } + } + dto.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("self").build()); + return Response.ok(dto).build(); + } + + @GET + @Path("/interfaces") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get interfaces of a service tempate", response = InterfaceListDTO.class) + public Response getBoundaryDefinitionInterfaces(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String servicetemplate) { + logger.debug("Invoking getBoundaryDefinitionInterfaces"); + final Csar csar = this.storage.findById(new CsarId(csarId)); + final TServiceTemplate serviceTemplate; + try { + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, servicetemplate); + } catch (org.opentosca.container.core.common.NotFoundException e) { + throw new NotFoundException(e); + } + + // we're hacking ourselves an elvis operator here, allowing us to condense nullchecks + @SuppressWarnings("null") final List interfaces = + Optional.ofNullable(serviceTemplate).map(TServiceTemplate::getBoundaryDefinitions) + .map(TBoundaryDefinitions::getInterfaces).map(TBoundaryDefinitions.Interfaces::getInterface) + .orElse(Collections.emptyList()); + this.logger.debug("Found <{}> interface(s) in Service Template \"{}\" of CSAR \"{}\" ", interfaces.size(), + servicetemplate, csar.id().csarName()); + + final InterfaceListDTO list = new InterfaceListDTO(); + list.add(interfaces.stream().map(iface -> { + final InterfaceDTO dto = new InterfaceDTO(); + dto.setName(iface.getName()); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, iface.getName(), false, "self")); + return dto; + }).collect(Collectors.toList()).toArray(new InterfaceDTO[] {})); + list.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(list).build(); + } + + @GET + @Path("/interfaces/{name}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get an interface of a service template", response = InterfaceDTO.class) + public Response getBoundaryDefinitionInterface(@ApiParam("interface name") @PathParam("name") final String name, + @ApiParam("ID of CSAR") @PathParam("csar") final String csarId, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String servicetemplate) { + logger.debug("Invoking getBoundaryDefinitionInterface"); + final Csar csar = this.storage.findById(new CsarId(csarId)); + final TServiceTemplate serviceTemplate; + try { + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, servicetemplate); + } catch (org.opentosca.container.core.common.NotFoundException e) { + throw new NotFoundException(e); + } + + @SuppressWarnings("null") final List operations = + Optional.ofNullable(serviceTemplate).map(TServiceTemplate::getBoundaryDefinitions) + .map(TBoundaryDefinitions::getInterfaces).map(TBoundaryDefinitions.Interfaces::getInterface) + .map(List::stream).orElse(Collections.emptyList().stream()) + .filter(iface -> iface.getIdFromIdOrNameField().equals(name)).findFirst() + .map(iface -> iface.getOperation()).orElse(Collections.emptyList()); + + logger.debug("Found <{}> operation(s) for Interface \"{}\" in Service Template \"{}\" of CSAR \"{}\" ", + operations.size(), name, servicetemplate, csar.id().csarName()); + + Collection serviceInstances = serviceTemplateInstanceRepository.findByTemplateId(servicetemplate); + + final Map ops = operations.stream().map(o -> { + final OperationDTO op = new OperationDTO(); + + op.setName(o.getName()); + op.setNodeOperation(NodeOperationDTO.Converter.convert(o.getNodeOperation())); + op.setRelationshipOperation(o.getRelationshipOperation()); + + if (o.getPlan() != null) { + final PlanDTO plan = new PlanDTO((TPlan) o.getPlan().getPlanRef()); + op.setPlan(plan); + + // Compute the according URL for the Build or Management Plan + URI planUrl; + if (PlanType.BUILD.toString().equals(plan.getPlanType())) { + // If it's a build plan + planUrl = + this.uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/buildplans/{buildplan}") + .build(csar.id().csarName(), servicetemplate, plan.getId()); + + plan.add(Link.fromUri(UriUtil.encode(planUrl)).rel("self").build()); + op.add(Link.fromUri(UriUtil.encode(planUrl)).rel("plan").build()); + } else { + // ... else we assume it's a management plan + for (ServiceTemplateInstance serviceInstance : serviceInstances) { + planUrl = + this.uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{serviceinstance}/managementplans/{managementplan}") + .build(csar.id().csarName(), servicetemplate, serviceInstance.getId(), plan.getId()); + op.add(Link.fromUri(UriUtil.encode(planUrl)).rel("plan").build()); + plan.add(Link.fromUri(UriUtil.encode(planUrl)).rel("self").build()); + } + } + } + return op; + }).collect(Collectors.toMap(OperationDTO::getName, t -> t)); + + final InterfaceDTO dto = new InterfaceDTO(); + dto.setName(name); + dto.setOperations(ops); + dto.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(dto).build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/BuildPlanController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/BuildPlanController.java new file mode 100644 index 000000000..301bd1560 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/BuildPlanController.java @@ -0,0 +1,238 @@ +package org.opentosca.container.api.controller; + +import java.net.URI; +import java.util.List; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.UriInfo; + +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.plan.PlanDTO; +import org.opentosca.container.api.dto.plan.PlanInstanceDTO; +import org.opentosca.container.api.dto.plan.PlanInstanceEventDTO; +import org.opentosca.container.api.dto.plan.PlanInstanceEventListDTO; +import org.opentosca.container.api.dto.plan.PlanInstanceListDTO; +import org.opentosca.container.api.dto.plan.PlanListDTO; +import org.opentosca.container.api.dto.request.CreatePlanInstanceLogEntryRequest; +import org.opentosca.container.api.service.PlanService; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanInstanceEvent; +import org.opentosca.container.core.next.model.PlanInstanceState; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.tosca.extension.TParameter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Api +// not marked as @RestController because lifecycle is controlled by parent resource +//@RestController +public class BuildPlanController { + + private static final Logger LOGGER = LoggerFactory.getLogger(BuildPlanController.class); + + private static final PlanType PLAN_TYPE = PlanType.BUILD; + private static final PlanType[] ALL_PLAN_TYPES = PlanType.values(); + + private final PlanService planService; + private final Csar csar; + private final TServiceTemplate serviceTemplate; + + public BuildPlanController(final Csar csar, final TServiceTemplate serviceTemplate, final PlanService planService) { + this.planService = planService; + this.csar = csar; + this.serviceTemplate = serviceTemplate; + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get build plans of service template", response = PlanListDTO.class) + public Response getBuildPlans(@Context final UriInfo uriInfo) { + LOGGER.debug("Invoking getBuildPlans"); + PlanListDTO list = new PlanListDTO(); + csar.plans().stream() + .filter(tplan -> tplan.getPlanType().equals(PLAN_TYPE.toString())) + .map(p -> { + final PlanDTO plan = new PlanDTO(p); + + plan.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(plan.getId()).path("instances") + .build())) + .rel("instances").build()); + plan.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(plan.getId()).build())) + .rel("self").build()); + return plan; + }) + .forEach(list::add); + + list.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePath())).rel("self").build()); + return Response.ok(list).build(); + } + + @GET + @Path("/{plan}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a build plan", response = PlanDTO.class) + public Response getBuildPlan(@ApiParam("ID of build plan") @PathParam("plan") final String plan, + @Context final UriInfo uriInfo) { + PlanDTO dto = planService.getPlanDto(csar, ALL_PLAN_TYPES, plan); + + dto.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path("instances").build())) + .rel("instances").build()); + dto.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePath())).rel("self").build()); + return Response.ok(dto).build(); + } + + @GET + @Path("/{plan}/instances") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get build plan instances", response = PlanInstanceListDTO.class) + public Response getBuildPlanInstances(@ApiParam("ID of build plan") @PathParam("plan") final String plan, + @Context final UriInfo uriInfo) { + LOGGER.debug("Invoking getBuildPlanInstances"); + List planInstances = planService.getPlanInstances(csar, PLAN_TYPE); + + final PlanInstanceListDTO list = new PlanInstanceListDTO(); + planInstances.stream() + .map(pi -> { + PlanInstanceDTO dto = PlanInstanceDTO.Converter.convert(pi); + if (pi.getServiceTemplateInstance() != null) { + final URI uri = uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{instance}") + .build(csar.id().csarName(), serviceTemplate.getId(), pi.getServiceTemplateInstance().getId()); + dto.add(Link.fromUri(UriUtil.encode(uri)).rel("service_template_instance").build()); + } + dto.add(UriUtil.generateSubResourceLink(uriInfo, pi.getCorrelationId(), false, "self")); + return dto; + }) + .forEach(list::add); + list.add(UriUtil.generateSelfLink(uriInfo)); + + return Response.ok(list).build(); + } + + @POST + @Path("/{plan}/instances") + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) + @ApiOperation(value = "Invokes a build plan", response = String.class) + public Response invokeBuildPlan(@ApiParam("ID of build plan") @PathParam("plan") final String plan, + @Context final UriInfo uriInfo, + @ApiParam(required = true, + value = "plan input parameters") final List parameters) { + LOGGER.debug("Invoking invokeBuildPlan"); + // We pass -1L because "PlanInvocationEngine.invokePlan()" expects it for build plans + String correlationId = planService.invokePlan(csar, serviceTemplate, -1L, plan, parameters, PLAN_TYPE); + return Response.ok(correlationId).build(); + } + + @GET + @Path("/{plan}/instances/{instance}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a build plan instance", response = PlanInstanceDTO.class) + public Response getBuildPlanInstance(@ApiParam("ID of build plan") @PathParam("plan") final String plan, + @ApiParam("correlation ID") @PathParam("instance") final String instance, + @Context final UriInfo uriInfo) { + LOGGER.debug("Invoking getBuildPlanInstance"); + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, PLAN_TYPE); + + final PlanInstanceDTO dto = PlanInstanceDTO.Converter.convert(pi); + // Add service template instance link + if (pi.getServiceTemplateInstance() != null) { + final URI uri = uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{instance}") + .build(csar.id().csarName(), serviceTemplate.getId(), + String.valueOf(pi.getServiceTemplateInstance().getId())); + dto.add(Link.fromUri(UriUtil.encode(uri)).rel("service_template_instance").build()); + } + + dto.add(UriUtil.generateSubResourceLink(uriInfo, "state", false, "state")); + dto.add(UriUtil.generateSubResourceLink(uriInfo, "logs", false, "logs")); + + // Add self link + dto.add(UriUtil.generateSelfLink(uriInfo)); + + return Response.ok(dto).build(); + } + + @GET + @Path("/{plan}/instances/{instance}/state") + @Produces( {MediaType.TEXT_PLAIN}) + @ApiOperation(value = "Get the state of a build plan instance", response = String.class) + public Response getBuildPlanInstanceState(@ApiParam("ID of build plan") @PathParam("plan") final String plan, + @ApiParam("correlation ID") @PathParam("instance") final String instance, + @Context final UriInfo uriInfo) { + LOGGER.debug("Invoking getBuildPlanInstanceState"); + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, PLAN_TYPE); + return Response.ok(pi.getState().toString()).build(); + } + + @PUT + @Path("/{plan}/instances/{instance}/state") + @Consumes( {MediaType.TEXT_PLAIN}) + @ApiOperation(hidden = true, value = "") + public Response changeBuildPlanInstanceState(@PathParam("plan") final String plan, + @PathParam("instance") final String instance, + @Context final UriInfo uriInfo, final String request) { + LOGGER.debug("Invoking changeBuildPlanInstanceState"); + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, PLAN_TYPE); + return planService.updatePlanInstanceState(pi, PlanInstanceState.valueOf(request)) + ? Response.ok().build() + : Response.status(Status.BAD_REQUEST).build(); + } + + @GET + @Path("/{plan}/instances/{instance}/logs") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get log entries for a build plan instance", response = PlanInstanceEventDTO.class, + responseContainer = "list") + public Response getBuildPlanInstanceLogs(@ApiParam("ID of build plan") @PathParam("plan") final String plan, + @ApiParam("Correlation ID") @PathParam("instance") final String instance, + @Context final UriInfo uriInfo) { + LOGGER.debug("Invoking getBuildPlanInstanceLogs"); + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, PLAN_TYPE); + + final PlanInstanceDTO piDto = PlanInstanceDTO.Converter.convert(pi); + final PlanInstanceEventListDTO dto = new PlanInstanceEventListDTO(piDto.getLogs()); + dto.add(UriUtil.generateSelfLink(uriInfo)); + + return Response.ok(dto).build(); + } + + @POST + @Path("/{plan}/instances/{instance}/logs") + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response addBuildPlanLogEntry(@PathParam("plan") final String plan, + @PathParam("instance") final String instance, @Context final UriInfo uriInfo, + final CreatePlanInstanceLogEntryRequest logEntry) { + LOGGER.debug("Invoking addBuildPlanLogEntry"); + final String entry = logEntry.getLogEntry(); + if (entry == null || entry.length() <= 0) { + LOGGER.info("Log entry is empty!"); + return Response.status(Status.BAD_REQUEST).build(); + } + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, PLAN_TYPE); + final PlanInstanceEvent event = new PlanInstanceEvent("INFO", "PLAN_LOG", entry); + planService.addLogToPlanInstance(pi, event); + + final URI resourceUri = uriInfo.getAbsolutePath(); + return Response.ok(resourceUri).build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/CsarController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/CsarController.java new file mode 100644 index 000000000..7ebb6667e --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/CsarController.java @@ -0,0 +1,400 @@ +package org.opentosca.container.api.controller; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Path; +import java.text.MessageFormat; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Objects; + +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.ServerErrorException; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.UriInfo; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.selfservice.Application; +import org.eclipse.winery.model.tosca.TServiceTemplate; +import org.eclipse.winery.repository.backend.filebased.FileUtils; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; +import org.opentosca.container.api.controller.content.DirectoryController; +import org.opentosca.container.api.dto.CsarDTO; +import org.opentosca.container.api.dto.CsarListDTO; +import org.opentosca.container.api.dto.request.CsarTransformRequest; +import org.opentosca.container.api.dto.request.CsarUploadRequest; +import org.opentosca.container.api.service.CsarService; +import org.opentosca.container.api.util.ModelUtil; +import org.opentosca.container.connector.winery.WineryConnector; +import org.opentosca.container.control.OpenToscaControlService; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.csar.backwards.FileSystemDirectory; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +@Api +@javax.ws.rs.Path("/csars") +@Component +public class CsarController { + + private static Logger logger = LoggerFactory.getLogger(CsarController.class); + + @Context + private UriInfo uriInfo; + + @Inject + private CsarService csarService; + + @Inject + private CsarStorageService storage; + + @Inject + private OpenToscaControlService controlService; + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get all CSARs", response = CsarListDTO.class) + public Response getCsars() { + logger.debug("Invoking getCsars"); + try { + final CsarListDTO list = new CsarListDTO(); + for (final Csar csarContent : this.storage.findAll()) { + final String id = csarContent.id().csarName(); + final CsarDTO csar = new CsarDTO(); + csar.setId(id); + csar.setDescription(csarContent.description()); + csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(CsarController.class) + .path(CsarController.class, "getCsar").build(id)) + .rel("self").build()); + list.add(csar); + } + list.add(Link.fromResource(CsarController.class).rel("self").baseUri(this.uriInfo.getBaseUri()).build()); + return Response.ok(list).build(); + } catch (Exception e) { + logger.warn("Exception when fetching all CSARs:", e); + throw new ServerErrorException(Response.serverError().build()); + } + } + + @GET + @javax.ws.rs.Path("/{csar}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a CSAR", response = CsarDTO.class) + public Response getCsar(@ApiParam("ID of CSAR") @PathParam("csar") final String id) { + logger.debug("Invoking getCsar"); + try { + final Csar csarContent = storage.findById(new CsarId(id)); + final Application metadata = csarContent.selfserviceMetadata(); + + final CsarDTO csar = CsarDTO.Converter.convert(metadata); + // Absolute URLs for icon and image + final String urlTemplate = "{0}csars/{1}/content/servicetemplates/{2}/{3}/SELFSERVICE-Metadata/{4}"; + + TServiceTemplate entryServiceTemplate = csarContent.entryServiceTemplate(); + // double encoding, otherwise the link breaks + final String namespaceSegment = UriUtil.encodePathSegment(UriUtil.encodePathSegment(entryServiceTemplate.getTargetNamespace())); + final String nameSegment = UriUtil.encodePathSegment(UriUtil.encodePathSegment(entryServiceTemplate.getName())); + final String baseUri = this.uriInfo.getBaseUri().toString(); + if (csar.getIconUrl() != null) { + final String iconUrl = + MessageFormat.format(urlTemplate, baseUri, id, namespaceSegment, nameSegment, csar.getIconUrl()); + csar.setIconUrl(iconUrl); + } + if (csar.getImageUrl() != null) { + final String imageUrl = + MessageFormat.format(urlTemplate, baseUri, id, namespaceSegment, nameSegment, csar.getImageUrl()); + csar.setImageUrl(imageUrl); + } + + csar.setId(id); + if (csar.getName() == null) { + csar.setName(id); + } + csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(ServiceTemplateController.class).build(id)) + .rel("servicetemplates") + .baseUri(this.uriInfo.getBaseUri()).build() + ); + + csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(CsarController.class) + .path(CsarController.class, "getContent").build(id)) + .rel("content").baseUri(this.uriInfo.getBaseUri()).build(id)); + csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(CsarController.class) + .path(CsarController.class, "getCsar").build(id)) + .rel("self").build()); + + csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(ServiceTemplateController.class) + .path(ServiceTemplateController.class, "getServiceTemplate") + .build(id, UriUtil.encodePathSegment(entryServiceTemplate.getId()))) + .rel("servicetemplate").baseUri(this.uriInfo.getBaseUri()).build()); + + return Response.ok(csar).build(); + } catch (NoSuchElementException e) { + return Response.status(Status.NOT_FOUND).build(); + } + } + + @javax.ws.rs.Path("/{csar}/content") + @ApiOperation(hidden = true, value = "") + public DirectoryController getContent(@PathParam("csar") final String id) { + logger.debug("Invoking getContent"); + try { + return new DirectoryController(new FileSystemDirectory(storage.findById(new CsarId(id)).getSaveLocation())); + } catch (NoSuchElementException e) { + throw new javax.ws.rs.NotFoundException(e); + } + } + + @POST + @Consumes(MediaType.MULTIPART_FORM_DATA) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response uploadCsar(@FormDataParam("enrichment") final String applyEnrichment, + @FormDataParam("file") final InputStream is, + @FormDataParam("file") final FormDataContentDisposition file) { + logger.debug("Invoking uploadCsar"); + if (is == null || file == null) { + return Response.status(Status.BAD_REQUEST).build(); + } + logger.info("Uploading new CSAR file \"{}\", size {}", file.getFileName(), file.getSize()); + return handleCsarUpload(file.getFileName(), is, applyEnrichment); + } + + private String extractFileName(MultivaluedMap headers) { + String[] contentDispostion = headers.getFirst("Content-Disposition").split("\\s*;\\s*"); + for (String kvPair : contentDispostion) { + if (kvPair.startsWith("filename")) { + String[] name = kvPair.split("="); + String quoted = name[1].trim(); + // drops the surrounding quotes + return quoted.substring(1, quoted.length() - 1); + } + } + return null; + } + + @POST + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Handles an upload request for a CSAR file") + public Response uploadCsar(@ApiParam(required = true) final CsarUploadRequest request) { + logger.debug("Invoking uploadCsar"); + if (request == null) { + return Response.status(Status.BAD_REQUEST).build(); + } + + logger.info("Uploading new CSAR based on request payload: name={}; url={}; applyEnrichment={}", request.getName(), + request.getUrl(), request.getEnrich()); + + String filename = request.getName(); + if (!filename.endsWith(".csar")) { + filename = filename + ".csar"; + } + + try { + final URL url = new URL(request.getUrl()); + + return handleCsarUpload(filename, url.openStream(), request.getEnrich()); + } catch (final Exception e) { + logger.error("Error uploading CSAR: {}", e.getMessage(), e); + return Response.serverError().build(); + } + } + + private Response handleCsarUpload(final String filename, final InputStream is, final String applyEnrichment) { + + Path tempFile = storage.storeCSARTemporarily(filename, is); + if (tempFile == null) { + // writing to temporary file failed + return Response.serverError().build(); + } + WineryConnector wc = new WineryConnector(); + doApplyEnrichment(wc, tempFile, applyEnrichment); + + CsarId csarId = null; + try { + csarId = storage.storeCSAR(tempFile); + } catch (UserException e) { + FileUtils.forceDelete(tempFile); + return Response.status(Status.CONFLICT).entity(e).build(); + } catch (SystemException e) { + FileUtils.forceDelete(tempFile); + return Response.serverError().entity(e).build(); + } + + Csar storedCsar = storage.findById(csarId); + try { + if (!this.csarService.generatePlans(storedCsar)) { + logger.info("Planning the CSAR failed. Deleting the failed import"); + this.storage.deleteCSAR(csarId); + return Response.serverError().build(); + } + } catch (Exception e) { + logger.warn("Planning the CSAR [{}] failed with an exception", csarId.csarName(), e); + try { + this.storage.deleteCSAR(csarId); + } catch (Exception log) { + logger.warn("Failed to delete CSAR [{}] with failed plans on import", csarId.csarName()); + } + return Response.serverError().build(); + } + + // FIXME maybe this only makes sense when we have generated plans :/ + this.controlService.declareStored(csarId); + + final List serviceTemplates = storedCsar.serviceTemplates(); + for (final TServiceTemplate serviceTemplate : serviceTemplates) { + logger.trace("Invoke plan deployment for service template \"{}\" of CSAR \"{}\"", serviceTemplate.getName(), csarId.csarName()); + if (!this.controlService.invokePlanDeployment(csarId, serviceTemplate)) { + logger.info("Error deploying plan for service template \"{}\" of CSAR \"{}\"", serviceTemplate.getName(), csarId.csarName()); + // do a rollback + try { + storage.deleteCSAR(csarId); + } catch (Exception log) { + logger.warn("Failed to delete CSAR [{}] with failed plan deployment on import", csarId.csarName(), log); + } + return Response.serverError().build(); + } + } + + // TODO this is such a brutal hack, won't go through reviews.... + final boolean repoAvailable = wc.isWineryRepositoryAvailable(); + final StringBuilder strB = new StringBuilder(); + // quick and dirty parallel thread to upload the csar to the container repository + // This is needed for the state save feature + Thread parallelUploadThread = new Thread(() -> { + try { + if (wc.isWineryRepositoryAvailable()) { + strB.append(wc.uploadCSAR(tempFile.toFile(), false)); + logger.info("Successfully uploaded csar to connected winery repository"); + } + } catch (final IOException | URISyntaxException e) { + logger.warn("Failed to upload csar to winery with exception", e); + } finally { + FileUtils.forceDelete(tempFile); + } + }, "winery-repository-upload-" + csarId.csarName()); + + if (repoAvailable) { + parallelUploadThread.start(); + } else { + // deleting temp file because winery connector does not use it + FileUtils.forceDelete(tempFile); + } + + if (ModelUtil.hasOpenRequirements(storedCsar)) { + if (repoAvailable) { + try { + // wait till the upload is finished + parallelUploadThread.join(); + this.controlService.deleteCsar(csarId); + return Response.status(Response.Status.NOT_ACCEPTABLE) + .entity("{ \"Location\": \"" + wc.getServiceTemplateURI(QName.valueOf(strB.toString())).toString() + "\" }") + .build(); + } catch (final Exception e) { + logger.error("Error resolving open requirements: {}", e.getMessage(), e); + return Response.serverError().build(); + } + } else { + logger.error("CSAR has open requirements but Winery repository is not available"); + try { + this.storage.deleteCSAR(csarId); + } catch (Exception log) { + logger.warn("Failed to delete CSAR [{}] with open requirements on import", csarId.csarName()); + } + return Response.serverError().build(); + } + } + + logger.info("Uploading and storing CSAR \"{}\" was successful", csarId.csarName()); + final URI uri = + UriUtil.encode(this.uriInfo.getAbsolutePathBuilder().path(CsarController.class, "getCsar").build(csarId.csarName())); + return Response.created(uri).build(); + } + + private void doApplyEnrichment(WineryConnector wc, Path tempFile, String applyEnrichment) { + if (Objects.nonNull(applyEnrichment) && Boolean.parseBoolean(applyEnrichment)) { + logger.debug("Enrichment status is true. Continue with enrichment."); + wc.performManagementFeatureEnrichment(tempFile.toFile()); + } + logger.debug("Enrichment status is null or false. Continue without enrichment."); + } + + @DELETE + @javax.ws.rs.Path("/{csar}") + @ApiOperation(value = "Delete a CSAR") + public Response deleteCsar(@ApiParam("ID of CSAR") @PathParam("csar") final String id) { + logger.debug("Invoking deleteCsar"); + Csar csarContent; + try { + csarContent = storage.findById(new CsarId(id)); + } catch (NoSuchElementException e) { + return Response.notModified().build(); + } + + logger.info("Deleting CSAR \"{}\"", id); + final List errors = this.controlService.deleteCsar(csarContent.id()); + + if (errors.size() > 0) { + logger.error("Error deleting CSAR"); + errors.forEach(s -> logger.error(s)); + return Response.serverError().entity(errors).build(); + } + return Response.noContent().build(); + } + + @POST + @javax.ws.rs.Path("/transform") + @ApiOperation(value = "Transform this CSAR to a new CSAR") + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response transformCsar(@ApiParam(required = true) final CsarTransformRequest request) { + logger.debug("Invoking transformCsar"); + final CsarId sourceCsar = new CsarId(request.getSourceCsarName()); + final CsarId targetCsar = new CsarId(request.getTargetCsarName()); + + CsarId csarId = this.csarService.generateTransformationPlans(sourceCsar, targetCsar); + this.controlService.declareStored(csarId); + + boolean success = this.controlService.invokeToscaProcessing(csarId); + if (success) { + Csar storedCsar = storage.findById(csarId); + final List serviceTemplates = storedCsar.serviceTemplates(); + for (final TServiceTemplate serviceTemplate : serviceTemplates) { + logger.trace("Invoke plan deployment for service template \"{}\" of CSAR \"{}\"", serviceTemplate.getName(), csarId.csarName()); + if (!this.controlService.invokePlanDeployment(csarId, serviceTemplate)) { + logger.info("Error deploying plan for service template \"{}\" of CSAR \"{}\"", serviceTemplate.getName(), csarId.csarName()); + success = false; + } + } + } + + return success + ? Response.ok().build() + : Response.serverError().build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ManagementPlanController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ManagementPlanController.java new file mode 100644 index 000000000..91f257719 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ManagementPlanController.java @@ -0,0 +1,237 @@ +package org.opentosca.container.api.controller; + +import java.net.URI; +import java.util.Arrays; +import java.util.List; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.UriInfo; + +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.plan.PlanDTO; +import org.opentosca.container.api.dto.plan.PlanInstanceDTO; +import org.opentosca.container.api.dto.plan.PlanInstanceEventDTO; +import org.opentosca.container.api.dto.plan.PlanInstanceEventListDTO; +import org.opentosca.container.api.dto.plan.PlanInstanceListDTO; +import org.opentosca.container.api.dto.plan.PlanListDTO; +import org.opentosca.container.api.dto.request.CreatePlanInstanceLogEntryRequest; +import org.opentosca.container.api.service.PlanService; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanInstanceEvent; +import org.opentosca.container.core.next.model.PlanInstanceState; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.tosca.extension.TParameter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Api +// not marked as @RestController because instantiation is controlled by parent resource +//@RestController +public class ManagementPlanController { + + private static final Logger LOGGER = LoggerFactory.getLogger(ManagementPlanController.class); + + private final PlanService planService; + + private final Csar csar; + private final TServiceTemplate serviceTemplate; + private final Long serviceTemplateInstanceId; + // supports TERMINATION and MANAGEMENT + private final PlanType[] planTypes; + + public ManagementPlanController(final Csar csar, final TServiceTemplate serviceTemplate, + final Long serviceTemplateInstanceId, final PlanService planService, + final PlanType... types) { + this.csar = csar; + this.serviceTemplate = serviceTemplate; + this.serviceTemplateInstanceId = serviceTemplateInstanceId; + this.planService = planService; + this.planTypes = types; + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get management plans", response = PlanListDTO.class) + public Response getManagementPlans(@Context final UriInfo uriInfo) { + PlanListDTO list = new PlanListDTO(); + csar.plans().stream() + .filter(tplan -> Arrays.stream(planTypes).anyMatch(pt -> tplan.getPlanType().equals(pt.toString()))) + .map(p -> { + final PlanDTO plan = new PlanDTO(p); + + plan.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(plan.getId()).path("instances") + .build())) + .rel("instances").build()); + plan.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(plan.getId()).build())) + .rel("self").build()); + return plan; + }) + .forEach(list::add); + + list.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePath())).rel("self").build()); + return Response.ok(list).build(); + } + + @GET + @Path("/{plan}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a management plan", response = PlanDTO.class) + public Response getManagementPlan(@ApiParam("ID of management plan") @PathParam("plan") final String plan, + @Context final UriInfo uriInfo) { + PlanDTO dto = planService.getPlanDto(csar, planTypes, plan); + + dto.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path("instances").build())) + .rel("instances").build()); + dto.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePath())).rel("self").build()); + return Response.ok(dto).build(); + } + + @GET + @Path("/{plan}/instances") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get instances of a management plan", response = PlanInstanceListDTO.class) + public Response getManagementPlanInstances(@ApiParam("ID of management plan") @PathParam("plan") final String plan, + @Context final UriInfo uriInfo) { + List planInstances = planService.getPlanInstances(csar, planTypes); + + final PlanInstanceListDTO list = new PlanInstanceListDTO(); + planInstances.stream() + .filter(planInstance -> planInstance.getTemplateId().getLocalPart().equals(plan)) + .map(pi -> { + PlanInstanceDTO dto = PlanInstanceDTO.Converter.convert(pi); + if (pi.getServiceTemplateInstance() != null) { + final URI uri = uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{instance}") + .build(csar.id().csarName(), serviceTemplate.toString(), pi.getServiceTemplateInstance().getId()); + dto.add(Link.fromUri(UriUtil.encode(uri)).rel("service_template_instance").build()); + } + dto.add(UriUtil.generateSubResourceLink(uriInfo, pi.getCorrelationId(), false, "self")); + return dto; + }) + .forEach(list::add); + list.add(UriUtil.generateSelfLink(uriInfo)); + + return Response.ok(list).build(); + } + + @POST + @Path("/{plan}/instances") + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) + @ApiOperation(value = "Invokes a management plan", response = String.class) + public Response invokeManagementPlan(@ApiParam("ID of management plan") @PathParam("plan") final String plan, + @Context final UriInfo uriInfo, + @ApiParam(required = true, + value = "plan input parameters") final List parameters) { + String correlationId = planService.invokePlan(csar, serviceTemplate, serviceTemplateInstanceId, plan, parameters, this.planTypes); + return Response.ok(correlationId).build(); + } + + @GET + @Path("/{plan}/instances/{instance}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a management plan instance", response = PlanInstanceDTO.class) + public Response getManagementPlanInstance(@ApiParam("ID of management plan") @PathParam("plan") final String plan, + @ApiParam("correlation ID") @PathParam("instance") final String instance, + @Context final UriInfo uriInfo) { + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, planTypes); + + final PlanInstanceDTO dto = PlanInstanceDTO.Converter.convert(pi); + // Add service template instance link + if (pi.getServiceTemplateInstance() != null) { + final URI uri = uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{instance}") + .build(csar.id().csarName(), serviceTemplate.toString(), + String.valueOf(pi.getServiceTemplateInstance().getId())); + dto.add(Link.fromUri(UriUtil.encode(uri)).rel("service_template_instance").build()); + } + + dto.add(UriUtil.generateSubResourceLink(uriInfo, "state", false, "state")); + dto.add(UriUtil.generateSubResourceLink(uriInfo, "logs", false, "logs")); + + // Add self link + dto.add(UriUtil.generateSelfLink(uriInfo)); + + return Response.ok(dto).build(); + } + + @GET + @Path("/{plan}/instances/{instance}/state") + @Produces( {MediaType.TEXT_PLAIN}) + @ApiOperation(value = "Get state of a management plan instance", response = String.class) + public Response getManagementPlanInstanceState(@ApiParam("ID of management plan") @PathParam("plan") final String plan, + @ApiParam("correlation ID") @PathParam("instance") final String instance, + @Context final UriInfo uriInfo) { + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, planTypes); + return Response.ok(pi.getState().toString()).build(); + } + + @PUT + @Path("/{plan}/instances/{instance}/state") + @Consumes( {MediaType.TEXT_PLAIN}) + @ApiOperation(hidden = true, value = "") + public Response changeManagementPlanInstanceState(@PathParam("plan") final String plan, + @PathParam("instance") final String instance, + @Context final UriInfo uriInfo, final String request) { + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, planTypes); + return planService.updatePlanInstanceState(pi, PlanInstanceState.valueOf(request)) + ? Response.ok().build() + : Response.status(Status.BAD_REQUEST).build(); + } + + @GET + @Path("/{plan}/instances/{instance}/logs") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get log entries of a management plan instance", response = PlanInstanceEventDTO.class, + responseContainer = "list") + public Response getManagementPlanInstanceLogs(@ApiParam("management plan id") @PathParam("plan") final String plan, + @ApiParam("plan instance correlation id") @PathParam("instance") final String instance, + @Context final UriInfo uriInfo) { + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, planTypes); + + final PlanInstanceDTO piDto = PlanInstanceDTO.Converter.convert(pi); + final PlanInstanceEventListDTO dto = new PlanInstanceEventListDTO(piDto.getLogs()); + dto.add(UriUtil.generateSelfLink(uriInfo)); + + return Response.ok(dto).build(); + } + + @POST + @Path("/{plan}/instances/{instance}/logs") + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response addManagementPlanLogEntry(@PathParam("plan") final String plan, + @PathParam("instance") final String instance, + @Context final UriInfo uriInfo, + final CreatePlanInstanceLogEntryRequest logEntry) { + final String entry = logEntry.getLogEntry(); + if (entry == null || entry.length() <= 0) { + LOGGER.info("Log entry is empty!"); + return Response.status(Status.BAD_REQUEST).build(); + } + PlanInstance pi = planService.resolvePlanInstance(csar, serviceTemplate, null, plan, instance, planTypes); + final PlanInstanceEvent event = new PlanInstanceEvent("INFO", "PLAN_LOG", entry); + planService.addLogToPlanInstance(pi, event); + + final URI resourceUri = uriInfo.getAbsolutePath(); + return Response.ok(resourceUri).build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/NodeTemplateController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/NodeTemplateController.java new file mode 100644 index 000000000..9fc358117 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/NodeTemplateController.java @@ -0,0 +1,157 @@ +package org.opentosca.container.api.controller; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.ws.rs.GET; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.container.ResourceContext; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.NodeTemplateDTO; +import org.opentosca.container.api.dto.NodeTemplateListDTO; +import org.opentosca.container.api.dto.boundarydefinitions.InterfaceDTO; +import org.opentosca.container.api.dto.boundarydefinitions.OperationDTO; +import org.opentosca.container.api.service.InstanceService; +import org.opentosca.container.api.service.NodeTemplateService; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.next.model.NodeTemplateInstanceProperty; +import org.opentosca.container.core.next.xml.PropertyParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; + +@Api +@Component +public class NodeTemplateController { + + private static final Logger logger = LoggerFactory.getLogger(NodeTemplateController.class); + + @Context + UriInfo uriInfo; + + @Context + ResourceContext resourceContext; + + private final NodeTemplateService nodeTemplateService; + private final InstanceService instanceService; + + // can't be injected because this is instantiated by the parent resource + public NodeTemplateController(final NodeTemplateService nodeTemplateService, + final InstanceService instanceService) { + this.nodeTemplateService = nodeTemplateService; + this.instanceService = instanceService; + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get all node templates of a service template", response = NodeTemplateListDTO.class) + public Response getNodeTemplates(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId) throws NotFoundException { + logger.debug("Invoking getNodeTemplates"); + // this validates that the CSAR contains the service template + final List nodeTemplateIds = + this.nodeTemplateService.getNodeTemplatesOfServiceTemplate(csarId, serviceTemplateId); + final NodeTemplateListDTO list = new NodeTemplateListDTO(); + + for (final NodeTemplateDTO nodeTemplate : nodeTemplateIds) { + nodeTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, nodeTemplate.getId(), false, "self")); + + nodeTemplate.getInterfaces().add(UriUtil.generateSelfLink(this.uriInfo)); + + for (final InterfaceDTO dto : nodeTemplate.getInterfaces().getInterfaces()) { + dto.add(UriUtil.generateSelfLink(this.uriInfo)); + for (final OperationDTO op : dto.getOperations().values()) { + op.add(UriUtil.generateSelfLink(this.uriInfo)); + } + } + + list.add(nodeTemplate); + } + + list.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(list).build(); + } + + @GET + @Path("/{nodetemplate}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a node template", response = NodeTemplateDTO.class) + public Response getNodeTemplate(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId, + @ApiParam("ID of node template") @PathParam("nodetemplate") final String nodeTemplateId) + throws NotFoundException { + logger.debug("Invoking getNodeTemplate"); + NodeTemplateDTO result; + try { + result = this.nodeTemplateService.getNodeTemplateById(csarId, serviceTemplateId, nodeTemplateId); + } catch (org.opentosca.container.core.common.NotFoundException e) { + throw new NotFoundException(e.getMessage(), e); + } + + result.add(UriUtil.generateSubResourceLink(this.uriInfo, "instances", false, "instances")); + result.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(result).build(); + } + + @GET + @Path("/{nodetemplate}/properties") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get the properties of a node template", response = Document.class) + public Response getNodeTemplateProperties(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, + @ApiParam("qualified name of service template") @PathParam("servicetemplate") final String serviceTemplateId, + @ApiParam("ID of node template") @PathParam("nodetemplate") final String nodeTemplateId) + throws NotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException { + + final Document result; + try { + result = nodeTemplateService.getPropertiesOfNodeTemplate(csarId, serviceTemplateId, nodeTemplateId); + } catch (org.opentosca.container.core.common.NotFoundException e) { + throw new javax.ws.rs.NotFoundException(e); + } + final NodeTemplateInstanceProperty property = instanceService.convertDocumentToProperty(result, NodeTemplateInstanceProperty.class); + + final List properties = new ArrayList<>(); + properties.add(property); + final NodeTemplateInstanceProperty prop = properties.stream() + .filter(p -> p.getType().equalsIgnoreCase("xml")) + .reduce((a, b) -> null).orElse(null); + + Map resultMap = new HashMap<>(); + if (prop != null) { + final PropertyParser parser = new PropertyParser(); + resultMap = parser.parse(prop.getValue()); + } + return Response.ok(resultMap).build(); + } + + @Path("/{nodetemplate}/instances") + public NodeTemplateInstanceController getInstances(@ApiParam(hidden = true) @PathParam("csar") final String csarId, + @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId, + @ApiParam(hidden = true) @PathParam("nodetemplate") final String nodeTemplateId) { + logger.debug("Invoking getInstances"); + if (!this.nodeTemplateService.hasNodeTemplate(csarId, serviceTemplateId, nodeTemplateId)) { + logger.info("Node template \"" + nodeTemplateId + "\" could not be found"); + throw new NotFoundException("Node template \"" + nodeTemplateId + "\" could not be found"); + } + + final NodeTemplateInstanceController child = new NodeTemplateInstanceController(this.instanceService); + this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource + + return child; + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/NodeTemplateInstanceController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/NodeTemplateInstanceController.java new file mode 100644 index 000000000..b9b3fbde0 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/NodeTemplateInstanceController.java @@ -0,0 +1,280 @@ +package org.opentosca.container.api.controller; + +import java.net.URI; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.UriInfo; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.NodeTemplateInstanceDTO; +import org.opentosca.container.api.dto.NodeTemplateInstanceListDTO; +import org.opentosca.container.api.service.InstanceService; +import org.opentosca.container.api.util.ModelUtil; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstanceState; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +@Api +@Component +public class NodeTemplateInstanceController { + + private static final Logger logger = LoggerFactory.getLogger(NodeTemplateInstanceController.class); + + @ApiParam("ID of node template") + @PathParam("nodetemplate") + String nodetemplate; + + @ApiParam("ID of CSAR") + @PathParam("csar") + String csar; + + @ApiParam("qualified name of the service template") + @PathParam("servicetemplate") + String servicetemplate; + + @Context + UriInfo uriInfo; + + private final InstanceService instanceService; + + public NodeTemplateInstanceController(final InstanceService instanceService) { + this.instanceService = instanceService; + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get all instances of a node template", response = NodeTemplateInstanceListDTO.class) + public Response getNodeTemplateInstances(@QueryParam(value = "state") final List states, + @QueryParam(value = "source") final List relationIds, + @QueryParam(value = "serviceInstanceId") final Long serviceInstanceId) { + logger.debug("Invoking getNodeTemplateInstances"); + final Collection nodeInstances = this.instanceService.getNodeTemplateInstances(nodetemplate); + logger.debug("Found <{}> instances of NodeTemplate \"{}\" ", nodeInstances.size(), this.nodetemplate); + + final NodeTemplateInstanceListDTO list = new NodeTemplateInstanceListDTO(); + + for (final NodeTemplateInstance i : nodeInstances) { + if (states != null && !states.isEmpty() && !states.contains(i.getState())) { + // skip this node instance, as it does not have the proper state + continue; + } + + if (!i.getServiceTemplateInstance().getTemplateId().toString().equals(this.servicetemplate)) { + continue; + } + + if (serviceInstanceId != null && !i.getServiceTemplateInstance().getId().equals(serviceInstanceId)) { + continue; + } + + if (relationIds != null && !relationIds.isEmpty()) { + for (final RelationshipTemplateInstance relInstance : i.getOutgoingRelations()) { + if (!relationIds.contains(relInstance.getId())) { + // skip this node instance, as it is no source of the given relation + continue; + } + } + } + + final NodeTemplateInstanceDTO dto = NodeTemplateInstanceDTO.Converter.convert(i); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, dto.getId().toString(), false, "self")); + + list.add(dto); + } + + list.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(list).build(); + } + + @POST + @Consumes( {MediaType.TEXT_PLAIN}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response createNodeTemplateInstance(@Context final UriInfo uriInfo, final String serviceTemplateInstanceId) { + logger.debug("Invoking createNodeTemplateInstance"); + try { + final NodeTemplateInstance createdInstance = + this.instanceService.createNewNodeTemplateInstance(this.csar, this.servicetemplate, this.nodetemplate, + Long.parseLong(serviceTemplateInstanceId)); + final URI instanceURI = UriUtil.generateSubResourceURI(uriInfo, createdInstance.getId().toString(), false); + return Response.ok(instanceURI).build(); + } catch (final IllegalArgumentException e) { + logger.warn("Failed to correctly parse request information for creating a NodeTemplateInstance", e); + return Response.status(Status.BAD_REQUEST).build(); + } catch (InstantiationException | IllegalAccessException e) { + logger.warn("Failed to create new NodeTemplateInstance with exception.", e); + return Response.serverError().build(); + } + } + + @GET + @Path("/{id}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a node template instance", response = NodeTemplateInstanceDTO.class) + public Response getNodeTemplateInstance(@ApiParam("ID of node template instance") @PathParam("id") final Long id) { + logger.debug("Invoking getNodeTemplateInstance"); + final NodeTemplateInstance instance = + this.instanceService.resolveNodeTemplateInstance(this.servicetemplate, this.nodetemplate, id); + final NodeTemplateInstanceDTO dto = NodeTemplateInstanceDTO.Converter.convert(instance); + + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "state", false, "state")); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "properties", false, "properties")); + dto.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(dto).build(); + } + + @DELETE + @Path("/{id}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response deleteNodeTemplateInstance(@PathParam("id") final Long id) { + logger.debug("Invoking deleteNodeTemplateInstance"); + this.instanceService.deleteNodeTemplateInstance(this.servicetemplate, this.nodetemplate, id); + return Response.noContent().build(); + } + + @GET + @Path("/{id}/state") + @Produces( {MediaType.TEXT_PLAIN}) + @ApiOperation(value = "Get state of a node template instance", response = String.class) + public Response getNodeTemplateInstanceState(@ApiParam("ID node template instance") @PathParam("id") final Long id) { + logger.debug("Invoking getNodeTemplateInstanceState"); + final NodeTemplateInstanceState state = + this.instanceService.getNodeTemplateInstanceState(this.servicetemplate, this.nodetemplate, id); + return Response.ok(state.toString()).build(); + } + + @PUT + @Path("/{id}/state") + @Consumes( {MediaType.TEXT_PLAIN}) + @ApiOperation(hidden = true, value = "") + public Response updateNodeTemplateInstanceState(@PathParam("id") final Long id, final String request) { + logger.debug("Invoking updateNodeTemplateInstanceState"); + try { + this.instanceService.setNodeTemplateInstanceState(this.servicetemplate, this.nodetemplate, id, request); + } catch (final IllegalArgumentException e) { // this handles a null request too + return Response.status(Status.BAD_REQUEST).build(); + } + return Response.ok().build(); + } + + @GET + @Path("/{id}/properties") + @Produces( {MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response getNodeTemplateInstanceProperties(@PathParam("id") final Long id) { + logger.debug("Invoking getNodeTemplateInstanceProperties"); + final Document properties = + this.instanceService.getNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id); + + if (properties == null) { + return Response.noContent().build(); + } else { + return Response.ok(properties).build(); + } + } + + @GET + @Path("/{id}/properties") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation( + value = "Get properties of a node template instance", + response = Map.class) + public Map getNodeTemplateInstancePropertiesAsJson(@PathParam("id") final Long id) { + logger.debug("Invoking getNodeTemplateInstancePropertiesAsJson"); + final NodeTemplateInstance instance = + this.instanceService.resolveNodeTemplateInstance(this.servicetemplate, this.nodetemplate, id); + return instance.getPropertiesAsMap(); + } + + @GET + @Path("/{id}/properties/{propname}") + @Produces( {MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response getNodeTemplateInstanceProperty(@PathParam("id") final Long id, + @PathParam("propname") final String propertyName) { + logger.debug("Invoking getNodeTemplateInstanceProperty"); + final Document properties = + this.instanceService.getNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id); + + if (properties == null && ModelUtil.fetchFirstChildElement(properties, propertyName) == null) { + return Response.noContent().build(); + } else { + return Response.ok(ModelUtil.createDocumentFromElement(ModelUtil.fetchFirstChildElement(properties, + propertyName))) + .build(); + } + } + + @PUT + @Path("/{id}/properties") + @Consumes( {MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response updateNodeTemplateInstanceProperties(@PathParam("id") final Long id, final Document request) { + logger.debug("Invoking updateNodeTemplateInstanceProperties"); + try { + this.instanceService.setNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id, + request); + } catch (final IllegalArgumentException e) { // this handles a null request too + return Response.status(Status.BAD_REQUEST).build(); + } catch (final ReflectiveOperationException e) { + return Response.serverError().build(); + } + + return Response.ok(uriInfo.getAbsolutePath()).build(); + } + + @PUT + @Path("/{id}/properties/{propname}") + @Consumes( {MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response updateNodeTemplateInstanceProperty(@PathParam("id") final Long id, + @PathParam("propname") final String propertyName, + final Document request) { + logger.debug("Invoking updateNodeTemplateInstanceProperty"); + try { + final Document properties = + this.instanceService.getNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id); + + final Element propElement = ModelUtil.fetchFirstChildElement(properties, propertyName); + + propElement.setTextContent(request.getDocumentElement().getTextContent()); + + this.instanceService.setNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id, + properties); + } catch (final IllegalArgumentException e) { // this handles a null request too + return Response.status(Status.BAD_REQUEST).build(); + } catch (final ReflectiveOperationException e) { + return Response.serverError().build(); + } + + return Response.ok(this.uriInfo.getAbsolutePath()).build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/PlacementController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/PlacementController.java new file mode 100644 index 000000000..889472764 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/PlacementController.java @@ -0,0 +1,103 @@ +package org.opentosca.container.api.controller; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.container.ResourceContext; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.NodeTemplateDTO; +import org.opentosca.container.api.service.InstanceService; +import org.opentosca.container.api.service.NodeTemplateService; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.tosca.convention.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Api +public class PlacementController { + + private static final Logger logger = LoggerFactory.getLogger(PlacementController.class); + + @Context + UriInfo uriInfo; + + @Context + ResourceContext resourceContext; + + @ApiParam("ID of CSAR") + @PathParam("csar") + String csarId; + + @ApiParam("qualified name of the service template") + @PathParam("servicetemplate") + String serviceTemplateId; + + private final InstanceService instanceService; + private final NodeTemplateService nodeTemplateService; + + public PlacementController(final InstanceService instanceService, final NodeTemplateService nodeTemplateService) { + this.instanceService = instanceService; + this.nodeTemplateService = nodeTemplateService; + } + + @POST + @Produces( {MediaType.APPLICATION_JSON}) + @Consumes( {MediaType.APPLICATION_JSON}) + @ApiOperation(hidden = true, value = "") + public Response getInstances(@ApiParam("node template list need to be placed") final List request) throws InstantiationException, + IllegalAccessException, + IllegalArgumentException { + + // all node templates that need to be placed + final List nodeTemplatesToBePlaced = request.stream() + .map(id -> { + try { + return nodeTemplateService.getNodeTemplateById(csarId, serviceTemplateId, id); + } catch (NotFoundException e) { + throw new javax.ws.rs.NotFoundException(e); + } + }) + .collect(Collectors.toList()); + + // all running node template instances + final Collection nodeTemplateInstanceList = instanceService.getAllNodeTemplateInstances(); + final Map> resultMap = new HashMap<>(); + // loop over all node templates that need to be placed + for (NodeTemplateDTO nodeTemplateDTO : nodeTemplatesToBePlaced) { + // putting default value for all nodeTemplates in the request, even if we can't place them! + resultMap.put(nodeTemplateDTO.getId(), new ArrayList<>()); + // search for valid running node template instances where node template can be placed + for (final NodeTemplateInstance nodeTemplateInstance : nodeTemplateInstanceList) { + // check if node type of instance is supported os node type + if (Utils.isSupportedVMNodeType(nodeTemplateInstance.getTemplateType())) { + // yay, we found an option, add to list + resultMap.get(nodeTemplateDTO.getId()) + .add(Stream.of(nodeTemplateInstance.getId(), + nodeTemplateInstance.getTemplateId(), + nodeTemplateInstance.getServiceTemplateInstance().getId(), + nodeTemplateInstance.getServiceTemplateInstance().getCsarId()) + .map(String::valueOf) + .collect(Collectors.joining("|||"))); + } + } + } + return Response.ok(resultMap).build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/PlanbuilderController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/PlanbuilderController.java new file mode 100644 index 000000000..b4a0463ef --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/PlanbuilderController.java @@ -0,0 +1,148 @@ +package org.opentosca.container.api.controller; + +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.UriInfo; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.opentosca.container.api.planbuilder.PlanbuilderWorker; +import org.opentosca.container.api.planbuilder.RunningTasks; +import org.opentosca.container.api.planbuilder.model.GeneratePlanForTopology; +import org.opentosca.container.api.planbuilder.model.PlanGenerationState; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.impl.service.CsarStorageServiceImpl; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.IHTTPService; +import org.opentosca.planbuilder.importer.Importer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * Copyright 2015 IAAS University of Stuttgart
+ *
+ *

+ * PlanBuilder Service RESTful Rootresource + *

+ * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +@Path("planbuilder") +@Component +@NonNullByDefault +public class PlanbuilderController { + + private static final ExecutorService backgroundWorker = Executors.newCachedThreadPool(r -> new Thread(r, "planbuilder-api-worker")); + private static final Logger LOG = LoggerFactory.getLogger(PlanbuilderController.class); + + @Context + UriInfo uriInfo; + + private final CsarStorageService csarStorage; + private final Importer importer; + private final IHTTPService httpService; + + @Inject + public PlanbuilderController(Importer importer, IHTTPService httpService) { + this.httpService = httpService; + this.importer = importer; + csarStorage = new CsarStorageServiceImpl(Settings.CONTAINER_STORAGE_BASEPATH.resolveSibling("planbuilder-application")); + } + + @GET + @Produces("text/html") + public Response getRootPage() { + return Response.ok("

Hello to the PlanBuilder Service.

To use the PlanBuilder Service send a POST Request with the following example body:

") + .build(); + } + + @Path("async/{taskId}") + @GET + @Produces("application/xml") + public Response getTask(@PathParam("taskId") final String taskId) { + if (RunningTasks.exists(taskId)) { + return Response.ok(RunningTasks.get(taskId)).build(); + } else { + return Response.status(Status.NOT_FOUND).build(); + } + } + + @POST + @Consumes("application/xml") + @Produces("application/xml") + @Path("async") + public Response generateBuildPlanAsync(final GeneratePlanForTopology generatePlanForTopology) { + final URL csarURL; + final URL planPostURL; + try { + csarURL = new URL(generatePlanForTopology.CSARURL); + planPostURL = new URL(generatePlanForTopology.PLANPOSTURL); + } catch (final MalformedURLException e) { + LOG.info("Failed to create csarURl or planPostURL for async build plan", e); + return Response.status(Status.BAD_REQUEST).entity(e).build(); + } + final PlanGenerationState newTaskState = new PlanGenerationState(csarURL, planPostURL); + final String newId = RunningTasks.putSafe(newTaskState); + LOG.info("Enqueueing PlanbuilderWorker for CsarUrl {} and planUrl {} with id [{}]", csarURL, planPostURL, newId); + backgroundWorker.execute(new PlanbuilderWorker(newTaskState, httpService, csarStorage, importer)::doWork); + return Response.created(URI.create(this.uriInfo.getAbsolutePath() + "/" + newId)).build(); + } + + /** + *

+ * Given the paramaters CSARURL and PLANPOSTURL in the request, this method does the following:
- Check whether + * the given parameters are URL's
- Download the CSAR denoted by the CSARURL parameter
- Load the CSAR into + * the OpenTOSCA Core
- Generate BuildPlans for the given CSAR
- Send the the first generated BuildPlan to + * the given PLANPOSTURL using a HTTP POST + *

+ * + * @param generatePlanForTopology a wrapper class for the parameters CSARURL and PLANPOSTURL + * @return a HTTP Response appropriate to the situation (e.g. error, success,..) + */ + @POST + @Consumes("application/xml") + @Produces("application/xml") + @Path("sync") + public Response generateBuildPlanSync(final GeneratePlanForTopology generatePlanForTopology) { + final URL csarURL; + final URL planPostURL; + try { + csarURL = new URL(generatePlanForTopology.CSARURL); + planPostURL = new URL(generatePlanForTopology.PLANPOSTURL); + } catch (final MalformedURLException e) { + LOG.info("Failed to create csarURl or planPostURL for sync build plan", e); + return Response.status(Status.BAD_REQUEST).entity(e).build(); + } + + final PlanGenerationState newTaskState = new PlanGenerationState(csarURL, planPostURL); + final String newId = RunningTasks.putSafe(newTaskState); + + final PlanbuilderWorker worker = new PlanbuilderWorker(newTaskState, httpService, csarStorage, importer); + LOG.info("Synchronously Running PlanbuilderWorker for CsarUrl {} and planUrl {} with id [{}]", csarURL, planPostURL, newId); + worker.doWork(); + + // if the worker doWork is finished, we're either in a failed state or everything worked + switch (worker.getState().currentState) { + case CSARDOWNLOADFAILED: + case PLANGENERATIONFAILED: + case PLANSENDINGFAILED: + return Response.status(Status.INTERNAL_SERVER_ERROR).entity(worker.getState()).build(); + default: + return Response.ok().entity(worker.getState()).build(); + } + } +} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/RelationshipTemplateController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RelationshipTemplateController.java similarity index 87% rename from org.opentosca.container.api/src/org/opentosca/container/api/controller/RelationshipTemplateController.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RelationshipTemplateController.java index 1d964426d..c047c476c 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/RelationshipTemplateController.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RelationshipTemplateController.java @@ -14,22 +14,22 @@ import javax.ws.rs.core.UriInfo; import javax.xml.namespace.QName; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.opentosca.container.api.dto.RelationshipTemplateDTO; import org.opentosca.container.api.dto.RelationshipTemplateListDTO; import org.opentosca.container.api.service.InstanceService; import org.opentosca.container.api.service.RelationshipTemplateService; -import org.opentosca.container.api.util.UriUtil; +import org.opentosca.container.core.common.uri.UriUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; +import org.springframework.stereotype.Component; @Api +@Component public class RelationshipTemplateController { - - private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateController.class); + private static final Logger logger = LoggerFactory.getLogger(RelationshipTemplateController.class); @Context UriInfo uriInfo; @@ -48,9 +48,9 @@ public RelationshipTemplateController(final RelationshipTemplateService relation } @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @ApiOperation(value = "Get all relationship templates of a service template", - response = RelationshipTemplateListDTO.class) + response = RelationshipTemplateListDTO.class) public Response getRelationshipTemplates(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId) throws NotFoundException { @@ -60,8 +60,8 @@ public Response getRelationshipTemplates(@ApiParam("ID of CSAR") @PathParam("csa final RelationshipTemplateListDTO list = new RelationshipTemplateListDTO(); for (final RelationshipTemplateDTO relationshipTemplate : relationshipTemplateIds) { - relationshipTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, relationshipTemplate.getId(), true, - "self")); + relationshipTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, relationshipTemplate.getId(), false, + "self")); list.add(relationshipTemplate); } @@ -73,15 +73,14 @@ public Response getRelationshipTemplates(@ApiParam("ID of CSAR") @PathParam("csa @GET @Path("/{relationshiptemplate}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @ApiOperation(value = "Get a relationship template", response = RelationshipTemplateDTO.class) public Response getRelationshipTemplate(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateName, @ApiParam("ID of relationship template") @PathParam("relationshiptemplate") final String relationshipTemplateId) throws NotFoundException { final RelationshipTemplateDTO result = - this.relationshipTemplateService.getRelationshipTemplateById(csarId, QName.valueOf(serviceTemplateId), - relationshipTemplateId); + this.relationshipTemplateService.getRelationshipTemplateById(csarId, serviceTemplateName, relationshipTemplateId); result.add(UriUtil.generateSubResourceLink(this.uriInfo, "instances", false, "instances")); result.add(UriUtil.generateSelfLink(this.uriInfo)); @@ -95,7 +94,7 @@ public RelationshipTemplateInstanceController getInstances(@ApiParam(hidden = tr @ApiParam(hidden = true) @PathParam("relationshiptemplate") final String relationshipTemplateId) { if (!this.relationshipTemplateService.hasRelationshipTemplate(csarId, QName.valueOf(serviceTemplateId), - relationshipTemplateId)) { + relationshipTemplateId)) { logger.info("Relationship template \"" + relationshipTemplateId + "\" could not be found"); throw new NotFoundException("Relationship template \"" + relationshipTemplateId + "\" could not be found"); } diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RelationshipTemplateInstanceController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RelationshipTemplateInstanceController.java new file mode 100644 index 000000000..c3fb24f59 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RelationshipTemplateInstanceController.java @@ -0,0 +1,229 @@ +package org.opentosca.container.api.controller; + +import java.net.URI; +import java.util.Collection; +import java.util.List; + +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.UriInfo; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.RelationshipTemplateInstanceDTO; +import org.opentosca.container.api.dto.RelationshipTemplateInstanceListDTO; +import org.opentosca.container.api.dto.request.CreateRelationshipTemplateInstanceRequest; +import org.opentosca.container.api.service.InstanceService; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.next.model.RelationshipTemplateInstanceState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; + +@Api +@Component +public class RelationshipTemplateInstanceController { + + private static final Logger logger = LoggerFactory.getLogger(RelationshipTemplateInstanceController.class); + + @ApiParam("ID of CSAR") + @PathParam("csar") + String csar; + + @ApiParam("qualified name of the service template") + @PathParam("servicetemplate") + String servicetemplate; + + @ApiParam("ID of relationship template") + @PathParam("relationshiptemplate") + String relationshiptemplate; + + @Context + UriInfo uriInfo; + + private final InstanceService instanceService; + + public RelationshipTemplateInstanceController(final InstanceService instanceService) { + this.instanceService = instanceService; + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get all relationship template instances", + response = RelationshipTemplateInstanceListDTO.class) + public Response getRelationshipTemplateInstances(@QueryParam(value = "state") final List states, + @QueryParam(value = "target") final Long targetNodeInstanceId, + @QueryParam(value = "serviceInstanceId") final Long serviceInstanceId) { + final Collection relationshipInstances = + this.instanceService.getRelationshipTemplateInstances(relationshiptemplate); + logger.debug("Found <{}> instances of RelationshipTemplate \"{}\" ", relationshipInstances.size(), + this.relationshiptemplate); + + final RelationshipTemplateInstanceListDTO list = new RelationshipTemplateInstanceListDTO(); + + for (final RelationshipTemplateInstance i : relationshipInstances) { + if (!i.getTarget().getServiceTemplateInstance().getTemplateId().toString().equals(this.servicetemplate)) { + continue; + } + if (states != null && !states.isEmpty() && !states.contains(i.getState())) { + // skip this node instance, as it not has the proper state + continue; + } + + if (serviceInstanceId != null && !i.getServiceTemplateInstance().getId().equals(serviceInstanceId)) { + continue; + } + + if (targetNodeInstanceId != null && !i.getTarget().getId().equals(targetNodeInstanceId)) { + // skip this instance if the target id doesn't match + continue; + } + final RelationshipTemplateInstanceDTO dto = RelationshipTemplateInstanceDTO.Converter.convert(i); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, dto.getId().toString(), false, "self")); + + list.add(dto); + } + + list.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(list).build(); + } + + @POST + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response createRelationshipTemplateInstance(@Context final UriInfo uriInfo, + final CreateRelationshipTemplateInstanceRequest request) { + try { + + final RelationshipTemplateInstance createdInstance = + this.instanceService.createNewRelationshipTemplateInstance(this.csar, this.servicetemplate, + this.relationshiptemplate, request); + final URI instanceURI = UriUtil.generateSubResourceURI(uriInfo, createdInstance.getId().toString(), false); + return Response.ok(instanceURI).build(); + } catch (final IllegalArgumentException e) { + logger.error("Error creating instance: {}", e.getMessage(), e); + return Response.status(Status.BAD_REQUEST).build(); + } catch (InstantiationException | IllegalAccessException e) { + logger.error("Error creating instance: {}", e.getMessage(), e); + return Response.serverError().build(); + } + } + + @GET + @Path("/{id}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a relationship template instance", response = RelationshipTemplateInstanceDTO.class) + public Response getRelationshipTemplateInstance(@ApiParam("ID of relationship template instance") @PathParam("id") final Long id) { + + final RelationshipTemplateInstance instance = + this.instanceService.resolveRelationshipTemplateInstance(this.servicetemplate, this.relationshiptemplate, + id); + final RelationshipTemplateInstanceDTO dto = RelationshipTemplateInstanceDTO.Converter.convert(instance); + + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "state", false, "state")); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "properties", false, "properties")); + final String path = + "/csars/{csar}/servicetemplates/{servicetemplate}/nodetemplates/{nodetemplate}/instances/{nodetemplateinstance}"; + final URI sourceNodeTemplateInstanceUri = + this.uriInfo.getBaseUriBuilder().path(path).build(dto.getCsarId(), dto.getServiceTemplateId(), + instance.getSource().getTemplateId(), + dto.getSourceNodeTemplateInstanceId()); + final URI targetNodeTemplateInstanceUri = + this.uriInfo.getBaseUriBuilder().path(path).build(dto.getCsarId(), dto.getServiceTemplateId(), + instance.getTarget().getTemplateId(), + dto.getTargetNodeTemplateInstanceId()); + dto.add(Link.fromUri(UriUtil.encode(sourceNodeTemplateInstanceUri)).rel("source_node_template_instance") + .build()); + dto.add(Link.fromUri(UriUtil.encode(targetNodeTemplateInstanceUri)).rel("target_node_template_instance") + .build()); + dto.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(dto).build(); + } + + @DELETE + @Path("/{id}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response deleteRelationshipTemplateInstance(@PathParam("id") final Long id) { + this.instanceService.deleteRelationshipTemplateInstance(this.servicetemplate, this.relationshiptemplate, id); + return Response.noContent().build(); + } + + @GET + @Path("/{id}/state") + @Produces( {MediaType.TEXT_PLAIN}) + @ApiOperation(value = "Get state of a relationship template instance", response = String.class) + public Response getRelationshipTemplateInstanceState(@ApiParam("ID of relationship template instance") @PathParam("id") final Long id) { + final RelationshipTemplateInstanceState state = + this.instanceService.getRelationshipTemplateInstanceState(this.servicetemplate, this.relationshiptemplate, + id); + return Response.ok(state.toString()).build(); + } + + @PUT + @Path("/{id}/state") + @Consumes( {MediaType.TEXT_PLAIN}) + @ApiOperation(hidden = true, value = "") + public Response updateRelationshipTemplateInstanceState(@PathParam("id") final Long id, final String request) { + try { + this.instanceService.setRelationshipTemplateInstanceState(this.servicetemplate, this.relationshiptemplate, + id, request); + } catch (final IllegalArgumentException e) { // this handles a null request too + return Response.status(Status.BAD_REQUEST).build(); + } + return Response.ok().build(); + } + + @GET + @Path("/{id}/properties") + @Produces( {MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response getRelationshipTemplateInstanceProperties(@PathParam("id") final Long id) { + final Document properties = + this.instanceService.getRelationshipTemplateInstanceProperties(this.servicetemplate, + this.relationshiptemplate, id); + if (properties == null) { + return Response.noContent().build(); + } else { + return Response.ok(properties).build(); + } + } + + @PUT + @Path("/{id}/properties") + @Consumes( {MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response updateRelationshipTemplateInstanceProperties(@PathParam("id") final Long id, + final Document request) { + + try { + this.instanceService.setRelationshipTemplateInstanceProperties(this.servicetemplate, + this.relationshiptemplate, id, request); + } catch (final IllegalArgumentException e) { // this handles a null request too + return Response.status(Status.BAD_REQUEST).build(); + } catch (final ReflectiveOperationException e) { + return Response.serverError().build(); + } + + return Response.ok(this.uriInfo.getAbsolutePath()).build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RootController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RootController.java new file mode 100644 index 000000000..299f88839 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/RootController.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright 2017-2019 University of Stuttgart + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + *******************************************************************************/ +package org.opentosca.container.api.controller; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import io.swagger.annotations.Contact; +import io.swagger.annotations.Info; +import io.swagger.annotations.License; +import io.swagger.annotations.SwaggerDefinition; +import org.opentosca.container.api.dto.ResourceSupport; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestMapping; + +@SwaggerDefinition(info = @Info(title = "Public API for OpenTOSCA Container", + description = "API access to query entities and manipulate them using plans", + version = "2.1.0", termsOfService = "", + contact = @Contact(name = "OpenTOSCA", url = "http://opentosca.org", + email = "opentosca@iaas.uni-stuttgart.de"), + license = @License(name = "Apache License, Version 2.0", + url = "https://www.apache.org/licenses/LICENSE-2.0"))) +@Path("/") +@Component +@RequestMapping("/") +public class RootController { + + @Context + private UriInfo uriInfo; + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response getRoot() { + final ResourceSupport links = new ResourceSupport(); + links.add(Link.fromResource(RootController.class).rel("self").baseUri(this.uriInfo.getBaseUri()).build()); + links.add(Link.fromResource(CsarController.class).rel("csars").baseUri(this.uriInfo.getBaseUri()).build()); + links.add( + Link.fromResource(SituationsController.class).rel("situationsapi").baseUri(this.uriInfo.getBaseUri()).build()); + + return Response.ok(links).build(); + } + + @GET + @Path("favicon.ico") + // this just stubs out the favicon endpoint to shut error-logging for requests to it up + public Response faviconStub() { + return Response.noContent().build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ServiceTemplateController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ServiceTemplateController.java new file mode 100644 index 000000000..d0456b7b7 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ServiceTemplateController.java @@ -0,0 +1,240 @@ +package org.opentosca.container.api.controller; + +import java.util.List; + +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.container.ResourceContext; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Request; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.ServiceTemplateDTO; +import org.opentosca.container.api.dto.ServiceTemplateListDTO; +import org.opentosca.container.api.dto.request.ServiceTransformRequest; +import org.opentosca.container.api.service.CsarService; +import org.opentosca.container.api.service.CsarService.AdaptationPlanGenerationResult; +import org.opentosca.container.api.service.InstanceService; +import org.opentosca.container.api.service.NodeTemplateService; +import org.opentosca.container.api.service.PlanService; +import org.opentosca.container.api.service.RelationshipTemplateService; +import org.opentosca.container.control.OpenToscaControlService; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.deployment.checks.DeploymentTestService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +@Path("/csars/{csar}/servicetemplates") +@Api("/") +@Component +public class ServiceTemplateController { + + private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateController.class); + + @Context + private UriInfo uriInfo; + + @Context + private Request request; + + @Context + private ResourceContext resourceContext; + + @Inject + private PlanService planService; + + @Inject + private InstanceService instanceService; + + @Inject + private NodeTemplateService nodeTemplateService; + + @Inject + private RelationshipTemplateService relationshipTemplateService; + + @Inject + private DeploymentTestService deploymentTestService; + + @Inject + private CsarStorageService storage; + + @Inject + private OpenToscaControlService controlService; + + @Inject + private CsarService csarService; + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get all service templates", response = ServiceTemplateListDTO.class) + public Response getServiceTemplates(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId) { + logger.info("Loading all service templates for csar [{}]", csarId); + final Csar csar = storage.findById(new CsarId(csarId)); + final ServiceTemplateListDTO list = new ServiceTemplateListDTO(); + + for (final TServiceTemplate template : csar.serviceTemplates()) { + final String templateId = template.getIdFromIdOrNameField(); + final ServiceTemplateDTO serviceTemplate = new ServiceTemplateDTO(templateId); + serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, templateId, false, "self")); + list.add(serviceTemplate); + } + + list.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(list).build(); + } + + @GET + @Path("/{servicetemplate}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a service template", response = ServiceTemplateDTO.class) + public Response getServiceTemplate(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId) { + + final Csar csar = storage.findById(new CsarId(csarId)); + // return value is not used, we only need to throw if we didn't find stuff + csar.serviceTemplates().stream() + .filter(t -> t.getIdFromIdOrNameField().equals(serviceTemplateId)) + .findFirst().orElseThrow(NotFoundException::new); + + final ServiceTemplateDTO serviceTemplate = new ServiceTemplateDTO(serviceTemplateId); + + serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "boundarydefinitions", false, + "boundarydefinitions")); + serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "buildplans", false, "buildplans")); + serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "instances", false, "instances")); + serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "nodetemplates", false, "nodetemplates")); + serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "relationshiptemplates", false, + "relationshiptemplates")); + serviceTemplate.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(serviceTemplate).build(); + } + + @Path("/{servicetemplate}/buildplans") + public BuildPlanController getBuildPlans(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId) { + final Csar csar = storage.findById(new CsarId(csarId)); + final TServiceTemplate serviceTemplate = csar.serviceTemplates().stream() + .filter(t -> t.getIdFromIdOrNameField().equals(serviceTemplateId)) + .findFirst().orElseThrow(NotFoundException::new); + + return new BuildPlanController(csar, serviceTemplate, this.planService); + } + + @Path("/{servicetemplate}/nodetemplates") + public NodeTemplateController getNodeTemplates(@ApiParam(hidden = true) @PathParam("csar") final String csarId, + @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId) { + + final Csar csar = storage.findById(new CsarId(csarId)); + // return value is not used, we only need to throw if we didn't find stuff + csar.serviceTemplates().stream() + .filter(t -> t.getIdFromIdOrNameField().equals(serviceTemplateId)) + .findFirst().orElseThrow(NotFoundException::new); + + final NodeTemplateController child = new NodeTemplateController(this.nodeTemplateService, this.instanceService); + this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource + return child; + } + + @Path("/{servicetemplate}/relationshiptemplates") + public RelationshipTemplateController getRelationshipTemplates(@ApiParam(hidden = true) @PathParam("csar") final String csarId, + @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId) { + final Csar csar = storage.findById(new CsarId(csarId)); + // return value is not used, we only need to throw if we didn't find stuff + csar.serviceTemplates().stream() + .filter(t -> t.getIdFromIdOrNameField().equals(serviceTemplateId)) + .findFirst().orElseThrow(NotFoundException::new); + + final RelationshipTemplateController child = + new RelationshipTemplateController(this.relationshipTemplateService, this.instanceService); + this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource + return child; + } + + @Path("/{servicetemplate}/placement") + public PlacementController startPlacement(@ApiParam(hidden = true) @PathParam("csar") final String csarId, + @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId) { + final Csar csar = storage.findById(new CsarId(csarId)); + final TServiceTemplate serviceTemplate = csar.serviceTemplates().stream() + .filter(t -> t.getIdFromIdOrNameField().equals(serviceTemplateId)) + .findFirst().orElseThrow(NotFoundException::new); + + // init placement controller if placement is started + final PlacementController child = new PlacementController(instanceService, nodeTemplateService); + resourceContext.initResource(child); + return child; + } + + @Path("/{servicetemplate}/instances") + public ServiceTemplateInstanceController getInstances(@ApiParam(hidden = true) @PathParam("csar") final String csarId, + @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId) { + final Csar csar = storage.findById(new CsarId(csarId)); + // return value is not used, we only need to throw if we didn't find stuff + TServiceTemplate serviceTemplate = csar.serviceTemplates().stream() + .filter(t -> t.getIdFromIdOrNameField().equals(serviceTemplateId)) + .findFirst().orElseThrow(NotFoundException::new); + + final ServiceTemplateInstanceController child = new ServiceTemplateInstanceController(csar, serviceTemplate, this.instanceService, + this.planService, this.deploymentTestService); + this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource + return child; + } + + @POST + @Path("/{servicetemplate}/transform") + @ApiOperation(value = "Generates a plan to adapt service template instances via the given the source and target nodes/relations") + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response transformCsar(@ApiParam("ID of CSAR") @PathParam("csar") final String csar, + @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId, @ApiParam(required = true) final ServiceTransformRequest request) { + + final AdaptationPlanGenerationResult result = this.csarService.generateAdaptationPlan(new CsarId(csar), QName.valueOf(serviceTemplateId), request.getSourceNodeTemplates(), request.getSourceRelationshipTemplates(), request.getTargetNodeTemplates(), request.getTargetRelationshipTemplates()); + + if (result == null) { + return Response.serverError().build(); + } + + // FIXME maybe this only makes sense when we have generated plans :/ + this.controlService.declareStored(result.csarId); + + boolean success = this.controlService.invokeToscaProcessing(result.csarId); + + if (success) { + Csar storedCsar = storage.findById(result.csarId); + final List serviceTemplates = storedCsar.serviceTemplates(); + + for (final TServiceTemplate serviceTemplate : serviceTemplates) { + if (!this.controlService.invokePlanDeployment(result.csarId, serviceTemplate)) { + success = false; + } + } + } + + if (success) { + PlanType[] planTypes = {PlanType.MANAGEMENT}; + return Response.ok(this.planService.getPlanDto(storage.findById(result.csarId), planTypes, result.planId)).build(); + } else { + return Response.serverError().build(); + } + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ServiceTemplateInstanceController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ServiceTemplateInstanceController.java new file mode 100644 index 000000000..70102ea12 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/ServiceTemplateInstanceController.java @@ -0,0 +1,463 @@ +package org.opentosca.container.api.controller; + +import java.net.URI; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Link; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.UriInfo; + +import org.eclipse.winery.model.tosca.TExportedInterface; +import org.eclipse.winery.model.tosca.TExportedOperation; +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.opentosca.container.api.dto.NodeOperationDTO; +import org.opentosca.container.api.dto.ResourceDecorator; +import org.opentosca.container.api.dto.ServiceTemplateInstanceDTO; +import org.opentosca.container.api.dto.ServiceTemplateInstanceListDTO; +import org.opentosca.container.api.dto.boundarydefinitions.InterfaceDTO; +import org.opentosca.container.api.dto.boundarydefinitions.InterfaceListDTO; +import org.opentosca.container.api.dto.boundarydefinitions.OperationDTO; +import org.opentosca.container.api.dto.plan.PlanDTO; +import org.opentosca.container.api.dto.request.CreateServiceTemplateInstanceRequest; +import org.opentosca.container.api.dto.situations.SituationsMonitorDTO; +import org.opentosca.container.api.dto.situations.SituationsMonitorListDTO; +import org.opentosca.container.api.service.InstanceService; +import org.opentosca.container.api.service.PlanService; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.DeploymentTest; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; +import org.opentosca.container.core.next.model.SituationsMonitor; +import org.opentosca.container.core.next.repository.DeploymentTestRepository; +import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; +import org.opentosca.deployment.checks.DeploymentTestService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; + +@Api +// not marked as @RestController because it is created by a parent controller +public class ServiceTemplateInstanceController { + + private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateInstanceController.class); + private final Csar csar; + private final TServiceTemplate serviceTemplate; + private final InstanceService instanceService; + private final PlanService planService; + private final DeploymentTestService deploymentTestService; + @Context + private UriInfo uriInfo; + + public ServiceTemplateInstanceController(final Csar csar, final TServiceTemplate serviceTemplate, + final InstanceService instanceService, final PlanService planService, + final DeploymentTestService deploymentTestService) { + this.csar = csar; + this.serviceTemplate = serviceTemplate; + this.instanceService = instanceService; + this.planService = planService; + this.deploymentTestService = deploymentTestService; + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get all instances of a service template", response = ServiceTemplateInstanceListDTO.class) + public Response getServiceTemplateInstances() { + logger.debug("Invoking getServiceTemplateInstances"); + final Collection serviceInstances = + this.instanceService.getServiceTemplateInstances(serviceTemplate.getId()); + logger.debug("Found <{}> instances of ServiceTemplate \"{}\" ", serviceInstances.size(), serviceTemplate.getId()); + + final ServiceTemplateInstanceListDTO list = new ServiceTemplateInstanceListDTO(); + + for (final ServiceTemplateInstance i : serviceInstances) { + final ServiceTemplateInstanceDTO dto = ServiceTemplateInstanceDTO.Converter.convert(i); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, dto.getId().toString(), false, "self")); + + list.add(dto); + } + + list.add(UriUtil.generateSelfLink(this.uriInfo)); + return Response.ok(list).build(); + } + + @POST + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response createServiceTemplateInstance(final CreateServiceTemplateInstanceRequest request) { + logger.debug("Invoking createServiceTemplateInstance"); + if (request == null || request.getCorrelationId() == null || request.getCorrelationId().trim().length() == 0) { + logger.debug("Request to create service template instance failed basic precondition(s)"); + return Response.status(Status.BAD_REQUEST).build(); + } + + try { + final ServiceTemplateInstance createdInstance = + this.instanceService.createServiceTemplateInstance(csar.id().csarName(), serviceTemplate.getId(), request.getCorrelationId().trim()); + + final URI uri = UriUtil.generateSubResourceURI(this.uriInfo, createdInstance.getId().toString(), false); + + return Response.ok(uri).build(); + } catch (final IllegalArgumentException e) { + logger.debug("Illegal Argument when creating serviceTemplateInstance", e); + return Response.status(Status.CONFLICT).build(); + } catch (InstantiationException | IllegalAccessException e) { + logger.debug("Internal error occurred: {}", e.getMessage()); + return Response.serverError().build(); + } catch (final NotFoundException e) { + logger.debug("Didn't find PlanInstances with given correlationId: {}", e.getMessage()); + return Response.status(Status.BAD_REQUEST).entity("Didn't find PlanInstances with given correlationId") + .build(); + } + } + + @GET + @Path("/{id}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get a service template instance", response = ServiceTemplateInstanceDTO.class) + public Response getServiceTemplateInstance(@ApiParam("ID of service template instance") @PathParam("id") final Long id) { + logger.debug("Invoking getServiceTemplateInstance"); + final ServiceTemplateInstance instance = resolveInstance(id, serviceTemplate.getId()); + final ServiceTemplateInstanceDTO dto = ServiceTemplateInstanceDTO.Converter.convert(instance); + + // Build plan: Determine plan instance that created this service template instance + final PlanInstance pi = findPlanInstance(instance); + // Add a link + String path = ""; + URI uri = null; + if (pi.getType().equals(PlanType.BUILD)) { + //url to the build plan instance + path = "/csars/{csar}/servicetemplates/{servicetemplate}/buildplans/{plan}/instances/{instance}"; + uri = this.uriInfo.getBaseUriBuilder().path(path).build(csar.id().csarName(), serviceTemplate.getId(), + pi.getTemplateId().getLocalPart(), pi.getCorrelationId()); + } else { + // url to the transformation plan instance which created this instance from another service instance + path = "/csars/{csar}/servicetemplates/{servicetemplate}/instances/{serviceinstance}/managementplans/{plan}/instances/{instance}"; + uri = this.uriInfo.getBaseUriBuilder().path(path).build(pi.getServiceTemplateInstance().getCsarId().csarName(), pi.getServiceTemplateInstance().getTemplateId().toString(), pi.getServiceTemplateInstance().getId(), + pi.getTemplateId().getLocalPart(), pi.getCorrelationId()); + } + + dto.add(Link.fromUri(UriUtil.encode(uri)).rel("build_plan_instance").build()); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "managementplans", false, "managementplans")); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "state", false, "state")); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "properties", false, "properties")); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "deploymenttests", false, "deploymenttests")); + dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "boundarydefinitions/interfaces", false, + "boundarydefinitions/interfaces")); + dto.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(dto).build(); + } + + private PlanInstance findPlanInstance(ServiceTemplateInstance instance) { + return planService.getPlanInstanceByCorrelationId(instance.getCreationCorrelationId()); + } + + @DELETE + @Path("/{id}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response deleteServiceTemplateInstance(@PathParam("id") final Long id) { + logger.debug("Invoking deleteServiceTemplateInstance"); + this.instanceService.deleteServiceTemplateInstance(id); + return Response.noContent().build(); + } + + @Path("/{id}/managementplans") + public ManagementPlanController getManagementPlans(@ApiParam("ID of service template instance") @PathParam("id") final Long id) { + logger.debug("Invoking getManagementPlans"); + final ServiceTemplateInstance instance = resolveInstance(id, serviceTemplate.getId()); + return new ManagementPlanController(csar, serviceTemplate, id, this.planService, PlanType.TERMINATION, PlanType.MANAGEMENT); + } + + @GET + @Path("/{id}/state") + @Produces( {MediaType.TEXT_PLAIN}) + @ApiOperation(value = "Get state of a service template instance", response = String.class) + public Response getServiceTemplateInstanceState(@ApiParam("ID of service template instance") @PathParam("id") final Long id) { + logger.debug("Invoking getServiceTemplateInstanceState"); + final ServiceTemplateInstanceState state = this.instanceService.getServiceTemplateInstanceState(id); + return Response.ok(state.toString()).build(); + } + + @PUT + @Path("/{id}/state") + @Consumes( {MediaType.TEXT_PLAIN}) + @ApiOperation(hidden = true, value = "") + public Response updateServiceTemplateInstanceState(@PathParam("id") final Long id, final String request) { + logger.debug("Invoking updateServiceTemplateInstanceState"); + try { + this.instanceService.setServiceTemplateInstanceState(id, request); + } catch (final IllegalArgumentException e) { // this handles a null request too + return Response.status(Status.BAD_REQUEST).build(); + } + return Response.ok().build(); + } + + @GET + @Path("/{id}/properties") + @Produces( {MediaType.APPLICATION_XML}) + @ApiOperation(hidden = true, value = "") + public Response getServiceTemplateInstanceProperties(@PathParam("id") final Long id) { + logger.debug("Invoking getServiceTemplateInstanceProperties"); + final ServiceTemplateInstance instance = this.instanceService.getServiceTemplateInstance(id, true); + final Document properties = instance.getPropertiesAsDocument(); + + if (properties == null) { + return Response.noContent().build(); + } else { + return Response.ok(properties).build(); + } + } + + @GET + @Path("/{id}/properties") + @Produces( {MediaType.APPLICATION_JSON}) + @ApiOperation(value = "Gets the properties of a service template instance", response = Map.class) + public Map getServiceTemplateInstancePropertiesAsJSON(@PathParam("id") final Long id) { + logger.debug("Invoking getServiceTemplateInstancePropertiesAsJSON"); + final ServiceTemplateInstance serviceTemplateInstance = this.instanceService.getServiceTemplateInstance(id, true); + return serviceTemplateInstance.getPropertiesAsMap(); + } + + @PUT + @Path("/{id}/properties") + @Consumes( {MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) + @ApiOperation(hidden = true, value = "") + public Response updateServiceTemplateInstanceProperties(@PathParam("id") final Long id, final Document request) { + logger.debug("Invoking updateServiceTemplateInstanceProperties"); + try { + this.instanceService.setServiceTemplateInstanceProperties(id, request); + } catch (final IllegalArgumentException e) { // this handles a null request too + return Response.status(Status.BAD_REQUEST).build(); + } catch (final ReflectiveOperationException e) { + return Response.serverError().build(); + } + return Response.ok(this.uriInfo.getAbsolutePath()).build(); + } + + @GET + @Path("/{id}/situationsmonitors") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response getSituationMonitors(@PathParam("id") final Long id) { + logger.debug("Invoking getSituationMonitors"); + Collection monitors = this.instanceService.getSituationsMonitors(id); + final SituationsMonitorListDTO dto = new SituationsMonitorListDTO(); + + monitors.forEach(x -> dto.add(SituationsMonitorDTO.Converter.convert(x))); + + dto.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(dto).build(); + } + + @POST + @Path("/{id}/situationsmonitors") + @Consumes( {MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response createSituationMonitor(@PathParam("id") final Long id, SituationsMonitorDTO monitor) { + logger.debug("Invoking createSituationMonitor"); + ServiceTemplateInstance servInstance = this.instanceService.getServiceTemplateInstance(id, false); + + Map> mapping = new HashMap<>(); + + for (String nodeId : monitor.getNodeId2SituationIds().keySet()) { + mapping.put(nodeId, monitor.getNodeId2SituationIds().get(nodeId).getSituationId()); + } + + SituationsMonitor createdInstance = this.instanceService.createNewSituationsMonitor(servInstance, mapping); + final URI uri = UriUtil.generateSubResourceURI(this.uriInfo, createdInstance.getId().toString(), false); + return Response.ok(uri).build(); + } + + /** + * Gets a reference to the service template instance. Ensures that the instance actually belongs to the service + * template. + * + * @throws NotFoundException if the instance does not belong to the service template + */ + private ServiceTemplateInstance resolveInstance(final Long instanceId, final String templateId) throws NotFoundException { + // We only need to check that the instance belongs to the template, the rest is + // guaranteed while this is a sub-resource + final ServiceTemplateInstance instance = this.instanceService.getServiceTemplateInstance(instanceId, false); + + if (!instance.getTemplateId().equals(templateId)) { + logger.info("Service template instance <{}> could not be found", instanceId); + throw new NotFoundException(String.format("Service template instance <%s> could not be found", instanceId)); + } + + return instance; + } + + @GET + @Path("/{id}/boundarydefinitions/interfaces") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @ApiOperation(value = "Get interfaces of a service tempate", response = InterfaceListDTO.class) + public Response getInterfaces(@PathParam("id") final Long id) { + logger.debug("Invoking getInterfaces"); + List boundaryInterfaces = serviceTemplate.getBoundaryDefinitions().getInterfaces().getInterface(); + logger.debug("Found <{}> interface(s) in Service Template \"{}\" of CSAR \"{}\" ", boundaryInterfaces.size(), + serviceTemplate.getId(), csar.id().csarName()); + + final InterfaceListDTO list = new InterfaceListDTO(); + list.add(boundaryInterfaces.stream().map(exportedInterface -> { + + final List operations = exportedInterface.getOperation(); + logger.debug("Found <{}> operation(s) for Interface \"{}\" in Service Template \"{}\" of CSAR \"{}\" ", + operations.size(), exportedInterface.getName(), serviceTemplate.getId(), csar.id().csarName()); + + final Map ops = operations.stream().filter(o -> { + final PlanDTO plan = new PlanDTO((TPlan) o.getPlan().getPlanRef()); + return !PlanType.BUILD.toString().equals(plan.getPlanType()); + }).map(o -> { + final OperationDTO dto = new OperationDTO(); + dto.setName(o.getName()); + dto.setNodeOperation(NodeOperationDTO.Converter.convert(o.getNodeOperation())); + dto.setRelationshipOperation(o.getRelationshipOperation()); + if (o.getPlan() != null) { + final PlanDTO plan = new PlanDTO((TPlan) o.getPlan().getPlanRef()); + dto.setPlan(plan); + // Compute the according URL for the Build or Management Plan + final URI planUrl; + if (PlanType.BUILD.toString().equals(plan.getPlanType())) { + // If it's a build plan + planUrl = + this.uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/buildplans/{buildplan}") + .build(csar.id().csarName(), serviceTemplate.getId(), plan.getId()); + } else { + // ... else we assume it's a management plan + planUrl = + this.uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{id}/managementplans/{managementplan}") + .build(csar.id().csarName(), serviceTemplate.getId(), id, plan.getId()); + } + plan.add(Link.fromUri(UriUtil.encode(planUrl)).rel("self").build()); + dto.add(Link.fromUri(UriUtil.encode(planUrl)).rel("plan").build()); + } + return dto; + }).collect(Collectors.toMap(OperationDTO::getName, t -> t)); + + final InterfaceDTO dto = new InterfaceDTO(); + String name = exportedInterface.getName(); + dto.setName(name); + dto.setOperations(ops); + + final URI selfLink = + this.uriInfo.getBaseUriBuilder() + .path("/csars/{csar}/servicetemplates/{servicetemplate}/boundarydefinitions/interfaces/{name}") + .build(csar.id().csarName(), serviceTemplate.getId(), name); + dto.add(Link.fromUri(UriUtil.encode(selfLink)).rel("self").build()); + + return dto; + }).collect(Collectors.toList()).toArray(new InterfaceDTO[] {})); + list.add(UriUtil.generateSelfLink(this.uriInfo)); + + return Response.ok(list).build(); + } + + @GET + @Path("/{id}/deploymenttests") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(hidden = true, value = "") + public Response getDeploymentTests(@PathParam("id") final Integer id) { + logger.debug("Invoking getDeploymentTests"); + // TODO: Check if instance belongs to CSAR and Service Template + final ServiceTemplateInstance sti = new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null); + if (sti == null) { + logger.info("Service template instance \"" + id + "\" of template \"" + serviceTemplate.getId() + + "\" could not be found"); + throw new NotFoundException("Service template instance \"" + id + "\" of template \"" + + serviceTemplate.getId() + "\" could not be found"); + } + + final List items = sti.getDeploymentTests().stream().map(v -> { + final ResourceDecorator decorator = new ResourceDecorator(); + decorator.setObject(v); + decorator.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePathBuilder() + .path(String.valueOf(v.getId())).build())) + .rel("self").build()); + return decorator; + }).collect(Collectors.toList()); + + final ResourceDecorator response = new ResourceDecorator(); + response.setObject(items); + response.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("self").build()); + + return Response.ok(response).build(); + } + + @GET + @Path("/{id}/deploymenttests/{deploymenttest}") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(hidden = true, value = "") + public Response getDeploymentTest(@PathParam("id") final Integer id, + @PathParam("deploymenttest") final Integer deploymenttest) { + logger.debug("Invoking getDeploymentTest"); + // TODO: Check if instance belongs to CSAR and Service Template + final ServiceTemplateInstance sti = new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null); + if (sti == null) { + logger.info("Service template instance \"" + id + "\" of template \"" + serviceTemplate.getId() + + "\" could not be found"); + throw new NotFoundException("Service template instance \"" + id + "\" of template \"" + + serviceTemplate.getId() + "\" could not be found"); + } + + // TODO: Check if deployment test belongs the current instance + final DeploymentTest object = new DeploymentTestRepository().find(Long.valueOf(deploymenttest)).orElse(null); + if (object == null) { + throw new NotFoundException(); + } + + final ResourceDecorator response = new ResourceDecorator(); + response.setObject(object); + response.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("self").build()); + + return Response.ok(response).build(); + } + + @POST + @Path("/{id}/deploymenttests") + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(hidden = true, value = "") + public Response createDeploymentTest(@PathParam("id") final Integer id) { + logger.debug("Invoking createDeploymentTest"); + // TODO: Check if instance belongs to CSAR and Service Template + final ServiceTemplateInstance sti = new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null); + if (sti == null) { + logger.info("Service template instance \"" + id + "\" of template \"" + serviceTemplate.getId() + + "\" could not be found"); + throw new NotFoundException("Service template instance \"" + id + "\" of template \"" + + serviceTemplate.getId() + "\" could not be found"); + } + + final DeploymentTest result = this.deploymentTestService.run(csar.id(), sti); + final URI location = this.uriInfo.getAbsolutePathBuilder().path(String.valueOf(result.getId())).build(); + return Response.created(UriUtil.encode(location)).build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/SituationsController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/SituationsController.java new file mode 100644 index 000000000..70b9f4b52 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/SituationsController.java @@ -0,0 +1,206 @@ +package org.opentosca.container.api.controller; + +import java.net.URI; +import java.util.Collection; +import java.util.Set; + +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import org.opentosca.container.api.dto.situations.SituationDTO; +import org.opentosca.container.api.dto.situations.SituationListDTO; +import org.opentosca.container.api.dto.situations.SituationTriggerDTO; +import org.opentosca.container.api.dto.situations.SituationTriggerInstanceDTO; +import org.opentosca.container.api.dto.situations.SituationTriggerListDTO; +import org.opentosca.container.api.service.InstanceService; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.model.Situation; +import org.opentosca.container.core.next.model.SituationTrigger; +import org.opentosca.container.core.next.model.SituationTriggerProperty; +import org.opentosca.container.core.service.CsarStorageService; +import org.springframework.stereotype.Component; + +@Path("/situationsapi") +@Component +public class SituationsController { + + @Context + UriInfo uriInfo; + + @Inject + private InstanceService instanceService; + @Inject + private CsarStorageService csarService; + + @GET + @Produces(MediaType.TEXT_PLAIN) + public Response getRoot() { + return Response.ok("Situations").build(); + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Path("/situations") + public Response getSituations() { + final SituationListDTO dto = new SituationListDTO(); + this.instanceService.getSituations().forEach(x -> dto.add(SituationDTO.Converter.convert(x))); + return Response.ok(dto).build(); + } + + @PUT + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Path("/situations/{situation}") + public Response updateSituation(@PathParam("situation") final Long situationId, final SituationDTO situation) { + final Situation sit = this.instanceService.getSituation(situation.getId()); + + sit.setActive(situation.getActive()); + sit.setEventProbability(situation.getEventProbability()); + sit.setEventTime(situation.getEventTime()); + + this.instanceService.updateSituation(sit); + + final URI instanceURI = this.uriInfo.getAbsolutePath(); + + return Response.ok(instanceURI).build(); + } + + @PUT + @Consumes( {MediaType.TEXT_PLAIN}) + @Path("/situations/{situation}/active") + public Response updateSituationActivity(@PathParam("situation") final Long situationId, final String body) { + final Situation sit = this.instanceService.getSituation(situationId); + + boolean active = false; + + if (body.equalsIgnoreCase("true") || body.equalsIgnoreCase("false")) { + active = Boolean.valueOf(body); + } else { + return Response.notAcceptable(null).build(); + } + + sit.setActive(active); + + this.instanceService.updateSituation(sit); + + final URI instanceURI = this.uriInfo.getAbsolutePath(); + + return Response.ok(instanceURI).build(); + } + + @POST + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Path("/situations") + public Response createSituation(final SituationDTO situation) { + final Situation sit = this.instanceService.createNewSituation(situation.getThingId(), + situation.getSituationTemplateId(), situation.getActive(), situation.getEventProbability(), + situation.getEventTime()); + + final URI instanceURI = UriUtil.generateSubResourceURI(this.uriInfo, sit.getId().toString(), false); + + return Response.ok(instanceURI).build(); + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Path("/situations/{situation}") + public Response getSituation(@PathParam("situation") final Long situationId) { + return Response.ok(SituationDTO.Converter.convert(this.instanceService.getSituation(situationId))).build(); + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Path("/triggers") + public Response getSituationTriggers() { + final SituationTriggerListDTO dto; + try { + dto = new SituationTriggerListDTO(); + this.instanceService.getSituationTriggers().forEach(x -> dto.add(SituationTriggerDTO.Converter.convert(x))); + } catch (final Exception e) { + e.printStackTrace(); + return Response.serverError().build(); + } + return Response.ok(dto).build(); + } + + @POST + @Path("/triggers") + @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response createSituationTrigger(final SituationTriggerDTO situationTrigger) { + final Collection sits = Lists.newArrayList(); + + for (final Long situationId : situationTrigger.getSituationIds()) { + final Situation situation = this.instanceService.getSituation(situationId); + sits.add(situation); + } + + ServiceTemplateInstance serviceInstance; + try { + serviceInstance = this.instanceService.getServiceTemplateInstance(situationTrigger.getServiceInstanceId(), false); + } catch (final NotFoundException e) { + serviceInstance = null; + } + NodeTemplateInstance nodeInstance = null; + if (situationTrigger.getNodeInstanceId() != null) { + nodeInstance = this.instanceService.getNodeTemplateInstance(situationTrigger.getNodeInstanceId()); + } + + final Set inputs = Sets.newHashSet(); + + float eventProbability = -1.0f; + if (Float.compare(situationTrigger.getEventProbability(), eventProbability) != 0) { + eventProbability = situationTrigger.getEventProbability(); + } + + String eventTime = null; + if (situationTrigger.getEventTime() != null) { + eventTime = situationTrigger.getEventTime(); + } + + situationTrigger.getInputParams() + .forEach(x -> inputs.add(new SituationTriggerProperty(x.getName(), x.getValue(), x.getType()))); + + final SituationTrigger sitTrig = this.instanceService.createNewSituationTrigger(sits, csarService.findById(new CsarId(situationTrigger.getCsarId())).id(), + situationTrigger.isOnActivation(), situationTrigger.isSingleInstance(), serviceInstance, nodeInstance, + situationTrigger.getInterfaceName(), situationTrigger.getOperationName(), inputs, eventProbability, eventTime); + + final URI instanceURI = UriUtil.generateSubResourceURI(this.uriInfo, sitTrig.getId().toString(), false); + return Response.ok(instanceURI).build(); + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Path("/triggers/{situationtrigger}") + public Response getSituationTrigger(@PathParam("situationtrigger") final Long situationTriggerId) { + return Response + .ok(SituationTriggerDTO.Converter.convert(this.instanceService.getSituationTrigger(situationTriggerId))) + .build(); + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @Path("/triggers/{situationtrigger}/{situationtriggerinstance}") + public Response getSituationTriggerInstance(@PathParam("situationtrigger") final Long situationTriggerId, + @PathParam("situationtriggerinstance") final Long situationTriggerInstanceId) { + return Response + .ok(SituationTriggerInstanceDTO.Converter.convert(this.instanceService.getSituationTriggerInstance(situationTriggerInstanceId))) + .build(); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/content/DirectoryController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/content/DirectoryController.java new file mode 100644 index 000000000..d537da1bc --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/content/DirectoryController.java @@ -0,0 +1,80 @@ +package org.opentosca.container.api.controller.content; + +import java.util.Objects; + +import javax.ws.rs.GET; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import org.opentosca.container.api.dto.ResourceSupport; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.AbstractDirectory; +import org.opentosca.container.core.model.AbstractFile; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DirectoryController { + + private static Logger logger = LoggerFactory.getLogger(DirectoryController.class); + + private final AbstractDirectory directory; + + public DirectoryController(final AbstractDirectory directory) { + Objects.nonNull(directory); + this.directory = directory; + logger.debug("Directory path: {}", directory.getPath()); + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response getLinks(@Context final UriInfo uriInfo, @QueryParam("recursive") String recursive) { + logger.debug("Get links for directory controller on directory: {} with recursive flag: {}", directory.getPath(), recursive); + final ResourceSupport dto = new ResourceSupport(); + if (recursive == null) { + for (final AbstractDirectory directory : this.directory.getDirectories()) { + logger.debug("Found sub directory: {}", directory.getName()); + dto.add(UriUtil.generateSubResourceLink(uriInfo, directory.getName(), true, directory.getName())); + } + for (final AbstractFile file : this.directory.getFiles()) { + dto.add(UriUtil.generateSubResourceLink(uriInfo, file.getName(), true, file.getName())); + } + } else { + for (final AbstractFile file : this.directory.getFilesRecursively()) { + dto.add(UriUtil.generateSubResourceLink(uriInfo, file.getPath(), true, file.getName())); + } + } + + dto.add(UriUtil.generateSelfLink(uriInfo)); + return Response.ok(dto).build(); + } + + @Path("/{path}") + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Object getPath(@PathParam("path") String path, @Context final UriInfo uriInfo) { + logger.debug("Serve path '{}' of directory '{}'", path, this.directory.getPath()); + for (final AbstractDirectory directory : this.directory.getDirectories()) { + logger.debug("Found directory: {}", directory.getName()); + if (directory.getName().equals(path)) { + logger.debug("Path '{}' is a directory...", path); + return new DirectoryController(directory); + } + } + for (final AbstractFile file : this.directory.getFiles()) { + if (file.getName().equals(path)) { + logger.debug("Path '{}' is a file...", path); + return new FileController(file); + } + } + logger.warn("Path '{}' does not exist in directory '{}'", path, this.directory.getPath()); + + throw new NotFoundException( + String.format("Path '%s' does not exist in directory '%s'", path, this.directory.getPath())); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/content/FileController.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/content/FileController.java new file mode 100644 index 000000000..021498971 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/controller/content/FileController.java @@ -0,0 +1,75 @@ +package org.opentosca.container.api.controller.content; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import javax.ws.rs.GET; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import org.apache.commons.io.FilenameUtils; +import org.opentosca.container.api.dto.ResourceSupport; +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.AbstractFile; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class FileController { + + private static Logger logger = LoggerFactory.getLogger(FileController.class); + private static final Map IMAGE_TYPES = new HashMap<>(); + + static { + IMAGE_TYPES.put("png", MediaType.valueOf("image/png")); + IMAGE_TYPES.put("jpg", MediaType.valueOf("image/jpeg")); + IMAGE_TYPES.put("jpeg", MediaType.valueOf("image/jpeg")); + IMAGE_TYPES.put("gif", MediaType.valueOf("image/gif")); + } + + private final AbstractFile file; + + public FileController(final AbstractFile file) { + Objects.nonNull(file); + this.file = file; + logger.debug("File path: {}", file.getPath()); + } + + @GET + @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public Response getLinks(@Context final UriInfo uriInfo) { + logger.debug("Get link for file controller on file: {}", file.getPath()); + final ResourceSupport dto = new ResourceSupport(); + + dto.add(UriUtil.generateSelfLink(uriInfo)); + return Response.ok(dto).build(); + } + + @GET + @Produces( {MediaType.APPLICATION_OCTET_STREAM, "image/*"}) + public Response getFile() { + logger.info("Attempt to get file: \"{}\"", this.file.getPath()); + try { + final InputStream is = this.file.getFileAsInputStream(); + // Image or normal file download? + final String ext = FilenameUtils.getExtension(this.file.getName()); + final MediaType imageType = IMAGE_TYPES.get(ext); + if (imageType != null) { + // Serve the image + return Response.ok(is, imageType).build(); + } else { + // ... download the file + return Response.ok(is) + .header("Content-Disposition", "attachment; filename=\"" + this.file.getName() + "\"") + .build(); + } + } catch (final Exception e) { + logger.error("Could not get file: {}", e.getMessage(), e); + return Response.serverError().build(); + } + } +} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/CsarDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/CsarDTO.java similarity index 90% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/CsarDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/CsarDTO.java index edaa37569..dbfc8a7ee 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/CsarDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/CsarDTO.java @@ -4,6 +4,8 @@ import java.util.Arrays; import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; @@ -12,34 +14,53 @@ import org.eclipse.winery.model.selfservice.Application; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSetter; - +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "Csar") +@XmlAccessorType(XmlAccessType.FIELD) @JsonIgnoreProperties(ignoreUnknown = true) public class CsarDTO extends ResourceSupport { + @JsonProperty + @XmlAttribute private String id; + @JsonProperty + @XmlElement(name = "Name") private String name; + @JsonProperty + @ApiModelProperty(name = "display_name") + @XmlElement(name = "DisplayName") private String displayName; + @JsonProperty + @XmlElement(name = "Version") private String version; + @JsonProperty + @XmlElement(name = "Author") + @XmlElementWrapper(name = "Authors") private List authors; + @JsonProperty + @XmlElement(name = "Description") private String description; + @JsonProperty + @ApiModelProperty(name = "icon_url") + @XmlElement(name = "IconUrl") private String iconUrl; + @JsonProperty + @ApiModelProperty(name = "image_url") + @XmlElement(name = "ImageUrl") private String imageUrl; + public CsarDTO() { + } - public CsarDTO() {} - - @XmlAttribute public String getId() { return this.id; } @@ -48,18 +69,14 @@ public void setId(final String id) { this.id = id; } - @XmlElement(name = "Name") public String getName() { return this.name; } - @JsonSetter public void setName(final String name) { this.name = name; } - @ApiModelProperty(name = "display_name") - @XmlElement(name = "DisplayName") public String getDisplayName() { return this.displayName; } @@ -68,7 +85,6 @@ public void setDisplayName(final String displayName) { this.displayName = displayName; } - @XmlElement(name = "Version") public String getVersion() { return this.version; } @@ -77,7 +93,6 @@ public void setVersion(final String version) { this.version = version; } - @XmlElement(name = "Description") public String getDescription() { return this.description; } @@ -86,8 +101,6 @@ public void setDescription(final String description) { this.description = description; } - @ApiModelProperty(name = "icon_url") - @XmlElement(name = "IconUrl") public String getIconUrl() { return this.iconUrl; } @@ -96,8 +109,6 @@ public void setIconUrl(final String iconUrl) { this.iconUrl = iconUrl; } - @ApiModelProperty(name = "image_url") - @XmlElement(name = "ImageUrl") public String getImageUrl() { return this.imageUrl; } @@ -106,8 +117,6 @@ public void setImageUrl(final String imageUrl) { this.imageUrl = imageUrl; } - @XmlElement(name = "Author") - @XmlElementWrapper(name = "Authors") public List getAuthors() { return this.authors; } @@ -123,7 +132,6 @@ public void addAuthors(final String... authors) { this.authors.addAll(Arrays.asList(authors)); } - public static final class Converter { public static CsarDTO convert(final Application object) { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/CsarListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/CsarListDTO.java similarity index 86% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/CsarListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/CsarListDTO.java index d6a8fb84f..05734e9ec 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/CsarListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/CsarListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -8,7 +9,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; @XmlRootElement(name = "CsarResources") public class CsarListDTO extends ResourceSupport { @@ -16,8 +16,7 @@ public class CsarListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "Csar") @XmlElementWrapper(name = "Csars") - private final List csars = Lists.newArrayList(); - + private final List csars = new ArrayList<>(); public List getCsars() { return this.csars; diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeOperationDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeOperationDTO.java similarity index 97% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeOperationDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeOperationDTO.java index 6fb7bcef4..337d3baeb 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeOperationDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeOperationDTO.java @@ -9,13 +9,12 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.core.tosca.extension.TParameter; -import org.opentosca.container.core.tosca.model.TExportedOperation; +import org.eclipse.winery.model.tosca.TExportedOperation; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.core.tosca.extension.TParameter; @XmlRootElement(name = "NodeOperation") @XmlAccessorType(XmlAccessType.FIELD) @@ -36,22 +35,22 @@ public class NodeOperationDTO { @XmlElementWrapper(name = "OutputParameters") private List outputParameters = Lists.newArrayList(); - public void setName(final String name) { - this.name = name; - } - public String getName() { return this.name; } - public void setInterfaceName(final String interfaceName) { - this.interfaceName = interfaceName; + public void setName(final String name) { + this.name = name; } public String getInterfaceName() { return this.interfaceName; } + public void setInterfaceName(final String interfaceName) { + this.interfaceName = interfaceName; + } + @ApiModelProperty(name = "input_parameters") public List getInputParameters() { return this.inputParameters; @@ -94,5 +93,4 @@ public static TExportedOperation.NodeOperation convert(final NodeOperationDTO dt return o; } } - } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateDTO.java index e20c62a27..f9f4c55d1 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateDTO.java @@ -6,11 +6,9 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.boundarydefinitions.InterfaceListDTO; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.api.dto.boundarydefinitions.InterfaceListDTO; @XmlRootElement(name = "NodeTemplate") @XmlAccessorType(XmlAccessType.FIELD) @@ -61,5 +59,4 @@ public InterfaceListDTO getInterfaces() { public void setInterfaces(final InterfaceListDTO interfaces) { this.interfaces = interfaces; } - } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateInstanceDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateInstanceDTO.java similarity index 98% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateInstanceDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateInstanceDTO.java index 71b01f449..9b8604a3d 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateInstanceDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateInstanceDTO.java @@ -8,12 +8,10 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstanceState; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstanceState; @XmlRootElement(name = "NodeTemplateInstance") @XmlAccessorType(XmlAccessType.FIELD) @@ -120,7 +118,7 @@ public static NodeTemplateInstanceDTO convert(final NodeTemplateInstance object) final NodeTemplateInstanceDTO dto = new NodeTemplateInstanceDTO(); dto.setId(object.getId()); - dto.setNodeTemplateId(object.getTemplateId().getLocalPart()); + dto.setNodeTemplateId(object.getTemplateId()); dto.setNodeTemplateType(object.getTemplateType().toString()); dto.setCreatedAt(object.getCreatedAt()); dto.setState(object.getState()); diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateInstanceListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateInstanceListDTO.java similarity index 93% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateInstanceListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateInstanceListDTO.java index aa9078ed7..8ef7a644f 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateInstanceListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateInstanceListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -8,8 +9,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "NodeTemplateInstanceResources") @@ -18,8 +17,7 @@ public class NodeTemplateInstanceListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "NodeTemplateInstance") @XmlElementWrapper(name = "NodeTemplateInstances") - private final List nodeTemplateInstances = Lists.newArrayList(); - + private final List nodeTemplateInstances = new ArrayList<>(); @ApiModelProperty(name = "node_template_instances") public List getNodeTemplateInstances() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateListDTO.java similarity index 87% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateListDTO.java index 0f3c584b4..d4c7636ee 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/NodeTemplateListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/NodeTemplateListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -8,8 +9,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "NodeTemplateResources") @@ -18,8 +17,7 @@ public class NodeTemplateListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "NodeTemplate") @XmlElementWrapper(name = "NodeTemplates") - private final List nodeTemplates = Lists.newArrayList(); - + private final List nodeTemplates = new ArrayList<>(); @ApiModelProperty(name = "node_templates") public List getNodeTemplates() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/PropertyDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/PropertyDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/PropertyDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/PropertyDTO.java index 726d1c064..9d5b1b2e7 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/PropertyDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/PropertyDTO.java @@ -3,9 +3,8 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlTransient; -import org.opentosca.container.core.next.model.Property; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import org.opentosca.container.core.next.model.Property; @XmlTransient @JsonIgnoreProperties(ignoreUnknown = true) @@ -18,7 +17,6 @@ public class PropertyDTO { @XmlElement(name = "Type") private String type; - public String getName() { return this.name; } @@ -58,6 +56,5 @@ public static void fillValues(final Property object, final PropertyDTO empty) { empty.setType(object.getType()); empty.setValue(object.getValue()); } - } } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateDTO.java similarity index 76% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateDTO.java index dfe7701dc..740ee8810 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateDTO.java @@ -6,8 +6,9 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import org.eclipse.winery.model.tosca.TRelationshipTemplate; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "RelationshipTemplate") @@ -48,4 +49,12 @@ public String getRelationshipType() { public void setRelationshipType(final String relationshipType) { this.relationshipType = relationshipType; } + + public static RelationshipTemplateDTO fromToscaObject(TRelationshipTemplate toscaObject) { + RelationshipTemplateDTO dto = new RelationshipTemplateDTO(); + dto.id = toscaObject.getId(); + dto.name = toscaObject.getName(); + dto.relationshipType = toscaObject.getType().toString(); + return dto; + } } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateInstanceDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateInstanceDTO.java similarity index 98% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateInstanceDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateInstanceDTO.java index 7f5894adf..2be1b317e 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateInstanceDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateInstanceDTO.java @@ -8,12 +8,10 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.next.model.RelationshipTemplateInstanceState; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.next.model.RelationshipTemplateInstanceState; @XmlRootElement(name = "RelationshipTemplateInstance") @XmlAccessorType(XmlAccessType.FIELD) @@ -132,11 +130,11 @@ public static RelationshipTemplateInstanceDTO convert(final RelationshipTemplate final RelationshipTemplateInstanceDTO dto = new RelationshipTemplateInstanceDTO(); dto.setId(object.getId()); - dto.setRelationshipTemplateId(object.getTemplateId().getLocalPart()); + dto.setRelationshipTemplateId(object.getTemplateId()); dto.setRelationshipTemplateType(object.getTemplateType().toString()); dto.setCreatedAt(object.getCreatedAt()); dto.setState(object.getState()); - dto.setServiceTemplateId(object.getSource().getServiceTemplateInstance().getTemplateId().toString()); + dto.setServiceTemplateId(object.getSource().getServiceTemplateInstance().getTemplateId()); dto.setCsarId(object.getSource().getServiceTemplateInstance().getCsarId().toString()); dto.setSourceNodeTemplateInstanceId(object.getSource().getId()); dto.setTargetNodeTemplateInstanceId(object.getTarget().getId()); diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateInstanceListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateInstanceListDTO.java similarity index 92% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateInstanceListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateInstanceListDTO.java index 2009f1579..f9b877b9c 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateInstanceListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateInstanceListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -8,8 +9,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "RelationshipTemplateInstanceResources") @@ -18,8 +17,7 @@ public class RelationshipTemplateInstanceListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "RelationshipTemplateInstance") @XmlElementWrapper(name = "RelationshipTemplateInstances") - private final List relationshipTemplateInstances = Lists.newArrayList(); - + private final List relationshipTemplateInstances = new ArrayList<>(); @ApiModelProperty(name = "relationship_template_instances") public List getRelationshipTemplateInstances() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateListDTO.java similarity index 93% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateListDTO.java index 80d48a5e7..c81fd97b1 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/RelationshipTemplateListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/RelationshipTemplateListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -8,8 +9,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "RelationshipTemplateResources") @@ -18,8 +17,7 @@ public class RelationshipTemplateListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "RelationshipTemplate") @XmlElementWrapper(name = "RelationshipTemplate") - private final List relationshipTemplates = Lists.newArrayList(); - + private final List relationshipTemplates = new ArrayList<>(); @ApiModelProperty(name = "relationship_templates") public List getRelationshipTemplates() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ResourceDecorator.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ResourceDecorator.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/ResourceDecorator.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ResourceDecorator.java index f32c32d47..17a04934a 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ResourceDecorator.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ResourceDecorator.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; - import io.swagger.annotations.ApiModelProperty; @JsonInclude(JsonInclude.Include.NON_NULL) diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ResourceSupport.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ResourceSupport.java similarity index 96% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/ResourceSupport.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ResourceSupport.java index a92fe7cd3..b5740f067 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ResourceSupport.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ResourceSupport.java @@ -12,44 +12,44 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.annotation.JsonSerialize; - import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "Resources") +@JsonInclude(JsonInclude.Include.NON_EMPTY) public class ResourceSupport { @ApiModelProperty(hidden = true) @JsonSerialize(using = LinksSerializer.class) private final List links = new ArrayList<>(); - public ResourceSupport() { } /** * Returns all {@link Link}s contained in this resource. - * - * @return */ @XmlElement(name = "Link") @XmlElementWrapper(name = "Links") @XmlJavaTypeAdapter(Link.JaxbAdapter.class) @JsonProperty("_links") public List getLinks() { + if (links.isEmpty()) { + return null; + } + return this.links; } /** * Adds the given link to the resource. - * - * @param link */ public void add(final Link link) { Objects.requireNonNull(link, "Link must not be null!"); @@ -58,8 +58,6 @@ public void add(final Link link) { /** * Adds all given {@link Link}s to the resource. - * - * @param links */ public void add(final Iterable links) { Objects.requireNonNull(links, "Given links must not be null!"); @@ -80,8 +78,6 @@ public void add(final Link... links) { /** * Returns whether the resource contains {@link Link}s at all. - * - * @return */ public boolean hasLinks() { return !this.links.isEmpty(); @@ -89,9 +85,6 @@ public boolean hasLinks() { /** * Returns whether the resource contains a {@link Link} with the given rel. - * - * @param rel - * @return */ public boolean hasLink(final String rel) { return getLink(rel) != null; @@ -107,7 +100,6 @@ public void removeLinks() { /** * Returns the link with the given rel. * - * @param rel * @return the link with the given rel or {@literal null} if none found. */ public Link getLink(final String rel) { @@ -139,7 +131,6 @@ public String toString() { return String.format("links: %s", this.links.toString()); } - public static class LinksSerializer extends JsonSerializer> { @Override @@ -157,12 +148,11 @@ public void serialize(final List links, final JsonGenerator json, } } - public static class LinkSerializer extends JsonSerializer { @Override public void serialize(final Link link, final JsonGenerator json, - final SerializerProvider provider) throws IOException, JsonProcessingException { + final SerializerProvider provider) throws IOException { if (link.getUri() == null || link.getRel() == null || link.getRel().isEmpty()) { return; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateDTO.java index edc47b657..db86cd99e 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateDTO.java @@ -14,7 +14,6 @@ public class ServiceTemplateDTO extends ResourceSupport { private String name; - public ServiceTemplateDTO() { } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateInstanceDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateInstanceDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateInstanceDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateInstanceDTO.java index c109d4f54..877360a8b 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateInstanceDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateInstanceDTO.java @@ -6,12 +6,10 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; @XmlRootElement(name = "ServiceTemplateInstance") @JsonIgnoreProperties(ignoreUnknown = true) @@ -27,7 +25,6 @@ public class ServiceTemplateInstanceDTO extends ResourceSupport { private ServiceTemplateInstanceState state; - @XmlAttribute public Long getId() { return this.id; diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateInstanceListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateInstanceListDTO.java similarity index 92% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateInstanceListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateInstanceListDTO.java index 043b6a5c7..d644326aa 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateInstanceListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateInstanceListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -8,8 +9,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "ServiceTemplateInstanceResources") @@ -18,8 +17,7 @@ public class ServiceTemplateInstanceListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "ServiceTemplateInstance") @XmlElementWrapper(name = "ServiceTemplateInstances") - private final List serviceTemplateInstances = Lists.newArrayList(); - + private final List serviceTemplateInstances = new ArrayList<>(); @ApiModelProperty(name = "service_template_instances") public List getServiceTemplateInstances() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateListDTO.java similarity index 87% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateListDTO.java index 4f3533583..1c4df2943 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/ServiceTemplateListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/ServiceTemplateListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -8,8 +9,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "ServiceTemplateResources") @@ -18,8 +17,7 @@ public class ServiceTemplateListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "ServiceTemplate") @XmlElementWrapper(name = "ServiceTemplates") - private final List serviceTemplates = Lists.newArrayList(); - + private final List serviceTemplates = new ArrayList<>(); @ApiModelProperty(name = "service_templates") public List getServiceTemplates() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/InterfaceDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/InterfaceDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/InterfaceDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/InterfaceDTO.java index 86819a3af..06e2d0461 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/InterfaceDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/InterfaceDTO.java @@ -16,7 +16,6 @@ public class InterfaceDTO extends ResourceSupport { private Map operations; - @XmlAttribute public String getName() { return this.name; diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/InterfaceListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/InterfaceListDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/InterfaceListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/InterfaceListDTO.java index 33e51c2d4..c3f49cd29 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/InterfaceListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/InterfaceListDTO.java @@ -8,9 +8,8 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; - import com.fasterxml.jackson.annotation.JsonProperty; +import org.opentosca.container.api.dto.ResourceSupport; @XmlRootElement(name = "InterfaceResources") public class InterfaceListDTO extends ResourceSupport { @@ -20,7 +19,6 @@ public class InterfaceListDTO extends ResourceSupport { @XmlElementWrapper(name = "Interfaces") private final List interfaces = new ArrayList<>(); - public List getInterfaces() { return this.interfaces; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/OperationDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/OperationDTO.java similarity index 96% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/OperationDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/OperationDTO.java index 04a48b15f..9bb316c9b 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/OperationDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/OperationDTO.java @@ -5,16 +5,15 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.NodeOperationDTO; -import org.opentosca.container.api.dto.ResourceSupport; -import org.opentosca.container.api.dto.plan.PlanDTO; -import org.opentosca.container.core.tosca.model.TExportedOperation; +import org.eclipse.winery.model.tosca.TExportedOperation; import com.fasterxml.jackson.annotation.JsonIgnore; - import dk.nykredit.jackson.dataformat.hal.annotation.EmbeddedResource; import dk.nykredit.jackson.dataformat.hal.annotation.Resource; import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.api.dto.NodeOperationDTO; +import org.opentosca.container.api.dto.ResourceSupport; +import org.opentosca.container.api.dto.plan.PlanDTO; @Resource @XmlRootElement(name = "Operation") @@ -36,7 +35,6 @@ public class OperationDTO extends ResourceSupport { @EmbeddedResource private PlanDTO plan; - public String getName() { return this.name; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/PropertiesDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/PropertiesDTO.java similarity index 86% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/PropertiesDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/PropertiesDTO.java index ca8e1de56..6c2f6679a 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/PropertiesDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/PropertiesDTO.java @@ -9,12 +9,9 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.api.dto.ResourceSupport; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "Properties") @@ -22,20 +19,18 @@ public class PropertiesDTO extends ResourceSupport { /** - * Represents the xml fragment contained in BoundaryDefinitions.Properties which is supposed to - * describe global ST properties. + * Represents the xml fragment contained in BoundaryDefinitions.Properties which is supposed to describe global ST + * properties. */ @XmlAnyElement(lax = true) private Object xmlFragment; /** - * Represents the mapping of the ST properties to values derived from ST sub-elements, e.g., - * NodeTemplates. + * Represents the mapping of the ST properties to values derived from ST sub-elements, e.g., NodeTemplates. */ @XmlElement(name = "PropertyMapping") @XmlElementWrapper(name = "PropertyMappings") - private List propertyMappings = Lists.newArrayList(); - + private List propertyMappings; public PropertiesDTO() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/PropertyMappingDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/PropertyMappingDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/PropertyMappingDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/PropertyMappingDTO.java index 1f6027cd9..bed558f85 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/boundarydefinitions/PropertyMappingDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/boundarydefinitions/PropertyMappingDTO.java @@ -6,7 +6,6 @@ import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - import io.swagger.annotations.ApiModelProperty; @XmlAccessorType(XmlAccessType.FIELD) diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanDTO.java similarity index 91% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanDTO.java index 2cbc4f8fb..ca53805c1 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto.plan; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -11,17 +12,14 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.namespace.QName; +import org.eclipse.winery.model.tosca.TPlan; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.annotations.ApiModelProperty; import org.opentosca.container.api.dto.ResourceSupport; import org.opentosca.container.core.tosca.extension.TParameter; import org.opentosca.container.core.tosca.extension.TParameterDTO; import org.opentosca.container.core.tosca.extension.TPlanDTO; -import org.opentosca.container.core.tosca.model.TBoolean; -import org.opentosca.container.core.tosca.model.TPlan; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.google.common.collect.Lists; - -import io.swagger.annotations.ApiModelProperty; @XmlRootElement(name = "Plan") @XmlAccessorType(XmlAccessType.FIELD) @@ -42,11 +40,11 @@ public class PlanDTO extends ResourceSupport { @XmlElement(name = "InputParameter") @XmlElementWrapper(name = "InputParameters") - private List inputParameters = Lists.newArrayList(); + private List inputParameters = new ArrayList<>(); @XmlElement(name = "OutputParameter") @XmlElementWrapper(name = "OutputParameters") - private List outputParameters = Lists.newArrayList(); + private List outputParameters = new ArrayList<>(); @XmlElement(name = "PlanModelReference") private String planModelReference; @@ -64,11 +62,11 @@ public PlanDTO(final TPlan plan) { this.planType = plan.getPlanType(); this.planLanguage = plan.getPlanLanguage(); this.inputParameters.addAll(plan.getInputParameters().getInputParameter().stream().map(p -> new TParameter(p)) - .collect(Collectors.toList())); + .collect(Collectors.toList())); this.outputParameters.addAll(plan.getOutputParameters().getOutputParameter().stream() - .map(p -> new TParameter(p)).collect(Collectors.toList())); + .map(p -> new TParameter(p)).collect(Collectors.toList())); this.planModelReference = plan.getPlanModelReference().getReference(); - this.calculatedWCET = plan.getCalculatedWCET(); + this.calculatedWCET = Long.valueOf(plan.getOtherAttributes().getOrDefault(new QName("http://opentosca.org", "WCET"), "0")); } public String getId() { @@ -150,7 +148,7 @@ public static TPlanDTO convert(final PlanDTO object) { plan.setName(object.getName()); plan.setPlanLanguage(object.getPlanLanguage()); plan.setPlanType(object.getPlanType()); - plan.setCalculatedWCET(object.getCalculatedWCET()); + plan.setCalculatedWCET(object.getCalculatedWCET()); final TPlanDTO.InputParameters inputParameters = new TPlanDTO.InputParameters(); for (final TParameter param : object.getInputParameters()) { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceDTO.java similarity index 95% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceDTO.java index 1c5dde3d3..3224edf5f 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto.plan; +import java.util.ArrayList; import java.util.Collection; import javax.xml.bind.annotation.XmlAccessType; @@ -10,6 +11,8 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import io.swagger.annotations.ApiModelProperty; import org.opentosca.container.api.dto.ResourceSupport; import org.opentosca.container.core.next.model.PlanInstance; import org.opentosca.container.core.next.model.PlanInstanceEvent; @@ -18,11 +21,6 @@ import org.opentosca.container.core.next.model.PlanInstanceState; import org.opentosca.container.core.next.model.PlanType; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.google.common.collect.Lists; - -import io.swagger.annotations.ApiModelProperty; - @XmlRootElement(name = "PlanInstance") @XmlAccessorType(XmlAccessType.FIELD) @JsonIgnoreProperties(ignoreUnknown = true) @@ -52,7 +50,6 @@ public class PlanInstanceDTO extends ResourceSupport { @XmlElementWrapper(name = "Logs") private Collection logs; - @ApiModelProperty(name = "correlation_id") public String getCorrelationId() { return this.correlationId; @@ -82,7 +79,6 @@ public void setInputs(final Collection inputs) { this.inputs = inputs; } - public PlanInstanceState getState() { return this.state; } @@ -112,7 +108,6 @@ public void setServiceTemplateInstanceId(final Long serviceTemplateInstanceId) { this.serviceTemplateInstanceId = serviceTemplateInstanceId; } - public static final class Converter { public static PlanInstanceDTO convert(final PlanInstance object) { @@ -123,11 +118,11 @@ public static PlanInstanceDTO convert(final PlanInstance object) { dto.setServiceTemplateInstanceId(object.getServiceTemplateInstance().getId()); dto.setType(object.getType()); - dto.setLogs(Lists.newArrayList()); - dto.setOutputs(Lists.newArrayList()); + dto.setLogs(new ArrayList<>()); + dto.setOutputs(new ArrayList<>()); dto.setState(object.getState()); - dto.setInputs(Lists.newArrayList()); + dto.setInputs(new ArrayList<>()); for (final PlanInstanceInput output : object.getInputs()) { dto.getInputs().add(PlanInstanceInputDTO.Converter.convert(output)); @@ -140,8 +135,6 @@ public static PlanInstanceDTO convert(final PlanInstance object) { for (final PlanInstanceOutput output : object.getOutputs()) { dto.getOutputs().add(PlanInstanceOutputDTO.Converter.convert(output)); } - - return dto; } } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceEventDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceEventDTO.java similarity index 93% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceEventDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceEventDTO.java index 466936f55..8b5bf7867 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceEventDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceEventDTO.java @@ -8,9 +8,8 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.core.next.model.PlanInstanceEvent; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import org.opentosca.container.core.next.model.PlanInstanceEvent; @XmlRootElement(name = "PlanInstanceEvent") @XmlAccessorType(XmlAccessType.FIELD) @@ -48,16 +47,16 @@ public Date getStartTimestamp() { return this.startTimestamp; } - public void setStartTimestamp(final Date timestamp) { - this.startTimestamp = timestamp; + public void setStartTimestamp(final Date startTimestamp) { + this.startTimestamp = startTimestamp; } public Date getEndTimestamp() { - return this.endTimestamp; + return endTimestamp; } - public void setEndTimestamp(final Date timestamp) { - this.endTimestamp = timestamp; + public void setEndTimestamp(Date endTimestamp) { + this.endTimestamp = endTimestamp; } public String getStatus() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceEventListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceEventListDTO.java similarity index 94% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceEventListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceEventListDTO.java index 338c9d4c4..87d7a71e3 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceEventListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceEventListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto.plan; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -8,12 +9,9 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; - import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.api.dto.ResourceSupport; @XmlRootElement(name = "PlanInstnaceEventResources") public class PlanInstanceEventListDTO extends ResourceSupport { @@ -21,8 +19,7 @@ public class PlanInstanceEventListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "PlanInstnaceEvent") @XmlElementWrapper(name = "PlanInstnaceEvents") - private final List planInstanceEvents = Lists.newArrayList(); - + private final List planInstanceEvents = new ArrayList<>(); public PlanInstanceEventListDTO() { @@ -40,5 +37,4 @@ public List getPlanInstanceEvents() { public void add(final PlanInstanceEventDTO... planInstanceEvents) { this.planInstanceEvents.addAll(Arrays.asList(planInstanceEvents)); } - } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceInputDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceInputDTO.java similarity index 100% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceInputDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceInputDTO.java diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceListDTO.java similarity index 89% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceListDTO.java index ede911129..8902945f1 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto.plan; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -8,12 +9,9 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; - import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.api.dto.ResourceSupport; @XmlRootElement(name = "PlanInstanceResources") public class PlanInstanceListDTO extends ResourceSupport { @@ -21,8 +19,7 @@ public class PlanInstanceListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "PlanInstance") @XmlElementWrapper(name = "PlanInstances") - private final List planInstances = Lists.newArrayList(); - + private final List planInstances = new ArrayList<>(); @ApiModelProperty(name = "plan_instances") public List getPlanInstances() { diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceOutputDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceOutputDTO.java similarity index 100% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanInstanceOutputDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanInstanceOutputDTO.java diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanListDTO.java similarity index 88% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanListDTO.java index 05a6bdb58..5174df22f 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/plan/PlanListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/plan/PlanListDTO.java @@ -1,5 +1,6 @@ package org.opentosca.container.api.dto.plan; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -8,10 +9,8 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; - import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; +import org.opentosca.container.api.dto.ResourceSupport; @XmlRootElement(name = "PlanResources") public class PlanListDTO extends ResourceSupport { @@ -19,8 +18,7 @@ public class PlanListDTO extends ResourceSupport { @JsonProperty @XmlElement(name = "Plan") @XmlElementWrapper(name = "Plans") - private final List plans = Lists.newArrayList(); - + private final List plans = new ArrayList<>(); public List getPlans() { return this.plans; diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CreatePlanInstanceLogEntryRequest.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CreatePlanInstanceLogEntryRequest.java similarity index 100% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CreatePlanInstanceLogEntryRequest.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CreatePlanInstanceLogEntryRequest.java diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CreateRelationshipTemplateInstanceRequest.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CreateRelationshipTemplateInstanceRequest.java similarity index 91% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CreateRelationshipTemplateInstanceRequest.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CreateRelationshipTemplateInstanceRequest.java index a2b906e02..943c25767 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CreateRelationshipTemplateInstanceRequest.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CreateRelationshipTemplateInstanceRequest.java @@ -11,10 +11,10 @@ @XmlAccessorType(XmlAccessType.FIELD) @JsonIgnoreProperties(ignoreUnknown = true) public class CreateRelationshipTemplateInstanceRequest { - + @XmlAttribute(name = "service-instance-id") private Long serviceInstanceId; - + @XmlAttribute(name = "source-instance-id") private Long sourceNodeTemplateInstanceId; @@ -22,13 +22,13 @@ public class CreateRelationshipTemplateInstanceRequest { private Long targetNodeTemplateInstanceId; public Long getServiceInstanceId() { - return this.serviceInstanceId; + return serviceInstanceId; } - - public void setServiceInstanceId(final Long serviceInstanceId) { + + public void setServiceInstanceId(Long serviceInstanceId) { this.serviceInstanceId = serviceInstanceId; } - + public Long getSourceNodeTemplateInstanceId() { return this.sourceNodeTemplateInstanceId; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequest.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequest.java similarity index 100% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequest.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequest.java diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CsarTransformRequest.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CsarTransformRequest.java similarity index 83% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CsarTransformRequest.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CsarTransformRequest.java index 33818bc97..6c0d695f3 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CsarTransformRequest.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CsarTransformRequest.java @@ -12,20 +12,20 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class CsarTransformRequest { - @XmlElement(name = "SourceCsarName") - private String sourceCsarName; - + @XmlElement(name = "SourceCsarName") + private String sourceCsarName; + @XmlElement(name = "TargetCsarName") private String targetCsarName; public String getSourceCsarName() { - return this.sourceCsarName; + return this.sourceCsarName; } - + public void setSourceCsarName(final String sourceCsarName) { - this.sourceCsarName = sourceCsarName; + this.sourceCsarName = sourceCsarName; } - + public String getTargetCsarName() { return this.targetCsarName; } @@ -33,6 +33,4 @@ public String getTargetCsarName() { public void setTargetCsarName(final String targetCsarName) { this.targetCsarName = targetCsarName; } - - } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CsarUploadRequest.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CsarUploadRequest.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CsarUploadRequest.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CsarUploadRequest.java index 8c5d6bf7e..95220bf00 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/CsarUploadRequest.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/CsarUploadRequest.java @@ -21,7 +21,6 @@ public class CsarUploadRequest { @XmlElement(name = "Enrich") private String enrich; - public String getName() { return this.name; } @@ -38,7 +37,6 @@ public void setUrl(final String url) { this.url = url; } - public String getEnrich() { return this.enrich; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/ServiceTransformRequest.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/ServiceTransformRequest.java similarity index 96% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/request/ServiceTransformRequest.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/ServiceTransformRequest.java index 6433805c7..bf79d456b 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/ServiceTransformRequest.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/ServiceTransformRequest.java @@ -9,8 +9,6 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.situations.SituationDTO; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Lists; @@ -19,13 +17,12 @@ @XmlAccessorType(XmlAccessType.FIELD) @JsonIgnoreProperties(ignoreUnknown = true) public class ServiceTransformRequest { - + @JsonProperty @XmlElement(name = "NodeTemplate") @XmlElementWrapper(name = "SourceNodeTemplates") private final List sourceNodeTemplates = Lists.newArrayList(); - public List getSourceNodeTemplates() { return this.sourceNodeTemplates; } @@ -33,13 +30,12 @@ public List getSourceNodeTemplates() { public void addSourceNodeTemplates(final String... nodeTemplates) { this.sourceNodeTemplates.addAll(Arrays.asList(nodeTemplates)); } - + @JsonProperty @XmlElement(name = "RelationshipTemplate") @XmlElementWrapper(name = "SourceRelationshipTemplates") private final List sourceRelationshipTemplates = Lists.newArrayList(); - public List getSourceRelationshipTemplates() { return this.sourceRelationshipTemplates; } @@ -47,13 +43,12 @@ public List getSourceRelationshipTemplates() { public void addSourceRelationshipTemplates(final String... relationshipTemplates) { this.sourceRelationshipTemplates.addAll(Arrays.asList(relationshipTemplates)); } - + @JsonProperty @XmlElement(name = "NodeTemplate") @XmlElementWrapper(name = "TargetNodeTemplates") private final List targetNodeTemplates = Lists.newArrayList(); - public List getTargetNodeTemplates() { return this.targetNodeTemplates; } @@ -61,13 +56,12 @@ public List getTargetNodeTemplates() { public void addTargetNodeTemplates(final String... nodeTemplates) { this.targetNodeTemplates.addAll(Arrays.asList(nodeTemplates)); } - + @JsonProperty @XmlElement(name = "RelationshipTemplate") @XmlElementWrapper(name = "TargetRelationshipTemplates") private final List targetRelationshipTemplates = Lists.newArrayList(); - public List getTargetRelationshipTemplates() { return this.targetRelationshipTemplates; } @@ -75,6 +69,4 @@ public List getTargetRelationshipTemplates() { public void addTargetRelationshipTemplates(final String... relationshipTemplates) { this.targetRelationshipTemplates.addAll(Arrays.asList(relationshipTemplates)); } - - } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/request/package-info.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/package-info.java similarity index 100% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/request/package-info.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/request/package-info.java diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationDTO.java similarity index 85% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationDTO.java index 5395befde..4634d31e1 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationDTO.java @@ -6,19 +6,16 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.opentosca.container.api.dto.ResourceSupport; import org.opentosca.container.core.next.model.Situation; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - /** - * Presents an active situation recognition. When a situation occurs it is called active in this - * context, where a specific thing is observed based on a specific situation template. A situation - * can trigger so called SituationTriggers for certain interactions, such as invoking a TOSCA - * operation. + * Presents an active situation recognition. When a situation occurs it is called active in this context, where a + * specific thing is observed based on a specific situation template. A situation can trigger so called + * SituationTriggers for certain interactions, such as invoking a TOSCA operation. * * @author kalmankepes - * */ @XmlRootElement(name = "Situation") @XmlAccessorType(XmlAccessType.FIELD) @@ -36,7 +33,7 @@ public class SituationDTO extends ResourceSupport { @XmlElement(name = "Active", required = false) private boolean active; - + @XmlElement(name = "EventProbability", required = false) private float eventProbability = -1.0f; @@ -74,20 +71,20 @@ public boolean getActive() { public void setActive(final boolean active) { this.active = active; } - + public float getEventProbability() { - return this.eventProbability; + return eventProbability; } - public void setEventProbability(final float eventProbability) { + public void setEventProbability(float eventProbability) { this.eventProbability = eventProbability; } public String getEventTime() { - return this.eventTime; + return eventTime; } - public void setEventTime(final String eventTime) { + public void setEventTime(String eventTime) { this.eventTime = eventTime; } @@ -106,5 +103,4 @@ public static SituationDTO convert(final Situation object) { return dto; } } - } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationListDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationListDTO.java index fa95df70e..3727be87e 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationListDTO.java @@ -7,10 +7,9 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Lists; +import org.opentosca.container.api.dto.ResourceSupport; @XmlRootElement(name = "SituationResources") public class SituationListDTO extends ResourceSupport { @@ -20,7 +19,6 @@ public class SituationListDTO extends ResourceSupport { @XmlElementWrapper(name = "Situations") private final List situations = Lists.newArrayList(); - public List getSituations() { return this.situations; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerDTO.java similarity index 95% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerDTO.java index ced634168..c2431b04c 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerDTO.java @@ -9,15 +9,13 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; -import org.opentosca.container.core.next.model.Situation; -import org.opentosca.container.core.next.model.SituationTrigger; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.google.common.collect.Lists; import com.google.common.collect.Sets; - import io.swagger.annotations.ApiModelProperty; +import org.opentosca.container.api.dto.ResourceSupport; +import org.opentosca.container.core.next.model.Situation; +import org.opentosca.container.core.next.model.SituationTrigger; @XmlRootElement(name = "SituationTrigger") @XmlAccessorType(XmlAccessType.FIELD) @@ -30,7 +28,7 @@ public class SituationTriggerDTO extends ResourceSupport { @XmlElement(name = "SituationId") @XmlElementWrapper(name = "Situations") private Collection situationIds; - + @XmlElement(name = "CsarId") @ApiModelProperty(name = "csar_id") private String csarId; @@ -65,7 +63,7 @@ public class SituationTriggerDTO extends ResourceSupport { @XmlElement(name = "EventTime", required = false) private String eventTime; - + public Long getId() { return this.id; } @@ -83,13 +81,13 @@ public void setSituationIds(final Collection situationIds) { } public String getCsarId() { - return this.csarId; + return csarId; } - public void setCsarId(final String csarId) { + public void setCsarId(String csarId) { this.csarId = csarId; } - + public boolean isOnActivation() { return this.onActivation; } @@ -145,22 +143,23 @@ public Collection getInputParams() { public void setInputParams(final Collection inputParams) { this.inputParams = inputParams; } - + public float getEventProbability() { - return this.eventProbability; + return eventProbability; } - public void setEventProbability(final float eventProbability) { + public void setEventProbability(float eventProbability) { this.eventProbability = eventProbability; } + public String getEventTime() { - return this.eventTime; + return eventTime; } - public void setEventTime(final String eventTime) { + public void setEventTime(String eventTime) { this.eventTime = eventTime; } - + public static final class Converter { public static SituationTriggerDTO convert(final SituationTrigger object) { final SituationTriggerDTO dto = new SituationTriggerDTO(); @@ -168,6 +167,7 @@ public static SituationTriggerDTO convert(final SituationTrigger object) { dto.setId(object.getId()); dto.setOnActivation(object.isTriggerOnActivation()); dto.setIsSingleInstance(object.isSingleInstance()); + final Collection situationIds = Lists.newArrayList(); for (final Situation situation : object.getSituations()) { @@ -191,5 +191,4 @@ public static SituationTriggerDTO convert(final SituationTrigger object) { return dto; } } - } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerInputDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerInputDTO.java similarity index 100% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerInputDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerInputDTO.java diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerInstanceDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerInstanceDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerInstanceDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerInstanceDTO.java index a201ab9f3..a5278792f 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerInstanceDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerInstanceDTO.java @@ -7,11 +7,10 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; -import org.opentosca.container.core.next.model.SituationTriggerInstance; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.google.common.collect.Maps; +import org.opentosca.container.api.dto.ResourceSupport; +import org.opentosca.container.core.next.model.SituationTriggerInstance; @XmlRootElement(name = "SituationTriggerInstance") @JsonIgnoreProperties(ignoreUnknown = true) @@ -26,7 +25,6 @@ public class SituationTriggerInstanceDTO extends ResourceSupport { private Map outputParams; - public Long getId() { return this.id; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerListDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerListDTO.java index 659950f0d..c79f709c0 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationTriggerListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationTriggerListDTO.java @@ -7,10 +7,9 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Lists; +import org.opentosca.container.api.dto.ResourceSupport; @XmlRootElement(name = "SituationTriggerResources") public class SituationTriggerListDTO extends ResourceSupport { @@ -20,7 +19,6 @@ public class SituationTriggerListDTO extends ResourceSupport { @XmlElementWrapper(name = "SituationTriggers") private final List situationTriggers = Lists.newArrayList(); - public List getSituationTriggers() { return this.situationTriggers; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationsMonitorDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationsMonitorDTO.java similarity index 78% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationsMonitorDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationsMonitorDTO.java index 52df5219d..d6f91d040 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationsMonitorDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationsMonitorDTO.java @@ -1,7 +1,6 @@ package org.opentosca.container.api.dto.situations; import java.util.Collection; -import java.util.HashSet; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; @@ -11,12 +10,10 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; -import org.opentosca.container.core.next.model.Situation; -import org.opentosca.container.core.next.model.SituationsMonitor; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.google.common.collect.Maps; +import org.opentosca.container.api.dto.ResourceSupport; +import org.opentosca.container.core.next.model.SituationsMonitor; @XmlRootElement(name = "SituationsMonitor") @XmlAccessorType(XmlAccessType.FIELD) @@ -27,7 +24,7 @@ public class SituationsMonitorDTO extends ResourceSupport { private Long id; @XmlElementWrapper(name = "NodeIds2SituationIds") - private Map nodeId2situationIds; + private Map nodeId2situationIds; public Long getId() { return this.id; @@ -37,11 +34,11 @@ public void setId(final Long id) { this.id = id; } - public Map getNodeId2SituationIds() { + public Map getNodeId2SituationIds() { return this.nodeId2situationIds; } - public void setNodeId2SituationIds(final Map nodeId2situationIds) { + public void setNodeId2SituationIds(final Map nodeId2situationIds) { this.nodeId2situationIds = nodeId2situationIds; } @@ -49,31 +46,31 @@ public static final class Converter { public static SituationsMonitorDTO convert(final SituationsMonitor object) { final SituationsMonitorDTO dto = new SituationsMonitorDTO(); dto.setId(object.getId()); - + Map wrap = Maps.newHashMap(); - - for(String key : object.getNode2Situations().keySet()) { + + for (String key : object.getNode2Situations().keySet()) { SituationIdsWrapper w = new SituationIdsWrapper(); w.setSituationId(object.getNode2Situations().get(key)); wrap.put(key, w); } - + dto.setNodeId2SituationIds(wrap); - + return dto; } } - + public static class SituationIdsWrapper { - - @XmlElementWrapper(name="SituationIdsList") - @XmlElement(name="situationId") + + @XmlElementWrapper(name = "SituationIdsList") + @XmlElement(name = "situationId") private Collection situationIds; - + public void setSituationId(Collection situationId) { this.situationIds = situationId; } - + public Collection getSituationId() { return this.situationIds; } diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationsMonitorListDTO.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationsMonitorListDTO.java similarity index 99% rename from org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationsMonitorListDTO.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationsMonitorListDTO.java index 57538aa74..3fcb419a4 100644 --- a/org.opentosca.container.api/src/org/opentosca/container/api/dto/situations/SituationsMonitorListDTO.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/dto/situations/SituationsMonitorListDTO.java @@ -7,10 +7,9 @@ import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.opentosca.container.api.dto.ResourceSupport; - import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Lists; +import org.opentosca.container.api.dto.ResourceSupport; @XmlRootElement(name = "SituationsMonitors") public class SituationsMonitorListDTO extends ResourceSupport { @@ -20,7 +19,6 @@ public class SituationsMonitorListDTO extends ResourceSupport { @XmlElementWrapper(name = "SituationsMonitors") private final List situationsMonitors = Lists.newArrayList(); - public List getSituations() { return this.situationsMonitors; } diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/PlanbuilderWorker.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/PlanbuilderWorker.java new file mode 100644 index 000000000..b11d07d49 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/PlanbuilderWorker.java @@ -0,0 +1,340 @@ +package org.opentosca.container.api.planbuilder; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URL; +import java.nio.file.Path; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import javax.xml.namespace.QName; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import org.apache.commons.io.FileUtils; +import org.apache.http.HeaderElement; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.EntityBuilder; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.ContentBody; +import org.apache.http.entity.mime.content.FileBody; +import org.apache.http.entity.mime.content.StringBody; +import org.apache.http.message.BasicHeader; +import org.opentosca.container.api.planbuilder.Util.SelfServiceOptionWrapper; +import org.opentosca.container.api.planbuilder.model.PlanGenerationState; +import org.opentosca.container.api.planbuilder.model.PlanGenerationState.PlanGenerationStates; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.IHTTPService; +import org.opentosca.planbuilder.importer.Importer; +import org.opentosca.planbuilder.model.plan.AbstractPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The worker process instance for one single plan generation. + *
+ * Copyright 2015 IAAS University of Stuttgart
+ *
+ * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public class PlanbuilderWorker { + + final private static Logger LOG = LoggerFactory.getLogger(PlanbuilderWorker.class); + + private final PlanGenerationState state; + private final IHTTPService httpService; + private final CsarStorageService csarStorage; + private final Importer planBuilderImporter; + + public PlanbuilderWorker(final PlanGenerationState state, IHTTPService httpService, CsarStorageService csarStorage, + Importer importer) { + this.state = state; + this.httpService = httpService; + this.csarStorage = csarStorage; + this.planBuilderImporter = importer; + } + + public PlanGenerationState getState() { + return state; + } + + public void doWork() { + if (csarStorage == null || httpService == null) { + LOG.error("Required services for planbuilder worker are not available. Aborting invocation"); + state.currentMessage = "Services were not avaiable. Invocation failed"; + state.currentState = PlanGenerationStates.FAILED; + } + + LOG.debug("Starting to download CSAR"); + state.currentState = PlanGenerationState.PlanGenerationStates.CSARDOWNLOADING; + LOG.debug("Downloading CSAR " + state.getCsarUrl()); + + try { + final HttpResponse csarResponse = httpService.Get(state.getCsarUrl().toString(), Collections.singletonMap("Accept", "application/zip")); + final InputStream csarInputStream = csarResponse.getEntity().getContent(); + + if (csarInputStream == null) { + state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; + state.currentMessage = "Couldn't download CSAR"; + LOG.error("Couldn't download CSAR"); + return; + } + + String fileName = null; + for (final org.apache.http.Header header : csarResponse.getAllHeaders()) { + if (!header.getName().contains("Content-Disposition")) { + continue; + } + for (final HeaderElement elem : header.getElements()) { + if (!elem.getName().equals("attachment")) { + continue; + } + for (final NameValuePair nameValuePair : elem.getParameters()) { + if (nameValuePair.getName().equals("filename")) { + fileName = nameValuePair.getValue(); + } + } + } + } + + if (fileName == null) { + // robustness hack (*g*) + fileName = state.getCsarUrl().toString().replace("?csar", ""); + if (fileName.endsWith("/")) { + fileName = fileName.substring(0, fileName.length() - 1); + } + fileName = fileName.substring(fileName.lastIndexOf("/") + 1); + } + + state.currentState = PlanGenerationStates.CSARDOWNLOADED; + state.currentMessage = "Downloaded CSAR"; + LOG.debug("CSAR download finished"); + + if (fileName == null) { + LOG.debug("CSAR Filename couldn't be determined"); + state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; + state.currentMessage = "CSAR Filename couldn't be determined"; + return; + } + + fileName = fileName.replace(".csar", "") + ".planbuilder" + System.currentTimeMillis() + ".csar"; + // generate plan (assumption: the send csar contains only one topologytemplate => only one buildPlan will be generated) + LOG.debug("Storing CSAR"); + Path tempCsarLocation = csarStorage.storeCSARTemporarily(fileName, csarInputStream); + } catch (final IOException e) { + state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; + state.currentMessage = "Couldn't download CSAR"; + LOG.error("Couldn't download CSAR"); + return; + } + + CsarId csarId = null; + if (csarId == null) { + state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; + state.currentMessage = "Couldn't store CSAR"; + LOG.error("Couldn't store CSAR"); + forceDelete(csarId); + return; + } + + state.currentState = PlanGenerationStates.PLANGENERATING; + state.currentMessage = "Generating Plan"; + LOG.debug("Starting to generate Plan"); + + final List buildPlans = planBuilderImporter.generatePlans(csarId.toOldCsarId()); + + if (buildPlans.size() <= 0) { + state.currentState = PlanGenerationStates.PLANGENERATIONFAILED; + state.currentMessage = "No plans could be generated"; + forceDelete(csarId); + LOG.error("No plans could be generated"); + return; + } + + state.currentState = PlanGenerationStates.PLANSGENERATED; + state.currentMessage = "Stored and generated Plans"; + LOG.debug("Stored and generated Plans"); + + final Map plansToUpload = new HashMap<>(); + + for (final AbstractPlan buildPlan : buildPlans) { + final File planTmpFile = Util.writePlan2TmpFolder((BPELPlan) buildPlan); + plansToUpload.put((BPELPlan) buildPlan, planTmpFile); + } + + LOG.debug("Plans to upload: " + buildPlans.size()); + + for (final AbstractPlan buildPlan : plansToUpload.keySet()) { + + // write to tmp dir, only generating one plan + final File planTmpFile = plansToUpload.get(buildPlan); + + final List inputParameters = ((BPELPlan) buildPlan).getWsdl().getInputMessageLocalNames(); + final List outputParameters = ((BPELPlan) buildPlan).getWsdl().getOuputMessageLocalNames(); + + final JsonObject obj = new JsonObject(); + obj.addProperty("name", QName.valueOf(buildPlan.getId()).getLocalPart()); + obj.addProperty("planType", buildPlan.getType().toString()); + obj.addProperty("planLanguage", BPELPlan.bpelNamespace); + + JsonArray inputParamList = new JsonArray(); + createParameters(inputParameters).forEach(inputParamList::add); + obj.add("inputParameters", inputParamList); + + JsonArray outputParamList = new JsonArray(); + createParameters(outputParameters).forEach(outputParamList::add); + obj.add("outputParameters", outputParamList); + + final HttpEntity ent = + EntityBuilder.create().setText(obj.getAsString()).setContentType(ContentType.APPLICATION_JSON).build(); + + HttpResponse createPlanResponse = null; + try { + createPlanResponse = httpService.Post(getState().getPostUrl().toString(), ent, + new BasicHeader("Accept", "application/json"), + new BasicHeader("Content-Type", "application/json")); + } catch (final Exception e) { + state.currentState = PlanGenerationStates.PLANSENDINGFAILED; + state.currentMessage = + "Couldn't send plan. Server send status " + createPlanResponse.getStatusLine().getStatusCode(); + LOG.error("[{}] {}", state.currentState, state.currentMessage); + forceDelete(csarId); + return; + } + + final org.apache.http.Header planLocationHeader = createPlanResponse.getHeaders("Location")[0]; + + String planLocation = planLocationHeader.getValue(); + // Remove trailing slash + if (planLocation.endsWith("/")) { + planLocation = planLocation.substring(0, planLocation.length() - 1); + } + + try { + state.currentState = PlanGenerationStates.PLANSENDING; + state.currentMessage = "Sending Plan"; + LOG.debug("Sending Plan"); + + // send file + final FileBody bin = new FileBody(planTmpFile); + final ContentBody cb = bin; + final MultipartEntityBuilder mpEntity = MultipartEntityBuilder.create(); + mpEntity.addPart("file", cb); + + final HttpResponse uploadResponse = httpService.Put(planLocation + "/file", mpEntity.build()); + if (uploadResponse.getStatusLine().getStatusCode() >= 300) { + // we assume ,if the status code ranges from 300 to 5xx , that + // an error occured + state.currentState = PlanGenerationStates.PLANSENDINGFAILED; + state.currentMessage = + "Couldn't send plan. Server send status " + uploadResponse.getStatusLine().getStatusCode(); + forceDelete(csarId); + LOG.error("Couldn't send plan. Server send status " + + uploadResponse.getStatusLine().getStatusCode()); + return; + } + + LOG.debug("Starting to send Options"); + state.currentState = PlanGenerationStates.OPTIONSENDING; + state.currentMessage = "Sending SelfService Option"; + + try { + final URL optionsUrl = new URL(state.getCsarUrl(), "selfserviceportal/options/"); + LOG.debug("Sending options to " + optionsUrl.toString()); + + final SelfServiceOptionWrapper option = Util.generateSelfServiceOption((BPELPlan) buildPlan); + LOG.debug("Sending the following option: " + option.toString()); + + // send plan back + final MultipartEntityBuilder multipartBuilder = MultipartEntityBuilder.create(); + try { + multipartBuilder.addPart("name", + new StringBody(option.option.getName(), ContentType.TEXT_PLAIN)); + multipartBuilder.addPart("description", + new StringBody(option.option.getDescription(), ContentType.TEXT_PLAIN)); + multipartBuilder.addPart("planServiceName", + new StringBody(option.option.getPlanServiceName(), ContentType.TEXT_PLAIN)); + multipartBuilder.addPart("planInputMessage", + new StringBody(FileUtils.readFileToString(option.planInputMessageFile), ContentType.TEXT_PLAIN)); + } catch (final UnsupportedEncodingException e1) { + state.currentState = PlanGenerationStates.OPTIONSENDINGFAILED; + state.currentMessage = "Couldn't generate option to send to winery"; + forceDelete(csarId); + LOG.error("Couldn't generate option request to " + optionsUrl.toString()); + return; + } + + // TODO here we should send a default image, instead of the message.. + final FileBody fileBody = new FileBody(option.planInputMessageFile); + final ContentBody contentBody = fileBody; + multipartBuilder.addPart("file", contentBody); + + final HttpResponse optionsResponse = httpService.Post(optionsUrl.toString(), multipartBuilder.build()); + + if (optionsResponse.getStatusLine().getStatusCode() >= 300) { + // we assume ,if the status code ranges from 300 to 5xx , that an error occured + state.currentState = PlanGenerationStates.OPTIONSENDINGFAILED; + state.currentMessage = "Couldn't send option to winery. Response: \n StatusCode: " + + optionsResponse.getStatusLine().getStatusCode() + " \n Reason Phrase: \n" + + optionsResponse.getStatusLine().getReasonPhrase(); + forceDelete(csarId); + return; + } else { + state.currentState = PlanGenerationStates.OPTIONSENT; + state.currentMessage = "Sent option. Everythings okay."; + } + } catch (final IOException e) { + state.currentState = PlanGenerationStates.OPTIONSENDINGFAILED; + state.currentMessage = "Couldn't send option to winery."; + forceDelete(csarId); + return; + } + + state.currentState = PlanGenerationStates.PLANSSENT; + state.currentMessage = "Sent plan."; + LOG.debug("Sent plan."); + } catch (final IOException e) { + state.currentState = PlanGenerationStates.PLANSENDINGFAILED; + state.currentMessage = "Couldn't send plan."; + forceDelete(csarId); + LOG.error("Couldn't send plan."); + return; + } + } + state.currentState = PlanGenerationStates.FINISHED; + state.currentMessage = "Plans where successfully sent."; + forceDelete(csarId); + } + + private void forceDelete(CsarId csarId) { + try { + csarStorage.deleteCSAR(csarId); + } catch (UserException | SystemException e) { + LOG.warn("Failed to delete csar {} for planbuilder worker [{}:{}] with exception", csarId.csarName(), state.currentState, state.currentMessage, e); + } + } + + private List createParameters(final List parameters) { + return parameters.stream().map(p -> { + JsonObject paramObject = new JsonObject(); + paramObject.addProperty("name", p); + paramObject.addProperty("type", "xsd:string"); + paramObject.addProperty("required", "NO"); + return paramObject; + }) + .collect(Collectors.toList()); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/RunningTasks.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/RunningTasks.java new file mode 100644 index 000000000..21d3011e6 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/RunningTasks.java @@ -0,0 +1,50 @@ +/** + * + */ +package org.opentosca.container.api.planbuilder; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.opentosca.container.api.planbuilder.model.PlanGenerationState; + +/** + * Copyright 2015 IAAS University of Stuttgart
+ *
+ * + *

+ * Simple implementation for storing the tasks generated by the PlanBuilder service + *

+ * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + * + */ +public class RunningTasks { + + private static final Map tasks = new ConcurrentHashMap<>(); + + private static String generateId() { + final String newId = String.valueOf(System.currentTimeMillis()); + if (RunningTasks.tasks.containsKey(newId)) { + return RunningTasks.generateId(); + } else { + return newId; + } + } + + public static String putSafe(PlanGenerationState generationState) { + synchronized (tasks) { + final String id = generateId(); + tasks.put(id, generationState); + return id; + } + } + + public static PlanGenerationState get(String id) { + return tasks.get(id); + } + + public static boolean exists(String id) { + return tasks.containsKey(id); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/Util.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/Util.java new file mode 100644 index 000000000..4a303df4b --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/Util.java @@ -0,0 +1,132 @@ +package org.opentosca.container.api.planbuilder; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.List; + +import javax.xml.bind.JAXBException; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.selfservice.ApplicationOption; + +import org.apache.ode.schemas.dd._2007._03.TProvide; +import org.opentosca.container.core.impl.service.FileSystem; +import org.opentosca.planbuilder.export.Exporter; +import org.opentosca.planbuilder.export.VinothekKnownParameters; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.Deploy; + +/** + * Copyright 2015 IAAS University of Stuttgart
+ *
+ * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public class Util { + + public static class SelfServiceOptionWrapper { + + public ApplicationOption option; + public File planInputMessageFile; + + public SelfServiceOptionWrapper(final ApplicationOption option, final File planInputMessageFile) { + this.option = option; + this.planInputMessageFile = planInputMessageFile; + } + + @Override + public String toString() { + return "SelfServiceOption Id: " + this.option.getId() + " Name: " + this.option.getName(); + } + } + + public static SelfServiceOptionWrapper generateSelfServiceOption(final BPELPlan buildPlan) throws IOException { + final String id = String.valueOf(System.currentTimeMillis()); + final ApplicationOption option = new ApplicationOption(); + + final File tmpDir = FileSystem.getTemporaryFolder().toFile(); + tmpDir.mkdir(); + + final File planInputMessageFile = new File(tmpDir, "plan.input.default." + id + ".xml"); + + option.setName(Util.getBuildPlanServiceName(buildPlan.getDeploymentDeskriptor()).getLocalPart()); + option.setId(id); + option.setIconUrl(""); + option.setDescription("N/A"); + option.setPlanServiceName(Util.getBuildPlanServiceName(buildPlan.getDeploymentDeskriptor()).getLocalPart()); + option.setPlanInputMessageUrl("plan.input.default." + id + ".xml"); + Util.writePlanInputMessageInstance(buildPlan, planInputMessageFile); + + return new SelfServiceOptionWrapper(option, planInputMessageFile); + } + + /** + * Writes given BuildPlan to temporary folder. + * + * @param buildPlan a BuildPlan + * @return a File denoting the export location + */ + public static File writePlan2TmpFolder(final BPELPlan buildPlan) { + final Exporter planBuilderExporter = new Exporter(); + + try { + final File tmpDir = FileSystem.getTemporaryFolder().toFile(); + tmpDir.mkdir(); + + final File uploadFile = new File(tmpDir.getAbsoluteFile() + System.getProperty("file.separator") + + buildPlan.getBpelProcessElement().getAttribute("name") + ".zip"); + planBuilderExporter.exportToPlanFile(uploadFile.toURI(), buildPlan); + return uploadFile; + } catch (final IOException e) { + e.printStackTrace(); + return null; + } catch (final JAXBException e) { + e.printStackTrace(); + return null; + } + } + + private static QName getBuildPlanServiceName(final Deploy deploy) { + // generated buildplans have only one process! + for (final TProvide provide : deploy.getProcess().get(0).getProvide()) { + // "client" is a convention + if (provide.getPartnerLink().equals("client")) { + return provide.getService().getName(); + } + } + return null; + } + + private static void writePlanInputMessageInstance(final BPELPlan buildPlan, final File xmlFile) throws IOException { + final String messageNs = buildPlan.getWsdl().getTargetNamespace(); + final String requestMessageLocalName = buildPlan.getWsdl().getRequestMessageLocalName(); + final List inputParamNames = buildPlan.getWsdl().getInputMessageLocalNames(); + + final VinothekKnownParameters paramMappings = new VinothekKnownParameters(); + final String soapMessagePrefix = Util.createPrefixPartOfSoapMessage(messageNs, requestMessageLocalName); + final String soapMessageSuffix = Util.createSuffixPartOfSoapMessage(requestMessageLocalName); + + String soapMessage = soapMessagePrefix; + for (final String inputParamName : inputParamNames) { + soapMessage += paramMappings.createXmlElement(inputParamName); + } + soapMessage += soapMessageSuffix; + + Files.write(xmlFile.toPath(), soapMessage.getBytes(StandardCharsets.UTF_8)); + } + + private static String createPrefixPartOfSoapMessage(final String namespace, final String messageBodyRootLocalName) { + return "%CALLBACK-URL%" + + namespace + + "/initiate%CORRELATION-ID%"; + } + + private static String createSuffixPartOfSoapMessage(final String messageBodyRootLocalName) { + return ""; + } +} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/model/GeneratePlanForTopology.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/model/GeneratePlanForTopology.java similarity index 85% rename from org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/model/GeneratePlanForTopology.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/model/GeneratePlanForTopology.java index 9deb3f887..2fed2904a 100644 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/model/GeneratePlanForTopology.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/model/GeneratePlanForTopology.java @@ -1,7 +1,7 @@ /** * */ -package org.opentosca.planbuilder.service.model; +package org.opentosca.container.api.planbuilder.model; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/model/PlanGenerationState.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/model/PlanGenerationState.java similarity index 89% rename from org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/model/PlanGenerationState.java rename to org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/model/PlanGenerationState.java index bee05a792..9022bb307 100644 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/model/PlanGenerationState.java +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/planbuilder/model/PlanGenerationState.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder.service.model; +package org.opentosca.container.api.planbuilder.model; import java.io.File; import java.net.URL; @@ -13,19 +13,20 @@ *
* * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ @XmlRootElement public class PlanGenerationState { public enum PlanGenerationStates { - INITIALIZED, CSARDOWNLOADING, CSARDOWNLOADFAILED, CSARDOWNLOADED, PLANGENERATING, PLANGENERATIONFAILED, PLANSGENERATED, PLANSENDING, PLANSENDINGFAILED, PLANSSENT, OPTIONSENDING, OPTIONSENDINGFAILED, OPTIONSENT, FINISHED + INITIALIZED, CSARDOWNLOADING, CSARDOWNLOADFAILED, CSARDOWNLOADED, PLANGENERATING, PLANGENERATIONFAILED, PLANSGENERATED, PLANSENDING, PLANSENDINGFAILED, PLANSSENT, OPTIONSENDING, OPTIONSENDINGFAILED, OPTIONSENT, FINISHED, FAILED } - @XmlElement public String currentMessage = "Task is initializing"; + @XmlElement + public PlanGenerationStates currentState = PlanGenerationStates.INITIALIZED; + @XmlElement private final URL csarUrl; @@ -36,10 +37,6 @@ public enum PlanGenerationStates { private final File planTmpFile = null; - @XmlElement - public PlanGenerationStates currentState = PlanGenerationStates.INITIALIZED; - - public PlanGenerationState() { this.csarUrl = null; this.planPostUrl = null; @@ -57,5 +54,4 @@ public URL getCsarUrl() { public URL getPostUrl() { return this.planPostUrl; } - } diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/CsarService.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/CsarService.java new file mode 100644 index 000000000..fbe187546 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/CsarService.java @@ -0,0 +1,147 @@ +package org.opentosca.container.api.service; + +import java.nio.file.Path; +import java.util.Collection; +import java.util.List; +import java.util.Optional; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.repository.backend.filebased.FileUtils; + +import com.google.common.collect.Lists; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.planbuilder.core.csarhandler.CSARHandler; +import org.opentosca.planbuilder.export.Exporter; +import org.opentosca.planbuilder.export.Exporter.PlanExportResult; +import org.opentosca.planbuilder.importer.Importer; +import org.opentosca.planbuilder.model.plan.AbstractPlan; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +@Service +public class CsarService { + private static Logger logger = LoggerFactory.getLogger(CsarService.class); + + private final CsarStorageService storage; + private final Exporter planBuilderExporter; + private final Importer planBuilderImporter; + + public class AdaptationPlanGenerationResult { + public CsarId csarId; + public String planId; + + public AdaptationPlanGenerationResult(CsarId csarId, String planId) { + this.csarId = csarId; + this.planId = planId; + } + } + + // FIXME remove this as soon as planbuilder works off new csar model + private final CSARHandler planbuilderStorage = new CSARHandler(); + + @Inject + public CsarService(CsarStorageService storage, Exporter planBuilderExporter, Importer planBuilderImporter) { + this.storage = storage; + this.planBuilderExporter = planBuilderExporter; + this.planBuilderImporter = planBuilderImporter; + } + + /** + * Checks whether the plan builder should generate a build plans. + * + * @param csar the {@link Csar} to generate build plans for + * @return true for success or false for failure + */ + public boolean generatePlans(final Csar csar) throws SystemException, UserException { + Optional zipFile = safeExport(csar); + if (!zipFile.isPresent()) { + return false; + } + + try { + planbuilderStorage.storeCSAR(zipFile.get().toFile()); + final List buildPlans = planBuilderImporter.generatePlans(csar.id().toOldCsarId()); + // no plans, save ourselves some work by returning early + if (buildPlans.isEmpty()) { + return true; + } + + final Path file = planBuilderExporter.exportToCSAR(buildPlans, csar.id().toOldCsarId()).csarFile; + // reimport CSAR after generating plans + storage.deleteCSAR(csar.id()); + storage.storeCSAR(file); + return true; + } catch (UserException | SystemException e) { + logger.warn("Reimport of Csar after building plans failed with an exception", e); + } finally { + planbuilderStorage.deleteCSAR(csar.id().toOldCsarId()); + } + return false; + } + + public AdaptationPlanGenerationResult generateAdaptationPlan(final CsarId csarId, QName serviceTemplateId, Collection sourceNodeTemplateIds, Collection sourceRelationshipTemplateIds, Collection targetNodeTemplateId, Collection targetRelationshipTemplateId) { + try { + + AbstractPlan plan = planBuilderImporter.generateAdaptationPlan(new CSARID(csarId.csarName()), serviceTemplateId, sourceNodeTemplateIds, sourceRelationshipTemplateIds, targetNodeTemplateId, targetRelationshipTemplateId); + + if (plan == null) { + return null; + } + List plans = Lists.newArrayList(); + plans.add(plan); + final PlanExportResult result = planBuilderExporter.exportToCSAR(plans, new CSARID(csarId.csarName())); + final Path file = result.csarFile; + + storage.deleteCSAR(csarId); + + CsarId newCsarId = storage.storeCSAR(file); + return new AdaptationPlanGenerationResult(newCsarId, result.planIds.iterator().next()); + } catch (final Exception e) { + logger.error("Could not store repackaged CSAR: {}", e.getMessage(), e); + } + + return null; + } + + public CsarId generateTransformationPlans(final CsarId sourceCsarId, final CsarId targetCsarId) { + +// final Importer planBuilderImporter = new Importer(); +// final Exporter planBuilderExporter = new Exporter(new FileAccessServiceImpl()); + + //planBuilderImporter.buildTransformationPlans(sourceCsarId.getFileName(), sourceDefinitions, targetCsarId.getFileName(), targetDefinitions) + List plans = planBuilderImporter.generateTransformationPlans(sourceCsarId.toOldCsarId(), targetCsarId.toOldCsarId()); + + if (plans.isEmpty()) { + return sourceCsarId; + } + + final Path file = planBuilderExporter.exportToCSAR(plans, sourceCsarId.toOldCsarId()).csarFile; + try { + storage.deleteCSAR(sourceCsarId); + return storage.storeCSAR(file); + } catch (final Exception e) { + logger.error("Could not store repackaged CSAR: {}", e.getMessage(), e); + } + return null; + } + + private Optional safeExport(Csar csar) { + Optional zipFile = Optional.empty(); + try { + zipFile = Optional.of(storage.exportCSAR(csar.id())); + } catch (UserException | SystemException e) { + logger.info("Exporting the Csar that is to be planned failed with an exception", e); + zipFile.ifPresent(FileUtils::forceDelete); + return Optional.empty(); + } + return zipFile; + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/InstanceService.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/InstanceService.java new file mode 100644 index 000000000..90999a324 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/InstanceService.java @@ -0,0 +1,751 @@ +package org.opentosca.container.api.service; + +import java.util.Collection; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.ws.rs.NotFoundException; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import com.google.common.collect.Lists; +import org.opentosca.container.api.dto.NodeTemplateDTO; +import org.opentosca.container.api.dto.RelationshipTemplateDTO; +import org.opentosca.container.api.dto.request.CreateRelationshipTemplateInstanceRequest; +import org.opentosca.container.core.common.jpa.DocumentConverter; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstanceProperty; +import org.opentosca.container.core.next.model.NodeTemplateInstanceState; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.next.model.Property; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.next.model.RelationshipTemplateInstanceProperty; +import org.opentosca.container.core.next.model.RelationshipTemplateInstanceState; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstanceProperty; +import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; +import org.opentosca.container.core.next.model.Situation; +import org.opentosca.container.core.next.model.SituationTrigger; +import org.opentosca.container.core.next.model.SituationTriggerInstance; +import org.opentosca.container.core.next.model.SituationTriggerProperty; +import org.opentosca.container.core.next.model.SituationsMonitor; +import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; +import org.opentosca.container.core.next.repository.PlanInstanceRepository; +import org.opentosca.container.core.next.repository.RelationshipTemplateInstanceRepository; +import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; +import org.opentosca.container.core.next.repository.SituationRepository; +import org.opentosca.container.core.next.repository.SituationTriggerInstanceRepository; +import org.opentosca.container.core.next.repository.SituationTriggerRepository; +import org.opentosca.container.core.next.repository.SituationsMonitorRepository; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Allows access to instance information for service templates and node templates. + */ +@Service +public class InstanceService { + + private static Logger logger = LoggerFactory.getLogger(InstanceService.class); + + private final ServiceTemplateInstanceRepository serviceTemplateInstanceRepository = + new ServiceTemplateInstanceRepository(); + private final NodeTemplateInstanceRepository nodeTemplateInstanceRepository = new NodeTemplateInstanceRepository(); + private final RelationshipTemplateInstanceRepository relationshipTemplateInstanceRepository = + new RelationshipTemplateInstanceRepository(); + + // situations + private final SituationRepository sitRepo = new SituationRepository(); + private final SituationTriggerRepository sitTrig = new SituationTriggerRepository(); + private final SituationTriggerInstanceRepository sitTrigInst = new SituationTriggerInstanceRepository(); + private final SituationsMonitorRepository situationsMonitorRepo = new SituationsMonitorRepository(); + + private final RelationshipTemplateService relationshipTemplateService; + private final NodeTemplateService nodeTemplateService; + private final ServiceTemplateService serviceTemplateService; + private final CsarStorageService storage; + + private final DocumentConverter converter = new DocumentConverter(); + + @Inject + public InstanceService(RelationshipTemplateService relationshipTemplateService, NodeTemplateService nodeTemplateService, ServiceTemplateService serviceTemplateService, CsarStorageService storage) { + this.relationshipTemplateService = relationshipTemplateService; + this.nodeTemplateService = nodeTemplateService; + this.serviceTemplateService = serviceTemplateService; + this.storage = storage; + } + + public Document convertPropertyToDocument(final Property property) { + return (Document) this.converter.convertToEntityAttribute(property.getValue()); + } + + /** + * Converts an xml document to an xml-based property sui/table for service or node template instances + */ + public T convertDocumentToProperty(final Document propertyDoc, + final Class type) throws InstantiationException, + IllegalAccessException, + IllegalArgumentException { + + if (propertyDoc == null) { + final String msg = + String.format("The set of parameters of an instance of type %s cannot be null", type.getName()); + logger.debug(msg); + throw new IllegalArgumentException(msg); + } + final String propertyAsString = this.converter.convertToDatabaseColumn(propertyDoc); + final T property = type.newInstance(); + property.setName("xml"); + property.setType("xml"); + property.setValue(propertyAsString); + + return property; + } + + /* Service Template Instances */ + public Collection getServiceTemplateInstances(final String serviceTemplate) { + logger.debug("Requesting instances of ServiceTemplate \"{}\"...", serviceTemplate); + return this.serviceTemplateInstanceRepository.findByTemplateId(serviceTemplate); + } + + public ServiceTemplateInstance getServiceTemplateInstanceByCorrelationId(String correlationId) { + return this.serviceTemplateInstanceRepository.findAll().stream() + .filter(s -> s.getPlanInstances().stream() + .anyMatch(p -> p.getCorrelationId().equals(correlationId))) + .findFirst().get(); + } + + public ServiceTemplateInstance getServiceTemplateInstance(final Long id, final boolean evaluatePropertyMappings) { + logger.debug("Requesting service template instance <{}>...", id); + final Optional instance = this.serviceTemplateInstanceRepository.find(id); + + if (instance.isPresent()) { + final ServiceTemplateInstance result = instance.get(); + + if (evaluatePropertyMappings) { + final PropertyMappingsHelper helper = new PropertyMappingsHelper(this, storage); + helper.evaluatePropertyMappings(result); + } + + return result; + } + + logger.debug("Service Template Instance <" + id + "> not found."); + throw new NotFoundException("Service Template Instance <" + id + "> not found."); + } + + public ServiceTemplateInstanceState getServiceTemplateInstanceState(final Long id) { + final ServiceTemplateInstance service = getServiceTemplateInstance(id, false); + + return service.getState(); + } + + public void setServiceTemplateInstanceState(final Long id, final String state) throws NotFoundException, + IllegalArgumentException { + + ServiceTemplateInstanceState newState; + try { + newState = ServiceTemplateInstanceState.valueOf(state); + } catch (final Exception e) { + final String msg = + String.format("The given state %s is an illegal service template instance state.", state); + logger.debug(msg); + throw new IllegalArgumentException(msg, e); + } + + final ServiceTemplateInstance service = getServiceTemplateInstance(id, false); + service.setState(newState); + this.serviceTemplateInstanceRepository.update(service); + } + + public Document getServiceTemplateInstanceRawProperties(final Long id) throws NotFoundException { + final ServiceTemplateInstance service = getServiceTemplateInstance(id, false); + final Optional firstProp = service.getProperties().stream().findFirst(); + + if (firstProp.isPresent()) { + return convertPropertyToDocument(firstProp.get()); + } + + final String msg = String.format("No properties are found for the service template instance <%s>", id); + logger.debug(msg); + + return null; + } + + public void setServiceTemplateInstanceProperties(final Long id, + final Document properties) throws ReflectiveOperationException { + final ServiceTemplateInstance service = getServiceTemplateInstance(id, false); + + try { + final ServiceTemplateInstanceProperty property = + this.convertDocumentToProperty(properties, ServiceTemplateInstanceProperty.class); + service.addProperty(property); + this.serviceTemplateInstanceRepository.update(service); + } catch (InstantiationException | IllegalAccessException e) { // This is not supposed to happen at all! + final String msg = String.format("An error occurred while instantiating an instance of the %s class.", + ServiceTemplateInstanceProperty.class); + logger.debug(msg); + throw e; + } + } + + public void deleteServiceTemplateInstance(final Long instanceId) { + // throws exception if not found + final ServiceTemplateInstance instance = getServiceTemplateInstance(instanceId, false); + this.serviceTemplateInstanceRepository.remove(instance); + } + + public ServiceTemplateInstance createServiceTemplateInstance(final String csarId, final String serviceTemplateName, + final String correlationId) throws NotFoundException, + InstantiationException, + IllegalAccessException, + IllegalArgumentException { + final CsarId csar = this.serviceTemplateService.checkServiceTemplateExistence(csarId, serviceTemplateName); + final PlanInstanceRepository repository = new PlanInstanceRepository(); + PlanInstance pi = null; + + try { + pi = repository.findByCorrelationId(correlationId); + } catch (final Exception e) { + final String msg = + String.format("The given correlation id %s is either malformed, does not belong to an existing plan instance", + correlationId); + logger.info(msg); + throw new NotFoundException(msg); + } + + // If the found plan is a build plan there shouldn't be a service template instance available, + // if it is a transformation plan the service instance mustn't be of the service template the new service instance should belong to + if ((pi.getType().equals(PlanType.BUILD) && pi.getServiceTemplateInstance() == null) + || (pi.getType().equals(PlanType.TRANSFORMATION) && !pi.getServiceTemplateInstance().getTemplateId().equals(serviceTemplateName))) { + + return this.createServiceTemplateInstance(csar, serviceTemplateName, pi); + } else { + final String msg = "The build plan instance is already associted with a service template instance!"; + logger.info(msg); + throw new IllegalArgumentException(msg); + } + } + + private ServiceTemplateInstance createServiceTemplateInstance(final CsarId csarId, final String serviceTemplateName, + final PlanInstance buildPlanInstance) throws InstantiationException, + IllegalAccessException, + IllegalArgumentException { + final Document propertiesAsDoc = + createServiceInstanceInitialPropertiesFromServiceTemplate(csarId, serviceTemplateName); + final ServiceTemplateInstanceProperty property = + convertDocumentToProperty(propertiesAsDoc, ServiceTemplateInstanceProperty.class); + + final ServiceTemplateInstance instance = new ServiceTemplateInstance(); + instance.setCsarId(csarId); + instance.setTemplateId(serviceTemplateName); + instance.setState(ServiceTemplateInstanceState.INITIAL); + instance.addProperty(property); + instance.addPlanInstance(buildPlanInstance); + instance.setCreationCorrelationId(buildPlanInstance.getCorrelationId()); + this.serviceTemplateInstanceRepository.add(instance); + new PlanInstanceRepository().update(buildPlanInstance); + + return instance; + } + + private Document createServiceInstanceInitialPropertiesFromServiceTemplate(final CsarId csarId, + final String serviceTemplateId) { + + final Document existingProperties = + this.serviceTemplateService.getPropertiesOfServiceTemplate(csarId, serviceTemplateId); + + if (existingProperties != null) { + return existingProperties; + } + + logger.debug("No Properties found in BoundaryDefinitions for ST {} thus creating blank ones", + serviceTemplateId); + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + DocumentBuilder db; + try { + db = dbf.newDocumentBuilder(); + final Document doc = db.newDocument(); + final Element createElementNS = + doc.createElementNS("http://docs.oasis-open.org/tosca/ns/2011/12", "Properties"); + createElementNS.setAttribute("xmlns:tosca", "http://docs.oasis-open.org/tosca/ns/2011/12"); + createElementNS.setPrefix("tosca"); + doc.appendChild(createElementNS); + + return doc; + } catch (final ParserConfigurationException e) { + logger.info("Cannot create a new DocumentBuilder: {}", e.getMessage()); + } + + return null; // this should never happen + } + + /* Node Template Instances */ + public Collection getNodeTemplateInstances(final String nodeTemplateName) { + logger.debug("Requesting instances of NodeTemplate \"{}\"...", nodeTemplateName); + return this.nodeTemplateInstanceRepository.findByTemplateId(nodeTemplateName); + } + + public Collection getAllNodeTemplateInstances() { + logger.debug("Requesting all NodeTemplate instances"); + return this.nodeTemplateInstanceRepository.findAll(); + } + + public NodeTemplateInstance resolveNodeTemplateInstance(final String serviceTemplateName, + final String nodeTemplateId, final Long id) { + // We only need to check that the instance belongs to the template, the rest is + // guaranteed while this is a sub-resource + final NodeTemplateInstance instance = getNodeTemplateInstance(id); + if (!(instance.getTemplateId().equals(nodeTemplateId) + && instance.getServiceTemplateInstance().getTemplateId().equals(serviceTemplateName))) { + logger.info("Node template instance <{}> could not be found", id); + throw new NotFoundException(String.format("Node template instance <%s> could not be found", id)); + } + + return instance; + } + + public NodeTemplateInstance getNodeTemplateInstance(final Long id) { + logger.debug("Requesting node template instance <{}>...", id); + final Optional instance = this.nodeTemplateInstanceRepository.find(id); + + if (instance.isPresent()) { + return instance.get(); + } + + logger.debug("Node Template Instance <" + id + "> not found."); + throw new NotFoundException("Node Template Instance <" + id + "> not found."); + } + + public NodeTemplateInstanceState getNodeTemplateInstanceState(final String serviceTemplateQName, + final String nodeTemplateId, final Long id) { + final NodeTemplateInstance node = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); + + return node.getState(); + } + + public void setNodeTemplateInstanceState(final String serviceTemplateName, final String nodeTemplateId, + final Long id, + final String state) throws NotFoundException, IllegalArgumentException { + + NodeTemplateInstanceState newState; + try { + newState = NodeTemplateInstanceState.valueOf(state); + } catch (final Exception e) { + final String msg = String.format("The given state %s is an illegal node template instance state.", state); + logger.debug(msg); + throw new IllegalArgumentException(msg, e); + } + + final NodeTemplateInstance node = resolveNodeTemplateInstance(serviceTemplateName, nodeTemplateId, id); + node.setState(newState); + this.nodeTemplateInstanceRepository.update(node); + } + + public Document getNodeTemplateInstanceProperties(final String serviceTemplateQName, final String nodeTemplateId, + final Long id) throws NotFoundException { + final NodeTemplateInstance node = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); + final Optional firstProp = node.getProperties().stream().findFirst(); + + if (firstProp.isPresent()) { + return convertPropertyToDocument(firstProp.get()); + } + + final String msg = String.format("No properties are found for the node template instance <%s>", id); + logger.debug(msg); + return null; + } + + public void setNodeTemplateInstanceProperties(final String serviceTemplateQName, final String nodeTemplateId, + final Long id, + final Document properties) throws ReflectiveOperationException { + final NodeTemplateInstance node = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); + + try { + final NodeTemplateInstanceProperty property = + this.convertDocumentToProperty(properties, NodeTemplateInstanceProperty.class); + node.addProperty(property); + this.nodeTemplateInstanceRepository.update(node); + } catch (InstantiationException | IllegalAccessException e) { // This is not supposed to happen at all! + final String msg = String.format("An error occurred while instantiating an instance of the %s class.", + NodeTemplateInstanceProperty.class); + logger.debug(msg); + throw e; + } + } + + public NodeTemplateInstance createNewNodeTemplateInstance(final String csarId, + final String serviceTemplateNameAsString, + final String nodeTemplateId, + final Long serviceTemplateInstanceId) throws InstantiationException, + IllegalAccessException, + IllegalArgumentException { + final Csar csar = storage.findById(new CsarId(csarId)); + final TServiceTemplate serviceTemplate; + final TNodeTemplate nodeTemplate; + try { + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateNameAsString); + nodeTemplate = ToscaEngine.resolveNodeTemplate(serviceTemplate, nodeTemplateId); + } catch (org.opentosca.container.core.common.NotFoundException e) { + throw new NotFoundException(e.getMessage(), e); + } + final NodeTemplateDTO dto = nodeTemplateService.createNodeTemplate(nodeTemplate, csar); + final Document propertiesAsDocument = ToscaEngine.getEntityTemplateProperties(nodeTemplate); + + // Properties + // We set the properties of the template as initial properties + final NodeTemplateInstance newInstance = new NodeTemplateInstance(); + if (propertiesAsDocument != null) { + final NodeTemplateInstanceProperty properties = + this.convertDocumentToProperty(propertiesAsDocument, NodeTemplateInstanceProperty.class); + newInstance.addProperty(properties); + } + // State + newInstance.setState(NodeTemplateInstanceState.INITIAL); + // Template + newInstance.setTemplateId(nodeTemplate.getIdFromIdOrNameField()); + // Type + newInstance.setTemplateType(QName.valueOf(dto.getNodeType())); + // ServiceTemplateInstance + final ServiceTemplateInstance serviceTemplateInstance = getServiceTemplateInstance(serviceTemplateInstanceId, false); + + // only compare the local Id, because ServiceTemplateInstance does not keep the + // fully namespaced QName as the parent Id (which sucks, but it is what it is for now) + if (!serviceTemplateInstance.getTemplateId().equals(serviceTemplate.getIdFromIdOrNameField())) { + final String msg = + String.format("Service template instance id <%s> does not belong to service template: %s", + serviceTemplateInstanceId, serviceTemplate.getName()); + logger.debug(msg); + throw new IllegalArgumentException(msg); + } + newInstance.setServiceTemplateInstance(serviceTemplateInstance); + + this.nodeTemplateInstanceRepository.add(newInstance); + + return newInstance; + } + + public void deleteNodeTemplateInstance(final String serviceTemplateQName, final String nodeTemplateId, + final Long id) { + // throws exception if not found + final NodeTemplateInstance instance = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); + this.nodeTemplateInstanceRepository.remove(instance); + } + + /* Relationship Template Instances */ + public Collection getRelationshipTemplateInstances(final String relationshipTemplateQName) { + logger.debug("Requesting instances of RelationshipTemplate \"{}\"...", relationshipTemplateQName); + return this.relationshipTemplateInstanceRepository.findByTemplateId(relationshipTemplateQName); + } + + /** + * Gets a reference to the relationship template instance. Ensures that the instance actually belongs to the + * relationship template. + * + * @throws NotFoundException if the instance does not belong to the relationship template + */ + public RelationshipTemplateInstance resolveRelationshipTemplateInstance(final String serviceTemplateName, + final String relationshipTemplateId, + final Long instanceId) throws NotFoundException { + // We only need to check that the instance belongs to the template, the rest is + // guaranteed while this is a sub-resource + final RelationshipTemplateInstance instance = getRelationshipTemplateInstance(instanceId); + if (!(instance.getTemplateId().equals(relationshipTemplateId) + && instance.getServiceTemplateInstance().getTemplateId().equals(serviceTemplateName))) { + logger.info("Relationship template instance <{}> could not be found", instanceId); + throw new NotFoundException( + String.format("Relationship template instance <%s> could not be found", instanceId)); + } + + return instance; + } + + private RelationshipTemplateInstance getRelationshipTemplateInstance(final Long id) { + logger.debug("Requesting relationship template instance <{}>...", id); + final Optional instance = this.relationshipTemplateInstanceRepository.find(id); + + if (instance.isPresent()) { + return instance.get(); + } + + logger.debug("Relationship Template Instance <" + id + "> not found."); + throw new NotFoundException("Relationship Template Instance <" + id + "> not found."); + } + + public RelationshipTemplateInstanceState getRelationshipTemplateInstanceState(final String serviceTemplateQName, + final String relationshipTemplateId, + final Long id) { + final RelationshipTemplateInstance relationship = + resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, id); + + return relationship.getState(); + } + + public void setRelationshipTemplateInstanceState(final String serviceTemplateQName, + final String relationshipTemplateId, final Long id, + final String state) throws NotFoundException, + IllegalArgumentException { + RelationshipTemplateInstanceState newState; + try { + newState = RelationshipTemplateInstanceState.valueOf(state); + } catch (final Exception e) { + final String msg = + String.format("The given state %s is an illegal relationship template instance state.", state); + logger.debug(msg); + throw new IllegalArgumentException(msg, e); + } + + final RelationshipTemplateInstance relationship = + resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, id); + relationship.setState(newState); + this.relationshipTemplateInstanceRepository.update(relationship); + } + + public Document getRelationshipTemplateInstanceProperties(final String serviceTemplateQName, + final String relationshipTemplateId, + final Long id) throws NotFoundException { + final RelationshipTemplateInstance relationship = + resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, id); + final Optional firstProp = + relationship.getProperties().stream().findFirst(); + + if (firstProp.isPresent()) { + return convertPropertyToDocument(firstProp.get()); + } + + final String msg = String.format("No properties are found for the relationship template instance <%s>", id); + logger.debug(msg); + + return null; + } + + public void setRelationshipTemplateInstanceProperties(final String serviceTemplateQName, + final String relationshipTemplateId, final Long id, + final Document properties) throws ReflectiveOperationException { + final RelationshipTemplateInstance relationship = + resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, id); + + try { + final RelationshipTemplateInstanceProperty property = + this.convertDocumentToProperty(properties, RelationshipTemplateInstanceProperty.class); + relationship.addProperty(property); + this.relationshipTemplateInstanceRepository.update(relationship); + } catch (InstantiationException | IllegalAccessException e) { // This is not supposed to happen at all! + final String msg = String.format("An error occurred while instantiating an instance of the %s class.", + RelationshipTemplateInstanceProperty.class); + logger.debug(msg); + throw e; + } + } + + public RelationshipTemplateInstance createNewRelationshipTemplateInstance(final String csarId, + final String serviceTemplateName, + final String relationshipTemplateId, + final CreateRelationshipTemplateInstanceRequest request) throws InstantiationException, + IllegalAccessException, + IllegalArgumentException { + + if (request == null || request.getSourceNodeTemplateInstanceId() == null + || request.getTargetNodeTemplateInstanceId() == null) { + final String msg = "Relationship template instance creation request is empty or missing content"; + logger.info(msg); + throw new IllegalArgumentException(msg); + } + + final RelationshipTemplateInstance newInstance = new RelationshipTemplateInstance(); + final RelationshipTemplateDTO dto = + this.relationshipTemplateService.getRelationshipTemplateById(csarId, serviceTemplateName, + relationshipTemplateId); + + // Properties + // We set the properties of the template as initial properties + final Document propertiesAsDocument = + this.relationshipTemplateService.getPropertiesOfRelationshipTemplate(csarId, serviceTemplateName, + relationshipTemplateId); + + if (propertiesAsDocument != null) { + final RelationshipTemplateInstanceProperty properties = + this.convertDocumentToProperty(propertiesAsDocument, RelationshipTemplateInstanceProperty.class); + newInstance.addProperty(properties); + } + // State + newInstance.setState(RelationshipTemplateInstanceState.INITIAL); + // Template + newInstance.setTemplateId(relationshipTemplateId); + // Type + newInstance.setTemplateType(QName.valueOf(dto.getRelationshipType())); + // Source node instance + newInstance.setSource(getNodeTemplateInstance(request.getSourceNodeTemplateInstanceId())); + // Target node instance + newInstance.setTarget(getNodeTemplateInstance(request.getTargetNodeTemplateInstanceId())); + newInstance.setServiceTemplateInstance(serviceTemplateInstanceRepository.find(request.getServiceInstanceId()).get()); + + this.relationshipTemplateInstanceRepository.add(newInstance); + + return newInstance; + } + + public void deleteRelationshipTemplateInstance(final String serviceTemplateQName, + final String relationshipTemplateId, final Long instanceId) { + // throws exception if not found + final RelationshipTemplateInstance instance = + resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, instanceId); + this.relationshipTemplateInstanceRepository.remove(instance); + } + + /* Situations */ + public Situation createNewSituation(final String thingId, final String situationTemplateId, final boolean active, + final float eventProbability, final String eventTime) { + final Situation newInstance = new Situation(); + + newInstance.setSituationTemplateId(situationTemplateId); + newInstance.setThingId(thingId); + newInstance.setActive(active); + newInstance.setEventProbability(eventProbability); + newInstance.setEventTime(eventTime); + + this.sitRepo.add(newInstance); + + return newInstance; + } + + public Situation getSituation(final Long id) { + final Optional instance = this.sitRepo.find(id); + if (instance.isPresent()) { + return instance.get(); + } + throw new NotFoundException("Situation <" + id + "> not found."); + } + + public Collection getSituations() { + return this.sitRepo.findAll(); + } + + public boolean removeSituation(final Long situationId) { + if (this.sitTrig.findSituationTriggersBySituationId(situationId).isEmpty()) { + this.sitRepo.find(situationId).ifPresent(x -> this.sitRepo.remove(x)); + return true; + } + return false; + } + + public Collection getSituationTriggers() { + return this.sitTrig.findAll(); + } + + public Collection getSituationTriggers(final Situation situation) { + return this.sitTrig.findSituationTriggersBySituationId(situation.getId()); + } + + public SituationTrigger createNewSituationTrigger(final Collection situations, final CsarId csarId, + final boolean triggerOnActivation, final boolean isSingleInstance, + final ServiceTemplateInstance serviceInstance, + final NodeTemplateInstance nodeInstance, + final String interfaceName, final String operationName, + final Set inputs, + final float eventProbability, final String eventTime) { + final SituationTrigger newInstance = new SituationTrigger(); + + newInstance.setSituations(situations); + newInstance.setCsarId(csarId); + newInstance.setTriggerOnActivation(triggerOnActivation); + newInstance.setSingleInstance(isSingleInstance); + newInstance.setServiceInstance(serviceInstance); + newInstance.setInterfaceName(interfaceName); + newInstance.setOperationName(operationName); + if (nodeInstance != null) { + newInstance.setNodeInstance(nodeInstance); + } + + for (SituationTriggerProperty input : inputs) { + input.setSituationTrigger(newInstance); + } + + newInstance.setInputs(inputs); + + if (eventProbability != -1.0f) { + newInstance.setEventProbability(eventProbability); + } + + if (eventTime != null) { + newInstance.setEventTime(eventTime); + } + + this.sitTrig.add(newInstance); + + return newInstance; + } + + public SituationTrigger getSituationTrigger(final Long id) { + final Optional opt = this.sitTrig.find(id); + + if (opt.isPresent()) { + return opt.get(); + } + + throw new NotFoundException("SituationTrigger <" + id + "> not found."); + } + + public void removeSituationTrigger(Long situationTriggerId) { + this.sitTrig.find(situationTriggerId).ifPresent(x -> this.sitTrig.remove(x)); + } + + public Collection geSituationTriggerInstances(final SituationTrigger trigger) { + final Collection triggerInstances = Lists.newArrayList(); + for (final SituationTriggerInstance triggerInstance : this.sitTrigInst.findAll()) { + if (triggerInstance.getSituationTrigger().equals(trigger)) { + triggerInstances.add(triggerInstance); + } + } + return triggerInstances; + } + + public void updateSituation(final Situation situation) { + this.sitRepo.update(situation); + } + + public SituationTriggerInstance getSituationTriggerInstance(final Long id) { + return this.sitTrigInst.find(id) + .orElseThrow(() -> new RuntimeException("SituationTriggerInstance <" + id + "> not found.")); + } + + public SituationsMonitor createNewSituationsMonitor(final ServiceTemplateInstance instance, + final Map> situations) { + final SituationsMonitor monitor = new SituationsMonitor(); + + monitor.setServiceInstance(instance); + + monitor.setNode2Situations(situations); + + this.situationsMonitorRepo.add(monitor); + return monitor; + } + + public Collection getSituationsMonitors() { + return this.situationsMonitorRepo.findAll(); + } + + public Collection getSituationsMonitors(final Long serviceInstanceID) { + return this.getSituationsMonitors().stream() + .filter(monitor -> monitor.getServiceInstance() != null + && monitor.getServiceInstance().getId().equals(serviceInstanceID)) + .collect(Collectors.toList()); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/NodeTemplateService.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/NodeTemplateService.java new file mode 100644 index 000000000..e3230404c --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/NodeTemplateService.java @@ -0,0 +1,186 @@ +package org.opentosca.container.api.service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TInterface; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TOperation; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.api.dto.NodeOperationDTO; +import org.opentosca.container.api.dto.NodeTemplateDTO; +import org.opentosca.container.api.dto.boundarydefinitions.InterfaceDTO; +import org.opentosca.container.api.dto.boundarydefinitions.InterfaceListDTO; +import org.opentosca.container.api.dto.boundarydefinitions.OperationDTO; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.tosca.extension.TParameter; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; + +/** + * Provides data access functionality to retrieve node templates based on a service template. Throughout the class, it + * is assumed that the passed service template id belongs to the passed CSAR, i.e., it is assumed that a check that this + * is true is performed earlier. + * + * @author Ghareeb Falazi + */ +// TODO it is assumed that the name of the node template is the same as its id. +// That assumption is not accurate +@Service +public class NodeTemplateService { + + private final CsarStorageService storage; + + @Inject + public NodeTemplateService(CsarStorageService storage) { + this.storage = storage; + } + + /** + * Gets a collection of node templates associated to a given service template. + * + * @param csarId The id of the CSAR + * @param serviceTemplateQName The QName of the service template within the given CSAR + * @return A collection of node templates stored within the given service template. + */ + public List getNodeTemplatesOfServiceTemplate(final String csarId, + final String serviceTemplateQName) { + final Csar csar = storage.findById(new CsarId(csarId)); + + List nodeTemplates = csar.serviceTemplates().stream() + .filter(st -> st.getName().equals(serviceTemplateQName)) + .findFirst() + .get() + .getTopologyTemplate() + .getNodeTemplates(); + + return nodeTemplates.stream() + .map(toscaNodeTemplate -> createNodeTemplate(toscaNodeTemplate, csar)) + .collect(Collectors.toList()); + } + + /** + * Gets the node template specified by its id + * + * @param csarId The id of the CSAR + * @param serviceTemplateQName The QName of the service template within the given CSAR + * @param nodeTemplateId The id of the node template we want to get and that belongs to the specified service + * template + * @return The node template specified by the given id + * @throws NotFoundException If the service template does not contain the specified node template + */ + public NodeTemplateDTO getNodeTemplateById(final String csarId, final String serviceTemplateQName, + final String nodeTemplateId) throws NotFoundException { + final Csar csar = storage.findById(new CsarId(csarId)); + TServiceTemplate serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateQName); + TNodeTemplate nodeTemplate = ToscaEngine.resolveNodeTemplate(serviceTemplate, nodeTemplateId); + + return createNodeTemplate(nodeTemplate, csar); + } + + /** + * Checks whether the specified service template contains a given node template. + * + * @param csarId The id of the CSAR + * @param serviceTemplateName the name of the service template + * @param nodeTemplateId the id of the node template to check for + * @return true when the CSAR contains the service template and the service + * template contains the node template, otherwise false + */ + public boolean hasNodeTemplate(final String csarId, final String serviceTemplateName, final String nodeTemplateId) { + final Csar csar = this.storage.findById(new CsarId(csarId)); + try { + TServiceTemplate serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateName); + @SuppressWarnings("unused") + TNodeTemplate indicator = ToscaEngine.resolveNodeTemplate(serviceTemplate, nodeTemplateId); + return true; + } catch (NotFoundException e) { + return false; + } + } + + /** + * Gets the properties (as an XML document) of a given node template. + */ + public Document getPropertiesOfNodeTemplate(final String csarId, final String serviceTemplateQName, + final String nodeTemplateId) throws NotFoundException { + final Csar csar = storage.findById(new CsarId(csarId)); + + TServiceTemplate serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateQName); + TNodeTemplate nodeTemplate = ToscaEngine.resolveNodeTemplate(serviceTemplate, nodeTemplateId); + + return ToscaEngine.getEntityTemplateProperties(nodeTemplate); + } + + // TODO Careful! this method assumes that the namespace of a node template is the same namespace + // as its parent service template! + + /** + * Creates a new instance of the NodeTemplateDTO class. It fetches the qualified name of node type of the node + * template. + */ + public NodeTemplateDTO createNodeTemplate(final TNodeTemplate toscaObject, final Csar csar) { + final QName nodeTypeId = toscaObject.getType(); + final NodeTemplateDTO currentNodeTemplate = new NodeTemplateDTO(); + currentNodeTemplate.setId(toscaObject.getId()); + currentNodeTemplate.setName(toscaObject.getName()); + currentNodeTemplate.setNodeType(nodeTypeId.toString()); + + final InterfaceListDTO interfaces = new InterfaceListDTO(); + final List ifaces = ToscaEngine.getInterfaces(toscaObject, csar); + for (final TInterface toscaInterface : ifaces) { + final InterfaceDTO interfaceDto = new InterfaceDTO(); + interfaceDto.setName(toscaInterface.getName()); + + final Map operations = new HashMap<>(); + final List interfaceOperations = toscaInterface.getOperation(); + for (final TOperation operation : interfaceOperations) { + final OperationDTO operationDto = new OperationDTO(); + operationDto.setName(operation.getName()); + operationDto.setNodeOperation(transformNodeOperations(operation)); + operations.put(operation.getName(), operationDto); + } + interfaceDto.setOperations(operations); + interfaces.add(interfaceDto); + } + currentNodeTemplate.setInterfaces(interfaces); + return currentNodeTemplate; + } + + private NodeOperationDTO transformNodeOperations(TOperation operation) { + TOperation.InputParameters inputParams = operation.getInputParameters(); + TOperation.OutputParameters outputParams = operation.getOutputParameters(); + + final NodeOperationDTO nodeOperationDTO = new NodeOperationDTO(); + nodeOperationDTO.setName(operation.getName()); + nodeOperationDTO.setInputParameters(inputParams == null ? Collections.emptyList() + : wrap(inputParams.getInputParameter())); + nodeOperationDTO.setOutputParameters(outputParams == null ? Collections.emptyList() + : wrap(outputParams.getOutputParameter())); + return nodeOperationDTO; + } + + private List wrap(final List params) { + final List wrapped = new ArrayList<>(); + for (final org.eclipse.winery.model.tosca.TParameter param : params) { + final TParameter tParam = new TParameter(); + tParam.setName(param.getName()); + tParam.setType(param.getType()); + tParam.setRequired(param.getRequired()); + wrapped.add(tParam); + } + return wrapped; + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/PlanService.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/PlanService.java new file mode 100644 index 000000000..0aa566561 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/PlanService.java @@ -0,0 +1,159 @@ +package org.opentosca.container.api.service; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.ws.rs.NotFoundException; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.api.dto.plan.PlanDTO; +import org.opentosca.container.control.OpenToscaControlService; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanInstanceEvent; +import org.opentosca.container.core.next.model.PlanInstanceState; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.repository.PlanInstanceRepository; +import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; +import org.opentosca.container.core.tosca.convention.Interfaces; +import org.opentosca.container.core.tosca.extension.TParameter; +import org.opentosca.deployment.checks.DeploymentTestService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +@Service +public class PlanService { + + private static final PlanType[] ALL_PLAN_TYPES = PlanType.values(); + private static Logger logger = LoggerFactory.getLogger(PlanService.class); + private final OpenToscaControlService controlService; + private final DeploymentTestService deploymentTestService; + private final PlanInstanceRepository planInstanceRepository = new PlanInstanceRepository(); + + @Inject + public PlanService(OpenToscaControlService controlService, DeploymentTestService deploymentTestService) { + this.controlService = controlService; + this.deploymentTestService = deploymentTestService; + } + + public List getPlanInstances(final Csar csar, final PlanType... planTypes) { + final ServiceTemplateInstanceRepository repo = new ServiceTemplateInstanceRepository(); + final Collection serviceInstances = repo.findByCsarId(csar.id()); + return serviceInstances.stream() + .flatMap(sti -> sti.getPlanInstances().stream()) + .filter(p -> { + final PlanType currentType = PlanType.fromString(p.getType().toString()); + return Arrays.stream(planTypes).anyMatch(pt -> pt.equals(currentType)); + }) + .collect(Collectors.toList()); + } + + /** + * Get DTO for the plan with the given Id in the given Csar + * + * @param csar the Csar containing the plan + * @param planTypes an array with possible types of the plan + * @param planId the Id of the plan + * @return the PlanDto if found or + * @throws NotFoundException is thrown if the plan can not be found + */ + public PlanDTO getPlanDto(Csar csar, PlanType[] planTypes, String planId) throws NotFoundException { + return csar.plans().stream() + .filter(tplan -> Arrays.stream(planTypes).anyMatch(pt -> tplan.getPlanType().equals(pt.toString()))) + .filter(tplan -> tplan.getId() != null && tplan.getId().equals(planId)) + .findFirst() + .map(PlanDTO::new) + .orElseThrow(NotFoundException::new); + } + + public PlanInstance getPlanInstanceByCorrelationId(final String correlationId) { + return planInstanceRepository.findByCorrelationId(correlationId); + } + + public PlanInstance resolvePlanInstance(Csar csar, TServiceTemplate serviceTemplate, Long serviceTemplateInstanceId, String planId, String planInstanceId, PlanType... planTypes) { + TPlan plan = csar.plans().stream() + .filter(tplan -> tplan.getId().equals(planId) && Arrays.stream(planTypes).anyMatch(pt -> tplan.getPlanType().equals(pt.toString()))) + .findFirst() + .orElseThrow(() -> new NotFoundException("Plan \"" + planId + "\" could not be found")); + + final PlanInstanceRepository repository = new PlanInstanceRepository(); + final PlanInstance pi = repository.findByCorrelationId(planInstanceId); + + if (pi == null) { + final String msg = "Plan instance '" + planInstanceId + "' not found"; + logger.info(msg); + throw new NotFoundException(msg); + } + if (!pi.getTemplateId().getLocalPart().equals(plan.getId())) { + throw new NotFoundException(String.format("The passed plan instance <%s> does not belong to the passed plan template: %s", planInstanceId, plan)); + } + + final Long id = pi.getServiceTemplateInstance().getId(); + if (serviceTemplateInstanceId != null && serviceTemplateInstanceId != id) { + throw new NotFoundException(String.format("The passed service template instance id <%s> does not match the service template instance id that is associated with the plan instance <%s> ", + serviceTemplateInstanceId, id, planInstanceId)); + } + return pi; + } + + public boolean updatePlanInstanceState(PlanInstance instance, PlanInstanceState newState) { + try { + instance.setState(newState); + this.planInstanceRepository.update(instance); + return true; + } catch (final IllegalArgumentException e) { + logger.info("The given state {} is an illegal plan instance state.", newState); + return false; + } + } + + public void addLogToPlanInstance(PlanInstance instance, PlanInstanceEvent event) { + instance.addEvent(event); + planInstanceRepository.update(instance); + } + + public String invokePlan(Csar csar, TServiceTemplate serviceTemplate, Long serviceTemplateInstanceId, String planId, List parameters, PlanType... planTypes) { + TPlan plan = csar.plans().stream() + .filter(tplan -> tplan.getId().equals(planId) + && Arrays.stream(planTypes).anyMatch(pt -> tplan.getPlanType().equals(pt.toString()))) + .findFirst() + .orElseThrow(() -> new NotFoundException("Plan \"" + planId + "\" could not be found")); + + final String namespace = serviceTemplate.getTargetNamespace(); + final PlanDTO dto = new PlanDTO(plan); + + dto.setId(new QName(namespace, plan.getId()).toString()); + enhanceInputParameters(csar, serviceTemplate, serviceTemplateInstanceId, parameters); + dto.setInputParameters(parameters); + + final String correlationId = controlService.invokePlanInvocation(csar.id(), serviceTemplate, + serviceTemplateInstanceId, + PlanDTO.Converter.convert(dto)); + if (PlanType.fromString(plan.getPlanType()).equals(PlanType.BUILD) + && Boolean.parseBoolean(Settings.OPENTOSCA_DEPLOYMENT_TESTS)) { + logger.debug("Plan \"{}\" is a build plan, so we schedule deployment tests...", plan.getName()); + this.deploymentTestService.runAfterPlan(csar.id(), correlationId); + } + return correlationId; + } + + private void enhanceInputParameters(Csar csar, TServiceTemplate serviceTemplate, Long serviceTemplateInstanceId, List parameters) { + // set "meta" params + for (final TParameter param : parameters) { + if (param.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT) + && param.getValue() != null && param.getValue().isEmpty()) { + final String containerRepoUrl = Settings.getSetting("org.opentosca.container.connector.winery.url"); + param.setValue(containerRepoUrl); + } + } + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/PropertyMappingsHelper.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/PropertyMappingsHelper.java new file mode 100644 index 000000000..42789a5a2 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/PropertyMappingsHelper.java @@ -0,0 +1,278 @@ +package org.opentosca.container.api.service; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import javax.ws.rs.NotFoundException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.eclipse.winery.model.tosca.TBoundaryDefinitions; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TPropertyMapping; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstanceProperty; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstanceProperty; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class PropertyMappingsHelper { + private static Logger logger = LoggerFactory.getLogger(PropertyMappingsHelper.class); + private final InstanceService instanceService; + private final CsarStorageService storage; + + public PropertyMappingsHelper(final InstanceService instanceService, CsarStorageService storage) { + this.instanceService = instanceService; + this.storage = storage; + } + + /** + * Evaluates the property mappings of a boundary definition's properties against the xml fragment representing these + * properties and uses node template instances for this purpose. + * + * @param serviceInstance the service template instance whose property mappings we want to evaluate + * @return the xml fragment representing the properties after property mappings are evaluated + * @throws NotFoundException thrown when the id does not correspond to a service template instance + */ + public void evaluatePropertyMappings(final ServiceTemplateInstance serviceInstance) throws NotFoundException { + final Document propertiesAsXML = serviceInstance.getPropertiesAsDocument(); + // check if the serviceInstance has properties + if (propertiesAsXML == null) { + return; + } + updateServiceInstanceProperties(serviceInstance, propertiesAsXML); + } + + private void updateServiceInstanceProperties(final ServiceTemplateInstance serviceInstance, + final Document proprtiesAsXML) { + Csar owningCsar = storage.findById(serviceInstance.getCsarId()); + TServiceTemplate template = null; + try { + template = ToscaEngine.resolveServiceTemplate(owningCsar, serviceInstance.getTemplateId()); + } catch (org.opentosca.container.core.common.NotFoundException e) { + logger.warn("Could not find service template associated with the serviceTemplateInstance {}", serviceInstance.getId(), e); + return; + } + // check if the serviceTemplate has propertyMappings + if (Objects.isNull(template.getBoundaryDefinitions()) || Objects.isNull(template.getBoundaryDefinitions().getProperties()) + || Objects.isNull(template.getBoundaryDefinitions().getProperties().getPropertyMappings())) { + // if there are no property mappings there is no need to update. The + // properties can only be updated by external clients via setting + // properties by hand + return; + } + final TBoundaryDefinitions.Properties.PropertyMappings propertyMappings = template.getBoundaryDefinitions().getProperties().getPropertyMappings(); + + // cycle through mappings and update accordingly + for (final TPropertyMapping mapping : propertyMappings.getPropertyMapping()) { + final String serviceTemplatePropertyQuery = mapping.getServiceTemplatePropertyRef(); + final List serviceTemplatePropertyElements = queryElementList((Element) proprtiesAsXML.getFirstChild(), serviceTemplatePropertyQuery); + + // fetch element from serviceTemplateProperties + if (serviceTemplatePropertyElements.size() != 1) { + // skip this property, we expect only one + continue; + } + + // check whether the targetRef is concat query + if (isConcatQuery(mapping.getTargetPropertyRef())) { + // this query needs possibly multiple properties from different nodeInstances + + final String propertyValue = generatePropertyValueFromConcatQuery(mapping.getTargetPropertyRef(), serviceInstance.getNodeTemplateInstances()); + serviceTemplatePropertyElements.get(0).setTextContent(propertyValue); + } else { + // this query only fetches a SINGLE element on the properties of + // the referenced entity + final NodeTemplateInstance nodeInstance = getNodeInstanceFromMappingObject(serviceInstance, mapping.getTargetObjectRef()); + + if (nodeInstance == null) { + continue; + } + + final Optional firstProperty = nodeInstance.getProperties().stream().findFirst(); + if (!firstProperty.isPresent()) { + // skip it, the mapping is invalid + continue; + } + + final Document nodeProperties = this.instanceService.convertPropertyToDocument(firstProperty.get()); + final Element nodePropertiesRoot = (Element) nodeProperties.getFirstChild(); + final String nodeTemplatePropertyQuery = mapping.getTargetPropertyRef(); + final List nodePropertyElements = queryElementList(nodePropertiesRoot, nodeTemplatePropertyQuery); + + if (nodePropertyElements.size() != 1) { + // skip this property, we expect only one + continue; + } + + // change the serviceTemplateProperty + serviceTemplatePropertyElements.get(0).setTextContent(nodePropertyElements.get(0).getTextContent()); + } + } + + try { + serviceInstance.setProperties(Collections.singleton(this.instanceService.convertDocumentToProperty(proprtiesAsXML, + ServiceTemplateInstanceProperty.class))); + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException e) { + logger.error("Failed to store properties in service template instance object. Reason {}", e.getMessage()); + } + } + + private List queryElementList(final Element node, final String xpathQuery) { + final List elements = new ArrayList<>(); + try { + final XPath xPath = XPathFactory.newInstance().newXPath(); + final NodeList nodes = (NodeList) xPath.evaluate(xpathQuery, node, XPathConstants.NODESET); + for (int index = 0; index < nodes.getLength(); index++) { + if (nodes.item(index).getNodeType() == Node.ELEMENT_NODE) { + elements.add((Element) nodes.item(index)); + } + } + } catch (final XPathExpressionException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return elements; + } + + private boolean isConcatQuery(final String xPathQuery) { + final String testString = xPathQuery.trim(); + + if (!testString.startsWith("concat(")) { + return false; + } + + String functionContent = testString.substring("concat(".length()); + functionContent = functionContent.substring(0, functionContent.length() - 1); + + final String[] functionParts = functionContent.split(","); + + for (final String functionPart : functionParts) { + if (functionPart.startsWith("'") && !functionPart.endsWith("'")) { + return false; + } + } + + return true; + } + + private String generatePropertyValueFromConcatQuery(final String targetPropertyRef, + final Collection nodeInstance) { + final String testQuery = targetPropertyRef.trim(); + + if (!testQuery.endsWith(")")) { + return null; + } + + final int functionOpeningBracket = testQuery.indexOf("("); + + final String functionString = testQuery.substring(0, functionOpeningBracket); + + // simple validity check as we only want to be able to concat strings, + // but maybe more later + if (!functionString.equals("concat")) { + return null; + } + + final String functionContent = + testQuery.substring(functionOpeningBracket + 1, testQuery.lastIndexOf(")")).trim(); + + final String[] functionParts = functionContent.split(","); + + final List augmentedFunctionParts = new ArrayList<>(); + + for (final String functionPart : functionParts) { + if (functionPart.trim().startsWith("'")) { + // string function part, just add to list + augmentedFunctionParts.add(functionPart.trim()); + } else if (functionPart.trim().split("\\.").length == 3) { + // "DSL" Query + final String[] queryParts = functionPart.trim().split("\\."); + // fast check for validity + if (!queryParts[1].equals("Properties")) { + return null; + } + + final String nodeTemplateName = queryParts[0]; + final String propertyName = queryParts[2]; + + if (getNodeInstanceWithName(nodeInstance, nodeTemplateName) != null) { + + final String propValue = + fetchPropertyValueFromNodeInstance(getNodeInstanceWithName(nodeInstance, nodeTemplateName), + propertyName); + + augmentedFunctionParts.add("'" + propValue + "'"); + } + } + } + + // now we have a string of the form: + // concat('someString','somePropertyValue','someString',..) + // just make the concat itself instead of running an XPath query + + String resultString = ""; + for (final String functionPart : augmentedFunctionParts) { + resultString += functionPart.replace("'", ""); + } + + return resultString; + } + + private NodeTemplateInstance getNodeInstanceWithName(final Collection nodeInstances, + final String nodeTemplateId) { + + for (final NodeTemplateInstance nodeInstance : nodeInstances) { + if (nodeInstance.getTemplateId().equals(nodeTemplateId)) { + return nodeInstance; + } + } + + return null; + } + + private String fetchPropertyValueFromNodeInstance(final NodeTemplateInstance nodeInstance, + final String propertyLocalName) { + if (nodeInstance.getProperties() == null) { + return null; + } + + return nodeInstance.getPropertiesAsMap().getOrDefault(propertyLocalName, null); + } + + private NodeTemplateInstance getNodeInstanceFromMappingObject(final ServiceTemplateInstance serviceInstance, + final Object obj) { + if (!(obj instanceof TNodeTemplate)) { + logger.error("Only node templates are supported as target objects for property mappings!"); + return null; + } + final TNodeTemplate template = (TNodeTemplate) obj; + final Collection nodeInstances = serviceInstance.getNodeTemplateInstances(); + if (nodeInstances == null) { + return null; + } + + for (final NodeTemplateInstance nodeInstance : nodeInstances) { + if (nodeInstance.getTemplateId().equals(template.getId())) { + return nodeInstance; + } + } + return null; + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/RelationshipTemplateService.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/RelationshipTemplateService.java new file mode 100644 index 000000000..c3dde8c01 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/RelationshipTemplateService.java @@ -0,0 +1,144 @@ +package org.opentosca.container.api.service; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.ws.rs.NotFoundException; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TEntityTemplate; +import org.eclipse.winery.model.tosca.TRelationshipTemplate; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.api.dto.RelationshipTemplateDTO; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +// TODO it is assumed that the name of the node template is the same as its id. + +/** + * Provides data access functionality to retrieve relationship templates based on a service template. Throughout the + * class, it is assumed that the passed service template id belongs to the passed CSAR, i.e., it is assumed that a check + * that this is true is performed earlier. + * + * @author Ghareeb Falazi + */ +@Service +public class RelationshipTemplateService { + + private static final Logger LOG = LoggerFactory.getLogger(RelationshipTemplateService.class); + + @Inject + private CsarStorageService storage; + + /** + * Gets a collection of relationship templates associated to a given service template. + * + * @param csarId The id of the CSAR + * @param serviceTemplateQName The QName of the service template within the given CSAR + * @return A collection of relationship templates stored within the given service template. + */ + public List getRelationshipTemplatesOfServiceTemplate(final String csarId, + final String serviceTemplateQName) { + final Csar csar = storage.findById(new CsarId(csarId)); + List relationshipTemplates = csar.serviceTemplates().stream() + .filter(st -> st.getName().equals(serviceTemplateQName)) + .findFirst() + .get() + .getTopologyTemplate() + .getRelationshipTemplates(); + + return relationshipTemplates.stream() + .map(RelationshipTemplateDTO::fromToscaObject) + .collect(Collectors.toList()); + } + + /** + * Gets the relationship template specified by its id + * + * @param csarId The id of the CSAR + * @param serviceTemplateName The local name of the service template within the given CSAR + * @param relationshipTemplateId The id of the relationship template we want to get and that belongs to the + * specified service template + * @return The relationship template specified by the given id + * @throws NotFoundException If the service template does not contain the specified relationship template + */ + public RelationshipTemplateDTO getRelationshipTemplateById(final String csarId, final String serviceTemplateName, + final String relationshipTemplateId) throws NotFoundException { + final Csar csar = storage.findById(new CsarId(csarId)); + + TRelationshipTemplate template = csar.serviceTemplates().stream() + .filter(st -> st.getName().equals(serviceTemplateName)) + .findFirst() + .orElseThrow(() -> new NotFoundException("Relationship template \"" + relationshipTemplateId + "\" could not be found")) + .getTopologyTemplate() + .getRelationshipTemplate(relationshipTemplateId); + + return RelationshipTemplateDTO.fromToscaObject(template); + } + + /** + * Checks whether the specified service template contains a given relationship template. + * + * @param csarId The id of the CSAR + * @param serviceTemplateQName the QName of the service template + * @param relationshipTemplateId the id of the relationship template to check for + * @return true when the CSAR contains the service template and the service + * template contains the relationship template, otherwise false + */ + public boolean hasRelationshipTemplate(final String csarId, final QName serviceTemplateQName, + final String relationshipTemplateId) { + return getRelationshipTemplateIdsOfServiceTemplate(csarId, + serviceTemplateQName.toString()).contains(relationshipTemplateId); + } + + /** + * Gets the properties (as an XML document) of a given relationship template. + */ + public Document getPropertiesOfRelationshipTemplate(final String csarId, final String serviceTemplateName, + final String relationshipTemplateId) { + final Csar csar = storage.findById(new CsarId(csarId)); + try { + final TServiceTemplate serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateName); + return ToscaEngine.getRelationshipTemplate(serviceTemplate, relationshipTemplateId) + .map(TRelationshipTemplate::getProperties) + .map(TEntityTemplate.Properties::getInternalAny) + .filter(Element.class::isInstance) + .map(Element.class::cast) + .map(Element::getOwnerDocument) + .orElse(null); + } catch (org.opentosca.container.core.common.NotFoundException e) { + LOG.warn("Could not get properties of relationship template {} for service template {} in csar {}", + relationshipTemplateId, serviceTemplateName, csarId); + } + return null; + } + + /** + * Gets a collection of relationship template ids associated to a given service template. + * + * @param csarId The id of the CSAR + * @param serviceTemplateQName the QName of the service template within the given CSAR + * @return A collection of relationship template ids stored within the given service template. + */ + private List getRelationshipTemplateIdsOfServiceTemplate(final String csarId, + final String serviceTemplateQName) { + final Csar csar = storage.findById(new CsarId(csarId)); + return csar.serviceTemplates().stream() + .filter(st -> st.getId().equals(serviceTemplateQName)) + .findFirst() + .orElseThrow(NotFoundException::new) + .getTopologyTemplate() + .getRelationshipTemplates().stream() + .map(tosca -> tosca.getId()) + .collect(Collectors.toList()); + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/ServiceTemplateService.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/ServiceTemplateService.java new file mode 100644 index 000000000..498c96508 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/service/ServiceTemplateService.java @@ -0,0 +1,83 @@ +package org.opentosca.container.api.service; + +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.ws.rs.NotFoundException; + +import org.eclipse.winery.model.tosca.TBoundaryDefinitions; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +@Service +public class ServiceTemplateService { + + private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateService.class); + + @Inject + private CsarStorageService csarStorage; + + public Set getServiceTemplatesOfCsar(final String csarId) { + final Csar csarContent = this.csarStorage.findById(new CsarId(csarId)); + return csarContent.serviceTemplates().stream().map(TServiceTemplate::getId).collect(Collectors.toSet()); + } + + public Document getPropertiesOfServiceTemplate(final CsarId csarId, final String serviceTemplateId) { + logger.debug("Getting ServiceTemplate properties for " + serviceTemplateId + " in " + csarId); + final Csar csarContent = this.csarStorage.findById(csarId); + final TBoundaryDefinitions boundaryDefs = csarContent.serviceTemplates().stream() + .filter(template -> template.getIdFromIdOrNameField().equals(serviceTemplateId)) + .findFirst() + .map(TServiceTemplate::getBoundaryDefinitions) + .orElseThrow(() -> new NoSuchElementException(String.format("Could not find serviceTemplate with id [%s] on csar [%s]", serviceTemplateId, csarId))); + + if (boundaryDefs != null && boundaryDefs.getProperties() != null) { + logger.debug("Properties found in BoundaryDefinitions for ST {}", serviceTemplateId); + final Element propertiesElement = (Element) boundaryDefs.getProperties().getAny(); + if (null != propertiesElement && null != propertiesElement.getOwnerDocument()) { + return propertiesElement.getOwnerDocument(); + } else { + logger.debug("No properties element found!"); + } + } + + return null; + } + + /** + * Checks whether the specified csarId exists and that it contains the specified service template + * + * @return the CSARID that corresponds to the passed parameter + * @throws NotFoundException if either the CSAR is not found or if does not contain the specified service template. + */ + public CsarId checkServiceTemplateExistence(final String csarId, + final String serviceTemplateQName) throws NotFoundException { + final CsarId assumedId = new CsarId(csarId); + final Csar csarContent = this.csarStorage.findById(assumedId);// throws exception if not found! + + if (!csarContent.serviceTemplates().stream().anyMatch(template -> template.getId().equals(serviceTemplateQName))) { + final String msg = "Service template \"" + serviceTemplateQName + "\" could not be found"; + logger.info(msg); + throw new NotFoundException(msg); + } + + return assumedId; + } + + /* Service Injection */ + + /*********************/ + public void bindStorage(final CsarStorageService storage) { + this.csarStorage = storage; + } +} diff --git a/org.opentosca.container.api/src/main/java/org/opentosca/container/api/util/ModelUtil.java b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/util/ModelUtil.java new file mode 100644 index 000000000..215cbfca9 --- /dev/null +++ b/org.opentosca.container.api/src/main/java/org/opentosca/container/api/util/ModelUtil.java @@ -0,0 +1,76 @@ +package org.opentosca.container.api.util; + +import java.util.List; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.eclipse.winery.model.tosca.RelationshipSourceOrTarget; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TRelationshipTemplate; +import org.eclipse.winery.model.tosca.TRequirement; +import org.eclipse.winery.model.tosca.TServiceTemplate; +import org.eclipse.winery.model.tosca.TTopologyTemplate; + +import org.opentosca.container.core.model.csar.Csar; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public abstract class ModelUtil { + + public static boolean hasOpenRequirements(final Csar csar) { + TServiceTemplate serviceTemplate = csar.entryServiceTemplate(); + TTopologyTemplate topology = serviceTemplate.getTopologyTemplate(); + + List nodeTemplates = topology.getNodeTemplates(); + List relationshipTemplates = topology.getRelationshipTemplates(); + + for (final TNodeTemplate nodeTemplate : nodeTemplates) { + if (nodeTemplate.getRequirements() == null) { + continue; + } + final List nodeTemplateRequirements = nodeTemplate.getRequirements().getRequirement(); + int foundRelations = 0; + for (final TRelationshipTemplate relationship : relationshipTemplates) { + RelationshipSourceOrTarget src = relationship.getSourceElement().getRef(); + RelationshipSourceOrTarget target = relationship.getTargetElement().getRef(); + if ((src instanceof TNodeTemplate && nodeTemplate.equals((TNodeTemplate) src)) + || (target instanceof TNodeTemplate && nodeTemplate.equals((TNodeTemplate) target))) { + foundRelations++; + } + } + + if (foundRelations < nodeTemplateRequirements.size()) { + return true; + } + } + return false; + } + + public static Element fetchFirstChildElement(final Document doc, final String childElementLocalName) { + final NodeList childe = doc.getDocumentElement().getElementsByTagName(childElementLocalName); + for (int i = 0; i < childe.getLength(); i++) { + if (childe.item(i) instanceof Element) { + return (Element) childe.item(i); + } + } + return null; + } + + public static Document createDocumentFromElement(final Element element) { + try { + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setIgnoringComments(true); + final Document doc = dbf.newDocumentBuilder().newDocument(); + final Node importedNode = doc.importNode(element, true); + doc.appendChild(importedNode); + return doc; + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + return null; + } + } +} diff --git a/org.opentosca.container.api/src/main/resources/META-INF/persistence.xml b/org.opentosca.container.api/src/main/resources/META-INF/persistence.xml new file mode 100644 index 000000000..6daa33614 --- /dev/null +++ b/org.opentosca.container.api/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,64 @@ + + + + + + + + + org.opentosca.container.core.common.jpa.CsarIdConverter + org.opentosca.container.core.common.jpa.DocumentConverter + org.opentosca.container.core.common.jpa.PathConverter + org.opentosca.container.core.common.jpa.QNameConverter + org.opentosca.container.core.common.jpa.UriConverter + + + org.opentosca.container.core.next.model.PersistenceObject + org.opentosca.container.core.next.model.Property + org.opentosca.container.core.next.model.ServiceTemplateInstance + org.opentosca.container.core.next.model.ServiceTemplateInstanceProperty + org.opentosca.container.core.next.model.NodeTemplateInstance + org.opentosca.container.core.next.model.NodeTemplateInstanceProperty + org.opentosca.container.core.next.model.RelationshipTemplateInstance + org.opentosca.container.core.next.model.RelationshipTemplateInstanceProperty + org.opentosca.container.core.next.model.PlanInstance + org.opentosca.container.core.next.model.PlanInstanceEvent + org.opentosca.container.core.next.model.PlanInstanceOutput + org.opentosca.container.core.next.model.PlanInstanceInput + + org.opentosca.container.core.next.model.DeploymentTest + org.opentosca.container.core.next.model.DeploymentTestResult + + org.opentosca.container.core.next.model.Situation + org.opentosca.container.core.next.model.SituationTrigger + org.opentosca.container.core.next.model.SituationTriggerProperty + org.opentosca.container.core.next.model.SituationTriggerInstance + org.opentosca.container.core.next.model.SituationTriggerInstanceProperty + org.opentosca.container.core.next.model.SituationsMonitor + org.opentosca.container.core.next.model.SituationsMonitorIdCollection + + org.opentosca.container.core.model.credentials.Credentials + org.opentosca.container.legacy.core.model.CSARContent + org.opentosca.container.core.model.deployment.ia.IADeploymentInfo + org.opentosca.container.core.model.deployment.plan.PlanDeploymentInfo + org.opentosca.container.core.model.deployment.process.DeploymentProcessInfo + org.opentosca.container.core.model.deployment.AbstractDeploymentInfo + org.opentosca.container.core.model.deployment.AbstractFileDeploymentInfo + org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint + org.opentosca.container.core.model.endpoint.rest.RESTEndpoint + + org.opentosca.container.core.model.capability.Capability + + true + + + + + + + + + + diff --git a/org.opentosca.container.api/src/main/resources/spring/context-api.xml b/org.opentosca.container.api/src/main/resources/spring/context-api.xml new file mode 100644 index 000000000..4f95c99a1 --- /dev/null +++ b/org.opentosca.container.api/src/main/resources/spring/context-api.xml @@ -0,0 +1,19 @@ + + + + + Configuration for Spring-Bean service discovery of beans within the org.opentosca.container.api module + + + + + + + + diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/Activator.java b/org.opentosca.container.api/src/org/opentosca/container/api/Activator.java deleted file mode 100644 index 6e4358028..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/Activator.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright 2017 University of Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - *******************************************************************************/ -package org.opentosca.container.api; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import org.glassfish.jersey.jackson.JacksonFeature; -import org.glassfish.jersey.media.multipart.MultiPartFeature; -import org.glassfish.jersey.server.ServerProperties; -import org.opentosca.container.api.config.CorsFilter; -import org.opentosca.container.api.config.JAXBContextProvider; -import org.opentosca.container.api.config.LogFilter; -import org.opentosca.container.api.config.ObjectMapperProvider; -import org.opentosca.container.api.config.PlainTextMessageBodyWriter; -import org.opentosca.container.api.config.URI2XMLMessageBodyWriter; -import org.opentosca.container.api.controller.RootController; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.framework.ServiceRegistration; -import org.osgi.service.cm.Configuration; -import org.osgi.service.cm.ConfigurationAdmin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.eclipsesource.jaxrs.publisher.ApplicationConfiguration; - -public class Activator implements BundleActivator, ApplicationConfiguration { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - private final List> services = new ArrayList<>(); - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - - context = bundleContext; - - // Non-OSGi Endpoint Resources - this.services.add(bundleContext.registerService(RootController.class, new RootController(), null)); - - // Jersey Configuration - configurator(bundleContext); - - this.services.add(bundleContext.registerService(ApplicationConfiguration.class, this, null)); - this.services.add(bundleContext.registerService(CorsFilter.class, new CorsFilter(), null)); - this.services.add(bundleContext.registerService(PlainTextMessageBodyWriter.class, - new PlainTextMessageBodyWriter(), null)); - this.services.add(bundleContext.registerService(URI2XMLMessageBodyWriter.class, new URI2XMLMessageBodyWriter(), - null)); - this.services.add(bundleContext.registerService(ObjectMapperProvider.class, new ObjectMapperProvider(), null)); - this.services.add(bundleContext.registerService(JacksonFeature.class, new JacksonFeature(), null)); - this.services.add(bundleContext.registerService(MultiPartFeature.class, new MultiPartFeature(), null)); - this.services.add(bundleContext.registerService(LogFilter.class, new LogFilter(), null)); - - // Custom JAXBContext provider to have proper error logging. Can be - // removed once the API is in a stable state. - this.services.add(bundleContext.registerService(JAXBContextProvider.class, new JAXBContextProvider(), null)); - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - this.services.forEach(service -> service.unregister()); - context = null; - } - - private void configurator(final BundleContext bundleContext) throws Exception { - final ServiceReference configAdminRef = - bundleContext.getServiceReference(ConfigurationAdmin.class.getName()); - - if (configAdminRef == null) { - logger.warn("Reference to service could not be found, did you activate the bundle?"); - return; - } - - final ConfigurationAdmin configAdmin = (ConfigurationAdmin) bundleContext.getService(configAdminRef); - final Configuration config = configAdmin.getConfiguration("com.eclipsesource.jaxrs.connector", null); - - Dictionary properties = config.getProperties(); - if (properties == null) { - properties = new Hashtable<>(); - } - - properties.put("root", "/"); - - config.update(properties); - // context.ungetService(configAdminRef); - } - - - @Override - public Map getProperties() { - final Map properties = new HashMap<>(); - properties.put(ServerProperties.WADL_FEATURE_DISABLE, true); - return properties; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/BoundaryDefinitionController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/BoundaryDefinitionController.java deleted file mode 100644 index 377f4d50c..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/BoundaryDefinitionController.java +++ /dev/null @@ -1,263 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.net.URI; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import javax.ws.rs.GET; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Link; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Request; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.NodeOperationDTO; -import org.opentosca.container.api.dto.ResourceSupport; -import org.opentosca.container.api.dto.boundarydefinitions.InterfaceDTO; -import org.opentosca.container.api.dto.boundarydefinitions.InterfaceListDTO; -import org.opentosca.container.api.dto.boundarydefinitions.OperationDTO; -import org.opentosca.container.api.dto.boundarydefinitions.PropertiesDTO; -import org.opentosca.container.api.dto.boundarydefinitions.PropertyMappingDTO; -import org.opentosca.container.api.dto.plan.PlanDTO; -import org.opentosca.container.api.service.CsarService; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.model.TEntityTemplate; -import org.opentosca.container.core.tosca.model.TExportedInterface; -import org.opentosca.container.core.tosca.model.TExportedOperation; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPropertyMapping; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -@Path("/csars/{csar}/servicetemplates/{servicetemplate}/boundarydefinitions") -public class BoundaryDefinitionController { - - private static Logger logger = LoggerFactory.getLogger(CsarController.class); - - @Context - private UriInfo uriInfo; - - @Context - private Request request; - - private CsarService csarService; - - private IToscaEngineService engineService; - - private IToscaReferenceMapper referenceMapper; - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response getBoundaryDefinitions(@PathParam("csar") final String csar, - @PathParam("servicetemplate") final String servicetemplate) { - - final CSARContent csarContent = this.csarService.findById(csar); - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), servicetemplate)) { - logger.info("Service template \"" + servicetemplate + "\" could not be found"); - throw new NotFoundException("Service template \"" + servicetemplate + "\" could not be found"); - } - - final ResourceSupport links = new ResourceSupport(); - links.add(UriUtil.generateSubResourceLink(this.uriInfo, "properties", false, "properties")); - links.add(UriUtil.generateSubResourceLink(this.uriInfo, "interfaces", false, "interfaces")); - - // TODO This resource seems to be unused and not implemented - // links.add(Link.fromUri(UriUtils.encode(this.uriInfo.getAbsolutePathBuilder().path("propertyconstraints").build())).rel("propertyconstraints").build()); - // TODO This resource seems to be unused and not implemented - // links.add(Link.fromUri(UriUtils.encode(this.uriInfo.getAbsolutePathBuilder().path("requirements").build())).rel("requirements").build()); - // TODO This resource seems to be unused and not implemented - // links.add(Link.fromUri(UriUtils.encode(this.uriInfo.getAbsolutePathBuilder().path("capabilities").build())).rel("capabilities").build()); - // TODO: This resource seems to be unused and not implemented - // links.add(Link.fromUri(UriUtils.encode(this.uriInfo.getAbsolutePathBuilder().path("policies").build())).rel("policies").build()); - links.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("self").build()); - - return Response.ok(links).build(); - } - - @GET - @Path("/properties") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get properties of a service tempate", response = PropertiesDTO.class) - public Response getBoundaryDefinitionProperties(@ApiParam("ID of CSAR") @PathParam("csar") final String csar, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String servicetemplate) { - - final CSARContent csarContent = this.csarService.findById(csar); - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), servicetemplate)) { - logger.info("Service template \"" + servicetemplate + "\" could not be found"); - throw new NotFoundException("Service template \"" + servicetemplate + "\" could not be found"); - } - - final Object xmlFragment = - this.referenceMapper.getServiceTemplateBoundsPropertiesXMLFragment(csarContent.getCSARID(), - QName.valueOf(servicetemplate)); - final List propertyMappings = - this.referenceMapper.getPropertyMappings(csarContent.getCSARID(), QName.valueOf(servicetemplate)); - final PropertiesDTO dto = new PropertiesDTO(); - logger.debug("XML Fragement: {}", xmlFragment); - dto.setXmlFragment(xmlFragment); - - if (propertyMappings != null) { - logger.debug("Found <{}> property mappings", propertyMappings.size()); - final List propertyMappingDTOs = propertyMappings.stream().map(mapping -> { - - final PropertyMappingDTO result = new PropertyMappingDTO(); - result.setServiceTemplatePropertyRef(mapping.getServiceTemplatePropertyRef()); - result.setTargetPropertyRef(mapping.getTargetPropertyRef()); - - if (!(mapping.getTargetObjectRef() instanceof TEntityTemplate)) { - logger.error("Unexpected mapping target detected for the property (" - + mapping.getServiceTemplatePropertyRef() + ")"); - } else { - result.setTargetObjectRef(((TEntityTemplate) mapping.getTargetObjectRef()).getId()); - } - - return result; - }).collect(Collectors.toList()); - - dto.setPropertyMappings(propertyMappingDTOs); - } - - dto.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("self").build()); - - return Response.ok(dto).build(); - } - - @GET - @Path("/interfaces") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get interfaces of a service tempate", response = InterfaceListDTO.class) - public Response getBoundaryDefinitionInterfaces(@ApiParam("ID of CSAR") @PathParam("csar") final String csar, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String servicetemplate) { - - final CSARContent csarContent = this.csarService.findById(csar); - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), servicetemplate)) { - logger.info("Service template \"" + servicetemplate + "\" could not be found"); - throw new NotFoundException("Service template \"" + servicetemplate + "\" could not be found"); - } - - final List interfaces = - this.referenceMapper.getBoundaryInterfacesOfServiceTemplate(csarContent.getCSARID(), - QName.valueOf(servicetemplate)); - logger.debug("Found <{}> interface(s) in Service Template \"{}\" of CSAR \"{}\" ", interfaces.size(), - servicetemplate, csar); - - final InterfaceListDTO list = new InterfaceListDTO(); - list.add(interfaces.stream().map(name -> { - final InterfaceDTO dto = new InterfaceDTO(); - dto.setName(name); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, name, false, "self")); - return dto; - }).collect(Collectors.toList()).toArray(new InterfaceDTO[] {})); - list.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(list).build(); - } - - @GET - @Path("/interfaces/{name}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get an interface of a service template", response = InterfaceDTO.class) - public Response getBoundaryDefinitionInterface(@ApiParam("interface name") @PathParam("name") final String name, - @ApiParam("ID of CSAR") @PathParam("csar") final String csar, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String servicetemplate) { - - final CSARContent csarContent = this.csarService.findById(csar); - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), servicetemplate)) { - logger.info("Service template \"" + servicetemplate + "\" could not be found"); - throw new NotFoundException("Service template \"" + servicetemplate + "\" could not be found"); - } - - final List operations = - getExportedOperations(csarContent.getCSARID(), QName.valueOf(servicetemplate), name); - - logger.debug("Found <{}> operation(s) for Interface \"{}\" in Service Template \"{}\" of CSAR \"{}\" ", - operations.size(), name, servicetemplate, csar); - - final Map ops = operations.stream().map(o -> { - - final OperationDTO dto = new OperationDTO(); - - dto.setName(o.getName()); - dto.setNodeOperation(NodeOperationDTO.Converter.convert(o.getNodeOperation())); - dto.setRelationshipOperation(o.getRelationshipOperation()); - - if (o.getPlan() != null) { - final PlanDTO plan = new PlanDTO((TPlan) o.getPlan().getPlanRef()); - dto.setPlan(plan); - - // Compute the according URL for the Build or Management Plan - final URI planUrl; - if (PlanTypes.BUILD.toString().equals(plan.getPlanType())) { - // If it's a build plan - planUrl = - this.uriInfo.getBaseUriBuilder() - .path("/csars/{csar}/servicetemplates/{servicetemplate}/buildplans/{buildplan}") - .build(csar, servicetemplate, plan.getId()); - } else { - // ... else we assume it's a management plan - planUrl = - this.uriInfo.getBaseUriBuilder() - .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/:id/managementplans/{managementplan}") - .build(csar, servicetemplate, plan.getId()); - } - - plan.add(Link.fromUri(UriUtil.encode(planUrl)).rel("self").build()); - dto.add(Link.fromUri(UriUtil.encode(planUrl)).rel("plan").build()); - } - - return dto; - }).collect(Collectors.toMap(OperationDTO::getName, t -> t)); - - final InterfaceDTO dto = new InterfaceDTO(); - dto.setName(name); - dto.setOperations(ops); - dto.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(dto).build(); - } - - private List getExportedOperations(final CSARID csarId, final QName serviceTemplate, - final String interfaceName) { - final Map> exportedInterfacesOfCsar = - this.referenceMapper.getExportedInterfacesOfCSAR(csarId); - if (exportedInterfacesOfCsar.containsKey(serviceTemplate)) { - final List exportedInterfaces = exportedInterfacesOfCsar.get(serviceTemplate); - for (final TExportedInterface exportedInterface : exportedInterfaces) { - if (exportedInterface.getName().equalsIgnoreCase(interfaceName)) { - return exportedInterface.getOperation(); - } - } - } - return null; - } - - public void setCsarService(final CsarService csarService) { - this.csarService = csarService; - } - - public void setEngineService(final IToscaEngineService engineService) { - this.engineService = engineService; - // We cannot inject an instance of {@link IToscaReferenceMapper} since - // it is manually created in our default implementation of {@link - // IToscaEngineService} - this.referenceMapper = this.engineService.getToscaReferenceMapper(); - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/BuildPlanController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/BuildPlanController.java deleted file mode 100644 index 9d2f75de5..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/BuildPlanController.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.util.List; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.plan.PlanDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceEventDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceListDTO; -import org.opentosca.container.api.dto.plan.PlanListDTO; -import org.opentosca.container.api.dto.request.CreatePlanInstanceLogEntryRequest; -import org.opentosca.container.api.service.PlanService; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.extension.TParameter; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -public class BuildPlanController { - private final PlanService planService; - - private final CSARID csarId; - private final QName serviceTemplate; - - - private final PlanTypes PLAN_TYPE = PlanTypes.BUILD; - - public BuildPlanController(final CSARID csarId, final QName serviceTemplate, final PlanService planService) { - this.csarId = csarId; - this.serviceTemplate = serviceTemplate; - - this.planService = planService; - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get build plans of service template", response = PlanListDTO.class) - public Response getBuildPlans(@Context final UriInfo uriInfo) { - return this.planService.getPlans(uriInfo, this.csarId, this.serviceTemplate, this.PLAN_TYPE); - } - - @GET - @Path("/{plan}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a build plan", response = PlanDTO.class) - public Response getBuildPlan(@ApiParam("ID of build plan") @PathParam("plan") final String plan, - @Context final UriInfo uriInfo) { - return this.planService.getPlan(plan, uriInfo, this.csarId, this.serviceTemplate, this.PLAN_TYPE); - } - - @GET - @Path("/{plan}/instances") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get build plan instances", response = PlanInstanceListDTO.class) - public Response getBuildPlanInstances(@ApiParam("ID of build plan") @PathParam("plan") final String plan, - @Context final UriInfo uriInfo) { - return this.planService.getPlanInstances(plan, uriInfo, this.csarId, this.serviceTemplate, null, - this.PLAN_TYPE); - } - - @POST - @Path("/{plan}/instances") - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) - @ApiOperation(value = "Invokes a build plan", response = String.class) - public Response invokeBuildPlan(@ApiParam("ID of build plan") @PathParam("plan") final String plan, - @Context final UriInfo uriInfo, - @ApiParam(required = true, - value = "plan input parameters") final List parameters) { - // We pass -1L because "PlanInvocationEngine.invokePlan()" expects it for build plans - return this.planService.invokePlan(plan, uriInfo, parameters, this.csarId, this.serviceTemplate, -1L, - this.PLAN_TYPE); - } - - @GET - @Path("/{plan}/instances/{instance}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a build plan instance", response = PlanInstanceDTO.class) - public Response getBuildPlanInstance(@ApiParam("ID of build plan") @PathParam("plan") final String plan, - @ApiParam("correlation ID") @PathParam("instance") final String instance, - @Context final UriInfo uriInfo) { - return this.planService.getPlanInstance(plan, instance, uriInfo, this.csarId, this.serviceTemplate, null, - this.PLAN_TYPE); - } - - @GET - @Path("/{plan}/instances/{instance}/state") - @Produces({MediaType.TEXT_PLAIN}) - @ApiOperation(value = "Get the state of a build plan instance", response = String.class) - public Response getBuildPlanInstanceState(@ApiParam("ID of build plan") @PathParam("plan") final String plan, - @ApiParam("correlation ID") @PathParam("instance") final String instance, - @Context final UriInfo uriInfo) { - return this.planService.getPlanInstanceState(plan, instance, uriInfo, this.csarId, this.serviceTemplate, null, - this.PLAN_TYPE); - } - - @PUT - @Path("/{plan}/instances/{instance}/state") - @Consumes({MediaType.TEXT_PLAIN}) - @ApiOperation(hidden = true, value = "") - public Response changeBuildPlanInstanceState(@PathParam("plan") final String plan, - @PathParam("instance") final String instance, - @Context final UriInfo uriInfo, final String request) { - return this.planService.changePlanInstanceState(request, plan, instance, uriInfo, this.csarId, - this.serviceTemplate, null, this.PLAN_TYPE); - } - - @GET - @Path("/{plan}/instances/{instance}/logs") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get log entries for a build plan instance", response = PlanInstanceEventDTO.class, - responseContainer = "list") - public Response getBuildPlanInstanceLogs(@ApiParam("ID of build plan") @PathParam("plan") final String plan, - @ApiParam("Correlation ID") @PathParam("instance") final String instance, - @Context final UriInfo uriInfo) { - return this.planService.getPlanInstanceLogs(plan, instance, uriInfo, this.csarId, this.serviceTemplate, null, - this.PLAN_TYPE); - } - - @POST - @Path("/{plan}/instances/{instance}/logs") - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response addBuildPlanLogEntry(@PathParam("plan") final String plan, - @PathParam("instance") final String instance, @Context final UriInfo uriInfo, - final CreatePlanInstanceLogEntryRequest logEntry) { - return this.planService.addLogToPlanInstance(logEntry, plan, instance, uriInfo, this.csarId, - this.serviceTemplate, null, this.PLAN_TYPE); - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/CsarController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/CsarController.java deleted file mode 100644 index 4b1d261e7..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/CsarController.java +++ /dev/null @@ -1,401 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.text.MessageFormat; -import java.util.List; -import java.util.Objects; -import java.util.Set; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Link; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.eclipse.winery.model.selfservice.Application; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.FormDataParam; -import org.opentosca.container.api.controller.content.DirectoryController; -import org.opentosca.container.api.dto.CsarDTO; -import org.opentosca.container.api.dto.CsarListDTO; -import org.opentosca.container.api.dto.request.CsarTransformRequest; -import org.opentosca.container.api.dto.request.CsarUploadRequest; -import org.opentosca.container.api.service.CsarService; -import org.opentosca.container.api.util.ModelUtil; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.connector.winery.WineryConnector; -import org.opentosca.container.control.IOpenToscaControlService; -import org.opentosca.container.core.common.EntityExistsException; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.ICoreFileService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -@Path("/csars") -public class CsarController { - - private static Logger logger = LoggerFactory.getLogger(CsarController.class); - - @Context - private UriInfo uriInfo; - - private CsarService csarService; - - private ICoreFileService fileService; - - private IToscaEngineService engineService; - - private IOpenToscaControlService controlService; - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get all CSARs", response = CsarListDTO.class) - public Response getCsars() { - - final CsarListDTO list = new CsarListDTO(); - - for (final CSARContent csarContent : this.csarService.findAll()) { - final String id = csarContent.getCSARID().getFileName(); - final CsarDTO csar = new CsarDTO(); - csar.setId(id); - csar.setDescription(csarContent.getCSARDescription()); - csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(CsarController.class) - .path(CsarController.class, "getCsar").build(id)) - .rel("self").build()); - list.add(csar); - } - - list.add(Link.fromResource(CsarController.class).rel("self").baseUri(this.uriInfo.getBaseUri()).build()); - - return Response.ok(list).build(); - } - - @GET - @Path("/{csar}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a CSAR", response = CsarDTO.class) - public Response getCsar(@ApiParam("ID of CSAR") @PathParam("csar") final String id) { - - final CSARContent csarContent = this.csarService.findById(id); - final Application metadata = this.csarService.getSelfserviceMetadata(csarContent); - - final CsarDTO csar = CsarDTO.Converter.convert(metadata); - - // Absolute URLs for icon and image - final String urlTemplate = "{0}csars/{1}/content/SELFSERVICE-Metadata/{2}"; - - if (csar.getIconUrl() != null) { - final String iconUrl = - MessageFormat.format(urlTemplate, this.uriInfo.getBaseUri().toString(), id, csar.getIconUrl()); - csar.setIconUrl(iconUrl); - } - if (csar.getImageUrl() != null) { - final String imageUrl = - MessageFormat.format(urlTemplate, this.uriInfo.getBaseUri().toString(), id, csar.getImageUrl()); - csar.setImageUrl(imageUrl); - } - - csar.setId(id); - if (csar.getName() == null) { - csar.setName(id); - } - csar.add(Link.fromResource(ServiceTemplateController.class).rel("servicetemplates") - .baseUri(this.uriInfo.getBaseUri()).build(id)); - // Add direct link to service template - final Set serviceTemplates = this.csarService.getServiceTemplates(new CSARID(id)); - if (serviceTemplates.size() == 1) { - final String name = serviceTemplates.stream().findFirst().get(); - csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(ServiceTemplateController.class) - .path(ServiceTemplateController.class, "getServiceTemplate") - .build(id, UriUtil.encodePathSegment(name))) - .rel("servicetemplate").baseUri(this.uriInfo.getBaseUri()).build()); - } - csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(CsarController.class) - .path(CsarController.class, "getContent").build(id)) - .rel("content").baseUri(this.uriInfo.getBaseUri()).build(id)); - csar.add(Link.fromUri(this.uriInfo.getBaseUriBuilder().path(CsarController.class) - .path(CsarController.class, "getCsar").build(id)) - .rel("self").build()); - - return Response.ok(csar).build(); - } - - @Path("/{csar}/content") - @ApiOperation(hidden = true, value = "") - public DirectoryController getContent(@PathParam("csar") final String id) { - final CSARContent csarContent = this.csarService.findById(id); - return new DirectoryController(csarContent.getCsarRoot()); - } - - @POST - @Consumes(MediaType.MULTIPART_FORM_DATA) - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response uploadCsar(@FormDataParam(value = "enrichment") final String applyEnrichment, - @FormDataParam(value = "file") final InputStream is, - @FormDataParam("file") final FormDataContentDisposition file) { - - if (is == null || file == null) { - return Response.status(Status.BAD_REQUEST).build(); - } - - logger.info("Uploading new CSAR file \"{}\", size {}", file.getFileName(), file.getSize()); - - try { - return handleCsarUpload(file.getFileName(), is, applyEnrichment); - } - catch (SystemException e) { - e.printStackTrace(); - return Response.serverError().entity(e).build(); - } - catch (UserException e) { - - e.printStackTrace(); - return Response.serverError().entity(e).build(); - } - - } - - @POST - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Handles an upload request for a CSAR file") - public Response uploadCsar(@ApiParam(required = true) final CsarUploadRequest request) { - - if (request == null) { - return Response.status(Status.BAD_REQUEST).build(); - } - - - logger.info("Uploading new CSAR based on request payload: name={}; url={}; applyEnrichment={}", - request.getName(), request.getUrl(), request.getEnrich()); - - String filename = request.getName(); - if (!filename.endsWith(".csar")) { - filename = filename + ".csar"; - } - - try { - final URL url = new URL(request.getUrl()); - - return handleCsarUpload(filename, url.openStream(), request.getEnrich()); - } - catch (final Exception e) { - logger.error("Error uploading CSAR: {}", e.getMessage(), e); - return Response.serverError().build(); - } - } - - - private Response handleCsarUpload(final String filename, final InputStream is, - final String applyEnrichment) throws SystemException, UserException { - - final File file = this.csarService.storeTemporaryFile(filename, is); - - final WineryConnector wc = new WineryConnector(); - - if (Objects.nonNull(applyEnrichment) && Boolean.parseBoolean(applyEnrichment)) { - logger.debug("Enrichment status is true. Continue with enrichment."); - wc.performManagementFeatureEnrichment(file); - } else { - logger.debug("Enrichment status is null or false. Continue without enrichment."); - } - - CSARID csarId; - - try { - csarId = this.fileService.storeCSAR(file.toPath()); - } - catch (final EntityExistsException e) { - logger.error("Failed to store CSAR: {}", e.getMessage(), e); - return Response.status(Status.CONFLICT).build(); - } - catch (final Exception e) { - logger.error("Failed to store CSAR: {}", e.getMessage(), e); - return Response.serverError().build(); - } - - csarId = this.csarService.generatePlans(csarId); - if (csarId == null) { - return Response.serverError().build(); - } - - this.controlService.setDeploymentProcessStateStored(csarId); - boolean success = this.controlService.invokeTOSCAProcessing(csarId); - - if (success) { - final List serviceTemplates = - this.engineService.getToscaReferenceMapper().getServiceTemplateIDsContainedInCSAR(csarId); - for (final QName serviceTemplate : serviceTemplates) { - logger.info("Invoke plan deployment for service template \"{}\" of CSAR \"{}\"", serviceTemplate, - csarId.getFileName()); - if (!this.controlService.invokePlanDeployment(csarId, serviceTemplate)) { - logger.error("Error deploying plan for service template \"{}\" of CSAR \"{}\"", serviceTemplate, - csarId.getFileName()); - success = false; - } - } - } - - // TODO this is such a brutal hack, won't go through reviews.... - final boolean repoAvailable = wc.isWineryRepositoryAvailable(); - final StringBuilder strB = new StringBuilder(); - - // quick and dirty parallel thread to upload the csar to the container - // repository - // This is needed for the state save feature - final Thread parallelUploadThread = new Thread(() -> { - if (wc.isWineryRepositoryAvailable()) { - try { - strB.append(wc.uploadCSAR(file, false)); - } - catch (final URISyntaxException e1) { - e1.printStackTrace(); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - } - }); - - if (repoAvailable) { - parallelUploadThread.start(); - } - - try { - if (ModelUtil.hasOpenRequirements(csarId, this.engineService)) { - - if (repoAvailable) { - while (parallelUploadThread.isAlive()) { - // wait till the upload is finished - } - this.controlService.deleteCSAR(csarId); - return Response.status(Response.Status.NOT_ACCEPTABLE) - .entity("{ \"Location\": \"" - + wc.getServiceTemplateURI(QName.valueOf(strB.toString())).toString() + "\" }") - .build(); - } else { - logger.error("CSAR has open requirments but Winery repository is not available"); - try { - this.fileService.deleteCSAR(csarId); - } - catch (final Exception e) { - // Ignore - logger.error("Error deleting csar after open requirements check: {}", e.getMessage(), e); - } - return Response.serverError().build(); - } - } - } - catch (final Exception e) { - logger.error("Error resolving open requirements: {}", e.getMessage(), e); - return Response.serverError().build(); - } - - if (!success) { - return Response.serverError().build(); - } - - logger.info("Uploading and storing CSAR \"{}\" was successful", csarId.getFileName()); - final URI uri = - UriUtil.encode(this.uriInfo.getAbsolutePathBuilder().path(CsarController.class, "getCsar").build(csarId)); - return Response.created(uri).build(); - } - - @DELETE - @Path("/{csar}") - @ApiOperation(value = "Delete a CSAR") - public Response deleteCsar(@ApiParam("ID of CSAR") @PathParam("csar") final String id) { - final CSARContent csarContent = this.csarService.findById(id); - - logger.info("Deleting CSAR \"{}\"", id); - final List errors = this.controlService.deleteCSAR(csarContent.getCSARID()); - - if (errors.size() > 0) { - logger.error("Error deleting CSAR"); - errors.forEach(s -> logger.error(s)); - return Response.serverError().build(); - } - - return Response.noContent().build(); - } - - @POST - @Path("/transform") - @ApiOperation(value = "Transform this CSAR to a new CSAR") - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Response transformCsar(@ApiParam(required = true) final CsarTransformRequest request) { - - final String sourceCsarName = request.getSourceCsarName(); - final String targetCsarName = request.getTargetCsarName(); - - final CSARID csarId = - this.csarService.generateTransformationPlans(new CSARID(sourceCsarName), new CSARID(targetCsarName)); - - this.controlService.setDeploymentProcessStateStored(csarId); - boolean success = this.controlService.invokeTOSCAProcessing(csarId); - - - if (success) { - final List serviceTemplates = - this.engineService.getToscaReferenceMapper().getServiceTemplateIDsContainedInCSAR(csarId); - for (final QName serviceTemplate : serviceTemplates) { - logger.info("Invoke plan deployment for service template \"{}\" of CSAR \"{}\"", serviceTemplate, - csarId.getFileName()); - if (!this.controlService.invokePlanDeployment(csarId, serviceTemplate)) { - logger.error("Error deploying plan for service template \"{}\" of CSAR \"{}\"", serviceTemplate, - csarId.getFileName()); - success = false; - } - } - } - - if (success) { - return Response.ok().build(); - } else { - return Response.serverError().build(); - } - } - - - - public void setCsarService(final CsarService csarService) { - this.csarService = csarService; - } - - public void setFileService(final ICoreFileService fileService) { - this.fileService = fileService; - } - - public void setEngineService(final IToscaEngineService engineService) { - this.engineService = engineService; - } - - public void setControlService(final IOpenToscaControlService controlService) { - this.controlService = controlService; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/ManagementPlanController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/ManagementPlanController.java deleted file mode 100644 index 92804bdd9..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/ManagementPlanController.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.util.List; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.plan.PlanDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceEventDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceListDTO; -import org.opentosca.container.api.dto.plan.PlanListDTO; -import org.opentosca.container.api.dto.request.CreatePlanInstanceLogEntryRequest; -import org.opentosca.container.api.service.PlanService; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.extension.TParameter; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -public class ManagementPlanController { - private final PlanService planService; - - private final CSARID csarId; - private final QName serviceTemplate; - private final Long serviceTemplateInstanceId; - // At the moment the only supported management plan type is TERMINATION - private final PlanTypes[] planTypes; - - public ManagementPlanController(final CSARID csarId, final QName serviceTemplate, - final Long serviceTemplateInstanceId, final PlanService planService, - final PlanTypes... types) { - this.csarId = csarId; - this.serviceTemplate = serviceTemplate; - this.serviceTemplateInstanceId = serviceTemplateInstanceId; - this.planService = planService; - this.planTypes = types; - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get management plans", response = PlanListDTO.class) - public Response getManagementPlans(@Context final UriInfo uriInfo) { - return this.planService.getPlans(uriInfo, this.csarId, this.serviceTemplate, this.planTypes); - } - - @GET - @Path("/{plan}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a management plan", response = PlanDTO.class) - public Response getManagementPlan(@ApiParam("ID of management plan") @PathParam("plan") final String plan, - @Context final UriInfo uriInfo) { - return this.planService.getPlan(plan, uriInfo, this.csarId, this.serviceTemplate, this.planTypes); - } - - @GET - @Path("/{plan}/instances") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get instances of a management plan", response = PlanInstanceListDTO.class) - public Response getManagementPlanInstances(@ApiParam("ID of management plan") @PathParam("plan") final String plan, - @Context final UriInfo uriInfo) { - return this.planService.getPlanInstances(plan, uriInfo, this.csarId, this.serviceTemplate, - this.serviceTemplateInstanceId, this.planTypes); - } - - @POST - @Path("/{plan}/instances") - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) - @ApiOperation(value = "Invokes a management plan", response = String.class) - public Response invokeManagementPlan(@ApiParam("ID of management plan") @PathParam("plan") final String plan, - @Context final UriInfo uriInfo, - @ApiParam(required = true, - value = "plan input parameters") final List parameters) { - return this.planService.invokePlan(plan, uriInfo, parameters, this.csarId, this.serviceTemplate, - this.serviceTemplateInstanceId, this.planTypes); - } - - @GET - @Path("/{plan}/instances/{instance}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a management plan instance", response = PlanInstanceDTO.class) - public Response getManagementPlanInstance(@ApiParam("ID of management plan") @PathParam("plan") final String plan, - @ApiParam("correlation ID") @PathParam("instance") final String instance, - @Context final UriInfo uriInfo) { - return this.planService.getPlanInstance(plan, instance, uriInfo, this.csarId, this.serviceTemplate, - this.serviceTemplateInstanceId, this.planTypes); - } - - @GET - @Path("/{plan}/instances/{instance}/state") - @Produces({MediaType.TEXT_PLAIN}) - @ApiOperation(value = "Get state of a management plan instance", response = String.class) - public Response getManagementPlanInstanceState(@ApiParam("ID of management plan") @PathParam("plan") final String plan, - @ApiParam("correlation ID") @PathParam("instance") final String instance, - @Context final UriInfo uriInfo) { - return this.planService.getPlanInstanceState(plan, instance, uriInfo, this.csarId, this.serviceTemplate, - this.serviceTemplateInstanceId, this.planTypes); - } - - @PUT - @Path("/{plan}/instances/{instance}/state") - @Consumes({MediaType.TEXT_PLAIN}) - @ApiOperation(hidden = true, value = "") - public Response changeManagementPlanInstanceState(@PathParam("plan") final String plan, - @PathParam("instance") final String instance, - @Context final UriInfo uriInfo, final String request) { - return this.planService.changePlanInstanceState(request, plan, instance, uriInfo, this.csarId, - this.serviceTemplate, this.serviceTemplateInstanceId, - this.planTypes); - } - - @GET - @Path("/{plan}/instances/{instance}/logs") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get log entries of a management plan instance", response = PlanInstanceEventDTO.class, - responseContainer = "list") - public Response getManagementPlanInstanceLogs(@ApiParam("management plan id") @PathParam("plan") final String plan, - @ApiParam("plan instance correlation id") @PathParam("instance") final String instance, - @Context final UriInfo uriInfo) { - return this.planService.getPlanInstanceLogs(plan, instance, uriInfo, this.csarId, this.serviceTemplate, - this.serviceTemplateInstanceId, this.planTypes); - } - - @POST - @Path("/{plan}/instances/{instance}/logs") - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response addManagementPlanLogEntry(@PathParam("plan") final String plan, - @PathParam("instance") final String instance, - @Context final UriInfo uriInfo, - final CreatePlanInstanceLogEntryRequest logEntry) { - return this.planService.addLogToPlanInstance(logEntry, plan, instance, uriInfo, this.csarId, - this.serviceTemplate, this.serviceTemplateInstanceId, - this.planTypes); - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/NodeTemplateController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/NodeTemplateController.java deleted file mode 100644 index c4aecab72..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/NodeTemplateController.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import javax.ws.rs.GET; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.container.ResourceContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.NodeTemplateDTO; -import org.opentosca.container.api.dto.NodeTemplateListDTO; -import org.opentosca.container.api.dto.boundarydefinitions.InterfaceDTO; -import org.opentosca.container.api.dto.boundarydefinitions.OperationDTO; -import org.opentosca.container.api.service.InstanceService; -import org.opentosca.container.api.service.NodeTemplateService; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.core.common.jpa.DocumentConverter; -import org.opentosca.container.core.next.model.NodeTemplateInstanceProperty; -import org.opentosca.container.core.next.xml.PropertyParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -public class NodeTemplateController { - - private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateController.class); - - @Context - UriInfo uriInfo; - - @Context - ResourceContext resourceContext; - - private NodeTemplateService nodeTemplateService; - private InstanceService instanceService; - - public NodeTemplateController(final NodeTemplateService nodeTemplateService, - final InstanceService instanceService) { - this.nodeTemplateService = nodeTemplateService; - this.instanceService = instanceService; - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get all node templates of a service template", response = NodeTemplateListDTO.class) - public Response getNodeTemplates(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId) throws NotFoundException { - - // this validates that the CSAR contains the service template - final List nodeTemplateIds = - this.nodeTemplateService.getNodeTemplatesOfServiceTemplate(csarId, serviceTemplateId); - final NodeTemplateListDTO list = new NodeTemplateListDTO(); - - for (final NodeTemplateDTO nodeTemplate : nodeTemplateIds) { - nodeTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, nodeTemplate.getId(), true, "self")); - - nodeTemplate.getInterfaces().add(UriUtil.generateSelfLink(this.uriInfo)); - - for (final InterfaceDTO dto : nodeTemplate.getInterfaces().getInterfaces()) { - dto.add(UriUtil.generateSelfLink(this.uriInfo)); - for (final OperationDTO op : dto.getOperations().values()) { - op.add(UriUtil.generateSelfLink(this.uriInfo)); - } - } - - list.add(nodeTemplate); - } - - list.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(list).build(); - } - - @GET - @Path("/{nodetemplate}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a node template", response = NodeTemplateDTO.class) - public Response getNodeTemplate(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId, - @ApiParam("ID of node template") @PathParam("nodetemplate") final String nodeTemplateId) throws NotFoundException { - - final NodeTemplateDTO result = - this.nodeTemplateService.getNodeTemplateById(csarId, QName.valueOf(serviceTemplateId), nodeTemplateId); - - result.add(UriUtil.generateSubResourceLink(this.uriInfo, "instances", false, "instances")); - result.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(result).build(); - } - - @GET - @Path("/{nodetemplate}/properties") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get properties of a node template", response = Document.class) - public Response getNodeTemplateProperties(@ApiParam("ID of CSAR") @PathParam("csar") final String csarId, - @ApiParam("qualified name of service template") @PathParam("servicetemplate") final String serviceTemplateId, - @ApiParam("ID of node template") @PathParam("nodetemplate") final String nodeTemplateId) throws NotFoundException, - InstantiationException, - IllegalAccessException, - IllegalArgumentException { - - final DocumentConverter converter = new DocumentConverter(); - final Document result = - this.nodeTemplateService.getPropertiesOfNodeTemplate(csarId, QName.valueOf(serviceTemplateId), - nodeTemplateId); - - final NodeTemplateInstanceProperty property = - this.instanceService.convertDocumentToProperty(result, NodeTemplateInstanceProperty.class); - - final List properties = new ArrayList<>(); - properties.add(property); - final PropertyParser parser = new PropertyParser(); - final NodeTemplateInstanceProperty prop = properties.stream().filter(p -> p.getType().equalsIgnoreCase("xml")) - .collect(Collectors.reducing((a, b) -> null)).orElse(null); - - Map resultMap = new HashMap<>(); - if (prop != null) { - resultMap = parser.parse(prop.getValue()); - - } - - return Response.ok(resultMap).build(); - } - - @Path("/{nodetemplate}/instances") - public NodeTemplateInstanceController getInstances(@ApiParam(hidden = true) @PathParam("csar") final String csarId, - @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId, - @ApiParam(hidden = true) @PathParam("nodetemplate") final String nodeTemplateId) { - - if (!this.nodeTemplateService.hasNodeTemplate(csarId, QName.valueOf(serviceTemplateId), nodeTemplateId)) { - logger.info("Node template \"" + nodeTemplateId + "\" could not be found"); - throw new NotFoundException("Node template \"" + nodeTemplateId + "\" could not be found"); - } - - final NodeTemplateInstanceController child = new NodeTemplateInstanceController(this.instanceService); - this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource - - return child; - } - - public void setNodeTemplateService(final NodeTemplateService nodeTemplateService) { - this.nodeTemplateService = nodeTemplateService; - } - - public void setInstanceService(final InstanceService instanceService) { - this.instanceService = instanceService; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/NodeTemplateInstanceController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/NodeTemplateInstanceController.java deleted file mode 100644 index 3790d6bf0..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/NodeTemplateInstanceController.java +++ /dev/null @@ -1,279 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.net.URI; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.NodeTemplateInstanceDTO; -import org.opentosca.container.api.dto.NodeTemplateInstanceListDTO; -import org.opentosca.container.api.service.InstanceService; -import org.opentosca.container.api.util.ModelUtil; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstanceState; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -public class NodeTemplateInstanceController { - - @ApiParam("ID of node template") - @PathParam("nodetemplate") - String nodetemplate; - - @ApiParam("ID of CSAR") - @PathParam("csar") - String csar; - - @ApiParam("qualified name of the service template") - @PathParam("servicetemplate") - String servicetemplate; - - @Context - UriInfo uriInfo; - - private static final Logger logger = LoggerFactory.getLogger(NodeTemplateInstanceController.class); - - private final InstanceService instanceService; - - public NodeTemplateInstanceController(final InstanceService instanceService) { - this.instanceService = instanceService; - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get all instances of a node template", response = NodeTemplateInstanceListDTO.class) - public Response getNodeTemplateInstances(@QueryParam(value = "state") final List states, - @QueryParam(value = "source") final List relationIds, @QueryParam(value="serviceInstanceId") final Long serviceInstanceId) { - final QName nodeTemplateQName = - new QName(QName.valueOf(this.servicetemplate).getNamespaceURI(), this.nodetemplate); - final Collection nodeInstances = - this.instanceService.getNodeTemplateInstances(nodeTemplateQName); - logger.debug("Found <{}> instances of NodeTemplate \"{}\" ", nodeInstances.size(), this.nodetemplate); - - final NodeTemplateInstanceListDTO list = new NodeTemplateInstanceListDTO(); - - for (final NodeTemplateInstance i : nodeInstances) { - if (states != null && !states.isEmpty() && !states.contains(i.getState())) { - // skip this node instance, as it not has the proper state - continue; - } - - if (relationIds != null && !relationIds.isEmpty()) { - for (final RelationshipTemplateInstance relInstance : i.getOutgoingRelations()) { - if (!relationIds.contains(relInstance.getId())) { - // skip this node instance, as it is no source of the given relation - continue; - } - } - } - - if(!i.getServiceTemplateInstance().getTemplateId().toString().equals(this.servicetemplate)) { - continue; - } - - if(serviceInstanceId != null && !i.getServiceTemplateInstance().getId().equals(serviceInstanceId)) { - continue; - } - - final NodeTemplateInstanceDTO dto = NodeTemplateInstanceDTO.Converter.convert(i); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, dto.getId().toString(), false, "self")); - - list.add(dto); - } - - list.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(list).build(); - } - - @POST - @Consumes({MediaType.TEXT_PLAIN}) - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response createNodeTemplateInstance(@Context final UriInfo uriInfo, final String serviceTemplateInstanceId) { - try { - final NodeTemplateInstance createdInstance = - this.instanceService.createNewNodeTemplateInstance(this.csar, this.servicetemplate, this.nodetemplate, - Long.parseLong(serviceTemplateInstanceId)); - final URI instanceURI = UriUtil.generateSubResourceURI(uriInfo, createdInstance.getId().toString(), false); - return Response.ok(instanceURI).build(); - } - catch (final IllegalArgumentException e) { - return Response.status(Status.BAD_REQUEST).build(); - } - catch (InstantiationException | IllegalAccessException e) { - return Response.serverError().build(); - } - } - - @GET - @Path("/{id}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a node template instance", response = NodeTemplateInstanceDTO.class) - public Response getNodeTemplateInstance(@ApiParam("ID of node template instance") @PathParam("id") final Long id) { - - final NodeTemplateInstance instance = - this.instanceService.resolveNodeTemplateInstance(this.servicetemplate, this.nodetemplate, id); - final NodeTemplateInstanceDTO dto = NodeTemplateInstanceDTO.Converter.convert(instance); - - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "state", false, "state")); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "properties", false, "properties")); - dto.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(dto).build(); - } - - @DELETE - @Path("/{id}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response deleteNodeTemplateInstance(@PathParam("id") final Long id) { - this.instanceService.deleteNodeTemplateInstance(this.servicetemplate, this.nodetemplate, id); - return Response.noContent().build(); - } - - @GET - @Path("/{id}/state") - @Produces({MediaType.TEXT_PLAIN}) - @ApiOperation(value = "Get state of a node template instance", response = String.class) - public Response getNodeTemplateInstanceState(@ApiParam("ID node template instance") @PathParam("id") final Long id) { - final NodeTemplateInstanceState state = - this.instanceService.getNodeTemplateInstanceState(this.servicetemplate, this.nodetemplate, id); - return Response.ok(state.toString()).build(); - } - - @PUT - @Path("/{id}/state") - @Consumes({MediaType.TEXT_PLAIN}) - @ApiOperation(hidden = true, value = "") - public Response updateNodeTemplateInstanceState(@PathParam("id") final Long id, final String request) { - try { - this.instanceService.setNodeTemplateInstanceState(this.servicetemplate, this.nodetemplate, id, request); - } - catch (final IllegalArgumentException e) { // this handles a null request too - return Response.status(Status.BAD_REQUEST).build(); - } - return Response.ok().build(); - } - - @GET - @Path("/{id}/properties") - @Produces(MediaType.APPLICATION_XML) - @ApiOperation(hidden = true, value = "") - public Response getNodeTemplateInstanceProperties(@PathParam("id") final Long id) { - final Document properties = - this.instanceService.getNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id); - - if (properties == null) { - return Response.noContent().build(); - } else { - return Response.ok(properties).build(); - } - } - - @GET - @Path("/{id}/properties") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Get properties of a node template instance", - response = Map.class) - public Map getNodeTemplateInstancePropertiesAsJson(@PathParam("id") final Long id) { - final NodeTemplateInstance instance = - this.instanceService.resolveNodeTemplateInstance(this.servicetemplate, this.nodetemplate, id); - return instance.getPropertiesAsMap(); - } - - @GET - @Path("/{id}/properties/{propname}") - @Produces({MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response getNodeTemplateInstanceProperty(@PathParam("id") final Long id, - @PathParam("propname") final String propertyName) { - final Document properties = - this.instanceService.getNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id); - - if (properties == null && ModelUtil.fetchFirstChildElement(properties, propertyName) == null) { - return Response.noContent().build(); - } else { - return Response.ok(ModelUtil.createDocumentFromElement(ModelUtil.fetchFirstChildElement(properties, - propertyName))) - .build(); - } - } - - @PUT - @Path("/{id}/properties") - @Consumes({MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response updateNodeTemplateInstanceProperties(@PathParam("id") final Long id, final Document request) { - - try { - this.instanceService.setNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id, - request); - } - catch (final IllegalArgumentException e) { // this handles a null request too - return Response.status(Status.BAD_REQUEST).build(); - } - catch (final ReflectiveOperationException e) { - return Response.serverError().build(); - } - - return Response.ok(UriUtil.generateSelfURI(this.uriInfo)).build(); - } - - @PUT - @Path("/{id}/properties/{propname}") - @Consumes({MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response updateNodeTemplateInstanceProperty(@PathParam("id") final Long id, - @PathParam("propname") final String propertyName, - final Document request) { - - try { - final Document properties = - this.instanceService.getNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id); - - final Element propElement = ModelUtil.fetchFirstChildElement(properties, propertyName); - - propElement.setTextContent(request.getDocumentElement().getTextContent()); - - this.instanceService.setNodeTemplateInstanceProperties(this.servicetemplate, this.nodetemplate, id, - properties); - } - catch (final IllegalArgumentException e) { // this handles a null request too - return Response.status(Status.BAD_REQUEST).build(); - } - catch (final ReflectiveOperationException e) { - return Response.serverError().build(); - } - - return Response.ok(UriUtil.generateSelfURI(this.uriInfo)).build(); - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/PlacementController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/PlacementController.java deleted file mode 100644 index 303da201c..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/PlacementController.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.Consumes; -import javax.ws.rs.POST; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.container.ResourceContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.NodeTemplateDTO; -import org.opentosca.container.api.service.InstanceService; -import org.opentosca.container.api.service.NodeTemplateService; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.tosca.convention.Utils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -public class PlacementController { - - private static final Logger logger = LoggerFactory.getLogger(PlacementController.class); - - @Context - UriInfo uriInfo; - - @Context - ResourceContext resourceContext; - - @ApiParam("ID of CSAR") - @PathParam("csar") - String csarId; - - @ApiParam("qualified name of the service template") - @PathParam("servicetemplate") - String serviceTemplateId; - - private final InstanceService instanceService; - private final NodeTemplateService nodeTemplateService; - - public PlacementController(final InstanceService instanceService, final NodeTemplateService nodeTemplateService) { - this.instanceService = instanceService; - this.nodeTemplateService = nodeTemplateService; - } - - @POST - @Produces({MediaType.APPLICATION_JSON}) - @Consumes({MediaType.APPLICATION_JSON}) - @ApiOperation(hidden = true, value = "") - public Response getInstances(@ApiParam("node template list need to be placed") final List request) throws InstantiationException, - IllegalAccessException, - IllegalArgumentException { - - // all node templates that need to be placed - final List nodeTemplateIdsToBePlaced = request; - final List nodeTemplatesToBePlaced = new ArrayList<>(); - - nodeTemplateIdsToBePlaced.stream() - .forEach(id -> nodeTemplatesToBePlaced.add(this.nodeTemplateService.getNodeTemplateById(this.csarId, - QName.valueOf(this.serviceTemplateId), - id))); - - // all running node template instances - final Collection nodeTemplateInstanceList = - this.instanceService.getAllNodeTemplateInstances(); - final Map> resultMap = new HashMap<>(); - // loop over all node templates that need to be placed - for (int i = 0; i < nodeTemplatesToBePlaced.size(); i++) { - resultMap.put(nodeTemplatesToBePlaced.get(i).getId(), new ArrayList<>()); - // search for valid running node template instances where node template can be placed - for (final NodeTemplateInstance nodeTemplateInstance : nodeTemplateInstanceList) { - // check if node type of instance is supported os node type - if (Utils.isSupportedVMNodeType(nodeTemplateInstance.getTemplateType())) { - // yay, we found an option, add to list - resultMap.get(nodeTemplatesToBePlaced.get(i).getId()) - .add(String.valueOf(nodeTemplateInstance.getId()) + "|||" - + nodeTemplateInstance.getTemplateId().getLocalPart() + "|||" - + String.valueOf(nodeTemplateInstance.getServiceTemplateInstance().getId() + "|||" - + nodeTemplateInstance.getServiceTemplateInstance().getCsarId())); - } - } - } - return Response.ok(resultMap).build(); - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/RelationshipTemplateInstanceController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/RelationshipTemplateInstanceController.java deleted file mode 100644 index 273228775..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/RelationshipTemplateInstanceController.java +++ /dev/null @@ -1,236 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.net.URI; -import java.util.Collection; -import java.util.List; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Link; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.RelationshipTemplateInstanceDTO; -import org.opentosca.container.api.dto.RelationshipTemplateInstanceListDTO; -import org.opentosca.container.api.dto.request.CreateRelationshipTemplateInstanceRequest; -import org.opentosca.container.api.service.InstanceService; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.core.next.model.NodeTemplateInstanceState; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.next.model.RelationshipTemplateInstanceState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -public class RelationshipTemplateInstanceController { - - @ApiParam("ID of CSAR") - @PathParam("csar") - String csar; - - @ApiParam("qualified name of the service template") - @PathParam("servicetemplate") - String servicetemplate; - - @ApiParam("ID of relationship template") - @PathParam("relationshiptemplate") - String relationshiptemplate; - - @Context - UriInfo uriInfo; - - private static final Logger logger = LoggerFactory.getLogger(RelationshipTemplateInstanceController.class); - - private final InstanceService instanceService; - - public RelationshipTemplateInstanceController(final InstanceService instanceService) { - this.instanceService = instanceService; - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get all relationship template instances", - response = RelationshipTemplateInstanceListDTO.class) - public Response getRelationshipTemplateInstances(@QueryParam(value = "state") final List states,@QueryParam(value = "target") final Long targetNodeInstanceId, @QueryParam(value="serviceInstanceId") final Long serviceInstanceId) { - final QName relationshipTemplateQName = - new QName(QName.valueOf(this.servicetemplate).getNamespaceURI(), this.relationshiptemplate); - final Collection relationshipInstances = - this.instanceService.getRelationshipTemplateInstances(relationshipTemplateQName); - logger.debug("Found <{}> instances of RelationshipTemplate \"{}\" ", relationshipInstances.size(), - this.relationshiptemplate); - - final RelationshipTemplateInstanceListDTO list = new RelationshipTemplateInstanceListDTO(); - - for (final RelationshipTemplateInstance i : relationshipInstances) { - if(!i.getTarget().getServiceTemplateInstance().getTemplateId().toString().equals(this.servicetemplate)) { - continue; - } - if (states != null && !states.isEmpty() && !states.contains(i.getState())) { - // skip this node instance, as it not has the proper state - continue; - } - - if (targetNodeInstanceId != null && !i.getTarget().getId().equals(targetNodeInstanceId)) { - // skip this instance if the target id doesn't match - continue; - } - - if(serviceInstanceId != null && !i.getServiceTemplateInstance().getId().equals(serviceInstanceId)) { - continue; - } - - final RelationshipTemplateInstanceDTO dto = RelationshipTemplateInstanceDTO.Converter.convert(i); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, dto.getId().toString(), false, "self")); - - list.add(dto); - } - - list.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(list).build(); - } - - @POST - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response createRelationshipTemplateInstance(@Context final UriInfo uriInfo, - final CreateRelationshipTemplateInstanceRequest request) { - try { - - final RelationshipTemplateInstance createdInstance = - this.instanceService.createNewRelationshipTemplateInstance(this.csar, this.servicetemplate, - this.relationshiptemplate, request); - final URI instanceURI = UriUtil.generateSubResourceURI(uriInfo, createdInstance.getId().toString(), false); - return Response.ok(instanceURI).build(); - } - catch (final IllegalArgumentException e) { - logger.error("Error creating instance: {}", e.getMessage(), e); - return Response.status(Status.BAD_REQUEST).build(); - } - catch (InstantiationException | IllegalAccessException e) { - logger.error("Error creating instance: {}", e.getMessage(), e); - return Response.serverError().build(); - } - } - - @GET - @Path("/{id}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a relationship template instance", response = RelationshipTemplateInstanceDTO.class) - public Response getRelationshipTemplateInstance(@ApiParam("ID of relationship template instance") @PathParam("id") final Long id) { - - final RelationshipTemplateInstance instance = - this.instanceService.resolveRelationshipTemplateInstance(this.servicetemplate, this.relationshiptemplate, - id); - final RelationshipTemplateInstanceDTO dto = RelationshipTemplateInstanceDTO.Converter.convert(instance); - - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "state", false, "state")); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "properties", false, "properties")); - final String path = - "/csars/{csar}/servicetemplates/{servicetemplate}/nodetemplates/{nodetemplate}/instances/{nodetemplateinstance}"; - final URI sourceNodeTemplateInstanceUri = - this.uriInfo.getBaseUriBuilder().path(path).build(dto.getCsarId(), dto.getServiceTemplateId(), - instance.getSource().getTemplateId().getLocalPart(), - dto.getSourceNodeTemplateInstanceId()); - final URI targetNodeTemplateInstanceUri = - this.uriInfo.getBaseUriBuilder().path(path).build(dto.getCsarId(), dto.getServiceTemplateId(), - instance.getTarget().getTemplateId().getLocalPart(), - dto.getTargetNodeTemplateInstanceId()); - dto.add(Link.fromUri(UriUtil.encode(sourceNodeTemplateInstanceUri)).rel("source_node_template_instance") - .build()); - dto.add(Link.fromUri(UriUtil.encode(targetNodeTemplateInstanceUri)).rel("target_node_template_instance") - .build()); - dto.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(dto).build(); - } - - @DELETE - @Path("/{id}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response deleteRelationshipTemplateInstance(@PathParam("id") final Long id) { - this.instanceService.deleteRelationshipTemplateInstance(this.servicetemplate, this.relationshiptemplate, id); - return Response.noContent().build(); - } - - @GET - @Path("/{id}/state") - @Produces({MediaType.TEXT_PLAIN}) - @ApiOperation(value = "Get state of a relationship template instance", response = String.class) - public Response getRelationshipTemplateInstanceState(@ApiParam("ID of relationship template instance") @PathParam("id") final Long id) { - final RelationshipTemplateInstanceState state = - this.instanceService.getRelationshipTemplateInstanceState(this.servicetemplate, this.relationshiptemplate, - id); - return Response.ok(state.toString()).build(); - } - - @PUT - @Path("/{id}/state") - @Consumes({MediaType.TEXT_PLAIN}) - @ApiOperation(hidden = true, value = "") - public Response updateRelationshipTemplateInstanceState(@PathParam("id") final Long id, final String request) { - try { - this.instanceService.setRelationshipTemplateInstanceState(this.servicetemplate, this.relationshiptemplate, - id, request); - } - catch (final IllegalArgumentException e) { // this handles a null request too - return Response.status(Status.BAD_REQUEST).build(); - } - return Response.ok().build(); - } - - @GET - @Path("/{id}/properties") - @Produces({MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response getRelationshipTemplateInstanceProperties(@PathParam("id") final Long id) { - final Document properties = - this.instanceService.getRelationshipTemplateInstanceProperties(this.servicetemplate, - this.relationshiptemplate, id); - if (properties == null) { - return Response.noContent().build(); - } else { - return Response.ok(properties).build(); - } - } - - @PUT - @Path("/{id}/properties") - @Consumes({MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) - @ApiOperation(hidden = true, value = "") - public Response updateRelationshipTemplateInstanceProperties(@PathParam("id") final Long id, - final Document request) { - - try { - this.instanceService.setRelationshipTemplateInstanceProperties(this.servicetemplate, - this.relationshiptemplate, id, request); - } - catch (final IllegalArgumentException e) { // this handles a null request too - return Response.status(Status.BAD_REQUEST).build(); - } - catch (final ReflectiveOperationException e) { - return Response.serverError().build(); - } - - return Response.ok(UriUtil.generateSelfURI(this.uriInfo)).build(); - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/RootController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/RootController.java deleted file mode 100644 index 00dea8c57..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/RootController.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright 2017 University of Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - *******************************************************************************/ -package org.opentosca.container.api.controller; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Link; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -import org.opentosca.container.api.dto.ResourceSupport; -import org.opentosca.planbuilder.service.resources.RootResource; - -import io.swagger.annotations.Contact; -import io.swagger.annotations.Info; -import io.swagger.annotations.License; -import io.swagger.annotations.SwaggerDefinition; - -@SwaggerDefinition(info = @Info(title = "Public API for OpenTOSCA Container", - description = "API access to query entities and manipulate them using plans", - version = "2.1.0", termsOfService = "", - contact = @Contact(name = "OpenTOSCA", url = "http://opentosca.org", - email = "opentosca@iaas.uni-stuttgart.de"), - license = @License(name = "Apache License, Version 2.0", - url = "https://www.apache.org/licenses/LICENSE-2.0"))) -@Path("/") -public class RootController { - - @Context - private UriInfo uriInfo; - - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Response getRoot() { - final ResourceSupport links = new ResourceSupport(); - links.add(Link.fromResource(RootController.class).rel("self").baseUri(this.uriInfo.getBaseUri()).build()); - links.add(Link.fromResource(CsarController.class).rel("csars").baseUri(this.uriInfo.getBaseUri()).build()); - links.add(Link.fromResource(SituationsController.class).rel("situationsapi").baseUri(this.uriInfo.getBaseUri()) - .build()); - // somehow using the style of creating the link like the above creates duplicate paths, e.g., host:1337/planbuilder/planbuilder - links.add(Link.fromUriBuilder(this.uriInfo.getBaseUriBuilder().path(RootResource.class).path("planbuilder")).rel("planbuilder").build()); - - - return Response.ok(links).build(); - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/ServiceTemplateController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/ServiceTemplateController.java deleted file mode 100644 index e1e151c36..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/ServiceTemplateController.java +++ /dev/null @@ -1,244 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.container.ResourceContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Request; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.NodeTemplateDTO; -import org.opentosca.container.api.dto.RelationshipTemplateDTO; -import org.opentosca.container.api.dto.ServiceTemplateDTO; -import org.opentosca.container.api.dto.ServiceTemplateListDTO; -import org.opentosca.container.api.dto.request.ServiceTransformRequest; -import org.opentosca.container.api.service.CsarService; -import org.opentosca.container.api.service.InstanceService; -import org.opentosca.container.api.service.NodeTemplateService; -import org.opentosca.container.api.service.PlanService; -import org.opentosca.container.api.service.RelationshipTemplateService; -import org.opentosca.container.api.service.ServiceTemplateService; -import org.opentosca.container.api.service.CsarService.AdaptationPlanGenerationResult; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.control.IOpenToscaControlService; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.deployment.tests.DeploymentTestService; - -import com.google.common.collect.Lists; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Path("/csars/{csar}/servicetemplates") -@Api(value = "/") -public class ServiceTemplateController { - - @Context - private UriInfo uriInfo; - - @Context - private Request request; - - @Context - private ResourceContext resourceContext; - - private PlanService planService; - - private InstanceService instanceService; - - private NodeTemplateService nodeTemplateService; - - private RelationshipTemplateService relationshipTemplateService; - - private ServiceTemplateService serviceTemplateService; - - private CsarService csarService; - - private IOpenToscaControlService controlService; - - private DeploymentTestService deploymentTestService; - - private IToscaEngineService engineService; - - private IToscaReferenceMapper referenceMapper; - - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get all service templates", response = ServiceTemplateListDTO.class) - public Response getServiceTemplates(@ApiParam("ID of CSAR") @PathParam("csar") final String csar) { - - final ServiceTemplateListDTO list = new ServiceTemplateListDTO(); - - for (final String name : this.serviceTemplateService.getServiceTemplatesOfCsar(csar)) { - final ServiceTemplateDTO serviceTemplate = new ServiceTemplateDTO(name); - serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, name, true, "self")); - list.add(serviceTemplate); - } - - list.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(list).build(); - } - - @GET - @Path("/{servicetemplate}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a service template", response = ServiceTemplateDTO.class) - public Response getServiceTemplate(@ApiParam("ID of CSAR") @PathParam("csar") final String csar, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId) { - - this.serviceTemplateService.checkServiceTemplateExistence(csar, serviceTemplateId); // throws exception if not! - - final ServiceTemplateDTO serviceTemplate = new ServiceTemplateDTO(serviceTemplateId); - - serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "boundarydefinitions", false, - "boundarydefinitions")); - serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "buildplans", false, "buildplans")); - serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "instances", false, "instances")); - serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "nodetemplates", false, "nodetemplates")); - serviceTemplate.add(UriUtil.generateSubResourceLink(this.uriInfo, "relationshiptemplates", false, - "relationshiptemplates")); - serviceTemplate.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(serviceTemplate).build(); - } - - @Path("/{servicetemplate}/buildplans") - public BuildPlanController getBuildPlans(@ApiParam("ID of CSAR") @PathParam("csar") final String csar, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId) { - final CSARID csarId = this.serviceTemplateService.checkServiceTemplateExistence(csar, serviceTemplateId); - return new BuildPlanController(csarId, QName.valueOf(serviceTemplateId), this.planService); - } - - @Path("/{servicetemplate}/nodetemplates") - public NodeTemplateController getNodeTemplates(@ApiParam(hidden = true) @PathParam("csar") final String csar, - @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId) { - this.serviceTemplateService.checkServiceTemplateExistence(csar, serviceTemplateId); - final NodeTemplateController child = new NodeTemplateController(this.nodeTemplateService, this.instanceService); - this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource - return child; - } - - @Path("/{servicetemplate}/relationshiptemplates") - public RelationshipTemplateController getRelationshipTemplates(@ApiParam(hidden = true) @PathParam("csar") final String csar, - @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId) { - this.serviceTemplateService.checkServiceTemplateExistence(csar, serviceTemplateId); - final RelationshipTemplateController child = - new RelationshipTemplateController(this.relationshipTemplateService, this.instanceService); - this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource - return child; - } - - @Path("/{servicetemplate}/placement") - public PlacementController startPlacement(@ApiParam(hidden = true) @PathParam("csar") final String csar, - @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId) { - this.serviceTemplateService.checkServiceTemplateExistence(csar, serviceTemplateId); - // init placement controller if placement is started - final PlacementController child = new PlacementController(this.instanceService, this.nodeTemplateService); - this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource - return child; - - } - - @Path("/{servicetemplate}/instances") - public ServiceTemplateInstanceController getInstances(@ApiParam(hidden = true) @PathParam("csar") final String csar, - @ApiParam(hidden = true) @PathParam("servicetemplate") final String serviceTemplateId) { - this.serviceTemplateService.checkServiceTemplateExistence(csar, serviceTemplateId); - final ServiceTemplateInstanceController child = new ServiceTemplateInstanceController(this.instanceService, - this.planService, this.csarService, this.deploymentTestService, this.referenceMapper); - this.resourceContext.initResource(child);// this initializes @Context fields in the sub-resource - return child; - } - - @POST - @Path("/{servicetemplate}/transform") - @ApiOperation(value = "Generates a plan to adapt service template instances via the given the source and target nodes/relations") - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Response transformCsar(@ApiParam("ID of CSAR") @PathParam("csar") final String csar, - @ApiParam("qualified name of the service template") @PathParam("servicetemplate") final String serviceTemplateId, @ApiParam(required = true) final ServiceTransformRequest request) { - - - - final AdaptationPlanGenerationResult result = this.csarService.generateAdaptationPlan(new CSARID(csar), QName.valueOf(serviceTemplateId), request.getSourceNodeTemplates(), request.getSourceRelationshipTemplates(), request.getTargetNodeTemplates(), request.getTargetRelationshipTemplates()); - - if(result == null) { - return Response.serverError().build(); - } - - this.controlService.setDeploymentProcessStateStored(result.csarId); - boolean success = this.controlService.invokeTOSCAProcessing(result.csarId); - - if (success) { - final List serviceTemplates = - this.engineService.getToscaReferenceMapper().getServiceTemplateIDsContainedInCSAR(result.csarId); - for (final QName serviceTemplate : serviceTemplates) { - if (!this.controlService.invokePlanDeployment(result.csarId, serviceTemplate)) { - success = false; - } - } - } - - if (success) { - return this.planService.getPlan(result.planId, uriInfo, result.csarId, QName.valueOf(serviceTemplateId), PlanTypes.OTHERMANAGEMENT); - } else { - return Response.serverError().build(); - } - } - - public void setPlanService(final PlanService planService) { - this.planService = planService; - } - - public void setInstanceService(final InstanceService instanceService) { - this.instanceService = instanceService; - } - - public void setNodeTemplateService(final NodeTemplateService nodeTemplateService) { - this.nodeTemplateService = nodeTemplateService; - } - - public void setRelationshipTemplateService(final RelationshipTemplateService relationshipTemplateService) { - this.relationshipTemplateService = relationshipTemplateService; - } - - public void setServiceTemplateService(final ServiceTemplateService serviceTemplateService) { - this.serviceTemplateService = serviceTemplateService; - } - - public void setCsarService(final CsarService csarService) { - this.csarService = csarService; - } - - public void setDeploymentTestService(final DeploymentTestService deploymentTestService) { - this.deploymentTestService = deploymentTestService; - } - - public void setEngineService(final IToscaEngineService engineService) { - this.engineService = engineService; - // We cannot inject an instance of {@link IToscaReferenceMapper} since - // it is manually created in our default implementation of {@link - // IToscaEngineService} - this.referenceMapper = this.engineService.getToscaReferenceMapper(); - } - - public void setControlService(final IOpenToscaControlService controlService) { - this.controlService = controlService; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/ServiceTemplateInstanceController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/ServiceTemplateInstanceController.java deleted file mode 100644 index 1b2dd3202..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/ServiceTemplateInstanceController.java +++ /dev/null @@ -1,542 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.net.URI; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Link; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.NodeOperationDTO; -import org.opentosca.container.api.dto.ResourceDecorator; -import org.opentosca.container.api.dto.ServiceTemplateInstanceDTO; -import org.opentosca.container.api.dto.ServiceTemplateInstanceListDTO; -import org.opentosca.container.api.dto.boundarydefinitions.InterfaceDTO; -import org.opentosca.container.api.dto.boundarydefinitions.InterfaceListDTO; -import org.opentosca.container.api.dto.boundarydefinitions.OperationDTO; -import org.opentosca.container.api.dto.plan.PlanDTO; -import org.opentosca.container.api.dto.request.CreateServiceTemplateInstanceRequest; -import org.opentosca.container.api.dto.situations.SituationsMonitorDTO; -import org.opentosca.container.api.dto.situations.SituationsMonitorListDTO; -import org.opentosca.container.api.service.CsarService; -import org.opentosca.container.api.service.InstanceService; -import org.opentosca.container.api.service.PlanService; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.DeploymentTest; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.model.PlanType; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; -import org.opentosca.container.core.next.model.SituationsMonitor; -import org.opentosca.container.core.next.repository.DeploymentTestRepository; -import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.model.TExportedInterface; -import org.opentosca.container.core.tosca.model.TExportedOperation; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.deployment.tests.DeploymentTestService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; - -import com.google.common.collect.Maps; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; - -@Api -public class ServiceTemplateInstanceController { - - @ApiParam("ID of CSAR") - @PathParam("csar") - String csarId; - - @ApiParam("qualified name of the service template") - @PathParam("servicetemplate") - String serviceTemplateId; - - @Context - private UriInfo uriInfo; - - private static Logger logger = LoggerFactory.getLogger(ServiceTemplateInstanceController.class); - - private final InstanceService instanceService; - - private final PlanService planService; - - private final CsarService csarService; - - - private final DeploymentTestService deploymentTestService; - - private final IToscaReferenceMapper referenceMapper; - - - public ServiceTemplateInstanceController(final InstanceService instanceService, final PlanService planService, - final CsarService csarService, - final DeploymentTestService deploymentTestService, - final IToscaReferenceMapper referenceMapper) { - this.instanceService = instanceService; - this.planService = planService; - this.csarService = csarService; - this.deploymentTestService = deploymentTestService; - this.referenceMapper = referenceMapper; - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get all instances of a service template", response = ServiceTemplateInstanceListDTO.class) - public Response getServiceTemplateInstances() { - final Collection serviceInstances = - this.instanceService.getServiceTemplateInstances(this.serviceTemplateId); - logger.debug("Found <{}> instances of ServiceTemplate \"{}\" ", serviceInstances.size(), - this.serviceTemplateId); - - final ServiceTemplateInstanceListDTO list = new ServiceTemplateInstanceListDTO(); - - for (final ServiceTemplateInstance i : serviceInstances) { - final ServiceTemplateInstanceDTO dto = ServiceTemplateInstanceDTO.Converter.convert(i); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, dto.getId().toString(), false, "self")); - - list.add(dto); - } - - list.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(list).build(); - } - - @POST - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML}) - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response createServiceTemplateInstance(final CreateServiceTemplateInstanceRequest request) { - - if (request == null || request.getCorrelationId() == null || request.getCorrelationId().trim().length() == 0) { - return Response.status(Status.BAD_REQUEST).build(); - } - - try { - final ServiceTemplateInstance createdInstance = - this.instanceService.createServiceTemplateInstance(this.csarId, this.serviceTemplateId, - request.getCorrelationId().trim()); - - final URI uri = UriUtil.generateSubResourceURI(this.uriInfo, createdInstance.getId().toString(), false); - - return Response.ok(uri).build(); - } - catch (final IllegalArgumentException e) { - return Response.status(Status.BAD_REQUEST).build(); - } - catch (InstantiationException | IllegalAccessException e) { - logger.debug("Internal error occurred: {}", e.getMessage()); - - return Response.serverError().build(); - } - catch (final NotFoundException e) { - logger.debug("Didn't find PlanInstances with given correlationId: {}", e.getMessage()); - return Response.status(Status.BAD_REQUEST).entity("Didn't find PlanInstances with given correlationId") - .build(); - } - } - - @GET - @Path("/{id}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get a service template instance", response = ServiceTemplateInstanceDTO.class) - public Response getServiceTemplateInstance(@ApiParam("ID of service template instance") @PathParam("id") final Long id) { - final ServiceTemplateInstance instance = resolveInstance(id, this.serviceTemplateId); - final ServiceTemplateInstanceDTO dto = ServiceTemplateInstanceDTO.Converter.convert(instance); - - // Build plan: Determine plan instance that created this service - // template instance - final PlanInstance pi = findPlanInstance(instance); - - // Add a link - String path = ""; - URI uri = null; - - if (pi.getType().equals(PlanType.BUILD)) { - // url to the build plan instance - path = "/csars/{csar}/servicetemplates/{servicetemplate}/buildplans/{plan}/instances/{instance}"; - uri = this.uriInfo.getBaseUriBuilder().path(path).build(this.csarId, this.serviceTemplateId, - pi.getTemplateId().getLocalPart(), - pi.getCorrelationId()); - } else { - // url to the transformation plan instance which created this instance from another service instance - path = - "/csars/{csar}/servicetemplates/{servicetemplate}/instances/{serviceinstance}/managementplans/{plan}/instances/{instance}"; - uri = this.uriInfo.getBaseUriBuilder().path(path) - .build(pi.getServiceTemplateInstance().getCsarId().getFileName(), - pi.getServiceTemplateInstance().getTemplateId().toString(), - pi.getServiceTemplateInstance().getId(), pi.getTemplateId().getLocalPart(), - pi.getCorrelationId()); - } - - dto.add(Link.fromUri(UriUtil.encode(uri)).rel("build_plan_instance").build()); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "managementplans", false, "managementplans")); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "state", false, "state")); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "properties", false, "properties")); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "deploymenttests", false, "deploymenttests")); - dto.add(UriUtil.generateSubResourceLink(this.uriInfo, "boundarydefinitions/interfaces", false, - "boundarydefinitions/interfaces")); - dto.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(dto).build(); - } - - private PlanInstance findPlanInstance(ServiceTemplateInstance instance) { - return this.planService.getPlanInstanceByCorrelationId(instance.getCreationCorrelationId()); - } - - - @DELETE - @Path("/{id}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response deleteServiceTemplateInstance(@PathParam("id") final Long id) { - this.instanceService.deleteServiceTemplateInstance(id); - return Response.noContent().build(); - } - - @Path("/{id}/managementplans") - public ManagementPlanController getManagementPlans(@ApiParam("ID of service template instance") @PathParam("id") final Long id) { - final ServiceTemplateInstance instance = resolveInstance(id, this.serviceTemplateId); - return new ManagementPlanController(instance.getCsarId(), QName.valueOf(this.serviceTemplateId), id, - this.planService, PlanTypes.TERMINATION, PlanTypes.OTHERMANAGEMENT); - } - - @GET - @Path("/{id}/state") - @Produces({MediaType.TEXT_PLAIN}) - @ApiOperation(value = "Get state of a service template instance", response = String.class) - public Response getServiceTemplateInstanceState(@ApiParam("ID of service template instance") @PathParam("id") final Long id) { - final ServiceTemplateInstanceState state = this.instanceService.getServiceTemplateInstanceState(id); - return Response.ok(state.toString()).build(); - } - - @PUT - @Path("/{id}/state") - @Consumes({MediaType.TEXT_PLAIN}) - @ApiOperation(hidden = true, value = "") - public Response updateServiceTemplateInstanceState(@PathParam("id") final Long id, final String request) { - try { - this.instanceService.setServiceTemplateInstanceState(id, request); - } - catch (final IllegalArgumentException e) { // this handles a null request too - return Response.status(Status.BAD_REQUEST).build(); - } - - return Response.ok().build(); - } - - @GET - @Path("/{id}/properties") - @Produces({MediaType.APPLICATION_XML}) - @ApiOperation(hidden = true, value = "") - public Response getServiceTemplateInstanceProperties(@PathParam("id") final Long id) { - final ServiceTemplateInstance instance = this.instanceService.getServiceTemplateInstance(id, true); - final Document properties = instance.getPropertiesAsDocument(); - - if (properties == null) { - return Response.noContent().build(); - } else { - return Response.ok(properties).build(); - } - } - - @GET - @Path("/{id}/properties") - @Produces({MediaType.APPLICATION_JSON}) - @ApiOperation(value = "Gets the properties of a service template instance", response = Map.class) - public Map getServiceTemplateInstancePropertiesAsJSON(@PathParam("id") final Long id) { - final ServiceTemplateInstance serviceTemplateInstance = - this.instanceService.getServiceTemplateInstance(id, true); - return serviceTemplateInstance.getPropertiesAsMap(); - } - - @PUT - @Path("/{id}/properties") - @Consumes({MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) - @ApiOperation(hidden = true, value = "") - public Response updateServiceTemplateInstanceProperties(@PathParam("id") final Long id, final Document request) { - try { - this.instanceService.setServiceTemplateInstanceProperties(id, request); - } - catch (final IllegalArgumentException e) { // this handles a null request too - return Response.status(Status.BAD_REQUEST).build(); - } - catch (final ReflectiveOperationException e) { - return Response.serverError().build(); - } - - return Response.ok(UriUtil.generateSelfURI(this.uriInfo)).build(); - } - - @GET - @Path("/{id}/situationsmonitors") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Response getSituationMonitors(@PathParam("id") final Long id) { - Collection monitors = this.instanceService.getSituationsMonitors(id); - final SituationsMonitorListDTO dto = new SituationsMonitorListDTO(); - - monitors.forEach(x -> dto.add(SituationsMonitorDTO.Converter.convert(x))); - - dto.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(dto).build(); - } - - @POST - @Path("/{id}/situationsmonitors") - @Consumes({MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Response createSituationMonitor(@PathParam("id") final Long id, SituationsMonitorDTO monitor) { - ServiceTemplateInstance servInstance = this.instanceService.getServiceTemplateInstance(id, false); - - Map> mapping = Maps.newHashMap(); - - for(String nodeId : monitor.getNodeId2SituationIds().keySet()) { - mapping.put(nodeId, monitor.getNodeId2SituationIds().get(nodeId).getSituationId()); - } - - SituationsMonitor createdInstance = this.instanceService.createNewSituationsMonitor(servInstance, mapping); - final URI uri = UriUtil.generateSubResourceURI(this.uriInfo, createdInstance.getId().toString(), false); - return Response.ok(uri).build(); - } - - /** - * Gets a reference to the service template instance. Ensures that the instance actually belongs to - * the service template. - * - * @param instanceId - * @param templateId - * @return - * @throws NotFoundException if the instance does not belong to the service template - */ - private ServiceTemplateInstance resolveInstance(final Long instanceId, - final String templateId) throws NotFoundException { - // We only need to check that the instance belongs to the template, the rest is - // guaranteed while this is a sub-resource - final ServiceTemplateInstance instance = this.instanceService.getServiceTemplateInstance(instanceId, false); - - if (!instance.getTemplateId().equals(QName.valueOf(templateId))) { - logger.info("Service template instance <{}> could not be found", instanceId); - throw new NotFoundException(String.format("Service template instance <%s> could not be found", instanceId)); - } - - return instance; - } - - @GET - @Path("/{id}/boundarydefinitions/interfaces") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @ApiOperation(value = "Get interfaces of a service tempate", response = InterfaceListDTO.class) - public Response getInterfaces(@PathParam("id") final Long id) { - - final CSARContent csarContent = this.csarService.findById(this.csarId); - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), this.serviceTemplateId)) { - logger.info("Service template \"" + this.serviceTemplateId + "\" could not be found"); - throw new NotFoundException("Service template \"" + this.serviceTemplateId + "\" could not be found"); - } - - final List interfaces = - this.referenceMapper.getBoundaryInterfacesOfServiceTemplate(csarContent.getCSARID(), - QName.valueOf(this.serviceTemplateId)); - logger.debug("Found <{}> interface(s) in Service Template \"{}\" of CSAR \"{}\" ", interfaces.size(), - this.serviceTemplateId, this.csarId); - - final InterfaceListDTO list = new InterfaceListDTO(); - list.add(interfaces.stream().map(name -> { - - final List operations = - getExportedOperations(csarContent.getCSARID(), QName.valueOf(this.serviceTemplateId), name); - logger.debug("Found <{}> operation(s) for Interface \"{}\" in Service Template \"{}\" of CSAR \"{}\" ", - operations.size(), name, this.serviceTemplateId, this.csarId); - - final Map ops = operations.stream().filter(o -> { - final PlanDTO plan = new PlanDTO((TPlan) o.getPlan().getPlanRef()); - return !PlanTypes.BUILD.toString().equals(plan.getPlanType()); - }).map(o -> { - final OperationDTO dto = new OperationDTO(); - dto.setName(o.getName()); - dto.setNodeOperation(NodeOperationDTO.Converter.convert(o.getNodeOperation())); - dto.setRelationshipOperation(o.getRelationshipOperation()); - if (o.getPlan() != null) { - final PlanDTO plan = new PlanDTO((TPlan) o.getPlan().getPlanRef()); - dto.setPlan(plan); - // Compute the according URL for the Build or Management Plan - final URI planUrl; - if (PlanTypes.BUILD.toString().equals(plan.getPlanType())) { - // If it's a build plan - planUrl = - this.uriInfo.getBaseUriBuilder() - .path("/csars/{csar}/servicetemplates/{servicetemplate}/buildplans/{buildplan}") - .build(this.csarId, this.serviceTemplateId, plan.getId()); - } else { - // ... else we assume it's a management plan - planUrl = - this.uriInfo.getBaseUriBuilder() - .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{id}/managementplans/{managementplan}") - .build(this.csarId, this.serviceTemplateId, id, plan.getId()); - } - plan.add(Link.fromUri(UriUtil.encode(planUrl)).rel("self").build()); - dto.add(Link.fromUri(UriUtil.encode(planUrl)).rel("plan").build()); - } - return dto; - }).collect(Collectors.toMap(OperationDTO::getName, t -> t)); - - final InterfaceDTO dto = new InterfaceDTO(); - dto.setName(name); - dto.setOperations(ops); - - final URI selfLink = - this.uriInfo.getBaseUriBuilder() - .path("/csars/{csar}/servicetemplates/{servicetemplate}/boundarydefinitions/interfaces/{name}") - .build(this.csarId, this.serviceTemplateId, name); - dto.add(Link.fromUri(UriUtil.encode(selfLink)).rel("self").build()); - - return dto; - }).collect(Collectors.toList()).toArray(new InterfaceDTO[] {})); - list.add(UriUtil.generateSelfLink(this.uriInfo)); - - return Response.ok(list).build(); - } - - private List getExportedOperations(final CSARID csarId, final QName serviceTemplate, - final String interfaceName) { - final Map> exportedInterfacesOfCsar = - this.referenceMapper.getExportedInterfacesOfCSAR(csarId); - if (exportedInterfacesOfCsar.containsKey(serviceTemplate)) { - final List exportedInterfaces = exportedInterfacesOfCsar.get(serviceTemplate); - for (final TExportedInterface exportedInterface : exportedInterfaces) { - if (exportedInterface.getName().equalsIgnoreCase(interfaceName)) { - return exportedInterface.getOperation(); - } - } - } - return null; - } - - @GET - @Path("/{id}/deploymenttests") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(hidden = true, value = "") - public Response getDeploymentTests(@PathParam("id") final Integer id) { - - final CSARContent csarContent = this.csarService.findById(this.csarId); - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), this.serviceTemplateId)) { - logger.info("Service template \"" + this.serviceTemplateId + "\" could not be found"); - throw new NotFoundException("Service template \"" + this.serviceTemplateId + "\" could not be found"); - } - - // TODO: Check if instance belongs to CSAR and Service Template - final ServiceTemplateInstance sti = new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null); - if (sti == null) { - logger.info("Service template instance \"" + id + "\" of template \"" + this.serviceTemplateId - + "\" could not be found"); - throw new NotFoundException("Service template instance \"" + id + "\" of template \"" - + this.serviceTemplateId + "\" could not be found"); - } - - final List items = sti.getDeploymentTests().stream().map(v -> { - final ResourceDecorator decorator = new ResourceDecorator(); - decorator.setObject(v); - decorator.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePathBuilder() - .path(String.valueOf(v.getId())).build())) - .rel("self").build()); - return decorator; - }).collect(Collectors.toList()); - - final ResourceDecorator response = new ResourceDecorator(); - response.setObject(items); - response.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("self").build()); - - return Response.ok(response).build(); - } - - @GET - @Path("/{id}/deploymenttests/{deploymenttest}") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(hidden = true, value = "") - public Response getDeploymentTest(@PathParam("id") final Integer id, - @PathParam("deploymenttest") final Integer deploymenttest) { - - final CSARContent csarContent = this.csarService.findById(this.csarId); - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), this.serviceTemplateId)) { - logger.info("Service template \"" + this.serviceTemplateId + "\" could not be found"); - throw new NotFoundException("Service template \"" + this.serviceTemplateId + "\" could not be found"); - } - - // TODO: Check if instance belongs to CSAR and Service Template - final ServiceTemplateInstance sti = new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null); - if (sti == null) { - logger.info("Service template instance \"" + id + "\" of template \"" + this.serviceTemplateId - + "\" could not be found"); - throw new NotFoundException("Service template instance \"" + id + "\" of template \"" - + this.serviceTemplateId + "\" could not be found"); - } - - // TODO: Check if deployment test belongs the current instance - final DeploymentTest object = new DeploymentTestRepository().find(Long.valueOf(deploymenttest)).orElse(null); - if (object == null) { - throw new NotFoundException(); - } - - final ResourceDecorator response = new ResourceDecorator(); - response.setObject(object); - response.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("self").build()); - - return Response.ok(response).build(); - } - - - @POST - @Path("/{id}/deploymenttests") - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(hidden = true, value = "") - public Response createDeploymentTest(@PathParam("id") final Integer id) { - - final CSARContent csarContent = this.csarService.findById(this.csarId); - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), this.serviceTemplateId)) { - logger.info("Service template \"" + this.serviceTemplateId + "\" could not be found"); - throw new NotFoundException("Service template \"" + this.serviceTemplateId + "\" could not be found"); - } - - // TODO: Check if instance belongs to CSAR and Service Template - final ServiceTemplateInstance sti = new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null); - if (sti == null) { - logger.info("Service template instance \"" + id + "\" of template \"" + this.serviceTemplateId - + "\" could not be found"); - throw new NotFoundException("Service template instance \"" + id + "\" of template \"" - + this.serviceTemplateId + "\" could not be found"); - } - - final DeploymentTest result = this.deploymentTestService.run(csarContent.getCSARID(), sti); - final URI location = this.uriInfo.getAbsolutePathBuilder().path(String.valueOf(result.getId())).build(); - return Response.created(UriUtil.encode(location)).build(); - } - - -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/SituationsController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/SituationsController.java deleted file mode 100644 index 80336529a..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/SituationsController.java +++ /dev/null @@ -1,218 +0,0 @@ -package org.opentosca.container.api.controller; - -import java.net.URI; -import java.util.Collection; -import java.util.Set; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -import org.opentosca.container.api.dto.situations.SituationDTO; -import org.opentosca.container.api.dto.situations.SituationListDTO; -import org.opentosca.container.api.dto.situations.SituationTriggerDTO; -import org.opentosca.container.api.dto.situations.SituationTriggerInstanceDTO; -import org.opentosca.container.api.dto.situations.SituationTriggerListDTO; -import org.opentosca.container.api.service.CsarService; -import org.opentosca.container.api.service.InstanceService; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.model.Situation; -import org.opentosca.container.core.next.model.SituationTrigger; -import org.opentosca.container.core.next.model.SituationTriggerProperty; - -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - -@Path("/situationsapi") -public class SituationsController { - - @Context - UriInfo uriInfo; - - private InstanceService instanceService; - private CsarService csarService; - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Path("/situations") - public Response getSituations() { - final SituationListDTO dto = new SituationListDTO(); - this.instanceService.getSituations().forEach(x -> dto.add(SituationDTO.Converter.convert(x)));; - return Response.ok(dto).build(); - } - - @PUT - @Consumes({MediaType.TEXT_PLAIN}) - @Path("/situations/{situation}/active") - public Response updateSituationActivity(@PathParam("situation") final Long situationId, final String body) { - final Situation sit = this.instanceService.getSituation(situationId); - - boolean active = false; - - if (body.equalsIgnoreCase("true") || body.equalsIgnoreCase("false")) { - active = Boolean.valueOf(body); - } else { - return Response.notAcceptable(null).build(); - } - - - - sit.setActive(active); - - this.instanceService.updateSituation(sit); - - final URI instanceURI = UriUtil.generateSelfURI(this.uriInfo); - - return Response.ok(instanceURI).build(); - } - - @POST - @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Path("/situations") - public Response createSituation(final SituationDTO situation) { - final Situation sit = - this.instanceService.createNewSituation(situation.getThingId(), situation.getSituationTemplateId(), situation.getActive(), situation.getEventProbability(), situation.getEventTime()); - final URI instanceURI = UriUtil.generateSubResourceURI(this.uriInfo, sit.getId().toString(), false); - - return Response.ok(instanceURI).build(); - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Path("/situations/{situation}") - public Response getSituation(@PathParam("situation") final Long situationId) { - return Response.ok(SituationDTO.Converter.convert(this.instanceService.getSituation(situationId))).build(); - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Path("/triggers") - public Response getSituationTriggers() { - final SituationTriggerListDTO dto; - try { - dto = new SituationTriggerListDTO(); - this.instanceService.getSituationTriggers().forEach(x -> dto.add(SituationTriggerDTO.Converter.convert(x))); - } - catch (final Exception e) { - e.printStackTrace(); - return Response.serverError().build(); - } - return Response.ok(dto).build(); - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Path("/triggers/{situationtrigger}") - public Response getSituationTrigger(@PathParam("situationtrigger") final Long situationTriggerId) { - return Response.ok(SituationTriggerDTO.Converter.convert(this.instanceService.getSituationTrigger(situationTriggerId))) - .build(); - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - @Path("/triggers/{situationtrigger}/{situationtriggerinstance}") - public Response getSituationTriggerInstance(@PathParam("situationtrigger") final Long situationTriggerId, - @PathParam("situationtriggerinstance") final Long situationTriggerInstanceId) { - return Response.ok(SituationTriggerInstanceDTO.Converter.convert(this.instanceService.getSituationTriggerInstance(situationTriggerInstanceId))) - .build(); - } - - - @PUT - @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - @Path("/situations/{situation}") - public Response updateSituation(@PathParam("situation") final Long situationId, final SituationDTO situation) { - final Situation sit = this.instanceService.getSituation(situation.getId()); - - sit.setActive(situation.getActive()); - sit.setEventProbability(situation.getEventProbability()); - sit.setEventTime(situation.getEventTime()); - - this.instanceService.updateSituation(sit); - - final URI instanceURI = UriUtil.generateSelfURI(this.uriInfo); - - return Response.ok(instanceURI).build(); - } - - @DELETE - @Consumes({ MediaType.TEXT_PLAIN }) - @Path("/situations/{situation}") - public Response deleteSituation(@PathParam("situation") final Long situationId) { - - boolean removed = this.instanceService.removeSituation(situationId); - - if(removed){ - return Response.ok().build(); - } else { - return Response.status(410).build(); - } - } - - @POST - @Path("/triggers") - @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - public Response createSituationTrigger(final SituationTriggerDTO situationTrigger) { - final Collection sits = Lists.newArrayList(); - - for (final Long situationId : situationTrigger.getSituationIds()) { - final Situation situation = this.instanceService.getSituation(situationId); - sits.add(situation); - } - - ServiceTemplateInstance serviceInstance; - try { - serviceInstance = this.instanceService.getServiceTemplateInstance(situationTrigger.getServiceInstanceId(), - false); - } catch (final NotFoundException e) { - serviceInstance = null; - } - NodeTemplateInstance nodeInstance = null; - if (situationTrigger.getNodeInstanceId() != null) { - nodeInstance = this.instanceService.getNodeTemplateInstance(situationTrigger.getNodeInstanceId()); - } - - final Set inputs = Sets.newHashSet(); - - float eventProbability = -1.0f; - if (Float.compare(situationTrigger.getEventProbability(), eventProbability) != 0) { - eventProbability = situationTrigger.getEventProbability(); - } - - String eventTime = null; - if (situationTrigger.getEventTime() != null) { - eventTime = situationTrigger.getEventTime(); - } - - situationTrigger.getInputParams() - .forEach(x -> inputs.add(new SituationTriggerProperty(x.getName(), x.getValue(), x.getType()))); - - - final SituationTrigger sitTrig = this.instanceService.createNewSituationTrigger(sits, this.csarService.findById(situationTrigger.getCsarId()).getCSARID(), situationTrigger.isOnActivation(), situationTrigger.isSingleInstance(),serviceInstance, nodeInstance, situationTrigger.getInterfaceName(), situationTrigger.getOperationName(), inputs, eventProbability, eventTime); - final URI instanceURI = UriUtil.generateSubResourceURI(this.uriInfo, sitTrig.getId().toString(), false); - return Response.ok(instanceURI).build(); - } - - public void setInstanceService(final InstanceService instanceService) { - this.instanceService = instanceService; - } - - public void setCsarService(final CsarService csarService) { - this.csarService = csarService; - } - -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/content/DirectoryController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/content/DirectoryController.java deleted file mode 100644 index 7171d51c5..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/content/DirectoryController.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.opentosca.container.api.controller.content; - -import java.util.Objects; -import java.util.Set; - -import javax.ws.rs.GET; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -import org.opentosca.container.api.dto.ResourceSupport; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.core.model.AbstractDirectory; -import org.opentosca.container.core.model.AbstractFile; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DirectoryController { - - private static Logger logger = LoggerFactory.getLogger(DirectoryController.class); - - - private final AbstractDirectory directory; - - - public DirectoryController(final AbstractDirectory directory) { - Objects.nonNull(directory); - this.directory = directory; - logger.info("Directory path: {}", directory.getPath()); - } - - @GET - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Response getLinks(@Context final UriInfo uriInfo, @QueryParam("recursive") String recursive) { - final ResourceSupport dto = new ResourceSupport(); - - if(recursive == null){ - for (final AbstractDirectory directory : this.directory.getDirectories()) { - dto.add(UriUtil.generateSubResourceLink(uriInfo, directory.getName(), false, directory.getName())); - } - for (final AbstractFile file : this.directory.getFiles()) { - dto.add(UriUtil.generateSubResourceLink(uriInfo, file.getName(), false, file.getName())); - } - } else { - for(final AbstractFile file : this.directory.getFilesRecursively()) { - dto.add(UriUtil.generateSubResourceLink(uriInfo, file.getPath(), false, file.getName())); - } - } - - dto.add(UriUtil.generateSelfLink(uriInfo)); - return Response.ok(dto).build(); - } - - - @Path("/{path}") - @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Object getPath(@PathParam("path") String path, @Context final UriInfo uriInfo) { - path = UriUtil.encodePathSegment(path); - logger.debug("Serve path '{}' of directory '{}'", path, this.directory.getPath()); - for (final AbstractDirectory directory : this.directory.getDirectories()) { - if (directory.getName().equals(path)) { - logger.debug("Path '{}' is a directory...", path); - return new DirectoryController(directory); - } - } - for (final AbstractFile file : this.directory.getFiles()) { - if (file.getName().equals(path)) { - logger.debug("Path '{}' is a file...", path); - return new FileController(file); - } - } - logger.warn("Path '{}' does not exist in directory '{}'", path, this.directory.getPath()); - - throw new NotFoundException( - String.format("Path '%s' does not exist in directory '%s'", path, this.directory.getPath())); - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/controller/content/FileController.java b/org.opentosca.container.api/src/org/opentosca/container/api/controller/content/FileController.java deleted file mode 100644 index f6c664434..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/controller/content/FileController.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.opentosca.container.api.controller.content; - -import java.io.InputStream; -import java.util.Map; -import java.util.Objects; - -import javax.ws.rs.GET; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.apache.commons.io.FilenameUtils; -import org.opentosca.container.core.model.AbstractFile; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Maps; - -public class FileController { - - private static Logger logger = LoggerFactory.getLogger(FileController.class); - - private final AbstractFile file; - - - private static final Map IMAGE_TYPES = Maps.newHashMap(); - - static { - IMAGE_TYPES.put("png", MediaType.valueOf("image/png")); - IMAGE_TYPES.put("jpg", MediaType.valueOf("image/jpeg")); - IMAGE_TYPES.put("jpeg", MediaType.valueOf("image/jpeg")); - IMAGE_TYPES.put("gif", MediaType.valueOf("image/gif")); - } - - - public FileController(final AbstractFile file) { - Objects.nonNull(file); - this.file = file; - logger.info("File path: {}", file.getPath()); - } - - @GET - @Produces({MediaType.APPLICATION_OCTET_STREAM, "image/*"}) - public Response getFile() { - logger.info("Attempt to get file: \"{}\"", this.file.getPath()); - try { - final InputStream is = this.file.getFileAsInputStream(); - // Image or normal file download? - final String ext = FilenameUtils.getExtension(this.file.getName()); - final MediaType imageType = IMAGE_TYPES.get(ext); - if (imageType != null) { - // Serve the image - return Response.ok(is, imageType).build(); - } else { - // ... download the file - return Response.ok(is) - .header("Content-Disposition", "attachment; filename=\"" + this.file.getName() + "\"") - .build(); - } - } - catch (final Exception e) { - logger.error("Could not get file: {}", e.getMessage(), e); - return Response.serverError().build(); - } - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/service/CsarService.java b/org.opentosca.container.api/src/org/opentosca/container/api/service/CsarService.java deleted file mode 100644 index 0e2364aff..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/service/CsarService.java +++ /dev/null @@ -1,272 +0,0 @@ -package org.opentosca.container.api.service; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Collection; -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.ws.rs.NotFoundException; -import javax.ws.rs.ServerErrorException; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import javax.xml.namespace.QName; - -import org.apache.commons.io.FileUtils; -import org.eclipse.winery.model.selfservice.Application; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.instance.ServiceInstance; -import org.opentosca.container.core.service.ICoreFileService; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.planbuilder.export.Exporter; -import org.opentosca.planbuilder.export.Exporter.PlanExportResult; -import org.opentosca.planbuilder.importer.Importer; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - -public class CsarService { - - private static Logger logger = LoggerFactory.getLogger(CsarService.class); - - private ICoreFileService fileService; - - private IToscaEngineService engineService; - - private IFileAccessService fileAccessService; - - public class AdaptationPlanGenerationResult { - public CSARID csarId; - public String planId; - - public AdaptationPlanGenerationResult(CSARID csarId, String planId) { - this.csarId = csarId; - this.planId = planId; - } - } - - - /** - * Loads all available CSARs as {@link CSARContent} - * - * @return Set of {@link CSARContent} objects - */ - public Set findAll() { - logger.debug("Requesting all CSARs..."); - final Set csarSet = Sets.newHashSet(); - for (final CSARID id : this.fileService.getCSARIDs()) { - try { - csarSet.add(this.findById(id)); - } - catch (final Exception e) { - logger.error("Error while loading CSAR with ID \"{}\": {}", id, e.getMessage(), e); - throw new ServerErrorException(Response.serverError().build()); - } - } - return csarSet; - } - - /** - * Loads a CSAR as {@link CSARContent} by a given id - * - * @param id The id of the CSAR - * @return The CSAR as {@link CSARContent} - */ - public CSARContent findById(final CSARID id) { - logger.debug("Requesting CSAR \"{}\"...", id); - try { - return this.fileService.getCSAR(id); - } - catch (final UserException e) { - logger.info("CSAR \"" + id.getFileName() + "\" could not be found"); - throw new NotFoundException("CSAR \"" + id.getFileName() + "\" could not be found"); - } - } - - /** - * Loads a CSAR as {@link CSARContent} by a given id - * - * @param id The id of the CSAR - * @return The CSAR as {@link CSARContent} - */ - public CSARContent findById(final String id) { - return this.findById(new CSARID(id)); - } - - /** - * Reads the self-service metadata of a CSAR and returns it as a Java object - * - * @param csarContent The content object of the CSAR - * @return The self-service metadata as Java object - */ - public Application getSelfserviceMetadata(final CSARContent csarContent) { - try (final InputStream is = - csarContent.getDirectory("SELFSERVICE-Metadata").getFile("data.xml").getFileAsInputStream()) { - final JAXBContext jaxbContext = JAXBContext.newInstance(Application.class); - final Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); - return (Application) jaxbUnmarshaller.unmarshal(is); - } - catch (final Exception e) { - logger.error("Could not serialize data.xml from CSAR", e); - throw new ServerErrorException(Status.INTERNAL_SERVER_ERROR); - } - } - - /** - * Returns a set of strings representing service templates contained in a CSAR - * - * @param id The id of the CSAR - * @return A Set of String objects representing service templates - */ - public Set getServiceTemplates(final CSARID id) { - logger.debug("Requesting ServiceTemplates of CSAR \"{}\"...", id); - final List result = this.engineService.getServiceTemplatesInCSAR(id); - return result.stream().filter(Objects::nonNull).map(item -> item.toString()).collect(Collectors.toSet()); - } - - /** - * Utility to check if a given CSAR has a certain ServiceTemplate attached - * - * @param id The id of the CSAR - * @param name The QName as string of the ServiceTemplate - * @return true or false - */ - public boolean hasServiceTemplate(final CSARID id, final String name) { - return this.getServiceTemplates(id).contains(name); - } - - public File storeTemporaryFile(final String filename, final InputStream is) { - - final File tempDirectory = this.fileAccessService.getTemp(); - - // Make sure the temp directory exists - tempDirectory.mkdir(); - - // Determine temporary file location - final File file = new File(tempDirectory, filename); - - // Write the input stream into the file - try { - FileUtils.copyInputStreamToFile(is, file); - } - catch (final IOException e) { - logger.error("Error writing temporary CSAR file: {}", e.getMessage(), e); - return null; - } - - return file; - } - - /** - * Checks whether the plan builder should generate a build plans. - * - * @param csarId the {@link CSARID} to generate build plans - * @return the new {@link CSARID} for the repackaged CSAR or null if an error occurred - * @throws UserException - * @throws SystemException - */ - public CSARID generatePlans(final CSARID csarId) throws SystemException, UserException { - - final Importer planBuilderImporter = new Importer(); - final Exporter planBuilderExporter = new Exporter(); - - - try { - final List buildPlans = planBuilderImporter.generatePlans(csarId); - - if (buildPlans.isEmpty()) { - return csarId; - } - - final File file = planBuilderExporter.exportToCSAR(buildPlans, csarId).csarFile; - - this.fileService.deleteCSAR(csarId); - return this.fileService.storeCSAR(file.toPath()); - } - catch (final Exception e) { - logger.error("Could not generate Plans: {}", e.getMessage(), e); - this.fileService.deleteCSAR(csarId); - } - - return null; - } - - public AdaptationPlanGenerationResult generateAdaptationPlan(final CSARID csarId,QName serviceTemplateId, Collection sourceNodeTemplateIds, Collection sourceRelationshipTemplateIds, Collection targetNodeTemplateId, Collection targetRelationshipTemplateId) { - final Importer planBuilderImporter = new Importer(); - final Exporter planBuilderExporter = new Exporter(); - try { - - AbstractPlan plan = planBuilderImporter.generateAdaptationPlan(csarId, serviceTemplateId, sourceNodeTemplateIds, sourceRelationshipTemplateIds, targetNodeTemplateId, targetRelationshipTemplateId); - - if (plan == null) { - return null; - } - List plans = Lists.newArrayList(); - plans.add(plan); - final PlanExportResult result = planBuilderExporter.exportToCSAR(plans, csarId); - final File file = result.csarFile; - - this.engineService.clearCSARContent(csarId); - this.fileService.deleteCSAR(csarId); - - CSARID newCsarId = this.fileService.storeCSAR(file.toPath()); - return new AdaptationPlanGenerationResult(newCsarId, result.planIds.iterator().next()); - } - catch (final Exception e) { - logger.error("Could not store repackaged CSAR: {}", e.getMessage(), e); - } - - return null; - } - - public CSARID generateTransformationPlans(final CSARID sourceCsarId, final CSARID targetCsarId) { - - final Importer planBuilderImporter = new Importer(); - final Exporter planBuilderExporter = new Exporter(); - - // planBuilderImporter.buildTransformationPlans(sourceCsarId.getFileName(), sourceDefinitions, - // targetCsarId.getFileName(), targetDefinitions) - List plans = planBuilderImporter.generateTransformationPlans(sourceCsarId, targetCsarId); - - if (plans.isEmpty()) { - return sourceCsarId; - } - - final File file = planBuilderExporter.exportToCSAR(plans, sourceCsarId).csarFile; - - try { - this.engineService.clearCSARContent(sourceCsarId); - this.fileService.deleteCSAR(sourceCsarId); - return this.fileService.storeCSAR(file.toPath()); - } - catch (final Exception e) { - logger.error("Could not store repackaged CSAR: {}", e.getMessage(), e); - } - - return null; - } - - public void setFileService(final ICoreFileService fileService) { - this.fileService = fileService; - } - - public void setEngineService(final IToscaEngineService engineService) { - this.engineService = engineService; - } - - public void setFileAccessService(final IFileAccessService fileAccessService) { - this.fileAccessService = fileAccessService; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/service/InstanceService.java b/org.opentosca.container.api/src/org/opentosca/container/api/service/InstanceService.java deleted file mode 100644 index e4989bcf3..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/service/InstanceService.java +++ /dev/null @@ -1,813 +0,0 @@ -package org.opentosca.container.api.service; - -import java.util.Collection; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.ws.rs.NotFoundException; -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.opentosca.container.api.dto.NodeTemplateDTO; -import org.opentosca.container.api.dto.RelationshipTemplateDTO; -import org.opentosca.container.api.dto.request.CreateRelationshipTemplateInstanceRequest; -import org.opentosca.container.core.common.jpa.DocumentConverter; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstanceProperty; -import org.opentosca.container.core.next.model.NodeTemplateInstanceState; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.model.PlanType; -import org.opentosca.container.core.next.model.Property; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.next.model.RelationshipTemplateInstanceProperty; -import org.opentosca.container.core.next.model.RelationshipTemplateInstanceState; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstanceProperty; -import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; -import org.opentosca.container.core.next.model.Situation; -import org.opentosca.container.core.next.model.SituationTrigger; -import org.opentosca.container.core.next.model.SituationTriggerInstance; -import org.opentosca.container.core.next.model.SituationTriggerProperty; -import org.opentosca.container.core.next.model.SituationsMonitor; -import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; -import org.opentosca.container.core.next.repository.PlanInstanceRepository; -import org.opentosca.container.core.next.repository.RelationshipTemplateInstanceRepository; -import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; -import org.opentosca.container.core.next.repository.SituationRepository; -import org.opentosca.container.core.next.repository.SituationTriggerInstanceRepository; -import org.opentosca.container.core.next.repository.SituationTriggerRepository; -import org.opentosca.container.core.next.repository.SituationsMonitorRepository; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.google.common.collect.Lists; - -/** - * Allows access to instance information for service templates and node templates. - */ -public class InstanceService { - - private static Logger logger = LoggerFactory.getLogger(InstanceService.class); - - private final ServiceTemplateInstanceRepository serviceTemplateInstanceRepository = - new ServiceTemplateInstanceRepository(); - private final NodeTemplateInstanceRepository nodeTemplateInstanceRepository = new NodeTemplateInstanceRepository(); - private final RelationshipTemplateInstanceRepository relationshipTemplateInstanceRepository = - new RelationshipTemplateInstanceRepository(); - - // situations - private final SituationRepository sitRepo = new SituationRepository(); - private final SituationTriggerRepository sitTrig = new SituationTriggerRepository(); - private final SituationTriggerInstanceRepository sitTrigInst = new SituationTriggerInstanceRepository(); - private final SituationsMonitorRepository situationsMonitorRepo = new SituationsMonitorRepository(); - - private RelationshipTemplateService relationshipTemplateService; - private NodeTemplateService nodeTemplateService; - private ServiceTemplateService serviceTemplateService; - private IToscaEngineService engineService; - private IToscaReferenceMapper referenceMapper; - private final DocumentConverter converter = new DocumentConverter(); - - public Document convertPropertyToDocument(final Property property) { - return (Document) this.converter.convertDataValueToObjectValue(property.getValue(), null); - } - - /** - * Converts an xml document to an xml-based property suitable for service or node template instances - * - * @param propertyDoc - * @param type - * @return - * @throws InstantiationException - * @throws IllegalAccessException - * @throws IllegalArgumentException - */ - public T convertDocumentToProperty(final Document propertyDoc, - final Class type) throws InstantiationException, - IllegalAccessException, - IllegalArgumentException { - - if (propertyDoc == null) { - final String msg = - String.format("The set of parameters of an instance of type %s cannot be null", type.getName()); - logger.debug(msg); - throw new IllegalArgumentException(msg); - } - final String propertyAsString = (String) this.converter.convertObjectValueToDataValue(propertyDoc, null); - final T property = type.newInstance(); - property.setName("xml"); - property.setType("xml"); - property.setValue(propertyAsString); - - return property; - } - - /* Service Template Instances */ - /******************************/ - public IToscaReferenceMapper getReferenceMapper() { - return this.referenceMapper; - } - - public Collection getServiceTemplateInstances(final String serviceTemplate) { - return this.getServiceTemplateInstances(QName.valueOf(serviceTemplate)); - } - - public Collection getServiceTemplateInstances(final QName serviceTemplate) { - logger.debug("Requesting instances of ServiceTemplate \"{}\"...", serviceTemplate); - return this.serviceTemplateInstanceRepository.findByTemplateId(serviceTemplate); - } - - public ServiceTemplateInstance getServiceTemplateInstanceByCorrelationId(final String correlationId) { - return this.serviceTemplateInstanceRepository.findAll().stream() - .filter(s -> s.getPlanInstances().stream() - .anyMatch(p -> p.getCorrelationId() - .equals(correlationId))) - .findFirst().get(); - } - - public ServiceTemplateInstance getServiceTemplateInstance(final Long id, final boolean evaluatePropertyMappings) { - logger.debug("Requesting service template instance <{}>...", id); - final Optional instance = this.serviceTemplateInstanceRepository.find(id); - - if (instance.isPresent()) { - final ServiceTemplateInstance result = instance.get(); - - if (evaluatePropertyMappings) { - final PropertyMappingsHelper helper = new PropertyMappingsHelper(this); - helper.evaluatePropertyMappings(result); - } - - return result; - } - - logger.debug("Service Template Instance <" + id + "> not found."); - throw new NotFoundException("Service Template Instance <" + id + "> not found."); - } - - public ServiceTemplateInstanceState getServiceTemplateInstanceState(final Long id) { - final ServiceTemplateInstance service = getServiceTemplateInstance(id, false); - - return service.getState(); - } - - public void setServiceTemplateInstanceState(final Long id, final String state) throws NotFoundException, - IllegalArgumentException { - - ServiceTemplateInstanceState newState; - try { - newState = ServiceTemplateInstanceState.valueOf(state); - } - catch (final Exception e) { - final String msg = - String.format("The given state %s is an illegal service template instance state.", state); - logger.debug(msg); - throw new IllegalArgumentException(msg, e); - } - - final ServiceTemplateInstance service = getServiceTemplateInstance(id, false); - service.setState(newState); - this.serviceTemplateInstanceRepository.update(service); - } - - - - public Document getServiceTemplateInstanceRawProperties(final Long id) throws NotFoundException { - final ServiceTemplateInstance service = getServiceTemplateInstance(id, false); - final Optional firstProp = service.getProperties().stream().findFirst(); - - if (firstProp.isPresent()) { - return convertPropertyToDocument(firstProp.get()); - } - - final String msg = String.format("No properties are found for the service template instance <%s>", id); - logger.debug(msg); - - return null; - } - - public void setServiceTemplateInstanceProperties(final Long id, - final Document properties) throws ReflectiveOperationException { - final ServiceTemplateInstance service = getServiceTemplateInstance(id, false); - - try { - final ServiceTemplateInstanceProperty property = - this.convertDocumentToProperty(properties, ServiceTemplateInstanceProperty.class); - service.addProperty(property); - this.serviceTemplateInstanceRepository.update(service); - } - catch (InstantiationException | IllegalAccessException e) {// This is not supposed to happen at all! - final String msg = String.format("An error occurred while instantiating an instance of the %s class.", - ServiceTemplateInstanceProperty.class); - logger.debug(msg); - throw e; - } - - } - - public void deleteServiceTemplateInstance(final Long instanceId) { - // throws exception if not found - final ServiceTemplateInstance instance = getServiceTemplateInstance(instanceId, false); - this.serviceTemplateInstanceRepository.remove(instance); - } - - public ServiceTemplateInstance createServiceTemplateInstance(final String csarId, final String serviceTemplateQName, - final String correlationId) throws NotFoundException, - InstantiationException, - IllegalAccessException, - IllegalArgumentException { - final CSARID csar = this.serviceTemplateService.checkServiceTemplateExistence(csarId, serviceTemplateQName); - final PlanInstanceRepository repository = new PlanInstanceRepository(); - PlanInstance pi = null; - - try { - pi = repository.findByCorrelationId(correlationId); - } - catch (final Exception e) { - final String msg = - String.format("The given correlation id %s is either malformed, does not belong to an existing plan instance", - correlationId); - logger.info(msg); - throw new NotFoundException(msg); - } - - // If the found plan is a build plan there shouldn't be a service template instance available, if it - // is a transformation plan the service instance mustn't be of the service template the new service - // instance should belong to - if (pi.getType().equals(PlanType.BUILD) & pi.getServiceTemplateInstance() == null - || pi.getType().equals(PlanType.TRANSFORMATION) - & !pi.getServiceTemplateInstance().getTemplateId().toString().equals(serviceTemplateQName)) { - final QName stqn = QName.valueOf(serviceTemplateQName); - final ServiceTemplateInstance result = this.createServiceTemplateInstance(csar, stqn, pi); - - return result; - } else { - final String msg = "The build plan instance is already associted with a service template instance!"; - logger.info(msg); - throw new IllegalArgumentException(msg); - } - } - - private ServiceTemplateInstance createServiceTemplateInstance(final CSARID csarId, final QName serviceTemplateQName, - final PlanInstance buildPlanInstance) throws InstantiationException, - IllegalAccessException, - IllegalArgumentException { - final Document propertiesAsDoc = - createServiceInstanceInitialPropertiesFromServiceTemplate(csarId, serviceTemplateQName); - final ServiceTemplateInstanceProperty property = - convertDocumentToProperty(propertiesAsDoc, ServiceTemplateInstanceProperty.class); - - final ServiceTemplateInstance instance = new ServiceTemplateInstance(); - instance.setCsarId(csarId); - instance.setTemplateId(serviceTemplateQName); - instance.setState(ServiceTemplateInstanceState.INITIAL); - instance.addProperty(property); - instance.addPlanInstance(buildPlanInstance); - instance.setCreationCorrelationId(buildPlanInstance.getCorrelationId()); - this.serviceTemplateInstanceRepository.add(instance); - new PlanInstanceRepository().update(buildPlanInstance); - - return instance; - } - - private Document createServiceInstanceInitialPropertiesFromServiceTemplate(final CSARID csarId, - final QName serviceTemplateQName) { - - final Document existingProperties = - this.serviceTemplateService.getPropertiesOfServicTemplate(csarId, serviceTemplateQName); - - if (existingProperties != null) { - return existingProperties; - } - - logger.debug("No Properties found in BoundaryDefinitions for ST {} thus creating blank ones", - serviceTemplateQName); - final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - DocumentBuilder db; - try { - db = dbf.newDocumentBuilder(); - final Document doc = db.newDocument(); - final Element createElementNS = - doc.createElementNS("http://docs.oasis-open.org/tosca/ns/2011/12", "Properties"); - createElementNS.setAttribute("xmlns:tosca", "http://docs.oasis-open.org/tosca/ns/2011/12"); - createElementNS.setPrefix("tosca"); - doc.appendChild(createElementNS); - - return doc; - } - catch (final ParserConfigurationException e) { - logger.info("Cannot create a new DocumentBuilder: {}", e.getMessage()); - } - - return null; // this should never happen - - } - - /* Node Template Instances */ - /******************************/ - public Collection getNodeTemplateInstances(final QName nodeTemplateQName) { - logger.debug("Requesting instances of NodeTemplate \"{}\"...", nodeTemplateQName); - return this.nodeTemplateInstanceRepository.findByTemplateId(nodeTemplateQName); - } - - public Collection getAllNodeTemplateInstances() { - logger.debug("Requesting all NodeTemplate instances"); - return this.nodeTemplateInstanceRepository.findAll(); - } - - public NodeTemplateInstance resolveNodeTemplateInstance(final String serviceTemplateQName, - final String nodeTemplateId, final Long id) { - // We only need to check that the instance belongs to the template, the rest is - // guaranteed while this is a sub-resource - final QName nodeTemplateQName = - new QName(QName.valueOf(serviceTemplateQName).getNamespaceURI(), nodeTemplateId); - final NodeTemplateInstance instance = getNodeTemplateInstance(id); - - if (!instance.getTemplateId().equals(nodeTemplateQName)) { - logger.info("Node template instance <{}> could not be found", id); - throw new NotFoundException(String.format("Node template instance <%s> could not be found", id)); - } - - return instance; - } - - public NodeTemplateInstance getNodeTemplateInstance(final Long id) { - logger.debug("Requesting node template instance <{}>...", id); - final Optional instance = this.nodeTemplateInstanceRepository.find(id); - - if (instance.isPresent()) { - return instance.get(); - } - - logger.debug("Node Template Instance <" + id + "> not found."); - throw new NotFoundException("Node Template Instance <" + id + "> not found."); - } - - - public NodeTemplateInstanceState getNodeTemplateInstanceState(final String serviceTemplateQName, - final String nodeTemplateId, final Long id) { - final NodeTemplateInstance node = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); - - return node.getState(); - } - - public void setNodeTemplateInstanceState(final String serviceTemplateQName, final String nodeTemplateId, - final Long id, - final String state) throws NotFoundException, IllegalArgumentException { - - NodeTemplateInstanceState newState; - try { - newState = NodeTemplateInstanceState.valueOf(state); - } - catch (final Exception e) { - final String msg = String.format("The given state %s is an illegal node template instance state.", state); - logger.debug(msg); - throw new IllegalArgumentException(msg, e); - } - - final NodeTemplateInstance node = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); - node.setState(newState); - this.nodeTemplateInstanceRepository.update(node); - } - - public Document getNodeTemplateInstanceProperties(final String serviceTemplateQName, final String nodeTemplateId, - final Long id) throws NotFoundException { - final NodeTemplateInstance node = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); - final Optional firstProp = node.getProperties().stream().findFirst(); - - if (firstProp.isPresent()) { - return convertPropertyToDocument(firstProp.get()); - } - - final String msg = String.format("No properties are found for the node template instance <%s>", id); - logger.debug(msg); - return null; - } - - public void setNodeTemplateInstanceProperties(final String serviceTemplateQName, final String nodeTemplateId, - final Long id, - final Document properties) throws ReflectiveOperationException { - final NodeTemplateInstance node = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); - - try { - final NodeTemplateInstanceProperty property = - this.convertDocumentToProperty(properties, NodeTemplateInstanceProperty.class); - node.addProperty(property); - this.nodeTemplateInstanceRepository.update(node); - } - catch (InstantiationException | IllegalAccessException e) {// This is not supposed to happen at all! - final String msg = String.format("An error occurred while instantiating an instance of the %s class.", - NodeTemplateInstanceProperty.class); - logger.debug(msg); - throw e; - } - - } - - public NodeTemplateInstance createNewNodeTemplateInstance(final String csarId, - final String serviceTemplateQNameAsString, - final String nodeTemplateId, - final Long serviceTemplateInstanceId) throws InstantiationException, - IllegalAccessException, - IllegalArgumentException { - final QName serviceTemplateQName = QName.valueOf(serviceTemplateQNameAsString); - final NodeTemplateInstance newInstance = new NodeTemplateInstance(); - final NodeTemplateDTO dto = - this.nodeTemplateService.getNodeTemplateById(csarId, serviceTemplateQName, nodeTemplateId); - - // Properties - // We set the properties of the template as initial properties - final Document propertiesAsDocument = - this.nodeTemplateService.getPropertiesOfNodeTemplate(csarId, serviceTemplateQName, nodeTemplateId); - - if (propertiesAsDocument != null) { - final NodeTemplateInstanceProperty properties = - this.convertDocumentToProperty(propertiesAsDocument, NodeTemplateInstanceProperty.class); - newInstance.addProperty(properties); - } - // State - newInstance.setState(NodeTemplateInstanceState.INITIAL); - // Template - newInstance.setTemplateId(new QName(serviceTemplateQName.getNamespaceURI(), nodeTemplateId)); - // Type - newInstance.setTemplateType(QName.valueOf(dto.getNodeType())); - // ServiceTemplateInstance - final ServiceTemplateInstance serviceTemplateInstance = - getServiceTemplateInstance(serviceTemplateInstanceId, false); - - if (!serviceTemplateInstance.getTemplateId().equals(serviceTemplateQName)) { - final String msg = - String.format("Service template instance id <%s> does not belong to service template: %s", - serviceTemplateInstanceId, serviceTemplateQName); - logger.debug(msg); - throw new IllegalArgumentException(msg); - } - newInstance.setServiceTemplateInstance(serviceTemplateInstance); - - this.nodeTemplateInstanceRepository.add(newInstance); - - return newInstance; - } - - public void deleteNodeTemplateInstance(final String serviceTemplateQName, final String nodeTemplateId, - final Long id) { - final NodeTemplateInstance instance = resolveNodeTemplateInstance(serviceTemplateQName, nodeTemplateId, id); // throws - // exception - // if - // not - // found - this.nodeTemplateInstanceRepository.remove(instance); - } - - /* Relationship Template Instances */ - /***********************************/ - public Collection getRelationshipTemplateInstances(final QName relationshipTemplateQName) { - logger.debug("Requesting instances of RelationshipTemplate \"{}\"...", relationshipTemplateQName); - return this.relationshipTemplateInstanceRepository.findByTemplateId(relationshipTemplateQName); - } - - /** - * Gets a reference to the relationship template instance. Ensures that the instance actually - * belongs to the relationship template. - * - * @param instanceId - * @param templateId - * @return - * @throws NotFoundException if the instance does not belong to the relationship template - */ - public RelationshipTemplateInstance resolveRelationshipTemplateInstance(final String serviceTemplateQName, - final String relationshipTemplateId, - final Long instanceId) throws NotFoundException { - // We only need to check that the instance belongs to the template, the rest is - // guaranteed while this is a sub-resource - final RelationshipTemplateInstance instance = getRelationshipTemplateInstanc(instanceId); - final QName relationshipTemplateQName = - new QName(QName.valueOf(serviceTemplateQName).getNamespaceURI(), relationshipTemplateId); - if (!instance.getTemplateId().equals(relationshipTemplateQName)) { - logger.info("Relationship template instance <{}> could not be found", instanceId); - throw new NotFoundException( - String.format("Relationship template instance <%s> could not be found", instanceId)); - } - - return instance; - } - - private RelationshipTemplateInstance getRelationshipTemplateInstanc(final Long id) { - logger.debug("Requesting relationship template instance <{}>...", id); - final Optional instance = this.relationshipTemplateInstanceRepository.find(id); - - if (instance.isPresent()) { - return instance.get(); - } - - logger.debug("Relationship Template Instance <" + id + "> not found."); - throw new NotFoundException("Relationship Template Instance <" + id + "> not found."); - } - - public RelationshipTemplateInstanceState getRelationshipTemplateInstanceState(final String serviceTemplateQName, - final String relationshipTemplateId, - final Long id) { - final RelationshipTemplateInstance relationship = - resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, id); - - return relationship.getState(); - } - - public void setRelationshipTemplateInstanceState(final String serviceTemplateQName, - final String relationshipTemplateId, final Long id, - final String state) throws NotFoundException, - IllegalArgumentException { - - RelationshipTemplateInstanceState newState; - try { - newState = RelationshipTemplateInstanceState.valueOf(state); - } - catch (final Exception e) { - final String msg = - String.format("The given state %s is an illegal relationship template instance state.", state); - logger.debug(msg); - throw new IllegalArgumentException(msg, e); - } - - final RelationshipTemplateInstance relationship = - resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, id); - relationship.setState(newState); - this.relationshipTemplateInstanceRepository.update(relationship); - } - - public Document getRelationshipTemplateInstanceProperties(final String serviceTemplateQName, - final String relationshipTemplateId, - final Long id) throws NotFoundException { - final RelationshipTemplateInstance relationship = - resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, id); - final Optional firstProp = - relationship.getProperties().stream().findFirst(); - - if (firstProp.isPresent()) { - return convertPropertyToDocument(firstProp.get()); - } - - final String msg = String.format("No properties are found for the relationship template instance <%s>", id); - logger.debug(msg); - - return null; - } - - public void setRelationshipTemplateInstanceProperties(final String serviceTemplateQName, - final String relationshipTemplateId, final Long id, - final Document properties) throws ReflectiveOperationException { - final RelationshipTemplateInstance relationship = - resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, id); - - try { - final RelationshipTemplateInstanceProperty property = - this.convertDocumentToProperty(properties, RelationshipTemplateInstanceProperty.class); - relationship.addProperty(property); - this.relationshipTemplateInstanceRepository.update(relationship); - } - catch (InstantiationException | IllegalAccessException e) {// This is not supposed to happen at all! - final String msg = String.format("An error occurred while instantiating an instance of the %s class.", - RelationshipTemplateInstanceProperty.class); - logger.debug(msg); - throw e; - } - - } - - public RelationshipTemplateInstance createNewRelationshipTemplateInstance(final String csarId, - final String serviceTemplateId, - final String relationshipTemplateId, - final CreateRelationshipTemplateInstanceRequest request) throws InstantiationException, - IllegalAccessException, - IllegalArgumentException { - - if (request == null || request.getSourceNodeTemplateInstanceId() == null - || request.getTargetNodeTemplateInstanceId() == null) { - final String msg = - String.format("Relationship template instance creation request is empty or missing content"); - logger.info(msg); - throw new IllegalArgumentException(msg); - } - - final QName serviceTemplateQName = QName.valueOf(serviceTemplateId); - final RelationshipTemplateInstance newInstance = new RelationshipTemplateInstance(); - final RelationshipTemplateDTO dto = - this.relationshipTemplateService.getRelationshipTemplateById(csarId, serviceTemplateQName, - relationshipTemplateId); - - // Properties - // We set the properties of the template as initial properties - final Document propertiesAsDocument = - this.relationshipTemplateService.getPropertiesOfRelationshipTemplate(csarId, serviceTemplateQName, - relationshipTemplateId); - - if (propertiesAsDocument != null) { - final RelationshipTemplateInstanceProperty properties = - this.convertDocumentToProperty(propertiesAsDocument, RelationshipTemplateInstanceProperty.class); - newInstance.addProperty(properties); - } - // State - newInstance.setState(RelationshipTemplateInstanceState.INITIAL); - // Template - newInstance.setTemplateId(new QName(serviceTemplateQName.getNamespaceURI(), relationshipTemplateId)); - // Type - newInstance.setTemplateType(QName.valueOf(dto.getRelationshipType())); - // Source node instance - newInstance.setSource(getNodeTemplateInstance(request.getSourceNodeTemplateInstanceId())); - // Target node instance - newInstance.setTarget(getNodeTemplateInstance(request.getTargetNodeTemplateInstanceId())); - newInstance.setServiceTemplateInstance(this.serviceTemplateInstanceRepository.find(request.getServiceInstanceId()) - .get()); - - this.relationshipTemplateInstanceRepository.add(newInstance); - - return newInstance; - } - - public void deleteRelationshipTemplateInstance(final String serviceTemplateQName, - final String relationshipTemplateId, final Long instanceId) { - final RelationshipTemplateInstance instance = - resolveRelationshipTemplateInstance(serviceTemplateQName, relationshipTemplateId, instanceId); // throws - // exception - // if - // not - // found - this.relationshipTemplateInstanceRepository.remove(instance); - } - - /* Situations */ - public Situation createNewSituation(final String thingId, final String situationTemplateId, final boolean active, float eventProbability, String eventTime) { - final Situation newInstance = new Situation(); - - newInstance.setSituationTemplateId(situationTemplateId); - newInstance.setThingId(thingId); - newInstance.setActive(active); - newInstance.setEventProbability(eventProbability); - newInstance.setEventTime(eventTime); - - this.sitRepo.add(newInstance); - - return newInstance; - - } - - public Situation getSituation(final Long id) { - final Optional instance = this.sitRepo.find(id); - if (instance.isPresent()) { - return instance.get(); - } - throw new NotFoundException("Situation <" + id + "> not found."); - } - - public Collection getSituations() { - return this.sitRepo.findAll(); - } - - public boolean removeSituation(final Long situationId) { - if(this.sitTrig.findSituationTriggersBySituationId(situationId).isEmpty()) { - this.sitRepo.find(situationId).ifPresent(x -> this.sitRepo.remove(x)); - return true; - } - return false; - } - - public Collection getSituationTriggers() { - return this.sitTrig.findAll(); - } - - public Collection getSituationTriggers(final Situation situation) { - return this.sitTrig.findSituationTriggersBySituationId(situation.getId()); - } - - public SituationTrigger createNewSituationTrigger(final Collection situations, final CSARID csarId, - final boolean triggerOnActivation, final boolean isSingleInstance, - final ServiceTemplateInstance serviceInstance, - final NodeTemplateInstance nodeInstance, - final String interfaceName, final String operationName, - final Set inputs, - final float eventProbability, final String eventTime) { - final SituationTrigger newInstance = new SituationTrigger(); - - newInstance.setSituations(situations); - newInstance.setCsarId(csarId); - newInstance.setTriggerOnActivation(triggerOnActivation); - newInstance.setSingleInstance(isSingleInstance); - newInstance.setServiceInstance(serviceInstance); - newInstance.setInterfaceName(interfaceName); - newInstance.setOperationName(operationName); - if (nodeInstance != null) { - newInstance.setNodeInstance(nodeInstance); - } - - for (SituationTriggerProperty input : inputs) { - input.setSituationTrigger(newInstance); - } - - newInstance.setInputs(inputs); - - if (eventProbability != -1.0f) { - newInstance.setEventProbability(eventProbability); - } - if (eventTime != null) { - newInstance.setEventTime(eventTime); - } - - this.sitTrig.add(newInstance); - - return newInstance; - } - - public SituationTrigger getSituationTrigger(final Long id) { - final Optional opt = this.sitTrig.find(id); - - if (opt.isPresent()) { - return opt.get(); - } - - throw new NotFoundException("SituationTrigger <" + id + "> not found."); - } - - public void removeSituationTrigger(Long situationTriggerId) { - this.sitTrig.find(situationTriggerId).ifPresent(x -> this.sitTrig.remove(x)); - } - - public Collection geSituationTriggerInstances(final SituationTrigger trigger) { - final Collection triggerInstances = Lists.newArrayList(); - for (final SituationTriggerInstance triggerInstance : this.sitTrigInst.findAll()) { - if (triggerInstance.getSituationTrigger().equals(trigger)) { - triggerInstances.add(triggerInstance); - } - } - return triggerInstances; - } - - - public void updateSituation(final Situation situation) { - this.sitRepo.update(situation); - } - - public SituationTriggerInstance getSituationTriggerInstance(final Long id) { - - final Optional opt = this.sitTrigInst.find(id); - - if (opt.isPresent()) { - return opt.get(); - } - - throw new RuntimeException("SituationTriggerInstance <" + id + "> not found."); - } - - public SituationsMonitor createNewSituationsMonitor(final ServiceTemplateInstance instance, - final Map> situations) { - final SituationsMonitor monitor = new SituationsMonitor(); - - monitor.setServiceInstance(instance); - - monitor.setNode2Situations(situations); - - this.situationsMonitorRepo.add(monitor); - return monitor; - } - - public Collection getSituationsMonitors() { - return this.situationsMonitorRepo.findAll(); - } - - public Collection getSituationsMonitors(final Long serviceInstanceId) { - return this.getSituationsMonitors().stream().filter(monitor -> monitor.getServiceInstance() != null - && monitor.getServiceInstance().getId().equals(serviceInstanceId)).collect(Collectors.toList()); - } - - /* Service Injection */ - /*********************/ - - public void setRelationshipTemplateService(final RelationshipTemplateService relationshipTemplateService) { - this.relationshipTemplateService = relationshipTemplateService; - } - - public void setNodeTemplateService(final NodeTemplateService nodeTemplateService) { - this.nodeTemplateService = nodeTemplateService; - } - - public void setServiceTemplateService(final ServiceTemplateService serviceTemplateService) { - this.serviceTemplateService = serviceTemplateService; - } - - public void setEngineService(final IToscaEngineService engineService) { - this.engineService = engineService; - // We cannot inject an instance of {@link IToscaReferenceMapper} since - // it is manually created in our default implementation of {@link - // IToscaEngineService} - this.referenceMapper = this.engineService.getToscaReferenceMapper(); - } - -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/service/NodeTemplateService.java b/org.opentosca.container.api/src/org/opentosca/container/api/service/NodeTemplateService.java deleted file mode 100644 index f4b8b964b..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/service/NodeTemplateService.java +++ /dev/null @@ -1,235 +0,0 @@ -package org.opentosca.container.api.service; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.NotFoundException; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.NodeOperationDTO; -import org.opentosca.container.api.dto.NodeTemplateDTO; -import org.opentosca.container.api.dto.boundarydefinitions.InterfaceDTO; -import org.opentosca.container.api.dto.boundarydefinitions.InterfaceListDTO; -import org.opentosca.container.api.dto.boundarydefinitions.OperationDTO; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.TParameter; -import org.opentosca.container.core.tosca.model.TBoolean; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; - -import com.google.common.collect.Lists; - -// TODO it is assumed that the name of the node template is the same as its id. -/** - * Provides data access functionality to retrieve node templates based on a service template. - * Throughout the class, it is assumed that the passed service template id belongs to the passed - * CSAR, i.e., it is assumed that a check that this is true is performed earlier. - * - * @author Ghareeb Falazi - * - */ -public class NodeTemplateService { - private static Logger logger = LoggerFactory.getLogger(InstanceService.class); - - private CsarService csarService; - private IToscaEngineService toscaEngineService; - - /** - * Gets a collection of node templates associated to a given service template. - * - * @param csarId The id of the CSAR - * @param serviceTemplateQName The QName of the service template within the given CSAR - * @return A collection of node templates stored within the given service template. - */ - public List getNodeTemplatesOfServiceTemplate(final String csarId, - final String serviceTemplateQName) { - final CSARContent csarContent = this.csarService.findById(csarId); - final List nodeTemplateIds = - this.toscaEngineService.getNodeTemplatesOfServiceTemplate(csarContent.getCSARID(), - QName.valueOf(serviceTemplateQName)); - final List nodeTemplates = Lists.newArrayList(); - NodeTemplateDTO currentNodeTemplate; - - for (final String id : nodeTemplateIds) { - currentNodeTemplate = createNodeTemplate(csarContent.getCSARID(), QName.valueOf(serviceTemplateQName), id); - nodeTemplates.add(currentNodeTemplate); - } - - return nodeTemplates; - } - - /** - * Gets the node template specified by its id - * - * @param csarId The id of the CSAR - * @param serviceTemplateQName The QName of the service template within the given CSAR - * @param nodeTemplateId The id of the node template we want to get and that belongs to the - * specified service template - * @return The node template specified by the given id - * @throws NotFoundException If the service template does not contain the specified node - * template - */ - public NodeTemplateDTO getNodeTemplateById(final String csarId, final QName serviceTemplateQName, - final String nodeTemplateId) throws NotFoundException { - final CSARContent csarContent = this.csarService.findById(csarId); - final CSARID idOfCsar = csarContent.getCSARID(); - - if (!this.toscaEngineService.getNodeTemplatesOfServiceTemplate(idOfCsar, serviceTemplateQName) - .contains(nodeTemplateId)) { - logger.info("Node template \"" + nodeTemplateId + "\" could not be found"); - throw new NotFoundException("Node template \"" + nodeTemplateId + "\" could not be found"); - } - - return createNodeTemplate(idOfCsar, serviceTemplateQName, nodeTemplateId); - } - - /** - * Checks whether the specified service template contains a given node template. - * - * @param csarId The id of the CSAR - * @param serviceTemplateQName the QName of the service template - * @param nodeTemplateId the id of the node template to check for - * @return true when the CSAR contains the service template and the service - * template contains the node template, otherwise false - */ - public boolean hasNodeTemplate(final String csarId, final QName serviceTemplateQName, final String nodeTemplateId) { - return getNodeTemplateIdsOfServiceTemplate(csarId, serviceTemplateQName.toString()).contains(nodeTemplateId); - } - - - /** - * Gets the properties (as an XML document) of a given node template. - * - * @param csarId - * @param serviceTemplateQName - * @param nodeTemplateId - * @return - */ - public Document getPropertiesOfNodeTemplate(final String csarId, final QName serviceTemplateQName, - final String nodeTemplateId) { - final CSARContent csarContent = this.csarService.findById(csarId); - final CSARID idOfCsar = csarContent.getCSARID(); - - if (!this.toscaEngineService.getNodeTemplatesOfServiceTemplate(idOfCsar, serviceTemplateQName) - .contains(nodeTemplateId)) { - logger.info("Node template \"" + nodeTemplateId + "\" could not be found"); - throw new NotFoundException("Node template \"" + nodeTemplateId + "\" could not be found"); - } - - final Document properties = - this.toscaEngineService.getPropertiesOfTemplate(idOfCsar, serviceTemplateQName, nodeTemplateId); - - return properties; - } - - // TODO Careful! this method assumes that the namespace of a node template is the same namespace - // as its parent service template! - /** - * Creates a new instance of the NodeTemplateDTO class. It fetches the qualified name of node - * type of the node template. - * - * @param csarId - * @param serviceTemplateQName - * @param nodeTemplateIde - * @return - */ - private NodeTemplateDTO createNodeTemplate(final CSARID csarId, final QName serviceTemplateQName, - final String nodeTemplateId) { - final QName nodeTypeId = - this.toscaEngineService.getNodeTypeOfNodeTemplate(csarId, serviceTemplateQName, nodeTemplateId); - - final NodeTemplateDTO currentNodeTemplate = new NodeTemplateDTO(); - currentNodeTemplate.setId(nodeTemplateId); - currentNodeTemplate.setName(nodeTemplateId); - currentNodeTemplate.setNodeType(nodeTypeId.toString()); - - final InterfaceListDTO interfaces = new InterfaceListDTO(); - - final List interfaceNames = this.toscaEngineService.getInterfaceNamesOfNodeType(csarId, nodeTypeId); - - for (final String interfaceName : interfaceNames) { - final InterfaceDTO interfaceDto = new InterfaceDTO(); - - interfaceDto.setName(interfaceName); - - final Map opMap = new HashMap<>(); - - final List operationNames = - this.toscaEngineService.getOperationNamesOfNodeTypeInterface(csarId, nodeTypeId, interfaceName); - - for (final String operationName : operationNames) { - final List inputParamNames = - this.toscaEngineService.getInputParametersOfTypeOperation(csarId, nodeTypeId, interfaceName, - operationName); - final List outputParamNames = - this.toscaEngineService.getOutputParametersOfTypeOperation(csarId, nodeTypeId, interfaceName, - operationName); - final OperationDTO operationDto = new OperationDTO(); - - operationDto.setName(operationName); - - final NodeOperationDTO nodeOperationDTO = new NodeOperationDTO(); - - nodeOperationDTO.setName(operationName); - - nodeOperationDTO.setInputParameters(transform(inputParamNames)); - nodeOperationDTO.setOutputParameters(transform(outputParamNames)); - - - operationDto.setNodeOperation(nodeOperationDTO); - - opMap.put(operationName, operationDto); - } - - interfaceDto.setOperations(opMap); - - interfaces.add(interfaceDto); - } - - currentNodeTemplate.setInterfaces(interfaces); - - return currentNodeTemplate; - } - - private List transform(final List params) { - final List tParams = Lists.newArrayList(); - - for (final String param : params) { - final TParameter tParam = new TParameter(); - tParam.setName(param); - // TODO currently hard to get - tParam.setRequired(TBoolean.YES); - tParams.add(tParam); - } - - return tParams; - } - - /** - * Gets a collection of node template ids associated to a given service template. - * - * @param csarId The id of the CSAR - * @param serviceTemplateQName the QName of the service template within the given CSAR - * @return A collection of node template ids stored within the given service template. - */ - private List getNodeTemplateIdsOfServiceTemplate(final String csarId, final String serviceTemplateQName) { - final CSARContent csarContent = this.csarService.findById(csarId); - - return this.toscaEngineService.getNodeTemplatesOfServiceTemplate(csarContent.getCSARID(), - QName.valueOf(serviceTemplateQName)); - } - - /* Service Injection */ - /*********************/ - public void setCsarService(final CsarService csarService) { - this.csarService = csarService; - } - - public void setToscaEngineService(final IToscaEngineService toscaEngineService) { - this.toscaEngineService = toscaEngineService; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/service/PlanService.java b/org.opentosca.container.api/src/org/opentosca/container/api/service/PlanService.java deleted file mode 100644 index ed3d3ab14..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/service/PlanService.java +++ /dev/null @@ -1,443 +0,0 @@ -package org.opentosca.container.api.service; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; - -import javax.ws.rs.NotFoundException; -import javax.ws.rs.ServerErrorException; -import javax.ws.rs.core.Link; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriInfo; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.plan.PlanDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceEventListDTO; -import org.opentosca.container.api.dto.plan.PlanInstanceListDTO; -import org.opentosca.container.api.dto.plan.PlanListDTO; -import org.opentosca.container.api.dto.request.CreatePlanInstanceLogEntryRequest; -import org.opentosca.container.api.util.JsonUtil; -import org.opentosca.container.api.util.UriUtil; -import org.opentosca.container.control.IOpenToscaControlService; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.model.PlanInstanceEvent; -import org.opentosca.container.core.next.model.PlanInstanceState; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.repository.PlanInstanceRepository; -import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.extension.TParameter; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.deployment.tests.DeploymentTestService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Lists; - -public class PlanService { - - private static Logger logger = LoggerFactory.getLogger(PlanService.class); - - private static final PlanTypes[] ALL_PLAN_TYPES = PlanTypes.values(); - - // To retrieve a reference to IToscaReferenceMapper - private IToscaEngineService engineService; - - private IToscaReferenceMapper referenceMapper; - - private IOpenToscaControlService controlService; - - private DeploymentTestService deploymentTestService; - - private final PlanInstanceRepository planInstanceRepository = new PlanInstanceRepository(); - - public List getPlansByType(final CSARID id, final PlanTypes... planTypes) { - logger.debug("Requesting plans of type \"{}\" for CSAR \"{}\"...", planTypes, id); - final List plans = Lists.newArrayList(); - final Map> plansOfCsar = this.referenceMapper.getCSARIDToPlans(id); - for (final PlanTypes planType : planTypes) { - final LinkedHashMap plansOfType = plansOfCsar.get(planType); - if (plansOfType == null) { - logger.warn("CSAR \"" + id.getFileName() + "\" does not have a plan of type \"" + planType.toString() - + "\""); - continue; - } - plans.addAll(plansOfType.values()); - } - return plans; - } - - public TPlan getPlan(final String name, final CSARID id) { - return getPlansByType(id, ALL_PLAN_TYPES).stream().filter(plan -> Objects.nonNull(plan.getId()) - && plan.getId().equalsIgnoreCase(name)).findFirst().orElse(null); - } - - - - public String invokePlan(final CSARID csarId, final QName serviceTemplate, final long serviceTemplateInstanceId, - final TPlan plan, final List parameters) { - - final PlanDTO dto = new PlanDTO(plan); - - final String namespace = this.referenceMapper.getNamespaceOfPlan(csarId, plan.getId()); - dto.setId(new QName(namespace, plan.getId()).toString()); - dto.setInputParameters(parameters); - - try { - final String correlationId = - this.controlService.invokePlanInvocation(csarId, serviceTemplate, serviceTemplateInstanceId, - PlanDTO.Converter.convert(dto)); - if (PlanTypes.isPlanTypeURI(plan.getPlanType()).equals(PlanTypes.BUILD) - && Boolean.parseBoolean(Settings.OPENTOSCA_DEPLOYMENT_TESTS)) { - logger.debug("Plan \"{}\" is a build plan, so we schedule deployment tests...", plan.getName()); - this.deploymentTestService.runAfterPlan(csarId, correlationId); - } - return correlationId; - } - catch (final UnsupportedEncodingException e) { - throw new ServerErrorException(500, e); - } - } - - public boolean hasPlan(final CSARID csarId, final PlanTypes[] planTypes, final String plan) { - final TPlan p = this.getPlan(plan, csarId); - if (p == null) { - return false; - } - if (Arrays.asList(planTypes).contains(PlanTypes.isPlanTypeURI(p.getPlanType()))) { - return true; - } - return false; - } - - - public PlanInstance getPlanInstanceByCorrelationId(final String correlationId) { - return this.planInstanceRepository.findByCorrelationId(correlationId); - } - - /** - * Gets the indicated plan instance and performs sanity checks insuring that the plan belongs to the - * service template, the instance belongs to the plan, and belongs to the service template instance - * (if one is passed). - * - * @param plan - * @param instance - * @param uriInfo - * @param csarId - * @param serviceTemplate - * @param serviceTemplateInstanceId - * @param planTypes - * @return - */ - private PlanInstance resolvePlanInstance(final String plan, final String instance, final UriInfo uriInfo, - final CSARID csarId, final QName serviceTemplate, - final Long serviceTemplateInstanceId, final PlanTypes... planTypes) { - - if (!hasPlan(csarId, planTypes, plan)) { - final String msg = "Plan \"" + plan + "\" could not be found"; - logger.info(msg); - throw new NotFoundException(msg); - } - - final PlanInstanceRepository repository = new PlanInstanceRepository(); - final PlanInstance pi = repository.findByCorrelationId(instance); - - if (pi == null) { - final String msg = "Plan instance '" + instance + "' not found"; - logger.info(msg); - throw new NotFoundException(msg); - } - - final Long id = pi.getServiceTemplateInstance().getId(); - - if (!pi.getTemplateId().getLocalPart().equals(plan)) { - final String msg = - String.format("The passed plan instance <%s> does not belong to the passed plan template: %s", instance, - plan); - logger.info(msg); - throw new NotFoundException(msg); - } - - if (serviceTemplateInstanceId != null && serviceTemplateInstanceId != id) { - final String msg = - String.format("The passed service template instance id <%s> does not match the service template instance id that is associated with the plan instance <%s> ", - serviceTemplateInstanceId, id, instance); - logger.info(msg); - throw new NotFoundException(msg); - } - - return pi; - } - - /* API Operations Helper Methods */ - /*********************************/ - /*********************************/ - - /* Plan Templates */ - /******************/ - - public Response getPlans(final UriInfo uriInfo, final CSARID csarId, final QName serviceTemplate, - final PlanTypes... planTypes) { - - final List buildPlans = getPlansByType(csarId, planTypes); - logger.debug("Found <{}> plans for ServiceTemplate \"{}\" in CSAR \"{}\"", buildPlans.size(), serviceTemplate, - csarId); - - final PlanListDTO list = new PlanListDTO(); - buildPlans.stream().forEach(p -> { - final PlanDTO plan = new PlanDTO(p); - - plan.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(plan.getId()).path("instances") - .build())) - .rel("instances").build()); - plan.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(plan.getId()).build())) - .rel("self").build()); - list.add(plan); - }); - list.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePath())).rel("self").build()); - - return Response.ok(list).build(); - } - - public Response getPlan(final String plan, final UriInfo uriInfo, final CSARID csarId, final QName serviceTemplate, - final PlanTypes... planTypes) { - - final List buildPlans = getPlansByType(csarId, planTypes); - logger.debug("Found <{}> plans for ServiceTemplate \"{}\" in CSAR \"{}\"", buildPlans.size(), serviceTemplate, - csarId); - - final TPlan p = getPlan(plan, csarId); - - if (p == null) { - logger.info("Plan \"" + plan + "\" of ServiceTemplate \"" + serviceTemplate + "\" in CSAR \"" + csarId - + "\" not found"); - throw new NotFoundException("Plan \"" + plan + "\" of ServiceTemplate \"" + serviceTemplate - + "\" in CSAR \"" + csarId + "\" not found"); - } - - final PlanDTO dto = new PlanDTO(p); - dto.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePathBuilder().path("instances").build())) - .rel("instances").build()); - dto.add(Link.fromUri(UriUtil.encode(uriInfo.getAbsolutePath())).rel("self").build()); - return Response.ok(dto).build(); - } - - public Response invokePlan(final String plan, final UriInfo uriInfo, final List parameters, - final CSARID csarId, final QName serviceTemplate, final Long serviceTemplateInstanceId, - final PlanTypes... planTypes) { - - final TPlan p = getPlan(plan, csarId); - - if (parameters == null) { - return Response.status(Status.BAD_REQUEST).build(); - } - - - if (!hasPlan(csarId, planTypes, plan)) { - logger.info("Plan \"" + plan + "\" could not be found"); - throw new NotFoundException("Plan \"" + plan + "\" could not be found"); - } - - logger.info("Received a payload for plan \"{}\" in ServiceTemplate \"{}\" of CSAR \"{}\"", plan, - serviceTemplate, csarId); - if (logger.isDebugEnabled()) { - logger.debug("Request payload:\n{}", JsonUtil.writeValueAsString(parameters)); - } - // set "meta" params - for (final TParameter param : parameters) { - if (param.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT) - && param.getValue() != null && param.getValue().isEmpty()) { - final String containerRepoUrl = Settings.getSetting("org.opentosca.container.connector.winery.url"); - param.setValue(containerRepoUrl); - } - } - - - final String correlationId = invokePlan(csarId, serviceTemplate, serviceTemplateInstanceId, p, parameters); - final URI location = UriUtil.encode(uriInfo.getAbsolutePathBuilder().path(correlationId).build()); - - - - return Response.created(location).entity(correlationId).build(); - } - - /* Plan Instances */ - /*****************/ - public Response getPlanInstances(final String plan, final UriInfo uriInfo, final CSARID csarId, - final QName serviceTemplate, final Long serviceTemplateInstanceId, - final PlanTypes... planTypes) { - - if (!hasPlan(csarId, planTypes, plan)) { - logger.info("Plan \"" + plan + "\" could not be found"); - throw new NotFoundException("Plan \"" + plan + "\" could not be found"); - } - - final ServiceTemplateInstanceRepository repo = new ServiceTemplateInstanceRepository(); - - - final Collection serviceInstances; - if (serviceTemplateInstanceId != null) { - serviceInstances = Lists.newArrayList(); - serviceInstances.add(repo.find(serviceTemplateInstanceId).get()); - } else { - serviceInstances = repo.findByCsarId(csarId); - } - - final List planInstances = Lists.newArrayList(); - for (final ServiceTemplateInstance sti : serviceInstances) { - final List dto = sti.getPlanInstances().stream().filter(p -> { - final PlanTypes currType = PlanTypes.isPlanTypeURI(p.getType().toString()); - return Arrays.asList(planTypes).contains(currType) - && plan.equalsIgnoreCase(p.getTemplateId().getLocalPart()); - }).map(p -> PlanInstanceDTO.Converter.convert(p)).collect(Collectors.toList()); - planInstances.addAll(dto); - } - - for (final PlanInstanceDTO pi : planInstances) { - - // Should we add the link in the "instances" method or only in "instance" - // method? - // Add service template instance link - final Long id = pi.getServiceTemplateInstanceId(); - if (id != null) { - final URI uri = uriInfo.getBaseUriBuilder() - .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{instance}") - .build(csarId.toString(), serviceTemplate.toString(), String.valueOf(id)); - pi.add(Link.fromUri(UriUtil.encode(uri)).rel("service_template_instance").build()); - } - - // Add self link - pi.add(UriUtil.generateSubResourceLink(uriInfo, pi.getCorrelationId(), true, "self")); - } - - final PlanInstanceListDTO list = new PlanInstanceListDTO(); - - list.add(planInstances); - list.add(UriUtil.generateSelfLink(uriInfo)); - - return Response.ok(list).build(); - } - - public Response getPlanInstance(final String plan, final String instance, final UriInfo uriInfo, - final CSARID csarId, final QName serviceTemplate, - final Long serviceTemplateInstanceId, final PlanTypes... planTypes) { - - final PlanInstance pi = - resolvePlanInstance(plan, instance, uriInfo, csarId, serviceTemplate, serviceTemplateInstanceId, planTypes); - final PlanInstanceDTO dto = PlanInstanceDTO.Converter.convert(pi); - // Add service template instance link - if (pi.getServiceTemplateInstance() != null) { - final URI uri = uriInfo.getBaseUriBuilder() - .path("/csars/{csar}/servicetemplates/{servicetemplate}/instances/{instance}") - .build(csarId.toString(), serviceTemplate.toString(), - String.valueOf(pi.getServiceTemplateInstance().getId())); - dto.add(Link.fromUri(UriUtil.encode(uri)).rel("service_template_instance").build()); - } - - dto.add(UriUtil.generateSubResourceLink(uriInfo, "state", false, "state")); - dto.add(UriUtil.generateSubResourceLink(uriInfo, "logs", false, "logs")); - - // Add self link - dto.add(UriUtil.generateSelfLink(uriInfo)); - - return Response.ok(dto).build(); - - } - - public Response getPlanInstanceState(final String plan, final String instance, final UriInfo uriInfo, - final CSARID csarId, final QName serviceTemplate, - final Long serviceTemplateInstanceId, final PlanTypes... planTypes) { - - final PlanInstance pi = - resolvePlanInstance(plan, instance, uriInfo, csarId, serviceTemplate, serviceTemplateInstanceId, planTypes); - - return Response.ok(pi.getState().toString()).build(); - } - - public Response changePlanInstanceState(final String newState, final String plan, final String instance, - final UriInfo uriInfo, final CSARID csarId, final QName serviceTemplate, - final Long serviceTemplateInstanceId, final PlanTypes... planTypes) { - - final PlanInstance pi = - resolvePlanInstance(plan, instance, uriInfo, csarId, serviceTemplate, serviceTemplateInstanceId, planTypes); - try { - final PlanInstanceState parsedState = PlanInstanceState.valueOf(newState); - pi.setState(parsedState); - this.planInstanceRepository.update(pi); - - return Response.ok().build(); - } - catch (final IllegalArgumentException e) { - final String msg = String.format("The given state %s is an illegal plan instance state.", newState); - logger.info(msg); - - return Response.status(Status.BAD_REQUEST).build(); - } - - } - - public Response getPlanInstanceLogs(final String plan, final String instance, final UriInfo uriInfo, - final CSARID csarId, final QName serviceTemplate, - final Long serviceTemplateInstanceId, final PlanTypes... planTypes) { - - final PlanInstance pi = - resolvePlanInstance(plan, instance, uriInfo, csarId, serviceTemplate, serviceTemplateInstanceId, planTypes); - - final PlanInstanceDTO piDto = PlanInstanceDTO.Converter.convert(pi); - final PlanInstanceEventListDTO dto = new PlanInstanceEventListDTO(piDto.getLogs()); - dto.add(UriUtil.generateSelfLink(uriInfo)); - - return Response.ok(dto).build(); - } - - public Response addLogToPlanInstance(final CreatePlanInstanceLogEntryRequest logEntry, final String plan, - final String instance, final UriInfo uriInfo, final CSARID csarId, - final QName serviceTemplate, final Long serviceTemplateInstanceId, - final PlanTypes... planTypes) { - final String entry = logEntry.getLogEntry(); - - if (entry != null && entry.length() > 0) { - final PlanInstance pi = resolvePlanInstance(plan, instance, uriInfo, csarId, serviceTemplate, - serviceTemplateInstanceId, planTypes); - final PlanInstanceEvent event = new PlanInstanceEvent("INFO", "PLAN_LOG", entry); - pi.addEvent(event); - this.planInstanceRepository.update(pi); - final URI resourceUri = UriUtil.generateSelfURI(uriInfo); - - return Response.ok(resourceUri).build(); - - } else { - logger.info("Log entry is empty!"); - return Response.status(Status.BAD_REQUEST).build(); - } - } - - public void setEngineService(final IToscaEngineService engineService) { - this.engineService = engineService; - // FIXME: We cannot inject an instance of {@link IToscaReferenceMapper} since - // it is manually created in our default implementation of {@link - // IToscaEngineService} - this.referenceMapper = this.engineService.getToscaReferenceMapper(); - } - - public void setControlService(final IOpenToscaControlService controlService) { - this.controlService = controlService; - } - - public void setDeploymentTestService(final DeploymentTestService deploymentTestService) { - this.deploymentTestService = deploymentTestService; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/service/PropertyMappingsHelper.java b/org.opentosca.container.api/src/org/opentosca/container/api/service/PropertyMappingsHelper.java deleted file mode 100644 index 578e2f13e..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/service/PropertyMappingsHelper.java +++ /dev/null @@ -1,297 +0,0 @@ -package org.opentosca.container.api.service; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import javax.ws.rs.NotFoundException; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstanceProperty; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstanceProperty; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Properties.PropertyMappings; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TPropertyMapping; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class PropertyMappingsHelper { - private static Logger logger = LoggerFactory.getLogger(PropertyMappingsHelper.class); - private final InstanceService instanceService; - - public PropertyMappingsHelper(final InstanceService instanceService) { - this.instanceService = instanceService; - } - - /** - * Evaluates the property mappings of a boundary definition's properties against the xml fragment - * representing these properties and uses node template instances for this purpose. The resulting - * service template instance is not automatically persisted in the DB. - * - * @param serviceTemplateInstance the the service template instance whose property mappings we want - * to evaluate - */ - public void evaluatePropertyMappings(final ServiceTemplateInstance serviceInstance) throws NotFoundException { - if (serviceInstance == null) { - return; - } - - final Document propertiesAsXML = serviceInstance.getPropertiesAsDocument(); - - // check if the serviceInstance has properties - if (propertiesAsXML == null) { - return; - } - - updateServiceInstanceProperties(serviceInstance, propertiesAsXML); - } - - private void updateServiceInstanceProperties(final ServiceTemplateInstance serviceInstance, - final Document proprtiesAsXML) { - // check if the serviceTemplate has propertyMappings - final PropertyMappings propertyMappings = - this.instanceService.getReferenceMapper() - .getServiceTemplateBoundsPropertyMappings(serviceInstance.getCsarId(), - serviceInstance.getTemplateId()); - - if (propertyMappings == null) { - // if there are no property mappings there is no need to update. The - // properties can only be updated by external clients via setting - // properties by hand - return; - } - - // cycle through mappings and update accordingly - for (final TPropertyMapping mapping : propertyMappings.getPropertyMapping()) { - final String serviceTemplatePropertyQuery = mapping.getServiceTemplatePropertyRef(); - final List serviceTemplatePropertyElements = - queryElementList((Element) proprtiesAsXML.getFirstChild(), serviceTemplatePropertyQuery); - - // fetch element from serviceTemplateProperties - if (serviceTemplatePropertyElements.size() != 1) { - // skip this property, we expect only one - continue; - } - - // check whether the targetRef is concat query - if (isConcatQuery(mapping.getTargetPropertyRef())) { - // this query needs possibly multiple properties from different - // nodeInstances - - final String propertyValue = - generatePropertyValueFromConcatQuery(mapping.getTargetPropertyRef(), - serviceInstance.getNodeTemplateInstances()); - serviceTemplatePropertyElements.get(0).setTextContent(propertyValue); - - } else { - // this query only fetches a SINGLE element on the properties of - // the referenced entity - - final NodeTemplateInstance nodeInstance = - getNodeInstanceFromMappingObject(serviceInstance, mapping.getTargetObjectRef()); - - if (nodeInstance == null) { - continue; - } - - final Optional firstProperty = - nodeInstance.getProperties().stream().findFirst(); - - if (!firstProperty.isPresent()) { - // skip it, the mapping is invalid - continue; - } - - final Document nodeProperties = this.instanceService.convertPropertyToDocument(firstProperty.get()); - final Element nodePropertiesRoot = (Element) nodeProperties.getFirstChild(); - final String nodeTemplatePropertyQuery = mapping.getTargetPropertyRef(); - final List nodePropertyElements = - queryElementList(nodePropertiesRoot, nodeTemplatePropertyQuery); - - if (nodePropertyElements.size() != 1) { - // skip this property, we expect only one - continue; - } - - // change the serviceTemplateProperty - serviceTemplatePropertyElements.get(0).setTextContent(nodePropertyElements.get(0).getTextContent()); - - } - } - - try { - serviceInstance.setProperties(Collections.singleton(this.instanceService.convertDocumentToProperty(proprtiesAsXML, - ServiceTemplateInstanceProperty.class))); - } - catch (InstantiationException | IllegalAccessException | IllegalArgumentException e) { - logger.error("Failed to store properties in service template instance object. Reason {}", e.getMessage()); - } - } - - private List queryElementList(final Element node, final String xpathQuery) { - final List elements = new ArrayList<>(); - try { - final XPath xPath = XPathFactory.newInstance().newXPath(); - - final NodeList nodes = (NodeList) xPath.evaluate(xpathQuery, node, XPathConstants.NODESET); - - for (int index = 0; index < nodes.getLength(); index++) { - if (nodes.item(index).getNodeType() == Node.ELEMENT_NODE) { - elements.add((Element) nodes.item(index)); - } - - } - - } - catch (final XPathExpressionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return elements; - } - - private boolean isConcatQuery(final String xPathQuery) { - final String testString = xPathQuery.trim(); - - if (!testString.startsWith("concat(")) { - return false; - } - - String functionContent = testString.substring("concat(".length()); - functionContent = functionContent.substring(0, functionContent.length() - 1); - - final String[] functionParts = functionContent.split(","); - - for (final String functionPart : functionParts) { - if (functionPart.startsWith("'") && !functionPart.endsWith("'")) { - return false; - } - } - - return true; - } - - private String generatePropertyValueFromConcatQuery(final String targetPropertyRef, - final Collection nodeInstance) { - final String testQuery = targetPropertyRef.trim(); - - if (!testQuery.endsWith(")")) { - return null; - } - - final int functionOpeningBracket = testQuery.indexOf("("); - - final String functionString = testQuery.substring(0, functionOpeningBracket); - - // simple validity check as we only want to be able to concat strings, - // but maybe more later - if (!functionString.equals("concat")) { - return null; - } - - final String functionContent = - testQuery.substring(functionOpeningBracket + 1, testQuery.lastIndexOf(")")).trim(); - - final String[] functionParts = functionContent.split(","); - - final List augmentedFunctionParts = new ArrayList<>(); - - for (final String functionPart : functionParts) { - if (functionPart.trim().startsWith("'")) { - // string function part, just add to list - augmentedFunctionParts.add(functionPart.trim()); - } else if (functionPart.trim().split("\\.").length == 3) { - // "DSL" Query - final String[] queryParts = functionPart.trim().split("\\."); - // fast check for validity - if (!queryParts[1].equals("Properties")) { - return null; - } - - final String nodeTemplateName = queryParts[0]; - final String propertyName = queryParts[2]; - - if (getNodeInstanceWithName(nodeInstance, nodeTemplateName) != null) { - - final String propValue = - fetchPropertyValueFromNodeInstance(getNodeInstanceWithName(nodeInstance, nodeTemplateName), - propertyName); - - augmentedFunctionParts.add("'" + propValue + "'"); - } - } - } - - // now we have a string of the form: - // concat('someString','somePropertyValue','someString',..) - // just make the concat itself instead of running an XPath query - - String resultString = ""; - for (final String functionPart : augmentedFunctionParts) { - resultString += functionPart.replace("'", ""); - } - - return resultString; - } - - private NodeTemplateInstance getNodeInstanceWithName(final Collection nodeInstances, - final String nodeTemplateId) { - - for (final NodeTemplateInstance nodeInstance : nodeInstances) { - if (nodeInstance.getTemplateId().getLocalPart().equals(nodeTemplateId)) { - return nodeInstance; - } - } - - return null; - } - - private String fetchPropertyValueFromNodeInstance(final NodeTemplateInstance nodeInstance, - final String propertyLocalName) { - if (nodeInstance.getProperties() == null) { - return null; - } - - return nodeInstance.getPropertiesAsMap().getOrDefault(propertyLocalName, null); - } - - - private NodeTemplateInstance getNodeInstanceFromMappingObject(final ServiceTemplateInstance serviceInstance, - final Object obj) { - - if (obj instanceof TNodeTemplate) { - - final TNodeTemplate template = (TNodeTemplate) obj; - - // service.getNodeInstances(null, null, null, - // serviceInstanceIDtoURI); - - final Collection nodeInstances = serviceInstance.getNodeTemplateInstances(); - - if (nodeInstances == null) { - return null; - } - - for (final NodeTemplateInstance nodeInstance : nodeInstances) { - if (nodeInstance.getTemplateId().getLocalPart().equals(template.getId())) { - return nodeInstance; - } - } - } else { - logger.error("Only node templates are supported as target objects for property mappings!"); - } - - return null; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/service/RelationshipTemplateService.java b/org.opentosca.container.api/src/org/opentosca/container/api/service/RelationshipTemplateService.java deleted file mode 100644 index 137432b8f..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/service/RelationshipTemplateService.java +++ /dev/null @@ -1,169 +0,0 @@ -package org.opentosca.container.api.service; - -import java.util.List; - -import javax.ws.rs.NotFoundException; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.dto.RelationshipTemplateDTO; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; - -import com.google.common.collect.Lists; - -// TODO it is assumed that the name of the node template is the same as its id. -/** - * Provides data access functionality to retrieve relationship templates based on a service - * template. Throughout the class, it is assumed that the passed service template id belongs to the - * passed CSAR, i.e., it is assumed that a check that this is true is performed earlier. - * - * @author Ghareeb Falazi - * - */ -public class RelationshipTemplateService { - private static Logger logger = LoggerFactory.getLogger(InstanceService.class); - - private CsarService csarService; - private IToscaEngineService toscaEngineService; - - /** - * Gets a collection of relationship templates associated to a given service template. - * - * @param csarId The id of the CSAR - * @param serviceTemplateQName The QName of the service template within the given CSAR - * @return A collection of relationship templates stored within the given service template. - */ - public List getRelationshipTemplatesOfServiceTemplate(final String csarId, - final String serviceTemplateQName) { - final CSARContent csarContent = this.csarService.findById(csarId); - final List relationshipTemplateIds = - this.toscaEngineService.getRelationshipTemplatesOfServiceTemplate(csarContent.getCSARID(), - QName.valueOf(serviceTemplateQName)); - final List relationshipTemplates = Lists.newArrayList(); - RelationshipTemplateDTO currentRelationshipTemplate; - - for (final String id : relationshipTemplateIds) { - currentRelationshipTemplate = - createRelationshipTemplate(csarContent.getCSARID(), QName.valueOf(serviceTemplateQName), id); - relationshipTemplates.add(currentRelationshipTemplate); - } - - return relationshipTemplates; - } - - /** - * Gets the relationship template specified by its id - * - * @param csarId The id of the CSAR - * @param serviceTemplateQName The QName of the service template within the given CSAR - * @param relationshipTemplateId The id of the relationship template we want to get and that - * belongs to the specified service template - * @return The relationship template specified by the given id - * @throws NotFoundException If the service template does not contain the specified relationship - * template - */ - public RelationshipTemplateDTO getRelationshipTemplateById(final String csarId, final QName serviceTemplateQName, - final String relationshipTemplateId) throws NotFoundException { - final CSARContent csarContent = this.csarService.findById(csarId); - final CSARID idOfCsar = csarContent.getCSARID(); - - if (!this.toscaEngineService.getRelationshipTemplatesOfServiceTemplate(idOfCsar, serviceTemplateQName) - .contains(relationshipTemplateId)) { - logger.info("Relationship template \"" + relationshipTemplateId + "\" could not be found"); - throw new NotFoundException("Relationship template \"" + relationshipTemplateId + "\" could not be found"); - } - - return createRelationshipTemplate(idOfCsar, serviceTemplateQName, relationshipTemplateId); - } - - - /** - * Checks whether the specified service template contains a given relationship template. - * - * @param csarId The id of the CSAR - * @param serviceTemplateQName the QName of the service template - * @param relationshipTemplateId the id of the relationship template to check for - * @return true when the CSAR contains the service template and the service - * template contains the relationship template, otherwise false - */ - public boolean hasRelationshipTemplate(final String csarId, final QName serviceTemplateQName, - final String relationshipTemplateId) { - return getRelationshipTemplateIdsOfServiceTemplate(csarId, - serviceTemplateQName.toString()).contains(relationshipTemplateId); - } - - /** - * Gets the properties (as an XML document) of a given relationship template. - * - * @param csarId - * @param serviceTemplateQName - * @param relationshipTemplateId - * @return - */ - public Document getPropertiesOfRelationshipTemplate(final String csarId, final QName serviceTemplateQName, - final String relationshipTemplateId) { - final CSARContent csarContent = this.csarService.findById(csarId); - final CSARID idOfCsar = csarContent.getCSARID(); - - if (!this.toscaEngineService.getRelationshipTemplatesOfServiceTemplate(idOfCsar, serviceTemplateQName) - .contains(relationshipTemplateId)) { - logger.info("Relationship template \"" + relationshipTemplateId + "\" could not be found"); - throw new NotFoundException("Relationship template \"" + relationshipTemplateId + "\" could not be found"); - } - - final Document properties = - this.toscaEngineService.getPropertiesOfTemplate(idOfCsar, serviceTemplateQName, relationshipTemplateId); - - return properties; - } - - /** - * Creates a new instance of the RelationshipTemplateDTO class. - * - * @param csarId - * @param serviceTemplateQName - * @param relationshipTemplateId - * @return - */ - private RelationshipTemplateDTO createRelationshipTemplate(final CSARID csarId, final QName serviceTemplateQName, - final String relationshipTemplateId) { - final RelationshipTemplateDTO currentRelationshipTemplate = new RelationshipTemplateDTO(); - currentRelationshipTemplate.setId(relationshipTemplateId); - currentRelationshipTemplate.setName(relationshipTemplateId); - currentRelationshipTemplate.setRelationshipType(this.toscaEngineService.getRelationshipTypeOfRelationshipTemplate(csarId, - serviceTemplateQName, - relationshipTemplateId) - .toString()); - - return currentRelationshipTemplate; - } - - /** - * Gets a collection of relationship template ids associated to a given service template. - * - * @param csarId The id of the CSAR - * @param serviceTemplateQName the QName of the service template within the given CSAR - * @return A collection of relationship template ids stored within the given service template. - */ - private List getRelationshipTemplateIdsOfServiceTemplate(final String csarId, - final String serviceTemplateQName) { - final CSARContent csarContent = this.csarService.findById(csarId); - - return this.toscaEngineService.getRelationshipTemplatesOfServiceTemplate(csarContent.getCSARID(), - QName.valueOf(serviceTemplateQName)); - } - - /* Service Injection */ - /*********************/ - public void setCsarService(final CsarService csarService) { - this.csarService = csarService; - } - - public void setToscaEngineService(final IToscaEngineService toscaEngineService) { - this.toscaEngineService = toscaEngineService; - } -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/service/ServiceTemplateService.java b/org.opentosca.container.api/src/org/opentosca/container/api/service/ServiceTemplateService.java deleted file mode 100644 index 6037c5196..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/service/ServiceTemplateService.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.opentosca.container.api.service; - -import java.util.Set; - -import javax.ws.rs.NotFoundException; -import javax.xml.namespace.QName; - -import org.opentosca.container.api.controller.ServiceTemplateController; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ServiceTemplateService { - - private static Logger logger = LoggerFactory.getLogger(ServiceTemplateController.class); - private CsarService csarService; - private IToscaEngineService toscaEngineService; - - public Set getServiceTemplatesOfCsar(final String csarId) { - final CSARContent csarContent = this.csarService.findById(csarId); - - return this.csarService.getServiceTemplates(csarContent.getCSARID()); - } - - - - public Document getPropertiesOfServicTemplate(final CSARID csarId, final QName serviceTemplateId) { - logger.debug("Getting ServiceTemplate properties for " + serviceTemplateId + " in " + csarId); - final TBoundaryDefinitions boundaryDefs = - this.toscaEngineService.getBoundaryDefinitionsOfServiceTemplate(csarId, serviceTemplateId); - - if (boundaryDefs != null && boundaryDefs.getProperties() != null) { - - logger.debug("Properties found in BoundaryDefinitions for ST {}", serviceTemplateId); - final Element propertiesElement = (Element) boundaryDefs.getProperties().getAny(); - - if (null != propertiesElement && null != propertiesElement.getOwnerDocument()) { - return propertiesElement.getOwnerDocument(); - } else { - logger.debug("No properties element found!"); - } - } - - return null; - } - - /** - * Checks whether the specified csarId exists and that it contains the specified service template - * - * @param csarId - * @param serviceTemplateQName - * @return the CSARID that corresponds to the passed parameter - * @throws NotFoundException if either the CSAR is not found or if does not contain the specified - * service template. - */ - public CSARID checkServiceTemplateExistence(final String csarId, - final String serviceTemplateQName) throws NotFoundException { - final CSARContent csarContent = this.csarService.findById(csarId);// throws exception if not found! - - if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(), serviceTemplateQName)) { - final String msg = "Service template \"" + serviceTemplateQName + "\" could not be found"; - logger.info(msg); - throw new NotFoundException(msg); - } - - return csarContent.getCSARID(); - } - - /* Service Injection */ - /*********************/ - - public void setCsarService(final CsarService csarService) { - this.csarService = csarService; - } - - public void setToscaEngineService(final IToscaEngineService toscaEngineService) { - this.toscaEngineService = toscaEngineService; - } - - -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/util/JsonUtil.java b/org.opentosca.container.api/src/org/opentosca/container/api/util/JsonUtil.java deleted file mode 100644 index 4f7ca394c..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/util/JsonUtil.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.opentosca.container.api.util; - -import org.opentosca.container.api.config.ObjectMapperProvider; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -public abstract class JsonUtil { - - private static ObjectMapper objectMapper = ObjectMapperProvider.createDefaultMapper(); - - static { - objectMapper.enable(SerializationFeature.INDENT_OUTPUT); - } - - - public static String writeValueAsString(final T object) { - try { - return objectMapper.writeValueAsString(object); - } - catch (final JsonProcessingException e) { - throw new RuntimeException(e); - } - } - -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/util/ModelUtil.java b/org.opentosca.container.api/src/org/opentosca/container/api/util/ModelUtil.java deleted file mode 100644 index f1c0da4ac..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/util/ModelUtil.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.opentosca.container.api.util; - -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public abstract class ModelUtil { - - public static boolean hasOpenRequirements(final CSARID csarId, - final IToscaEngineService service) throws UserException, SystemException { - final QName serviceTemplateId = service.getServiceTemplatesInCSAR(csarId).get(0); - - final List nodeTemplateIds = service.getNodeTemplatesOfServiceTemplate(csarId, serviceTemplateId); - final List relationshipTemplateIds = - service.getRelationshipTemplatesOfServiceTemplate(csarId, serviceTemplateId); - - for (final String nodeTemplateId : nodeTemplateIds) { - final List nodeReqs = service.getNodeTemplateRequirements(csarId, serviceTemplateId, nodeTemplateId); - int foundRelations = 0; - - for (final String relationshipTemplateId : relationshipTemplateIds) { - final QName relationReq = - service.getRelationshipTemplateSource(csarId, serviceTemplateId, relationshipTemplateId); - if (relationReq.getLocalPart().equals(nodeTemplateId)) { - foundRelations++; - } - } - - if (foundRelations < nodeReqs.size()) { - return true; - } - - } - return false; - } - - public static Element fetchFirstChildElement(final Document doc, final String childElementLocalName) { - final NodeList childe = doc.getDocumentElement().getElementsByTagName(childElementLocalName); - for (int i = 0; i < childe.getLength(); i++) { - if (childe.item(i) instanceof Element) { - return (Element) childe.item(i); - } - } - return null; - } - - public static Document createDocumentFromElement(final Element element) { - try { - final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - dbf.setIgnoringComments(true); - final Document doc = dbf.newDocumentBuilder().newDocument(); - final Node importedNode = doc.importNode(element, true); - doc.appendChild(importedNode); - return doc; - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - return null; - } - } - - - -} diff --git a/org.opentosca.container.api/src/org/opentosca/container/api/util/UriUtil.java b/org.opentosca.container.api/src/org/opentosca/container/api/util/UriUtil.java deleted file mode 100644 index 18e9c0daa..000000000 --- a/org.opentosca.container.api/src/org/opentosca/container/api/util/UriUtil.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.opentosca.container.api.util; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLEncoder; -import java.util.List; - -import javax.ws.rs.core.Link; -import javax.ws.rs.core.PathSegment; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; -import javax.ws.rs.ext.RuntimeDelegate; - -import org.glassfish.jersey.uri.UriComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class UriUtil { - - private static Logger logger = LoggerFactory.getLogger(UriUtil.class); - - public static URI encode(final URI uri) { - final List pathSegments = UriComponent.decodePath(uri, false); - final UriBuilder uriBuilder = RuntimeDelegate.getInstance().createUriBuilder(); - // Build base URL - uriBuilder.scheme(uri.getScheme()).host(uri.getHost()).port(uri.getPort()); - // Iterate over path segments and encode it if necessary - for (final PathSegment ps : pathSegments) { - uriBuilder.path(UriComponent.encode(ps.toString(), UriComponent.Type.PATH_SEGMENT)); - } - logger.debug("URL before encoding: {}", uri); - logger.debug("URL after encoding: {}", uriBuilder); - return URI.create(uriBuilder.toString()); - } - - public static String encodePathSegment(final String pathSegment) { - try { - return URLEncoder.encode(pathSegment, "UTF-8"); - } - catch (final UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - } - - public static Link generateSelfLink(final UriInfo uriInfo) { - return Link.fromUri(UriUtil.generateSelfURI(uriInfo)).rel("self").build(); - } - - public static URI generateSelfURI(final UriInfo uriInfo) { - return UriUtil.encode(uriInfo.getAbsolutePath()); - } - - - public static Link generateSubResourceLink(final UriInfo uriInfo, final String subResource, - final boolean encodeSubResourcePathSegment, final String rel) { - final URI finalUri = UriUtil.generateSubResourceURI(uriInfo, subResource, encodeSubResourcePathSegment); - - return Link.fromUri(finalUri).rel(rel).build(); - } - - public static URI generateSubResourceURI(final UriInfo uriInfo, final String subResource, - final boolean encodeSubResourcePathSegment) { - final UriBuilder uriBuilder = RuntimeDelegate.getInstance().createUriBuilder(); - final URI absolutePathEncoded = UriUtil.encode(uriInfo.getAbsolutePath()); - uriBuilder.path(absolutePathEncoded.toString()); - uriBuilder.path("{resourceId}"); - URI finalUri; - - if (encodeSubResourcePathSegment) { - finalUri = uriBuilder.build(UriComponent.encode(subResource, UriComponent.Type.PATH_SEGMENT)); - } else { - finalUri = uriBuilder.build(subResource); - } - - return finalUri; - } -} diff --git a/org.opentosca.container.application/META-INF/MANIFEST.MF b/org.opentosca.container.application/META-INF/MANIFEST.MF deleted file mode 100644 index 6dc151b96..000000000 --- a/org.opentosca.container.application/META-INF/MANIFEST.MF +++ /dev/null @@ -1,11 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container Application -Bundle-SymbolicName: org.opentosca.container.application;singleton:=true -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.container.application.Activator -Require-Bundle: org.eclipse.core.runtime -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Import-Package: org.slf4j;version="1.7.2", - org.slf4j.bridge;version="1.7.2" diff --git a/org.opentosca.container.application/build.properties b/org.opentosca.container.application/build.properties deleted file mode 100644 index 07c30d929..000000000 --- a/org.opentosca.container.application/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = plugin.xml,\ - META-INF/,\ - . diff --git a/org.opentosca.container.application/plugin.xml b/org.opentosca.container.application/plugin.xml deleted file mode 100644 index 3fc02242c..000000000 --- a/org.opentosca.container.application/plugin.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/org.opentosca.container.application/pom.xml b/org.opentosca.container.application/pom.xml deleted file mode 100644 index 9472c992e..000000000 --- a/org.opentosca.container.application/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.container.application - eclipse-plugin - - diff --git a/org.opentosca.container.application/src/org/opentosca/container/application/Activator.java b/org.opentosca.container.application/src/org/opentosca/container/application/Activator.java deleted file mode 100644 index b2a93e16e..000000000 --- a/org.opentosca.container.application/src/org/opentosca/container/application/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright 2017 University of Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - *******************************************************************************/ -package org.opentosca.container.application; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.bridge.SLF4JBridgeHandler; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = bundleContext; - - // Install logging bridge handler for SLF4J - SLF4JBridgeHandler.install(); - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.application/src/org/opentosca/container/application/Application.java b/org.opentosca.container.application/src/org/opentosca/container/application/Application.java deleted file mode 100644 index 0f4df022e..000000000 --- a/org.opentosca.container.application/src/org/opentosca/container/application/Application.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2017 University of Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - *******************************************************************************/ -package org.opentosca.container.application; - -import org.eclipse.equinox.app.IApplication; -import org.eclipse.equinox.app.IApplicationContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Application implements IApplication { - - private static Logger logger = LoggerFactory.getLogger(Application.class); - - - @Override - public Object start(final IApplicationContext context) throws Exception { - logger.info("OpenTOSCA Container application has been started"); - return IApplication.EXIT_OK; - } - - @Override - public void stop() { - logger.info("OpenTOSCA Container application has been stopped"); - } -} diff --git a/org.opentosca.container.config.logging/META-INF/MANIFEST.MF b/org.opentosca.container.config.logging/META-INF/MANIFEST.MF deleted file mode 100644 index 8605657e5..000000000 --- a/org.opentosca.container.config.logging/META-INF/MANIFEST.MF +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container Logging Configuration -Bundle-SymbolicName: org.opentosca.container.config.logging -Bundle-Version: 2.0.0.qualifier -Fragment-Host: ch.qos.logback.classic -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/org.opentosca.container.config.logging/build.properties b/org.opentosca.container.config.logging/build.properties deleted file mode 100644 index 72b6b3648..000000000 --- a/org.opentosca.container.config.logging/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ diff --git a/org.opentosca.container.config.logging/pom.xml b/org.opentosca.container.config.logging/pom.xml deleted file mode 100644 index 8cdf2b151..000000000 --- a/org.opentosca.container.config.logging/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.container.config.logging - eclipse-plugin - - diff --git a/org.opentosca.container.config.logging/src/logback.xml b/org.opentosca.container.config.logging/src/logback.xml deleted file mode 100644 index 89cf1bd0c..000000000 --- a/org.opentosca.container.config.logging/src/logback.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - ${CONSOLE_LOG_PATTERN} - utf8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.container.connector.bps/META-INF/MANIFEST.MF b/org.opentosca.container.connector.bps/META-INF/MANIFEST.MF deleted file mode 100644 index 15cda4ce4..000000000 --- a/org.opentosca.container.connector.bps/META-INF/MANIFEST.MF +++ /dev/null @@ -1,85 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container BPS Connector -Bundle-SymbolicName: org.opentosca.container.connector.bps -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Test-Suite: org.opentosca.bpsconnector.test.BpsConnectorTestSuite -Bundle-ActivationPolicy: lazy -Import-Package: javax.mail.internet;version="1.4.0", - org.apache.commons.httpclient;version="3.1.0", - org.apache.commons.httpclient.auth;version="3.1.0", - org.apache.commons.httpclient.cookie;version="3.1.0", - org.apache.commons.httpclient.methods;version="3.1.0", - org.apache.commons.httpclient.methods.multipart;version="3.1.0", - org.apache.commons.httpclient.params;version="3.1.0", - org.apache.commons.httpclient.protocol;version="3.1.0", - org.apache.commons.httpclient.util;version="3.1.0", - org.apache.commons.logging;version="1.1.1", - org.apache.http;version="4.3.3", - org.apache.http.annotation;version="4.3.3", - org.apache.http.auth;version="4.3.6", - org.apache.http.auth.params;version="4.3.6", - org.apache.http.client;version="4.3.6", - org.apache.http.client.cache;version="4.3.6", - org.apache.http.client.config;version="4.3.6", - org.apache.http.client.entity;version="4.3.6", - org.apache.http.client.fluent;version="4.3.6", - org.apache.http.client.methods;version="4.3.6", - org.apache.http.client.params;version="4.3.6", - org.apache.http.client.protocol;version="4.3.6", - org.apache.http.client.utils;version="4.3.6", - org.apache.http.concurrent;version="4.3.3", - org.apache.http.config;version="4.3.3", - org.apache.http.conn;version="4.3.4", - org.apache.http.conn.params;version="4.3.4", - org.apache.http.conn.routing;version="4.3.6", - org.apache.http.conn.scheme;version="4.3.6", - org.apache.http.conn.socket;version="4.3.6", - org.apache.http.conn.ssl;version="4.3.6", - org.apache.http.conn.util;version="4.3.6", - org.apache.http.cookie;version="4.3.6", - org.apache.http.cookie.params;version="4.3.6", - org.apache.http.entity;version="4.3.3", - org.apache.http.entity.mime;version="4.3.6", - org.apache.http.entity.mime.content;version="4.3.6", - org.apache.http.impl;version="4.3.3", - org.apache.http.impl.auth;version="4.3.6", - org.apache.http.impl.bootstrap;version="4.4.6", - org.apache.http.impl.client;version="4.3.6", - org.apache.http.impl.client.cache;version="4.3.6", - org.apache.http.impl.client.cache.ehcache;version="4.3.6", - org.apache.http.impl.client.cache.memcached;version="4.3.6", - org.apache.http.impl.conn;version="4.3.6", - org.apache.http.impl.conn.tsccm;version="4.3.6", - org.apache.http.impl.cookie;version="4.3.6", - org.apache.http.impl.entity;version="4.3.3", - org.apache.http.impl.execchain;version="4.3.6", - org.apache.http.impl.io;version="4.3.3", - org.apache.http.impl.pool;version="4.3.3", - org.apache.http.io;version="4.3.3", - org.apache.http.message;version="4.3.3", - org.apache.http.params;version="4.3.3", - org.apache.http.pool;version="4.3.3", - org.apache.http.protocol;version="4.3.3", - org.apache.http.ssl;version="4.4.6", - org.apache.http.util;version="4.3.3", - org.apache.neethi;version="3.0.3", - org.apache.neethi.builders;version="3.0.3", - org.apache.neethi.builders.converters;version="3.0.3", - org.apache.neethi.builders.xml;version="3.0.3", - org.apache.neethi.util;version="3.0.3", - org.apache.ws.commons.schema;version="1.4.7", - org.apache.ws.commons.schema.constants;version="1.4.7", - org.apache.ws.commons.schema.extensions;version="1.4.7", - org.apache.ws.commons.schema.resolver;version="1.4.7", - org.apache.ws.commons.schema.utils;version="1.4.7", - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.6.4" -Bundle-ClassPath: ., - META-INF/libs/axiom-1.2.14-osgi.jar, - META-INF/libs/org.apache.servicemix.bundles.wsdl4j-1.6.3_1.jar, - META-INF/libs/org.apache.axis2.osgi-1.6.2.jar, - META-INF/libs/apache-mime4j-core-0.7.2.jar -Export-Package: org.opentosca.container.connector.bps -Bundle-Activator: org.opentosca.container.connector.bps.Activator diff --git a/org.opentosca.container.connector.bps/META-INF/libs/apache-mime4j-core-0.7.2.jar b/org.opentosca.container.connector.bps/META-INF/libs/apache-mime4j-core-0.7.2.jar deleted file mode 100644 index b5c225b5d..000000000 Binary files a/org.opentosca.container.connector.bps/META-INF/libs/apache-mime4j-core-0.7.2.jar and /dev/null differ diff --git a/org.opentosca.container.connector.bps/META-INF/libs/axiom-1.2.14-osgi.jar b/org.opentosca.container.connector.bps/META-INF/libs/axiom-1.2.14-osgi.jar deleted file mode 100644 index ba6777e4d..000000000 Binary files a/org.opentosca.container.connector.bps/META-INF/libs/axiom-1.2.14-osgi.jar and /dev/null differ diff --git a/org.opentosca.container.connector.bps/META-INF/libs/org.apache.axis2.osgi-1.6.2.jar b/org.opentosca.container.connector.bps/META-INF/libs/org.apache.axis2.osgi-1.6.2.jar deleted file mode 100644 index 1c0b4022a..000000000 Binary files a/org.opentosca.container.connector.bps/META-INF/libs/org.apache.axis2.osgi-1.6.2.jar and /dev/null differ diff --git a/org.opentosca.container.connector.bps/META-INF/libs/org.apache.servicemix.bundles.wsdl4j-1.6.3_1.jar b/org.opentosca.container.connector.bps/META-INF/libs/org.apache.servicemix.bundles.wsdl4j-1.6.3_1.jar deleted file mode 100644 index 5fe8aa66e..000000000 Binary files a/org.opentosca.container.connector.bps/META-INF/libs/org.apache.servicemix.bundles.wsdl4j-1.6.3_1.jar and /dev/null differ diff --git a/org.opentosca.container.connector.bps/META-INF/resources/AuthenticationAdmin.wsdl b/org.opentosca.container.connector.bps/META-INF/resources/AuthenticationAdmin.wsdl deleted file mode 100644 index 69bb081b2..000000000 --- a/org.opentosca.container.connector.bps/META-INF/resources/AuthenticationAdmin.wsdl +++ /dev/null @@ -1,1265 +0,0 @@ - - AuthenticationAdmin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.container.connector.bps/META-INF/resources/BPELUploader.wsdl b/org.opentosca.container.connector.bps/META-INF/resources/BPELUploader.wsdl deleted file mode 100644 index a3da7e549..000000000 --- a/org.opentosca.container.connector.bps/META-INF/resources/BPELUploader.wsdl +++ /dev/null @@ -1,66 +0,0 @@ - - BPELUploader - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.container.connector.bps/META-INF/resources/wso2carbon.jks b/org.opentosca.container.connector.bps/META-INF/resources/wso2carbon.jks deleted file mode 100644 index 7942c53cf..000000000 Binary files a/org.opentosca.container.connector.bps/META-INF/resources/wso2carbon.jks and /dev/null differ diff --git a/org.opentosca.container.connector.bps/build.properties b/org.opentosca.container.connector.bps/build.properties deleted file mode 100644 index f38ef8c81..000000000 --- a/org.opentosca.container.connector.bps/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -bin.includes = META-INF/,\ - .,\ - META-INF/libs/axiom-1.2.14-osgi.jar,\ - META-INF/libs/org.apache.servicemix.bundles.wsdl4j-1.6.3_1.jar,\ - META-INF/libs/org.apache.axis2.osgi-1.6.2.jar,\ - META-INF/libs/apache-mime4j-core-0.7.2.jar -source.. = src/ diff --git a/org.opentosca.container.connector.bps/pom.xml b/org.opentosca.container.connector.bps/pom.xml deleted file mode 100644 index 1ed187208..000000000 --- a/org.opentosca.container.connector.bps/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.container.connector.bps - eclipse-plugin - - diff --git a/org.opentosca.container.connector.bps/src/authclient/java/io/xsd/InputStream.java b/org.opentosca.container.connector.bps/src/authclient/java/io/xsd/InputStream.java deleted file mode 100644 index aef57dd61..000000000 --- a/org.opentosca.container.connector.bps/src/authclient/java/io/xsd/InputStream.java +++ /dev/null @@ -1,378 +0,0 @@ - -/** - * InputStream.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package authclient.java.io.xsd; - - -/** - * InputStream bean class - */ - -public abstract class InputStream implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = InputStream Namespace URI = - * http://io.java/xsd Namespace Prefix = ns4 - */ - - - - /** - * - */ - private static final long serialVersionUID = 2070645967671706147L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://io.java/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":InputStream", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "InputStream", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://io.java/xsd")) { - return "ns4"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 InputStream parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InputStream object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"InputStream".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (InputStream) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/authclient/java/net/xsd/URL.java b/org.opentosca.container.connector.bps/src/authclient/java/net/xsd/URL.java deleted file mode 100644 index 4496f7ae8..000000000 --- a/org.opentosca.container.connector.bps/src/authclient/java/net/xsd/URL.java +++ /dev/null @@ -1,1366 +0,0 @@ - -/** - * URL.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package authclient.java.net.xsd; - - -/** - * URL bean class - */ - -public class URL implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = URL Namespace URI = - * http://net.java/xsd Namespace Prefix = ns15 - */ - - - /** - * - */ - private static final long serialVersionUID = -3553917925896862791L; - - /** - * field for Authority - */ - - - protected java.lang.String localAuthority; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAuthorityTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getAuthority() { - return this.localAuthority; - } - - - - /** - * Auto generated setter method - * - * @param param Authority - */ - public void setAuthority(final java.lang.String param) { - this.localAuthorityTracker = true; - - this.localAuthority = param; - - - } - - - /** - * field for Content - */ - - - protected java.lang.Object localContent; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localContentTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getContent() { - return this.localContent; - } - - - - /** - * Auto generated setter method - * - * @param param Content - */ - public void setContent(final java.lang.Object param) { - this.localContentTracker = true; - - this.localContent = param; - - - } - - - /** - * field for DefaultPort - */ - - - protected int localDefaultPort; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDefaultPortTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getDefaultPort() { - return this.localDefaultPort; - } - - - - /** - * Auto generated setter method - * - * @param param DefaultPort - */ - public void setDefaultPort(final int param) { - - // setting primitive attribute tracker to true - this.localDefaultPortTracker = param != java.lang.Integer.MIN_VALUE; - - this.localDefaultPort = param; - - - } - - - /** - * field for File - */ - - - protected java.lang.String localFile; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFileTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFile() { - return this.localFile; - } - - - - /** - * Auto generated setter method - * - * @param param File - */ - public void setFile(final java.lang.String param) { - this.localFileTracker = true; - - this.localFile = param; - - - } - - - /** - * field for Host - */ - - - protected java.lang.String localHost; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHostTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getHost() { - return this.localHost; - } - - - - /** - * Auto generated setter method - * - * @param param Host - */ - public void setHost(final java.lang.String param) { - this.localHostTracker = true; - - this.localHost = param; - - - } - - - /** - * field for Path - */ - - - protected java.lang.String localPath; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPathTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPath() { - return this.localPath; - } - - - - /** - * Auto generated setter method - * - * @param param Path - */ - public void setPath(final java.lang.String param) { - this.localPathTracker = true; - - this.localPath = param; - - - } - - - /** - * field for Port - */ - - - protected int localPort; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPortTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getPort() { - return this.localPort; - } - - - - /** - * Auto generated setter method - * - * @param param Port - */ - public void setPort(final int param) { - - // setting primitive attribute tracker to true - this.localPortTracker = param != java.lang.Integer.MIN_VALUE; - - this.localPort = param; - - - } - - - /** - * field for Protocol - */ - - - protected java.lang.String localProtocol; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localProtocolTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getProtocol() { - return this.localProtocol; - } - - - - /** - * Auto generated setter method - * - * @param param Protocol - */ - public void setProtocol(final java.lang.String param) { - this.localProtocolTracker = true; - - this.localProtocol = param; - - - } - - - /** - * field for Query - */ - - - protected java.lang.String localQuery; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localQueryTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getQuery() { - return this.localQuery; - } - - - - /** - * Auto generated setter method - * - * @param param Query - */ - public void setQuery(final java.lang.String param) { - this.localQueryTracker = true; - - this.localQuery = param; - - - } - - - /** - * field for Ref - */ - - - protected java.lang.String localRef; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRefTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getRef() { - return this.localRef; - } - - - - /** - * Auto generated setter method - * - * @param param Ref - */ - public void setRef(final java.lang.String param) { - this.localRefTracker = true; - - this.localRef = param; - - - } - - - /** - * field for UserInfo - */ - - - protected java.lang.String localUserInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUserInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getUserInfo() { - return this.localUserInfo; - } - - - - /** - * Auto generated setter method - * - * @param param UserInfo - */ - public void setUserInfo(final java.lang.String param) { - this.localUserInfoTracker = true; - - this.localUserInfo = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://net.java/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":URL", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "URL", xmlWriter); - } - - - } - if (this.localAuthorityTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "authority", xmlWriter); - - - if (this.localAuthority == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localAuthority); - - } - - xmlWriter.writeEndElement(); - } - if (this.localContentTracker) { - - if (this.localContent != null) { - if (this.localContent instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localContent).serialize(new javax.xml.namespace.QName( - "http://net.java/xsd", "content"), xmlWriter, true); - } else { - writeStartElement(null, "http://net.java/xsd", "content", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localContent, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://net.java/xsd", "content", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localDefaultPortTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "defaultPort", xmlWriter); - - if (this.localDefaultPort == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("defaultPort cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDefaultPort)); - } - - xmlWriter.writeEndElement(); - } - if (this.localFileTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "file", xmlWriter); - - - if (this.localFile == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localFile); - - } - - xmlWriter.writeEndElement(); - } - if (this.localHostTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "host", xmlWriter); - - - if (this.localHost == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localHost); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPathTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "path", xmlWriter); - - - if (this.localPath == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPath); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPortTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "port", xmlWriter); - - if (this.localPort == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("port cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPort)); - } - - xmlWriter.writeEndElement(); - } - if (this.localProtocolTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "protocol", xmlWriter); - - - if (this.localProtocol == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localProtocol); - - } - - xmlWriter.writeEndElement(); - } - if (this.localQueryTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "query", xmlWriter); - - - if (this.localQuery == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localQuery); - - } - - xmlWriter.writeEndElement(); - } - if (this.localRefTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "ref", xmlWriter); - - - if (this.localRef == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localRef); - - } - - xmlWriter.writeEndElement(); - } - if (this.localUserInfoTracker) { - namespace = "http://net.java/xsd"; - writeStartElement(null, namespace, "userInfo", xmlWriter); - - - if (this.localUserInfo == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localUserInfo); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://net.java/xsd")) { - return "ns15"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAuthorityTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "authority")); - - elementList.add(this.localAuthority == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAuthority)); - } - if (this.localContentTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "content")); - - - elementList.add(this.localContent == null ? null : this.localContent); - } - if (this.localDefaultPortTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "defaultPort")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDefaultPort)); - } - if (this.localFileTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "file")); - - elementList.add(this.localFile == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFile)); - } - if (this.localHostTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "host")); - - elementList.add(this.localHost == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localHost)); - } - if (this.localPathTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "path")); - - elementList.add(this.localPath == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPath)); - } - if (this.localPortTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "port")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPort)); - } - if (this.localProtocolTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "protocol")); - - elementList.add(this.localProtocol == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localProtocol)); - } - if (this.localQueryTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "query")); - - elementList.add(this.localQuery == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localQuery)); - } - if (this.localRefTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "ref")); - - elementList.add(this.localRef == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRef)); - } - if (this.localUserInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://net.java/xsd", "userInfo")); - - elementList.add(this.localUserInfo == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUserInfo)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static URL parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final URL object = new URL(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"URL".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (URL) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "authority").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setAuthority(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "content").equals(reader.getName())) { - - object.setContent(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "defaultPort").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDefaultPort(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setDefaultPort(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "file").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setFile(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "host").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setHost(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "path").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPath(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "port").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPort(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setPort(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "protocol").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setProtocol(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "query").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setQuery(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "ref").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setRef(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://net.java/xsd", "userInfo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setUserInfo(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Iterator.java b/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Iterator.java deleted file mode 100644 index 633aaa080..000000000 --- a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Iterator.java +++ /dev/null @@ -1,378 +0,0 @@ - -/** - * Iterator.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package authclient.java.util.xsd; - - -/** - * Iterator bean class - */ - -public abstract class Iterator implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Iterator Namespace URI = - * http://util.java/xsd Namespace Prefix = ns5 - */ - - - - /** - * - */ - private static final long serialVersionUID = -6665723700326876469L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://util.java/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":Iterator", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Iterator", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://util.java/xsd")) { - return "ns5"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 Iterator parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Iterator object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Iterator".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Iterator) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/LinkedHashMap.java b/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/LinkedHashMap.java deleted file mode 100644 index 70e206003..000000000 --- a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/LinkedHashMap.java +++ /dev/null @@ -1,377 +0,0 @@ - -/** - * LinkedHashMap.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package authclient.java.util.xsd; - - -/** - * LinkedHashMap bean class - */ - -public class LinkedHashMap implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = LinkedHashMap Namespace URI = - * http://util.java/xsd Namespace Prefix = ns5 - */ - - - - /** - * - */ - private static final long serialVersionUID = 5061254818083066776L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://util.java/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":LinkedHashMap", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "LinkedHashMap", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://util.java/xsd")) { - return "ns5"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 LinkedHashMap parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LinkedHashMap object = new LinkedHashMap(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"LinkedHashMap".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LinkedHashMap) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/LinkedList.java b/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/LinkedList.java deleted file mode 100644 index 4791936a2..000000000 --- a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/LinkedList.java +++ /dev/null @@ -1,547 +0,0 @@ - -/** - * LinkedList.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package authclient.java.util.xsd; - - -/** - * LinkedList bean class - */ - -public class LinkedList implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = LinkedList Namespace URI = - * http://util.java/xsd Namespace Prefix = ns5 - */ - - - /** - * - */ - private static final long serialVersionUID = -7331506418103022151L; - - /** - * field for First - */ - - - protected java.lang.Object localFirst; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFirstTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getFirst() { - return this.localFirst; - } - - - - /** - * Auto generated setter method - * - * @param param First - */ - public void setFirst(final java.lang.Object param) { - this.localFirstTracker = true; - - this.localFirst = param; - - - } - - - /** - * field for Last - */ - - - protected java.lang.Object localLast; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLastTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getLast() { - return this.localLast; - } - - - - /** - * Auto generated setter method - * - * @param param Last - */ - public void setLast(final java.lang.Object param) { - this.localLastTracker = true; - - this.localLast = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://util.java/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":LinkedList", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "LinkedList", xmlWriter); - } - - - } - if (this.localFirstTracker) { - - if (this.localFirst != null) { - if (this.localFirst instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localFirst).serialize(new javax.xml.namespace.QName( - "http://util.java/xsd", "first"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.java/xsd", "first", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localFirst, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.java/xsd", "first", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localLastTracker) { - - if (this.localLast != null) { - if (this.localLast instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localLast).serialize(new javax.xml.namespace.QName( - "http://util.java/xsd", "last"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.java/xsd", "last", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localLast, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.java/xsd", "last", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://util.java/xsd")) { - return "ns5"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localFirstTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.java/xsd", "first")); - - - elementList.add(this.localFirst == null ? null : this.localFirst); - } - if (this.localLastTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.java/xsd", "last")); - - - elementList.add(this.localLast == null ? null : this.localLast); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static LinkedList parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LinkedList object = new LinkedList(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"LinkedList".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LinkedList) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.java/xsd", "first").equals(reader.getName())) { - - object.setFirst(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.java/xsd", "last").equals(reader.getName())) { - - object.setLast(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Map.java b/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Map.java deleted file mode 100644 index 5affd83ba..000000000 --- a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Map.java +++ /dev/null @@ -1,453 +0,0 @@ - -/** - * Map.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package authclient.java.util.xsd; - - -/** - * Map bean class - */ - -public abstract class Map implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Map Namespace URI = - * http://util.java/xsd Namespace Prefix = ns5 - */ - - - /** - * - */ - private static final long serialVersionUID = -4809384793183098828L; - - /** - * field for Empty - */ - - - protected boolean localEmpty; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEmptyTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getEmpty() { - return this.localEmpty; - } - - - - /** - * Auto generated setter method - * - * @param param Empty - */ - public void setEmpty(final boolean param) { - - // setting primitive attribute tracker to true - this.localEmptyTracker = true; - - this.localEmpty = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://util.java/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Map", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Map", xmlWriter); - } - - - } - if (this.localEmptyTracker) { - namespace = "http://util.java/xsd"; - writeStartElement(null, namespace, "empty", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("empty cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://util.java/xsd")) { - return "ns5"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localEmptyTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.java/xsd", "empty")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Map parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Map object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Map".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Map) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.java/xsd", "empty").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setEmpty(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Set.java b/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Set.java deleted file mode 100644 index 7c9c007a0..000000000 --- a/org.opentosca.container.connector.bps/src/authclient/java/util/xsd/Set.java +++ /dev/null @@ -1,453 +0,0 @@ - -/** - * Set.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package authclient.java.util.xsd; - - -/** - * Set bean class - */ - -public abstract class Set implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Set Namespace URI = - * http://util.java/xsd Namespace Prefix = ns5 - */ - - - /** - * - */ - private static final long serialVersionUID = 3738415930809519484L; - - /** - * field for Empty - */ - - - protected boolean localEmpty; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEmptyTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getEmpty() { - return this.localEmpty; - } - - - - /** - * Auto generated setter method - * - * @param param Empty - */ - public void setEmpty(final boolean param) { - - // setting primitive attribute tracker to true - this.localEmptyTracker = true; - - this.localEmpty = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://util.java/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Set", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Set", xmlWriter); - } - - - } - if (this.localEmptyTracker) { - namespace = "http://util.java/xsd"; - writeStartElement(null, namespace, "empty", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("empty cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://util.java/xsd")) { - return "ns5"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localEmptyTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.java/xsd", "empty")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Set parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Set object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Set".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Set) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.java/xsd", "empty").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setEmpty(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/lifecycle/xsd/LifecycleManager.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/lifecycle/xsd/LifecycleManager.java deleted file mode 100644 index 2ec6281cc..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/lifecycle/xsd/LifecycleManager.java +++ /dev/null @@ -1,380 +0,0 @@ - -/** - * LifecycleManager.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.attachments.lifecycle.xsd; - - -/** - * LifecycleManager bean class - */ - -public abstract class LifecycleManager implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = LifecycleManager Namespace URI = - * http://lifecycle.attachments.axiom.apache.org/xsd Namespace Prefix = ns7 - */ - - - - /** - * - */ - private static final long serialVersionUID = -4392537342181259399L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://lifecycle.attachments.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":LifecycleManager", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "LifecycleManager", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://lifecycle.attachments.axiom.apache.org/xsd")) { - return "ns7"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 LifecycleManager parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LifecycleManager object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"LifecycleManager".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LifecycleManager) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/Attachments.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/Attachments.java deleted file mode 100644 index 61dc9322e..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/Attachments.java +++ /dev/null @@ -1,1544 +0,0 @@ - -/** - * Attachments.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.attachments.xsd; - - -/** - * Attachments bean class - */ - -public class Attachments implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Attachments Namespace URI = - * http://attachments.axiom.apache.org/xsd Namespace Prefix = ns6 - */ - - - /** - * - */ - private static final long serialVersionUID = 8749144206757981806L; - - /** - * field for SOAPPartContentID - */ - - - protected java.lang.String localSOAPPartContentID; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSOAPPartContentIDTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSOAPPartContentID() { - return this.localSOAPPartContentID; - } - - - - /** - * Auto generated setter method - * - * @param param SOAPPartContentID - */ - public void setSOAPPartContentID(final java.lang.String param) { - this.localSOAPPartContentIDTracker = true; - - this.localSOAPPartContentID = param; - - - } - - - /** - * field for SOAPPartContentType - */ - - - protected java.lang.String localSOAPPartContentType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSOAPPartContentTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSOAPPartContentType() { - return this.localSOAPPartContentType; - } - - - - /** - * Auto generated setter method - * - * @param param SOAPPartContentType - */ - public void setSOAPPartContentType(final java.lang.String param) { - this.localSOAPPartContentTypeTracker = true; - - this.localSOAPPartContentType = param; - - - } - - - /** - * field for SOAPPartInputStream - */ - - - protected authclient.java.io.xsd.InputStream localSOAPPartInputStream; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSOAPPartInputStreamTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.io.xsd.InputStream - */ - public authclient.java.io.xsd.InputStream getSOAPPartInputStream() { - return this.localSOAPPartInputStream; - } - - - - /** - * Auto generated setter method - * - * @param param SOAPPartInputStream - */ - public void setSOAPPartInputStream(final authclient.java.io.xsd.InputStream param) { - this.localSOAPPartInputStreamTracker = true; - - this.localSOAPPartInputStream = param; - - - } - - - /** - * field for AllContentIDs This was an Array! - */ - - - protected java.lang.String[] localAllContentIDs; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAllContentIDsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getAllContentIDs() { - return this.localAllContentIDs; - } - - - - /** - * validate the array for AllContentIDs - */ - protected void validateAllContentIDs(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param AllContentIDs - */ - public void setAllContentIDs(final java.lang.String[] param) { - - validateAllContentIDs(param); - - this.localAllContentIDsTracker = true; - - this.localAllContentIDs = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addAllContentIDs(final java.lang.String param) { - if (this.localAllContentIDs == null) { - this.localAllContentIDs = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localAllContentIDsTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localAllContentIDs); - list.add(param); - this.localAllContentIDs = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for AttachmentSpecType - */ - - - protected java.lang.String localAttachmentSpecType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAttachmentSpecTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getAttachmentSpecType() { - return this.localAttachmentSpecType; - } - - - - /** - * Auto generated setter method - * - * @param param AttachmentSpecType - */ - public void setAttachmentSpecType(final java.lang.String param) { - this.localAttachmentSpecTypeTracker = true; - - this.localAttachmentSpecType = param; - - - } - - - /** - * field for ContentIDList - */ - - - protected java.lang.Object localContentIDList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localContentIDListTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getContentIDList() { - return this.localContentIDList; - } - - - - /** - * Auto generated setter method - * - * @param param ContentIDList - */ - public void setContentIDList(final java.lang.Object param) { - this.localContentIDListTracker = true; - - this.localContentIDList = param; - - - } - - - /** - * field for ContentIDSet - */ - - - protected authclient.java.util.xsd.Set localContentIDSet; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localContentIDSetTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Set - */ - public authclient.java.util.xsd.Set getContentIDSet() { - return this.localContentIDSet; - } - - - - /** - * Auto generated setter method - * - * @param param ContentIDSet - */ - public void setContentIDSet(final authclient.java.util.xsd.Set param) { - this.localContentIDSetTracker = true; - - this.localContentIDSet = param; - - - } - - - /** - * field for ContentLength - */ - - - protected long localContentLength; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localContentLengthTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getContentLength() { - return this.localContentLength; - } - - - - /** - * Auto generated setter method - * - * @param param ContentLength - */ - public void setContentLength(final long param) { - - // setting primitive attribute tracker to true - this.localContentLengthTracker = param != java.lang.Long.MIN_VALUE; - - this.localContentLength = param; - - - } - - - /** - * field for IncomingAttachmentStreams - */ - - - protected org.apache.axiom.attachments.xsd.IncomingAttachmentStreams localIncomingAttachmentStreams; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIncomingAttachmentStreamsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.attachments.xsd.IncomingAttachmentStreams - */ - public org.apache.axiom.attachments.xsd.IncomingAttachmentStreams getIncomingAttachmentStreams() { - return this.localIncomingAttachmentStreams; - } - - - - /** - * Auto generated setter method - * - * @param param IncomingAttachmentStreams - */ - public void setIncomingAttachmentStreams(final org.apache.axiom.attachments.xsd.IncomingAttachmentStreams param) { - this.localIncomingAttachmentStreamsTracker = true; - - this.localIncomingAttachmentStreams = param; - - - } - - - /** - * field for IncomingAttachmentsAsSingleStream - */ - - - protected authclient.java.io.xsd.InputStream localIncomingAttachmentsAsSingleStream; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIncomingAttachmentsAsSingleStreamTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.io.xsd.InputStream - */ - public authclient.java.io.xsd.InputStream getIncomingAttachmentsAsSingleStream() { - return this.localIncomingAttachmentsAsSingleStream; - } - - - - /** - * Auto generated setter method - * - * @param param IncomingAttachmentsAsSingleStream - */ - public void setIncomingAttachmentsAsSingleStream(final authclient.java.io.xsd.InputStream param) { - this.localIncomingAttachmentsAsSingleStreamTracker = true; - - this.localIncomingAttachmentsAsSingleStream = param; - - - } - - - /** - * field for LifecycleManager - */ - - - protected org.apache.axiom.attachments.lifecycle.xsd.LifecycleManager localLifecycleManager; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLifecycleManagerTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.attachments.lifecycle.xsd.LifecycleManager - */ - public org.apache.axiom.attachments.lifecycle.xsd.LifecycleManager getLifecycleManager() { - return this.localLifecycleManager; - } - - - - /** - * Auto generated setter method - * - * @param param LifecycleManager - */ - public void setLifecycleManager(final org.apache.axiom.attachments.lifecycle.xsd.LifecycleManager param) { - this.localLifecycleManagerTracker = true; - - this.localLifecycleManager = param; - - - } - - - /** - * field for Map - */ - - - protected authclient.java.util.xsd.Map localMap; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMapTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getMap() { - return this.localMap; - } - - - - /** - * Auto generated setter method - * - * @param param Map - */ - public void setMap(final authclient.java.util.xsd.Map param) { - this.localMapTracker = true; - - this.localMap = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://attachments.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":Attachments", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Attachments", xmlWriter); - } - - - } - if (this.localSOAPPartContentIDTracker) { - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "SOAPPartContentID", xmlWriter); - - - if (this.localSOAPPartContentID == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSOAPPartContentID); - - } - - xmlWriter.writeEndElement(); - } - if (this.localSOAPPartContentTypeTracker) { - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "SOAPPartContentType", xmlWriter); - - - if (this.localSOAPPartContentType == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSOAPPartContentType); - - } - - xmlWriter.writeEndElement(); - } - if (this.localSOAPPartInputStreamTracker) { - if (this.localSOAPPartInputStream == null) { - - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "SOAPPartInputStream", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSOAPPartInputStream.serialize(new javax.xml.namespace.QName( - "http://attachments.axiom.apache.org/xsd", "SOAPPartInputStream"), xmlWriter); - } - } - if (this.localAllContentIDsTracker) { - if (this.localAllContentIDs != null) { - namespace = "http://attachments.axiom.apache.org/xsd"; - for (final String localAllContentID : this.localAllContentIDs) { - - if (localAllContentID != null) { - - writeStartElement(null, namespace, "allContentIDs", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAllContentID)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "allContentIDs", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "allContentIDs", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localAttachmentSpecTypeTracker) { - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "attachmentSpecType", xmlWriter); - - - if (this.localAttachmentSpecType == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localAttachmentSpecType); - - } - - xmlWriter.writeEndElement(); - } - if (this.localContentIDListTracker) { - - if (this.localContentIDList != null) { - if (this.localContentIDList instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localContentIDList).serialize(new javax.xml.namespace.QName( - "http://attachments.axiom.apache.org/xsd", "contentIDList"), xmlWriter, true); - } else { - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "contentIDList", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localContentIDList, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "contentIDList", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localContentIDSetTracker) { - if (this.localContentIDSet == null) { - - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "contentIDSet", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localContentIDSet.serialize(new javax.xml.namespace.QName( - "http://attachments.axiom.apache.org/xsd", "contentIDSet"), xmlWriter); - } - } - if (this.localContentLengthTracker) { - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "contentLength", xmlWriter); - - if (this.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(this.localContentLength)); - } - - xmlWriter.writeEndElement(); - } - if (this.localIncomingAttachmentStreamsTracker) { - if (this.localIncomingAttachmentStreams == null) { - - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "incomingAttachmentStreams", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localIncomingAttachmentStreams.serialize(new javax.xml.namespace.QName( - "http://attachments.axiom.apache.org/xsd", "incomingAttachmentStreams"), xmlWriter); - } - } - if (this.localIncomingAttachmentsAsSingleStreamTracker) { - if (this.localIncomingAttachmentsAsSingleStream == null) { - - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "incomingAttachmentsAsSingleStream", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localIncomingAttachmentsAsSingleStream.serialize(new javax.xml.namespace.QName( - "http://attachments.axiom.apache.org/xsd", "incomingAttachmentsAsSingleStream"), xmlWriter); - } - } - if (this.localLifecycleManagerTracker) { - if (this.localLifecycleManager == null) { - - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "lifecycleManager", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localLifecycleManager.serialize(new javax.xml.namespace.QName( - "http://attachments.axiom.apache.org/xsd", "lifecycleManager"), xmlWriter); - } - } - if (this.localMapTracker) { - if (this.localMap == null) { - - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "map", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMap.serialize(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "map"), - xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://attachments.axiom.apache.org/xsd")) { - return "ns6"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localSOAPPartContentIDTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "SOAPPartContentID")); - - elementList.add(this.localSOAPPartContentID == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSOAPPartContentID)); - } - if (this.localSOAPPartContentTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "SOAPPartContentType")); - - elementList.add(this.localSOAPPartContentType == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSOAPPartContentType)); - } - if (this.localSOAPPartInputStreamTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "SOAPPartInputStream")); - - - elementList.add(this.localSOAPPartInputStream == null ? null : this.localSOAPPartInputStream); - } - if (this.localAllContentIDsTracker) { - if (this.localAllContentIDs != null) { - for (final String localAllContentID : this.localAllContentIDs) { - - if (localAllContentID != null) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "allContentIDs")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAllContentID)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "allContentIDs")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "allContentIDs")); - elementList.add(null); - - } - - } - if (this.localAttachmentSpecTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "attachmentSpecType")); - - elementList.add(this.localAttachmentSpecType == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAttachmentSpecType)); - } - if (this.localContentIDListTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "contentIDList")); - - - elementList.add(this.localContentIDList == null ? null : this.localContentIDList); - } - if (this.localContentIDSetTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "contentIDSet")); - - - elementList.add(this.localContentIDSet == null ? null : this.localContentIDSet); - } - if (this.localContentLengthTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "contentLength")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localContentLength)); - } - if (this.localIncomingAttachmentStreamsTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "incomingAttachmentStreams")); - - - elementList.add(this.localIncomingAttachmentStreams == null ? null : this.localIncomingAttachmentStreams); - } - if (this.localIncomingAttachmentsAsSingleStreamTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "incomingAttachmentsAsSingleStream")); - - - elementList.add(this.localIncomingAttachmentsAsSingleStream == null ? null - : this.localIncomingAttachmentsAsSingleStream); - } - if (this.localLifecycleManagerTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "lifecycleManager")); - - - elementList.add(this.localLifecycleManager == null ? null : this.localLifecycleManager); - } - if (this.localMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "map")); - - - elementList.add(this.localMap == null ? null : this.localMap); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Attachments parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Attachments object = new Attachments(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Attachments".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Attachments) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list4 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "SOAPPartContentID").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSOAPPartContentID(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "SOAPPartContentType").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSOAPPartContentType(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "SOAPPartInputStream").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSOAPPartInputStream(null); - reader.next(); - - reader.next(); - - } else { - - object.setSOAPPartInputStream(authclient.java.io.xsd.InputStream.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://attachments.axiom.apache.org/xsd", - "allContentIDs").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list4.add(null); - - reader.next(); - } else { - list4.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone4 = false; - while (!loopDone4) { - // 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 - loopDone4 = true; - } else { - if (new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "allContentIDs").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list4.add(null); - - reader.next(); - } else { - list4.add(reader.getElementText()); - } - } else { - loopDone4 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setAllContentIDs((java.lang.String[]) list4.toArray(new java.lang.String[list4.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://attachments.axiom.apache.org/xsd", - "attachmentSpecType").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setAttachmentSpecType(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "contentIDList").equals(reader.getName())) { - - object.setContentIDList(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "contentIDSet").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setContentIDSet(null); - reader.next(); - - reader.next(); - - } else { - - object.setContentIDSet(authclient.java.util.xsd.Set.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://attachments.axiom.apache.org/xsd", - "contentLength").equals(reader.getName())) { - - final 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 { - - object.setContentLength(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "incomingAttachmentStreams").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setIncomingAttachmentStreams(null); - reader.next(); - - reader.next(); - - } else { - - object.setIncomingAttachmentStreams(org.apache.axiom.attachments.xsd.IncomingAttachmentStreams.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://attachments.axiom.apache.org/xsd", - "incomingAttachmentsAsSingleStream").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setIncomingAttachmentsAsSingleStream(null); - reader.next(); - - reader.next(); - - } else { - - object.setIncomingAttachmentsAsSingleStream(authclient.java.io.xsd.InputStream.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://attachments.axiom.apache.org/xsd", - "lifecycleManager").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setLifecycleManager(null); - reader.next(); - - reader.next(); - - } else { - - object.setLifecycleManager(org.apache.axiom.attachments.lifecycle.xsd.LifecycleManager.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://attachments.axiom.apache.org/xsd", - "map").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setMap(authclient.java.util.xsd.Map.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/IncomingAttachmentInputStream.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/IncomingAttachmentInputStream.java deleted file mode 100644 index 374af5893..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/IncomingAttachmentInputStream.java +++ /dev/null @@ -1,737 +0,0 @@ - -/** - * IncomingAttachmentInputStream.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.attachments.xsd; - - -/** - * IncomingAttachmentInputStream bean class - */ - -public class IncomingAttachmentInputStream extends authclient.java.io.xsd.InputStream - implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = IncomingAttachmentInputStream - * Namespace URI = http://attachments.axiom.apache.org/xsd Namespace Prefix = ns6 - */ - - - /** - * - */ - private static final long serialVersionUID = 1529184472047808569L; - - /** - * field for ContentId - */ - - - protected java.lang.String localContentId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localContentIdTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getContentId() { - return this.localContentId; - } - - - - /** - * Auto generated setter method - * - * @param param ContentId - */ - public void setContentId(final java.lang.String param) { - this.localContentIdTracker = true; - - this.localContentId = param; - - - } - - - /** - * field for ContentLocation - */ - - - protected java.lang.String localContentLocation; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localContentLocationTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getContentLocation() { - return this.localContentLocation; - } - - - - /** - * Auto generated setter method - * - * @param param ContentLocation - */ - public void setContentLocation(final java.lang.String param) { - this.localContentLocationTracker = true; - - this.localContentLocation = param; - - - } - - - /** - * field for ContentType - */ - - - protected java.lang.String localContentType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localContentTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getContentType() { - return this.localContentType; - } - - - - /** - * Auto generated setter method - * - * @param param ContentType - */ - public void setContentType(final java.lang.String param) { - this.localContentTypeTracker = true; - - this.localContentType = param; - - - } - - - /** - * field for Headers - */ - - - protected authclient.java.util.xsd.Map localHeaders; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHeadersTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getHeaders() { - return this.localHeaders; - } - - - - /** - * Auto generated setter method - * - * @param param Headers - */ - public void setHeaders(final authclient.java.util.xsd.Map param) { - this.localHeadersTracker = true; - - this.localHeaders = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://attachments.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":IncomingAttachmentInputStream", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "IncomingAttachmentInputStream", - xmlWriter); - } - - if (this.localContentIdTracker) { - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "contentId", xmlWriter); - - - if (this.localContentId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localContentId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localContentLocationTracker) { - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "contentLocation", xmlWriter); - - - if (this.localContentLocation == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localContentLocation); - - } - - xmlWriter.writeEndElement(); - } - if (this.localContentTypeTracker) { - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "contentType", xmlWriter); - - - if (this.localContentType == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localContentType); - - } - - xmlWriter.writeEndElement(); - } - if (this.localHeadersTracker) { - if (this.localHeaders == null) { - - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "headers", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localHeaders.serialize(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "headers"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://attachments.axiom.apache.org/xsd")) { - return "ns6"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://attachments.axiom.apache.org/xsd", - "IncomingAttachmentInputStream")); - if (this.localContentIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "contentId")); - - elementList.add(this.localContentId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localContentId)); - } - if (this.localContentLocationTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "contentLocation")); - - elementList.add(this.localContentLocation == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localContentLocation)); - } - if (this.localContentTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "contentType")); - - elementList.add(this.localContentType == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localContentType)); - } - if (this.localHeadersTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "headers")); - - - elementList.add(this.localHeaders == null ? null : this.localHeaders); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static IncomingAttachmentInputStream parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final IncomingAttachmentInputStream object = new IncomingAttachmentInputStream(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"IncomingAttachmentInputStream".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (IncomingAttachmentInputStream) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "contentId").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setContentId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "contentLocation").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setContentLocation(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "contentType").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setContentType(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "headers").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setHeaders(null); - reader.next(); - - reader.next(); - - } else { - - object.setHeaders(authclient.java.util.xsd.Map.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/IncomingAttachmentStreams.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/IncomingAttachmentStreams.java deleted file mode 100644 index 7ae87f0d2..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/attachments/xsd/IncomingAttachmentStreams.java +++ /dev/null @@ -1,541 +0,0 @@ - -/** - * IncomingAttachmentStreams.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.attachments.xsd; - - -/** - * IncomingAttachmentStreams bean class - */ - -public abstract class IncomingAttachmentStreams implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = IncomingAttachmentStreams - * Namespace URI = http://attachments.axiom.apache.org/xsd Namespace Prefix = ns6 - */ - - - /** - * - */ - private static final long serialVersionUID = 8023464193155975566L; - - /** - * field for NextStream - */ - - - protected org.apache.axiom.attachments.xsd.IncomingAttachmentInputStream localNextStream; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNextStreamTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.attachments.xsd.IncomingAttachmentInputStream - */ - public org.apache.axiom.attachments.xsd.IncomingAttachmentInputStream getNextStream() { - return this.localNextStream; - } - - - - /** - * Auto generated setter method - * - * @param param NextStream - */ - public void setNextStream(final org.apache.axiom.attachments.xsd.IncomingAttachmentInputStream param) { - this.localNextStreamTracker = true; - - this.localNextStream = param; - - - } - - - /** - * field for ReadyToGetNextStream - */ - - - protected boolean localReadyToGetNextStream; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localReadyToGetNextStreamTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getReadyToGetNextStream() { - return this.localReadyToGetNextStream; - } - - - - /** - * Auto generated setter method - * - * @param param ReadyToGetNextStream - */ - public void setReadyToGetNextStream(final boolean param) { - - // setting primitive attribute tracker to true - this.localReadyToGetNextStreamTracker = true; - - this.localReadyToGetNextStream = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://attachments.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":IncomingAttachmentStreams", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "IncomingAttachmentStreams", - xmlWriter); - } - - - } - if (this.localNextStreamTracker) { - if (this.localNextStream == null) { - - writeStartElement(null, "http://attachments.axiom.apache.org/xsd", "nextStream", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localNextStream.serialize(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "nextStream"), xmlWriter); - } - } - if (this.localReadyToGetNextStreamTracker) { - namespace = "http://attachments.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "readyToGetNextStream", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("readyToGetNextStream cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localReadyToGetNextStream)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://attachments.axiom.apache.org/xsd")) { - return "ns6"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localNextStreamTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", "nextStream")); - - - elementList.add(this.localNextStream == null ? null : this.localNextStream); - } - if (this.localReadyToGetNextStreamTracker) { - elementList.add(new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "readyToGetNextStream")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localReadyToGetNextStream)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static IncomingAttachmentStreams parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final IncomingAttachmentStreams object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"IncomingAttachmentStreams".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (IncomingAttachmentStreams) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://attachments.axiom.apache.org/xsd", - "nextStream").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setNextStream(null); - reader.next(); - - reader.next(); - - } else { - - object.setNextStream(org.apache.axiom.attachments.xsd.IncomingAttachmentInputStream.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://attachments.axiom.apache.org/xsd", - "readyToGetNextStream").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setReadyToGetNextStream(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()) { - // A start element we are not expecting indicates a trailing invalid property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/om/xsd/OMNamespace.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/om/xsd/OMNamespace.java deleted file mode 100644 index 0e9e1e586..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/om/xsd/OMNamespace.java +++ /dev/null @@ -1,652 +0,0 @@ - -/** - * OMNamespace.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.om.xsd; - - -/** - * OMNamespace bean class - */ - -public abstract class OMNamespace implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = OMNamespace Namespace URI = - * http://om.axiom.apache.org/xsd Namespace Prefix = ns25 - */ - - - /** - * - */ - private static final long serialVersionUID = -3684046096670258830L; - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for NamespaceURI - */ - - - protected java.lang.String localNamespaceURI; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNamespaceURITracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getNamespaceURI() { - return this.localNamespaceURI; - } - - - - /** - * Auto generated setter method - * - * @param param NamespaceURI - */ - public void setNamespaceURI(final java.lang.String param) { - this.localNamespaceURITracker = true; - - this.localNamespaceURI = 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 this.localPrefix; - } - - - - /** - * Auto generated setter method - * - * @param param Prefix - */ - public void setPrefix(final java.lang.String param) { - this.localPrefixTracker = true; - - this.localPrefix = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://om.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":OMNamespace", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "OMNamespace", xmlWriter); - } - - - } - if (this.localNameTracker) { - namespace = "http://om.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localNamespaceURITracker) { - namespace = "http://om.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "namespaceURI", xmlWriter); - - - if (this.localNamespaceURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localNamespaceURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPrefixTracker) { - namespace = "http://om.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "prefix", xmlWriter); - - - if (this.localPrefix == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPrefix); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://om.axiom.apache.org/xsd")) { - return "ns25"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://om.axiom.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localNamespaceURITracker) { - elementList.add(new javax.xml.namespace.QName("http://om.axiom.apache.org/xsd", "namespaceURI")); - - elementList.add(this.localNamespaceURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNamespaceURI)); - } - if (this.localPrefixTracker) { - elementList.add(new javax.xml.namespace.QName("http://om.axiom.apache.org/xsd", "prefix")); - - elementList.add(this.localPrefix == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPrefix)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static OMNamespace parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final OMNamespace object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"OMNamespace".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (OMNamespace) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://om.axiom.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://om.axiom.apache.org/xsd", - "namespaceURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setNamespaceURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://om.axiom.apache.org/xsd", - "prefix").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPrefix(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPBody.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPBody.java deleted file mode 100644 index 4011b9c6f..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPBody.java +++ /dev/null @@ -1,637 +0,0 @@ - -/** - * SOAPBody.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPBody bean class - */ - -public abstract class SOAPBody implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPBody Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = -995455141866387124L; - - /** - * field for Fault - */ - - - protected org.apache.axiom.soap.xsd.SOAPFault localFault; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPFault - */ - public org.apache.axiom.soap.xsd.SOAPFault getFault() { - return this.localFault; - } - - - - /** - * Auto generated setter method - * - * @param param Fault - */ - public void setFault(final org.apache.axiom.soap.xsd.SOAPFault param) { - this.localFaultTracker = true; - - this.localFault = param; - - - } - - - /** - * field for FirstElementLocalName - */ - - - protected java.lang.String localFirstElementLocalName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFirstElementLocalNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFirstElementLocalName() { - return this.localFirstElementLocalName; - } - - - - /** - * Auto generated setter method - * - * @param param FirstElementLocalName - */ - public void setFirstElementLocalName(final java.lang.String param) { - this.localFirstElementLocalNameTracker = true; - - this.localFirstElementLocalName = param; - - - } - - - /** - * field for FirstElementNS - */ - - - protected org.apache.axiom.om.xsd.OMNamespace localFirstElementNS; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFirstElementNSTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.xsd.OMNamespace - */ - public org.apache.axiom.om.xsd.OMNamespace getFirstElementNS() { - return this.localFirstElementNS; - } - - - - /** - * Auto generated setter method - * - * @param param FirstElementNS - */ - public void setFirstElementNS(final org.apache.axiom.om.xsd.OMNamespace param) { - this.localFirstElementNSTracker = true; - - this.localFirstElementNS = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPBody", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPBody", xmlWriter); - } - - - } - if (this.localFaultTracker) { - if (this.localFault == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "fault", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFault.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "fault"), - xmlWriter); - } - } - if (this.localFirstElementLocalNameTracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "firstElementLocalName", xmlWriter); - - - if (this.localFirstElementLocalName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localFirstElementLocalName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFirstElementNSTracker) { - if (this.localFirstElementNS == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "firstElementNS", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFirstElementNS.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "firstElementNS"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localFaultTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "fault")); - - - elementList.add(this.localFault == null ? null : this.localFault); - } - if (this.localFirstElementLocalNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "firstElementLocalName")); - - elementList.add(this.localFirstElementLocalName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFirstElementLocalName)); - } - if (this.localFirstElementNSTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "firstElementNS")); - - - elementList.add(this.localFirstElementNS == null ? null : this.localFirstElementNS); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPBody parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPBody object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPBody".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPBody) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "fault").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFault(null); - reader.next(); - - reader.next(); - - } else { - - object.setFault(org.apache.axiom.soap.xsd.SOAPFault.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://soap.axiom.apache.org/xsd", - "firstElementLocalName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setFirstElementLocalName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "firstElementNS").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFirstElementNS(null); - reader.next(); - - reader.next(); - - } else { - - object.setFirstElementNS(org.apache.axiom.om.xsd.OMNamespace.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPEnvelope.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPEnvelope.java deleted file mode 100644 index 7fbee301b..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPEnvelope.java +++ /dev/null @@ -1,809 +0,0 @@ - -/** - * SOAPEnvelope.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPEnvelope bean class - */ - -public abstract class SOAPEnvelope implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPEnvelope Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = -1882785473009669628L; - - /** - * field for SOAPBodyFirstElementLocalName - */ - - - protected java.lang.String localSOAPBodyFirstElementLocalName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSOAPBodyFirstElementLocalNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSOAPBodyFirstElementLocalName() { - return this.localSOAPBodyFirstElementLocalName; - } - - - - /** - * Auto generated setter method - * - * @param param SOAPBodyFirstElementLocalName - */ - public void setSOAPBodyFirstElementLocalName(final java.lang.String param) { - this.localSOAPBodyFirstElementLocalNameTracker = true; - - this.localSOAPBodyFirstElementLocalName = param; - - - } - - - /** - * field for SOAPBodyFirstElementNS - */ - - - protected org.apache.axiom.om.xsd.OMNamespace localSOAPBodyFirstElementNS; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSOAPBodyFirstElementNSTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.xsd.OMNamespace - */ - public org.apache.axiom.om.xsd.OMNamespace getSOAPBodyFirstElementNS() { - return this.localSOAPBodyFirstElementNS; - } - - - - /** - * Auto generated setter method - * - * @param param SOAPBodyFirstElementNS - */ - public void setSOAPBodyFirstElementNS(final org.apache.axiom.om.xsd.OMNamespace param) { - this.localSOAPBodyFirstElementNSTracker = true; - - this.localSOAPBodyFirstElementNS = param; - - - } - - - /** - * field for Body - */ - - - protected org.apache.axiom.soap.xsd.SOAPBody localBody; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localBodyTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPBody - */ - public org.apache.axiom.soap.xsd.SOAPBody getBody() { - return this.localBody; - } - - - - /** - * Auto generated setter method - * - * @param param Body - */ - public void setBody(final org.apache.axiom.soap.xsd.SOAPBody param) { - this.localBodyTracker = true; - - this.localBody = param; - - - } - - - /** - * field for Header - */ - - - protected org.apache.axiom.soap.xsd.SOAPHeader localHeader; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHeaderTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPHeader - */ - public org.apache.axiom.soap.xsd.SOAPHeader getHeader() { - return this.localHeader; - } - - - - /** - * Auto generated setter method - * - * @param param Header - */ - public void setHeader(final org.apache.axiom.soap.xsd.SOAPHeader param) { - this.localHeaderTracker = true; - - this.localHeader = param; - - - } - - - /** - * field for Version - */ - - - protected org.apache.axiom.soap.xsd.SOAPVersion 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 org.apache.axiom.soap.xsd.SOAPVersion - */ - public org.apache.axiom.soap.xsd.SOAPVersion getVersion() { - return this.localVersion; - } - - - - /** - * Auto generated setter method - * - * @param param Version - */ - public void setVersion(final org.apache.axiom.soap.xsd.SOAPVersion param) { - this.localVersionTracker = true; - - this.localVersion = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPEnvelope", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPEnvelope", xmlWriter); - } - - - } - if (this.localSOAPBodyFirstElementLocalNameTracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "SOAPBodyFirstElementLocalName", xmlWriter); - - - if (this.localSOAPBodyFirstElementLocalName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSOAPBodyFirstElementLocalName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localSOAPBodyFirstElementNSTracker) { - if (this.localSOAPBodyFirstElementNS == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "SOAPBodyFirstElementNS", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSOAPBodyFirstElementNS.serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "SOAPBodyFirstElementNS"), xmlWriter); - } - } - if (this.localBodyTracker) { - if (this.localBody == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "body", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localBody.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "body"), - xmlWriter); - } - } - if (this.localHeaderTracker) { - if (this.localHeader == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "header", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localHeader.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "header"), - xmlWriter); - } - } - if (this.localVersionTracker) { - if (this.localVersion == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "version", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localVersion.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "version"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localSOAPBodyFirstElementLocalNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "SOAPBodyFirstElementLocalName")); - - elementList.add(this.localSOAPBodyFirstElementLocalName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSOAPBodyFirstElementLocalName)); - } - if (this.localSOAPBodyFirstElementNSTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "SOAPBodyFirstElementNS")); - - - elementList.add(this.localSOAPBodyFirstElementNS == null ? null : this.localSOAPBodyFirstElementNS); - } - if (this.localBodyTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "body")); - - - elementList.add(this.localBody == null ? null : this.localBody); - } - if (this.localHeaderTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "header")); - - - elementList.add(this.localHeader == null ? null : this.localHeader); - } - if (this.localVersionTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "version")); - - - elementList.add(this.localVersion == null ? null : this.localVersion); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPEnvelope parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPEnvelope object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPEnvelope".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPEnvelope) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "SOAPBodyFirstElementLocalName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSOAPBodyFirstElementLocalName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "SOAPBodyFirstElementNS").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSOAPBodyFirstElementNS(null); - reader.next(); - - reader.next(); - - } else { - - object.setSOAPBodyFirstElementNS(org.apache.axiom.om.xsd.OMNamespace.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://soap.axiom.apache.org/xsd", - "body").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setBody(null); - reader.next(); - - reader.next(); - - } else { - - object.setBody(org.apache.axiom.soap.xsd.SOAPBody.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://soap.axiom.apache.org/xsd", - "header").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setHeader(null); - reader.next(); - - reader.next(); - - } else { - - object.setHeader(org.apache.axiom.soap.xsd.SOAPHeader.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://soap.axiom.apache.org/xsd", - "version").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setVersion(null); - reader.next(); - - reader.next(); - - } else { - - object.setVersion(org.apache.axiom.soap.xsd.SOAPVersion.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFault.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFault.java deleted file mode 100644 index c30b10e90..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFault.java +++ /dev/null @@ -1,895 +0,0 @@ - -/** - * SOAPFault.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPFault bean class - */ - -public abstract class SOAPFault implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPFault Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = 6271602086574838142L; - - /** - * field for Code - */ - - - protected org.apache.axiom.soap.xsd.SOAPFaultCode localCode; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCodeTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPFaultCode - */ - public org.apache.axiom.soap.xsd.SOAPFaultCode getCode() { - return this.localCode; - } - - - - /** - * Auto generated setter method - * - * @param param Code - */ - public void setCode(final org.apache.axiom.soap.xsd.SOAPFaultCode param) { - this.localCodeTracker = true; - - this.localCode = param; - - - } - - - /** - * field for Detail - */ - - - protected org.apache.axiom.soap.xsd.SOAPFaultDetail localDetail; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDetailTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPFaultDetail - */ - public org.apache.axiom.soap.xsd.SOAPFaultDetail getDetail() { - return this.localDetail; - } - - - - /** - * Auto generated setter method - * - * @param param Detail - */ - public void setDetail(final org.apache.axiom.soap.xsd.SOAPFaultDetail param) { - this.localDetailTracker = true; - - this.localDetail = param; - - - } - - - /** - * field for Exception - */ - - - protected org.apache.axiom.om.OMElement localException; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExceptionTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getException() { - return this.localException; - } - - - - /** - * Auto generated setter method - * - * @param param Exception - */ - public void setException(final org.apache.axiom.om.OMElement param) { - this.localExceptionTracker = true; - - this.localException = param; - - - } - - - /** - * field for Node - */ - - - protected org.apache.axiom.soap.xsd.SOAPFaultNode localNode; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNodeTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPFaultNode - */ - public org.apache.axiom.soap.xsd.SOAPFaultNode getNode() { - return this.localNode; - } - - - - /** - * Auto generated setter method - * - * @param param Node - */ - public void setNode(final org.apache.axiom.soap.xsd.SOAPFaultNode param) { - this.localNodeTracker = true; - - this.localNode = param; - - - } - - - /** - * field for Reason - */ - - - protected org.apache.axiom.soap.xsd.SOAPFaultReason localReason; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localReasonTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPFaultReason - */ - public org.apache.axiom.soap.xsd.SOAPFaultReason getReason() { - return this.localReason; - } - - - - /** - * Auto generated setter method - * - * @param param Reason - */ - public void setReason(final org.apache.axiom.soap.xsd.SOAPFaultReason param) { - this.localReasonTracker = true; - - this.localReason = param; - - - } - - - /** - * field for Role - */ - - - protected org.apache.axiom.soap.xsd.SOAPFaultRole localRole; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRoleTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPFaultRole - */ - public org.apache.axiom.soap.xsd.SOAPFaultRole getRole() { - return this.localRole; - } - - - - /** - * Auto generated setter method - * - * @param param Role - */ - public void setRole(final org.apache.axiom.soap.xsd.SOAPFaultRole param) { - this.localRoleTracker = true; - - this.localRole = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPFault", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPFault", xmlWriter); - } - - - } - if (this.localCodeTracker) { - if (this.localCode == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "code", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localCode.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "code"), - xmlWriter); - } - } - if (this.localDetailTracker) { - if (this.localDetail == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "detail", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localDetail.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "detail"), - xmlWriter); - } - } - if (this.localExceptionTracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "exception", xmlWriter); - - - if (this.localException == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - this.localException.serialize(xmlWriter); - - } - - xmlWriter.writeEndElement(); - } - if (this.localNodeTracker) { - if (this.localNode == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "node", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localNode.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "node"), - xmlWriter); - } - } - if (this.localReasonTracker) { - if (this.localReason == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "reason", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localReason.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "reason"), - xmlWriter); - } - } - if (this.localRoleTracker) { - if (this.localRole == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "role", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRole.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "role"), - xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localCodeTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "code")); - - - elementList.add(this.localCode == null ? null : this.localCode); - } - if (this.localDetailTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "detail")); - - - elementList.add(this.localDetail == null ? null : this.localDetail); - } - if (this.localExceptionTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "exception")); - - elementList.add(this.localException == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localException)); - } - if (this.localNodeTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "node")); - - - elementList.add(this.localNode == null ? null : this.localNode); - } - if (this.localReasonTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "reason")); - - - elementList.add(this.localReason == null ? null : this.localReason); - } - if (this.localRoleTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "role")); - - - elementList.add(this.localRole == null ? null : this.localRole); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPFault parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPFault object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPFault".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPFault) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "code").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setCode(null); - reader.next(); - - reader.next(); - - } else { - - object.setCode(org.apache.axiom.soap.xsd.SOAPFaultCode.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://soap.axiom.apache.org/xsd", - "detail").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setDetail(null); - reader.next(); - - reader.next(); - - } else { - - object.setDetail(org.apache.axiom.soap.xsd.SOAPFaultDetail.Factory.parse(reader)); - - reader.next(); - } - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - final org.apache.axiom.om.OMFactory fac = org.apache.axiom.om.OMAbstractFactory.getOMFactory(); - final org.apache.axiom.om.OMNamespace omNs = - fac.createOMNamespace("http://soap.axiom.apache.org/xsd", ""); - final org.apache.axiom.om.OMElement _valueException = fac.createOMElement("exception", omNs); - _valueException.addChild(fac.createOMText(_valueException, content)); - object.setException(_valueException); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "node").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setNode(null); - reader.next(); - - reader.next(); - - } else { - - object.setNode(org.apache.axiom.soap.xsd.SOAPFaultNode.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://soap.axiom.apache.org/xsd", - "reason").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setReason(null); - reader.next(); - - reader.next(); - - } else { - - object.setReason(org.apache.axiom.soap.xsd.SOAPFaultReason.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://soap.axiom.apache.org/xsd", - "role").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRole(null); - reader.next(); - - reader.next(); - - } else { - - object.setRole(org.apache.axiom.soap.xsd.SOAPFaultRole.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultCode.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultCode.java deleted file mode 100644 index 35459e308..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultCode.java +++ /dev/null @@ -1,378 +0,0 @@ - -/** - * SOAPFaultCode.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPFaultCode bean class - */ - -public abstract class SOAPFaultCode implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPFaultCode Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - - /** - * - */ - private static final long serialVersionUID = -9093529519999905828L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPFaultCode", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPFaultCode", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 SOAPFaultCode parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPFaultCode object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPFaultCode".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPFaultCode) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultDetail.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultDetail.java deleted file mode 100644 index 9b84cad92..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultDetail.java +++ /dev/null @@ -1,460 +0,0 @@ - -/** - * SOAPFaultDetail.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPFaultDetail bean class - */ - -public abstract class SOAPFaultDetail implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPFaultDetail Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = -8389218019977196676L; - - /** - * field for AllDetailEntries - */ - - - protected authclient.java.util.xsd.Iterator localAllDetailEntries; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAllDetailEntriesTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getAllDetailEntries() { - return this.localAllDetailEntries; - } - - - - /** - * Auto generated setter method - * - * @param param AllDetailEntries - */ - public void setAllDetailEntries(final authclient.java.util.xsd.Iterator param) { - this.localAllDetailEntriesTracker = true; - - this.localAllDetailEntries = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPFaultDetail", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPFaultDetail", - xmlWriter); - } - - - } - if (this.localAllDetailEntriesTracker) { - if (this.localAllDetailEntries == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "allDetailEntries", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAllDetailEntries.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "allDetailEntries"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAllDetailEntriesTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "allDetailEntries")); - - - elementList.add(this.localAllDetailEntries == null ? null : this.localAllDetailEntries); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPFaultDetail parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPFaultDetail object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPFaultDetail".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPFaultDetail) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "allDetailEntries").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAllDetailEntries(null); - reader.next(); - - reader.next(); - - } else { - - object.setAllDetailEntries(authclient.java.util.xsd.Iterator.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultNode.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultNode.java deleted file mode 100644 index 5fc80cdc8..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultNode.java +++ /dev/null @@ -1,467 +0,0 @@ - -/** - * SOAPFaultNode.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPFaultNode bean class - */ - -public abstract class SOAPFaultNode implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPFaultNode Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = 2136134559253236607L; - - /** - * field for NodeValue - */ - - - protected java.lang.String localNodeValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNodeValueTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getNodeValue() { - return this.localNodeValue; - } - - - - /** - * Auto generated setter method - * - * @param param NodeValue - */ - public void setNodeValue(final java.lang.String param) { - this.localNodeValueTracker = true; - - this.localNodeValue = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPFaultNode", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPFaultNode", xmlWriter); - } - - - } - if (this.localNodeValueTracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "nodeValue", xmlWriter); - - - if (this.localNodeValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localNodeValue); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localNodeValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "nodeValue")); - - elementList.add(this.localNodeValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNodeValue)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPFaultNode parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPFaultNode object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPFaultNode".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPFaultNode) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "nodeValue").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setNodeValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultReason.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultReason.java deleted file mode 100644 index aae69dc2b..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultReason.java +++ /dev/null @@ -1,549 +0,0 @@ - -/** - * SOAPFaultReason.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPFaultReason bean class - */ - -public abstract class SOAPFaultReason implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPFaultReason Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = -8538482997671511486L; - - /** - * field for AllSoapTexts - */ - - - protected java.lang.Object localAllSoapTexts; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAllSoapTextsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getAllSoapTexts() { - return this.localAllSoapTexts; - } - - - - /** - * Auto generated setter method - * - * @param param AllSoapTexts - */ - public void setAllSoapTexts(final java.lang.Object param) { - this.localAllSoapTextsTracker = true; - - this.localAllSoapTexts = param; - - - } - - - /** - * field for FirstSOAPText - */ - - - protected org.apache.axiom.soap.xsd.SOAPFaultText localFirstSOAPText; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFirstSOAPTextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPFaultText - */ - public org.apache.axiom.soap.xsd.SOAPFaultText getFirstSOAPText() { - return this.localFirstSOAPText; - } - - - - /** - * Auto generated setter method - * - * @param param FirstSOAPText - */ - public void setFirstSOAPText(final org.apache.axiom.soap.xsd.SOAPFaultText param) { - this.localFirstSOAPTextTracker = true; - - this.localFirstSOAPText = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPFaultReason", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPFaultReason", - xmlWriter); - } - - - } - if (this.localAllSoapTextsTracker) { - - if (this.localAllSoapTexts != null) { - if (this.localAllSoapTexts instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localAllSoapTexts).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "allSoapTexts"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "allSoapTexts", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localAllSoapTexts, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "allSoapTexts", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localFirstSOAPTextTracker) { - if (this.localFirstSOAPText == null) { - - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "firstSOAPText", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFirstSOAPText.serialize(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "firstSOAPText"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAllSoapTextsTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "allSoapTexts")); - - - elementList.add(this.localAllSoapTexts == null ? null : this.localAllSoapTexts); - } - if (this.localFirstSOAPTextTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "firstSOAPText")); - - - elementList.add(this.localFirstSOAPText == null ? null : this.localFirstSOAPText); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPFaultReason parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPFaultReason object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPFaultReason".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPFaultReason) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "allSoapTexts").equals(reader.getName())) { - - object.setAllSoapTexts(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "firstSOAPText").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFirstSOAPText(null); - reader.next(); - - reader.next(); - - } else { - - object.setFirstSOAPText(org.apache.axiom.soap.xsd.SOAPFaultText.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultRole.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultRole.java deleted file mode 100644 index 8220b2064..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultRole.java +++ /dev/null @@ -1,467 +0,0 @@ - -/** - * SOAPFaultRole.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPFaultRole bean class - */ - -public abstract class SOAPFaultRole implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPFaultRole Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = -6157760988913751566L; - - /** - * field for RoleValue - */ - - - protected java.lang.String localRoleValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRoleValueTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getRoleValue() { - return this.localRoleValue; - } - - - - /** - * Auto generated setter method - * - * @param param RoleValue - */ - public void setRoleValue(final java.lang.String param) { - this.localRoleValueTracker = true; - - this.localRoleValue = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPFaultRole", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPFaultRole", xmlWriter); - } - - - } - if (this.localRoleValueTracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "roleValue", xmlWriter); - - - if (this.localRoleValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localRoleValue); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localRoleValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "roleValue")); - - elementList.add(this.localRoleValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRoleValue)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPFaultRole parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPFaultRole object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPFaultRole".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPFaultRole) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "roleValue").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setRoleValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultText.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultText.java deleted file mode 100644 index 458cb6721..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPFaultText.java +++ /dev/null @@ -1,467 +0,0 @@ - -/** - * SOAPFaultText.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPFaultText bean class - */ - -public abstract class SOAPFaultText implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPFaultText Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = 228684773023599404L; - - /** - * field for Lang - */ - - - protected java.lang.String localLang; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLangTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getLang() { - return this.localLang; - } - - - - /** - * Auto generated setter method - * - * @param param Lang - */ - public void setLang(final java.lang.String param) { - this.localLangTracker = true; - - this.localLang = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPFaultText", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPFaultText", xmlWriter); - } - - - } - if (this.localLangTracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "lang", xmlWriter); - - - if (this.localLang == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localLang); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localLangTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "lang")); - - elementList.add(this.localLang == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLang)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPFaultText parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPFaultText object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPFaultText".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPFaultText) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "lang").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setLang(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPHeader.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPHeader.java deleted file mode 100644 index 91e9fcec4..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPHeader.java +++ /dev/null @@ -1,378 +0,0 @@ - -/** - * SOAPHeader.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPHeader bean class - */ - -public abstract class SOAPHeader implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPHeader Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - - /** - * - */ - private static final long serialVersionUID = 3891587413096500741L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPHeader", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPHeader", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 SOAPHeader parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPHeader object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPHeader".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPHeader) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPVersion.java b/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPVersion.java deleted file mode 100644 index ce66fd311..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axiom/soap/xsd/SOAPVersion.java +++ /dev/null @@ -1,1366 +0,0 @@ - -/** - * SOAPVersion.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axiom.soap.xsd; - - -/** - * SOAPVersion bean class - */ - -public abstract class SOAPVersion implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SOAPVersion Namespace URI = - * http://soap.axiom.apache.org/xsd Namespace Prefix = ns26 - */ - - - /** - * - */ - private static final long serialVersionUID = 4338887726584034357L; - - /** - * field for EncodingURI - */ - - - protected java.lang.String localEncodingURI; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEncodingURITracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getEncodingURI() { - return this.localEncodingURI; - } - - - - /** - * Auto generated setter method - * - * @param param EncodingURI - */ - public void setEncodingURI(final java.lang.String param) { - this.localEncodingURITracker = true; - - this.localEncodingURI = param; - - - } - - - /** - * field for EnvelopeURI - */ - - - protected java.lang.String localEnvelopeURI; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEnvelopeURITracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getEnvelopeURI() { - return this.localEnvelopeURI; - } - - - - /** - * Auto generated setter method - * - * @param param EnvelopeURI - */ - public void setEnvelopeURI(final java.lang.String param) { - this.localEnvelopeURITracker = true; - - this.localEnvelopeURI = param; - - - } - - - /** - * field for FaultCodeQName - */ - - - protected java.lang.Object localFaultCodeQName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultCodeQNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getFaultCodeQName() { - return this.localFaultCodeQName; - } - - - - /** - * Auto generated setter method - * - * @param param FaultCodeQName - */ - public void setFaultCodeQName(final java.lang.Object param) { - this.localFaultCodeQNameTracker = true; - - this.localFaultCodeQName = param; - - - } - - - /** - * field for FaultDetailQName - */ - - - protected java.lang.Object localFaultDetailQName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultDetailQNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getFaultDetailQName() { - return this.localFaultDetailQName; - } - - - - /** - * Auto generated setter method - * - * @param param FaultDetailQName - */ - public void setFaultDetailQName(final java.lang.Object param) { - this.localFaultDetailQNameTracker = true; - - this.localFaultDetailQName = param; - - - } - - - /** - * field for FaultReasonQName - */ - - - protected java.lang.Object localFaultReasonQName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultReasonQNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getFaultReasonQName() { - return this.localFaultReasonQName; - } - - - - /** - * Auto generated setter method - * - * @param param FaultReasonQName - */ - public void setFaultReasonQName(final java.lang.Object param) { - this.localFaultReasonQNameTracker = true; - - this.localFaultReasonQName = param; - - - } - - - /** - * field for FaultRoleQName - */ - - - protected java.lang.Object localFaultRoleQName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultRoleQNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getFaultRoleQName() { - return this.localFaultRoleQName; - } - - - - /** - * Auto generated setter method - * - * @param param FaultRoleQName - */ - public void setFaultRoleQName(final java.lang.Object param) { - this.localFaultRoleQNameTracker = true; - - this.localFaultRoleQName = param; - - - } - - - /** - * field for MustUnderstandFaultCode - */ - - - protected java.lang.Object localMustUnderstandFaultCode; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMustUnderstandFaultCodeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getMustUnderstandFaultCode() { - return this.localMustUnderstandFaultCode; - } - - - - /** - * Auto generated setter method - * - * @param param MustUnderstandFaultCode - */ - public void setMustUnderstandFaultCode(final java.lang.Object param) { - this.localMustUnderstandFaultCodeTracker = true; - - this.localMustUnderstandFaultCode = param; - - - } - - - /** - * field for NextRoleURI - */ - - - protected java.lang.String localNextRoleURI; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNextRoleURITracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getNextRoleURI() { - return this.localNextRoleURI; - } - - - - /** - * Auto generated setter method - * - * @param param NextRoleURI - */ - public void setNextRoleURI(final java.lang.String param) { - this.localNextRoleURITracker = true; - - this.localNextRoleURI = param; - - - } - - - /** - * field for ReceiverFaultCode - */ - - - protected java.lang.Object localReceiverFaultCode; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localReceiverFaultCodeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getReceiverFaultCode() { - return this.localReceiverFaultCode; - } - - - - /** - * Auto generated setter method - * - * @param param ReceiverFaultCode - */ - public void setReceiverFaultCode(final java.lang.Object param) { - this.localReceiverFaultCodeTracker = true; - - this.localReceiverFaultCode = param; - - - } - - - /** - * field for RoleAttributeQName - */ - - - protected java.lang.Object localRoleAttributeQName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRoleAttributeQNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getRoleAttributeQName() { - return this.localRoleAttributeQName; - } - - - - /** - * Auto generated setter method - * - * @param param RoleAttributeQName - */ - public void setRoleAttributeQName(final java.lang.Object param) { - this.localRoleAttributeQNameTracker = true; - - this.localRoleAttributeQName = param; - - - } - - - /** - * field for SenderFaultCode - */ - - - protected java.lang.Object localSenderFaultCode; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSenderFaultCodeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getSenderFaultCode() { - return this.localSenderFaultCode; - } - - - - /** - * Auto generated setter method - * - * @param param SenderFaultCode - */ - public void setSenderFaultCode(final java.lang.Object param) { - this.localSenderFaultCodeTracker = true; - - this.localSenderFaultCode = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://soap.axiom.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SOAPVersion", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SOAPVersion", xmlWriter); - } - - - } - if (this.localEncodingURITracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "encodingURI", xmlWriter); - - - if (this.localEncodingURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localEncodingURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localEnvelopeURITracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "envelopeURI", xmlWriter); - - - if (this.localEnvelopeURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localEnvelopeURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFaultCodeQNameTracker) { - - if (this.localFaultCodeQName != null) { - if (this.localFaultCodeQName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localFaultCodeQName).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "faultCodeQName"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "faultCodeQName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localFaultCodeQName, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "faultCodeQName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localFaultDetailQNameTracker) { - - if (this.localFaultDetailQName != null) { - if (this.localFaultDetailQName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localFaultDetailQName).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "faultDetailQName"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "faultDetailQName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localFaultDetailQName, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "faultDetailQName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localFaultReasonQNameTracker) { - - if (this.localFaultReasonQName != null) { - if (this.localFaultReasonQName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localFaultReasonQName).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "faultReasonQName"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "faultReasonQName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localFaultReasonQName, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "faultReasonQName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localFaultRoleQNameTracker) { - - if (this.localFaultRoleQName != null) { - if (this.localFaultRoleQName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localFaultRoleQName).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "faultRoleQName"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "faultRoleQName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localFaultRoleQName, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "faultRoleQName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localMustUnderstandFaultCodeTracker) { - - if (this.localMustUnderstandFaultCode != null) { - if (this.localMustUnderstandFaultCode instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localMustUnderstandFaultCode).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "mustUnderstandFaultCode"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "mustUnderstandFaultCode", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localMustUnderstandFaultCode, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "mustUnderstandFaultCode", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localNextRoleURITracker) { - namespace = "http://soap.axiom.apache.org/xsd"; - writeStartElement(null, namespace, "nextRoleURI", xmlWriter); - - - if (this.localNextRoleURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localNextRoleURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localReceiverFaultCodeTracker) { - - if (this.localReceiverFaultCode != null) { - if (this.localReceiverFaultCode instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localReceiverFaultCode).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "receiverFaultCode"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "receiverFaultCode", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localReceiverFaultCode, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "receiverFaultCode", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localRoleAttributeQNameTracker) { - - if (this.localRoleAttributeQName != null) { - if (this.localRoleAttributeQName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localRoleAttributeQName).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "roleAttributeQName"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "roleAttributeQName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localRoleAttributeQName, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "roleAttributeQName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localSenderFaultCodeTracker) { - - if (this.localSenderFaultCode != null) { - if (this.localSenderFaultCode instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localSenderFaultCode).serialize(new javax.xml.namespace.QName( - "http://soap.axiom.apache.org/xsd", "senderFaultCode"), xmlWriter, true); - } else { - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "senderFaultCode", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localSenderFaultCode, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://soap.axiom.apache.org/xsd", "senderFaultCode", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://soap.axiom.apache.org/xsd")) { - return "ns26"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localEncodingURITracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "encodingURI")); - - elementList.add(this.localEncodingURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEncodingURI)); - } - if (this.localEnvelopeURITracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "envelopeURI")); - - elementList.add(this.localEnvelopeURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEnvelopeURI)); - } - if (this.localFaultCodeQNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "faultCodeQName")); - - - elementList.add(this.localFaultCodeQName == null ? null : this.localFaultCodeQName); - } - if (this.localFaultDetailQNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "faultDetailQName")); - - - elementList.add(this.localFaultDetailQName == null ? null : this.localFaultDetailQName); - } - if (this.localFaultReasonQNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "faultReasonQName")); - - - elementList.add(this.localFaultReasonQName == null ? null : this.localFaultReasonQName); - } - if (this.localFaultRoleQNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "faultRoleQName")); - - - elementList.add(this.localFaultRoleQName == null ? null : this.localFaultRoleQName); - } - if (this.localMustUnderstandFaultCodeTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "mustUnderstandFaultCode")); - - - elementList.add(this.localMustUnderstandFaultCode == null ? null : this.localMustUnderstandFaultCode); - } - if (this.localNextRoleURITracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "nextRoleURI")); - - elementList.add(this.localNextRoleURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNextRoleURI)); - } - if (this.localReceiverFaultCodeTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "receiverFaultCode")); - - - elementList.add(this.localReceiverFaultCode == null ? null : this.localReceiverFaultCode); - } - if (this.localRoleAttributeQNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "roleAttributeQName")); - - - elementList.add(this.localRoleAttributeQName == null ? null : this.localRoleAttributeQName); - } - if (this.localSenderFaultCodeTracker) { - elementList.add(new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", "senderFaultCode")); - - - elementList.add(this.localSenderFaultCode == null ? null : this.localSenderFaultCode); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SOAPVersion parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SOAPVersion object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SOAPVersion".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SOAPVersion) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "encodingURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setEncodingURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "envelopeURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setEnvelopeURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "faultCodeQName").equals(reader.getName())) { - - object.setFaultCodeQName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "faultDetailQName").equals(reader.getName())) { - - object.setFaultDetailQName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "faultReasonQName").equals(reader.getName())) { - - object.setFaultReasonQName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "faultRoleQName").equals(reader.getName())) { - - object.setFaultRoleQName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "mustUnderstandFaultCode").equals(reader.getName())) { - - object.setMustUnderstandFaultCode(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "nextRoleURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setNextRoleURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "receiverFaultCode").equals(reader.getName())) { - - object.setReceiverFaultCode(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "roleAttributeQName").equals(reader.getName())) { - - object.setRoleAttributeQName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://soap.axiom.apache.org/xsd", - "senderFaultCode").equals(reader.getName())) { - - object.setSenderFaultCode(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/addressing/xsd/EndpointReference.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/addressing/xsd/EndpointReference.java deleted file mode 100644 index 587a2e8bc..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/addressing/xsd/EndpointReference.java +++ /dev/null @@ -1,1570 +0,0 @@ - -/** - * EndpointReference.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.addressing.xsd; - - -/** - * EndpointReference bean class - */ - -public class EndpointReference implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = EndpointReference Namespace URI - * = http://addressing.axis2.apache.org/xsd Namespace Prefix = ns27 - */ - - - /** - * - */ - private static final long serialVersionUID = -1460379303439663252L; - - /** - * field for WSAddressingAnonymous - */ - - - protected boolean localWSAddressingAnonymous; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localWSAddressingAnonymousTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getWSAddressingAnonymous() { - return this.localWSAddressingAnonymous; - } - - - - /** - * Auto generated setter method - * - * @param param WSAddressingAnonymous - */ - public void setWSAddressingAnonymous(final boolean param) { - - // setting primitive attribute tracker to true - this.localWSAddressingAnonymousTracker = true; - - this.localWSAddressingAnonymous = param; - - - } - - - /** - * field for Address - */ - - - protected java.lang.String localAddress; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAddressTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getAddress() { - return this.localAddress; - } - - - - /** - * Auto generated setter method - * - * @param param Address - */ - public void setAddress(final java.lang.String param) { - this.localAddressTracker = true; - - this.localAddress = param; - - - } - - - /** - * field for AddressAttributes - */ - - - protected java.lang.Object localAddressAttributes; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAddressAttributesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getAddressAttributes() { - return this.localAddressAttributes; - } - - - - /** - * Auto generated setter method - * - * @param param AddressAttributes - */ - public void setAddressAttributes(final java.lang.Object param) { - this.localAddressAttributesTracker = true; - - this.localAddressAttributes = param; - - - } - - - /** - * field for AllReferenceParameters - */ - - - protected authclient.java.util.xsd.Map localAllReferenceParameters; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAllReferenceParametersTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getAllReferenceParameters() { - return this.localAllReferenceParameters; - } - - - - /** - * Auto generated setter method - * - * @param param AllReferenceParameters - */ - public void setAllReferenceParameters(final authclient.java.util.xsd.Map param) { - this.localAllReferenceParametersTracker = true; - - this.localAllReferenceParameters = param; - - - } - - - /** - * field for Attributes - */ - - - protected java.lang.Object localAttributes; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAttributesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getAttributes() { - return this.localAttributes; - } - - - - /** - * Auto generated setter method - * - * @param param Attributes - */ - public void setAttributes(final java.lang.Object param) { - this.localAttributesTracker = true; - - this.localAttributes = param; - - - } - - - /** - * field for ExtensibleElements This was an Array! - */ - - - protected java.lang.Object[] localExtensibleElements; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtensibleElementsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object[] - */ - public java.lang.Object[] getExtensibleElements() { - return this.localExtensibleElements; - } - - - - /** - * validate the array for ExtensibleElements - */ - protected void validateExtensibleElements(final java.lang.Object[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ExtensibleElements - */ - public void setExtensibleElements(final java.lang.Object[] param) { - - validateExtensibleElements(param); - - this.localExtensibleElementsTracker = true; - - this.localExtensibleElements = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.Object - */ - public void addExtensibleElements(final java.lang.Object param) { - if (this.localExtensibleElements == null) { - this.localExtensibleElements = new java.lang.Object[] {}; - } - - - // update the setting tracker - this.localExtensibleElementsTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtensibleElements); - list.add(param); - this.localExtensibleElements = list.toArray(new java.lang.Object[list.size()]); - - } - - - /** - * field for LogCorrelationIDString - */ - - - protected java.lang.String localLogCorrelationIDString; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLogCorrelationIDStringTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getLogCorrelationIDString() { - return this.localLogCorrelationIDString; - } - - - - /** - * Auto generated setter method - * - * @param param LogCorrelationIDString - */ - public void setLogCorrelationIDString(final java.lang.String param) { - this.localLogCorrelationIDStringTracker = true; - - this.localLogCorrelationIDString = param; - - - } - - - /** - * field for MetaData - */ - - - protected java.lang.Object 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 java.lang.Object - */ - public java.lang.Object getMetaData() { - return this.localMetaData; - } - - - - /** - * Auto generated setter method - * - * @param param MetaData - */ - public void setMetaData(final java.lang.Object param) { - this.localMetaDataTracker = true; - - this.localMetaData = param; - - - } - - - /** - * field for MetadataAttributes - */ - - - protected java.lang.Object localMetadataAttributes; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMetadataAttributesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getMetadataAttributes() { - return this.localMetadataAttributes; - } - - - - /** - * Auto generated setter method - * - * @param param MetadataAttributes - */ - public void setMetadataAttributes(final java.lang.Object param) { - this.localMetadataAttributesTracker = true; - - this.localMetadataAttributes = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for ReferenceParameters This was an Array! - */ - - - protected java.lang.Object[] localReferenceParameters; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localReferenceParametersTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object[] - */ - public java.lang.Object[] getReferenceParameters() { - return this.localReferenceParameters; - } - - - - /** - * validate the array for ReferenceParameters - */ - protected void validateReferenceParameters(final java.lang.Object[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ReferenceParameters - */ - public void setReferenceParameters(final java.lang.Object[] param) { - - validateReferenceParameters(param); - - this.localReferenceParametersTracker = true; - - this.localReferenceParameters = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.Object - */ - public void addReferenceParameters(final java.lang.Object param) { - if (this.localReferenceParameters == null) { - this.localReferenceParameters = new java.lang.Object[] {}; - } - - - // update the setting tracker - this.localReferenceParametersTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localReferenceParameters); - list.add(param); - this.localReferenceParameters = list.toArray(new java.lang.Object[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://addressing.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":EndpointReference", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "EndpointReference", - xmlWriter); - } - - - } - if (this.localWSAddressingAnonymousTracker) { - namespace = "http://addressing.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "WSAddressingAnonymous", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("WSAddressingAnonymous cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWSAddressingAnonymous)); - } - - xmlWriter.writeEndElement(); - } - if (this.localAddressTracker) { - namespace = "http://addressing.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "address", xmlWriter); - - - if (this.localAddress == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localAddress); - - } - - xmlWriter.writeEndElement(); - } - if (this.localAddressAttributesTracker) { - - if (this.localAddressAttributes != null) { - if (this.localAddressAttributes instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localAddressAttributes).serialize(new javax.xml.namespace.QName( - "http://addressing.axis2.apache.org/xsd", "addressAttributes"), xmlWriter, true); - } else { - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "addressAttributes", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localAddressAttributes, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "addressAttributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localAllReferenceParametersTracker) { - if (this.localAllReferenceParameters == null) { - - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "allReferenceParameters", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAllReferenceParameters.serialize(new javax.xml.namespace.QName( - "http://addressing.axis2.apache.org/xsd", "allReferenceParameters"), xmlWriter); - } - } - if (this.localAttributesTracker) { - - if (this.localAttributes != null) { - if (this.localAttributes instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localAttributes).serialize(new javax.xml.namespace.QName( - "http://addressing.axis2.apache.org/xsd", "attributes"), xmlWriter, true); - } else { - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "attributes", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localAttributes, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "attributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localExtensibleElementsTracker) { - - if (this.localExtensibleElements != null) { - for (final Object localExtensibleElement : this.localExtensibleElements) { - if (localExtensibleElement != null) { - - if (localExtensibleElement instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) localExtensibleElement).serialize(new javax.xml.namespace.QName( - "http://addressing.axis2.apache.org/xsd", "extensibleElements"), xmlWriter, true); - } else { - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "extensibleElements", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(localExtensibleElement, - xmlWriter); - xmlWriter.writeEndElement(); - } - - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "extensibleElements", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "extensibleElements", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localLogCorrelationIDStringTracker) { - namespace = "http://addressing.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "logCorrelationIDString", xmlWriter); - - - if (this.localLogCorrelationIDString == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localLogCorrelationIDString); - - } - - xmlWriter.writeEndElement(); - } - if (this.localMetaDataTracker) { - - if (this.localMetaData != null) { - if (this.localMetaData instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localMetaData).serialize(new javax.xml.namespace.QName( - "http://addressing.axis2.apache.org/xsd", "metaData"), xmlWriter, true); - } else { - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "metaData", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localMetaData, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "metaData", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localMetadataAttributesTracker) { - - if (this.localMetadataAttributes != null) { - if (this.localMetadataAttributes instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localMetadataAttributes).serialize(new javax.xml.namespace.QName( - "http://addressing.axis2.apache.org/xsd", "metadataAttributes"), xmlWriter, true); - } else { - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "metadataAttributes", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localMetadataAttributes, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "metadataAttributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localNameTracker) { - namespace = "http://addressing.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localReferenceParametersTracker) { - - if (this.localReferenceParameters != null) { - for (final Object localReferenceParameter : this.localReferenceParameters) { - if (localReferenceParameter != null) { - - if (localReferenceParameter instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) localReferenceParameter).serialize(new javax.xml.namespace.QName( - "http://addressing.axis2.apache.org/xsd", "referenceParameters"), xmlWriter, true); - } else { - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "referenceParameters", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(localReferenceParameter, - xmlWriter); - xmlWriter.writeEndElement(); - } - - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "referenceParameters", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "referenceParameters", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://addressing.axis2.apache.org/xsd")) { - return "ns27"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localWSAddressingAnonymousTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "WSAddressingAnonymous")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWSAddressingAnonymous)); - } - if (this.localAddressTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", "address")); - - elementList.add(this.localAddress == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAddress)); - } - if (this.localAddressAttributesTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "addressAttributes")); - - - elementList.add(this.localAddressAttributes == null ? null : this.localAddressAttributes); - } - if (this.localAllReferenceParametersTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "allReferenceParameters")); - - - elementList.add(this.localAllReferenceParameters == null ? null : this.localAllReferenceParameters); - } - if (this.localAttributesTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", "attributes")); - - - elementList.add(this.localAttributes == null ? null : this.localAttributes); - } - if (this.localExtensibleElementsTracker) { - if (this.localExtensibleElements != null) { - for (final Object localExtensibleElement : this.localExtensibleElements) { - - if (localExtensibleElement != null) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "extensibleElements")); - elementList.add(localExtensibleElement); - } else { - - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "extensibleElements")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "extensibleElements")); - elementList.add(this.localExtensibleElements); - - } - - } - if (this.localLogCorrelationIDStringTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "logCorrelationIDString")); - - elementList.add(this.localLogCorrelationIDString == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLogCorrelationIDString)); - } - if (this.localMetaDataTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", "metaData")); - - - elementList.add(this.localMetaData == null ? null : this.localMetaData); - } - if (this.localMetadataAttributesTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "metadataAttributes")); - - - elementList.add(this.localMetadataAttributes == null ? null : this.localMetadataAttributes); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localReferenceParametersTracker) { - if (this.localReferenceParameters != null) { - for (final Object localReferenceParameter : this.localReferenceParameters) { - - if (localReferenceParameter != null) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "referenceParameters")); - elementList.add(localReferenceParameter); - } else { - - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "referenceParameters")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "referenceParameters")); - elementList.add(this.localReferenceParameters); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static EndpointReference parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final EndpointReference object = new EndpointReference(); - - int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"EndpointReference".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (EndpointReference) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list6 = new java.util.ArrayList(); - - final java.util.ArrayList list11 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "WSAddressingAnonymous").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setWSAddressingAnonymous(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://addressing.axis2.apache.org/xsd", - "address").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setAddress(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "addressAttributes").equals(reader.getName())) { - - object.setAddressAttributes(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "allReferenceParameters").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAllReferenceParameters(null); - reader.next(); - - reader.next(); - - } else { - - object.setAllReferenceParameters(authclient.java.util.xsd.Map.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://addressing.axis2.apache.org/xsd", - "attributes").equals(reader.getName())) { - - object.setAttributes(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "extensibleElements").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - - boolean loopDone6 = false; - final javax.xml.namespace.QName startQname6 = - new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", "extensibleElements"); - - while (!loopDone6) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event - && startQname6.equals(reader.getName())) { - - - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list6.add(null); - reader.next(); - } else { - list6.add(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - } - } else if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event - && !startQname6.equals(reader.getName())) { - loopDone6 = true; - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event - && !startQname6.equals(reader.getName())) { - loopDone6 = true; - } else if (javax.xml.stream.XMLStreamConstants.END_DOCUMENT == event) { - loopDone6 = true; - } else { - reader.next(); - } - - } - - - object.setExtensibleElements(list6.toArray()); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "logCorrelationIDString").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setLogCorrelationIDString(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "metaData").equals(reader.getName())) { - - object.setMetaData(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "metadataAttributes").equals(reader.getName())) { - - object.setMetadataAttributes(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "referenceParameters").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - - boolean loopDone11 = false; - final javax.xml.namespace.QName startQname11 = - new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", "referenceParameters"); - - while (!loopDone11) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event - && startQname11.equals(reader.getName())) { - - - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list11.add(null); - reader.next(); - } else { - list11.add(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - } - } else if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event - && !startQname11.equals(reader.getName())) { - loopDone11 = true; - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event - && !startQname11.equals(reader.getName())) { - loopDone11 = true; - } else if (javax.xml.stream.XMLStreamConstants.END_DOCUMENT == event) { - loopDone11 = true; - } else { - reader.next(); - } - - } - - - object.setReferenceParameters(list11.toArray()); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/addressing/xsd/RelatesTo.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/addressing/xsd/RelatesTo.java deleted file mode 100644 index e31bb302f..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/addressing/xsd/RelatesTo.java +++ /dev/null @@ -1,650 +0,0 @@ - -/** - * RelatesTo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.addressing.xsd; - - -/** - * RelatesTo bean class - */ - -public class RelatesTo implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = RelatesTo Namespace URI = - * http://addressing.axis2.apache.org/xsd Namespace Prefix = ns27 - */ - - - /** - * - */ - private static final long serialVersionUID = 8993986984115901300L; - - /** - * field for ExtensibilityAttributes - */ - - - protected java.lang.Object localExtensibilityAttributes; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtensibilityAttributesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getExtensibilityAttributes() { - return this.localExtensibilityAttributes; - } - - - - /** - * Auto generated setter method - * - * @param param ExtensibilityAttributes - */ - public void setExtensibilityAttributes(final java.lang.Object param) { - this.localExtensibilityAttributesTracker = true; - - this.localExtensibilityAttributes = param; - - - } - - - /** - * field for RelationshipType - */ - - - protected java.lang.String localRelationshipType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRelationshipTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getRelationshipType() { - return this.localRelationshipType; - } - - - - /** - * Auto generated setter method - * - * @param param RelationshipType - */ - public void setRelationshipType(final java.lang.String param) { - this.localRelationshipTypeTracker = true; - - this.localRelationshipType = param; - - - } - - - /** - * field for Value - */ - - - protected java.lang.String localValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localValueTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getValue() { - return this.localValue; - } - - - - /** - * Auto generated setter method - * - * @param param Value - */ - public void setValue(final java.lang.String param) { - this.localValueTracker = true; - - this.localValue = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://addressing.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":RelatesTo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "RelatesTo", xmlWriter); - } - - - } - if (this.localExtensibilityAttributesTracker) { - - if (this.localExtensibilityAttributes != null) { - if (this.localExtensibilityAttributes instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localExtensibilityAttributes).serialize(new javax.xml.namespace.QName( - "http://addressing.axis2.apache.org/xsd", "extensibilityAttributes"), xmlWriter, true); - } else { - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "extensibilityAttributes", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localExtensibilityAttributes, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://addressing.axis2.apache.org/xsd", "extensibilityAttributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localRelationshipTypeTracker) { - namespace = "http://addressing.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "relationshipType", xmlWriter); - - - if (this.localRelationshipType == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localRelationshipType); - - } - - xmlWriter.writeEndElement(); - } - if (this.localValueTracker) { - namespace = "http://addressing.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "value", xmlWriter); - - - if (this.localValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localValue); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://addressing.axis2.apache.org/xsd")) { - return "ns27"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localExtensibilityAttributesTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "extensibilityAttributes")); - - - elementList.add(this.localExtensibilityAttributes == null ? null : this.localExtensibilityAttributes); - } - if (this.localRelationshipTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "relationshipType")); - - elementList.add(this.localRelationshipType == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRelationshipType)); - } - if (this.localValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", "value")); - - elementList.add(this.localValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localValue)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static RelatesTo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final RelatesTo object = new RelatesTo(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"RelatesTo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (RelatesTo) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "extensibilityAttributes").equals(reader.getName())) { - - object.setExtensibilityAttributes(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "relationshipType").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setRelationshipType(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://addressing.axis2.apache.org/xsd", - "value").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/client/xsd/Options.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/client/xsd/Options.java deleted file mode 100644 index 1d13e83f3..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/client/xsd/Options.java +++ /dev/null @@ -1,2583 +0,0 @@ - -/** - * Options.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.client.xsd; - -import org.apache.axis2.addressing.xsd.RelatesTo; - -/** - * Options bean class - */ - -public class Options implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Options Namespace URI = - * http://client.axis2.apache.org/xsd Namespace Prefix = ns29 - */ - - - /** - * - */ - private static final long serialVersionUID = -7123490050652853093L; - - /** - * field for Action - */ - - - protected java.lang.String localAction; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getAction() { - return this.localAction; - } - - - - /** - * Auto generated setter method - * - * @param param Action - */ - public void setAction(final java.lang.String param) { - this.localActionTracker = true; - - this.localAction = param; - - - } - - - /** - * field for CallTransportCleanup - */ - - - protected boolean localCallTransportCleanup; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCallTransportCleanupTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getCallTransportCleanup() { - return this.localCallTransportCleanup; - } - - - - /** - * Auto generated setter method - * - * @param param CallTransportCleanup - */ - public void setCallTransportCleanup(final boolean param) { - - // setting primitive attribute tracker to true - this.localCallTransportCleanupTracker = true; - - this.localCallTransportCleanup = param; - - - } - - - /** - * field for ExceptionToBeThrownOnSOAPFault - */ - - - protected boolean localExceptionToBeThrownOnSOAPFault; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExceptionToBeThrownOnSOAPFaultTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getExceptionToBeThrownOnSOAPFault() { - return this.localExceptionToBeThrownOnSOAPFault; - } - - - - /** - * Auto generated setter method - * - * @param param ExceptionToBeThrownOnSOAPFault - */ - public void setExceptionToBeThrownOnSOAPFault(final boolean param) { - - // setting primitive attribute tracker to true - this.localExceptionToBeThrownOnSOAPFaultTracker = true; - - this.localExceptionToBeThrownOnSOAPFault = param; - - - } - - - /** - * field for FaultTo - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localFaultTo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultToTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getFaultTo() { - return this.localFaultTo; - } - - - - /** - * Auto generated setter method - * - * @param param FaultTo - */ - public void setFaultTo(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localFaultToTracker = true; - - this.localFaultTo = param; - - - } - - - /** - * field for From - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localFrom; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFromTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getFrom() { - return this.localFrom; - } - - - - /** - * Auto generated setter method - * - * @param param From - */ - public void setFrom(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localFromTracker = true; - - this.localFrom = param; - - - } - - - /** - * field for Listener - */ - - - protected org.apache.axis2.transport.xsd.TransportListener localListener; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localListenerTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.transport.xsd.TransportListener - */ - public org.apache.axis2.transport.xsd.TransportListener getListener() { - return this.localListener; - } - - - - /** - * Auto generated setter method - * - * @param param Listener - */ - public void setListener(final org.apache.axis2.transport.xsd.TransportListener param) { - this.localListenerTracker = true; - - this.localListener = param; - - - } - - - /** - * field for LogCorrelationIDString - */ - - - protected java.lang.String localLogCorrelationIDString; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLogCorrelationIDStringTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getLogCorrelationIDString() { - return this.localLogCorrelationIDString; - } - - - - /** - * Auto generated setter method - * - * @param param LogCorrelationIDString - */ - public void setLogCorrelationIDString(final java.lang.String param) { - this.localLogCorrelationIDStringTracker = true; - - this.localLogCorrelationIDString = param; - - - } - - - /** - * field for ManageSession - */ - - - protected boolean localManageSession; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localManageSessionTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getManageSession() { - return this.localManageSession; - } - - - - /** - * Auto generated setter method - * - * @param param ManageSession - */ - public void setManageSession(final boolean param) { - - // setting primitive attribute tracker to true - this.localManageSessionTracker = true; - - this.localManageSession = param; - - - } - - - /** - * field for MessageId - */ - - - protected java.lang.String localMessageId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessageIdTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getMessageId() { - return this.localMessageId; - } - - - - /** - * Auto generated setter method - * - * @param param MessageId - */ - public void setMessageId(final java.lang.String param) { - this.localMessageIdTracker = true; - - this.localMessageId = param; - - - } - - - /** - * field for Parent - */ - - - protected org.apache.axis2.client.xsd.Options localParent; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localParentTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.client.xsd.Options - */ - public org.apache.axis2.client.xsd.Options getParent() { - return this.localParent; - } - - - - /** - * Auto generated setter method - * - * @param param Parent - */ - public void setParent(final org.apache.axis2.client.xsd.Options param) { - this.localParentTracker = true; - - this.localParent = param; - - - } - - - /** - * field for Password - */ - - - protected java.lang.String localPassword; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPasswordTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPassword() { - return this.localPassword; - } - - - - /** - * Auto generated setter method - * - * @param param Password - */ - public void setPassword(final java.lang.String param) { - this.localPasswordTracker = true; - - this.localPassword = param; - - - } - - - /** - * field for Properties This was an Array! - */ - - - protected java.lang.String[] localProperties; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPropertiesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getProperties() { - return this.localProperties; - } - - - - /** - * validate the array for Properties - */ - protected void validateProperties(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Properties - */ - public void setProperties(final java.lang.String[] param) { - - validateProperties(param); - - this.localPropertiesTracker = true; - - this.localProperties = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addProperties(final java.lang.String param) { - if (this.localProperties == null) { - this.localProperties = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localPropertiesTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localProperties); - list.add(param); - this.localProperties = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for RelatesTo - */ - - - protected org.apache.axis2.addressing.xsd.RelatesTo localRelatesTo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRelatesToTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.RelatesTo - */ - public org.apache.axis2.addressing.xsd.RelatesTo getRelatesTo() { - return this.localRelatesTo; - } - - - - /** - * Auto generated setter method - * - * @param param RelatesTo - */ - public void setRelatesTo(final org.apache.axis2.addressing.xsd.RelatesTo param) { - this.localRelatesToTracker = true; - - this.localRelatesTo = param; - - - } - - - /** - * field for Relationships This was an Array! - */ - - - protected org.apache.axis2.addressing.xsd.RelatesTo[] localRelationships; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRelationshipsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.RelatesTo[] - */ - public org.apache.axis2.addressing.xsd.RelatesTo[] getRelationships() { - return this.localRelationships; - } - - - - /** - * validate the array for Relationships - */ - protected void validateRelationships(final org.apache.axis2.addressing.xsd.RelatesTo[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Relationships - */ - public void setRelationships(final org.apache.axis2.addressing.xsd.RelatesTo[] param) { - - validateRelationships(param); - - this.localRelationshipsTracker = true; - - this.localRelationships = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axis2.addressing.xsd.RelatesTo - */ - public void addRelationships(final org.apache.axis2.addressing.xsd.RelatesTo param) { - if (this.localRelationships == null) { - this.localRelationships = new org.apache.axis2.addressing.xsd.RelatesTo[] {}; - } - - - // update the setting tracker - this.localRelationshipsTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localRelationships); - list.add(param); - this.localRelationships = - (org.apache.axis2.addressing.xsd.RelatesTo[]) list.toArray(new org.apache.axis2.addressing.xsd.RelatesTo[list.size()]); - - } - - - /** - * field for ReplyTo - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localReplyTo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localReplyToTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getReplyTo() { - return this.localReplyTo; - } - - - - /** - * Auto generated setter method - * - * @param param ReplyTo - */ - public void setReplyTo(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localReplyToTracker = true; - - this.localReplyTo = param; - - - } - - - /** - * field for SoapVersionURI - */ - - - protected java.lang.String localSoapVersionURI; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSoapVersionURITracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSoapVersionURI() { - return this.localSoapVersionURI; - } - - - - /** - * Auto generated setter method - * - * @param param SoapVersionURI - */ - public void setSoapVersionURI(final java.lang.String param) { - this.localSoapVersionURITracker = true; - - this.localSoapVersionURI = param; - - - } - - - /** - * field for TimeOutInMilliSeconds - */ - - - protected long localTimeOutInMilliSeconds; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTimeOutInMilliSecondsTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getTimeOutInMilliSeconds() { - return this.localTimeOutInMilliSeconds; - } - - - - /** - * Auto generated setter method - * - * @param param TimeOutInMilliSeconds - */ - public void setTimeOutInMilliSeconds(final long param) { - - // setting primitive attribute tracker to true - this.localTimeOutInMilliSecondsTracker = param != java.lang.Long.MIN_VALUE; - - this.localTimeOutInMilliSeconds = param; - - - } - - - /** - * field for To - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localTo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localToTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getTo() { - return this.localTo; - } - - - - /** - * Auto generated setter method - * - * @param param To - */ - public void setTo(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localToTracker = true; - - this.localTo = param; - - - } - - - /** - * field for TransportIn - */ - - - protected org.apache.axis2.description.xsd.TransportInDescription localTransportIn; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransportInTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.TransportInDescription - */ - public org.apache.axis2.description.xsd.TransportInDescription getTransportIn() { - return this.localTransportIn; - } - - - - /** - * Auto generated setter method - * - * @param param TransportIn - */ - public void setTransportIn(final org.apache.axis2.description.xsd.TransportInDescription param) { - this.localTransportInTracker = true; - - this.localTransportIn = param; - - - } - - - /** - * field for TransportInProtocol - */ - - - protected java.lang.String localTransportInProtocol; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransportInProtocolTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getTransportInProtocol() { - return this.localTransportInProtocol; - } - - - - /** - * Auto generated setter method - * - * @param param TransportInProtocol - */ - public void setTransportInProtocol(final java.lang.String param) { - this.localTransportInProtocolTracker = true; - - this.localTransportInProtocol = param; - - - } - - - /** - * field for TransportOut - */ - - - protected org.apache.axis2.description.xsd.TransportOutDescription localTransportOut; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransportOutTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.TransportOutDescription - */ - public org.apache.axis2.description.xsd.TransportOutDescription getTransportOut() { - return this.localTransportOut; - } - - - - /** - * Auto generated setter method - * - * @param param TransportOut - */ - public void setTransportOut(final org.apache.axis2.description.xsd.TransportOutDescription param) { - this.localTransportOutTracker = true; - - this.localTransportOut = param; - - - } - - - /** - * field for UseSeparateListener - */ - - - protected boolean localUseSeparateListener; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUseSeparateListenerTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getUseSeparateListener() { - return this.localUseSeparateListener; - } - - - - /** - * Auto generated setter method - * - * @param param UseSeparateListener - */ - public void setUseSeparateListener(final boolean param) { - - // setting primitive attribute tracker to true - this.localUseSeparateListenerTracker = true; - - this.localUseSeparateListener = param; - - - } - - - /** - * field for UserName - */ - - - protected java.lang.String localUserName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUserNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getUserName() { - return this.localUserName; - } - - - - /** - * Auto generated setter method - * - * @param param UserName - */ - public void setUserName(final java.lang.String param) { - this.localUserNameTracker = true; - - this.localUserName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://client.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Options", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Options", xmlWriter); - } - - - } - if (this.localActionTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "action", xmlWriter); - - - if (this.localAction == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localAction); - - } - - xmlWriter.writeEndElement(); - } - if (this.localCallTransportCleanupTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "callTransportCleanup", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("callTransportCleanup cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCallTransportCleanup)); - } - - xmlWriter.writeEndElement(); - } - if (this.localExceptionToBeThrownOnSOAPFaultTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "exceptionToBeThrownOnSOAPFault", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("exceptionToBeThrownOnSOAPFault cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localExceptionToBeThrownOnSOAPFault)); - } - - xmlWriter.writeEndElement(); - } - if (this.localFaultToTracker) { - if (this.localFaultTo == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "faultTo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFaultTo.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "faultTo"), xmlWriter); - } - } - if (this.localFromTracker) { - if (this.localFrom == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "from", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFrom.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "from"), - xmlWriter); - } - } - if (this.localListenerTracker) { - if (this.localListener == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "listener", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localListener.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "listener"), xmlWriter); - } - } - if (this.localLogCorrelationIDStringTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "logCorrelationIDString", xmlWriter); - - - if (this.localLogCorrelationIDString == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localLogCorrelationIDString); - - } - - xmlWriter.writeEndElement(); - } - if (this.localManageSessionTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "manageSession", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("manageSession cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localManageSession)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMessageIdTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "messageId", xmlWriter); - - - if (this.localMessageId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localMessageId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localParentTracker) { - if (this.localParent == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "parent", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localParent.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "parent"), xmlWriter); - } - } - if (this.localPasswordTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "password", xmlWriter); - - - if (this.localPassword == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPassword); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPropertiesTracker) { - if (this.localProperties != null) { - namespace = "http://client.axis2.apache.org/xsd"; - for (final String localPropertie : this.localProperties) { - - if (localPropertie != null) { - - writeStartElement(null, namespace, "properties", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPropertie)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "properties", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://client.axis2.apache.org/xsd", "properties", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localRelatesToTracker) { - if (this.localRelatesTo == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "relatesTo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRelatesTo.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "relatesTo"), xmlWriter); - } - } - if (this.localRelationshipsTracker) { - if (this.localRelationships != null) { - for (final RelatesTo localRelationship : this.localRelationships) { - if (localRelationship != null) { - localRelationship.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "relationships"), xmlWriter); - } else { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "relationships", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "relationships", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - if (this.localReplyToTracker) { - if (this.localReplyTo == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "replyTo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localReplyTo.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "replyTo"), xmlWriter); - } - } - if (this.localSoapVersionURITracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "soapVersionURI", xmlWriter); - - - if (this.localSoapVersionURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSoapVersionURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localTimeOutInMilliSecondsTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "timeOutInMilliSeconds", xmlWriter); - - if (this.localTimeOutInMilliSeconds == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("timeOutInMilliSeconds cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTimeOutInMilliSeconds)); - } - - xmlWriter.writeEndElement(); - } - if (this.localToTracker) { - if (this.localTo == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "to", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTo.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "to"), - xmlWriter); - } - } - if (this.localTransportInTracker) { - if (this.localTransportIn == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "transportIn", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTransportIn.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "transportIn"), xmlWriter); - } - } - if (this.localTransportInProtocolTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "transportInProtocol", xmlWriter); - - - if (this.localTransportInProtocol == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localTransportInProtocol); - - } - - xmlWriter.writeEndElement(); - } - if (this.localTransportOutTracker) { - if (this.localTransportOut == null) { - - writeStartElement(null, "http://client.axis2.apache.org/xsd", "transportOut", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTransportOut.serialize(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "transportOut"), xmlWriter); - } - } - if (this.localUseSeparateListenerTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "useSeparateListener", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("useSeparateListener cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUseSeparateListener)); - } - - xmlWriter.writeEndElement(); - } - if (this.localUserNameTracker) { - namespace = "http://client.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "userName", xmlWriter); - - - if (this.localUserName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localUserName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://client.axis2.apache.org/xsd")) { - return "ns29"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localActionTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "action")); - - elementList.add(this.localAction == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAction)); - } - if (this.localCallTransportCleanupTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "callTransportCleanup")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCallTransportCleanup)); - } - if (this.localExceptionToBeThrownOnSOAPFaultTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "exceptionToBeThrownOnSOAPFault")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localExceptionToBeThrownOnSOAPFault)); - } - if (this.localFaultToTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "faultTo")); - - - elementList.add(this.localFaultTo == null ? null : this.localFaultTo); - } - if (this.localFromTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "from")); - - - elementList.add(this.localFrom == null ? null : this.localFrom); - } - if (this.localListenerTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "listener")); - - - elementList.add(this.localListener == null ? null : this.localListener); - } - if (this.localLogCorrelationIDStringTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "logCorrelationIDString")); - - elementList.add(this.localLogCorrelationIDString == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLogCorrelationIDString)); - } - if (this.localManageSessionTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "manageSession")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localManageSession)); - } - if (this.localMessageIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "messageId")); - - elementList.add(this.localMessageId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMessageId)); - } - if (this.localParentTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "parent")); - - - elementList.add(this.localParent == null ? null : this.localParent); - } - if (this.localPasswordTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "password")); - - elementList.add(this.localPassword == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPassword)); - } - if (this.localPropertiesTracker) { - if (this.localProperties != null) { - for (final String localPropertie : this.localProperties) { - - if (localPropertie != null) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "properties")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPropertie)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "properties")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "properties")); - elementList.add(null); - - } - - } - if (this.localRelatesToTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "relatesTo")); - - - elementList.add(this.localRelatesTo == null ? null : this.localRelatesTo); - } - if (this.localRelationshipsTracker) { - if (this.localRelationships != null) { - for (final RelatesTo localRelationship : this.localRelationships) { - - if (localRelationship != null) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "relationships")); - elementList.add(localRelationship); - } else { - - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "relationships")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "relationships")); - elementList.add(this.localRelationships); - - } - - } - if (this.localReplyToTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "replyTo")); - - - elementList.add(this.localReplyTo == null ? null : this.localReplyTo); - } - if (this.localSoapVersionURITracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "soapVersionURI")); - - elementList.add(this.localSoapVersionURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSoapVersionURI)); - } - if (this.localTimeOutInMilliSecondsTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "timeOutInMilliSeconds")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTimeOutInMilliSeconds)); - } - if (this.localToTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "to")); - - - elementList.add(this.localTo == null ? null : this.localTo); - } - if (this.localTransportInTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "transportIn")); - - - elementList.add(this.localTransportIn == null ? null : this.localTransportIn); - } - if (this.localTransportInProtocolTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "transportInProtocol")); - - elementList.add(this.localTransportInProtocol == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTransportInProtocol)); - } - if (this.localTransportOutTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "transportOut")); - - - elementList.add(this.localTransportOut == null ? null : this.localTransportOut); - } - if (this.localUseSeparateListenerTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "useSeparateListener")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUseSeparateListener)); - } - if (this.localUserNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", "userName")); - - elementList.add(this.localUserName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUserName)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Options parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Options object = new Options(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Options".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Options) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list12 = new java.util.ArrayList(); - - final java.util.ArrayList list14 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "action").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setAction(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "callTransportCleanup").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCallTransportCleanup(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://client.axis2.apache.org/xsd", - "exceptionToBeThrownOnSOAPFault").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setExceptionToBeThrownOnSOAPFault(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://client.axis2.apache.org/xsd", - "faultTo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFaultTo(null); - reader.next(); - - reader.next(); - - } else { - - object.setFaultTo(org.apache.axis2.addressing.xsd.EndpointReference.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://client.axis2.apache.org/xsd", - "from").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFrom(null); - reader.next(); - - reader.next(); - - } else { - - object.setFrom(org.apache.axis2.addressing.xsd.EndpointReference.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://client.axis2.apache.org/xsd", - "listener").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setListener(null); - reader.next(); - - reader.next(); - - } else { - - object.setListener(org.apache.axis2.transport.xsd.TransportListener.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://client.axis2.apache.org/xsd", - "logCorrelationIDString").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setLogCorrelationIDString(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "manageSession").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setManageSession(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://client.axis2.apache.org/xsd", - "messageId").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setMessageId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "parent").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setParent(null); - reader.next(); - - reader.next(); - - } else { - - object.setParent(org.apache.axis2.client.xsd.Options.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://client.axis2.apache.org/xsd", - "password").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPassword(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "properties").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list12.add(null); - - reader.next(); - } else { - list12.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone12 = false; - while (!loopDone12) { - // 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 - loopDone12 = true; - } else { - if (new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "properties").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list12.add(null); - - reader.next(); - } else { - list12.add(reader.getElementText()); - } - } else { - loopDone12 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setProperties((java.lang.String[]) list12.toArray(new java.lang.String[list12.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://client.axis2.apache.org/xsd", - "relatesTo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRelatesTo(null); - reader.next(); - - reader.next(); - - } else { - - object.setRelatesTo(org.apache.axis2.addressing.xsd.RelatesTo.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://client.axis2.apache.org/xsd", - "relationships").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list14.add(null); - reader.next(); - } else { - list14.add(org.apache.axis2.addressing.xsd.RelatesTo.Factory.parse(reader)); - } - // loop until we find a start element that is not part of this array - boolean loopDone14 = false; - while (!loopDone14) { - // 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 - loopDone14 = true; - } else { - if (new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "relationships").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list14.add(null); - reader.next(); - } else { - list14.add(org.apache.axis2.addressing.xsd.RelatesTo.Factory.parse(reader)); - } - } else { - loopDone14 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setRelationships((org.apache.axis2.addressing.xsd.RelatesTo[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.apache.axis2.addressing.xsd.RelatesTo.class, - list14)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "replyTo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setReplyTo(null); - reader.next(); - - reader.next(); - - } else { - - object.setReplyTo(org.apache.axis2.addressing.xsd.EndpointReference.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://client.axis2.apache.org/xsd", - "soapVersionURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSoapVersionURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "timeOutInMilliSeconds").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setTimeOutInMilliSeconds(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setTimeOutInMilliSeconds(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "to").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTo(null); - reader.next(); - - reader.next(); - - } else { - - object.setTo(org.apache.axis2.addressing.xsd.EndpointReference.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://client.axis2.apache.org/xsd", - "transportIn").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTransportIn(null); - reader.next(); - - reader.next(); - - } else { - - object.setTransportIn(org.apache.axis2.description.xsd.TransportInDescription.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://client.axis2.apache.org/xsd", - "transportInProtocol").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setTransportInProtocol(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://client.axis2.apache.org/xsd", - "transportOut").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTransportOut(null); - reader.next(); - - reader.next(); - - } else { - - object.setTransportOut(org.apache.axis2.description.xsd.TransportOutDescription.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://client.axis2.apache.org/xsd", - "useSeparateListener").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setUseSeparateListener(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://client.axis2.apache.org/xsd", - "userName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setUserName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/management/xsd/NodeManager.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/management/xsd/NodeManager.java deleted file mode 100644 index ed6e7e100..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/management/xsd/NodeManager.java +++ /dev/null @@ -1,463 +0,0 @@ - -/** - * NodeManager.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.clustering.management.xsd; - - -/** - * NodeManager bean class - */ - -public abstract class NodeManager implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = NodeManager Namespace URI = - * http://management.clustering.axis2.apache.org/xsd Namespace Prefix = ns11 - */ - - - /** - * - */ - private static final long serialVersionUID = 3966966973286939094L; - - /** - * field for ConfigurationContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localConfigurationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConfigurationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getConfigurationContext() { - return this.localConfigurationContext; - } - - - - /** - * Auto generated setter method - * - * @param param ConfigurationContext - */ - public void setConfigurationContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localConfigurationContextTracker = true; - - this.localConfigurationContext = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://management.clustering.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":NodeManager", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "NodeManager", xmlWriter); - } - - - } - if (this.localConfigurationContextTracker) { - if (this.localConfigurationContext == null) { - - writeStartElement(null, "http://management.clustering.axis2.apache.org/xsd", "configurationContext", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConfigurationContext.serialize(new javax.xml.namespace.QName( - "http://management.clustering.axis2.apache.org/xsd", "configurationContext"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://management.clustering.axis2.apache.org/xsd")) { - return "ns11"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localConfigurationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://management.clustering.axis2.apache.org/xsd", - "configurationContext")); - - - elementList.add(this.localConfigurationContext == null ? null : this.localConfigurationContext); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static NodeManager parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final NodeManager object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"NodeManager".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (NodeManager) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://management.clustering.axis2.apache.org/xsd", - "configurationContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConfigurationContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setConfigurationContext(org.apache.axis2.context.xsd.ConfigurationContext.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/state/xsd/StateManager.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/state/xsd/StateManager.java deleted file mode 100644 index f589cf014..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/state/xsd/StateManager.java +++ /dev/null @@ -1,551 +0,0 @@ - -/** - * StateManager.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.clustering.state.xsd; - - -/** - * StateManager bean class - */ - -public abstract class StateManager implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = StateManager Namespace URI = - * http://state.clustering.axis2.apache.org/xsd Namespace Prefix = ns12 - */ - - - /** - * - */ - private static final long serialVersionUID = 6996746525145150706L; - - /** - * field for ConfigurationContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localConfigurationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConfigurationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getConfigurationContext() { - return this.localConfigurationContext; - } - - - - /** - * Auto generated setter method - * - * @param param ConfigurationContext - */ - public void setConfigurationContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localConfigurationContextTracker = true; - - this.localConfigurationContext = param; - - - } - - - /** - * field for ReplicationExcludePatterns - */ - - - protected authclient.java.util.xsd.Map localReplicationExcludePatterns; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localReplicationExcludePatternsTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getReplicationExcludePatterns() { - return this.localReplicationExcludePatterns; - } - - - - /** - * Auto generated setter method - * - * @param param ReplicationExcludePatterns - */ - public void setReplicationExcludePatterns(final authclient.java.util.xsd.Map param) { - this.localReplicationExcludePatternsTracker = true; - - this.localReplicationExcludePatterns = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://state.clustering.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":StateManager", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "StateManager", xmlWriter); - } - - - } - if (this.localConfigurationContextTracker) { - if (this.localConfigurationContext == null) { - - writeStartElement(null, "http://state.clustering.axis2.apache.org/xsd", "configurationContext", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConfigurationContext.serialize(new javax.xml.namespace.QName( - "http://state.clustering.axis2.apache.org/xsd", "configurationContext"), xmlWriter); - } - } - if (this.localReplicationExcludePatternsTracker) { - if (this.localReplicationExcludePatterns == null) { - - writeStartElement(null, "http://state.clustering.axis2.apache.org/xsd", "replicationExcludePatterns", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localReplicationExcludePatterns.serialize(new javax.xml.namespace.QName( - "http://state.clustering.axis2.apache.org/xsd", "replicationExcludePatterns"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://state.clustering.axis2.apache.org/xsd")) { - return "ns12"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localConfigurationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://state.clustering.axis2.apache.org/xsd", - "configurationContext")); - - - elementList.add(this.localConfigurationContext == null ? null : this.localConfigurationContext); - } - if (this.localReplicationExcludePatternsTracker) { - elementList.add(new javax.xml.namespace.QName("http://state.clustering.axis2.apache.org/xsd", - "replicationExcludePatterns")); - - - elementList.add(this.localReplicationExcludePatterns == null ? null : this.localReplicationExcludePatterns); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static StateManager parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final StateManager object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"StateManager".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (StateManager) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://state.clustering.axis2.apache.org/xsd", - "configurationContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConfigurationContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setConfigurationContext(org.apache.axis2.context.xsd.ConfigurationContext.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://state.clustering.axis2.apache.org/xsd", - "replicationExcludePatterns").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setReplicationExcludePatterns(null); - reader.next(); - - reader.next(); - - } else { - - object.setReplicationExcludePatterns(authclient.java.util.xsd.Map.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/xsd/ClusteringAgent.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/xsd/ClusteringAgent.java deleted file mode 100644 index 00dc14ae0..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/clustering/xsd/ClusteringAgent.java +++ /dev/null @@ -1,805 +0,0 @@ - -/** - * ClusteringAgent.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.clustering.xsd; - - -/** - * ClusteringAgent bean class - */ - -public abstract class ClusteringAgent implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ClusteringAgent Namespace URI = - * http://clustering.axis2.apache.org/xsd Namespace Prefix = ns13 - */ - - - /** - * - */ - private static final long serialVersionUID = 1725647734393256682L; - - /** - * field for ConfigurationContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localConfigurationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConfigurationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getConfigurationContext() { - return this.localConfigurationContext; - } - - - - /** - * Auto generated setter method - * - * @param param ConfigurationContext - */ - public void setConfigurationContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localConfigurationContextTracker = true; - - this.localConfigurationContext = param; - - - } - - - /** - * field for Domains - */ - - - protected authclient.java.util.xsd.Set localDomains; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDomainsTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Set - */ - public authclient.java.util.xsd.Set getDomains() { - return this.localDomains; - } - - - - /** - * Auto generated setter method - * - * @param param Domains - */ - public void setDomains(final authclient.java.util.xsd.Set param) { - this.localDomainsTracker = true; - - this.localDomains = param; - - - } - - - /** - * field for Members - */ - - - protected java.lang.Object localMembers; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMembersTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getMembers() { - return this.localMembers; - } - - - - /** - * Auto generated setter method - * - * @param param Members - */ - public void setMembers(final java.lang.Object param) { - this.localMembersTracker = true; - - this.localMembers = param; - - - } - - - /** - * field for NodeManager - */ - - - protected org.apache.axis2.clustering.management.xsd.NodeManager localNodeManager; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNodeManagerTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.clustering.management.xsd.NodeManager - */ - public org.apache.axis2.clustering.management.xsd.NodeManager getNodeManager() { - return this.localNodeManager; - } - - - - /** - * Auto generated setter method - * - * @param param NodeManager - */ - public void setNodeManager(final org.apache.axis2.clustering.management.xsd.NodeManager param) { - this.localNodeManagerTracker = true; - - this.localNodeManager = param; - - - } - - - /** - * field for StateManager - */ - - - protected org.apache.axis2.clustering.state.xsd.StateManager localStateManager; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localStateManagerTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.clustering.state.xsd.StateManager - */ - public org.apache.axis2.clustering.state.xsd.StateManager getStateManager() { - return this.localStateManager; - } - - - - /** - * Auto generated setter method - * - * @param param StateManager - */ - public void setStateManager(final org.apache.axis2.clustering.state.xsd.StateManager param) { - this.localStateManagerTracker = true; - - this.localStateManager = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://clustering.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ClusteringAgent", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ClusteringAgent", - xmlWriter); - } - - - } - if (this.localConfigurationContextTracker) { - if (this.localConfigurationContext == null) { - - writeStartElement(null, "http://clustering.axis2.apache.org/xsd", "configurationContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConfigurationContext.serialize(new javax.xml.namespace.QName( - "http://clustering.axis2.apache.org/xsd", "configurationContext"), xmlWriter); - } - } - if (this.localDomainsTracker) { - if (this.localDomains == null) { - - writeStartElement(null, "http://clustering.axis2.apache.org/xsd", "domains", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localDomains.serialize(new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", - "domains"), xmlWriter); - } - } - if (this.localMembersTracker) { - - if (this.localMembers != null) { - if (this.localMembers instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localMembers).serialize(new javax.xml.namespace.QName( - "http://clustering.axis2.apache.org/xsd", "members"), xmlWriter, true); - } else { - writeStartElement(null, "http://clustering.axis2.apache.org/xsd", "members", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localMembers, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://clustering.axis2.apache.org/xsd", "members", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localNodeManagerTracker) { - if (this.localNodeManager == null) { - - writeStartElement(null, "http://clustering.axis2.apache.org/xsd", "nodeManager", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localNodeManager.serialize(new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", - "nodeManager"), xmlWriter); - } - } - if (this.localStateManagerTracker) { - if (this.localStateManager == null) { - - writeStartElement(null, "http://clustering.axis2.apache.org/xsd", "stateManager", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localStateManager.serialize(new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", - "stateManager"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://clustering.axis2.apache.org/xsd")) { - return "ns13"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localConfigurationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", - "configurationContext")); - - - elementList.add(this.localConfigurationContext == null ? null : this.localConfigurationContext); - } - if (this.localDomainsTracker) { - elementList.add(new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", "domains")); - - - elementList.add(this.localDomains == null ? null : this.localDomains); - } - if (this.localMembersTracker) { - elementList.add(new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", "members")); - - - elementList.add(this.localMembers == null ? null : this.localMembers); - } - if (this.localNodeManagerTracker) { - elementList.add(new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", "nodeManager")); - - - elementList.add(this.localNodeManager == null ? null : this.localNodeManager); - } - if (this.localStateManagerTracker) { - elementList.add(new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", "stateManager")); - - - elementList.add(this.localStateManager == null ? null : this.localStateManager); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ClusteringAgent parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ClusteringAgent object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ClusteringAgent".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ClusteringAgent) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", - "configurationContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConfigurationContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setConfigurationContext(org.apache.axis2.context.xsd.ConfigurationContext.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://clustering.axis2.apache.org/xsd", - "domains").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setDomains(null); - reader.next(); - - reader.next(); - - } else { - - object.setDomains(authclient.java.util.xsd.Set.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://clustering.axis2.apache.org/xsd", - "members").equals(reader.getName())) { - - object.setMembers(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://clustering.axis2.apache.org/xsd", - "nodeManager").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setNodeManager(null); - reader.next(); - - reader.next(); - - } else { - - object.setNodeManager(org.apache.axis2.clustering.management.xsd.NodeManager.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://clustering.axis2.apache.org/xsd", - "stateManager").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setStateManager(null); - reader.next(); - - reader.next(); - - } else { - - object.setStateManager(org.apache.axis2.clustering.state.xsd.StateManager.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ConfigurationContext.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ConfigurationContext.java deleted file mode 100644 index 02cc31786..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ConfigurationContext.java +++ /dev/null @@ -1,1618 +0,0 @@ - -/** - * ConfigurationContext.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.context.xsd; - - -/** - * ConfigurationContext bean class - */ - -public class ConfigurationContext implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ConfigurationContext Namespace - * URI = http://context.axis2.apache.org/xsd Namespace Prefix = ns10 - */ - - - /** - * - */ - private static final long serialVersionUID = 4407325029690339128L; - - /** - * field for AnyOperationContextRegistered - */ - - - protected boolean localAnyOperationContextRegistered; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAnyOperationContextRegisteredTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getAnyOperationContextRegistered() { - return this.localAnyOperationContextRegistered; - } - - - - /** - * Auto generated setter method - * - * @param param AnyOperationContextRegistered - */ - public void setAnyOperationContextRegistered(final boolean param) { - - // setting primitive attribute tracker to true - this.localAnyOperationContextRegisteredTracker = true; - - this.localAnyOperationContextRegistered = param; - - - } - - - /** - * field for AxisConfiguration - */ - - - protected org.apache.axis2.engine.xsd.AxisConfiguration localAxisConfiguration; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisConfigurationTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.AxisConfiguration - */ - public org.apache.axis2.engine.xsd.AxisConfiguration getAxisConfiguration() { - return this.localAxisConfiguration; - } - - - - /** - * Auto generated setter method - * - * @param param AxisConfiguration - */ - public void setAxisConfiguration(final org.apache.axis2.engine.xsd.AxisConfiguration param) { - this.localAxisConfigurationTracker = true; - - this.localAxisConfiguration = param; - - - } - - - /** - * field for ContextRoot - */ - - - protected java.lang.String localContextRoot; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localContextRootTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getContextRoot() { - return this.localContextRoot; - } - - - - /** - * Auto generated setter method - * - * @param param ContextRoot - */ - public void setContextRoot(final java.lang.String param) { - this.localContextRootTracker = true; - - this.localContextRoot = param; - - - } - - - /** - * field for ListenerManager - */ - - - protected org.apache.axis2.engine.xsd.ListenerManager localListenerManager; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localListenerManagerTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.ListenerManager - */ - public org.apache.axis2.engine.xsd.ListenerManager getListenerManager() { - return this.localListenerManager; - } - - - - /** - * Auto generated setter method - * - * @param param ListenerManager - */ - public void setListenerManager(final org.apache.axis2.engine.xsd.ListenerManager param) { - this.localListenerManagerTracker = true; - - this.localListenerManager = param; - - - } - - - /** - * field for RootContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localRootContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRootContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getRootContext() { - return this.localRootContext; - } - - - - /** - * Auto generated setter method - * - * @param param RootContext - */ - public void setRootContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localRootContextTracker = true; - - this.localRootContext = param; - - - } - - - /** - * field for ServiceContextPath - */ - - - protected java.lang.String localServiceContextPath; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceContextPathTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getServiceContextPath() { - return this.localServiceContextPath; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceContextPath - */ - public void setServiceContextPath(final java.lang.String param) { - this.localServiceContextPathTracker = true; - - this.localServiceContextPath = param; - - - } - - - /** - * field for ServiceGroupContextIDs This was an Array! - */ - - - protected java.lang.String[] localServiceGroupContextIDs; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupContextIDsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getServiceGroupContextIDs() { - return this.localServiceGroupContextIDs; - } - - - - /** - * validate the array for ServiceGroupContextIDs - */ - protected void validateServiceGroupContextIDs(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ServiceGroupContextIDs - */ - public void setServiceGroupContextIDs(final java.lang.String[] param) { - - validateServiceGroupContextIDs(param); - - this.localServiceGroupContextIDsTracker = true; - - this.localServiceGroupContextIDs = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addServiceGroupContextIDs(final java.lang.String param) { - if (this.localServiceGroupContextIDs == null) { - this.localServiceGroupContextIDs = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localServiceGroupContextIDsTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localServiceGroupContextIDs); - list.add(param); - this.localServiceGroupContextIDs = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for ServiceGroupContextTimeoutInterval - */ - - - protected long localServiceGroupContextTimeoutInterval; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupContextTimeoutIntervalTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getServiceGroupContextTimeoutInterval() { - return this.localServiceGroupContextTimeoutInterval; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupContextTimeoutInterval - */ - public void setServiceGroupContextTimeoutInterval(final long param) { - - // setting primitive attribute tracker to true - this.localServiceGroupContextTimeoutIntervalTracker = param != java.lang.Long.MIN_VALUE; - - this.localServiceGroupContextTimeoutInterval = param; - - - } - - - /** - * field for ServiceGroupContextTimoutInterval - */ - - - protected long localServiceGroupContextTimoutInterval; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupContextTimoutIntervalTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getServiceGroupContextTimoutInterval() { - return this.localServiceGroupContextTimoutInterval; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupContextTimoutInterval - */ - public void setServiceGroupContextTimoutInterval(final long param) { - - // setting primitive attribute tracker to true - this.localServiceGroupContextTimoutIntervalTracker = param != java.lang.Long.MIN_VALUE; - - this.localServiceGroupContextTimoutInterval = param; - - - } - - - /** - * field for ServiceGroupContexts - */ - - - protected java.lang.Object localServiceGroupContexts; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupContextsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getServiceGroupContexts() { - return this.localServiceGroupContexts; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupContexts - */ - public void setServiceGroupContexts(final java.lang.Object param) { - this.localServiceGroupContextsTracker = true; - - this.localServiceGroupContexts = param; - - - } - - - /** - * field for ServicePath - */ - - - protected java.lang.String localServicePath; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServicePathTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getServicePath() { - return this.localServicePath; - } - - - - /** - * Auto generated setter method - * - * @param param ServicePath - */ - public void setServicePath(final java.lang.String param) { - this.localServicePathTracker = true; - - this.localServicePath = param; - - - } - - - /** - * field for ThreadPool - */ - - - protected org.apache.axis2.util.threadpool.xsd.ThreadFactory localThreadPool; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localThreadPoolTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.util.threadpool.xsd.ThreadFactory - */ - public org.apache.axis2.util.threadpool.xsd.ThreadFactory getThreadPool() { - return this.localThreadPool; - } - - - - /** - * Auto generated setter method - * - * @param param ThreadPool - */ - public void setThreadPool(final org.apache.axis2.util.threadpool.xsd.ThreadFactory param) { - this.localThreadPoolTracker = true; - - this.localThreadPool = param; - - - } - - - /** - * field for TransportManager - */ - - - protected org.apache.axis2.engine.xsd.ListenerManager localTransportManager; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransportManagerTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.ListenerManager - */ - public org.apache.axis2.engine.xsd.ListenerManager getTransportManager() { - return this.localTransportManager; - } - - - - /** - * Auto generated setter method - * - * @param param TransportManager - */ - public void setTransportManager(final org.apache.axis2.engine.xsd.ListenerManager param) { - this.localTransportManagerTracker = true; - - this.localTransportManager = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://context.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ConfigurationContext", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ConfigurationContext", - xmlWriter); - } - - - } - if (this.localAnyOperationContextRegisteredTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "anyOperationContextRegistered", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("anyOperationContextRegistered cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAnyOperationContextRegistered)); - } - - xmlWriter.writeEndElement(); - } - if (this.localAxisConfigurationTracker) { - if (this.localAxisConfiguration == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "axisConfiguration", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisConfiguration.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "axisConfiguration"), xmlWriter); - } - } - if (this.localContextRootTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "contextRoot", xmlWriter); - - - if (this.localContextRoot == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localContextRoot); - - } - - xmlWriter.writeEndElement(); - } - if (this.localListenerManagerTracker) { - if (this.localListenerManager == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "listenerManager", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localListenerManager.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "listenerManager"), xmlWriter); - } - } - if (this.localRootContextTracker) { - if (this.localRootContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "rootContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRootContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext"), xmlWriter); - } - } - if (this.localServiceContextPathTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceContextPath", xmlWriter); - - - if (this.localServiceContextPath == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localServiceContextPath); - - } - - xmlWriter.writeEndElement(); - } - if (this.localServiceGroupContextIDsTracker) { - if (this.localServiceGroupContextIDs != null) { - namespace = "http://context.axis2.apache.org/xsd"; - for (final String localServiceGroupContextID : this.localServiceGroupContextIDs) { - - if (localServiceGroupContextID != null) { - - writeStartElement(null, namespace, "serviceGroupContextIDs", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localServiceGroupContextID)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceGroupContextIDs", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceGroupContextIDs", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localServiceGroupContextTimeoutIntervalTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceGroupContextTimeoutInterval", xmlWriter); - - if (this.localServiceGroupContextTimeoutInterval == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException( - "serviceGroupContextTimeoutInterval cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceGroupContextTimeoutInterval)); - } - - xmlWriter.writeEndElement(); - } - if (this.localServiceGroupContextTimoutIntervalTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceGroupContextTimoutInterval", xmlWriter); - - if (this.localServiceGroupContextTimoutInterval == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException( - "serviceGroupContextTimoutInterval cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceGroupContextTimoutInterval)); - } - - xmlWriter.writeEndElement(); - } - if (this.localServiceGroupContextsTracker) { - - if (this.localServiceGroupContexts != null) { - if (this.localServiceGroupContexts instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localServiceGroupContexts).serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "serviceGroupContexts"), xmlWriter, true); - } else { - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceGroupContexts", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localServiceGroupContexts, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceGroupContexts", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localServicePathTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "servicePath", xmlWriter); - - - if (this.localServicePath == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localServicePath); - - } - - xmlWriter.writeEndElement(); - } - if (this.localThreadPoolTracker) { - if (this.localThreadPool == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "threadPool", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localThreadPool.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "threadPool"), xmlWriter); - } - } - if (this.localTransportManagerTracker) { - if (this.localTransportManager == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "transportManager", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTransportManager.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "transportManager"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://context.axis2.apache.org/xsd")) { - return "ns10"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAnyOperationContextRegisteredTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "anyOperationContextRegistered")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAnyOperationContextRegistered)); - } - if (this.localAxisConfigurationTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "axisConfiguration")); - - - elementList.add(this.localAxisConfiguration == null ? null : this.localAxisConfiguration); - } - if (this.localContextRootTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "contextRoot")); - - elementList.add(this.localContextRoot == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localContextRoot)); - } - if (this.localListenerManagerTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "listenerManager")); - - - elementList.add(this.localListenerManager == null ? null : this.localListenerManager); - } - if (this.localRootContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "rootContext")); - - - elementList.add(this.localRootContext == null ? null : this.localRootContext); - } - if (this.localServiceContextPathTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "serviceContextPath")); - - elementList.add(this.localServiceContextPath == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceContextPath)); - } - if (this.localServiceGroupContextIDsTracker) { - if (this.localServiceGroupContextIDs != null) { - for (final String localServiceGroupContextID : this.localServiceGroupContextIDs) { - - if (localServiceGroupContextID != null) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextIDs")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localServiceGroupContextID)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextIDs")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextIDs")); - elementList.add(null); - - } - - } - if (this.localServiceGroupContextTimeoutIntervalTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextTimeoutInterval")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceGroupContextTimeoutInterval)); - } - if (this.localServiceGroupContextTimoutIntervalTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextTimoutInterval")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceGroupContextTimoutInterval)); - } - if (this.localServiceGroupContextsTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContexts")); - - - elementList.add(this.localServiceGroupContexts == null ? null : this.localServiceGroupContexts); - } - if (this.localServicePathTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "servicePath")); - - elementList.add(this.localServicePath == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServicePath)); - } - if (this.localThreadPoolTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "threadPool")); - - - elementList.add(this.localThreadPool == null ? null : this.localThreadPool); - } - if (this.localTransportManagerTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "transportManager")); - - - elementList.add(this.localTransportManager == null ? null : this.localTransportManager); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ConfigurationContext parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ConfigurationContext object = new ConfigurationContext(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ConfigurationContext".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ConfigurationContext) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list7 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "anyOperationContextRegistered").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setAnyOperationContextRegistered(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://context.axis2.apache.org/xsd", - "axisConfiguration").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisConfiguration(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisConfiguration(org.apache.axis2.engine.xsd.AxisConfiguration.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://context.axis2.apache.org/xsd", - "contextRoot").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setContextRoot(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "listenerManager").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setListenerManager(null); - reader.next(); - - reader.next(); - - } else { - - object.setListenerManager(org.apache.axis2.engine.xsd.ListenerManager.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://context.axis2.apache.org/xsd", - "rootContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRootContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setRootContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "serviceContextPath").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceContextPath(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextIDs").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - - reader.next(); - } else { - list7.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone7 = false; - while (!loopDone7) { - // 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 - loopDone7 = true; - } else { - if (new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextIDs").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - - reader.next(); - } else { - list7.add(reader.getElementText()); - } - } else { - loopDone7 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setServiceGroupContextIDs((java.lang.String[]) list7.toArray(new java.lang.String[list7.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://context.axis2.apache.org/xsd", - "serviceGroupContextTimeoutInterval").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceGroupContextTimeoutInterval(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setServiceGroupContextTimeoutInterval(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextTimoutInterval").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceGroupContextTimoutInterval(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setServiceGroupContextTimoutInterval(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContexts").equals(reader.getName())) { - - object.setServiceGroupContexts(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "servicePath").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setServicePath(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "threadPool").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setThreadPool(null); - reader.next(); - - reader.next(); - - } else { - - object.setThreadPool(org.apache.axis2.util.threadpool.xsd.ThreadFactory.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://context.axis2.apache.org/xsd", - "transportManager").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTransportManager(null); - reader.next(); - - reader.next(); - - } else { - - object.setTransportManager(org.apache.axis2.engine.xsd.ListenerManager.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/MessageContext.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/MessageContext.java deleted file mode 100644 index c7421b482..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/MessageContext.java +++ /dev/null @@ -1,5170 +0,0 @@ - -/** - * MessageContext.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.context.xsd; - -import org.apache.axis2.addressing.xsd.RelatesTo; - -/** - * MessageContext bean class - */ - -public class MessageContext implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = MessageContext Namespace URI = - * http://context.axis2.apache.org/xsd Namespace Prefix = ns10 - */ - - - /** - * - */ - private static final long serialVersionUID = 8509954566845595027L; - - /** - * field for FLOW - */ - - - protected int localFLOW; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFLOWTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getFLOW() { - return this.localFLOW; - } - - - - /** - * Auto generated setter method - * - * @param param FLOW - */ - public void setFLOW(final int param) { - - // setting primitive attribute tracker to true - this.localFLOWTracker = param != java.lang.Integer.MIN_VALUE; - - this.localFLOW = param; - - - } - - - /** - * field for SOAP11 - */ - - - protected boolean localSOAP11; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSOAP11Tracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getSOAP11() { - return this.localSOAP11; - } - - - - /** - * Auto generated setter method - * - * @param param SOAP11 - */ - public void setSOAP11(final boolean param) { - - // setting primitive attribute tracker to true - this.localSOAP11Tracker = true; - - this.localSOAP11 = param; - - - } - - - /** - * field for WSAAction - */ - - - protected java.lang.String localWSAAction; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localWSAActionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getWSAAction() { - return this.localWSAAction; - } - - - - /** - * Auto generated setter method - * - * @param param WSAAction - */ - public void setWSAAction(final java.lang.String param) { - this.localWSAActionTracker = true; - - this.localWSAAction = param; - - - } - - - /** - * field for WSAMessageId - */ - - - protected java.lang.String localWSAMessageId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localWSAMessageIdTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getWSAMessageId() { - return this.localWSAMessageId; - } - - - - /** - * Auto generated setter method - * - * @param param WSAMessageId - */ - public void setWSAMessageId(final java.lang.String param) { - this.localWSAMessageIdTracker = true; - - this.localWSAMessageId = param; - - - } - - - /** - * field for AttachmentMap - */ - - - protected org.apache.axiom.attachments.xsd.Attachments localAttachmentMap; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAttachmentMapTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.attachments.xsd.Attachments - */ - public org.apache.axiom.attachments.xsd.Attachments getAttachmentMap() { - return this.localAttachmentMap; - } - - - - /** - * Auto generated setter method - * - * @param param AttachmentMap - */ - public void setAttachmentMap(final org.apache.axiom.attachments.xsd.Attachments param) { - this.localAttachmentMapTracker = true; - - this.localAttachmentMap = param; - - - } - - - /** - * field for AxisMessage - */ - - - protected org.apache.axis2.description.xsd.AxisMessage localAxisMessage; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisMessageTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisMessage - */ - public org.apache.axis2.description.xsd.AxisMessage getAxisMessage() { - return this.localAxisMessage; - } - - - - /** - * Auto generated setter method - * - * @param param AxisMessage - */ - public void setAxisMessage(final org.apache.axis2.description.xsd.AxisMessage param) { - this.localAxisMessageTracker = true; - - this.localAxisMessage = param; - - - } - - - /** - * field for AxisOperation - */ - - - protected org.apache.axis2.description.xsd.AxisOperation localAxisOperation; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisOperationTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisOperation - */ - public org.apache.axis2.description.xsd.AxisOperation getAxisOperation() { - return this.localAxisOperation; - } - - - - /** - * Auto generated setter method - * - * @param param AxisOperation - */ - public void setAxisOperation(final org.apache.axis2.description.xsd.AxisOperation param) { - this.localAxisOperationTracker = true; - - this.localAxisOperation = param; - - - } - - - /** - * field for AxisService - */ - - - protected org.apache.axis2.description.xsd.AxisService localAxisService; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisServiceTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisService - */ - public org.apache.axis2.description.xsd.AxisService getAxisService() { - return this.localAxisService; - } - - - - /** - * Auto generated setter method - * - * @param param AxisService - */ - public void setAxisService(final org.apache.axis2.description.xsd.AxisService param) { - this.localAxisServiceTracker = true; - - this.localAxisService = param; - - - } - - - /** - * field for AxisServiceGroup - */ - - - protected org.apache.axis2.description.xsd.AxisServiceGroup localAxisServiceGroup; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisServiceGroupTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisServiceGroup - */ - public org.apache.axis2.description.xsd.AxisServiceGroup getAxisServiceGroup() { - return this.localAxisServiceGroup; - } - - - - /** - * Auto generated setter method - * - * @param param AxisServiceGroup - */ - public void setAxisServiceGroup(final org.apache.axis2.description.xsd.AxisServiceGroup param) { - this.localAxisServiceGroupTracker = true; - - this.localAxisServiceGroup = param; - - - } - - - /** - * field for ConfigurationContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localConfigurationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConfigurationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getConfigurationContext() { - return this.localConfigurationContext; - } - - - - /** - * Auto generated setter method - * - * @param param ConfigurationContext - */ - public void setConfigurationContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localConfigurationContextTracker = true; - - this.localConfigurationContext = param; - - - } - - - /** - * field for CurrentHandlerIndex - */ - - - protected int localCurrentHandlerIndex; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCurrentHandlerIndexTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getCurrentHandlerIndex() { - return this.localCurrentHandlerIndex; - } - - - - /** - * Auto generated setter method - * - * @param param CurrentHandlerIndex - */ - public void setCurrentHandlerIndex(final int param) { - - // setting primitive attribute tracker to true - this.localCurrentHandlerIndexTracker = param != java.lang.Integer.MIN_VALUE; - - this.localCurrentHandlerIndex = param; - - - } - - - /** - * field for CurrentPhaseIndex - */ - - - protected int localCurrentPhaseIndex; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCurrentPhaseIndexTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getCurrentPhaseIndex() { - return this.localCurrentPhaseIndex; - } - - - - /** - * Auto generated setter method - * - * @param param CurrentPhaseIndex - */ - public void setCurrentPhaseIndex(final int param) { - - // setting primitive attribute tracker to true - this.localCurrentPhaseIndexTracker = param != java.lang.Integer.MIN_VALUE; - - this.localCurrentPhaseIndex = param; - - - } - - - /** - * field for DoingMTOM - */ - - - protected boolean localDoingMTOM; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDoingMTOMTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getDoingMTOM() { - return this.localDoingMTOM; - } - - - - /** - * Auto generated setter method - * - * @param param DoingMTOM - */ - public void setDoingMTOM(final boolean param) { - - // setting primitive attribute tracker to true - this.localDoingMTOMTracker = true; - - this.localDoingMTOM = param; - - - } - - - /** - * field for DoingREST - */ - - - protected boolean localDoingREST; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDoingRESTTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getDoingREST() { - return this.localDoingREST; - } - - - - /** - * Auto generated setter method - * - * @param param DoingREST - */ - public void setDoingREST(final boolean param) { - - // setting primitive attribute tracker to true - this.localDoingRESTTracker = true; - - this.localDoingREST = param; - - - } - - - /** - * field for DoingSwA - */ - - - protected boolean localDoingSwA; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDoingSwATracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getDoingSwA() { - return this.localDoingSwA; - } - - - - /** - * Auto generated setter method - * - * @param param DoingSwA - */ - public void setDoingSwA(final boolean param) { - - // setting primitive attribute tracker to true - this.localDoingSwATracker = true; - - this.localDoingSwA = param; - - - } - - - /** - * field for EffectivePolicy - */ - - - protected org.apache.neethi.xsd.Policy localEffectivePolicy; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEffectivePolicyTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.neethi.xsd.Policy - */ - public org.apache.neethi.xsd.Policy getEffectivePolicy() { - return this.localEffectivePolicy; - } - - - - /** - * Auto generated setter method - * - * @param param EffectivePolicy - */ - public void setEffectivePolicy(final org.apache.neethi.xsd.Policy param) { - this.localEffectivePolicyTracker = true; - - this.localEffectivePolicy = param; - - - } - - - /** - * field for Envelope - */ - - - protected org.apache.axiom.soap.xsd.SOAPEnvelope localEnvelope; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEnvelopeTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.soap.xsd.SOAPEnvelope - */ - public org.apache.axiom.soap.xsd.SOAPEnvelope getEnvelope() { - return this.localEnvelope; - } - - - - /** - * Auto generated setter method - * - * @param param Envelope - */ - public void setEnvelope(final org.apache.axiom.soap.xsd.SOAPEnvelope param) { - this.localEnvelopeTracker = true; - - this.localEnvelope = param; - - - } - - - /** - * field for ExecutedPhases - */ - - - protected authclient.java.util.xsd.Iterator localExecutedPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExecutedPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getExecutedPhases() { - return this.localExecutedPhases; - } - - - - /** - * Auto generated setter method - * - * @param param ExecutedPhases - */ - public void setExecutedPhases(final authclient.java.util.xsd.Iterator param) { - this.localExecutedPhasesTracker = true; - - this.localExecutedPhases = param; - - - } - - - /** - * field for ExecutedPhasesExplicit - */ - - - protected authclient.java.util.xsd.LinkedList localExecutedPhasesExplicit; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExecutedPhasesExplicitTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.LinkedList - */ - public authclient.java.util.xsd.LinkedList getExecutedPhasesExplicit() { - return this.localExecutedPhasesExplicit; - } - - - - /** - * Auto generated setter method - * - * @param param ExecutedPhasesExplicit - */ - public void setExecutedPhasesExplicit(final authclient.java.util.xsd.LinkedList param) { - this.localExecutedPhasesExplicitTracker = true; - - this.localExecutedPhasesExplicit = param; - - - } - - - /** - * field for ExecutionChain - */ - - - protected java.lang.Object localExecutionChain; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExecutionChainTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getExecutionChain() { - return this.localExecutionChain; - } - - - - /** - * Auto generated setter method - * - * @param param ExecutionChain - */ - public void setExecutionChain(final java.lang.Object param) { - this.localExecutionChainTracker = true; - - this.localExecutionChain = param; - - - } - - - /** - * field for FailureReason - */ - - - protected org.apache.axiom.om.OMElement localFailureReason; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFailureReasonTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getFailureReason() { - return this.localFailureReason; - } - - - - /** - * Auto generated setter method - * - * @param param FailureReason - */ - public void setFailureReason(final org.apache.axiom.om.OMElement param) { - this.localFailureReasonTracker = true; - - this.localFailureReason = param; - - - } - - - /** - * field for Fault - */ - - - protected boolean localFault; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getFault() { - return this.localFault; - } - - - - /** - * Auto generated setter method - * - * @param param Fault - */ - public void setFault(final boolean param) { - - // setting primitive attribute tracker to true - this.localFaultTracker = true; - - this.localFault = param; - - - } - - - /** - * field for FaultTo - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localFaultTo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultToTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getFaultTo() { - return this.localFaultTo; - } - - - - /** - * Auto generated setter method - * - * @param param FaultTo - */ - public void setFaultTo(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localFaultToTracker = true; - - this.localFaultTo = param; - - - } - - - /** - * field for From - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localFrom; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFromTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getFrom() { - return this.localFrom; - } - - - - /** - * Auto generated setter method - * - * @param param From - */ - public void setFrom(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localFromTracker = true; - - this.localFrom = param; - - - } - - - /** - * field for HeaderPresent - */ - - - protected boolean localHeaderPresent; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHeaderPresentTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getHeaderPresent() { - return this.localHeaderPresent; - } - - - - /** - * Auto generated setter method - * - * @param param HeaderPresent - */ - public void setHeaderPresent(final boolean param) { - - // setting primitive attribute tracker to true - this.localHeaderPresentTracker = true; - - this.localHeaderPresent = param; - - - } - - - /** - * field for InboundContentLength - */ - - - protected long localInboundContentLength; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInboundContentLengthTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getInboundContentLength() { - return this.localInboundContentLength; - } - - - - /** - * Auto generated setter method - * - * @param param InboundContentLength - */ - public void setInboundContentLength(final long param) { - - // setting primitive attribute tracker to true - this.localInboundContentLengthTracker = param != java.lang.Long.MIN_VALUE; - - this.localInboundContentLength = param; - - - } - - - /** - * field for IncomingTransportName - */ - - - protected java.lang.String localIncomingTransportName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIncomingTransportNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getIncomingTransportName() { - return this.localIncomingTransportName; - } - - - - /** - * Auto generated setter method - * - * @param param IncomingTransportName - */ - public void setIncomingTransportName(final java.lang.String param) { - this.localIncomingTransportNameTracker = true; - - this.localIncomingTransportName = param; - - - } - - - /** - * field for IsSOAP11Explicit - */ - - - protected boolean localIsSOAP11Explicit; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIsSOAP11ExplicitTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getIsSOAP11Explicit() { - return this.localIsSOAP11Explicit; - } - - - - /** - * Auto generated setter method - * - * @param param IsSOAP11Explicit - */ - public void setIsSOAP11Explicit(final boolean param) { - - // setting primitive attribute tracker to true - this.localIsSOAP11ExplicitTracker = true; - - this.localIsSOAP11Explicit = param; - - - } - - - /** - * field for LogCorrelationID - */ - - - protected java.lang.String localLogCorrelationID; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLogCorrelationIDTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getLogCorrelationID() { - return this.localLogCorrelationID; - } - - - - /** - * Auto generated setter method - * - * @param param LogCorrelationID - */ - public void setLogCorrelationID(final java.lang.String param) { - this.localLogCorrelationIDTracker = true; - - this.localLogCorrelationID = param; - - - } - - - /** - * field for LogIDString - */ - - - protected java.lang.String localLogIDString; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLogIDStringTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getLogIDString() { - return this.localLogIDString; - } - - - - /** - * Auto generated setter method - * - * @param param LogIDString - */ - public void setLogIDString(final java.lang.String param) { - this.localLogIDStringTracker = true; - - this.localLogIDString = param; - - - } - - - /** - * field for MessageID - */ - - - protected java.lang.String localMessageID; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessageIDTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getMessageID() { - return this.localMessageID; - } - - - - /** - * Auto generated setter method - * - * @param param MessageID - */ - public void setMessageID(final java.lang.String param) { - this.localMessageIDTracker = true; - - this.localMessageID = param; - - - } - - - /** - * field for NewThreadRequired - */ - - - protected boolean localNewThreadRequired; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNewThreadRequiredTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getNewThreadRequired() { - return this.localNewThreadRequired; - } - - - - /** - * Auto generated setter method - * - * @param param NewThreadRequired - */ - public void setNewThreadRequired(final boolean param) { - - // setting primitive attribute tracker to true - this.localNewThreadRequiredTracker = true; - - this.localNewThreadRequired = param; - - - } - - - /** - * field for OperationContext - */ - - - protected org.apache.axis2.context.xsd.OperationContext localOperationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.OperationContext - */ - public org.apache.axis2.context.xsd.OperationContext getOperationContext() { - return this.localOperationContext; - } - - - - /** - * Auto generated setter method - * - * @param param OperationContext - */ - public void setOperationContext(final org.apache.axis2.context.xsd.OperationContext param) { - this.localOperationContextTracker = true; - - this.localOperationContext = param; - - - } - - - /** - * field for Options - */ - - - protected org.apache.axis2.client.xsd.Options localOptions; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOptionsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.client.xsd.Options - */ - public org.apache.axis2.client.xsd.Options getOptions() { - return this.localOptions; - } - - - - /** - * Auto generated setter method - * - * @param param Options - */ - public void setOptions(final org.apache.axis2.client.xsd.Options param) { - this.localOptionsTracker = true; - - this.localOptions = param; - - - } - - - /** - * field for OptionsExplicit - */ - - - protected org.apache.axis2.client.xsd.Options localOptionsExplicit; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOptionsExplicitTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.client.xsd.Options - */ - public org.apache.axis2.client.xsd.Options getOptionsExplicit() { - return this.localOptionsExplicit; - } - - - - /** - * Auto generated setter method - * - * @param param OptionsExplicit - */ - public void setOptionsExplicit(final org.apache.axis2.client.xsd.Options param) { - this.localOptionsExplicitTracker = true; - - this.localOptionsExplicit = param; - - - } - - - /** - * field for OutputWritten - */ - - - protected boolean localOutputWritten; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOutputWrittenTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getOutputWritten() { - return this.localOutputWritten; - } - - - - /** - * Auto generated setter method - * - * @param param OutputWritten - */ - public void setOutputWritten(final boolean param) { - - // setting primitive attribute tracker to true - this.localOutputWrittenTracker = true; - - this.localOutputWritten = param; - - - } - - - /** - * field for Paused - */ - - - protected boolean localPaused; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPausedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getPaused() { - return this.localPaused; - } - - - - /** - * Auto generated setter method - * - * @param param Paused - */ - public void setPaused(final boolean param) { - - // setting primitive attribute tracker to true - this.localPausedTracker = true; - - this.localPaused = param; - - - } - - - /** - * field for ProcessingFault - */ - - - protected boolean localProcessingFault; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localProcessingFaultTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getProcessingFault() { - return this.localProcessingFault; - } - - - - /** - * Auto generated setter method - * - * @param param ProcessingFault - */ - public void setProcessingFault(final boolean param) { - - // setting primitive attribute tracker to true - this.localProcessingFaultTracker = true; - - this.localProcessingFault = param; - - - } - - - /** - * field for Properties - */ - - - protected authclient.java.util.xsd.Map localProperties; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPropertiesTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getProperties() { - return this.localProperties; - } - - - - /** - * Auto generated setter method - * - * @param param Properties - */ - public void setProperties(final authclient.java.util.xsd.Map param) { - this.localPropertiesTracker = true; - - this.localProperties = param; - - - } - - - /** - * field for RelatesTo - */ - - - protected org.apache.axis2.addressing.xsd.RelatesTo localRelatesTo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRelatesToTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.RelatesTo - */ - public org.apache.axis2.addressing.xsd.RelatesTo getRelatesTo() { - return this.localRelatesTo; - } - - - - /** - * Auto generated setter method - * - * @param param RelatesTo - */ - public void setRelatesTo(final org.apache.axis2.addressing.xsd.RelatesTo param) { - this.localRelatesToTracker = true; - - this.localRelatesTo = param; - - - } - - - /** - * field for Relationships This was an Array! - */ - - - protected org.apache.axis2.addressing.xsd.RelatesTo[] localRelationships; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRelationshipsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.RelatesTo[] - */ - public org.apache.axis2.addressing.xsd.RelatesTo[] getRelationships() { - return this.localRelationships; - } - - - - /** - * validate the array for Relationships - */ - protected void validateRelationships(final org.apache.axis2.addressing.xsd.RelatesTo[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Relationships - */ - public void setRelationships(final org.apache.axis2.addressing.xsd.RelatesTo[] param) { - - validateRelationships(param); - - this.localRelationshipsTracker = true; - - this.localRelationships = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axis2.addressing.xsd.RelatesTo - */ - public void addRelationships(final org.apache.axis2.addressing.xsd.RelatesTo param) { - if (this.localRelationships == null) { - this.localRelationships = new org.apache.axis2.addressing.xsd.RelatesTo[] {}; - } - - - // update the setting tracker - this.localRelationshipsTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localRelationships); - list.add(param); - this.localRelationships = - (org.apache.axis2.addressing.xsd.RelatesTo[]) list.toArray(new org.apache.axis2.addressing.xsd.RelatesTo[list.size()]); - - } - - - /** - * field for ReplyTo - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localReplyTo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localReplyToTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getReplyTo() { - return this.localReplyTo; - } - - - - /** - * Auto generated setter method - * - * @param param ReplyTo - */ - public void setReplyTo(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localReplyToTracker = true; - - this.localReplyTo = param; - - - } - - - /** - * field for ResponseWritten - */ - - - protected boolean localResponseWritten; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localResponseWrittenTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getResponseWritten() { - return this.localResponseWritten; - } - - - - /** - * Auto generated setter method - * - * @param param ResponseWritten - */ - public void setResponseWritten(final boolean param) { - - // setting primitive attribute tracker to true - this.localResponseWrittenTracker = true; - - this.localResponseWritten = param; - - - } - - - /** - * field for RootContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localRootContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRootContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getRootContext() { - return this.localRootContext; - } - - - - /** - * Auto generated setter method - * - * @param param RootContext - */ - public void setRootContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localRootContextTracker = true; - - this.localRootContext = param; - - - } - - - /** - * field for SelfManagedDataMapExplicit - */ - - - protected authclient.java.util.xsd.LinkedHashMap localSelfManagedDataMapExplicit; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSelfManagedDataMapExplicitTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.LinkedHashMap - */ - public authclient.java.util.xsd.LinkedHashMap getSelfManagedDataMapExplicit() { - return this.localSelfManagedDataMapExplicit; - } - - - - /** - * Auto generated setter method - * - * @param param SelfManagedDataMapExplicit - */ - public void setSelfManagedDataMapExplicit(final authclient.java.util.xsd.LinkedHashMap param) { - this.localSelfManagedDataMapExplicitTracker = true; - - this.localSelfManagedDataMapExplicit = param; - - - } - - - /** - * field for ServerSide - */ - - - protected boolean localServerSide; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServerSideTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getServerSide() { - return this.localServerSide; - } - - - - /** - * Auto generated setter method - * - * @param param ServerSide - */ - public void setServerSide(final boolean param) { - - // setting primitive attribute tracker to true - this.localServerSideTracker = true; - - this.localServerSide = param; - - - } - - - /** - * field for ServiceContext - */ - - - protected org.apache.axis2.context.xsd.ServiceContext localServiceContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ServiceContext - */ - public org.apache.axis2.context.xsd.ServiceContext getServiceContext() { - return this.localServiceContext; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceContext - */ - public void setServiceContext(final org.apache.axis2.context.xsd.ServiceContext param) { - this.localServiceContextTracker = true; - - this.localServiceContext = param; - - - } - - - /** - * field for ServiceContextID - */ - - - protected java.lang.String localServiceContextID; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceContextIDTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getServiceContextID() { - return this.localServiceContextID; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceContextID - */ - public void setServiceContextID(final java.lang.String param) { - this.localServiceContextIDTracker = true; - - this.localServiceContextID = param; - - - } - - - /** - * field for ServiceGroupContext - */ - - - protected org.apache.axis2.context.xsd.ServiceGroupContext localServiceGroupContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ServiceGroupContext - */ - public org.apache.axis2.context.xsd.ServiceGroupContext getServiceGroupContext() { - return this.localServiceGroupContext; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupContext - */ - public void setServiceGroupContext(final org.apache.axis2.context.xsd.ServiceGroupContext param) { - this.localServiceGroupContextTracker = true; - - this.localServiceGroupContext = param; - - - } - - - /** - * field for ServiceGroupContextId - */ - - - protected java.lang.String localServiceGroupContextId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupContextIdTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getServiceGroupContextId() { - return this.localServiceGroupContextId; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupContextId - */ - public void setServiceGroupContextId(final java.lang.String param) { - this.localServiceGroupContextIdTracker = true; - - this.localServiceGroupContextId = param; - - - } - - - /** - * field for SessionContext - */ - - - protected org.apache.axis2.context.xsd.SessionContext localSessionContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSessionContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.SessionContext - */ - public org.apache.axis2.context.xsd.SessionContext getSessionContext() { - return this.localSessionContext; - } - - - - /** - * Auto generated setter method - * - * @param param SessionContext - */ - public void setSessionContext(final org.apache.axis2.context.xsd.SessionContext param) { - this.localSessionContextTracker = true; - - this.localSessionContext = param; - - - } - - - /** - * field for SoapAction - */ - - - protected java.lang.String localSoapAction; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSoapActionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSoapAction() { - return this.localSoapAction; - } - - - - /** - * Auto generated setter method - * - * @param param SoapAction - */ - public void setSoapAction(final java.lang.String param) { - this.localSoapActionTracker = true; - - this.localSoapAction = param; - - - } - - - /** - * field for To - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localTo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localToTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getTo() { - return this.localTo; - } - - - - /** - * Auto generated setter method - * - * @param param To - */ - public void setTo(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localToTracker = true; - - this.localTo = param; - - - } - - - /** - * field for TransportIn - */ - - - protected org.apache.axis2.description.xsd.TransportInDescription localTransportIn; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransportInTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.TransportInDescription - */ - public org.apache.axis2.description.xsd.TransportInDescription getTransportIn() { - return this.localTransportIn; - } - - - - /** - * Auto generated setter method - * - * @param param TransportIn - */ - public void setTransportIn(final org.apache.axis2.description.xsd.TransportInDescription param) { - this.localTransportInTracker = true; - - this.localTransportIn = param; - - - } - - - /** - * field for TransportOut - */ - - - protected org.apache.axis2.description.xsd.TransportOutDescription localTransportOut; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransportOutTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.TransportOutDescription - */ - public org.apache.axis2.description.xsd.TransportOutDescription getTransportOut() { - return this.localTransportOut; - } - - - - /** - * Auto generated setter method - * - * @param param TransportOut - */ - public void setTransportOut(final org.apache.axis2.description.xsd.TransportOutDescription param) { - this.localTransportOutTracker = true; - - this.localTransportOut = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://context.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":MessageContext", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "MessageContext", xmlWriter); - } - - - } - if (this.localFLOWTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "FLOW", xmlWriter); - - if (this.localFLOW == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("FLOW cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFLOW)); - } - - xmlWriter.writeEndElement(); - } - if (this.localSOAP11Tracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "SOAP11", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("SOAP11 cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSOAP11)); - } - - xmlWriter.writeEndElement(); - } - if (this.localWSAActionTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "WSAAction", xmlWriter); - - - if (this.localWSAAction == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localWSAAction); - - } - - xmlWriter.writeEndElement(); - } - if (this.localWSAMessageIdTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "WSAMessageId", xmlWriter); - - - if (this.localWSAMessageId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localWSAMessageId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localAttachmentMapTracker) { - if (this.localAttachmentMap == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "attachmentMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAttachmentMap.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "attachmentMap"), xmlWriter); - } - } - if (this.localAxisMessageTracker) { - if (this.localAxisMessage == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "axisMessage", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisMessage.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "axisMessage"), xmlWriter); - } - } - if (this.localAxisOperationTracker) { - if (this.localAxisOperation == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "axisOperation", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisOperation.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "axisOperation"), xmlWriter); - } - } - if (this.localAxisServiceTracker) { - if (this.localAxisService == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "axisService", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisService.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "axisService"), xmlWriter); - } - } - if (this.localAxisServiceGroupTracker) { - if (this.localAxisServiceGroup == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "axisServiceGroup", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisServiceGroup.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "axisServiceGroup"), xmlWriter); - } - } - if (this.localConfigurationContextTracker) { - if (this.localConfigurationContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "configurationContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConfigurationContext.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "configurationContext"), xmlWriter); - } - } - if (this.localCurrentHandlerIndexTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "currentHandlerIndex", xmlWriter); - - if (this.localCurrentHandlerIndex == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("currentHandlerIndex cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCurrentHandlerIndex)); - } - - xmlWriter.writeEndElement(); - } - if (this.localCurrentPhaseIndexTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "currentPhaseIndex", xmlWriter); - - if (this.localCurrentPhaseIndex == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("currentPhaseIndex cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCurrentPhaseIndex)); - } - - xmlWriter.writeEndElement(); - } - if (this.localDoingMTOMTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "doingMTOM", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("doingMTOM cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDoingMTOM)); - } - - xmlWriter.writeEndElement(); - } - if (this.localDoingRESTTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "doingREST", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("doingREST cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDoingREST)); - } - - xmlWriter.writeEndElement(); - } - if (this.localDoingSwATracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "doingSwA", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("doingSwA cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDoingSwA)); - } - - xmlWriter.writeEndElement(); - } - if (this.localEffectivePolicyTracker) { - if (this.localEffectivePolicy == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "effectivePolicy", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localEffectivePolicy.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "effectivePolicy"), xmlWriter); - } - } - if (this.localEnvelopeTracker) { - if (this.localEnvelope == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "envelope", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localEnvelope.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "envelope"), xmlWriter); - } - } - if (this.localExecutedPhasesTracker) { - if (this.localExecutedPhases == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "executedPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localExecutedPhases.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "executedPhases"), xmlWriter); - } - } - if (this.localExecutedPhasesExplicitTracker) { - if (this.localExecutedPhasesExplicit == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "executedPhasesExplicit", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localExecutedPhasesExplicit.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "executedPhasesExplicit"), xmlWriter); - } - } - if (this.localExecutionChainTracker) { - - if (this.localExecutionChain != null) { - if (this.localExecutionChain instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localExecutionChain).serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "executionChain"), xmlWriter, true); - } else { - writeStartElement(null, "http://context.axis2.apache.org/xsd", "executionChain", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localExecutionChain, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://context.axis2.apache.org/xsd", "executionChain", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localFailureReasonTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "failureReason", xmlWriter); - - - if (this.localFailureReason == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - this.localFailureReason.serialize(xmlWriter); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFaultTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "fault", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("fault cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFault)); - } - - xmlWriter.writeEndElement(); - } - if (this.localFaultToTracker) { - if (this.localFaultTo == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "faultTo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFaultTo.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "faultTo"), xmlWriter); - } - } - if (this.localFromTracker) { - if (this.localFrom == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "from", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFrom.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "from"), - xmlWriter); - } - } - if (this.localHeaderPresentTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "headerPresent", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("headerPresent cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localHeaderPresent)); - } - - xmlWriter.writeEndElement(); - } - if (this.localInboundContentLengthTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "inboundContentLength", xmlWriter); - - if (this.localInboundContentLength == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("inboundContentLength cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localInboundContentLength)); - } - - xmlWriter.writeEndElement(); - } - if (this.localIncomingTransportNameTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "incomingTransportName", xmlWriter); - - - if (this.localIncomingTransportName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localIncomingTransportName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localIsSOAP11ExplicitTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "isSOAP11Explicit", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("isSOAP11Explicit cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIsSOAP11Explicit)); - } - - xmlWriter.writeEndElement(); - } - if (this.localLogCorrelationIDTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "logCorrelationID", xmlWriter); - - - if (this.localLogCorrelationID == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localLogCorrelationID); - - } - - xmlWriter.writeEndElement(); - } - if (this.localLogIDStringTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "logIDString", xmlWriter); - - - if (this.localLogIDString == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localLogIDString); - - } - - xmlWriter.writeEndElement(); - } - if (this.localMessageIDTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "messageID", xmlWriter); - - - if (this.localMessageID == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localMessageID); - - } - - xmlWriter.writeEndElement(); - } - if (this.localNewThreadRequiredTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "newThreadRequired", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("newThreadRequired cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNewThreadRequired)); - } - - xmlWriter.writeEndElement(); - } - if (this.localOperationContextTracker) { - if (this.localOperationContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "operationContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localOperationContext.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "operationContext"), xmlWriter); - } - } - if (this.localOptionsTracker) { - if (this.localOptions == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "options", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localOptions.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "options"), xmlWriter); - } - } - if (this.localOptionsExplicitTracker) { - if (this.localOptionsExplicit == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "optionsExplicit", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localOptionsExplicit.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "optionsExplicit"), xmlWriter); - } - } - if (this.localOutputWrittenTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "outputWritten", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("outputWritten cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOutputWritten)); - } - - xmlWriter.writeEndElement(); - } - if (this.localPausedTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "paused", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("paused cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPaused)); - } - - xmlWriter.writeEndElement(); - } - if (this.localProcessingFaultTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "processingFault", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("processingFault cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localProcessingFault)); - } - - xmlWriter.writeEndElement(); - } - if (this.localPropertiesTracker) { - if (this.localProperties == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "properties", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localProperties.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "properties"), xmlWriter); - } - } - if (this.localRelatesToTracker) { - if (this.localRelatesTo == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "relatesTo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRelatesTo.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "relatesTo"), xmlWriter); - } - } - if (this.localRelationshipsTracker) { - if (this.localRelationships != null) { - for (final RelatesTo localRelationship : this.localRelationships) { - if (localRelationship != null) { - localRelationship.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "relationships"), xmlWriter); - } else { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "relationships", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "relationships", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - if (this.localReplyToTracker) { - if (this.localReplyTo == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "replyTo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localReplyTo.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "replyTo"), xmlWriter); - } - } - if (this.localResponseWrittenTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "responseWritten", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("responseWritten cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localResponseWritten)); - } - - xmlWriter.writeEndElement(); - } - if (this.localRootContextTracker) { - if (this.localRootContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "rootContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRootContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext"), xmlWriter); - } - } - if (this.localSelfManagedDataMapExplicitTracker) { - if (this.localSelfManagedDataMapExplicit == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "selfManagedDataMapExplicit", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSelfManagedDataMapExplicit.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "selfManagedDataMapExplicit"), xmlWriter); - } - } - if (this.localServerSideTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serverSide", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("serverSide cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServerSide)); - } - - xmlWriter.writeEndElement(); - } - if (this.localServiceContextTracker) { - if (this.localServiceContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServiceContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceContext"), xmlWriter); - } - } - if (this.localServiceContextIDTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceContextID", xmlWriter); - - - if (this.localServiceContextID == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localServiceContextID); - - } - - xmlWriter.writeEndElement(); - } - if (this.localServiceGroupContextTracker) { - if (this.localServiceGroupContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceGroupContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServiceGroupContext.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "serviceGroupContext"), xmlWriter); - } - } - if (this.localServiceGroupContextIdTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceGroupContextId", xmlWriter); - - - if (this.localServiceGroupContextId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localServiceGroupContextId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localSessionContextTracker) { - if (this.localSessionContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "sessionContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSessionContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "sessionContext"), xmlWriter); - } - } - if (this.localSoapActionTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "soapAction", xmlWriter); - - - if (this.localSoapAction == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSoapAction); - - } - - xmlWriter.writeEndElement(); - } - if (this.localToTracker) { - if (this.localTo == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "to", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTo.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "to"), - xmlWriter); - } - } - if (this.localTransportInTracker) { - if (this.localTransportIn == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "transportIn", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTransportIn.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "transportIn"), xmlWriter); - } - } - if (this.localTransportOutTracker) { - if (this.localTransportOut == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "transportOut", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTransportOut.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "transportOut"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://context.axis2.apache.org/xsd")) { - return "ns10"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localFLOWTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "FLOW")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFLOW)); - } - if (this.localSOAP11Tracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "SOAP11")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSOAP11)); - } - if (this.localWSAActionTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "WSAAction")); - - elementList.add(this.localWSAAction == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWSAAction)); - } - if (this.localWSAMessageIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "WSAMessageId")); - - elementList.add(this.localWSAMessageId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWSAMessageId)); - } - if (this.localAttachmentMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "attachmentMap")); - - - elementList.add(this.localAttachmentMap == null ? null : this.localAttachmentMap); - } - if (this.localAxisMessageTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "axisMessage")); - - - elementList.add(this.localAxisMessage == null ? null : this.localAxisMessage); - } - if (this.localAxisOperationTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "axisOperation")); - - - elementList.add(this.localAxisOperation == null ? null : this.localAxisOperation); - } - if (this.localAxisServiceTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "axisService")); - - - elementList.add(this.localAxisService == null ? null : this.localAxisService); - } - if (this.localAxisServiceGroupTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "axisServiceGroup")); - - - elementList.add(this.localAxisServiceGroup == null ? null : this.localAxisServiceGroup); - } - if (this.localConfigurationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "configurationContext")); - - - elementList.add(this.localConfigurationContext == null ? null : this.localConfigurationContext); - } - if (this.localCurrentHandlerIndexTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "currentHandlerIndex")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCurrentHandlerIndex)); - } - if (this.localCurrentPhaseIndexTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "currentPhaseIndex")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCurrentPhaseIndex)); - } - if (this.localDoingMTOMTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "doingMTOM")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDoingMTOM)); - } - if (this.localDoingRESTTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "doingREST")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDoingREST)); - } - if (this.localDoingSwATracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "doingSwA")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDoingSwA)); - } - if (this.localEffectivePolicyTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "effectivePolicy")); - - - elementList.add(this.localEffectivePolicy == null ? null : this.localEffectivePolicy); - } - if (this.localEnvelopeTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "envelope")); - - - elementList.add(this.localEnvelope == null ? null : this.localEnvelope); - } - if (this.localExecutedPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "executedPhases")); - - - elementList.add(this.localExecutedPhases == null ? null : this.localExecutedPhases); - } - if (this.localExecutedPhasesExplicitTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "executedPhasesExplicit")); - - - elementList.add(this.localExecutedPhasesExplicit == null ? null : this.localExecutedPhasesExplicit); - } - if (this.localExecutionChainTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "executionChain")); - - - elementList.add(this.localExecutionChain == null ? null : this.localExecutionChain); - } - if (this.localFailureReasonTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "failureReason")); - - elementList.add(this.localFailureReason == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFailureReason)); - } - if (this.localFaultTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "fault")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFault)); - } - if (this.localFaultToTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "faultTo")); - - - elementList.add(this.localFaultTo == null ? null : this.localFaultTo); - } - if (this.localFromTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "from")); - - - elementList.add(this.localFrom == null ? null : this.localFrom); - } - if (this.localHeaderPresentTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "headerPresent")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localHeaderPresent)); - } - if (this.localInboundContentLengthTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "inboundContentLength")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localInboundContentLength)); - } - if (this.localIncomingTransportNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "incomingTransportName")); - - elementList.add(this.localIncomingTransportName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIncomingTransportName)); - } - if (this.localIsSOAP11ExplicitTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "isSOAP11Explicit")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIsSOAP11Explicit)); - } - if (this.localLogCorrelationIDTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "logCorrelationID")); - - elementList.add(this.localLogCorrelationID == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLogCorrelationID)); - } - if (this.localLogIDStringTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "logIDString")); - - elementList.add(this.localLogIDString == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLogIDString)); - } - if (this.localMessageIDTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "messageID")); - - elementList.add(this.localMessageID == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMessageID)); - } - if (this.localNewThreadRequiredTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "newThreadRequired")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNewThreadRequired)); - } - if (this.localOperationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "operationContext")); - - - elementList.add(this.localOperationContext == null ? null : this.localOperationContext); - } - if (this.localOptionsTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "options")); - - - elementList.add(this.localOptions == null ? null : this.localOptions); - } - if (this.localOptionsExplicitTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "optionsExplicit")); - - - elementList.add(this.localOptionsExplicit == null ? null : this.localOptionsExplicit); - } - if (this.localOutputWrittenTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "outputWritten")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOutputWritten)); - } - if (this.localPausedTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "paused")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPaused)); - } - if (this.localProcessingFaultTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "processingFault")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localProcessingFault)); - } - if (this.localPropertiesTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "properties")); - - - elementList.add(this.localProperties == null ? null : this.localProperties); - } - if (this.localRelatesToTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "relatesTo")); - - - elementList.add(this.localRelatesTo == null ? null : this.localRelatesTo); - } - if (this.localRelationshipsTracker) { - if (this.localRelationships != null) { - for (final RelatesTo localRelationship : this.localRelationships) { - - if (localRelationship != null) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "relationships")); - elementList.add(localRelationship); - } else { - - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "relationships")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "relationships")); - elementList.add(this.localRelationships); - - } - - } - if (this.localReplyToTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "replyTo")); - - - elementList.add(this.localReplyTo == null ? null : this.localReplyTo); - } - if (this.localResponseWrittenTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "responseWritten")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localResponseWritten)); - } - if (this.localRootContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "rootContext")); - - - elementList.add(this.localRootContext == null ? null : this.localRootContext); - } - if (this.localSelfManagedDataMapExplicitTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "selfManagedDataMapExplicit")); - - - elementList.add(this.localSelfManagedDataMapExplicit == null ? null : this.localSelfManagedDataMapExplicit); - } - if (this.localServerSideTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "serverSide")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServerSide)); - } - if (this.localServiceContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "serviceContext")); - - - elementList.add(this.localServiceContext == null ? null : this.localServiceContext); - } - if (this.localServiceContextIDTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "serviceContextID")); - - elementList.add(this.localServiceContextID == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceContextID)); - } - if (this.localServiceGroupContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContext")); - - - elementList.add(this.localServiceGroupContext == null ? null : this.localServiceGroupContext); - } - if (this.localServiceGroupContextIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContextId")); - - elementList.add(this.localServiceGroupContextId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceGroupContextId)); - } - if (this.localSessionContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "sessionContext")); - - - elementList.add(this.localSessionContext == null ? null : this.localSessionContext); - } - if (this.localSoapActionTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "soapAction")); - - elementList.add(this.localSoapAction == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSoapAction)); - } - if (this.localToTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "to")); - - - elementList.add(this.localTo == null ? null : this.localTo); - } - if (this.localTransportInTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "transportIn")); - - - elementList.add(this.localTransportIn == null ? null : this.localTransportIn); - } - if (this.localTransportOutTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "transportOut")); - - - elementList.add(this.localTransportOut == null ? null : this.localTransportOut); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static MessageContext parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final MessageContext object = new MessageContext(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"MessageContext".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (MessageContext) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list41 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "FLOW").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFLOW(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setFLOW(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "SOAP11").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSOAP11(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://context.axis2.apache.org/xsd", - "WSAAction").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setWSAAction(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "WSAMessageId").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setWSAMessageId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "attachmentMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAttachmentMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setAttachmentMap(org.apache.axiom.attachments.xsd.Attachments.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://context.axis2.apache.org/xsd", - "axisMessage").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisMessage(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisMessage(org.apache.axis2.description.xsd.AxisMessage.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://context.axis2.apache.org/xsd", - "axisOperation").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisOperation(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisOperation(org.apache.axis2.description.xsd.AxisOperation.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://context.axis2.apache.org/xsd", - "axisService").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisService(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisService(org.apache.axis2.description.xsd.AxisService.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://context.axis2.apache.org/xsd", - "axisServiceGroup").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisServiceGroup(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisServiceGroup(org.apache.axis2.description.xsd.AxisServiceGroup.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://context.axis2.apache.org/xsd", - "configurationContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConfigurationContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setConfigurationContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "currentHandlerIndex").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCurrentHandlerIndex(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setCurrentHandlerIndex(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "currentPhaseIndex").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCurrentPhaseIndex(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setCurrentPhaseIndex(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "doingMTOM").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDoingMTOM(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://context.axis2.apache.org/xsd", - "doingREST").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDoingREST(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://context.axis2.apache.org/xsd", - "doingSwA").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDoingSwA(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://context.axis2.apache.org/xsd", - "effectivePolicy").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setEffectivePolicy(null); - reader.next(); - - reader.next(); - - } else { - - object.setEffectivePolicy(org.apache.neethi.xsd.Policy.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://context.axis2.apache.org/xsd", - "envelope").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setEnvelope(null); - reader.next(); - - reader.next(); - - } else { - - object.setEnvelope(org.apache.axiom.soap.xsd.SOAPEnvelope.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://context.axis2.apache.org/xsd", - "executedPhases").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setExecutedPhases(null); - reader.next(); - - reader.next(); - - } else { - - object.setExecutedPhases(authclient.java.util.xsd.Iterator.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://context.axis2.apache.org/xsd", - "executedPhasesExplicit").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setExecutedPhasesExplicit(null); - reader.next(); - - reader.next(); - - } else { - - object.setExecutedPhasesExplicit(authclient.java.util.xsd.LinkedList.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://context.axis2.apache.org/xsd", - "executionChain").equals(reader.getName())) { - - object.setExecutionChain(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - final org.apache.axiom.om.OMFactory fac = org.apache.axiom.om.OMAbstractFactory.getOMFactory(); - final org.apache.axiom.om.OMNamespace omNs = - fac.createOMNamespace("http://context.axis2.apache.org/xsd", ""); - final org.apache.axiom.om.OMElement _valueFailureReason = - fac.createOMElement("failureReason", omNs); - _valueFailureReason.addChild(fac.createOMText(_valueFailureReason, content)); - object.setFailureReason(_valueFailureReason); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "fault").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFault(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://context.axis2.apache.org/xsd", - "faultTo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFaultTo(null); - reader.next(); - - reader.next(); - - } else { - - object.setFaultTo(org.apache.axis2.addressing.xsd.EndpointReference.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://context.axis2.apache.org/xsd", - "from").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFrom(null); - reader.next(); - - reader.next(); - - } else { - - object.setFrom(org.apache.axis2.addressing.xsd.EndpointReference.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://context.axis2.apache.org/xsd", - "headerPresent").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setHeaderPresent(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://context.axis2.apache.org/xsd", - "inboundContentLength").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setInboundContentLength(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setInboundContentLength(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "incomingTransportName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setIncomingTransportName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "isSOAP11Explicit").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIsSOAP11Explicit(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://context.axis2.apache.org/xsd", - "logCorrelationID").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setLogCorrelationID(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "logIDString").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setLogIDString(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "messageID").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setMessageID(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "newThreadRequired").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setNewThreadRequired(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://context.axis2.apache.org/xsd", - "operationContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setOperationContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setOperationContext(org.apache.axis2.context.xsd.OperationContext.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://context.axis2.apache.org/xsd", - "options").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setOptions(null); - reader.next(); - - reader.next(); - - } else { - - object.setOptions(org.apache.axis2.client.xsd.Options.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://context.axis2.apache.org/xsd", - "optionsExplicit").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setOptionsExplicit(null); - reader.next(); - - reader.next(); - - } else { - - object.setOptionsExplicit(org.apache.axis2.client.xsd.Options.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://context.axis2.apache.org/xsd", - "outputWritten").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setOutputWritten(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://context.axis2.apache.org/xsd", - "paused").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPaused(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://context.axis2.apache.org/xsd", - "processingFault").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setProcessingFault(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://context.axis2.apache.org/xsd", - "properties").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setProperties(null); - reader.next(); - - reader.next(); - - } else { - - object.setProperties(authclient.java.util.xsd.Map.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://context.axis2.apache.org/xsd", - "relatesTo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRelatesTo(null); - reader.next(); - - reader.next(); - - } else { - - object.setRelatesTo(org.apache.axis2.addressing.xsd.RelatesTo.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://context.axis2.apache.org/xsd", - "relationships").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list41.add(null); - reader.next(); - } else { - list41.add(org.apache.axis2.addressing.xsd.RelatesTo.Factory.parse(reader)); - } - // loop until we find a start element that is not part of this array - boolean loopDone41 = false; - while (!loopDone41) { - // 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 - loopDone41 = true; - } else { - if (new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "relationships").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list41.add(null); - reader.next(); - } else { - list41.add(org.apache.axis2.addressing.xsd.RelatesTo.Factory.parse(reader)); - } - } else { - loopDone41 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setRelationships((org.apache.axis2.addressing.xsd.RelatesTo[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.apache.axis2.addressing.xsd.RelatesTo.class, - list41)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "replyTo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setReplyTo(null); - reader.next(); - - reader.next(); - - } else { - - object.setReplyTo(org.apache.axis2.addressing.xsd.EndpointReference.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://context.axis2.apache.org/xsd", - "responseWritten").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setResponseWritten(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://context.axis2.apache.org/xsd", - "rootContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRootContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setRootContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "selfManagedDataMapExplicit").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSelfManagedDataMapExplicit(null); - reader.next(); - - reader.next(); - - } else { - - object.setSelfManagedDataMapExplicit(authclient.java.util.xsd.LinkedHashMap.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://context.axis2.apache.org/xsd", - "serverSide").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setServerSide(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://context.axis2.apache.org/xsd", - "serviceContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServiceContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setServiceContext(org.apache.axis2.context.xsd.ServiceContext.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://context.axis2.apache.org/xsd", - "serviceContextID").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceContextID(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServiceGroupContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setServiceGroupContext(org.apache.axis2.context.xsd.ServiceGroupContext.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://context.axis2.apache.org/xsd", - "serviceGroupContextId").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceGroupContextId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "sessionContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSessionContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setSessionContext(org.apache.axis2.context.xsd.SessionContext.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://context.axis2.apache.org/xsd", - "soapAction").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSoapAction(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "to").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTo(null); - reader.next(); - - reader.next(); - - } else { - - object.setTo(org.apache.axis2.addressing.xsd.EndpointReference.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://context.axis2.apache.org/xsd", - "transportIn").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTransportIn(null); - reader.next(); - - reader.next(); - - } else { - - object.setTransportIn(org.apache.axis2.description.xsd.TransportInDescription.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://context.axis2.apache.org/xsd", - "transportOut").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTransportOut(null); - reader.next(); - - reader.next(); - - } else { - - object.setTransportOut(org.apache.axis2.description.xsd.TransportOutDescription.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/OperationContext.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/OperationContext.java deleted file mode 100644 index 7d0edaa8e..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/OperationContext.java +++ /dev/null @@ -1,1461 +0,0 @@ - -/** - * OperationContext.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.context.xsd; - - -/** - * OperationContext bean class - */ - -public class OperationContext implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = OperationContext Namespace URI = - * http://context.axis2.apache.org/xsd Namespace Prefix = ns10 - */ - - - /** - * - */ - private static final long serialVersionUID = -1673517701517876145L; - - /** - * field for AxisOperation - */ - - - protected org.apache.axis2.description.xsd.AxisOperation localAxisOperation; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisOperationTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisOperation - */ - public org.apache.axis2.description.xsd.AxisOperation getAxisOperation() { - return this.localAxisOperation; - } - - - - /** - * Auto generated setter method - * - * @param param AxisOperation - */ - public void setAxisOperation(final org.apache.axis2.description.xsd.AxisOperation param) { - this.localAxisOperationTracker = true; - - this.localAxisOperation = param; - - - } - - - /** - * field for Complete - */ - - - protected boolean localComplete; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCompleteTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getComplete() { - return this.localComplete; - } - - - - /** - * Auto generated setter method - * - * @param param Complete - */ - public void setComplete(final boolean param) { - - // setting primitive attribute tracker to true - this.localCompleteTracker = true; - - this.localComplete = param; - - - } - - - /** - * field for ConfigurationContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localConfigurationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConfigurationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getConfigurationContext() { - return this.localConfigurationContext; - } - - - - /** - * Auto generated setter method - * - * @param param ConfigurationContext - */ - public void setConfigurationContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localConfigurationContextTracker = true; - - this.localConfigurationContext = param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.String localKey; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localKeyTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getKey() { - return this.localKey; - } - - - - /** - * Auto generated setter method - * - * @param param Key - */ - public void setKey(final java.lang.String param) { - this.localKeyTracker = true; - - this.localKey = param; - - - } - - - /** - * field for LogCorrelationIDString - */ - - - protected java.lang.String localLogCorrelationIDString; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLogCorrelationIDStringTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getLogCorrelationIDString() { - return this.localLogCorrelationIDString; - } - - - - /** - * Auto generated setter method - * - * @param param LogCorrelationIDString - */ - public void setLogCorrelationIDString(final java.lang.String param) { - this.localLogCorrelationIDStringTracker = true; - - this.localLogCorrelationIDString = param; - - - } - - - /** - * field for MessageContexts This was an Array! - */ - - - protected java.lang.String[] localMessageContexts; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessageContextsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getMessageContexts() { - return this.localMessageContexts; - } - - - - /** - * validate the array for MessageContexts - */ - protected void validateMessageContexts(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param MessageContexts - */ - public void setMessageContexts(final java.lang.String[] param) { - - validateMessageContexts(param); - - this.localMessageContextsTracker = true; - - this.localMessageContexts = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addMessageContexts(final java.lang.String param) { - if (this.localMessageContexts == null) { - this.localMessageContexts = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localMessageContextsTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localMessageContexts); - list.add(param); - this.localMessageContexts = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for OperationName - */ - - - protected java.lang.String localOperationName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getOperationName() { - return this.localOperationName; - } - - - - /** - * Auto generated setter method - * - * @param param OperationName - */ - public void setOperationName(final java.lang.String param) { - this.localOperationNameTracker = true; - - this.localOperationName = param; - - - } - - - /** - * field for RootContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localRootContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRootContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getRootContext() { - return this.localRootContext; - } - - - - /** - * Auto generated setter method - * - * @param param RootContext - */ - public void setRootContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localRootContextTracker = true; - - this.localRootContext = param; - - - } - - - /** - * field for ServiceContext - */ - - - protected org.apache.axis2.context.xsd.ServiceContext localServiceContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ServiceContext - */ - public org.apache.axis2.context.xsd.ServiceContext getServiceContext() { - return this.localServiceContext; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceContext - */ - public void setServiceContext(final org.apache.axis2.context.xsd.ServiceContext param) { - this.localServiceContextTracker = true; - - this.localServiceContext = param; - - - } - - - /** - * field for ServiceGroupName - */ - - - protected java.lang.String localServiceGroupName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getServiceGroupName() { - return this.localServiceGroupName; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupName - */ - public void setServiceGroupName(final java.lang.String param) { - this.localServiceGroupNameTracker = true; - - this.localServiceGroupName = param; - - - } - - - /** - * field for ServiceName - */ - - - protected java.lang.String localServiceName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getServiceName() { - return this.localServiceName; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceName - */ - public void setServiceName(final java.lang.String param) { - this.localServiceNameTracker = true; - - this.localServiceName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://context.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":OperationContext", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "OperationContext", - xmlWriter); - } - - - } - if (this.localAxisOperationTracker) { - if (this.localAxisOperation == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "axisOperation", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisOperation.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "axisOperation"), xmlWriter); - } - } - if (this.localCompleteTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "complete", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("complete cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localComplete)); - } - - xmlWriter.writeEndElement(); - } - if (this.localConfigurationContextTracker) { - if (this.localConfigurationContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "configurationContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConfigurationContext.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "configurationContext"), xmlWriter); - } - } - if (this.localKeyTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "key", xmlWriter); - - - if (this.localKey == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localKey); - - } - - xmlWriter.writeEndElement(); - } - if (this.localLogCorrelationIDStringTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "logCorrelationIDString", xmlWriter); - - - if (this.localLogCorrelationIDString == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localLogCorrelationIDString); - - } - - xmlWriter.writeEndElement(); - } - if (this.localMessageContextsTracker) { - if (this.localMessageContexts != null) { - namespace = "http://context.axis2.apache.org/xsd"; - for (final String localMessageContext : this.localMessageContexts) { - - if (localMessageContext != null) { - - writeStartElement(null, namespace, "messageContexts", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMessageContext)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "messageContexts", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://context.axis2.apache.org/xsd", "messageContexts", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localOperationNameTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "operationName", xmlWriter); - - - if (this.localOperationName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localOperationName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localRootContextTracker) { - if (this.localRootContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "rootContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRootContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext"), xmlWriter); - } - } - if (this.localServiceContextTracker) { - if (this.localServiceContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServiceContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceContext"), xmlWriter); - } - } - if (this.localServiceGroupNameTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceGroupName", xmlWriter); - - - if (this.localServiceGroupName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localServiceGroupName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localServiceNameTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceName", xmlWriter); - - - if (this.localServiceName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localServiceName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://context.axis2.apache.org/xsd")) { - return "ns10"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAxisOperationTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "axisOperation")); - - - elementList.add(this.localAxisOperation == null ? null : this.localAxisOperation); - } - if (this.localCompleteTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "complete")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localComplete)); - } - if (this.localConfigurationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "configurationContext")); - - - elementList.add(this.localConfigurationContext == null ? null : this.localConfigurationContext); - } - if (this.localKeyTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "key")); - - elementList.add(this.localKey == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localKey)); - } - if (this.localLogCorrelationIDStringTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "logCorrelationIDString")); - - elementList.add(this.localLogCorrelationIDString == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLogCorrelationIDString)); - } - if (this.localMessageContextsTracker) { - if (this.localMessageContexts != null) { - for (final String localMessageContext : this.localMessageContexts) { - - if (localMessageContext != null) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "messageContexts")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMessageContext)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "messageContexts")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "messageContexts")); - elementList.add(null); - - } - - } - if (this.localOperationNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "operationName")); - - elementList.add(this.localOperationName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOperationName)); - } - if (this.localRootContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "rootContext")); - - - elementList.add(this.localRootContext == null ? null : this.localRootContext); - } - if (this.localServiceContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "serviceContext")); - - - elementList.add(this.localServiceContext == null ? null : this.localServiceContext); - } - if (this.localServiceGroupNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "serviceGroupName")); - - elementList.add(this.localServiceGroupName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceGroupName)); - } - if (this.localServiceNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "serviceName")); - - elementList.add(this.localServiceName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceName)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static OperationContext parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final OperationContext object = new OperationContext(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"OperationContext".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (OperationContext) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list6 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "axisOperation").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisOperation(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisOperation(org.apache.axis2.description.xsd.AxisOperation.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://context.axis2.apache.org/xsd", - "complete").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setComplete(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://context.axis2.apache.org/xsd", - "configurationContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConfigurationContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setConfigurationContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "key").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setKey(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "logCorrelationIDString").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setLogCorrelationIDString(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "messageContexts").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list6.add(null); - - reader.next(); - } else { - list6.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone6 = false; - while (!loopDone6) { - // 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 - loopDone6 = true; - } else { - if (new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "messageContexts").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list6.add(null); - - reader.next(); - } else { - list6.add(reader.getElementText()); - } - } else { - loopDone6 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setMessageContexts((java.lang.String[]) list6.toArray(new java.lang.String[list6.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://context.axis2.apache.org/xsd", - "operationName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setOperationName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRootContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setRootContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "serviceContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServiceContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setServiceContext(org.apache.axis2.context.xsd.ServiceContext.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://context.axis2.apache.org/xsd", - "serviceGroupName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceGroupName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ServiceContext.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ServiceContext.java deleted file mode 100644 index 63728baac..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ServiceContext.java +++ /dev/null @@ -1,1330 +0,0 @@ - -/** - * ServiceContext.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.context.xsd; - - -/** - * ServiceContext bean class - */ - -public class ServiceContext implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ServiceContext Namespace URI = - * http://context.axis2.apache.org/xsd Namespace Prefix = ns10 - */ - - - /** - * - */ - private static final long serialVersionUID = -5976323813817411394L; - - /** - * field for AxisService - */ - - - protected org.apache.axis2.description.xsd.AxisService localAxisService; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisServiceTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisService - */ - public org.apache.axis2.description.xsd.AxisService getAxisService() { - return this.localAxisService; - } - - - - /** - * Auto generated setter method - * - * @param param AxisService - */ - public void setAxisService(final org.apache.axis2.description.xsd.AxisService param) { - this.localAxisServiceTracker = true; - - this.localAxisService = param; - - - } - - - /** - * field for CachingOperationContext - */ - - - protected boolean localCachingOperationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCachingOperationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getCachingOperationContext() { - return this.localCachingOperationContext; - } - - - - /** - * Auto generated setter method - * - * @param param CachingOperationContext - */ - public void setCachingOperationContext(final boolean param) { - - // setting primitive attribute tracker to true - this.localCachingOperationContextTracker = true; - - this.localCachingOperationContext = param; - - - } - - - /** - * field for ConfigurationContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localConfigurationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConfigurationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getConfigurationContext() { - return this.localConfigurationContext; - } - - - - /** - * Auto generated setter method - * - * @param param ConfigurationContext - */ - public void setConfigurationContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localConfigurationContextTracker = true; - - this.localConfigurationContext = param; - - - } - - - /** - * field for GroupName - */ - - - protected java.lang.String localGroupName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localGroupNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getGroupName() { - return this.localGroupName; - } - - - - /** - * Auto generated setter method - * - * @param param GroupName - */ - public void setGroupName(final java.lang.String param) { - this.localGroupNameTracker = true; - - this.localGroupName = param; - - - } - - - /** - * field for LastOperationContext - */ - - - protected org.apache.axis2.context.xsd.OperationContext localLastOperationContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLastOperationContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.OperationContext - */ - public org.apache.axis2.context.xsd.OperationContext getLastOperationContext() { - return this.localLastOperationContext; - } - - - - /** - * Auto generated setter method - * - * @param param LastOperationContext - */ - public void setLastOperationContext(final org.apache.axis2.context.xsd.OperationContext param) { - this.localLastOperationContextTracker = true; - - this.localLastOperationContext = param; - - - } - - - /** - * field for LogCorrelationIDString - */ - - - protected java.lang.String localLogCorrelationIDString; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLogCorrelationIDStringTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getLogCorrelationIDString() { - return this.localLogCorrelationIDString; - } - - - - /** - * Auto generated setter method - * - * @param param LogCorrelationIDString - */ - public void setLogCorrelationIDString(final java.lang.String param) { - this.localLogCorrelationIDStringTracker = true; - - this.localLogCorrelationIDString = param; - - - } - - - /** - * field for MyEPR - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localMyEPR; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMyEPRTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getMyEPR() { - return this.localMyEPR; - } - - - - /** - * Auto generated setter method - * - * @param param MyEPR - */ - public void setMyEPR(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localMyEPRTracker = true; - - this.localMyEPR = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for RootContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localRootContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRootContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getRootContext() { - return this.localRootContext; - } - - - - /** - * Auto generated setter method - * - * @param param RootContext - */ - public void setRootContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localRootContextTracker = true; - - this.localRootContext = param; - - - } - - - /** - * field for ServiceGroupContext - */ - - - protected org.apache.axis2.context.xsd.ServiceGroupContext localServiceGroupContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ServiceGroupContext - */ - public org.apache.axis2.context.xsd.ServiceGroupContext getServiceGroupContext() { - return this.localServiceGroupContext; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupContext - */ - public void setServiceGroupContext(final org.apache.axis2.context.xsd.ServiceGroupContext param) { - this.localServiceGroupContextTracker = true; - - this.localServiceGroupContext = param; - - - } - - - /** - * field for TargetEPR - */ - - - protected org.apache.axis2.addressing.xsd.EndpointReference localTargetEPR; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTargetEPRTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.addressing.xsd.EndpointReference - */ - public org.apache.axis2.addressing.xsd.EndpointReference getTargetEPR() { - return this.localTargetEPR; - } - - - - /** - * Auto generated setter method - * - * @param param TargetEPR - */ - public void setTargetEPR(final org.apache.axis2.addressing.xsd.EndpointReference param) { - this.localTargetEPRTracker = true; - - this.localTargetEPR = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://context.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ServiceContext", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ServiceContext", xmlWriter); - } - - - } - if (this.localAxisServiceTracker) { - if (this.localAxisService == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "axisService", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisService.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "axisService"), xmlWriter); - } - } - if (this.localCachingOperationContextTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "cachingOperationContext", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("cachingOperationContext cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCachingOperationContext)); - } - - xmlWriter.writeEndElement(); - } - if (this.localConfigurationContextTracker) { - if (this.localConfigurationContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "configurationContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConfigurationContext.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "configurationContext"), xmlWriter); - } - } - if (this.localGroupNameTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "groupName", xmlWriter); - - - if (this.localGroupName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localGroupName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localLastOperationContextTracker) { - if (this.localLastOperationContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "lastOperationContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localLastOperationContext.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "lastOperationContext"), xmlWriter); - } - } - if (this.localLogCorrelationIDStringTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "logCorrelationIDString", xmlWriter); - - - if (this.localLogCorrelationIDString == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localLogCorrelationIDString); - - } - - xmlWriter.writeEndElement(); - } - if (this.localMyEPRTracker) { - if (this.localMyEPR == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "myEPR", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMyEPR.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "myEPR"), - xmlWriter); - } - } - if (this.localNameTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localRootContextTracker) { - if (this.localRootContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "rootContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRootContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext"), xmlWriter); - } - } - if (this.localServiceGroupContextTracker) { - if (this.localServiceGroupContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceGroupContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServiceGroupContext.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "serviceGroupContext"), xmlWriter); - } - } - if (this.localTargetEPRTracker) { - if (this.localTargetEPR == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "targetEPR", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTargetEPR.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "targetEPR"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://context.axis2.apache.org/xsd")) { - return "ns10"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAxisServiceTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "axisService")); - - - elementList.add(this.localAxisService == null ? null : this.localAxisService); - } - if (this.localCachingOperationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "cachingOperationContext")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCachingOperationContext)); - } - if (this.localConfigurationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "configurationContext")); - - - elementList.add(this.localConfigurationContext == null ? null : this.localConfigurationContext); - } - if (this.localGroupNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "groupName")); - - elementList.add(this.localGroupName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localGroupName)); - } - if (this.localLastOperationContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "lastOperationContext")); - - - elementList.add(this.localLastOperationContext == null ? null : this.localLastOperationContext); - } - if (this.localLogCorrelationIDStringTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "logCorrelationIDString")); - - elementList.add(this.localLogCorrelationIDString == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLogCorrelationIDString)); - } - if (this.localMyEPRTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "myEPR")); - - - elementList.add(this.localMyEPR == null ? null : this.localMyEPR); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localRootContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "rootContext")); - - - elementList.add(this.localRootContext == null ? null : this.localRootContext); - } - if (this.localServiceGroupContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContext")); - - - elementList.add(this.localServiceGroupContext == null ? null : this.localServiceGroupContext); - } - if (this.localTargetEPRTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "targetEPR")); - - - elementList.add(this.localTargetEPR == null ? null : this.localTargetEPR); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ServiceContext parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ServiceContext object = new ServiceContext(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ServiceContext".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ServiceContext) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "axisService").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisService(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisService(org.apache.axis2.description.xsd.AxisService.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://context.axis2.apache.org/xsd", - "cachingOperationContext").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCachingOperationContext(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://context.axis2.apache.org/xsd", - "configurationContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConfigurationContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setConfigurationContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "groupName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setGroupName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "lastOperationContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setLastOperationContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setLastOperationContext(org.apache.axis2.context.xsd.OperationContext.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://context.axis2.apache.org/xsd", - "logCorrelationIDString").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setLogCorrelationIDString(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "myEPR").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMyEPR(null); - reader.next(); - - reader.next(); - - } else { - - object.setMyEPR(org.apache.axis2.addressing.xsd.EndpointReference.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://context.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRootContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setRootContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "serviceGroupContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServiceGroupContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setServiceGroupContext(org.apache.axis2.context.xsd.ServiceGroupContext.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://context.axis2.apache.org/xsd", - "targetEPR").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTargetEPR(null); - reader.next(); - - reader.next(); - - } else { - - object.setTargetEPR(org.apache.axis2.addressing.xsd.EndpointReference.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ServiceGroupContext.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ServiceGroupContext.java deleted file mode 100644 index 790b8f47e..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/ServiceGroupContext.java +++ /dev/null @@ -1,720 +0,0 @@ - -/** - * ServiceGroupContext.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.context.xsd; - - -/** - * ServiceGroupContext bean class - */ - -public class ServiceGroupContext implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ServiceGroupContext Namespace - * URI = http://context.axis2.apache.org/xsd Namespace Prefix = ns10 - */ - - - /** - * - */ - private static final long serialVersionUID = -8984790554851921943L; - - /** - * field for Description - */ - - - protected org.apache.axis2.description.xsd.AxisServiceGroup localDescription; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDescriptionTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisServiceGroup - */ - public org.apache.axis2.description.xsd.AxisServiceGroup getDescription() { - return this.localDescription; - } - - - - /** - * Auto generated setter method - * - * @param param Description - */ - public void setDescription(final org.apache.axis2.description.xsd.AxisServiceGroup param) { - this.localDescriptionTracker = true; - - this.localDescription = param; - - - } - - - /** - * field for Id - */ - - - protected java.lang.String localId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIdTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getId() { - return this.localId; - } - - - - /** - * Auto generated setter method - * - * @param param Id - */ - public void setId(final java.lang.String param) { - this.localIdTracker = true; - - this.localId = param; - - - } - - - /** - * field for RootContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localRootContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRootContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getRootContext() { - return this.localRootContext; - } - - - - /** - * Auto generated setter method - * - * @param param RootContext - */ - public void setRootContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localRootContextTracker = true; - - this.localRootContext = param; - - - } - - - /** - * field for ServiceContexts - */ - - - protected authclient.java.util.xsd.Iterator localServiceContexts; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceContextsTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getServiceContexts() { - return this.localServiceContexts; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceContexts - */ - public void setServiceContexts(final authclient.java.util.xsd.Iterator param) { - this.localServiceContextsTracker = true; - - this.localServiceContexts = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://context.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ServiceGroupContext", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ServiceGroupContext", - xmlWriter); - } - - - } - if (this.localDescriptionTracker) { - if (this.localDescription == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "description", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localDescription.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "description"), xmlWriter); - } - } - if (this.localIdTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "id", xmlWriter); - - - if (this.localId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localRootContextTracker) { - if (this.localRootContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "rootContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRootContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext"), xmlWriter); - } - } - if (this.localServiceContextsTracker) { - if (this.localServiceContexts == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceContexts", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServiceContexts.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceContexts"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://context.axis2.apache.org/xsd")) { - return "ns10"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localDescriptionTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "description")); - - - elementList.add(this.localDescription == null ? null : this.localDescription); - } - if (this.localIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "id")); - - elementList.add(this.localId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localId)); - } - if (this.localRootContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "rootContext")); - - - elementList.add(this.localRootContext == null ? null : this.localRootContext); - } - if (this.localServiceContextsTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "serviceContexts")); - - - elementList.add(this.localServiceContexts == null ? null : this.localServiceContexts); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ServiceGroupContext parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ServiceGroupContext object = new ServiceGroupContext(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ServiceGroupContext".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ServiceGroupContext) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "description").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setDescription(null); - reader.next(); - - reader.next(); - - } else { - - object.setDescription(org.apache.axis2.description.xsd.AxisServiceGroup.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://context.axis2.apache.org/xsd", - "id").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRootContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setRootContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "serviceContexts").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServiceContexts(null); - reader.next(); - - reader.next(); - - } else { - - object.setServiceContexts(authclient.java.util.xsd.Iterator.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/SessionContext.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/SessionContext.java deleted file mode 100644 index 8313a0c8d..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/context/xsd/SessionContext.java +++ /dev/null @@ -1,717 +0,0 @@ - -/** - * SessionContext.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.context.xsd; - - -/** - * SessionContext bean class - */ - -public class SessionContext implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SessionContext Namespace URI = - * http://context.axis2.apache.org/xsd Namespace Prefix = ns10 - */ - - - /** - * - */ - private static final long serialVersionUID = -3004075048862541922L; - - /** - * field for CookieID - */ - - - protected java.lang.String localCookieID; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCookieIDTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCookieID() { - return this.localCookieID; - } - - - - /** - * Auto generated setter method - * - * @param param CookieID - */ - public void setCookieID(final java.lang.String param) { - this.localCookieIDTracker = true; - - this.localCookieID = param; - - - } - - - /** - * field for LastTouchedTime - */ - - - protected long localLastTouchedTime; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLastTouchedTimeTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getLastTouchedTime() { - return this.localLastTouchedTime; - } - - - - /** - * Auto generated setter method - * - * @param param LastTouchedTime - */ - public void setLastTouchedTime(final long param) { - - // setting primitive attribute tracker to true - this.localLastTouchedTimeTracker = param != java.lang.Long.MIN_VALUE; - - this.localLastTouchedTime = param; - - - } - - - /** - * field for RootContext - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localRootContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRootContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getRootContext() { - return this.localRootContext; - } - - - - /** - * Auto generated setter method - * - * @param param RootContext - */ - public void setRootContext(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localRootContextTracker = true; - - this.localRootContext = param; - - - } - - - /** - * field for ServiceGroupContext - */ - - - protected authclient.java.util.xsd.Iterator localServiceGroupContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupContextTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getServiceGroupContext() { - return this.localServiceGroupContext; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupContext - */ - public void setServiceGroupContext(final authclient.java.util.xsd.Iterator param) { - this.localServiceGroupContextTracker = true; - - this.localServiceGroupContext = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://context.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SessionContext", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SessionContext", xmlWriter); - } - - - } - if (this.localCookieIDTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "cookieID", xmlWriter); - - - if (this.localCookieID == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localCookieID); - - } - - xmlWriter.writeEndElement(); - } - if (this.localLastTouchedTimeTracker) { - namespace = "http://context.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "lastTouchedTime", xmlWriter); - - if (this.localLastTouchedTime == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lastTouchedTime cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLastTouchedTime)); - } - - xmlWriter.writeEndElement(); - } - if (this.localRootContextTracker) { - if (this.localRootContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "rootContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRootContext.serialize(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext"), xmlWriter); - } - } - if (this.localServiceGroupContextTracker) { - if (this.localServiceGroupContext == null) { - - writeStartElement(null, "http://context.axis2.apache.org/xsd", "serviceGroupContext", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServiceGroupContext.serialize(new javax.xml.namespace.QName( - "http://context.axis2.apache.org/xsd", "serviceGroupContext"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://context.axis2.apache.org/xsd")) { - return "ns10"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localCookieIDTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "cookieID")); - - elementList.add(this.localCookieID == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCookieID)); - } - if (this.localLastTouchedTimeTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "lastTouchedTime")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLastTouchedTime)); - } - if (this.localRootContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", "rootContext")); - - - elementList.add(this.localRootContext == null ? null : this.localRootContext); - } - if (this.localServiceGroupContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "serviceGroupContext")); - - - elementList.add(this.localServiceGroupContext == null ? null : this.localServiceGroupContext); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SessionContext parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SessionContext object = new SessionContext(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SessionContext".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SessionContext) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "cookieID").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setCookieID(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "lastTouchedTime").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLastTouchedTime(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLastTouchedTime(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://context.axis2.apache.org/xsd", - "rootContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRootContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setRootContext(org.apache.axis2.context.xsd.ConfigurationContext.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://context.axis2.apache.org/xsd", - "serviceGroupContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServiceGroupContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setServiceGroupContext(authclient.java.util.xsd.Iterator.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/deployment/util/xsd/ExcludeInfo.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/deployment/util/xsd/ExcludeInfo.java deleted file mode 100644 index 14513655f..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/deployment/util/xsd/ExcludeInfo.java +++ /dev/null @@ -1,376 +0,0 @@ - -/** - * ExcludeInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.deployment.util.xsd; - - -/** - * ExcludeInfo bean class - */ - -public class ExcludeInfo implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ExcludeInfo Namespace URI = - * http://util.deployment.axis2.apache.org/xsd Namespace Prefix = ns14 - */ - - - - /** - * - */ - private static final long serialVersionUID = -969069286962278215L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://util.deployment.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ExcludeInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ExcludeInfo", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://util.deployment.axis2.apache.org/xsd")) { - return "ns14"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 ExcludeInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ExcludeInfo object = new ExcludeInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ExcludeInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ExcludeInfo) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/deployment/util/xsd/PhasesInfo.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/deployment/util/xsd/PhasesInfo.java deleted file mode 100644 index f02882a22..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/deployment/util/xsd/PhasesInfo.java +++ /dev/null @@ -1,1558 +0,0 @@ - -/** - * PhasesInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.deployment.util.xsd; - - -/** - * PhasesInfo bean class - */ - -public class PhasesInfo implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = PhasesInfo Namespace URI = - * http://util.deployment.axis2.apache.org/xsd Namespace Prefix = ns14 - */ - - - /** - * - */ - private static final long serialVersionUID = 9013173027493062367L; - - /** - * field for INPhases - */ - - - protected java.lang.Object localINPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localINPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getINPhases() { - return this.localINPhases; - } - - - - /** - * Auto generated setter method - * - * @param param INPhases - */ - public void setINPhases(final java.lang.Object param) { - this.localINPhasesTracker = true; - - this.localINPhases = param; - - - } - - - /** - * field for IN_FaultPhases - */ - - - protected java.lang.Object localIN_FaultPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIN_FaultPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getIN_FaultPhases() { - return this.localIN_FaultPhases; - } - - - - /** - * Auto generated setter method - * - * @param param IN_FaultPhases - */ - public void setIN_FaultPhases(final java.lang.Object param) { - this.localIN_FaultPhasesTracker = true; - - this.localIN_FaultPhases = param; - - - } - - - /** - * field for OUTPhases - */ - - - protected java.lang.Object localOUTPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOUTPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOUTPhases() { - return this.localOUTPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OUTPhases - */ - public void setOUTPhases(final java.lang.Object param) { - this.localOUTPhasesTracker = true; - - this.localOUTPhases = param; - - - } - - - /** - * field for OUT_FaultPhases - */ - - - protected java.lang.Object localOUT_FaultPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOUT_FaultPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOUT_FaultPhases() { - return this.localOUT_FaultPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OUT_FaultPhases - */ - public void setOUT_FaultPhases(final java.lang.Object param) { - this.localOUT_FaultPhasesTracker = true; - - this.localOUT_FaultPhases = param; - - - } - - - /** - * field for GlobalInFaultPhases - */ - - - protected java.lang.Object localGlobalInFaultPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localGlobalInFaultPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getGlobalInFaultPhases() { - return this.localGlobalInFaultPhases; - } - - - - /** - * Auto generated setter method - * - * @param param GlobalInFaultPhases - */ - public void setGlobalInFaultPhases(final java.lang.Object param) { - this.localGlobalInFaultPhasesTracker = true; - - this.localGlobalInFaultPhases = param; - - - } - - - /** - * field for GlobalInflow - */ - - - protected java.lang.Object localGlobalInflow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localGlobalInflowTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getGlobalInflow() { - return this.localGlobalInflow; - } - - - - /** - * Auto generated setter method - * - * @param param GlobalInflow - */ - public void setGlobalInflow(final java.lang.Object param) { - this.localGlobalInflowTracker = true; - - this.localGlobalInflow = param; - - - } - - - /** - * field for GlobalOutPhaseList - */ - - - protected java.lang.Object localGlobalOutPhaseList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localGlobalOutPhaseListTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getGlobalOutPhaseList() { - return this.localGlobalOutPhaseList; - } - - - - /** - * Auto generated setter method - * - * @param param GlobalOutPhaseList - */ - public void setGlobalOutPhaseList(final java.lang.Object param) { - this.localGlobalOutPhaseListTracker = true; - - this.localGlobalOutPhaseList = param; - - - } - - - /** - * field for OperationInFaultPhases - */ - - - protected java.lang.Object localOperationInFaultPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationInFaultPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOperationInFaultPhases() { - return this.localOperationInFaultPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OperationInFaultPhases - */ - public void setOperationInFaultPhases(final java.lang.Object param) { - this.localOperationInFaultPhasesTracker = true; - - this.localOperationInFaultPhases = param; - - - } - - - /** - * field for OperationInPhases - */ - - - protected java.lang.Object localOperationInPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationInPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOperationInPhases() { - return this.localOperationInPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OperationInPhases - */ - public void setOperationInPhases(final java.lang.Object param) { - this.localOperationInPhasesTracker = true; - - this.localOperationInPhases = param; - - - } - - - /** - * field for OperationOutFaultPhases - */ - - - protected java.lang.Object localOperationOutFaultPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationOutFaultPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOperationOutFaultPhases() { - return this.localOperationOutFaultPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OperationOutFaultPhases - */ - public void setOperationOutFaultPhases(final java.lang.Object param) { - this.localOperationOutFaultPhasesTracker = true; - - this.localOperationOutFaultPhases = param; - - - } - - - /** - * field for OperationOutPhases - */ - - - protected java.lang.Object localOperationOutPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationOutPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOperationOutPhases() { - return this.localOperationOutPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OperationOutPhases - */ - public void setOperationOutPhases(final java.lang.Object param) { - this.localOperationOutPhasesTracker = true; - - this.localOperationOutPhases = param; - - - } - - - /** - * field for OperationPhases - */ - - - protected org.apache.axis2.description.xsd.AxisOperation localOperationPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisOperation - */ - public org.apache.axis2.description.xsd.AxisOperation getOperationPhases() { - return this.localOperationPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OperationPhases - */ - public void setOperationPhases(final org.apache.axis2.description.xsd.AxisOperation param) { - this.localOperationPhasesTracker = true; - - this.localOperationPhases = param; - - - } - - - /** - * field for OutFaultPhaseList - */ - - - protected java.lang.Object localOutFaultPhaseList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOutFaultPhaseListTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOutFaultPhaseList() { - return this.localOutFaultPhaseList; - } - - - - /** - * Auto generated setter method - * - * @param param OutFaultPhaseList - */ - public void setOutFaultPhaseList(final java.lang.Object param) { - this.localOutFaultPhaseListTracker = true; - - this.localOutFaultPhaseList = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://util.deployment.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":PhasesInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PhasesInfo", xmlWriter); - } - - - } - if (this.localINPhasesTracker) { - - if (this.localINPhases != null) { - if (this.localINPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localINPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "INPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "INPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localINPhases, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "INPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localIN_FaultPhasesTracker) { - - if (this.localIN_FaultPhases != null) { - if (this.localIN_FaultPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localIN_FaultPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "IN_FaultPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "IN_FaultPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localIN_FaultPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "IN_FaultPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOUTPhasesTracker) { - - if (this.localOUTPhases != null) { - if (this.localOUTPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOUTPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "OUTPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "OUTPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOUTPhases, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "OUTPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOUT_FaultPhasesTracker) { - - if (this.localOUT_FaultPhases != null) { - if (this.localOUT_FaultPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOUT_FaultPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "OUT_FaultPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "OUT_FaultPhases", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOUT_FaultPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "OUT_FaultPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localGlobalInFaultPhasesTracker) { - - if (this.localGlobalInFaultPhases != null) { - if (this.localGlobalInFaultPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localGlobalInFaultPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "globalInFaultPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "globalInFaultPhases", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localGlobalInFaultPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "globalInFaultPhases", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localGlobalInflowTracker) { - - if (this.localGlobalInflow != null) { - if (this.localGlobalInflow instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localGlobalInflow).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "globalInflow"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "globalInflow", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localGlobalInflow, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "globalInflow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localGlobalOutPhaseListTracker) { - - if (this.localGlobalOutPhaseList != null) { - if (this.localGlobalOutPhaseList instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localGlobalOutPhaseList).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "globalOutPhaseList"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "globalOutPhaseList", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localGlobalOutPhaseList, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "globalOutPhaseList", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOperationInFaultPhasesTracker) { - - if (this.localOperationInFaultPhases != null) { - if (this.localOperationInFaultPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOperationInFaultPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "operationInFaultPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationInFaultPhases", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOperationInFaultPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationInFaultPhases", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOperationInPhasesTracker) { - - if (this.localOperationInPhases != null) { - if (this.localOperationInPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOperationInPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "operationInPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationInPhases", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOperationInPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationInPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOperationOutFaultPhasesTracker) { - - if (this.localOperationOutFaultPhases != null) { - if (this.localOperationOutFaultPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOperationOutFaultPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "operationOutFaultPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationOutFaultPhases", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOperationOutFaultPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationOutFaultPhases", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOperationOutPhasesTracker) { - - if (this.localOperationOutPhases != null) { - if (this.localOperationOutPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOperationOutPhases).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "operationOutPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationOutPhases", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOperationOutPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationOutPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOperationPhasesTracker) { - if (this.localOperationPhases == null) { - - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "operationPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localOperationPhases.serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "operationPhases"), xmlWriter); - } - } - if (this.localOutFaultPhaseListTracker) { - - if (this.localOutFaultPhaseList != null) { - if (this.localOutFaultPhaseList instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOutFaultPhaseList).serialize(new javax.xml.namespace.QName( - "http://util.deployment.axis2.apache.org/xsd", "outFaultPhaseList"), xmlWriter, true); - } else { - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "outFaultPhaseList", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOutFaultPhaseList, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://util.deployment.axis2.apache.org/xsd", "outFaultPhaseList", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://util.deployment.axis2.apache.org/xsd")) { - return "ns14"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localINPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", "INPhases")); - - - elementList.add(this.localINPhases == null ? null : this.localINPhases); - } - if (this.localIN_FaultPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "IN_FaultPhases")); - - - elementList.add(this.localIN_FaultPhases == null ? null : this.localIN_FaultPhases); - } - if (this.localOUTPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", "OUTPhases")); - - - elementList.add(this.localOUTPhases == null ? null : this.localOUTPhases); - } - if (this.localOUT_FaultPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "OUT_FaultPhases")); - - - elementList.add(this.localOUT_FaultPhases == null ? null : this.localOUT_FaultPhases); - } - if (this.localGlobalInFaultPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "globalInFaultPhases")); - - - elementList.add(this.localGlobalInFaultPhases == null ? null : this.localGlobalInFaultPhases); - } - if (this.localGlobalInflowTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "globalInflow")); - - - elementList.add(this.localGlobalInflow == null ? null : this.localGlobalInflow); - } - if (this.localGlobalOutPhaseListTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "globalOutPhaseList")); - - - elementList.add(this.localGlobalOutPhaseList == null ? null : this.localGlobalOutPhaseList); - } - if (this.localOperationInFaultPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationInFaultPhases")); - - - elementList.add(this.localOperationInFaultPhases == null ? null : this.localOperationInFaultPhases); - } - if (this.localOperationInPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationInPhases")); - - - elementList.add(this.localOperationInPhases == null ? null : this.localOperationInPhases); - } - if (this.localOperationOutFaultPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationOutFaultPhases")); - - - elementList.add(this.localOperationOutFaultPhases == null ? null : this.localOperationOutFaultPhases); - } - if (this.localOperationOutPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationOutPhases")); - - - elementList.add(this.localOperationOutPhases == null ? null : this.localOperationOutPhases); - } - if (this.localOperationPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationPhases")); - - - elementList.add(this.localOperationPhases == null ? null : this.localOperationPhases); - } - if (this.localOutFaultPhaseListTracker) { - elementList.add(new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "outFaultPhaseList")); - - - elementList.add(this.localOutFaultPhaseList == null ? null : this.localOutFaultPhaseList); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static PhasesInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final PhasesInfo object = new PhasesInfo(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"PhasesInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PhasesInfo) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "INPhases").equals(reader.getName())) { - - object.setINPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "IN_FaultPhases").equals(reader.getName())) { - - object.setIN_FaultPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "OUTPhases").equals(reader.getName())) { - - object.setOUTPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "OUT_FaultPhases").equals(reader.getName())) { - - object.setOUT_FaultPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "globalInFaultPhases").equals(reader.getName())) { - - object.setGlobalInFaultPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "globalInflow").equals(reader.getName())) { - - object.setGlobalInflow(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "globalOutPhaseList").equals(reader.getName())) { - - object.setGlobalOutPhaseList(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationInFaultPhases").equals(reader.getName())) { - - object.setOperationInFaultPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationInPhases").equals(reader.getName())) { - - object.setOperationInPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationOutFaultPhases").equals(reader.getName())) { - - object.setOperationOutFaultPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationOutPhases").equals(reader.getName())) { - - object.setOperationOutPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://util.deployment.axis2.apache.org/xsd", - "operationPhases").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setOperationPhases(null); - reader.next(); - - reader.next(); - - } else { - - object.setOperationPhases(org.apache.axis2.description.xsd.AxisOperation.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://util.deployment.axis2.apache.org/xsd", - "outFaultPhaseList").equals(reader.getName())) { - - object.setOutFaultPhaseList(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/java2wsdl/xsd/TypeTable.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/java2wsdl/xsd/TypeTable.java deleted file mode 100644 index 79337c5fe..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/java2wsdl/xsd/TypeTable.java +++ /dev/null @@ -1,460 +0,0 @@ - -/** - * TypeTable.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.java2wsdl.xsd; - - -/** - * TypeTable bean class - */ - -public class TypeTable implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = TypeTable Namespace URI = - * http://java2wsdl.description.axis2.apache.org/xsd Namespace Prefix = ns20 - */ - - - /** - * - */ - private static final long serialVersionUID = -6198251403749843239L; - - /** - * field for ComplexSchemaMap - */ - - - protected authclient.java.util.xsd.Map localComplexSchemaMap; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localComplexSchemaMapTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getComplexSchemaMap() { - return this.localComplexSchemaMap; - } - - - - /** - * Auto generated setter method - * - * @param param ComplexSchemaMap - */ - public void setComplexSchemaMap(final authclient.java.util.xsd.Map param) { - this.localComplexSchemaMapTracker = true; - - this.localComplexSchemaMap = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://java2wsdl.description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":TypeTable", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "TypeTable", xmlWriter); - } - - - } - if (this.localComplexSchemaMapTracker) { - if (this.localComplexSchemaMap == null) { - - writeStartElement(null, "http://java2wsdl.description.axis2.apache.org/xsd", "complexSchemaMap", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localComplexSchemaMap.serialize(new javax.xml.namespace.QName( - "http://java2wsdl.description.axis2.apache.org/xsd", "complexSchemaMap"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://java2wsdl.description.axis2.apache.org/xsd")) { - return "ns20"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localComplexSchemaMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://java2wsdl.description.axis2.apache.org/xsd", - "complexSchemaMap")); - - - elementList.add(this.localComplexSchemaMap == null ? null : this.localComplexSchemaMap); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static TypeTable parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TypeTable object = new TypeTable(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"TypeTable".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TypeTable) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://java2wsdl.description.axis2.apache.org/xsd", - "complexSchemaMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setComplexSchemaMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setComplexSchemaMap(authclient.java.util.xsd.Map.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisMessage.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisMessage.java deleted file mode 100644 index 920fe4e33..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisMessage.java +++ /dev/null @@ -1,1807 +0,0 @@ - -/** - * AxisMessage.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * AxisMessage bean class - */ - -public class AxisMessage implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = AxisMessage Namespace URI = - * http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = -3847681205553387581L; - - /** - * field for AxisOperation - */ - - - protected org.apache.axis2.description.xsd.AxisOperation localAxisOperation; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisOperationTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisOperation - */ - public org.apache.axis2.description.xsd.AxisOperation getAxisOperation() { - return this.localAxisOperation; - } - - - - /** - * Auto generated setter method - * - * @param param AxisOperation - */ - public void setAxisOperation(final org.apache.axis2.description.xsd.AxisOperation param) { - this.localAxisOperationTracker = true; - - this.localAxisOperation = param; - - - } - - - /** - * field for Direction - */ - - - protected java.lang.String localDirection; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDirectionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getDirection() { - return this.localDirection; - } - - - - /** - * Auto generated setter method - * - * @param param Direction - */ - public void setDirection(final java.lang.String param) { - this.localDirectionTracker = true; - - this.localDirection = param; - - - } - - - /** - * field for EffectivePolicy - */ - - - protected org.apache.neethi.xsd.Policy localEffectivePolicy; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEffectivePolicyTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.neethi.xsd.Policy - */ - public org.apache.neethi.xsd.Policy getEffectivePolicy() { - return this.localEffectivePolicy; - } - - - - /** - * Auto generated setter method - * - * @param param EffectivePolicy - */ - public void setEffectivePolicy(final org.apache.neethi.xsd.Policy param) { - this.localEffectivePolicyTracker = true; - - this.localEffectivePolicy = param; - - - } - - - /** - * field for ElementQName - */ - - - protected java.lang.Object localElementQName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localElementQNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getElementQName() { - return this.localElementQName; - } - - - - /** - * Auto generated setter method - * - * @param param ElementQName - */ - public void setElementQName(final java.lang.Object param) { - this.localElementQNameTracker = true; - - this.localElementQName = param; - - - } - - - /** - * field for ExtensibilityAttributes - */ - - - protected java.lang.Object localExtensibilityAttributes; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtensibilityAttributesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getExtensibilityAttributes() { - return this.localExtensibilityAttributes; - } - - - - /** - * Auto generated setter method - * - * @param param ExtensibilityAttributes - */ - public void setExtensibilityAttributes(final java.lang.Object param) { - this.localExtensibilityAttributesTracker = true; - - this.localExtensibilityAttributes = param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.Object localKey; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localKeyTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getKey() { - return this.localKey; - } - - - - /** - * Auto generated setter method - * - * @param param Key - */ - public void setKey(final java.lang.Object param) { - this.localKeyTracker = true; - - this.localKey = param; - - - } - - - /** - * field for MessageFlow - */ - - - protected java.lang.Object localMessageFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessageFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getMessageFlow() { - return this.localMessageFlow; - } - - - - /** - * Auto generated setter method - * - * @param param MessageFlow - */ - public void setMessageFlow(final java.lang.Object param) { - this.localMessageFlowTracker = true; - - this.localMessageFlow = param; - - - } - - - /** - * field for MessagePartName - */ - - - protected java.lang.String localMessagePartName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessagePartNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getMessagePartName() { - return this.localMessagePartName; - } - - - - /** - * Auto generated setter method - * - * @param param MessagePartName - */ - public void setMessagePartName(final java.lang.String param) { - this.localMessagePartNameTracker = true; - - this.localMessagePartName = param; - - - } - - - /** - * field for Modulerefs This was an Array! - */ - - - protected java.lang.String[] localModulerefs; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localModulerefsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getModulerefs() { - return this.localModulerefs; - } - - - - /** - * validate the array for Modulerefs - */ - protected void validateModulerefs(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Modulerefs - */ - public void setModulerefs(final java.lang.String[] param) { - - validateModulerefs(param); - - this.localModulerefsTracker = true; - - this.localModulerefs = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addModulerefs(final java.lang.String param) { - if (this.localModulerefs == null) { - this.localModulerefs = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localModulerefsTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localModulerefs); - list.add(param); - this.localModulerefs = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for PartName - */ - - - protected java.lang.String localPartName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPartNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPartName() { - return this.localPartName; - } - - - - /** - * Auto generated setter method - * - * @param param PartName - */ - public void setPartName(final java.lang.String param) { - this.localPartNameTracker = true; - - this.localPartName = param; - - - } - - - /** - * field for PolicyUpdated - */ - - - protected boolean localPolicyUpdated; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPolicyUpdatedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getPolicyUpdated() { - return this.localPolicyUpdated; - } - - - - /** - * Auto generated setter method - * - * @param param PolicyUpdated - */ - public void setPolicyUpdated(final boolean param) { - - // setting primitive attribute tracker to true - this.localPolicyUpdatedTracker = true; - - this.localPolicyUpdated = param; - - - } - - - /** - * field for SchemaElement - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaElement localSchemaElement; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaElementTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaElement - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaElement getSchemaElement() { - return this.localSchemaElement; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaElement - */ - public void setSchemaElement(final org.apache.ws.commons.schema.xsd.XmlSchemaElement param) { - this.localSchemaElementTracker = true; - - this.localSchemaElement = param; - - - } - - - /** - * field for SoapHeaders - */ - - - protected java.lang.Object localSoapHeaders; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSoapHeadersTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getSoapHeaders() { - return this.localSoapHeaders; - } - - - - /** - * Auto generated setter method - * - * @param param SoapHeaders - */ - public void setSoapHeaders(final java.lang.Object param) { - this.localSoapHeadersTracker = true; - - this.localSoapHeaders = param; - - - } - - - /** - * field for Wrapped - */ - - - protected boolean localWrapped; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localWrappedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getWrapped() { - return this.localWrapped; - } - - - - /** - * Auto generated setter method - * - * @param param Wrapped - */ - public void setWrapped(final boolean param) { - - // setting primitive attribute tracker to true - this.localWrappedTracker = true; - - this.localWrapped = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AxisMessage", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AxisMessage", xmlWriter); - } - - - } - if (this.localAxisOperationTracker) { - if (this.localAxisOperation == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "axisOperation", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisOperation.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "axisOperation"), xmlWriter); - } - } - if (this.localDirectionTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "direction", xmlWriter); - - - if (this.localDirection == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localDirection); - - } - - xmlWriter.writeEndElement(); - } - if (this.localEffectivePolicyTracker) { - if (this.localEffectivePolicy == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "effectivePolicy", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localEffectivePolicy.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "effectivePolicy"), xmlWriter); - } - } - if (this.localElementQNameTracker) { - - if (this.localElementQName != null) { - if (this.localElementQName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localElementQName).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "elementQName"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "elementQName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localElementQName, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "elementQName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localExtensibilityAttributesTracker) { - - if (this.localExtensibilityAttributes != null) { - if (this.localExtensibilityAttributes instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localExtensibilityAttributes).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "extensibilityAttributes"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "extensibilityAttributes", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localExtensibilityAttributes, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "extensibilityAttributes", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localKeyTracker) { - - if (this.localKey != null) { - if (this.localKey instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localKey).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "key"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "key", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localKey, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "key", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localMessageFlowTracker) { - - if (this.localMessageFlow != null) { - if (this.localMessageFlow instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localMessageFlow).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "messageFlow"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "messageFlow", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localMessageFlow, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "messageFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localMessagePartNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "messagePartName", xmlWriter); - - - if (this.localMessagePartName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localMessagePartName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localModulerefsTracker) { - if (this.localModulerefs != null) { - namespace = "http://description.axis2.apache.org/xsd"; - for (final String localModuleref : this.localModulerefs) { - - if (localModuleref != null) { - - writeStartElement(null, namespace, "modulerefs", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localModuleref)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "modulerefs", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "modulerefs", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPartNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "partName", xmlWriter); - - - if (this.localPartName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPartName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPolicyUpdatedTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "policyUpdated", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("policyUpdated cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPolicyUpdated)); - } - - xmlWriter.writeEndElement(); - } - if (this.localSchemaElementTracker) { - if (this.localSchemaElement == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "schemaElement", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSchemaElement.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "schemaElement"), xmlWriter); - } - } - if (this.localSoapHeadersTracker) { - - if (this.localSoapHeaders != null) { - if (this.localSoapHeaders instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localSoapHeaders).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "soapHeaders"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "soapHeaders", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localSoapHeaders, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "soapHeaders", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localWrappedTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "wrapped", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("wrapped cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWrapped)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAxisOperationTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "axisOperation")); - - - elementList.add(this.localAxisOperation == null ? null : this.localAxisOperation); - } - if (this.localDirectionTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "direction")); - - elementList.add(this.localDirection == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDirection)); - } - if (this.localEffectivePolicyTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "effectivePolicy")); - - - elementList.add(this.localEffectivePolicy == null ? null : this.localEffectivePolicy); - } - if (this.localElementQNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "elementQName")); - - - elementList.add(this.localElementQName == null ? null : this.localElementQName); - } - if (this.localExtensibilityAttributesTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "extensibilityAttributes")); - - - elementList.add(this.localExtensibilityAttributes == null ? null : this.localExtensibilityAttributes); - } - if (this.localKeyTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "key")); - - - elementList.add(this.localKey == null ? null : this.localKey); - } - if (this.localMessageFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "messageFlow")); - - - elementList.add(this.localMessageFlow == null ? null : this.localMessageFlow); - } - if (this.localMessagePartNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messagePartName")); - - elementList.add(this.localMessagePartName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMessagePartName)); - } - if (this.localModulerefsTracker) { - if (this.localModulerefs != null) { - for (final String localModuleref : this.localModulerefs) { - - if (localModuleref != null) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "modulerefs")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localModuleref)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "modulerefs")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "modulerefs")); - elementList.add(null); - - } - - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localPartNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "partName")); - - elementList.add(this.localPartName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPartName)); - } - if (this.localPolicyUpdatedTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "policyUpdated")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPolicyUpdated)); - } - if (this.localSchemaElementTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "schemaElement")); - - - elementList.add(this.localSchemaElement == null ? null : this.localSchemaElement); - } - if (this.localSoapHeadersTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "soapHeaders")); - - - elementList.add(this.localSoapHeaders == null ? null : this.localSoapHeaders); - } - if (this.localWrappedTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "wrapped")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWrapped)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AxisMessage parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AxisMessage object = new AxisMessage(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AxisMessage".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AxisMessage) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list9 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "axisOperation").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisOperation(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisOperation(org.apache.axis2.description.xsd.AxisOperation.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://description.axis2.apache.org/xsd", - "direction").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setDirection(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "effectivePolicy").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setEffectivePolicy(null); - reader.next(); - - reader.next(); - - } else { - - object.setEffectivePolicy(org.apache.neethi.xsd.Policy.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://description.axis2.apache.org/xsd", - "elementQName").equals(reader.getName())) { - - object.setElementQName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "extensibilityAttributes").equals(reader.getName())) { - - object.setExtensibilityAttributes(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "key").equals(reader.getName())) { - - object.setKey(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageFlow").equals(reader.getName())) { - - object.setMessageFlow(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messagePartName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setMessagePartName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "modulerefs").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list9.add(null); - - reader.next(); - } else { - list9.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone9 = false; - while (!loopDone9) { - // 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 - loopDone9 = true; - } else { - if (new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "modulerefs").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list9.add(null); - - reader.next(); - } else { - list9.add(reader.getElementText()); - } - } else { - loopDone9 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setModulerefs((java.lang.String[]) list9.toArray(new java.lang.String[list9.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://description.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "partName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPartName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "policyUpdated").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPolicyUpdated(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://description.axis2.apache.org/xsd", - "schemaElement").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSchemaElement(null); - reader.next(); - - reader.next(); - - } else { - - object.setSchemaElement(org.apache.ws.commons.schema.xsd.XmlSchemaElement.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://description.axis2.apache.org/xsd", - "soapHeaders").equals(reader.getName())) { - - object.setSoapHeaders(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "wrapped").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setWrapped(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisOperation.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisOperation.java deleted file mode 100644 index 639242f5c..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisOperation.java +++ /dev/null @@ -1,2560 +0,0 @@ - -/** - * AxisOperation.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * AxisOperation bean class - */ - -public abstract class AxisOperation implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = AxisOperation Namespace URI = - * http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = 3269888011500769352L; - - /** - * field for WSAMappingList - */ - - - protected java.lang.Object localWSAMappingList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localWSAMappingListTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getWSAMappingList() { - return this.localWSAMappingList; - } - - - - /** - * Auto generated setter method - * - * @param param WSAMappingList - */ - public void setWSAMappingList(final java.lang.Object param) { - this.localWSAMappingListTracker = true; - - this.localWSAMappingList = param; - - - } - - - /** - * field for AxisService - */ - - - protected org.apache.axis2.description.xsd.AxisService localAxisService; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisServiceTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisService - */ - public org.apache.axis2.description.xsd.AxisService getAxisService() { - return this.localAxisService; - } - - - - /** - * Auto generated setter method - * - * @param param AxisService - */ - public void setAxisService(final org.apache.axis2.description.xsd.AxisService param) { - this.localAxisServiceTracker = true; - - this.localAxisService = param; - - - } - - - /** - * field for AxisSpecificMEPConstant - */ - - - protected int localAxisSpecificMEPConstant; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisSpecificMEPConstantTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getAxisSpecificMEPConstant() { - return this.localAxisSpecificMEPConstant; - } - - - - /** - * Auto generated setter method - * - * @param param AxisSpecificMEPConstant - */ - public void setAxisSpecificMEPConstant(final int param) { - - // setting primitive attribute tracker to true - this.localAxisSpecificMEPConstantTracker = param != java.lang.Integer.MIN_VALUE; - - this.localAxisSpecificMEPConstant = param; - - - } - - - /** - * field for ControlOperation - */ - - - protected boolean localControlOperation; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localControlOperationTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getControlOperation() { - return this.localControlOperation; - } - - - - /** - * Auto generated setter method - * - * @param param ControlOperation - */ - public void setControlOperation(final boolean param) { - - // setting primitive attribute tracker to true - this.localControlOperationTracker = true; - - this.localControlOperation = param; - - - } - - - /** - * field for FaultAction - */ - - - protected java.lang.String localFaultAction; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultActionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFaultAction() { - return this.localFaultAction; - } - - - - /** - * Auto generated setter method - * - * @param param FaultAction - */ - public void setFaultAction(final java.lang.String param) { - this.localFaultActionTracker = true; - - this.localFaultAction = param; - - - } - - - /** - * field for FaultActionNames This was an Array! - */ - - - protected java.lang.String[] localFaultActionNames; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultActionNamesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getFaultActionNames() { - return this.localFaultActionNames; - } - - - - /** - * validate the array for FaultActionNames - */ - protected void validateFaultActionNames(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param FaultActionNames - */ - public void setFaultActionNames(final java.lang.String[] param) { - - validateFaultActionNames(param); - - this.localFaultActionNamesTracker = true; - - this.localFaultActionNames = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addFaultActionNames(final java.lang.String param) { - if (this.localFaultActionNames == null) { - this.localFaultActionNames = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localFaultActionNamesTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localFaultActionNames); - list.add(param); - this.localFaultActionNames = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for FaultMessages - */ - - - protected java.lang.Object localFaultMessages; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultMessagesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getFaultMessages() { - return this.localFaultMessages; - } - - - - /** - * Auto generated setter method - * - * @param param FaultMessages - */ - public void setFaultMessages(final java.lang.Object param) { - this.localFaultMessagesTracker = true; - - this.localFaultMessages = param; - - - } - - - /** - * field for InputAction - */ - - - protected java.lang.String localInputAction; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInputActionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getInputAction() { - return this.localInputAction; - } - - - - /** - * Auto generated setter method - * - * @param param InputAction - */ - public void setInputAction(final java.lang.String param) { - this.localInputActionTracker = true; - - this.localInputAction = param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.Object localKey; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localKeyTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getKey() { - return this.localKey; - } - - - - /** - * Auto generated setter method - * - * @param param Key - */ - public void setKey(final java.lang.Object param) { - this.localKeyTracker = true; - - this.localKey = param; - - - } - - - /** - * field for MessageExchangePattern - */ - - - protected java.lang.String localMessageExchangePattern; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessageExchangePatternTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getMessageExchangePattern() { - return this.localMessageExchangePattern; - } - - - - /** - * Auto generated setter method - * - * @param param MessageExchangePattern - */ - public void setMessageExchangePattern(final java.lang.String param) { - this.localMessageExchangePatternTracker = true; - - this.localMessageExchangePattern = param; - - - } - - - /** - * field for MessageReceiver - */ - - - protected org.apache.axis2.engine.xsd.MessageReceiver localMessageReceiver; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessageReceiverTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.MessageReceiver - */ - public org.apache.axis2.engine.xsd.MessageReceiver getMessageReceiver() { - return this.localMessageReceiver; - } - - - - /** - * Auto generated setter method - * - * @param param MessageReceiver - */ - public void setMessageReceiver(final org.apache.axis2.engine.xsd.MessageReceiver param) { - this.localMessageReceiverTracker = true; - - this.localMessageReceiver = param; - - - } - - - /** - * field for Messages - */ - - - protected authclient.java.util.xsd.Iterator localMessages; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessagesTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getMessages() { - return this.localMessages; - } - - - - /** - * Auto generated setter method - * - * @param param Messages - */ - public void setMessages(final authclient.java.util.xsd.Iterator param) { - this.localMessagesTracker = true; - - this.localMessages = param; - - - } - - - /** - * field for ModuleRefs - */ - - - protected java.lang.Object localModuleRefs; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localModuleRefsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getModuleRefs() { - return this.localModuleRefs; - } - - - - /** - * Auto generated setter method - * - * @param param ModuleRefs - */ - public void setModuleRefs(final java.lang.Object param) { - this.localModuleRefsTracker = true; - - this.localModuleRefs = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.Object localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.Object param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for OutputAction - */ - - - protected java.lang.String localOutputAction; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOutputActionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getOutputAction() { - return this.localOutputAction; - } - - - - /** - * Auto generated setter method - * - * @param param OutputAction - */ - public void setOutputAction(final java.lang.String param) { - this.localOutputActionTracker = true; - - this.localOutputAction = param; - - - } - - - /** - * field for PhasesInFaultFlow - */ - - - protected java.lang.Object localPhasesInFaultFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhasesInFaultFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getPhasesInFaultFlow() { - return this.localPhasesInFaultFlow; - } - - - - /** - * Auto generated setter method - * - * @param param PhasesInFaultFlow - */ - public void setPhasesInFaultFlow(final java.lang.Object param) { - this.localPhasesInFaultFlowTracker = true; - - this.localPhasesInFaultFlow = param; - - - } - - - /** - * field for PhasesOutFaultFlow - */ - - - protected java.lang.Object localPhasesOutFaultFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhasesOutFaultFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getPhasesOutFaultFlow() { - return this.localPhasesOutFaultFlow; - } - - - - /** - * Auto generated setter method - * - * @param param PhasesOutFaultFlow - */ - public void setPhasesOutFaultFlow(final java.lang.Object param) { - this.localPhasesOutFaultFlowTracker = true; - - this.localPhasesOutFaultFlow = param; - - - } - - - /** - * field for PhasesOutFlow - */ - - - protected java.lang.Object localPhasesOutFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhasesOutFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getPhasesOutFlow() { - return this.localPhasesOutFlow; - } - - - - /** - * Auto generated setter method - * - * @param param PhasesOutFlow - */ - public void setPhasesOutFlow(final java.lang.Object param) { - this.localPhasesOutFlowTracker = true; - - this.localPhasesOutFlow = param; - - - } - - - /** - * field for RemainingPhasesInFlow - */ - - - protected java.lang.Object localRemainingPhasesInFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRemainingPhasesInFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getRemainingPhasesInFlow() { - return this.localRemainingPhasesInFlow; - } - - - - /** - * Auto generated setter method - * - * @param param RemainingPhasesInFlow - */ - public void setRemainingPhasesInFlow(final java.lang.Object param) { - this.localRemainingPhasesInFlowTracker = true; - - this.localRemainingPhasesInFlow = param; - - - } - - - /** - * field for SoapAction - */ - - - protected java.lang.String localSoapAction; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSoapActionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSoapAction() { - return this.localSoapAction; - } - - - - /** - * Auto generated setter method - * - * @param param SoapAction - */ - public void setSoapAction(final java.lang.String param) { - this.localSoapActionTracker = true; - - this.localSoapAction = param; - - - } - - - /** - * field for Style - */ - - - protected java.lang.String localStyle; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localStyleTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getStyle() { - return this.localStyle; - } - - - - /** - * Auto generated setter method - * - * @param param Style - */ - public void setStyle(final java.lang.String param) { - this.localStyleTracker = true; - - this.localStyle = param; - - - } - - - /** - * field for WsamappingListE This was an Array! - */ - - - protected java.lang.String[] localWsamappingListE; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localWsamappingListETracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getWsamappingListE() { - return this.localWsamappingListE; - } - - - - /** - * validate the array for WsamappingListE - */ - protected void validateWsamappingListE(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param WsamappingListE - */ - public void setWsamappingListE(final java.lang.String[] param) { - - validateWsamappingListE(param); - - this.localWsamappingListETracker = true; - - this.localWsamappingListE = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addWsamappingListE(final java.lang.String param) { - if (this.localWsamappingListE == null) { - this.localWsamappingListE = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localWsamappingListETracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localWsamappingListE); - list.add(param); - this.localWsamappingListE = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AxisOperation", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AxisOperation", xmlWriter); - } - - - } - if (this.localWSAMappingListTracker) { - - if (this.localWSAMappingList != null) { - if (this.localWSAMappingList instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localWSAMappingList).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "WSAMappingList"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "WSAMappingList", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localWSAMappingList, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "WSAMappingList", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localAxisServiceTracker) { - if (this.localAxisService == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "axisService", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisService.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "axisService"), xmlWriter); - } - } - if (this.localAxisSpecificMEPConstantTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "axisSpecificMEPConstant", xmlWriter); - - if (this.localAxisSpecificMEPConstant == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("axisSpecificMEPConstant cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAxisSpecificMEPConstant)); - } - - xmlWriter.writeEndElement(); - } - if (this.localControlOperationTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "controlOperation", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("controlOperation cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localControlOperation)); - } - - xmlWriter.writeEndElement(); - } - if (this.localFaultActionTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "faultAction", xmlWriter); - - - if (this.localFaultAction == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localFaultAction); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFaultActionNamesTracker) { - if (this.localFaultActionNames != null) { - namespace = "http://description.axis2.apache.org/xsd"; - for (final String localFaultActionName : this.localFaultActionNames) { - - if (localFaultActionName != null) { - - writeStartElement(null, namespace, "faultActionNames", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFaultActionName)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "faultActionNames", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "faultActionNames", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localFaultMessagesTracker) { - - if (this.localFaultMessages != null) { - if (this.localFaultMessages instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localFaultMessages).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "faultMessages"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "faultMessages", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localFaultMessages, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "faultMessages", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localInputActionTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "inputAction", xmlWriter); - - - if (this.localInputAction == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localInputAction); - - } - - xmlWriter.writeEndElement(); - } - if (this.localKeyTracker) { - - if (this.localKey != null) { - if (this.localKey instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localKey).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "key"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "key", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localKey, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "key", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localMessageExchangePatternTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "messageExchangePattern", xmlWriter); - - - if (this.localMessageExchangePattern == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localMessageExchangePattern); - - } - - xmlWriter.writeEndElement(); - } - if (this.localMessageReceiverTracker) { - if (this.localMessageReceiver == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "messageReceiver", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMessageReceiver.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "messageReceiver"), xmlWriter); - } - } - if (this.localMessagesTracker) { - if (this.localMessages == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "messages", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMessages.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messages"), xmlWriter); - } - } - if (this.localModuleRefsTracker) { - - if (this.localModuleRefs != null) { - if (this.localModuleRefs instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localModuleRefs).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "moduleRefs"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "moduleRefs", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localModuleRefs, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "moduleRefs", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localNameTracker) { - - if (this.localName != null) { - if (this.localName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localName).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "name"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "name", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localName, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "name", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOutputActionTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "outputAction", xmlWriter); - - - if (this.localOutputAction == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localOutputAction); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPhasesInFaultFlowTracker) { - - if (this.localPhasesInFaultFlow != null) { - if (this.localPhasesInFaultFlow instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localPhasesInFaultFlow).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "phasesInFaultFlow"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "phasesInFaultFlow", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localPhasesInFaultFlow, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "phasesInFaultFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localPhasesOutFaultFlowTracker) { - - if (this.localPhasesOutFaultFlow != null) { - if (this.localPhasesOutFaultFlow instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localPhasesOutFaultFlow).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "phasesOutFaultFlow"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "phasesOutFaultFlow", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localPhasesOutFaultFlow, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "phasesOutFaultFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localPhasesOutFlowTracker) { - - if (this.localPhasesOutFlow != null) { - if (this.localPhasesOutFlow instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localPhasesOutFlow).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "phasesOutFlow"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "phasesOutFlow", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localPhasesOutFlow, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "phasesOutFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localRemainingPhasesInFlowTracker) { - - if (this.localRemainingPhasesInFlow != null) { - if (this.localRemainingPhasesInFlow instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localRemainingPhasesInFlow).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "remainingPhasesInFlow"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "remainingPhasesInFlow", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localRemainingPhasesInFlow, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "remainingPhasesInFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localSoapActionTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "soapAction", xmlWriter); - - - if (this.localSoapAction == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSoapAction); - - } - - xmlWriter.writeEndElement(); - } - if (this.localStyleTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "style", xmlWriter); - - - if (this.localStyle == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localStyle); - - } - - xmlWriter.writeEndElement(); - } - if (this.localWsamappingListETracker) { - if (this.localWsamappingListE != null) { - namespace = "http://description.axis2.apache.org/xsd"; - for (final String element : this.localWsamappingListE) { - - if (element != null) { - - writeStartElement(null, namespace, "wsamappingList", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "wsamappingList", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "wsamappingList", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localWSAMappingListTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "WSAMappingList")); - - - elementList.add(this.localWSAMappingList == null ? null : this.localWSAMappingList); - } - if (this.localAxisServiceTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "axisService")); - - - elementList.add(this.localAxisService == null ? null : this.localAxisService); - } - if (this.localAxisSpecificMEPConstantTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "axisSpecificMEPConstant")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAxisSpecificMEPConstant)); - } - if (this.localControlOperationTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "controlOperation")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localControlOperation)); - } - if (this.localFaultActionTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "faultAction")); - - elementList.add(this.localFaultAction == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFaultAction)); - } - if (this.localFaultActionNamesTracker) { - if (this.localFaultActionNames != null) { - for (final String localFaultActionName : this.localFaultActionNames) { - - if (localFaultActionName != null) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultActionNames")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFaultActionName)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultActionNames")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultActionNames")); - elementList.add(null); - - } - - } - if (this.localFaultMessagesTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "faultMessages")); - - - elementList.add(this.localFaultMessages == null ? null : this.localFaultMessages); - } - if (this.localInputActionTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "inputAction")); - - elementList.add(this.localInputAction == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localInputAction)); - } - if (this.localKeyTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "key")); - - - elementList.add(this.localKey == null ? null : this.localKey); - } - if (this.localMessageExchangePatternTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageExchangePattern")); - - elementList.add(this.localMessageExchangePattern == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMessageExchangePattern)); - } - if (this.localMessageReceiverTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageReceiver")); - - - elementList.add(this.localMessageReceiver == null ? null : this.localMessageReceiver); - } - if (this.localMessagesTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "messages")); - - - elementList.add(this.localMessages == null ? null : this.localMessages); - } - if (this.localModuleRefsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "moduleRefs")); - - - elementList.add(this.localModuleRefs == null ? null : this.localModuleRefs); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "name")); - - - elementList.add(this.localName == null ? null : this.localName); - } - if (this.localOutputActionTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "outputAction")); - - elementList.add(this.localOutputAction == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOutputAction)); - } - if (this.localPhasesInFaultFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "phasesInFaultFlow")); - - - elementList.add(this.localPhasesInFaultFlow == null ? null : this.localPhasesInFaultFlow); - } - if (this.localPhasesOutFaultFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "phasesOutFaultFlow")); - - - elementList.add(this.localPhasesOutFaultFlow == null ? null : this.localPhasesOutFaultFlow); - } - if (this.localPhasesOutFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "phasesOutFlow")); - - - elementList.add(this.localPhasesOutFlow == null ? null : this.localPhasesOutFlow); - } - if (this.localRemainingPhasesInFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "remainingPhasesInFlow")); - - - elementList.add(this.localRemainingPhasesInFlow == null ? null : this.localRemainingPhasesInFlow); - } - if (this.localSoapActionTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "soapAction")); - - elementList.add(this.localSoapAction == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSoapAction)); - } - if (this.localStyleTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "style")); - - elementList.add(this.localStyle == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localStyle)); - } - if (this.localWsamappingListETracker) { - if (this.localWsamappingListE != null) { - for (final String element : this.localWsamappingListE) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "wsamappingList")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "wsamappingList")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "wsamappingList")); - elementList.add(null); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AxisOperation parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AxisOperation object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AxisOperation".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AxisOperation) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list6 = new java.util.ArrayList(); - - final java.util.ArrayList list22 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "WSAMappingList").equals(reader.getName())) { - - object.setWSAMappingList(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "axisService").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisService(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisService(org.apache.axis2.description.xsd.AxisService.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://description.axis2.apache.org/xsd", - "axisSpecificMEPConstant").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setAxisSpecificMEPConstant(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setAxisSpecificMEPConstant(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "controlOperation").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setControlOperation(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://description.axis2.apache.org/xsd", - "faultAction").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setFaultAction(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultActionNames").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list6.add(null); - - reader.next(); - } else { - list6.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone6 = false; - while (!loopDone6) { - // 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 - loopDone6 = true; - } else { - if (new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultActionNames").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list6.add(null); - - reader.next(); - } else { - list6.add(reader.getElementText()); - } - } else { - loopDone6 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setFaultActionNames((java.lang.String[]) list6.toArray(new java.lang.String[list6.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://description.axis2.apache.org/xsd", - "faultMessages").equals(reader.getName())) { - - object.setFaultMessages(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "inputAction").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setInputAction(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "key").equals(reader.getName())) { - - object.setKey(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageExchangePattern").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setMessageExchangePattern(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageReceiver").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMessageReceiver(null); - reader.next(); - - reader.next(); - - } else { - - object.setMessageReceiver(org.apache.axis2.engine.xsd.MessageReceiver.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://description.axis2.apache.org/xsd", - "messages").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMessages(null); - reader.next(); - - reader.next(); - - } else { - - object.setMessages(authclient.java.util.xsd.Iterator.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://description.axis2.apache.org/xsd", - "moduleRefs").equals(reader.getName())) { - - object.setModuleRefs(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "outputAction").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setOutputAction(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "phasesInFaultFlow").equals(reader.getName())) { - - object.setPhasesInFaultFlow(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "phasesOutFaultFlow").equals(reader.getName())) { - - object.setPhasesOutFaultFlow(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "phasesOutFlow").equals(reader.getName())) { - - object.setPhasesOutFlow(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "remainingPhasesInFlow").equals(reader.getName())) { - - object.setRemainingPhasesInFlow(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "soapAction").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSoapAction(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "style").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setStyle(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "wsamappingList").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list22.add(null); - - reader.next(); - } else { - list22.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone22 = false; - while (!loopDone22) { - // 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 - loopDone22 = true; - } else { - if (new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "wsamappingList").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list22.add(null); - - reader.next(); - } else { - list22.add(reader.getElementText()); - } - } else { - loopDone22 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setWsamappingListE((java.lang.String[]) list22.toArray(new java.lang.String[list22.size()])); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisService.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisService.java deleted file mode 100644 index 763126515..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisService.java +++ /dev/null @@ -1,5348 +0,0 @@ - -/** - * AxisService.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * AxisService bean class - */ - -public class AxisService implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = AxisService Namespace URI = - * http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = 4019102326459307370L; - - /** - * field for EPRs This was an Array! - */ - - - protected java.lang.String[] localEPRs; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEPRsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getEPRs() { - return this.localEPRs; - } - - - - /** - * validate the array for EPRs - */ - protected void validateEPRs(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param EPRs - */ - public void setEPRs(final java.lang.String[] param) { - - validateEPRs(param); - - this.localEPRsTracker = true; - - this.localEPRs = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addEPRs(final java.lang.String param) { - if (this.localEPRs == null) { - this.localEPRs = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localEPRsTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localEPRs); - list.add(param); - this.localEPRs = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for WSAddressingFlag - */ - - - protected java.lang.String localWSAddressingFlag; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localWSAddressingFlagTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getWSAddressingFlag() { - return this.localWSAddressingFlag; - } - - - - /** - * Auto generated setter method - * - * @param param WSAddressingFlag - */ - public void setWSAddressingFlag(final java.lang.String param) { - this.localWSAddressingFlagTracker = true; - - this.localWSAddressingFlag = param; - - - } - - - /** - * field for Active - */ - - - protected boolean localActive; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActiveTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getActive() { - return this.localActive; - } - - - - /** - * Auto generated setter method - * - * @param param Active - */ - public void setActive(final boolean param) { - - // setting primitive attribute tracker to true - this.localActiveTracker = true; - - this.localActive = param; - - - } - - - /** - * field for AxisServiceGroup - */ - - - protected org.apache.axis2.description.xsd.AxisServiceGroup localAxisServiceGroup; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisServiceGroupTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisServiceGroup - */ - public org.apache.axis2.description.xsd.AxisServiceGroup getAxisServiceGroup() { - return this.localAxisServiceGroup; - } - - - - /** - * Auto generated setter method - * - * @param param AxisServiceGroup - */ - public void setAxisServiceGroup(final org.apache.axis2.description.xsd.AxisServiceGroup param) { - this.localAxisServiceGroupTracker = true; - - this.localAxisServiceGroup = param; - - - } - - - /** - * field for BindingName - */ - - - protected java.lang.String localBindingName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localBindingNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getBindingName() { - return this.localBindingName; - } - - - - /** - * Auto generated setter method - * - * @param param BindingName - */ - public void setBindingName(final java.lang.String param) { - this.localBindingNameTracker = true; - - this.localBindingName = param; - - - } - - - /** - * field for ClassLoader - */ - - - protected java.lang.Object localClassLoader; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localClassLoaderTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getClassLoader() { - return this.localClassLoader; - } - - - - /** - * Auto generated setter method - * - * @param param ClassLoader - */ - public void setClassLoader(final java.lang.Object param) { - this.localClassLoaderTracker = true; - - this.localClassLoader = param; - - - } - - - /** - * field for ClientSide - */ - - - protected boolean localClientSide; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localClientSideTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getClientSide() { - return this.localClientSide; - } - - - - /** - * Auto generated setter method - * - * @param param ClientSide - */ - public void setClientSide(final boolean param) { - - // setting primitive attribute tracker to true - this.localClientSideTracker = true; - - this.localClientSide = param; - - - } - - - /** - * field for ControlOperations - */ - - - protected java.lang.Object localControlOperations; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localControlOperationsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getControlOperations() { - return this.localControlOperations; - } - - - - /** - * Auto generated setter method - * - * @param param ControlOperations - */ - public void setControlOperations(final java.lang.Object param) { - this.localControlOperationsTracker = true; - - this.localControlOperations = param; - - - } - - - /** - * field for CustomSchemaNamePrefix - */ - - - protected java.lang.String localCustomSchemaNamePrefix; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCustomSchemaNamePrefixTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCustomSchemaNamePrefix() { - return this.localCustomSchemaNamePrefix; - } - - - - /** - * Auto generated setter method - * - * @param param CustomSchemaNamePrefix - */ - public void setCustomSchemaNamePrefix(final java.lang.String param) { - this.localCustomSchemaNamePrefixTracker = true; - - this.localCustomSchemaNamePrefix = param; - - - } - - - /** - * field for CustomSchemaNameSuffix - */ - - - protected java.lang.String localCustomSchemaNameSuffix; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCustomSchemaNameSuffixTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCustomSchemaNameSuffix() { - return this.localCustomSchemaNameSuffix; - } - - - - /** - * Auto generated setter method - * - * @param param CustomSchemaNameSuffix - */ - public void setCustomSchemaNameSuffix(final java.lang.String param) { - this.localCustomSchemaNameSuffixTracker = true; - - this.localCustomSchemaNameSuffix = param; - - - } - - - /** - * field for CustomWsdl - */ - - - protected boolean localCustomWsdl; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCustomWsdlTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getCustomWsdl() { - return this.localCustomWsdl; - } - - - - /** - * Auto generated setter method - * - * @param param CustomWsdl - */ - public void setCustomWsdl(final boolean param) { - - // setting primitive attribute tracker to true - this.localCustomWsdlTracker = true; - - this.localCustomWsdl = param; - - - } - - - /** - * field for ElementFormDefault - */ - - - protected boolean localElementFormDefault; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localElementFormDefaultTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getElementFormDefault() { - return this.localElementFormDefault; - } - - - - /** - * Auto generated setter method - * - * @param param ElementFormDefault - */ - public void setElementFormDefault(final boolean param) { - - // setting primitive attribute tracker to true - this.localElementFormDefaultTracker = true; - - this.localElementFormDefault = param; - - - } - - - /** - * field for EnableAllTransports - */ - - - protected boolean localEnableAllTransports; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEnableAllTransportsTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getEnableAllTransports() { - return this.localEnableAllTransports; - } - - - - /** - * Auto generated setter method - * - * @param param EnableAllTransports - */ - public void setEnableAllTransports(final boolean param) { - - // setting primitive attribute tracker to true - this.localEnableAllTransportsTracker = true; - - this.localEnableAllTransports = param; - - - } - - - /** - * field for EndpointName - */ - - - protected java.lang.String localEndpointName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEndpointNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getEndpointName() { - return this.localEndpointName; - } - - - - /** - * Auto generated setter method - * - * @param param EndpointName - */ - public void setEndpointName(final java.lang.String param) { - this.localEndpointNameTracker = true; - - this.localEndpointName = param; - - - } - - - /** - * field for EndpointURL - */ - - - protected java.lang.String localEndpointURL; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEndpointURLTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getEndpointURL() { - return this.localEndpointURL; - } - - - - /** - * Auto generated setter method - * - * @param param EndpointURL - */ - public void setEndpointURL(final java.lang.String param) { - this.localEndpointURLTracker = true; - - this.localEndpointURL = param; - - - } - - - /** - * field for Endpoints - */ - - - protected authclient.java.util.xsd.Map localEndpoints; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEndpointsTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getEndpoints() { - return this.localEndpoints; - } - - - - /** - * Auto generated setter method - * - * @param param Endpoints - */ - public void setEndpoints(final authclient.java.util.xsd.Map param) { - this.localEndpointsTracker = true; - - this.localEndpoints = param; - - - } - - - /** - * field for ExcludeInfo - */ - - - protected org.apache.axis2.deployment.util.xsd.ExcludeInfo localExcludeInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExcludeInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.deployment.util.xsd.ExcludeInfo - */ - public org.apache.axis2.deployment.util.xsd.ExcludeInfo getExcludeInfo() { - return this.localExcludeInfo; - } - - - - /** - * Auto generated setter method - * - * @param param ExcludeInfo - */ - public void setExcludeInfo(final org.apache.axis2.deployment.util.xsd.ExcludeInfo param) { - this.localExcludeInfoTracker = true; - - this.localExcludeInfo = param; - - - } - - - /** - * field for ExposedTransports This was an Array! - */ - - - protected java.lang.String[] localExposedTransports; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExposedTransportsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getExposedTransports() { - return this.localExposedTransports; - } - - - - /** - * validate the array for ExposedTransports - */ - protected void validateExposedTransports(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ExposedTransports - */ - public void setExposedTransports(final java.lang.String[] param) { - - validateExposedTransports(param); - - this.localExposedTransportsTracker = true; - - this.localExposedTransports = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addExposedTransports(final java.lang.String param) { - if (this.localExposedTransports == null) { - this.localExposedTransports = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localExposedTransportsTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExposedTransports); - list.add(param); - this.localExposedTransports = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for FileName - */ - - - protected authclient.java.net.xsd.URL localFileName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFileNameTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.net.xsd.URL - */ - public authclient.java.net.xsd.URL getFileName() { - return this.localFileName; - } - - - - /** - * Auto generated setter method - * - * @param param FileName - */ - public void setFileName(final authclient.java.net.xsd.URL param) { - this.localFileNameTracker = true; - - this.localFileName = param; - - - } - - - /** - * field for ImportedNamespaces - */ - - - protected java.lang.Object localImportedNamespaces; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localImportedNamespacesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getImportedNamespaces() { - return this.localImportedNamespaces; - } - - - - /** - * Auto generated setter method - * - * @param param ImportedNamespaces - */ - public void setImportedNamespaces(final java.lang.Object param) { - this.localImportedNamespacesTracker = true; - - this.localImportedNamespaces = param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.Object localKey; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localKeyTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getKey() { - return this.localKey; - } - - - - /** - * Auto generated setter method - * - * @param param Key - */ - public void setKey(final java.lang.Object param) { - this.localKeyTracker = true; - - this.localKey = param; - - - } - - - /** - * field for LastUpdate - */ - - - protected long localLastUpdate; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLastUpdateTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getLastUpdate() { - return this.localLastUpdate; - } - - - - /** - * Auto generated setter method - * - * @param param LastUpdate - */ - public void setLastUpdate(final long param) { - - // setting primitive attribute tracker to true - this.localLastUpdateTracker = param != java.lang.Long.MIN_VALUE; - - this.localLastUpdate = param; - - - } - - - /** - * field for LastupdateE - */ - - - protected long localLastupdateE; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLastupdateETracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getLastupdateE() { - return this.localLastupdateE; - } - - - - /** - * Auto generated setter method - * - * @param param LastupdateE - */ - public void setLastupdateE(final long param) { - - // setting primitive attribute tracker to true - this.localLastupdateETracker = param != java.lang.Long.MIN_VALUE; - - this.localLastupdateE = param; - - - } - - - /** - * field for MessageElementQNameToOperationMap This was an Array! - */ - - - protected java.lang.Object[] localMessageElementQNameToOperationMap; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessageElementQNameToOperationMapTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object[] - */ - public java.lang.Object[] getMessageElementQNameToOperationMap() { - return this.localMessageElementQNameToOperationMap; - } - - - - /** - * validate the array for MessageElementQNameToOperationMap - */ - protected void validateMessageElementQNameToOperationMap(final java.lang.Object[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param MessageElementQNameToOperationMap - */ - public void setMessageElementQNameToOperationMap(final java.lang.Object[] param) { - - validateMessageElementQNameToOperationMap(param); - - this.localMessageElementQNameToOperationMapTracker = true; - - this.localMessageElementQNameToOperationMap = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.Object - */ - public void addMessageElementQNameToOperationMap(final java.lang.Object param) { - if (this.localMessageElementQNameToOperationMap == null) { - this.localMessageElementQNameToOperationMap = new java.lang.Object[] {}; - } - - - // update the setting tracker - this.localMessageElementQNameToOperationMapTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localMessageElementQNameToOperationMap); - list.add(param); - this.localMessageElementQNameToOperationMap = list.toArray(new java.lang.Object[list.size()]); - - } - - - /** - * field for ModifyUserWSDLPortAddress - */ - - - protected boolean localModifyUserWSDLPortAddress; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localModifyUserWSDLPortAddressTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getModifyUserWSDLPortAddress() { - return this.localModifyUserWSDLPortAddress; - } - - - - /** - * Auto generated setter method - * - * @param param ModifyUserWSDLPortAddress - */ - public void setModifyUserWSDLPortAddress(final boolean param) { - - // setting primitive attribute tracker to true - this.localModifyUserWSDLPortAddressTracker = true; - - this.localModifyUserWSDLPortAddress = param; - - - } - - - /** - * field for Modules - */ - - - protected java.lang.Object localModules; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localModulesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getModules() { - return this.localModules; - } - - - - /** - * Auto generated setter method - * - * @param param Modules - */ - public void setModules(final java.lang.Object param) { - this.localModulesTracker = true; - - this.localModules = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for NameSpacesMap - */ - - - protected authclient.java.util.xsd.Map localNameSpacesMap; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameSpacesMapTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getNameSpacesMap() { - return this.localNameSpacesMap; - } - - - - /** - * Auto generated setter method - * - * @param param NameSpacesMap - */ - public void setNameSpacesMap(final authclient.java.util.xsd.Map param) { - this.localNameSpacesMapTracker = true; - - this.localNameSpacesMap = param; - - - } - - - /** - * field for NamespaceMap - */ - - - protected authclient.java.util.xsd.Map localNamespaceMap; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNamespaceMapTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getNamespaceMap() { - return this.localNamespaceMap; - } - - - - /** - * Auto generated setter method - * - * @param param NamespaceMap - */ - public void setNamespaceMap(final authclient.java.util.xsd.Map param) { - this.localNamespaceMapTracker = true; - - this.localNamespaceMap = param; - - - } - - - /** - * field for ObjectSupplier - */ - - - protected org.apache.axis2.engine.xsd.ObjectSupplier localObjectSupplier; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localObjectSupplierTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.ObjectSupplier - */ - public org.apache.axis2.engine.xsd.ObjectSupplier getObjectSupplier() { - return this.localObjectSupplier; - } - - - - /** - * Auto generated setter method - * - * @param param ObjectSupplier - */ - public void setObjectSupplier(final org.apache.axis2.engine.xsd.ObjectSupplier param) { - this.localObjectSupplierTracker = true; - - this.localObjectSupplier = param; - - - } - - - /** - * field for Operations - */ - - - protected authclient.java.util.xsd.Iterator localOperations; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationsTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getOperations() { - return this.localOperations; - } - - - - /** - * Auto generated setter method - * - * @param param Operations - */ - public void setOperations(final authclient.java.util.xsd.Iterator param) { - this.localOperationsTracker = true; - - this.localOperations = param; - - - } - - - /** - * field for OperationsNameList - */ - - - protected java.lang.Object localOperationsNameList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOperationsNameListTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOperationsNameList() { - return this.localOperationsNameList; - } - - - - /** - * Auto generated setter method - * - * @param param OperationsNameList - */ - public void setOperationsNameList(final java.lang.Object param) { - this.localOperationsNameListTracker = true; - - this.localOperationsNameList = param; - - - } - - - /** - * field for P2NMap - */ - - - protected authclient.java.util.xsd.Map localP2NMap; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localP2NMapTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getP2NMap() { - return this.localP2NMap; - } - - - - /** - * Auto generated setter method - * - * @param param P2NMap - */ - public void setP2NMap(final authclient.java.util.xsd.Map param) { - this.localP2NMapTracker = true; - - this.localP2NMap = param; - - - } - - - /** - * field for Parent - */ - - - protected org.apache.axis2.description.xsd.AxisServiceGroup localParent; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localParentTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.AxisServiceGroup - */ - public org.apache.axis2.description.xsd.AxisServiceGroup getParent() { - return this.localParent; - } - - - - /** - * Auto generated setter method - * - * @param param Parent - */ - public void setParent(final org.apache.axis2.description.xsd.AxisServiceGroup param) { - this.localParentTracker = true; - - this.localParent = param; - - - } - - - /** - * field for PortTypeName - */ - - - protected java.lang.String localPortTypeName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPortTypeNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPortTypeName() { - return this.localPortTypeName; - } - - - - /** - * Auto generated setter method - * - * @param param PortTypeName - */ - public void setPortTypeName(final java.lang.String param) { - this.localPortTypeNameTracker = true; - - this.localPortTypeName = param; - - - } - - - /** - * field for PublishedOperations - */ - - - protected java.lang.Object localPublishedOperations; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPublishedOperationsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getPublishedOperations() { - return this.localPublishedOperations; - } - - - - /** - * Auto generated setter method - * - * @param param PublishedOperations - */ - public void setPublishedOperations(final java.lang.Object param) { - this.localPublishedOperationsTracker = true; - - this.localPublishedOperations = param; - - - } - - - /** - * field for SchemaLocationsAdjusted - */ - - - protected boolean localSchemaLocationsAdjusted; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaLocationsAdjustedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getSchemaLocationsAdjusted() { - return this.localSchemaLocationsAdjusted; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaLocationsAdjusted - */ - public void setSchemaLocationsAdjusted(final boolean param) { - - // setting primitive attribute tracker to true - this.localSchemaLocationsAdjustedTracker = true; - - this.localSchemaLocationsAdjusted = param; - - - } - - - /** - * field for SchemaMappingTable - */ - - - protected authclient.java.util.xsd.Map localSchemaMappingTable; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaMappingTableTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getSchemaMappingTable() { - return this.localSchemaMappingTable; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaMappingTable - */ - public void setSchemaMappingTable(final authclient.java.util.xsd.Map param) { - this.localSchemaMappingTableTracker = true; - - this.localSchemaMappingTable = param; - - - } - - - /** - * field for SchemaTargetNamespace - */ - - - protected java.lang.String localSchemaTargetNamespace; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaTargetNamespaceTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSchemaTargetNamespace() { - return this.localSchemaTargetNamespace; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaTargetNamespace - */ - public void setSchemaTargetNamespace(final java.lang.String param) { - this.localSchemaTargetNamespaceTracker = true; - - this.localSchemaTargetNamespace = param; - - - } - - - /** - * field for SchemaTargetNamespacePrefix - */ - - - protected java.lang.String localSchemaTargetNamespacePrefix; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaTargetNamespacePrefixTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSchemaTargetNamespacePrefix() { - return this.localSchemaTargetNamespacePrefix; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaTargetNamespacePrefix - */ - public void setSchemaTargetNamespacePrefix(final java.lang.String param) { - this.localSchemaTargetNamespacePrefixTracker = true; - - this.localSchemaTargetNamespacePrefix = param; - - - } - - - /** - * field for SchematargetNamespaceE - */ - - - protected java.lang.String localSchematargetNamespaceE; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchematargetNamespaceETracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSchematargetNamespaceE() { - return this.localSchematargetNamespaceE; - } - - - - /** - * Auto generated setter method - * - * @param param SchematargetNamespaceE - */ - public void setSchematargetNamespaceE(final java.lang.String param) { - this.localSchematargetNamespaceETracker = true; - - this.localSchematargetNamespaceE = param; - - - } - - - /** - * field for SchematargetNamespacePrefixE - */ - - - protected java.lang.String localSchematargetNamespacePrefixE; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchematargetNamespacePrefixETracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSchematargetNamespacePrefixE() { - return this.localSchematargetNamespacePrefixE; - } - - - - /** - * Auto generated setter method - * - * @param param SchematargetNamespacePrefixE - */ - public void setSchematargetNamespacePrefixE(final java.lang.String param) { - this.localSchematargetNamespacePrefixETracker = true; - - this.localSchematargetNamespacePrefixE = param; - - - } - - - /** - * field for Scope - */ - - - protected java.lang.String localScope; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localScopeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getScope() { - return this.localScope; - } - - - - /** - * Auto generated setter method - * - * @param param Scope - */ - public void setScope(final java.lang.String param) { - this.localScopeTracker = true; - - this.localScope = param; - - - } - - - /** - * field for ServiceDescription - */ - - - protected java.lang.String localServiceDescription; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceDescriptionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getServiceDescription() { - return this.localServiceDescription; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceDescription - */ - public void setServiceDescription(final java.lang.String param) { - this.localServiceDescriptionTracker = true; - - this.localServiceDescription = param; - - - } - - - /** - * field for ServiceLifeCycle - */ - - - protected org.apache.axis2.engine.xsd.ServiceLifeCycle localServiceLifeCycle; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceLifeCycleTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.ServiceLifeCycle - */ - public org.apache.axis2.engine.xsd.ServiceLifeCycle getServiceLifeCycle() { - return this.localServiceLifeCycle; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceLifeCycle - */ - public void setServiceLifeCycle(final org.apache.axis2.engine.xsd.ServiceLifeCycle param) { - this.localServiceLifeCycleTracker = true; - - this.localServiceLifeCycle = param; - - - } - - - /** - * field for SetEndpointsToAllUsedBindings - */ - - - protected boolean localSetEndpointsToAllUsedBindings; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSetEndpointsToAllUsedBindingsTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getSetEndpointsToAllUsedBindings() { - return this.localSetEndpointsToAllUsedBindings; - } - - - - /** - * Auto generated setter method - * - * @param param SetEndpointsToAllUsedBindings - */ - public void setSetEndpointsToAllUsedBindings(final boolean param) { - - // setting primitive attribute tracker to true - this.localSetEndpointsToAllUsedBindingsTracker = true; - - this.localSetEndpointsToAllUsedBindings = param; - - - } - - - /** - * field for SoapNsUri - */ - - - protected java.lang.String localSoapNsUri; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSoapNsUriTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSoapNsUri() { - return this.localSoapNsUri; - } - - - - /** - * Auto generated setter method - * - * @param param SoapNsUri - */ - public void setSoapNsUri(final java.lang.String param) { - this.localSoapNsUriTracker = true; - - this.localSoapNsUri = param; - - - } - - - /** - * field for TargetNamespace - */ - - - protected java.lang.String localTargetNamespace; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTargetNamespaceTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getTargetNamespace() { - return this.localTargetNamespace; - } - - - - /** - * Auto generated setter method - * - * @param param TargetNamespace - */ - public void setTargetNamespace(final java.lang.String param) { - this.localTargetNamespaceTracker = true; - - this.localTargetNamespace = param; - - - } - - - /** - * field for TargetNamespacePrefix - */ - - - protected java.lang.String localTargetNamespacePrefix; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTargetNamespacePrefixTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getTargetNamespacePrefix() { - return this.localTargetNamespacePrefix; - } - - - - /** - * Auto generated setter method - * - * @param param TargetNamespacePrefix - */ - public void setTargetNamespacePrefix(final java.lang.String param) { - this.localTargetNamespacePrefixTracker = true; - - this.localTargetNamespacePrefix = param; - - - } - - - /** - * field for TypeTable - */ - - - protected org.apache.axis2.description.java2wsdl.xsd.TypeTable localTypeTable; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTypeTableTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.java2wsdl.xsd.TypeTable - */ - public org.apache.axis2.description.java2wsdl.xsd.TypeTable getTypeTable() { - return this.localTypeTable; - } - - - - /** - * Auto generated setter method - * - * @param param TypeTable - */ - public void setTypeTable(final org.apache.axis2.description.java2wsdl.xsd.TypeTable param) { - this.localTypeTableTracker = true; - - this.localTypeTable = param; - - - } - - - /** - * field for UseDefaultChains - */ - - - protected boolean localUseDefaultChains; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUseDefaultChainsTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getUseDefaultChains() { - return this.localUseDefaultChains; - } - - - - /** - * Auto generated setter method - * - * @param param UseDefaultChains - */ - public void setUseDefaultChains(final boolean param) { - - // setting primitive attribute tracker to true - this.localUseDefaultChainsTracker = true; - - this.localUseDefaultChains = param; - - - } - - - /** - * field for UseUserWSDL - */ - - - protected boolean localUseUserWSDL; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUseUserWSDLTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getUseUserWSDL() { - return this.localUseUserWSDL; - } - - - - /** - * Auto generated setter method - * - * @param param UseUserWSDL - */ - public void setUseUserWSDL(final boolean param) { - - // setting primitive attribute tracker to true - this.localUseUserWSDLTracker = true; - - this.localUseUserWSDL = param; - - - } - - - /** - * field for WsdlFound - */ - - - protected boolean localWsdlFound; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localWsdlFoundTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getWsdlFound() { - return this.localWsdlFound; - } - - - - /** - * Auto generated setter method - * - * @param param WsdlFound - */ - public void setWsdlFound(final boolean param) { - - // setting primitive attribute tracker to true - this.localWsdlFoundTracker = true; - - this.localWsdlFound = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AxisService", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AxisService", xmlWriter); - } - - - } - if (this.localEPRsTracker) { - if (this.localEPRs != null) { - namespace = "http://description.axis2.apache.org/xsd"; - for (final String localEPR : this.localEPRs) { - - if (localEPR != null) { - - writeStartElement(null, namespace, "EPRs", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEPR)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "EPRs", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "EPRs", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localWSAddressingFlagTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "WSAddressingFlag", xmlWriter); - - - if (this.localWSAddressingFlag == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localWSAddressingFlag); - - } - - xmlWriter.writeEndElement(); - } - if (this.localActiveTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "active", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("active cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActive)); - } - - xmlWriter.writeEndElement(); - } - if (this.localAxisServiceGroupTracker) { - if (this.localAxisServiceGroup == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "axisServiceGroup", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisServiceGroup.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "axisServiceGroup"), xmlWriter); - } - } - if (this.localBindingNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "bindingName", xmlWriter); - - - if (this.localBindingName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localBindingName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localClassLoaderTracker) { - - if (this.localClassLoader != null) { - if (this.localClassLoader instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localClassLoader).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "classLoader"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "classLoader", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localClassLoader, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "classLoader", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localClientSideTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "clientSide", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("clientSide cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localClientSide)); - } - - xmlWriter.writeEndElement(); - } - if (this.localControlOperationsTracker) { - - if (this.localControlOperations != null) { - if (this.localControlOperations instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localControlOperations).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "controlOperations"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "controlOperations", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localControlOperations, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "controlOperations", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localCustomSchemaNamePrefixTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "customSchemaNamePrefix", xmlWriter); - - - if (this.localCustomSchemaNamePrefix == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localCustomSchemaNamePrefix); - - } - - xmlWriter.writeEndElement(); - } - if (this.localCustomSchemaNameSuffixTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "customSchemaNameSuffix", xmlWriter); - - - if (this.localCustomSchemaNameSuffix == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localCustomSchemaNameSuffix); - - } - - xmlWriter.writeEndElement(); - } - if (this.localCustomWsdlTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "customWsdl", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("customWsdl cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCustomWsdl)); - } - - xmlWriter.writeEndElement(); - } - if (this.localElementFormDefaultTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "elementFormDefault", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("elementFormDefault cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localElementFormDefault)); - } - - xmlWriter.writeEndElement(); - } - if (this.localEnableAllTransportsTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "enableAllTransports", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("enableAllTransports cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEnableAllTransports)); - } - - xmlWriter.writeEndElement(); - } - if (this.localEndpointNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "endpointName", xmlWriter); - - - if (this.localEndpointName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localEndpointName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localEndpointURLTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "endpointURL", xmlWriter); - - - if (this.localEndpointURL == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localEndpointURL); - - } - - xmlWriter.writeEndElement(); - } - if (this.localEndpointsTracker) { - if (this.localEndpoints == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "endpoints", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localEndpoints.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "endpoints"), xmlWriter); - } - } - if (this.localExcludeInfoTracker) { - if (this.localExcludeInfo == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "excludeInfo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localExcludeInfo.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "excludeInfo"), xmlWriter); - } - } - if (this.localExposedTransportsTracker) { - if (this.localExposedTransports != null) { - namespace = "http://description.axis2.apache.org/xsd"; - for (final String localExposedTransport : this.localExposedTransports) { - - if (localExposedTransport != null) { - - writeStartElement(null, namespace, "exposedTransports", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localExposedTransport)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "exposedTransports", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "exposedTransports", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localFileNameTracker) { - if (this.localFileName == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "fileName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFileName.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "fileName"), xmlWriter); - } - } - if (this.localImportedNamespacesTracker) { - - if (this.localImportedNamespaces != null) { - if (this.localImportedNamespaces instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localImportedNamespaces).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "importedNamespaces"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "importedNamespaces", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localImportedNamespaces, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "importedNamespaces", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localKeyTracker) { - - if (this.localKey != null) { - if (this.localKey instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localKey).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "key"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "key", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localKey, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "key", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localLastUpdateTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "lastUpdate", xmlWriter); - - if (this.localLastUpdate == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lastUpdate cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLastUpdate)); - } - - xmlWriter.writeEndElement(); - } - if (this.localLastupdateETracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "lastupdate", xmlWriter); - - if (this.localLastupdateE == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lastupdate cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLastupdateE)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMessageElementQNameToOperationMapTracker) { - - if (this.localMessageElementQNameToOperationMap != null) { - for (final Object element : this.localMessageElementQNameToOperationMap) { - if (element != null) { - - if (element instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) element).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "messageElementQNameToOperationMap"), - xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", - "messageElementQNameToOperationMap", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(element, xmlWriter); - xmlWriter.writeEndElement(); - } - - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", - "messageElementQNameToOperationMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "messageElementQNameToOperationMap", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localModifyUserWSDLPortAddressTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "modifyUserWSDLPortAddress", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("modifyUserWSDLPortAddress cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localModifyUserWSDLPortAddress)); - } - - xmlWriter.writeEndElement(); - } - if (this.localModulesTracker) { - - if (this.localModules != null) { - if (this.localModules instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localModules).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "modules"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "modules", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localModules, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "modules", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localNameSpacesMapTracker) { - if (this.localNameSpacesMap == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "nameSpacesMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localNameSpacesMap.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "nameSpacesMap"), xmlWriter); - } - } - if (this.localNamespaceMapTracker) { - if (this.localNamespaceMap == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "namespaceMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localNamespaceMap.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "namespaceMap"), xmlWriter); - } - } - if (this.localObjectSupplierTracker) { - if (this.localObjectSupplier == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "objectSupplier", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localObjectSupplier.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "objectSupplier"), xmlWriter); - } - } - if (this.localOperationsTracker) { - if (this.localOperations == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "operations", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localOperations.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "operations"), xmlWriter); - } - } - if (this.localOperationsNameListTracker) { - - if (this.localOperationsNameList != null) { - if (this.localOperationsNameList instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOperationsNameList).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "operationsNameList"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "operationsNameList", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOperationsNameList, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "operationsNameList", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localP2NMapTracker) { - if (this.localP2NMap == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "p2nMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localP2NMap.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "p2nMap"), xmlWriter); - } - } - if (this.localParentTracker) { - if (this.localParent == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parent", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localParent.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "parent"), xmlWriter); - } - } - if (this.localPortTypeNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "portTypeName", xmlWriter); - - - if (this.localPortTypeName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPortTypeName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPublishedOperationsTracker) { - - if (this.localPublishedOperations != null) { - if (this.localPublishedOperations instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localPublishedOperations).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "publishedOperations"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "publishedOperations", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localPublishedOperations, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "publishedOperations", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localSchemaLocationsAdjustedTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "schemaLocationsAdjusted", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("schemaLocationsAdjusted cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSchemaLocationsAdjusted)); - } - - xmlWriter.writeEndElement(); - } - if (this.localSchemaMappingTableTracker) { - if (this.localSchemaMappingTable == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "schemaMappingTable", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSchemaMappingTable.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "schemaMappingTable"), xmlWriter); - } - } - if (this.localSchemaTargetNamespaceTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "schemaTargetNamespace", xmlWriter); - - - if (this.localSchemaTargetNamespace == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSchemaTargetNamespace); - - } - - xmlWriter.writeEndElement(); - } - if (this.localSchemaTargetNamespacePrefixTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "schemaTargetNamespacePrefix", xmlWriter); - - - if (this.localSchemaTargetNamespacePrefix == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSchemaTargetNamespacePrefix); - - } - - xmlWriter.writeEndElement(); - } - if (this.localSchematargetNamespaceETracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "schematargetNamespace", xmlWriter); - - - if (this.localSchematargetNamespaceE == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSchematargetNamespaceE); - - } - - xmlWriter.writeEndElement(); - } - if (this.localSchematargetNamespacePrefixETracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "schematargetNamespacePrefix", xmlWriter); - - - if (this.localSchematargetNamespacePrefixE == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSchematargetNamespacePrefixE); - - } - - xmlWriter.writeEndElement(); - } - if (this.localScopeTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "scope", xmlWriter); - - - if (this.localScope == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localScope); - - } - - xmlWriter.writeEndElement(); - } - if (this.localServiceDescriptionTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceDescription", xmlWriter); - - - if (this.localServiceDescription == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localServiceDescription); - - } - - xmlWriter.writeEndElement(); - } - if (this.localServiceLifeCycleTracker) { - if (this.localServiceLifeCycle == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "serviceLifeCycle", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServiceLifeCycle.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "serviceLifeCycle"), xmlWriter); - } - } - if (this.localSetEndpointsToAllUsedBindingsTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "setEndpointsToAllUsedBindings", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("setEndpointsToAllUsedBindings cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSetEndpointsToAllUsedBindings)); - } - - xmlWriter.writeEndElement(); - } - if (this.localSoapNsUriTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "soapNsUri", xmlWriter); - - - if (this.localSoapNsUri == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSoapNsUri); - - } - - xmlWriter.writeEndElement(); - } - if (this.localTargetNamespaceTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "targetNamespace", xmlWriter); - - - if (this.localTargetNamespace == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localTargetNamespace); - - } - - xmlWriter.writeEndElement(); - } - if (this.localTargetNamespacePrefixTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "targetNamespacePrefix", xmlWriter); - - - if (this.localTargetNamespacePrefix == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localTargetNamespacePrefix); - - } - - xmlWriter.writeEndElement(); - } - if (this.localTypeTableTracker) { - if (this.localTypeTable == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "typeTable", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTypeTable.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "typeTable"), xmlWriter); - } - } - if (this.localUseDefaultChainsTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "useDefaultChains", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("useDefaultChains cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUseDefaultChains)); - } - - xmlWriter.writeEndElement(); - } - if (this.localUseUserWSDLTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "useUserWSDL", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("useUserWSDL cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUseUserWSDL)); - } - - xmlWriter.writeEndElement(); - } - if (this.localWsdlFoundTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "wsdlFound", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("wsdlFound cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWsdlFound)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localEPRsTracker) { - if (this.localEPRs != null) { - for (final String localEPR : this.localEPRs) { - - if (localEPR != null) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "EPRs")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localEPR)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "EPRs")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "EPRs")); - elementList.add(null); - - } - - } - if (this.localWSAddressingFlagTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "WSAddressingFlag")); - - elementList.add(this.localWSAddressingFlag == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWSAddressingFlag)); - } - if (this.localActiveTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "active")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActive)); - } - if (this.localAxisServiceGroupTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "axisServiceGroup")); - - - elementList.add(this.localAxisServiceGroup == null ? null : this.localAxisServiceGroup); - } - if (this.localBindingNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "bindingName")); - - elementList.add(this.localBindingName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localBindingName)); - } - if (this.localClassLoaderTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "classLoader")); - - - elementList.add(this.localClassLoader == null ? null : this.localClassLoader); - } - if (this.localClientSideTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "clientSide")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localClientSide)); - } - if (this.localControlOperationsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "controlOperations")); - - - elementList.add(this.localControlOperations == null ? null : this.localControlOperations); - } - if (this.localCustomSchemaNamePrefixTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "customSchemaNamePrefix")); - - elementList.add(this.localCustomSchemaNamePrefix == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCustomSchemaNamePrefix)); - } - if (this.localCustomSchemaNameSuffixTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "customSchemaNameSuffix")); - - elementList.add(this.localCustomSchemaNameSuffix == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCustomSchemaNameSuffix)); - } - if (this.localCustomWsdlTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "customWsdl")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCustomWsdl)); - } - if (this.localElementFormDefaultTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "elementFormDefault")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localElementFormDefault)); - } - if (this.localEnableAllTransportsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "enableAllTransports")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEnableAllTransports)); - } - if (this.localEndpointNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "endpointName")); - - elementList.add(this.localEndpointName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEndpointName)); - } - if (this.localEndpointURLTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "endpointURL")); - - elementList.add(this.localEndpointURL == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEndpointURL)); - } - if (this.localEndpointsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "endpoints")); - - - elementList.add(this.localEndpoints == null ? null : this.localEndpoints); - } - if (this.localExcludeInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "excludeInfo")); - - - elementList.add(this.localExcludeInfo == null ? null : this.localExcludeInfo); - } - if (this.localExposedTransportsTracker) { - if (this.localExposedTransports != null) { - for (final String localExposedTransport : this.localExposedTransports) { - - if (localExposedTransport != null) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "exposedTransports")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localExposedTransport)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "exposedTransports")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "exposedTransports")); - elementList.add(null); - - } - - } - if (this.localFileNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "fileName")); - - - elementList.add(this.localFileName == null ? null : this.localFileName); - } - if (this.localImportedNamespacesTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "importedNamespaces")); - - - elementList.add(this.localImportedNamespaces == null ? null : this.localImportedNamespaces); - } - if (this.localKeyTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "key")); - - - elementList.add(this.localKey == null ? null : this.localKey); - } - if (this.localLastUpdateTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "lastUpdate")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLastUpdate)); - } - if (this.localLastupdateETracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "lastupdate")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLastupdateE)); - } - if (this.localMessageElementQNameToOperationMapTracker) { - if (this.localMessageElementQNameToOperationMap != null) { - for (final Object element : this.localMessageElementQNameToOperationMap) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageElementQNameToOperationMap")); - elementList.add(element); - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageElementQNameToOperationMap")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageElementQNameToOperationMap")); - elementList.add(this.localMessageElementQNameToOperationMap); - - } - - } - if (this.localModifyUserWSDLPortAddressTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "modifyUserWSDLPortAddress")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localModifyUserWSDLPortAddress)); - } - if (this.localModulesTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "modules")); - - - elementList.add(this.localModules == null ? null : this.localModules); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localNameSpacesMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "nameSpacesMap")); - - - elementList.add(this.localNameSpacesMap == null ? null : this.localNameSpacesMap); - } - if (this.localNamespaceMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "namespaceMap")); - - - elementList.add(this.localNamespaceMap == null ? null : this.localNamespaceMap); - } - if (this.localObjectSupplierTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "objectSupplier")); - - - elementList.add(this.localObjectSupplier == null ? null : this.localObjectSupplier); - } - if (this.localOperationsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "operations")); - - - elementList.add(this.localOperations == null ? null : this.localOperations); - } - if (this.localOperationsNameListTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "operationsNameList")); - - - elementList.add(this.localOperationsNameList == null ? null : this.localOperationsNameList); - } - if (this.localP2NMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "p2nMap")); - - - elementList.add(this.localP2NMap == null ? null : this.localP2NMap); - } - if (this.localParentTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "parent")); - - - elementList.add(this.localParent == null ? null : this.localParent); - } - if (this.localPortTypeNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "portTypeName")); - - elementList.add(this.localPortTypeName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPortTypeName)); - } - if (this.localPublishedOperationsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "publishedOperations")); - - - elementList.add(this.localPublishedOperations == null ? null : this.localPublishedOperations); - } - if (this.localSchemaLocationsAdjustedTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schemaLocationsAdjusted")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSchemaLocationsAdjusted)); - } - if (this.localSchemaMappingTableTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schemaMappingTable")); - - - elementList.add(this.localSchemaMappingTable == null ? null : this.localSchemaMappingTable); - } - if (this.localSchemaTargetNamespaceTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schemaTargetNamespace")); - - elementList.add(this.localSchemaTargetNamespace == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSchemaTargetNamespace)); - } - if (this.localSchemaTargetNamespacePrefixTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schemaTargetNamespacePrefix")); - - elementList.add(this.localSchemaTargetNamespacePrefix == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSchemaTargetNamespacePrefix)); - } - if (this.localSchematargetNamespaceETracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schematargetNamespace")); - - elementList.add(this.localSchematargetNamespaceE == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSchematargetNamespaceE)); - } - if (this.localSchematargetNamespacePrefixETracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schematargetNamespacePrefix")); - - elementList.add(this.localSchematargetNamespacePrefixE == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSchematargetNamespacePrefixE)); - } - if (this.localScopeTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "scope")); - - elementList.add(this.localScope == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localScope)); - } - if (this.localServiceDescriptionTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "serviceDescription")); - - elementList.add(this.localServiceDescription == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceDescription)); - } - if (this.localServiceLifeCycleTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "serviceLifeCycle")); - - - elementList.add(this.localServiceLifeCycle == null ? null : this.localServiceLifeCycle); - } - if (this.localSetEndpointsToAllUsedBindingsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "setEndpointsToAllUsedBindings")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSetEndpointsToAllUsedBindings)); - } - if (this.localSoapNsUriTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "soapNsUri")); - - elementList.add(this.localSoapNsUri == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSoapNsUri)); - } - if (this.localTargetNamespaceTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "targetNamespace")); - - elementList.add(this.localTargetNamespace == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTargetNamespace)); - } - if (this.localTargetNamespacePrefixTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "targetNamespacePrefix")); - - elementList.add(this.localTargetNamespacePrefix == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTargetNamespacePrefix)); - } - if (this.localTypeTableTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "typeTable")); - - - elementList.add(this.localTypeTable == null ? null : this.localTypeTable); - } - if (this.localUseDefaultChainsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "useDefaultChains")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUseDefaultChains)); - } - if (this.localUseUserWSDLTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "useUserWSDL")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUseUserWSDL)); - } - if (this.localWsdlFoundTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "wsdlFound")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localWsdlFound)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AxisService parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AxisService object = new AxisService(); - - int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AxisService".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AxisService) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - final java.util.ArrayList list18 = new java.util.ArrayList(); - - final java.util.ArrayList list24 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "EPRs").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list1.add(null); - - reader.next(); - } else { - list1.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while (!loopDone1) { - // 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 - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "EPRs").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list1.add(null); - - reader.next(); - } else { - list1.add(reader.getElementText()); - } - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setEPRs((java.lang.String[]) list1.toArray(new java.lang.String[list1.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://description.axis2.apache.org/xsd", - "WSAddressingFlag").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setWSAddressingFlag(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "active").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setActive(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://description.axis2.apache.org/xsd", - "axisServiceGroup").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisServiceGroup(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisServiceGroup(org.apache.axis2.description.xsd.AxisServiceGroup.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://description.axis2.apache.org/xsd", - "bindingName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setBindingName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "classLoader").equals(reader.getName())) { - - object.setClassLoader(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "clientSide").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setClientSide(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://description.axis2.apache.org/xsd", - "controlOperations").equals(reader.getName())) { - - object.setControlOperations(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "customSchemaNamePrefix").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setCustomSchemaNamePrefix(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "customSchemaNameSuffix").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setCustomSchemaNameSuffix(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "customWsdl").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCustomWsdl(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://description.axis2.apache.org/xsd", - "elementFormDefault").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setElementFormDefault(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://description.axis2.apache.org/xsd", - "enableAllTransports").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setEnableAllTransports(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://description.axis2.apache.org/xsd", - "endpointName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setEndpointName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "endpointURL").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setEndpointURL(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "endpoints").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setEndpoints(null); - reader.next(); - - reader.next(); - - } else { - - object.setEndpoints(authclient.java.util.xsd.Map.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://description.axis2.apache.org/xsd", - "excludeInfo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setExcludeInfo(null); - reader.next(); - - reader.next(); - - } else { - - object.setExcludeInfo(org.apache.axis2.deployment.util.xsd.ExcludeInfo.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://description.axis2.apache.org/xsd", - "exposedTransports").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list18.add(null); - - reader.next(); - } else { - list18.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone18 = false; - while (!loopDone18) { - // 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 - loopDone18 = true; - } else { - if (new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "exposedTransports").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list18.add(null); - - reader.next(); - } else { - list18.add(reader.getElementText()); - } - } else { - loopDone18 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setExposedTransports((java.lang.String[]) list18.toArray(new java.lang.String[list18.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://description.axis2.apache.org/xsd", - "fileName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFileName(null); - reader.next(); - - reader.next(); - - } else { - - object.setFileName(authclient.java.net.xsd.URL.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://description.axis2.apache.org/xsd", - "importedNamespaces").equals(reader.getName())) { - - object.setImportedNamespaces(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "key").equals(reader.getName())) { - - object.setKey(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "lastUpdate").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLastUpdate(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLastUpdate(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "lastupdate").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLastupdateE(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLastupdateE(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "messageElementQNameToOperationMap").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - - boolean loopDone24 = false; - final javax.xml.namespace.QName startQname24 = new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "messageElementQNameToOperationMap"); - - while (!loopDone24) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event - && startQname24.equals(reader.getName())) { - - - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list24.add(null); - reader.next(); - } else { - list24.add(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - } - } else if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event - && !startQname24.equals(reader.getName())) { - loopDone24 = true; - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event - && !startQname24.equals(reader.getName())) { - loopDone24 = true; - } else if (javax.xml.stream.XMLStreamConstants.END_DOCUMENT == event) { - loopDone24 = true; - } else { - reader.next(); - } - - } - - - object.setMessageElementQNameToOperationMap(list24.toArray()); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "modifyUserWSDLPortAddress").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setModifyUserWSDLPortAddress(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://description.axis2.apache.org/xsd", - "modules").equals(reader.getName())) { - - object.setModules(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "nameSpacesMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setNameSpacesMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setNameSpacesMap(authclient.java.util.xsd.Map.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://description.axis2.apache.org/xsd", - "namespaceMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setNamespaceMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setNamespaceMap(authclient.java.util.xsd.Map.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://description.axis2.apache.org/xsd", - "objectSupplier").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setObjectSupplier(null); - reader.next(); - - reader.next(); - - } else { - - object.setObjectSupplier(org.apache.axis2.engine.xsd.ObjectSupplier.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://description.axis2.apache.org/xsd", - "operations").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setOperations(null); - reader.next(); - - reader.next(); - - } else { - - object.setOperations(authclient.java.util.xsd.Iterator.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://description.axis2.apache.org/xsd", - "operationsNameList").equals(reader.getName())) { - - object.setOperationsNameList(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "p2nMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setP2NMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setP2NMap(authclient.java.util.xsd.Map.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://description.axis2.apache.org/xsd", - "parent").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setParent(null); - reader.next(); - - reader.next(); - - } else { - - object.setParent(org.apache.axis2.description.xsd.AxisServiceGroup.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://description.axis2.apache.org/xsd", - "portTypeName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPortTypeName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "publishedOperations").equals(reader.getName())) { - - object.setPublishedOperations(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schemaLocationsAdjusted").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSchemaLocationsAdjusted(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://description.axis2.apache.org/xsd", - "schemaMappingTable").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSchemaMappingTable(null); - reader.next(); - - reader.next(); - - } else { - - object.setSchemaMappingTable(authclient.java.util.xsd.Map.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://description.axis2.apache.org/xsd", - "schemaTargetNamespace").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSchemaTargetNamespace(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schemaTargetNamespacePrefix").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSchemaTargetNamespacePrefix(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schematargetNamespace").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSchematargetNamespaceE(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "schematargetNamespacePrefix").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSchematargetNamespacePrefixE(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "scope").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setScope(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "serviceDescription").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceDescription(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "serviceLifeCycle").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServiceLifeCycle(null); - reader.next(); - - reader.next(); - - } else { - - object.setServiceLifeCycle(org.apache.axis2.engine.xsd.ServiceLifeCycle.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://description.axis2.apache.org/xsd", - "setEndpointsToAllUsedBindings").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSetEndpointsToAllUsedBindings(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://description.axis2.apache.org/xsd", - "soapNsUri").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSoapNsUri(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "targetNamespace").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setTargetNamespace(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "targetNamespacePrefix").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setTargetNamespacePrefix(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "typeTable").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTypeTable(null); - reader.next(); - - reader.next(); - - } else { - - object.setTypeTable(org.apache.axis2.description.java2wsdl.xsd.TypeTable.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://description.axis2.apache.org/xsd", - "useDefaultChains").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setUseDefaultChains(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://description.axis2.apache.org/xsd", - "useUserWSDL").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setUseUserWSDL(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://description.axis2.apache.org/xsd", - "wsdlFound").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setWsdlFound(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisServiceGroup.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisServiceGroup.java deleted file mode 100644 index 32fb2bdec..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/AxisServiceGroup.java +++ /dev/null @@ -1,987 +0,0 @@ - -/** - * AxisServiceGroup.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * AxisServiceGroup bean class - */ - -public class AxisServiceGroup implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = AxisServiceGroup Namespace URI = - * http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = 6082642256039931997L; - - /** - * field for AxisDescription - */ - - - protected org.apache.axis2.engine.xsd.AxisConfiguration localAxisDescription; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisDescriptionTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.AxisConfiguration - */ - public org.apache.axis2.engine.xsd.AxisConfiguration getAxisDescription() { - return this.localAxisDescription; - } - - - - /** - * Auto generated setter method - * - * @param param AxisDescription - */ - public void setAxisDescription(final org.apache.axis2.engine.xsd.AxisConfiguration param) { - this.localAxisDescriptionTracker = true; - - this.localAxisDescription = param; - - - } - - - /** - * field for FoundWebResources - */ - - - protected boolean localFoundWebResources; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFoundWebResourcesTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getFoundWebResources() { - return this.localFoundWebResources; - } - - - - /** - * Auto generated setter method - * - * @param param FoundWebResources - */ - public void setFoundWebResources(final boolean param) { - - // setting primitive attribute tracker to true - this.localFoundWebResourcesTracker = true; - - this.localFoundWebResources = param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.Object localKey; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localKeyTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getKey() { - return this.localKey; - } - - - - /** - * Auto generated setter method - * - * @param param Key - */ - public void setKey(final java.lang.Object param) { - this.localKeyTracker = true; - - this.localKey = param; - - - } - - - /** - * field for ModuleRefs - */ - - - protected java.lang.Object localModuleRefs; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localModuleRefsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getModuleRefs() { - return this.localModuleRefs; - } - - - - /** - * Auto generated setter method - * - * @param param ModuleRefs - */ - public void setModuleRefs(final java.lang.Object param) { - this.localModuleRefsTracker = true; - - this.localModuleRefs = param; - - - } - - - /** - * field for ServiceGroupClassLoader - */ - - - protected java.lang.Object localServiceGroupClassLoader; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupClassLoaderTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getServiceGroupClassLoader() { - return this.localServiceGroupClassLoader; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupClassLoader - */ - public void setServiceGroupClassLoader(final java.lang.Object param) { - this.localServiceGroupClassLoaderTracker = true; - - this.localServiceGroupClassLoader = param; - - - } - - - /** - * field for ServiceGroupName - */ - - - protected java.lang.String localServiceGroupName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getServiceGroupName() { - return this.localServiceGroupName; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroupName - */ - public void setServiceGroupName(final java.lang.String param) { - this.localServiceGroupNameTracker = true; - - this.localServiceGroupName = param; - - - } - - - /** - * field for Services - */ - - - protected authclient.java.util.xsd.Iterator localServices; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServicesTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getServices() { - return this.localServices; - } - - - - /** - * Auto generated setter method - * - * @param param Services - */ - public void setServices(final authclient.java.util.xsd.Iterator param) { - this.localServicesTracker = true; - - this.localServices = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AxisServiceGroup", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AxisServiceGroup", - xmlWriter); - } - - - } - if (this.localAxisDescriptionTracker) { - if (this.localAxisDescription == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "axisDescription", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisDescription.serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "axisDescription"), xmlWriter); - } - } - if (this.localFoundWebResourcesTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "foundWebResources", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("foundWebResources cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFoundWebResources)); - } - - xmlWriter.writeEndElement(); - } - if (this.localKeyTracker) { - - if (this.localKey != null) { - if (this.localKey instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localKey).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "key"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "key", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localKey, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "key", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localModuleRefsTracker) { - - if (this.localModuleRefs != null) { - if (this.localModuleRefs instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localModuleRefs).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "moduleRefs"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "moduleRefs", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localModuleRefs, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "moduleRefs", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localServiceGroupClassLoaderTracker) { - - if (this.localServiceGroupClassLoader != null) { - if (this.localServiceGroupClassLoader instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localServiceGroupClassLoader).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "serviceGroupClassLoader"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "serviceGroupClassLoader", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localServiceGroupClassLoader, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "serviceGroupClassLoader", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localServiceGroupNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "serviceGroupName", xmlWriter); - - - if (this.localServiceGroupName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localServiceGroupName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localServicesTracker) { - if (this.localServices == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "services", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServices.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "services"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAxisDescriptionTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "axisDescription")); - - - elementList.add(this.localAxisDescription == null ? null : this.localAxisDescription); - } - if (this.localFoundWebResourcesTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "foundWebResources")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFoundWebResources)); - } - if (this.localKeyTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "key")); - - - elementList.add(this.localKey == null ? null : this.localKey); - } - if (this.localModuleRefsTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "moduleRefs")); - - - elementList.add(this.localModuleRefs == null ? null : this.localModuleRefs); - } - if (this.localServiceGroupClassLoaderTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "serviceGroupClassLoader")); - - - elementList.add(this.localServiceGroupClassLoader == null ? null : this.localServiceGroupClassLoader); - } - if (this.localServiceGroupNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "serviceGroupName")); - - elementList.add(this.localServiceGroupName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localServiceGroupName)); - } - if (this.localServicesTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "services")); - - - elementList.add(this.localServices == null ? null : this.localServices); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AxisServiceGroup parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AxisServiceGroup object = new AxisServiceGroup(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AxisServiceGroup".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AxisServiceGroup) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "axisDescription").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisDescription(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisDescription(org.apache.axis2.engine.xsd.AxisConfiguration.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://description.axis2.apache.org/xsd", - "foundWebResources").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFoundWebResources(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://description.axis2.apache.org/xsd", - "key").equals(reader.getName())) { - - object.setKey(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "moduleRefs").equals(reader.getName())) { - - object.setModuleRefs(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "serviceGroupClassLoader").equals(reader.getName())) { - - object.setServiceGroupClassLoader(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "serviceGroupName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setServiceGroupName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "services").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServices(null); - reader.next(); - - reader.next(); - - } else { - - object.setServices(authclient.java.util.xsd.Iterator.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/Flow.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/Flow.java deleted file mode 100644 index 7a8fcec57..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/Flow.java +++ /dev/null @@ -1,453 +0,0 @@ - -/** - * Flow.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * Flow bean class - */ - -public class Flow implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Flow Namespace URI = - * http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = 1511942172859531425L; - - /** - * field for HandlerCount - */ - - - protected int localHandlerCount; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHandlerCountTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getHandlerCount() { - return this.localHandlerCount; - } - - - - /** - * Auto generated setter method - * - * @param param HandlerCount - */ - public void setHandlerCount(final int param) { - - // setting primitive attribute tracker to true - this.localHandlerCountTracker = param != java.lang.Integer.MIN_VALUE; - - this.localHandlerCount = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Flow", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Flow", xmlWriter); - } - - - } - if (this.localHandlerCountTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "handlerCount", xmlWriter); - - if (this.localHandlerCount == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("handlerCount cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localHandlerCount)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localHandlerCountTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "handlerCount")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localHandlerCount)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Flow parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Flow object = new Flow(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Flow".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Flow) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "handlerCount").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setHandlerCount(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setHandlerCount(java.lang.Integer.MIN_VALUE); - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/HandlerDescription.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/HandlerDescription.java deleted file mode 100644 index 8709839eb..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/HandlerDescription.java +++ /dev/null @@ -1,902 +0,0 @@ - -/** - * HandlerDescription.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * HandlerDescription bean class - */ - -public class HandlerDescription implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = HandlerDescription Namespace URI - * = http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = 943580218947146304L; - - /** - * field for ClassName - */ - - - protected java.lang.String localClassName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localClassNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getClassName() { - return this.localClassName; - } - - - - /** - * Auto generated setter method - * - * @param param ClassName - */ - public void setClassName(final java.lang.String param) { - this.localClassNameTracker = true; - - this.localClassName = param; - - - } - - - /** - * field for Handler - */ - - - protected org.apache.axis2.engine.xsd.Handler localHandler; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHandlerTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.Handler - */ - public org.apache.axis2.engine.xsd.Handler getHandler() { - return this.localHandler; - } - - - - /** - * Auto generated setter method - * - * @param param Handler - */ - public void setHandler(final org.apache.axis2.engine.xsd.Handler param) { - this.localHandlerTracker = true; - - this.localHandler = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for Parameters - */ - - - protected java.lang.Object localParameters; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localParametersTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getParameters() { - return this.localParameters; - } - - - - /** - * Auto generated setter method - * - * @param param Parameters - */ - public void setParameters(final java.lang.Object param) { - this.localParametersTracker = true; - - this.localParameters = param; - - - } - - - /** - * field for Parent - */ - - - protected org.apache.axis2.description.xsd.ParameterInclude localParent; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localParentTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.ParameterInclude - */ - public org.apache.axis2.description.xsd.ParameterInclude getParent() { - return this.localParent; - } - - - - /** - * Auto generated setter method - * - * @param param Parent - */ - public void setParent(final org.apache.axis2.description.xsd.ParameterInclude param) { - this.localParentTracker = true; - - this.localParent = param; - - - } - - - /** - * field for Rules - */ - - - protected org.apache.axis2.description.xsd.PhaseRule localRules; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRulesTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.PhaseRule - */ - public org.apache.axis2.description.xsd.PhaseRule getRules() { - return this.localRules; - } - - - - /** - * Auto generated setter method - * - * @param param Rules - */ - public void setRules(final org.apache.axis2.description.xsd.PhaseRule param) { - this.localRulesTracker = true; - - this.localRules = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":HandlerDescription", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "HandlerDescription", - xmlWriter); - } - - - } - if (this.localClassNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "className", xmlWriter); - - - if (this.localClassName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localClassName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localHandlerTracker) { - if (this.localHandler == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "handler", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localHandler.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "handler"), xmlWriter); - } - } - if (this.localNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localParametersTracker) { - - if (this.localParameters != null) { - if (this.localParameters instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localParameters).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "parameters"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parameters", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localParameters, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parameters", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localParentTracker) { - if (this.localParent == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parent", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localParent.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "parent"), xmlWriter); - } - } - if (this.localRulesTracker) { - if (this.localRules == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "rules", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRules.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "rules"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localClassNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "className")); - - elementList.add(this.localClassName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localClassName)); - } - if (this.localHandlerTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "handler")); - - - elementList.add(this.localHandler == null ? null : this.localHandler); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localParametersTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "parameters")); - - - elementList.add(this.localParameters == null ? null : this.localParameters); - } - if (this.localParentTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "parent")); - - - elementList.add(this.localParent == null ? null : this.localParent); - } - if (this.localRulesTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "rules")); - - - elementList.add(this.localRules == null ? null : this.localRules); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static HandlerDescription parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final HandlerDescription object = new HandlerDescription(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"HandlerDescription".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (HandlerDescription) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "className").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setClassName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "handler").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setHandler(null); - reader.next(); - - reader.next(); - - } else { - - object.setHandler(org.apache.axis2.engine.xsd.Handler.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://description.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "parameters").equals(reader.getName())) { - - object.setParameters(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "parent").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setParent(null); - reader.next(); - - reader.next(); - - } else { - - object.setParent(org.apache.axis2.description.xsd.ParameterInclude.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://description.axis2.apache.org/xsd", - "rules").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRules(null); - reader.next(); - - reader.next(); - - } else { - - object.setRules(org.apache.axis2.description.xsd.PhaseRule.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/ParameterInclude.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/ParameterInclude.java deleted file mode 100644 index 66845658b..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/ParameterInclude.java +++ /dev/null @@ -1,464 +0,0 @@ - -/** - * ParameterInclude.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * ParameterInclude bean class - */ - -public abstract class ParameterInclude implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ParameterInclude Namespace URI = - * http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = -6199322761239721279L; - - /** - * field for Parameters - */ - - - protected java.lang.Object localParameters; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localParametersTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getParameters() { - return this.localParameters; - } - - - - /** - * Auto generated setter method - * - * @param param Parameters - */ - public void setParameters(final java.lang.Object param) { - this.localParametersTracker = true; - - this.localParameters = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ParameterInclude", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ParameterInclude", - xmlWriter); - } - - - } - if (this.localParametersTracker) { - - if (this.localParameters != null) { - if (this.localParameters instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localParameters).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "parameters"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parameters", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localParameters, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parameters", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localParametersTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "parameters")); - - - elementList.add(this.localParameters == null ? null : this.localParameters); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ParameterInclude parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ParameterInclude object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ParameterInclude".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ParameterInclude) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "parameters").equals(reader.getName())) { - - object.setParameters(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/PhaseRule.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/PhaseRule.java deleted file mode 100644 index 0ebb284f7..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/PhaseRule.java +++ /dev/null @@ -1,811 +0,0 @@ - -/** - * PhaseRule.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * PhaseRule bean class - */ - -public class PhaseRule implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = PhaseRule Namespace URI = - * http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = -7069848986532252443L; - - /** - * field for After - */ - - - protected java.lang.String localAfter; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAfterTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getAfter() { - return this.localAfter; - } - - - - /** - * Auto generated setter method - * - * @param param After - */ - public void setAfter(final java.lang.String param) { - this.localAfterTracker = true; - - this.localAfter = param; - - - } - - - /** - * field for Before - */ - - - protected java.lang.String localBefore; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localBeforeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getBefore() { - return this.localBefore; - } - - - - /** - * Auto generated setter method - * - * @param param Before - */ - public void setBefore(final java.lang.String param) { - this.localBeforeTracker = true; - - this.localBefore = param; - - - } - - - /** - * field for PhaseFirst - */ - - - protected boolean localPhaseFirst; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhaseFirstTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getPhaseFirst() { - return this.localPhaseFirst; - } - - - - /** - * Auto generated setter method - * - * @param param PhaseFirst - */ - public void setPhaseFirst(final boolean param) { - - // setting primitive attribute tracker to true - this.localPhaseFirstTracker = true; - - this.localPhaseFirst = param; - - - } - - - /** - * field for PhaseLast - */ - - - protected boolean localPhaseLast; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhaseLastTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getPhaseLast() { - return this.localPhaseLast; - } - - - - /** - * Auto generated setter method - * - * @param param PhaseLast - */ - public void setPhaseLast(final boolean param) { - - // setting primitive attribute tracker to true - this.localPhaseLastTracker = true; - - this.localPhaseLast = param; - - - } - - - /** - * field for PhaseName - */ - - - protected java.lang.String localPhaseName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhaseNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPhaseName() { - return this.localPhaseName; - } - - - - /** - * Auto generated setter method - * - * @param param PhaseName - */ - public void setPhaseName(final java.lang.String param) { - this.localPhaseNameTracker = true; - - this.localPhaseName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":PhaseRule", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PhaseRule", xmlWriter); - } - - - } - if (this.localAfterTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "after", xmlWriter); - - - if (this.localAfter == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localAfter); - - } - - xmlWriter.writeEndElement(); - } - if (this.localBeforeTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "before", xmlWriter); - - - if (this.localBefore == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localBefore); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPhaseFirstTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "phaseFirst", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("phaseFirst cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPhaseFirst)); - } - - xmlWriter.writeEndElement(); - } - if (this.localPhaseLastTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "phaseLast", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("phaseLast cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPhaseLast)); - } - - xmlWriter.writeEndElement(); - } - if (this.localPhaseNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "phaseName", xmlWriter); - - - if (this.localPhaseName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPhaseName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAfterTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "after")); - - elementList.add(this.localAfter == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAfter)); - } - if (this.localBeforeTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "before")); - - elementList.add(this.localBefore == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localBefore)); - } - if (this.localPhaseFirstTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "phaseFirst")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPhaseFirst)); - } - if (this.localPhaseLastTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "phaseLast")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPhaseLast)); - } - if (this.localPhaseNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "phaseName")); - - elementList.add(this.localPhaseName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPhaseName)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static PhaseRule parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final PhaseRule object = new PhaseRule(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"PhaseRule".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PhaseRule) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "after").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setAfter(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "before").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setBefore(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "phaseFirst").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPhaseFirst(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://description.axis2.apache.org/xsd", - "phaseLast").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPhaseLast(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://description.axis2.apache.org/xsd", - "phaseName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPhaseName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/TransportInDescription.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/TransportInDescription.java deleted file mode 100644 index d98dbf022..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/TransportInDescription.java +++ /dev/null @@ -1,979 +0,0 @@ - -/** - * TransportInDescription.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * TransportInDescription bean class - */ - -public class TransportInDescription implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = TransportInDescription Namespace - * URI = http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = -9068494219950011240L; - - /** - * field for FaultFlow - */ - - - protected org.apache.axis2.description.xsd.Flow localFaultFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.Flow - */ - public org.apache.axis2.description.xsd.Flow getFaultFlow() { - return this.localFaultFlow; - } - - - - /** - * Auto generated setter method - * - * @param param FaultFlow - */ - public void setFaultFlow(final org.apache.axis2.description.xsd.Flow param) { - this.localFaultFlowTracker = true; - - this.localFaultFlow = param; - - - } - - - /** - * field for FaultPhase - */ - - - protected org.apache.axis2.engine.xsd.Phase localFaultPhase; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultPhaseTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.Phase - */ - public org.apache.axis2.engine.xsd.Phase getFaultPhase() { - return this.localFaultPhase; - } - - - - /** - * Auto generated setter method - * - * @param param FaultPhase - */ - public void setFaultPhase(final org.apache.axis2.engine.xsd.Phase param) { - this.localFaultPhaseTracker = true; - - this.localFaultPhase = param; - - - } - - - /** - * field for InFlow - */ - - - protected org.apache.axis2.description.xsd.Flow localInFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.Flow - */ - public org.apache.axis2.description.xsd.Flow getInFlow() { - return this.localInFlow; - } - - - - /** - * Auto generated setter method - * - * @param param InFlow - */ - public void setInFlow(final org.apache.axis2.description.xsd.Flow param) { - this.localInFlowTracker = true; - - this.localInFlow = param; - - - } - - - /** - * field for InPhase - */ - - - protected org.apache.axis2.engine.xsd.Phase localInPhase; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInPhaseTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.Phase - */ - public org.apache.axis2.engine.xsd.Phase getInPhase() { - return this.localInPhase; - } - - - - /** - * Auto generated setter method - * - * @param param InPhase - */ - public void setInPhase(final org.apache.axis2.engine.xsd.Phase param) { - this.localInPhaseTracker = true; - - this.localInPhase = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for Parameters - */ - - - protected java.lang.Object localParameters; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localParametersTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getParameters() { - return this.localParameters; - } - - - - /** - * Auto generated setter method - * - * @param param Parameters - */ - public void setParameters(final java.lang.Object param) { - this.localParametersTracker = true; - - this.localParameters = param; - - - } - - - /** - * field for Receiver - */ - - - protected org.apache.axis2.transport.xsd.TransportListener localReceiver; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localReceiverTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.transport.xsd.TransportListener - */ - public org.apache.axis2.transport.xsd.TransportListener getReceiver() { - return this.localReceiver; - } - - - - /** - * Auto generated setter method - * - * @param param Receiver - */ - public void setReceiver(final org.apache.axis2.transport.xsd.TransportListener param) { - this.localReceiverTracker = true; - - this.localReceiver = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":TransportInDescription", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "TransportInDescription", - xmlWriter); - } - - - } - if (this.localFaultFlowTracker) { - if (this.localFaultFlow == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "faultFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFaultFlow.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultFlow"), xmlWriter); - } - } - if (this.localFaultPhaseTracker) { - if (this.localFaultPhase == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "faultPhase", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFaultPhase.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultPhase"), xmlWriter); - } - } - if (this.localInFlowTracker) { - if (this.localInFlow == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "inFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localInFlow.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "inFlow"), xmlWriter); - } - } - if (this.localInPhaseTracker) { - if (this.localInPhase == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "inPhase", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localInPhase.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "inPhase"), xmlWriter); - } - } - if (this.localNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localParametersTracker) { - - if (this.localParameters != null) { - if (this.localParameters instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localParameters).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "parameters"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parameters", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localParameters, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parameters", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localReceiverTracker) { - if (this.localReceiver == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "receiver", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localReceiver.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "receiver"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localFaultFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "faultFlow")); - - - elementList.add(this.localFaultFlow == null ? null : this.localFaultFlow); - } - if (this.localFaultPhaseTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "faultPhase")); - - - elementList.add(this.localFaultPhase == null ? null : this.localFaultPhase); - } - if (this.localInFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "inFlow")); - - - elementList.add(this.localInFlow == null ? null : this.localInFlow); - } - if (this.localInPhaseTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "inPhase")); - - - elementList.add(this.localInPhase == null ? null : this.localInPhase); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localParametersTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "parameters")); - - - elementList.add(this.localParameters == null ? null : this.localParameters); - } - if (this.localReceiverTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "receiver")); - - - elementList.add(this.localReceiver == null ? null : this.localReceiver); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static TransportInDescription parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TransportInDescription object = new TransportInDescription(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"TransportInDescription".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TransportInDescription) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultFlow").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFaultFlow(null); - reader.next(); - - reader.next(); - - } else { - - object.setFaultFlow(org.apache.axis2.description.xsd.Flow.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://description.axis2.apache.org/xsd", - "faultPhase").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFaultPhase(null); - reader.next(); - - reader.next(); - - } else { - - object.setFaultPhase(org.apache.axis2.engine.xsd.Phase.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://description.axis2.apache.org/xsd", - "inFlow").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setInFlow(null); - reader.next(); - - reader.next(); - - } else { - - object.setInFlow(org.apache.axis2.description.xsd.Flow.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://description.axis2.apache.org/xsd", - "inPhase").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setInPhase(null); - reader.next(); - - reader.next(); - - } else { - - object.setInPhase(org.apache.axis2.engine.xsd.Phase.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://description.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "parameters").equals(reader.getName())) { - - object.setParameters(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "receiver").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setReceiver(null); - reader.next(); - - reader.next(); - - } else { - - object.setReceiver(org.apache.axis2.transport.xsd.TransportListener.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/TransportOutDescription.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/TransportOutDescription.java deleted file mode 100644 index 30f348196..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/description/xsd/TransportOutDescription.java +++ /dev/null @@ -1,979 +0,0 @@ - -/** - * TransportOutDescription.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.description.xsd; - - -/** - * TransportOutDescription bean class - */ - -public class TransportOutDescription implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = TransportOutDescription - * Namespace URI = http://description.axis2.apache.org/xsd Namespace Prefix = ns19 - */ - - - /** - * - */ - private static final long serialVersionUID = -811850507867183948L; - - /** - * field for FaultFlow - */ - - - protected org.apache.axis2.description.xsd.Flow localFaultFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.Flow - */ - public org.apache.axis2.description.xsd.Flow getFaultFlow() { - return this.localFaultFlow; - } - - - - /** - * Auto generated setter method - * - * @param param FaultFlow - */ - public void setFaultFlow(final org.apache.axis2.description.xsd.Flow param) { - this.localFaultFlowTracker = true; - - this.localFaultFlow = param; - - - } - - - /** - * field for FaultPhase - */ - - - protected org.apache.axis2.engine.xsd.Phase localFaultPhase; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultPhaseTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.Phase - */ - public org.apache.axis2.engine.xsd.Phase getFaultPhase() { - return this.localFaultPhase; - } - - - - /** - * Auto generated setter method - * - * @param param FaultPhase - */ - public void setFaultPhase(final org.apache.axis2.engine.xsd.Phase param) { - this.localFaultPhaseTracker = true; - - this.localFaultPhase = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for OutFlow - */ - - - protected org.apache.axis2.description.xsd.Flow localOutFlow; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOutFlowTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.Flow - */ - public org.apache.axis2.description.xsd.Flow getOutFlow() { - return this.localOutFlow; - } - - - - /** - * Auto generated setter method - * - * @param param OutFlow - */ - public void setOutFlow(final org.apache.axis2.description.xsd.Flow param) { - this.localOutFlowTracker = true; - - this.localOutFlow = param; - - - } - - - /** - * field for OutPhase - */ - - - protected org.apache.axis2.engine.xsd.Phase localOutPhase; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOutPhaseTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.Phase - */ - public org.apache.axis2.engine.xsd.Phase getOutPhase() { - return this.localOutPhase; - } - - - - /** - * Auto generated setter method - * - * @param param OutPhase - */ - public void setOutPhase(final org.apache.axis2.engine.xsd.Phase param) { - this.localOutPhaseTracker = true; - - this.localOutPhase = param; - - - } - - - /** - * field for Parameters - */ - - - protected java.lang.Object localParameters; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localParametersTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getParameters() { - return this.localParameters; - } - - - - /** - * Auto generated setter method - * - * @param param Parameters - */ - public void setParameters(final java.lang.Object param) { - this.localParametersTracker = true; - - this.localParameters = param; - - - } - - - /** - * field for Sender - */ - - - protected org.apache.axis2.transport.xsd.TransportSender localSender; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSenderTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.transport.xsd.TransportSender - */ - public org.apache.axis2.transport.xsd.TransportSender getSender() { - return this.localSender; - } - - - - /** - * Auto generated setter method - * - * @param param Sender - */ - public void setSender(final org.apache.axis2.transport.xsd.TransportSender param) { - this.localSenderTracker = true; - - this.localSender = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://description.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":TransportOutDescription", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "TransportOutDescription", - xmlWriter); - } - - - } - if (this.localFaultFlowTracker) { - if (this.localFaultFlow == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "faultFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFaultFlow.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultFlow"), xmlWriter); - } - } - if (this.localFaultPhaseTracker) { - if (this.localFaultPhase == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "faultPhase", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFaultPhase.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultPhase"), xmlWriter); - } - } - if (this.localNameTracker) { - namespace = "http://description.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localOutFlowTracker) { - if (this.localOutFlow == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "outFlow", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localOutFlow.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "outFlow"), xmlWriter); - } - } - if (this.localOutPhaseTracker) { - if (this.localOutPhase == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "outPhase", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localOutPhase.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "outPhase"), xmlWriter); - } - } - if (this.localParametersTracker) { - - if (this.localParameters != null) { - if (this.localParameters instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localParameters).serialize(new javax.xml.namespace.QName( - "http://description.axis2.apache.org/xsd", "parameters"), xmlWriter, true); - } else { - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parameters", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localParameters, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://description.axis2.apache.org/xsd", "parameters", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localSenderTracker) { - if (this.localSender == null) { - - writeStartElement(null, "http://description.axis2.apache.org/xsd", "sender", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSender.serialize(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "sender"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://description.axis2.apache.org/xsd")) { - return "ns19"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localFaultFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "faultFlow")); - - - elementList.add(this.localFaultFlow == null ? null : this.localFaultFlow); - } - if (this.localFaultPhaseTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "faultPhase")); - - - elementList.add(this.localFaultPhase == null ? null : this.localFaultPhase); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localOutFlowTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "outFlow")); - - - elementList.add(this.localOutFlow == null ? null : this.localOutFlow); - } - if (this.localOutPhaseTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "outPhase")); - - - elementList.add(this.localOutPhase == null ? null : this.localOutPhase); - } - if (this.localParametersTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "parameters")); - - - elementList.add(this.localParameters == null ? null : this.localParameters); - } - if (this.localSenderTracker) { - elementList.add(new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", "sender")); - - - elementList.add(this.localSender == null ? null : this.localSender); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static TransportOutDescription parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TransportOutDescription object = new TransportOutDescription(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"TransportOutDescription".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TransportOutDescription) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "faultFlow").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFaultFlow(null); - reader.next(); - - reader.next(); - - } else { - - object.setFaultFlow(org.apache.axis2.description.xsd.Flow.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://description.axis2.apache.org/xsd", - "faultPhase").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFaultPhase(null); - reader.next(); - - reader.next(); - - } else { - - object.setFaultPhase(org.apache.axis2.engine.xsd.Phase.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://description.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "outFlow").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setOutFlow(null); - reader.next(); - - reader.next(); - - } else { - - object.setOutFlow(org.apache.axis2.description.xsd.Flow.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://description.axis2.apache.org/xsd", - "outPhase").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setOutPhase(null); - reader.next(); - - reader.next(); - - } else { - - object.setOutPhase(org.apache.axis2.engine.xsd.Phase.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://description.axis2.apache.org/xsd", - "parameters").equals(reader.getName())) { - - object.setParameters(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://description.axis2.apache.org/xsd", - "sender").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSender(null); - reader.next(); - - reader.next(); - - } else { - - object.setSender(org.apache.axis2.transport.xsd.TransportSender.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/AxisConfiguration.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/AxisConfiguration.java deleted file mode 100644 index 690cebcaf..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/AxisConfiguration.java +++ /dev/null @@ -1,3811 +0,0 @@ - -/** - * AxisConfiguration.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.engine.xsd; - - -/** - * AxisConfiguration bean class - */ - -public class AxisConfiguration implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = AxisConfiguration Namespace URI - * = http://engine.axis2.apache.org/xsd Namespace Prefix = ns8 - */ - - - /** - * - */ - private static final long serialVersionUID = -4972409878060057379L; - - /** - * field for ChildFirstClassLoading - */ - - - protected boolean localChildFirstClassLoading; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localChildFirstClassLoadingTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getChildFirstClassLoading() { - return this.localChildFirstClassLoading; - } - - - - /** - * Auto generated setter method - * - * @param param ChildFirstClassLoading - */ - public void setChildFirstClassLoading(final boolean param) { - - // setting primitive attribute tracker to true - this.localChildFirstClassLoadingTracker = true; - - this.localChildFirstClassLoading = param; - - - } - - - /** - * field for ClusteringAgent - */ - - - protected org.apache.axis2.clustering.xsd.ClusteringAgent localClusteringAgent; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localClusteringAgentTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.clustering.xsd.ClusteringAgent - */ - public org.apache.axis2.clustering.xsd.ClusteringAgent getClusteringAgent() { - return this.localClusteringAgent; - } - - - - /** - * Auto generated setter method - * - * @param param ClusteringAgent - */ - public void setClusteringAgent(final org.apache.axis2.clustering.xsd.ClusteringAgent param) { - this.localClusteringAgentTracker = true; - - this.localClusteringAgent = param; - - - } - - - /** - * field for Configurator - */ - - - protected org.apache.axis2.engine.xsd.AxisConfigurator localConfigurator; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConfiguratorTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.AxisConfigurator - */ - public org.apache.axis2.engine.xsd.AxisConfigurator getConfigurator() { - return this.localConfigurator; - } - - - - /** - * Auto generated setter method - * - * @param param Configurator - */ - public void setConfigurator(final org.apache.axis2.engine.xsd.AxisConfigurator param) { - this.localConfiguratorTracker = true; - - this.localConfigurator = param; - - - } - - - /** - * field for FaultyModules This was an Array! - */ - - - protected java.lang.String[] localFaultyModules; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultyModulesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getFaultyModules() { - return this.localFaultyModules; - } - - - - /** - * validate the array for FaultyModules - */ - protected void validateFaultyModules(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param FaultyModules - */ - public void setFaultyModules(final java.lang.String[] param) { - - validateFaultyModules(param); - - this.localFaultyModulesTracker = true; - - this.localFaultyModules = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addFaultyModules(final java.lang.String param) { - if (this.localFaultyModules == null) { - this.localFaultyModules = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localFaultyModulesTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localFaultyModules); - list.add(param); - this.localFaultyModules = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for FaultyServices This was an Array! - */ - - - protected java.lang.String[] localFaultyServices; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultyServicesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getFaultyServices() { - return this.localFaultyServices; - } - - - - /** - * validate the array for FaultyServices - */ - protected void validateFaultyServices(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param FaultyServices - */ - public void setFaultyServices(final java.lang.String[] param) { - - validateFaultyServices(param); - - this.localFaultyServicesTracker = true; - - this.localFaultyServices = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addFaultyServices(final java.lang.String param) { - if (this.localFaultyServices == null) { - this.localFaultyServices = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localFaultyServicesTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localFaultyServices); - list.add(param); - this.localFaultyServices = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for FaultyServicesDuetoModules - */ - - - protected authclient.java.util.xsd.Map localFaultyServicesDuetoModules; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultyServicesDuetoModulesTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getFaultyServicesDuetoModules() { - return this.localFaultyServicesDuetoModules; - } - - - - /** - * Auto generated setter method - * - * @param param FaultyServicesDuetoModules - */ - public void setFaultyServicesDuetoModules(final authclient.java.util.xsd.Map param) { - this.localFaultyServicesDuetoModulesTracker = true; - - this.localFaultyServicesDuetoModules = param; - - - } - - - /** - * field for GlobalModules - */ - - - protected java.lang.Object localGlobalModules; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localGlobalModulesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getGlobalModules() { - return this.localGlobalModules; - } - - - - /** - * Auto generated setter method - * - * @param param GlobalModules - */ - public void setGlobalModules(final java.lang.Object param) { - this.localGlobalModulesTracker = true; - - this.localGlobalModules = param; - - - } - - - /** - * field for GlobalOutPhase - */ - - - protected java.lang.Object localGlobalOutPhase; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localGlobalOutPhaseTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getGlobalOutPhase() { - return this.localGlobalOutPhase; - } - - - - /** - * Auto generated setter method - * - * @param param GlobalOutPhase - */ - public void setGlobalOutPhase(final java.lang.Object param) { - this.localGlobalOutPhaseTracker = true; - - this.localGlobalOutPhase = param; - - - } - - - /** - * field for InFaultFlowPhases - */ - - - protected java.lang.Object localInFaultFlowPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInFaultFlowPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getInFaultFlowPhases() { - return this.localInFaultFlowPhases; - } - - - - /** - * Auto generated setter method - * - * @param param InFaultFlowPhases - */ - public void setInFaultFlowPhases(final java.lang.Object param) { - this.localInFaultFlowPhasesTracker = true; - - this.localInFaultFlowPhases = param; - - - } - - - /** - * field for InFaultPhases - */ - - - protected java.lang.Object localInFaultPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInFaultPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getInFaultPhases() { - return this.localInFaultPhases; - } - - - - /** - * Auto generated setter method - * - * @param param InFaultPhases - */ - public void setInFaultPhases(final java.lang.Object param) { - this.localInFaultPhasesTracker = true; - - this.localInFaultPhases = param; - - - } - - - /** - * field for InFlowPhases - */ - - - protected java.lang.Object localInFlowPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInFlowPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getInFlowPhases() { - return this.localInFlowPhases; - } - - - - /** - * Auto generated setter method - * - * @param param InFlowPhases - */ - public void setInFlowPhases(final java.lang.Object param) { - this.localInFlowPhasesTracker = true; - - this.localInFlowPhases = param; - - - } - - - /** - * field for InPhasesUptoAndIncludingPostDispatch - */ - - - protected java.lang.Object localInPhasesUptoAndIncludingPostDispatch; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInPhasesUptoAndIncludingPostDispatchTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getInPhasesUptoAndIncludingPostDispatch() { - return this.localInPhasesUptoAndIncludingPostDispatch; - } - - - - /** - * Auto generated setter method - * - * @param param InPhasesUptoAndIncludingPostDispatch - */ - public void setInPhasesUptoAndIncludingPostDispatch(final java.lang.Object param) { - this.localInPhasesUptoAndIncludingPostDispatchTracker = true; - - this.localInPhasesUptoAndIncludingPostDispatch = param; - - - } - - - /** - * field for Key - */ - - - protected java.lang.Object localKey; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localKeyTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getKey() { - return this.localKey; - } - - - - /** - * Auto generated setter method - * - * @param param Key - */ - public void setKey(final java.lang.Object param) { - this.localKeyTracker = true; - - this.localKey = param; - - - } - - - /** - * field for LocalPolicyAssertions This was an Array! - */ - - - protected java.lang.Object[] localLocalPolicyAssertions; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLocalPolicyAssertionsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object[] - */ - public java.lang.Object[] getLocalPolicyAssertions() { - return this.localLocalPolicyAssertions; - } - - - - /** - * validate the array for LocalPolicyAssertions - */ - protected void validateLocalPolicyAssertions(final java.lang.Object[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param LocalPolicyAssertions - */ - public void setLocalPolicyAssertions(final java.lang.Object[] param) { - - validateLocalPolicyAssertions(param); - - this.localLocalPolicyAssertionsTracker = true; - - this.localLocalPolicyAssertions = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.Object - */ - public void addLocalPolicyAssertions(final java.lang.Object param) { - if (this.localLocalPolicyAssertions == null) { - this.localLocalPolicyAssertions = new java.lang.Object[] {}; - } - - - // update the setting tracker - this.localLocalPolicyAssertionsTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localLocalPolicyAssertions); - list.add(param); - this.localLocalPolicyAssertions = list.toArray(new java.lang.Object[list.size()]); - - } - - - /** - * field for ModuleClassLoader - */ - - - protected java.lang.Object localModuleClassLoader; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localModuleClassLoaderTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getModuleClassLoader() { - return this.localModuleClassLoader; - } - - - - /** - * Auto generated setter method - * - * @param param ModuleClassLoader - */ - public void setModuleClassLoader(final java.lang.Object param) { - this.localModuleClassLoaderTracker = true; - - this.localModuleClassLoader = param; - - - } - - - /** - * field for Modules - */ - - - protected java.lang.Object localModules; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localModulesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getModules() { - return this.localModules; - } - - - - /** - * Auto generated setter method - * - * @param param Modules - */ - public void setModules(final java.lang.Object param) { - this.localModulesTracker = true; - - this.localModules = param; - - - } - - - /** - * field for ObserversList - */ - - - protected java.lang.Object localObserversList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localObserversListTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getObserversList() { - return this.localObserversList; - } - - - - /** - * Auto generated setter method - * - * @param param ObserversList - */ - public void setObserversList(final java.lang.Object param) { - this.localObserversListTracker = true; - - this.localObserversList = param; - - - } - - - /** - * field for OutFaultFlowPhases - */ - - - protected java.lang.Object localOutFaultFlowPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOutFaultFlowPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOutFaultFlowPhases() { - return this.localOutFaultFlowPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OutFaultFlowPhases - */ - public void setOutFaultFlowPhases(final java.lang.Object param) { - this.localOutFaultFlowPhasesTracker = true; - - this.localOutFaultFlowPhases = param; - - - } - - - /** - * field for OutFaultPhases - */ - - - protected java.lang.Object localOutFaultPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOutFaultPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOutFaultPhases() { - return this.localOutFaultPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OutFaultPhases - */ - public void setOutFaultPhases(final java.lang.Object param) { - this.localOutFaultPhasesTracker = true; - - this.localOutFaultPhases = param; - - - } - - - /** - * field for OutFlowPhases - */ - - - protected java.lang.Object localOutFlowPhases; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOutFlowPhasesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getOutFlowPhases() { - return this.localOutFlowPhases; - } - - - - /** - * Auto generated setter method - * - * @param param OutFlowPhases - */ - public void setOutFlowPhases(final java.lang.Object param) { - this.localOutFlowPhasesTracker = true; - - this.localOutFlowPhases = param; - - - } - - - /** - * field for PhasesInfo - */ - - - protected org.apache.axis2.deployment.util.xsd.PhasesInfo localPhasesInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhasesInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.deployment.util.xsd.PhasesInfo - */ - public org.apache.axis2.deployment.util.xsd.PhasesInfo getPhasesInfo() { - return this.localPhasesInfo; - } - - - - /** - * Auto generated setter method - * - * @param param PhasesInfo - */ - public void setPhasesInfo(final org.apache.axis2.deployment.util.xsd.PhasesInfo param) { - this.localPhasesInfoTracker = true; - - this.localPhasesInfo = param; - - - } - - - /** - * field for Repository - */ - - - protected authclient.java.net.xsd.URL localRepository; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRepositoryTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.net.xsd.URL - */ - public authclient.java.net.xsd.URL getRepository() { - return this.localRepository; - } - - - - /** - * Auto generated setter method - * - * @param param Repository - */ - public void setRepository(final authclient.java.net.xsd.URL param) { - this.localRepositoryTracker = true; - - this.localRepository = param; - - - } - - - /** - * field for SecretResolver - */ - - - protected org.wso2.securevault.xsd.SecretResolver localSecretResolver; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSecretResolverTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.securevault.xsd.SecretResolver - */ - public org.wso2.securevault.xsd.SecretResolver getSecretResolver() { - return this.localSecretResolver; - } - - - - /** - * Auto generated setter method - * - * @param param SecretResolver - */ - public void setSecretResolver(final org.wso2.securevault.xsd.SecretResolver param) { - this.localSecretResolverTracker = true; - - this.localSecretResolver = param; - - - } - - - /** - * field for ServiceClassLoader - */ - - - protected java.lang.Object localServiceClassLoader; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceClassLoaderTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getServiceClassLoader() { - return this.localServiceClassLoader; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceClassLoader - */ - public void setServiceClassLoader(final java.lang.Object param) { - this.localServiceClassLoaderTracker = true; - - this.localServiceClassLoader = param; - - - } - - - /** - * field for ServiceGroups - */ - - - protected authclient.java.util.xsd.Iterator localServiceGroups; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServiceGroupsTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getServiceGroups() { - return this.localServiceGroups; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceGroups - */ - public void setServiceGroups(final authclient.java.util.xsd.Iterator param) { - this.localServiceGroupsTracker = true; - - this.localServiceGroups = param; - - - } - - - /** - * field for Services - */ - - - protected java.lang.Object localServices; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localServicesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getServices() { - return this.localServices; - } - - - - /** - * Auto generated setter method - * - * @param param Services - */ - public void setServices(final java.lang.Object param) { - this.localServicesTracker = true; - - this.localServices = param; - - - } - - - /** - * field for Start - */ - - - protected boolean localStart; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localStartTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getStart() { - return this.localStart; - } - - - - /** - * Auto generated setter method - * - * @param param Start - */ - public void setStart(final boolean param) { - - // setting primitive attribute tracker to true - this.localStartTracker = true; - - this.localStart = param; - - - } - - - /** - * field for SystemClassLoader - */ - - - protected java.lang.Object localSystemClassLoader; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSystemClassLoaderTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getSystemClassLoader() { - return this.localSystemClassLoader; - } - - - - /** - * Auto generated setter method - * - * @param param SystemClassLoader - */ - public void setSystemClassLoader(final java.lang.Object param) { - this.localSystemClassLoaderTracker = true; - - this.localSystemClassLoader = param; - - - } - - - /** - * field for TargetResolverChain - */ - - - protected org.apache.axis2.util.xsd.TargetResolver localTargetResolverChain; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTargetResolverChainTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.util.xsd.TargetResolver - */ - public org.apache.axis2.util.xsd.TargetResolver getTargetResolverChain() { - return this.localTargetResolverChain; - } - - - - /** - * Auto generated setter method - * - * @param param TargetResolverChain - */ - public void setTargetResolverChain(final org.apache.axis2.util.xsd.TargetResolver param) { - this.localTargetResolverChainTracker = true; - - this.localTargetResolverChain = param; - - - } - - - /** - * field for TransactionConfig - */ - - - protected org.apache.axis2.transaction.xsd.TransactionConfiguration localTransactionConfig; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransactionConfigTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.transaction.xsd.TransactionConfiguration - */ - public org.apache.axis2.transaction.xsd.TransactionConfiguration getTransactionConfig() { - return this.localTransactionConfig; - } - - - - /** - * Auto generated setter method - * - * @param param TransactionConfig - */ - public void setTransactionConfig(final org.apache.axis2.transaction.xsd.TransactionConfiguration param) { - this.localTransactionConfigTracker = true; - - this.localTransactionConfig = param; - - - } - - - /** - * field for TransactionConfiguration - */ - - - protected org.apache.axis2.transaction.xsd.TransactionConfiguration localTransactionConfiguration; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransactionConfigurationTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.transaction.xsd.TransactionConfiguration - */ - public org.apache.axis2.transaction.xsd.TransactionConfiguration getTransactionConfiguration() { - return this.localTransactionConfiguration; - } - - - - /** - * Auto generated setter method - * - * @param param TransactionConfiguration - */ - public void setTransactionConfiguration(final org.apache.axis2.transaction.xsd.TransactionConfiguration param) { - this.localTransactionConfigurationTracker = true; - - this.localTransactionConfiguration = param; - - - } - - - /** - * field for TransportsIn This was an Array! - */ - - - protected java.lang.String[] localTransportsIn; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransportsInTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getTransportsIn() { - return this.localTransportsIn; - } - - - - /** - * validate the array for TransportsIn - */ - protected void validateTransportsIn(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param TransportsIn - */ - public void setTransportsIn(final java.lang.String[] param) { - - validateTransportsIn(param); - - this.localTransportsInTracker = true; - - this.localTransportsIn = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addTransportsIn(final java.lang.String param) { - if (this.localTransportsIn == null) { - this.localTransportsIn = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localTransportsInTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localTransportsIn); - list.add(param); - this.localTransportsIn = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for TransportsOut This was an Array! - */ - - - protected java.lang.String[] localTransportsOut; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransportsOutTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getTransportsOut() { - return this.localTransportsOut; - } - - - - /** - * validate the array for TransportsOut - */ - protected void validateTransportsOut(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param TransportsOut - */ - public void setTransportsOut(final java.lang.String[] param) { - - validateTransportsOut(param); - - this.localTransportsOutTracker = true; - - this.localTransportsOut = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addTransportsOut(final java.lang.String param) { - if (this.localTransportsOut == null) { - this.localTransportsOut = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localTransportsOutTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localTransportsOut); - list.add(param); - this.localTransportsOut = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://engine.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AxisConfiguration", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AxisConfiguration", - xmlWriter); - } - - - } - if (this.localChildFirstClassLoadingTracker) { - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "childFirstClassLoading", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("childFirstClassLoading cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localChildFirstClassLoading)); - } - - xmlWriter.writeEndElement(); - } - if (this.localClusteringAgentTracker) { - if (this.localClusteringAgent == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "clusteringAgent", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localClusteringAgent.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "clusteringAgent"), xmlWriter); - } - } - if (this.localConfiguratorTracker) { - if (this.localConfigurator == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "configurator", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConfigurator.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "configurator"), xmlWriter); - } - } - if (this.localFaultyModulesTracker) { - if (this.localFaultyModules != null) { - namespace = "http://engine.axis2.apache.org/xsd"; - for (final String localFaultyModule : this.localFaultyModules) { - - if (localFaultyModule != null) { - - writeStartElement(null, namespace, "faultyModules", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFaultyModule)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "faultyModules", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "faultyModules", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localFaultyServicesTracker) { - if (this.localFaultyServices != null) { - namespace = "http://engine.axis2.apache.org/xsd"; - for (final String localFaultyService : this.localFaultyServices) { - - if (localFaultyService != null) { - - writeStartElement(null, namespace, "faultyServices", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFaultyService)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "faultyServices", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "faultyServices", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localFaultyServicesDuetoModulesTracker) { - if (this.localFaultyServicesDuetoModules == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "faultyServicesDuetoModules", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFaultyServicesDuetoModules.serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "faultyServicesDuetoModules"), xmlWriter); - } - } - if (this.localGlobalModulesTracker) { - - if (this.localGlobalModules != null) { - if (this.localGlobalModules instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localGlobalModules).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "globalModules"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "globalModules", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localGlobalModules, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "globalModules", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localGlobalOutPhaseTracker) { - - if (this.localGlobalOutPhase != null) { - if (this.localGlobalOutPhase instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localGlobalOutPhase).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "globalOutPhase"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "globalOutPhase", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localGlobalOutPhase, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "globalOutPhase", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localInFaultFlowPhasesTracker) { - - if (this.localInFaultFlowPhases != null) { - if (this.localInFaultFlowPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localInFaultFlowPhases).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "inFaultFlowPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "inFaultFlowPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localInFaultFlowPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "inFaultFlowPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localInFaultPhasesTracker) { - - if (this.localInFaultPhases != null) { - if (this.localInFaultPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localInFaultPhases).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "inFaultPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "inFaultPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localInFaultPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "inFaultPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localInFlowPhasesTracker) { - - if (this.localInFlowPhases != null) { - if (this.localInFlowPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localInFlowPhases).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "inFlowPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "inFlowPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localInFlowPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "inFlowPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localInPhasesUptoAndIncludingPostDispatchTracker) { - - if (this.localInPhasesUptoAndIncludingPostDispatch != null) { - if (this.localInPhasesUptoAndIncludingPostDispatch instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localInPhasesUptoAndIncludingPostDispatch).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "inPhasesUptoAndIncludingPostDispatch"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", - "inPhasesUptoAndIncludingPostDispatch", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localInPhasesUptoAndIncludingPostDispatch, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "inPhasesUptoAndIncludingPostDispatch", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localKeyTracker) { - - if (this.localKey != null) { - if (this.localKey instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localKey).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "key"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "key", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localKey, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "key", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localLocalPolicyAssertionsTracker) { - - if (this.localLocalPolicyAssertions != null) { - for (final Object localLocalPolicyAssertion : this.localLocalPolicyAssertions) { - if (localLocalPolicyAssertion != null) { - - if (localLocalPolicyAssertion instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) localLocalPolicyAssertion).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "localPolicyAssertions"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "localPolicyAssertions", - xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(localLocalPolicyAssertion, - xmlWriter); - xmlWriter.writeEndElement(); - } - - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "localPolicyAssertions", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "localPolicyAssertions", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localModuleClassLoaderTracker) { - - if (this.localModuleClassLoader != null) { - if (this.localModuleClassLoader instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localModuleClassLoader).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "moduleClassLoader"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "moduleClassLoader", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localModuleClassLoader, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "moduleClassLoader", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localModulesTracker) { - - if (this.localModules != null) { - if (this.localModules instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localModules).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "modules"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "modules", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localModules, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "modules", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localObserversListTracker) { - - if (this.localObserversList != null) { - if (this.localObserversList instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localObserversList).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "observersList"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "observersList", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localObserversList, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "observersList", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOutFaultFlowPhasesTracker) { - - if (this.localOutFaultFlowPhases != null) { - if (this.localOutFaultFlowPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOutFaultFlowPhases).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "outFaultFlowPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "outFaultFlowPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOutFaultFlowPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "outFaultFlowPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOutFaultPhasesTracker) { - - if (this.localOutFaultPhases != null) { - if (this.localOutFaultPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOutFaultPhases).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "outFaultPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "outFaultPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOutFaultPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "outFaultPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localOutFlowPhasesTracker) { - - if (this.localOutFlowPhases != null) { - if (this.localOutFlowPhases instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localOutFlowPhases).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "outFlowPhases"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "outFlowPhases", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localOutFlowPhases, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "outFlowPhases", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localPhasesInfoTracker) { - if (this.localPhasesInfo == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "phasesInfo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localPhasesInfo.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "phasesInfo"), xmlWriter); - } - } - if (this.localRepositoryTracker) { - if (this.localRepository == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "repository", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localRepository.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "repository"), xmlWriter); - } - } - if (this.localSecretResolverTracker) { - if (this.localSecretResolver == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "secretResolver", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSecretResolver.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "secretResolver"), xmlWriter); - } - } - if (this.localServiceClassLoaderTracker) { - - if (this.localServiceClassLoader != null) { - if (this.localServiceClassLoader instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localServiceClassLoader).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "serviceClassLoader"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "serviceClassLoader", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localServiceClassLoader, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "serviceClassLoader", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localServiceGroupsTracker) { - if (this.localServiceGroups == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "serviceGroups", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localServiceGroups.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "serviceGroups"), xmlWriter); - } - } - if (this.localServicesTracker) { - - if (this.localServices != null) { - if (this.localServices instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localServices).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "services"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "services", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localServices, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "services", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localStartTracker) { - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "start", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("start cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localStart)); - } - - xmlWriter.writeEndElement(); - } - if (this.localSystemClassLoaderTracker) { - - if (this.localSystemClassLoader != null) { - if (this.localSystemClassLoader instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localSystemClassLoader).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "systemClassLoader"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "systemClassLoader", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localSystemClassLoader, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "systemClassLoader", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localTargetResolverChainTracker) { - if (this.localTargetResolverChain == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "targetResolverChain", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTargetResolverChain.serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "targetResolverChain"), xmlWriter); - } - } - if (this.localTransactionConfigTracker) { - if (this.localTransactionConfig == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "transactionConfig", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTransactionConfig.serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "transactionConfig"), xmlWriter); - } - } - if (this.localTransactionConfigurationTracker) { - if (this.localTransactionConfiguration == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "transactionConfiguration", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localTransactionConfiguration.serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "transactionConfiguration"), xmlWriter); - } - } - if (this.localTransportsInTracker) { - if (this.localTransportsIn != null) { - namespace = "http://engine.axis2.apache.org/xsd"; - for (final String element : this.localTransportsIn) { - - if (element != null) { - - writeStartElement(null, namespace, "transportsIn", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "transportsIn", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "transportsIn", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - if (this.localTransportsOutTracker) { - if (this.localTransportsOut != null) { - namespace = "http://engine.axis2.apache.org/xsd"; - for (final String element : this.localTransportsOut) { - - if (element != null) { - - writeStartElement(null, namespace, "transportsOut", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "transportsOut", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "transportsOut", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://engine.axis2.apache.org/xsd")) { - return "ns8"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localChildFirstClassLoadingTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "childFirstClassLoading")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localChildFirstClassLoading)); - } - if (this.localClusteringAgentTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "clusteringAgent")); - - - elementList.add(this.localClusteringAgent == null ? null : this.localClusteringAgent); - } - if (this.localConfiguratorTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "configurator")); - - - elementList.add(this.localConfigurator == null ? null : this.localConfigurator); - } - if (this.localFaultyModulesTracker) { - if (this.localFaultyModules != null) { - for (final String localFaultyModule : this.localFaultyModules) { - - if (localFaultyModule != null) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "faultyModules")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFaultyModule)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "faultyModules")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "faultyModules")); - elementList.add(null); - - } - - } - if (this.localFaultyServicesTracker) { - if (this.localFaultyServices != null) { - for (final String localFaultyService : this.localFaultyServices) { - - if (localFaultyService != null) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "faultyServices")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFaultyService)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "faultyServices")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "faultyServices")); - elementList.add(null); - - } - - } - if (this.localFaultyServicesDuetoModulesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "faultyServicesDuetoModules")); - - - elementList.add(this.localFaultyServicesDuetoModules == null ? null : this.localFaultyServicesDuetoModules); - } - if (this.localGlobalModulesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "globalModules")); - - - elementList.add(this.localGlobalModules == null ? null : this.localGlobalModules); - } - if (this.localGlobalOutPhaseTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "globalOutPhase")); - - - elementList.add(this.localGlobalOutPhase == null ? null : this.localGlobalOutPhase); - } - if (this.localInFaultFlowPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "inFaultFlowPhases")); - - - elementList.add(this.localInFaultFlowPhases == null ? null : this.localInFaultFlowPhases); - } - if (this.localInFaultPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "inFaultPhases")); - - - elementList.add(this.localInFaultPhases == null ? null : this.localInFaultPhases); - } - if (this.localInFlowPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "inFlowPhases")); - - - elementList.add(this.localInFlowPhases == null ? null : this.localInFlowPhases); - } - if (this.localInPhasesUptoAndIncludingPostDispatchTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "inPhasesUptoAndIncludingPostDispatch")); - - - elementList.add(this.localInPhasesUptoAndIncludingPostDispatch == null ? null - : this.localInPhasesUptoAndIncludingPostDispatch); - } - if (this.localKeyTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "key")); - - - elementList.add(this.localKey == null ? null : this.localKey); - } - if (this.localLocalPolicyAssertionsTracker) { - if (this.localLocalPolicyAssertions != null) { - for (final Object localLocalPolicyAssertion : this.localLocalPolicyAssertions) { - - if (localLocalPolicyAssertion != null) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "localPolicyAssertions")); - elementList.add(localLocalPolicyAssertion); - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "localPolicyAssertions")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "localPolicyAssertions")); - elementList.add(this.localLocalPolicyAssertions); - - } - - } - if (this.localModuleClassLoaderTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "moduleClassLoader")); - - - elementList.add(this.localModuleClassLoader == null ? null : this.localModuleClassLoader); - } - if (this.localModulesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "modules")); - - - elementList.add(this.localModules == null ? null : this.localModules); - } - if (this.localObserversListTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "observersList")); - - - elementList.add(this.localObserversList == null ? null : this.localObserversList); - } - if (this.localOutFaultFlowPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "outFaultFlowPhases")); - - - elementList.add(this.localOutFaultFlowPhases == null ? null : this.localOutFaultFlowPhases); - } - if (this.localOutFaultPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "outFaultPhases")); - - - elementList.add(this.localOutFaultPhases == null ? null : this.localOutFaultPhases); - } - if (this.localOutFlowPhasesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "outFlowPhases")); - - - elementList.add(this.localOutFlowPhases == null ? null : this.localOutFlowPhases); - } - if (this.localPhasesInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "phasesInfo")); - - - elementList.add(this.localPhasesInfo == null ? null : this.localPhasesInfo); - } - if (this.localRepositoryTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "repository")); - - - elementList.add(this.localRepository == null ? null : this.localRepository); - } - if (this.localSecretResolverTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "secretResolver")); - - - elementList.add(this.localSecretResolver == null ? null : this.localSecretResolver); - } - if (this.localServiceClassLoaderTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "serviceClassLoader")); - - - elementList.add(this.localServiceClassLoader == null ? null : this.localServiceClassLoader); - } - if (this.localServiceGroupsTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "serviceGroups")); - - - elementList.add(this.localServiceGroups == null ? null : this.localServiceGroups); - } - if (this.localServicesTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "services")); - - - elementList.add(this.localServices == null ? null : this.localServices); - } - if (this.localStartTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "start")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localStart)); - } - if (this.localSystemClassLoaderTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "systemClassLoader")); - - - elementList.add(this.localSystemClassLoader == null ? null : this.localSystemClassLoader); - } - if (this.localTargetResolverChainTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "targetResolverChain")); - - - elementList.add(this.localTargetResolverChain == null ? null : this.localTargetResolverChain); - } - if (this.localTransactionConfigTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "transactionConfig")); - - - elementList.add(this.localTransactionConfig == null ? null : this.localTransactionConfig); - } - if (this.localTransactionConfigurationTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "transactionConfiguration")); - - - elementList.add(this.localTransactionConfiguration == null ? null : this.localTransactionConfiguration); - } - if (this.localTransportsInTracker) { - if (this.localTransportsIn != null) { - for (final String element : this.localTransportsIn) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "transportsIn")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "transportsIn")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "transportsIn")); - elementList.add(null); - - } - - } - if (this.localTransportsOutTracker) { - if (this.localTransportsOut != null) { - for (final String element : this.localTransportsOut) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "transportsOut")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "transportsOut")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "transportsOut")); - elementList.add(null); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AxisConfiguration parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AxisConfiguration object = new AxisConfiguration(); - - int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AxisConfiguration".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AxisConfiguration) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list4 = new java.util.ArrayList(); - - final java.util.ArrayList list5 = new java.util.ArrayList(); - - final java.util.ArrayList list14 = new java.util.ArrayList(); - - final java.util.ArrayList list32 = new java.util.ArrayList(); - - final java.util.ArrayList list33 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "childFirstClassLoading").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setChildFirstClassLoading(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://engine.axis2.apache.org/xsd", - "clusteringAgent").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setClusteringAgent(null); - reader.next(); - - reader.next(); - - } else { - - object.setClusteringAgent(org.apache.axis2.clustering.xsd.ClusteringAgent.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://engine.axis2.apache.org/xsd", - "configurator").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConfigurator(null); - reader.next(); - - reader.next(); - - } else { - - object.setConfigurator(org.apache.axis2.engine.xsd.AxisConfigurator.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://engine.axis2.apache.org/xsd", - "faultyModules").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list4.add(null); - - reader.next(); - } else { - list4.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone4 = false; - while (!loopDone4) { - // 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 - loopDone4 = true; - } else { - if (new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "faultyModules").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list4.add(null); - - reader.next(); - } else { - list4.add(reader.getElementText()); - } - } else { - loopDone4 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setFaultyModules((java.lang.String[]) list4.toArray(new java.lang.String[list4.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://engine.axis2.apache.org/xsd", - "faultyServices").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list5.add(null); - - reader.next(); - } else { - list5.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone5 = false; - while (!loopDone5) { - // 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 - loopDone5 = true; - } else { - if (new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "faultyServices").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list5.add(null); - - reader.next(); - } else { - list5.add(reader.getElementText()); - } - } else { - loopDone5 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setFaultyServices((java.lang.String[]) list5.toArray(new java.lang.String[list5.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://engine.axis2.apache.org/xsd", - "faultyServicesDuetoModules").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFaultyServicesDuetoModules(null); - reader.next(); - - reader.next(); - - } else { - - object.setFaultyServicesDuetoModules(authclient.java.util.xsd.Map.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://engine.axis2.apache.org/xsd", - "globalModules").equals(reader.getName())) { - - object.setGlobalModules(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "globalOutPhase").equals(reader.getName())) { - - object.setGlobalOutPhase(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "inFaultFlowPhases").equals(reader.getName())) { - - object.setInFaultFlowPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "inFaultPhases").equals(reader.getName())) { - - object.setInFaultPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "inFlowPhases").equals(reader.getName())) { - - object.setInFlowPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "inPhasesUptoAndIncludingPostDispatch").equals(reader.getName())) { - - object.setInPhasesUptoAndIncludingPostDispatch(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "key").equals(reader.getName())) { - - object.setKey(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "localPolicyAssertions").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - - boolean loopDone14 = false; - final javax.xml.namespace.QName startQname14 = - new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "localPolicyAssertions"); - - while (!loopDone14) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event - && startQname14.equals(reader.getName())) { - - - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list14.add(null); - reader.next(); - } else { - list14.add(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - } - } else if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event - && !startQname14.equals(reader.getName())) { - loopDone14 = true; - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event - && !startQname14.equals(reader.getName())) { - loopDone14 = true; - } else if (javax.xml.stream.XMLStreamConstants.END_DOCUMENT == event) { - loopDone14 = true; - } else { - reader.next(); - } - - } - - - object.setLocalPolicyAssertions(list14.toArray()); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "moduleClassLoader").equals(reader.getName())) { - - object.setModuleClassLoader(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "modules").equals(reader.getName())) { - - object.setModules(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "observersList").equals(reader.getName())) { - - object.setObserversList(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "outFaultFlowPhases").equals(reader.getName())) { - - object.setOutFaultFlowPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "outFaultPhases").equals(reader.getName())) { - - object.setOutFaultPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "outFlowPhases").equals(reader.getName())) { - - object.setOutFlowPhases(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "phasesInfo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setPhasesInfo(null); - reader.next(); - - reader.next(); - - } else { - - object.setPhasesInfo(org.apache.axis2.deployment.util.xsd.PhasesInfo.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://engine.axis2.apache.org/xsd", - "repository").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setRepository(null); - reader.next(); - - reader.next(); - - } else { - - object.setRepository(authclient.java.net.xsd.URL.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://engine.axis2.apache.org/xsd", - "secretResolver").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSecretResolver(null); - reader.next(); - - reader.next(); - - } else { - - object.setSecretResolver(org.wso2.securevault.xsd.SecretResolver.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://engine.axis2.apache.org/xsd", - "serviceClassLoader").equals(reader.getName())) { - - object.setServiceClassLoader(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "serviceGroups").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setServiceGroups(null); - reader.next(); - - reader.next(); - - } else { - - object.setServiceGroups(authclient.java.util.xsd.Iterator.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://engine.axis2.apache.org/xsd", - "services").equals(reader.getName())) { - - object.setServices(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "start").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setStart(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://engine.axis2.apache.org/xsd", - "systemClassLoader").equals(reader.getName())) { - - object.setSystemClassLoader(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "targetResolverChain").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTargetResolverChain(null); - reader.next(); - - reader.next(); - - } else { - - object.setTargetResolverChain(org.apache.axis2.util.xsd.TargetResolver.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://engine.axis2.apache.org/xsd", - "transactionConfig").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTransactionConfig(null); - reader.next(); - - reader.next(); - - } else { - - object.setTransactionConfig(org.apache.axis2.transaction.xsd.TransactionConfiguration.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://engine.axis2.apache.org/xsd", - "transactionConfiguration").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setTransactionConfiguration(null); - reader.next(); - - reader.next(); - - } else { - - object.setTransactionConfiguration(org.apache.axis2.transaction.xsd.TransactionConfiguration.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://engine.axis2.apache.org/xsd", - "transportsIn").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list32.add(null); - - reader.next(); - } else { - list32.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone32 = false; - while (!loopDone32) { - // 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 - loopDone32 = true; - } else { - if (new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "transportsIn").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list32.add(null); - - reader.next(); - } else { - list32.add(reader.getElementText()); - } - } else { - loopDone32 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setTransportsIn((java.lang.String[]) list32.toArray(new java.lang.String[list32.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://engine.axis2.apache.org/xsd", - "transportsOut").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list33.add(null); - - reader.next(); - } else { - list33.add(reader.getElementText()); - } - // loop until we find a start element that is not part of this array - boolean loopDone33 = false; - while (!loopDone33) { - // 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 - loopDone33 = true; - } else { - if (new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "transportsOut").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list33.add(null); - - reader.next(); - } else { - list33.add(reader.getElementText()); - } - } else { - loopDone33 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setTransportsOut((java.lang.String[]) list33.toArray(new java.lang.String[list33.size()])); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/AxisConfigurator.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/AxisConfigurator.java deleted file mode 100644 index 0893048ed..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/AxisConfigurator.java +++ /dev/null @@ -1,460 +0,0 @@ - -/** - * AxisConfigurator.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.engine.xsd; - - -/** - * AxisConfigurator bean class - */ - -public abstract class AxisConfigurator implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = AxisConfigurator Namespace URI = - * http://engine.axis2.apache.org/xsd Namespace Prefix = ns8 - */ - - - /** - * - */ - private static final long serialVersionUID = -7199236038319636857L; - - /** - * field for AxisConfiguration - */ - - - protected org.apache.axis2.engine.xsd.AxisConfiguration localAxisConfiguration; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAxisConfigurationTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.AxisConfiguration - */ - public org.apache.axis2.engine.xsd.AxisConfiguration getAxisConfiguration() { - return this.localAxisConfiguration; - } - - - - /** - * Auto generated setter method - * - * @param param AxisConfiguration - */ - public void setAxisConfiguration(final org.apache.axis2.engine.xsd.AxisConfiguration param) { - this.localAxisConfigurationTracker = true; - - this.localAxisConfiguration = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://engine.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AxisConfigurator", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AxisConfigurator", - xmlWriter); - } - - - } - if (this.localAxisConfigurationTracker) { - if (this.localAxisConfiguration == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "axisConfiguration", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAxisConfiguration.serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "axisConfiguration"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://engine.axis2.apache.org/xsd")) { - return "ns8"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAxisConfigurationTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "axisConfiguration")); - - - elementList.add(this.localAxisConfiguration == null ? null : this.localAxisConfiguration); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AxisConfigurator parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AxisConfigurator object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AxisConfigurator".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AxisConfigurator) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "axisConfiguration").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAxisConfiguration(null); - reader.next(); - - reader.next(); - - } else { - - object.setAxisConfiguration(org.apache.axis2.engine.xsd.AxisConfiguration.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/Handler.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/Handler.java deleted file mode 100644 index 8535e90ee..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/Handler.java +++ /dev/null @@ -1,551 +0,0 @@ - -/** - * Handler.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.engine.xsd; - - -/** - * Handler bean class - */ - -public abstract class Handler implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Handler Namespace URI = - * http://engine.axis2.apache.org/xsd Namespace Prefix = ns8 - */ - - - /** - * - */ - private static final long serialVersionUID = -149223018209896470L; - - /** - * field for HandlerDesc - */ - - - protected org.apache.axis2.description.xsd.HandlerDescription localHandlerDesc; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHandlerDescTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.HandlerDescription - */ - public org.apache.axis2.description.xsd.HandlerDescription getHandlerDesc() { - return this.localHandlerDesc; - } - - - - /** - * Auto generated setter method - * - * @param param HandlerDesc - */ - public void setHandlerDesc(final org.apache.axis2.description.xsd.HandlerDescription param) { - this.localHandlerDescTracker = true; - - this.localHandlerDesc = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://engine.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Handler", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Handler", xmlWriter); - } - - - } - if (this.localHandlerDescTracker) { - if (this.localHandlerDesc == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "handlerDesc", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localHandlerDesc.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "handlerDesc"), xmlWriter); - } - } - if (this.localNameTracker) { - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://engine.axis2.apache.org/xsd")) { - return "ns8"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localHandlerDescTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "handlerDesc")); - - - elementList.add(this.localHandlerDesc == null ? null : this.localHandlerDesc); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Handler parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Handler object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Handler".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Handler) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "handlerDesc").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setHandlerDesc(null); - reader.next(); - - reader.next(); - - } else { - - object.setHandlerDesc(org.apache.axis2.description.xsd.HandlerDescription.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://engine.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ListenerManager.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ListenerManager.java deleted file mode 100644 index 0787ed0a1..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ListenerManager.java +++ /dev/null @@ -1,618 +0,0 @@ - -/** - * ListenerManager.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.engine.xsd; - - -/** - * ListenerManager bean class - */ - -public class ListenerManager implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ListenerManager Namespace URI = - * http://engine.axis2.apache.org/xsd Namespace Prefix = ns8 - */ - - - /** - * - */ - private static final long serialVersionUID = 7183198322894566898L; - - /** - * field for Configctx - */ - - - protected org.apache.axis2.context.xsd.ConfigurationContext localConfigctx; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConfigctxTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.ConfigurationContext - */ - public org.apache.axis2.context.xsd.ConfigurationContext getConfigctx() { - return this.localConfigctx; - } - - - - /** - * Auto generated setter method - * - * @param param Configctx - */ - public void setConfigctx(final org.apache.axis2.context.xsd.ConfigurationContext param) { - this.localConfigctxTracker = true; - - this.localConfigctx = param; - - - } - - - /** - * field for ShutdownHookRequired - */ - - - protected boolean localShutdownHookRequired; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localShutdownHookRequiredTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getShutdownHookRequired() { - return this.localShutdownHookRequired; - } - - - - /** - * Auto generated setter method - * - * @param param ShutdownHookRequired - */ - public void setShutdownHookRequired(final boolean param) { - - // setting primitive attribute tracker to true - this.localShutdownHookRequiredTracker = true; - - this.localShutdownHookRequired = param; - - - } - - - /** - * field for Stopped - */ - - - protected boolean localStopped; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localStoppedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getStopped() { - return this.localStopped; - } - - - - /** - * Auto generated setter method - * - * @param param Stopped - */ - public void setStopped(final boolean param) { - - // setting primitive attribute tracker to true - this.localStoppedTracker = true; - - this.localStopped = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://engine.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ListenerManager", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ListenerManager", - xmlWriter); - } - - - } - if (this.localConfigctxTracker) { - if (this.localConfigctx == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "configctx", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConfigctx.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "configctx"), xmlWriter); - } - } - if (this.localShutdownHookRequiredTracker) { - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "shutdownHookRequired", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("shutdownHookRequired cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localShutdownHookRequired)); - } - - xmlWriter.writeEndElement(); - } - if (this.localStoppedTracker) { - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "stopped", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("stopped cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localStopped)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://engine.axis2.apache.org/xsd")) { - return "ns8"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localConfigctxTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "configctx")); - - - elementList.add(this.localConfigctx == null ? null : this.localConfigctx); - } - if (this.localShutdownHookRequiredTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "shutdownHookRequired")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localShutdownHookRequired)); - } - if (this.localStoppedTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "stopped")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localStopped)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ListenerManager parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ListenerManager object = new ListenerManager(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ListenerManager".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListenerManager) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "configctx").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConfigctx(null); - reader.next(); - - reader.next(); - - } else { - - object.setConfigctx(org.apache.axis2.context.xsd.ConfigurationContext.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://engine.axis2.apache.org/xsd", - "shutdownHookRequired").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setShutdownHookRequired(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://engine.axis2.apache.org/xsd", - "stopped").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setStopped(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/MessageReceiver.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/MessageReceiver.java deleted file mode 100644 index e04e97709..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/MessageReceiver.java +++ /dev/null @@ -1,379 +0,0 @@ - -/** - * MessageReceiver.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.engine.xsd; - - -/** - * MessageReceiver bean class - */ - -public abstract class MessageReceiver implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = MessageReceiver Namespace URI = - * http://engine.axis2.apache.org/xsd Namespace Prefix = ns8 - */ - - - - /** - * - */ - private static final long serialVersionUID = -2923692097481142991L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://engine.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":MessageReceiver", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "MessageReceiver", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://engine.axis2.apache.org/xsd")) { - return "ns8"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 MessageReceiver parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final MessageReceiver object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"MessageReceiver".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (MessageReceiver) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ObjectSupplier.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ObjectSupplier.java deleted file mode 100644 index a13504f8b..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ObjectSupplier.java +++ /dev/null @@ -1,378 +0,0 @@ - -/** - * ObjectSupplier.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.engine.xsd; - - -/** - * ObjectSupplier bean class - */ - -public abstract class ObjectSupplier implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ObjectSupplier Namespace URI = - * http://engine.axis2.apache.org/xsd Namespace Prefix = ns8 - */ - - - - /** - * - */ - private static final long serialVersionUID = 7493438612072855076L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://engine.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ObjectSupplier", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ObjectSupplier", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://engine.axis2.apache.org/xsd")) { - return "ns8"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 ObjectSupplier parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ObjectSupplier object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ObjectSupplier".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ObjectSupplier) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/Phase.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/Phase.java deleted file mode 100644 index 1cebdd65b..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/Phase.java +++ /dev/null @@ -1,981 +0,0 @@ - -/** - * Phase.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.engine.xsd; - - -/** - * Phase bean class - */ - -public class Phase implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Phase Namespace URI = - * http://engine.axis2.apache.org/xsd Namespace Prefix = ns8 - */ - - - /** - * - */ - private static final long serialVersionUID = 4470390831534784463L; - - /** - * field for HandlerCount - */ - - - protected int localHandlerCount; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHandlerCountTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getHandlerCount() { - return this.localHandlerCount; - } - - - - /** - * Auto generated setter method - * - * @param param HandlerCount - */ - public void setHandlerCount(final int param) { - - // setting primitive attribute tracker to true - this.localHandlerCountTracker = param != java.lang.Integer.MIN_VALUE; - - this.localHandlerCount = param; - - - } - - - /** - * field for HandlerDesc - */ - - - protected org.apache.axis2.description.xsd.HandlerDescription localHandlerDesc; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHandlerDescTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.description.xsd.HandlerDescription - */ - public org.apache.axis2.description.xsd.HandlerDescription getHandlerDesc() { - return this.localHandlerDesc; - } - - - - /** - * Auto generated setter method - * - * @param param HandlerDesc - */ - public void setHandlerDesc(final org.apache.axis2.description.xsd.HandlerDescription param) { - this.localHandlerDescTracker = true; - - this.localHandlerDesc = param; - - - } - - - /** - * field for Handlers - */ - - - protected java.lang.Object localHandlers; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localHandlersTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getHandlers() { - return this.localHandlers; - } - - - - /** - * Auto generated setter method - * - * @param param Handlers - */ - public void setHandlers(final java.lang.Object param) { - this.localHandlersTracker = true; - - this.localHandlers = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for PhaseFirst - */ - - - protected org.apache.axis2.engine.xsd.Handler localPhaseFirst; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhaseFirstTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.Handler - */ - public org.apache.axis2.engine.xsd.Handler getPhaseFirst() { - return this.localPhaseFirst; - } - - - - /** - * Auto generated setter method - * - * @param param PhaseFirst - */ - public void setPhaseFirst(final org.apache.axis2.engine.xsd.Handler param) { - this.localPhaseFirstTracker = true; - - this.localPhaseFirst = param; - - - } - - - /** - * field for PhaseLast - */ - - - protected org.apache.axis2.engine.xsd.Handler localPhaseLast; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhaseLastTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.engine.xsd.Handler - */ - public org.apache.axis2.engine.xsd.Handler getPhaseLast() { - return this.localPhaseLast; - } - - - - /** - * Auto generated setter method - * - * @param param PhaseLast - */ - public void setPhaseLast(final org.apache.axis2.engine.xsd.Handler param) { - this.localPhaseLastTracker = true; - - this.localPhaseLast = param; - - - } - - - /** - * field for PhaseName - */ - - - protected java.lang.String localPhaseName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPhaseNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPhaseName() { - return this.localPhaseName; - } - - - - /** - * Auto generated setter method - * - * @param param PhaseName - */ - public void setPhaseName(final java.lang.String param) { - this.localPhaseNameTracker = true; - - this.localPhaseName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://engine.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Phase", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Phase", xmlWriter); - } - - - } - if (this.localHandlerCountTracker) { - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "handlerCount", xmlWriter); - - if (this.localHandlerCount == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("handlerCount cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localHandlerCount)); - } - - xmlWriter.writeEndElement(); - } - if (this.localHandlerDescTracker) { - if (this.localHandlerDesc == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "handlerDesc", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localHandlerDesc.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "handlerDesc"), xmlWriter); - } - } - if (this.localHandlersTracker) { - - if (this.localHandlers != null) { - if (this.localHandlers instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localHandlers).serialize(new javax.xml.namespace.QName( - "http://engine.axis2.apache.org/xsd", "handlers"), xmlWriter, true); - } else { - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "handlers", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localHandlers, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "handlers", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localNameTracker) { - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPhaseFirstTracker) { - if (this.localPhaseFirst == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "phaseFirst", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localPhaseFirst.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "phaseFirst"), xmlWriter); - } - } - if (this.localPhaseLastTracker) { - if (this.localPhaseLast == null) { - - writeStartElement(null, "http://engine.axis2.apache.org/xsd", "phaseLast", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localPhaseLast.serialize(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "phaseLast"), xmlWriter); - } - } - if (this.localPhaseNameTracker) { - namespace = "http://engine.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "phaseName", xmlWriter); - - - if (this.localPhaseName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPhaseName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://engine.axis2.apache.org/xsd")) { - return "ns8"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localHandlerCountTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "handlerCount")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localHandlerCount)); - } - if (this.localHandlerDescTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "handlerDesc")); - - - elementList.add(this.localHandlerDesc == null ? null : this.localHandlerDesc); - } - if (this.localHandlersTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "handlers")); - - - elementList.add(this.localHandlers == null ? null : this.localHandlers); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localPhaseFirstTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "phaseFirst")); - - - elementList.add(this.localPhaseFirst == null ? null : this.localPhaseFirst); - } - if (this.localPhaseLastTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "phaseLast")); - - - elementList.add(this.localPhaseLast == null ? null : this.localPhaseLast); - } - if (this.localPhaseNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", "phaseName")); - - elementList.add(this.localPhaseName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPhaseName)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Phase parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Phase object = new Phase(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Phase".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Phase) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "handlerCount").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setHandlerCount(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setHandlerCount(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "handlerDesc").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setHandlerDesc(null); - reader.next(); - - reader.next(); - - } else { - - object.setHandlerDesc(org.apache.axis2.description.xsd.HandlerDescription.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://engine.axis2.apache.org/xsd", - "handlers").equals(reader.getName())) { - - object.setHandlers(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://engine.axis2.apache.org/xsd", - "phaseFirst").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setPhaseFirst(null); - reader.next(); - - reader.next(); - - } else { - - object.setPhaseFirst(org.apache.axis2.engine.xsd.Handler.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://engine.axis2.apache.org/xsd", - "phaseLast").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setPhaseLast(null); - reader.next(); - - reader.next(); - - } else { - - object.setPhaseLast(org.apache.axis2.engine.xsd.Handler.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://engine.axis2.apache.org/xsd", - "phaseName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPhaseName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ServiceLifeCycle.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ServiceLifeCycle.java deleted file mode 100644 index c9b0d8ac2..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/engine/xsd/ServiceLifeCycle.java +++ /dev/null @@ -1,379 +0,0 @@ - -/** - * ServiceLifeCycle.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.engine.xsd; - - -/** - * ServiceLifeCycle bean class - */ - -public abstract class ServiceLifeCycle implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ServiceLifeCycle Namespace URI = - * http://engine.axis2.apache.org/xsd Namespace Prefix = ns8 - */ - - - - /** - * - */ - private static final long serialVersionUID = -6963737108359013970L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://engine.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ServiceLifeCycle", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ServiceLifeCycle", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://engine.axis2.apache.org/xsd")) { - return "ns8"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 ServiceLifeCycle parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ServiceLifeCycle object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ServiceLifeCycle".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ServiceLifeCycle) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/transaction/xsd/ExtensionMapper.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/transaction/xsd/ExtensionMapper.java deleted file mode 100644 index 0f6be9b93..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/transaction/xsd/ExtensionMapper.java +++ /dev/null @@ -1,692 +0,0 @@ - -/** - * ExtensionMapper.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.transaction.xsd; - -/** - * ExtensionMapper class - */ - -public class ExtensionMapper { - - public static java.lang.Object getTypeObject(final java.lang.String namespaceURI, final java.lang.String typeName, - final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - - - if ("http://context.axis2.apache.org/xsd".equals(namespaceURI) && "ServiceContext".equals(typeName)) { - - return org.apache.axis2.context.xsd.ServiceContext.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPFaultCode".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPFaultCode.Factory.parse(reader); - - - } - - - if ("http://io.java/xsd".equals(namespaceURI) && "InputStream".equals(typeName)) { - - return authclient.java.io.xsd.InputStream.Factory.parse(reader); - - - } - - - if ("http://engine.axis2.apache.org/xsd".equals(namespaceURI) && "Handler".equals(typeName)) { - - return org.apache.axis2.engine.xsd.Handler.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "XmlSchemaElement".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaElement.Factory.parse(reader); - - - } - - - if ("http://dom.w3c.org/xsd".equals(namespaceURI) && "Element".equals(typeName)) { - - return org.w3c.dom.xsd.Element.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) && "ParameterInclude".equals(typeName)) { - - return org.apache.axis2.description.xsd.ParameterInclude.Factory.parse(reader); - - - } - - - if ("http://clustering.axis2.apache.org/xsd".equals(namespaceURI) && "ClusteringAgent".equals(typeName)) { - - return org.apache.axis2.clustering.xsd.ClusteringAgent.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPFaultText".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPFaultText.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "XmlSchemaDatatype".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaDatatype.Factory.parse(reader); - - - } - - - if ("http://lifecycle.attachments.axiom.apache.org/xsd".equals(namespaceURI) - && "LifecycleManager".equals(typeName)) { - - return org.apache.axiom.attachments.lifecycle.xsd.LifecycleManager.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) && "HandlerDescription".equals(typeName)) { - - return org.apache.axis2.description.xsd.HandlerDescription.Factory.parse(reader); - - - } - - - if ("http://addressing.axis2.apache.org/xsd".equals(namespaceURI) && "EndpointReference".equals(typeName)) { - - return org.apache.axis2.addressing.xsd.EndpointReference.Factory.parse(reader); - - - } - - - if ("http://net.java/xsd".equals(namespaceURI) && "URL".equals(typeName)) { - - return authclient.java.net.xsd.URL.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "XmlSchemaAnnotated".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaAnnotated.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "XmlSchemaForm".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaForm.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPFaultDetail".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPFaultDetail.Factory.parse(reader); - - - } - - - if ("http://securevault.wso2.org/xsd".equals(namespaceURI) && "SecretResolver".equals(typeName)) { - - return org.wso2.securevault.xsd.SecretResolver.Factory.parse(reader); - - - } - - - if ("http://attachments.axiom.apache.org/xsd".equals(namespaceURI) - && "IncomingAttachmentInputStream".equals(typeName)) { - - return org.apache.axiom.attachments.xsd.IncomingAttachmentInputStream.Factory.parse(reader); - - - } - - - if ("http://context.axis2.apache.org/xsd".equals(namespaceURI) && "MessageContext".equals(typeName)) { - - return org.apache.axis2.context.xsd.MessageContext.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPFaultRole".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPFaultRole.Factory.parse(reader); - - - } - - - if ("http://context.axis2.apache.org/xsd".equals(namespaceURI) && "SessionContext".equals(typeName)) { - - return org.apache.axis2.context.xsd.SessionContext.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "XmlSchemaAnnotation".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation.Factory.parse(reader); - - - } - - - if ("http://context.axis2.apache.org/xsd".equals(namespaceURI) && "ConfigurationContext".equals(typeName)) { - - return org.apache.axis2.context.xsd.ConfigurationContext.Factory.parse(reader); - - - } - - - if ("http://threadpool.util.axis2.apache.org/xsd".equals(namespaceURI) && "ThreadFactory".equals(typeName)) { - - return org.apache.axis2.util.threadpool.xsd.ThreadFactory.Factory.parse(reader); - - - } - - - if ("http://engine.axis2.apache.org/xsd".equals(namespaceURI) && "ListenerManager".equals(typeName)) { - - return org.apache.axis2.engine.xsd.ListenerManager.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) - && "XmlSchemaObjectCollection".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "XmlSchemaType".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaType.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPFault".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPFault.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPHeader".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPHeader.Factory.parse(reader); - - - } - - - if ("http://engine.axis2.apache.org/xsd".equals(namespaceURI) && "ServiceLifeCycle".equals(typeName)) { - - return org.apache.axis2.engine.xsd.ServiceLifeCycle.Factory.parse(reader); - - - } - - - if ("http://context.axis2.apache.org/xsd".equals(namespaceURI) && "OperationContext".equals(typeName)) { - - return org.apache.axis2.context.xsd.OperationContext.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPFaultReason".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPFaultReason.Factory.parse(reader); - - - } - - - if ("http://util.java/xsd".equals(namespaceURI) && "LinkedHashMap".equals(typeName)) { - - return authclient.java.util.xsd.LinkedHashMap.Factory.parse(reader); - - - } - - - if ("http://client.axis2.apache.org/xsd".equals(namespaceURI) && "Options".equals(typeName)) { - - return org.apache.axis2.client.xsd.Options.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) && "PhaseRule".equals(typeName)) { - - return org.apache.axis2.description.xsd.PhaseRule.Factory.parse(reader); - - - } - - - if ("http://util.axis2.apache.org/xsd".equals(namespaceURI) && "TargetResolver".equals(typeName)) { - - return org.apache.axis2.util.xsd.TargetResolver.Factory.parse(reader); - - - } - - - if ("http://engine.axis2.apache.org/xsd".equals(namespaceURI) && "AxisConfigurator".equals(typeName)) { - - return org.apache.axis2.engine.xsd.AxisConfigurator.Factory.parse(reader); - - - } - - - if ("http://attachments.axiom.apache.org/xsd".equals(namespaceURI) - && "IncomingAttachmentStreams".equals(typeName)) { - - return org.apache.axiom.attachments.xsd.IncomingAttachmentStreams.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) && "AxisService".equals(typeName)) { - - return org.apache.axis2.description.xsd.AxisService.Factory.parse(reader); - - - } - - - if ("http://neethi.apache.org/xsd".equals(namespaceURI) && "AbstractPolicyOperator".equals(typeName)) { - - return org.apache.neethi.xsd.AbstractPolicyOperator.Factory.parse(reader); - - - } - - - if ("http://util.java/xsd".equals(namespaceURI) && "Map".equals(typeName)) { - - return authclient.java.util.xsd.Map.Factory.parse(reader); - - - } - - - if ("http://engine.axis2.apache.org/xsd".equals(namespaceURI) && "Phase".equals(typeName)) { - - return org.apache.axis2.engine.xsd.Phase.Factory.parse(reader); - - - } - - - if ("http://om.axiom.apache.org/xsd".equals(namespaceURI) && "OMNamespace".equals(typeName)) { - - return org.apache.axiom.om.xsd.OMNamespace.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) && "AxisServiceGroup".equals(typeName)) { - - return org.apache.axis2.description.xsd.AxisServiceGroup.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPEnvelope".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPEnvelope.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) && "AxisMessage".equals(typeName)) { - - return org.apache.axis2.description.xsd.AxisMessage.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) && "AxisOperation".equals(typeName)) { - - return org.apache.axis2.description.xsd.AxisOperation.Factory.parse(reader); - - - } - - - if ("http://transport.axis2.apache.org/xsd".equals(namespaceURI) && "TransportSender".equals(typeName)) { - - return org.apache.axis2.transport.xsd.TransportSender.Factory.parse(reader); - - - } - - - if ("http://transaction.axis2.apache.org/xsd".equals(namespaceURI) - && "TransactionConfiguration".equals(typeName)) { - - return org.apache.axis2.transaction.xsd.TransactionConfiguration.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) - && "TransportOutDescription".equals(typeName)) { - - return org.apache.axis2.description.xsd.TransportOutDescription.Factory.parse(reader); - - - } - - - if ("http://state.clustering.axis2.apache.org/xsd".equals(namespaceURI) && "StateManager".equals(typeName)) { - - return org.apache.axis2.clustering.state.xsd.StateManager.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) && "Flow".equals(typeName)) { - - return org.apache.axis2.description.xsd.Flow.Factory.parse(reader); - - - } - - - if ("http://constants.schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "Enum".equals(typeName)) { - - return org.apache.ws.commons.schema.constants.xsd.Enum.Factory.parse(reader); - - - } - - - if ("http://util.deployment.axis2.apache.org/xsd".equals(namespaceURI) && "ExcludeInfo".equals(typeName)) { - - return org.apache.axis2.deployment.util.xsd.ExcludeInfo.Factory.parse(reader); - - - } - - - if ("http://util.deployment.axis2.apache.org/xsd".equals(namespaceURI) && "PhasesInfo".equals(typeName)) { - - return org.apache.axis2.deployment.util.xsd.PhasesInfo.Factory.parse(reader); - - - } - - - if ("http://engine.axis2.apache.org/xsd".equals(namespaceURI) && "MessageReceiver".equals(typeName)) { - - return org.apache.axis2.engine.xsd.MessageReceiver.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPBody".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPBody.Factory.parse(reader); - - - } - - - if ("http://dom.w3c.org/xsd".equals(namespaceURI) && "TypeInfo".equals(typeName)) { - - return org.w3c.dom.xsd.TypeInfo.Factory.parse(reader); - - - } - - - if ("http://authentication.services.core.carbon.wso2.org/xsd".equals(namespaceURI) - && "RememberMeData".equals(typeName)) { - - return org.wso2.carbon.core.services.authentication.xsd.RememberMeData.Factory.parse(reader); - - - } - - - if ("http://neethi.apache.org/xsd".equals(namespaceURI) && "All".equals(typeName)) { - - return org.apache.neethi.xsd.All.Factory.parse(reader); - - - } - - - if ("http://context.axis2.apache.org/xsd".equals(namespaceURI) && "ServiceGroupContext".equals(typeName)) { - - return org.apache.axis2.context.xsd.ServiceGroupContext.Factory.parse(reader); - - - } - - - if ("http://neethi.apache.org/xsd".equals(namespaceURI) && "PolicyComponent".equals(typeName)) { - - return org.apache.neethi.xsd.PolicyComponent.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPVersion".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPVersion.Factory.parse(reader); - - - } - - - if ("http://neethi.apache.org/xsd".equals(namespaceURI) && "Policy".equals(typeName)) { - - return org.apache.neethi.xsd.Policy.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "XmlSchemaParticle".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaParticle.Factory.parse(reader); - - - } - - - if ("http://engine.axis2.apache.org/xsd".equals(namespaceURI) && "AxisConfiguration".equals(typeName)) { - - return org.apache.axis2.engine.xsd.AxisConfiguration.Factory.parse(reader); - - - } - - - if ("http://management.clustering.axis2.apache.org/xsd".equals(namespaceURI) - && "NodeManager".equals(typeName)) { - - return org.apache.axis2.clustering.management.xsd.NodeManager.Factory.parse(reader); - - - } - - - if ("http://dom.w3c.org/xsd".equals(namespaceURI) && "Attr".equals(typeName)) { - - return org.w3c.dom.xsd.Attr.Factory.parse(reader); - - - } - - - if ("http://addressing.axis2.apache.org/xsd".equals(namespaceURI) && "RelatesTo".equals(typeName)) { - - return org.apache.axis2.addressing.xsd.RelatesTo.Factory.parse(reader); - - - } - - - if ("http://java2wsdl.description.axis2.apache.org/xsd".equals(namespaceURI) && "TypeTable".equals(typeName)) { - - return org.apache.axis2.description.java2wsdl.xsd.TypeTable.Factory.parse(reader); - - - } - - - if ("http://util.java/xsd".equals(namespaceURI) && "Iterator".equals(typeName)) { - - return authclient.java.util.xsd.Iterator.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) - && "XmlSchemaDerivationMethod".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod.Factory.parse(reader); - - - } - - - if ("http://soap.axiom.apache.org/xsd".equals(namespaceURI) && "SOAPFaultNode".equals(typeName)) { - - return org.apache.axiom.soap.xsd.SOAPFaultNode.Factory.parse(reader); - - - } - - - if ("http://common.core.carbon.wso2.org/xsd".equals(namespaceURI) - && "AuthenticationException".equals(typeName)) { - - return org.wso2.carbon.core.common.xsd.AuthenticationException.Factory.parse(reader); - - - } - - - if ("http://util.java/xsd".equals(namespaceURI) && "LinkedList".equals(typeName)) { - - return authclient.java.util.xsd.LinkedList.Factory.parse(reader); - - - } - - - if ("http://util.java/xsd".equals(namespaceURI) && "Set".equals(typeName)) { - - return authclient.java.util.xsd.Set.Factory.parse(reader); - - - } - - - if ("http://schema.commons.ws.apache.org/xsd".equals(namespaceURI) && "XmlSchemaObject".equals(typeName)) { - - return org.apache.ws.commons.schema.xsd.XmlSchemaObject.Factory.parse(reader); - - - } - - - if ("http://engine.axis2.apache.org/xsd".equals(namespaceURI) && "ObjectSupplier".equals(typeName)) { - - return org.apache.axis2.engine.xsd.ObjectSupplier.Factory.parse(reader); - - - } - - - if ("http://attachments.axiom.apache.org/xsd".equals(namespaceURI) && "Attachments".equals(typeName)) { - - return org.apache.axiom.attachments.xsd.Attachments.Factory.parse(reader); - - - } - - - if ("http://description.axis2.apache.org/xsd".equals(namespaceURI) - && "TransportInDescription".equals(typeName)) { - - return org.apache.axis2.description.xsd.TransportInDescription.Factory.parse(reader); - - - } - - - if ("http://transport.axis2.apache.org/xsd".equals(namespaceURI) && "TransportListener".equals(typeName)) { - - return org.apache.axis2.transport.xsd.TransportListener.Factory.parse(reader); - - - } - - - throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); - } - -} diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/transaction/xsd/TransactionConfiguration.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/transaction/xsd/TransactionConfiguration.java deleted file mode 100644 index 99ada9d16..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/transaction/xsd/TransactionConfiguration.java +++ /dev/null @@ -1,636 +0,0 @@ - -/** - * TransactionConfiguration.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.transaction.xsd; - - -/** - * TransactionConfiguration bean class - */ - -public class TransactionConfiguration implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = TransactionConfiguration - * Namespace URI = http://transaction.axis2.apache.org/xsd Namespace Prefix = ns18 - */ - - - /** - * - */ - private static final long serialVersionUID = 7993027399563702703L; - - /** - * field for TransactionManager - */ - - - protected java.lang.Object localTransactionManager; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransactionManagerTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getTransactionManager() { - return this.localTransactionManager; - } - - - - /** - * Auto generated setter method - * - * @param param TransactionManager - */ - public void setTransactionManager(final java.lang.Object param) { - this.localTransactionManagerTracker = true; - - this.localTransactionManager = param; - - - } - - - /** - * field for TransactionTimeout - */ - - - protected int localTransactionTimeout; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTransactionTimeoutTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getTransactionTimeout() { - return this.localTransactionTimeout; - } - - - - /** - * Auto generated setter method - * - * @param param TransactionTimeout - */ - public void setTransactionTimeout(final int param) { - - // setting primitive attribute tracker to true - this.localTransactionTimeoutTracker = param != java.lang.Integer.MIN_VALUE; - - this.localTransactionTimeout = param; - - - } - - - /** - * field for UserTransaction - */ - - - protected java.lang.Object localUserTransaction; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUserTransactionTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getUserTransaction() { - return this.localUserTransaction; - } - - - - /** - * Auto generated setter method - * - * @param param UserTransaction - */ - public void setUserTransaction(final java.lang.Object param) { - this.localUserTransactionTracker = true; - - this.localUserTransaction = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://transaction.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":TransactionConfiguration", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "TransactionConfiguration", - xmlWriter); - } - - - } - if (this.localTransactionManagerTracker) { - - if (this.localTransactionManager != null) { - if (this.localTransactionManager instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localTransactionManager).serialize(new javax.xml.namespace.QName( - "http://transaction.axis2.apache.org/xsd", "transactionManager"), xmlWriter, true); - } else { - writeStartElement(null, "http://transaction.axis2.apache.org/xsd", "transactionManager", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localTransactionManager, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://transaction.axis2.apache.org/xsd", "transactionManager", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localTransactionTimeoutTracker) { - namespace = "http://transaction.axis2.apache.org/xsd"; - writeStartElement(null, namespace, "transactionTimeout", xmlWriter); - - if (this.localTransactionTimeout == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("transactionTimeout cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTransactionTimeout)); - } - - xmlWriter.writeEndElement(); - } - if (this.localUserTransactionTracker) { - - if (this.localUserTransaction != null) { - if (this.localUserTransaction instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localUserTransaction).serialize(new javax.xml.namespace.QName( - "http://transaction.axis2.apache.org/xsd", "userTransaction"), xmlWriter, true); - } else { - writeStartElement(null, "http://transaction.axis2.apache.org/xsd", "userTransaction", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localUserTransaction, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://transaction.axis2.apache.org/xsd", "userTransaction", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://transaction.axis2.apache.org/xsd")) { - return "ns18"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localTransactionManagerTracker) { - elementList.add(new javax.xml.namespace.QName("http://transaction.axis2.apache.org/xsd", - "transactionManager")); - - - elementList.add(this.localTransactionManager == null ? null : this.localTransactionManager); - } - if (this.localTransactionTimeoutTracker) { - elementList.add(new javax.xml.namespace.QName("http://transaction.axis2.apache.org/xsd", - "transactionTimeout")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTransactionTimeout)); - } - if (this.localUserTransactionTracker) { - elementList.add(new javax.xml.namespace.QName("http://transaction.axis2.apache.org/xsd", - "userTransaction")); - - - elementList.add(this.localUserTransaction == null ? null : this.localUserTransaction); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static TransactionConfiguration parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TransactionConfiguration object = new TransactionConfiguration(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"TransactionConfiguration".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TransactionConfiguration) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://transaction.axis2.apache.org/xsd", - "transactionManager").equals(reader.getName())) { - - object.setTransactionManager(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://transaction.axis2.apache.org/xsd", - "transactionTimeout").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setTransactionTimeout(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setTransactionTimeout(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://transaction.axis2.apache.org/xsd", - "userTransaction").equals(reader.getName())) { - - object.setUserTransaction(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/transport/xsd/TransportListener.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/transport/xsd/TransportListener.java deleted file mode 100644 index c0d1a0f6d..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/transport/xsd/TransportListener.java +++ /dev/null @@ -1,379 +0,0 @@ - -/** - * TransportListener.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.transport.xsd; - - -/** - * TransportListener bean class - */ - -public abstract class TransportListener implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = TransportListener Namespace URI - * = http://transport.axis2.apache.org/xsd Namespace Prefix = ns28 - */ - - - - /** - * - */ - private static final long serialVersionUID = -4731301193242985980L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://transport.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":TransportListener", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "TransportListener", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://transport.axis2.apache.org/xsd")) { - return "ns28"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 TransportListener parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TransportListener object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"TransportListener".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TransportListener) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/transport/xsd/TransportSender.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/transport/xsd/TransportSender.java deleted file mode 100644 index 2b7969c80..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/transport/xsd/TransportSender.java +++ /dev/null @@ -1,379 +0,0 @@ - -/** - * TransportSender.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.transport.xsd; - - -/** - * TransportSender bean class - */ - -public abstract class TransportSender implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = TransportSender Namespace URI = - * http://transport.axis2.apache.org/xsd Namespace Prefix = ns28 - */ - - - - /** - * - */ - private static final long serialVersionUID = -1202519452065596864L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://transport.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":TransportSender", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "TransportSender", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://transport.axis2.apache.org/xsd")) { - return "ns28"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 TransportSender parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TransportSender object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"TransportSender".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TransportSender) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/util/threadpool/xsd/ThreadFactory.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/util/threadpool/xsd/ThreadFactory.java deleted file mode 100644 index 71715c5e3..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/util/threadpool/xsd/ThreadFactory.java +++ /dev/null @@ -1,379 +0,0 @@ - -/** - * ThreadFactory.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.util.threadpool.xsd; - - -/** - * ThreadFactory bean class - */ - -public abstract class ThreadFactory implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ThreadFactory Namespace URI = - * http://threadpool.util.axis2.apache.org/xsd Namespace Prefix = ns9 - */ - - - - /** - * - */ - private static final long serialVersionUID = -4409945647067632365L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://threadpool.util.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ThreadFactory", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ThreadFactory", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://threadpool.util.axis2.apache.org/xsd")) { - return "ns9"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 ThreadFactory parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ThreadFactory object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ThreadFactory".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ThreadFactory) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/axis2/util/xsd/TargetResolver.java b/org.opentosca.container.connector.bps/src/org/apache/axis2/util/xsd/TargetResolver.java deleted file mode 100644 index 7a80a7bec..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/axis2/util/xsd/TargetResolver.java +++ /dev/null @@ -1,378 +0,0 @@ - -/** - * TargetResolver.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.axis2.util.xsd; - - -/** - * TargetResolver bean class - */ - -public abstract class TargetResolver implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = TargetResolver Namespace URI = - * http://util.axis2.apache.org/xsd Namespace Prefix = ns17 - */ - - - - /** - * - */ - private static final long serialVersionUID = -5677731285294016739L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://util.axis2.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":TargetResolver", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "TargetResolver", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://util.axis2.apache.org/xsd")) { - return "ns17"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 TargetResolver parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TargetResolver object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"TargetResolver".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TargetResolver) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/AbstractPolicyOperator.java b/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/AbstractPolicyOperator.java deleted file mode 100644 index 32820aff4..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/AbstractPolicyOperator.java +++ /dev/null @@ -1,629 +0,0 @@ - -/** - * AbstractPolicyOperator.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.neethi.xsd; - - -/** - * AbstractPolicyOperator bean class - */ - -public abstract class AbstractPolicyOperator implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = AbstractPolicyOperator Namespace - * URI = http://neethi.apache.org/xsd Namespace Prefix = ns21 - */ - - - /** - * - */ - private static final long serialVersionUID = 7461322057695546269L; - - /** - * field for Empty - */ - - - protected boolean localEmpty; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEmptyTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getEmpty() { - return this.localEmpty; - } - - - - /** - * Auto generated setter method - * - * @param param Empty - */ - public void setEmpty(final boolean param) { - - // setting primitive attribute tracker to true - this.localEmptyTracker = true; - - this.localEmpty = param; - - - } - - - /** - * field for FirstPolicyComponent - */ - - - protected org.apache.neethi.xsd.PolicyComponent localFirstPolicyComponent; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFirstPolicyComponentTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.neethi.xsd.PolicyComponent - */ - public org.apache.neethi.xsd.PolicyComponent getFirstPolicyComponent() { - return this.localFirstPolicyComponent; - } - - - - /** - * Auto generated setter method - * - * @param param FirstPolicyComponent - */ - public void setFirstPolicyComponent(final org.apache.neethi.xsd.PolicyComponent param) { - this.localFirstPolicyComponentTracker = true; - - this.localFirstPolicyComponent = param; - - - } - - - /** - * field for PolicyComponents - */ - - - protected java.lang.Object localPolicyComponents; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPolicyComponentsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getPolicyComponents() { - return this.localPolicyComponents; - } - - - - /** - * Auto generated setter method - * - * @param param PolicyComponents - */ - public void setPolicyComponents(final java.lang.Object param) { - this.localPolicyComponentsTracker = true; - - this.localPolicyComponents = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://neethi.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AbstractPolicyOperator", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AbstractPolicyOperator", - xmlWriter); - } - - - } - if (this.localEmptyTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "empty", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("empty cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - - xmlWriter.writeEndElement(); - } - if (this.localFirstPolicyComponentTracker) { - if (this.localFirstPolicyComponent == null) { - - writeStartElement(null, "http://neethi.apache.org/xsd", "firstPolicyComponent", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFirstPolicyComponent.serialize(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "firstPolicyComponent"), xmlWriter); - } - } - if (this.localPolicyComponentsTracker) { - - if (this.localPolicyComponents != null) { - if (this.localPolicyComponents instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localPolicyComponents).serialize(new javax.xml.namespace.QName( - "http://neethi.apache.org/xsd", "policyComponents"), xmlWriter, true); - } else { - writeStartElement(null, "http://neethi.apache.org/xsd", "policyComponents", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localPolicyComponents, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://neethi.apache.org/xsd", "policyComponents", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://neethi.apache.org/xsd")) { - return "ns21"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localEmptyTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "empty")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - if (this.localFirstPolicyComponentTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "firstPolicyComponent")); - - - elementList.add(this.localFirstPolicyComponent == null ? null : this.localFirstPolicyComponent); - } - if (this.localPolicyComponentsTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "policyComponents")); - - - elementList.add(this.localPolicyComponents == null ? null : this.localPolicyComponents); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AbstractPolicyOperator parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AbstractPolicyOperator object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AbstractPolicyOperator".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AbstractPolicyOperator) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "empty").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setEmpty(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://neethi.apache.org/xsd", - "firstPolicyComponent").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFirstPolicyComponent(null); - reader.next(); - - reader.next(); - - } else { - - object.setFirstPolicyComponent(org.apache.neethi.xsd.PolicyComponent.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://neethi.apache.org/xsd", - "policyComponents").equals(reader.getName())) { - - object.setPolicyComponents(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/All.java b/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/All.java deleted file mode 100644 index 9c8d5e5ee..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/All.java +++ /dev/null @@ -1,674 +0,0 @@ - -/** - * All.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.neethi.xsd; - - -/** - * All bean class - */ - -public class All extends org.apache.neethi.xsd.AbstractPolicyOperator implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = All Namespace URI = - * http://neethi.apache.org/xsd Namespace Prefix = ns21 - */ - - - /** - * - */ - private static final long serialVersionUID = -7964765836952933285L; - - /** - * field for Assertions - */ - - - protected java.lang.Object localAssertions; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAssertionsTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getAssertions() { - return this.localAssertions; - } - - - - /** - * Auto generated setter method - * - * @param param Assertions - */ - public void setAssertions(final java.lang.Object param) { - this.localAssertionsTracker = true; - - this.localAssertions = param; - - - } - - - /** - * field for Type - */ - - - protected short localType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return short - */ - public short getType() { - return this.localType; - } - - - - /** - * Auto generated setter method - * - * @param param Type - */ - public void setType(final short param) { - - // setting primitive attribute tracker to true - this.localTypeTracker = param != java.lang.Short.MIN_VALUE; - - this.localType = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://neethi.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":All", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "All", xmlWriter); - } - - if (this.localEmptyTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "empty", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("empty cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - - xmlWriter.writeEndElement(); - } - if (this.localFirstPolicyComponentTracker) { - if (this.localFirstPolicyComponent == null) { - - writeStartElement(null, "http://neethi.apache.org/xsd", "firstPolicyComponent", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFirstPolicyComponent.serialize(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "firstPolicyComponent"), xmlWriter); - } - } - if (this.localPolicyComponentsTracker) { - - if (this.localPolicyComponents != null) { - if (this.localPolicyComponents instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localPolicyComponents).serialize(new javax.xml.namespace.QName( - "http://neethi.apache.org/xsd", "policyComponents"), xmlWriter, true); - } else { - writeStartElement(null, "http://neethi.apache.org/xsd", "policyComponents", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localPolicyComponents, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://neethi.apache.org/xsd", "policyComponents", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localAssertionsTracker) { - - if (this.localAssertions != null) { - if (this.localAssertions instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localAssertions).serialize(new javax.xml.namespace.QName( - "http://neethi.apache.org/xsd", "assertions"), xmlWriter, true); - } else { - writeStartElement(null, "http://neethi.apache.org/xsd", "assertions", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localAssertions, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://neethi.apache.org/xsd", "assertions", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localTypeTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "type", xmlWriter); - - if (this.localType == java.lang.Short.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("type cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://neethi.apache.org/xsd")) { - return "ns21"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://neethi.apache.org/xsd", "All")); - if (this.localEmptyTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "empty")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - if (this.localFirstPolicyComponentTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "firstPolicyComponent")); - - - elementList.add(this.localFirstPolicyComponent == null ? null : this.localFirstPolicyComponent); - } - if (this.localPolicyComponentsTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "policyComponents")); - - - elementList.add(this.localPolicyComponents == null ? null : this.localPolicyComponents); - } - if (this.localAssertionsTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "assertions")); - - - elementList.add(this.localAssertions == null ? null : this.localAssertions); - } - if (this.localTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "type")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static All parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final All object = new All(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"All".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (All) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "empty").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setEmpty(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://neethi.apache.org/xsd", - "firstPolicyComponent").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFirstPolicyComponent(null); - reader.next(); - - reader.next(); - - } else { - - object.setFirstPolicyComponent(org.apache.neethi.xsd.PolicyComponent.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://neethi.apache.org/xsd", - "policyComponents").equals(reader.getName())) { - - object.setPolicyComponents(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "assertions").equals(reader.getName())) { - - object.setAssertions(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "type").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setType(org.apache.axis2.databinding.utils.ConverterUtil.convertToShort(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setType(java.lang.Short.MIN_VALUE); - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/Policy.java b/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/Policy.java deleted file mode 100644 index e6e83f203..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/Policy.java +++ /dev/null @@ -1,1034 +0,0 @@ - -/** - * Policy.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.neethi.xsd; - - -/** - * Policy bean class - */ - -public class Policy extends org.apache.neethi.xsd.All implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Policy Namespace URI = - * http://neethi.apache.org/xsd Namespace Prefix = ns21 - */ - - - /** - * - */ - private static final long serialVersionUID = 8575602364127850409L; - - /** - * field for Alternatives - */ - - - protected authclient.java.util.xsd.Iterator localAlternatives; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAlternativesTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getAlternatives() { - return this.localAlternatives; - } - - - - /** - * Auto generated setter method - * - * @param param Alternatives - */ - public void setAlternatives(final authclient.java.util.xsd.Iterator param) { - this.localAlternativesTracker = true; - - this.localAlternatives = param; - - - } - - - /** - * field for Attributes - */ - - - protected authclient.java.util.xsd.Map localAttributes; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAttributesTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getAttributes() { - return this.localAttributes; - } - - - - /** - * Auto generated setter method - * - * @param param Attributes - */ - public void setAttributes(final authclient.java.util.xsd.Map param) { - this.localAttributesTracker = true; - - this.localAttributes = param; - - - } - - - /** - * field for Id - */ - - - protected java.lang.String localId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIdTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getId() { - return this.localId; - } - - - - /** - * Auto generated setter method - * - * @param param Id - */ - public void setId(final java.lang.String param) { - this.localIdTracker = true; - - this.localId = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for Type - */ - - - protected short localType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return short - */ - @Override - public short getType() { - return this.localType; - } - - - - /** - * Auto generated setter method - * - * @param param Type - */ - @Override - public void setType(final short param) { - - // setting primitive attribute tracker to true - this.localTypeTracker = param != java.lang.Short.MIN_VALUE; - - this.localType = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://neethi.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Policy", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Policy", xmlWriter); - } - - if (this.localEmptyTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "empty", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("empty cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - - xmlWriter.writeEndElement(); - } - if (this.localFirstPolicyComponentTracker) { - if (this.localFirstPolicyComponent == null) { - - writeStartElement(null, "http://neethi.apache.org/xsd", "firstPolicyComponent", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFirstPolicyComponent.serialize(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "firstPolicyComponent"), xmlWriter); - } - } - if (this.localPolicyComponentsTracker) { - - if (this.localPolicyComponents != null) { - if (this.localPolicyComponents instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localPolicyComponents).serialize(new javax.xml.namespace.QName( - "http://neethi.apache.org/xsd", "policyComponents"), xmlWriter, true); - } else { - writeStartElement(null, "http://neethi.apache.org/xsd", "policyComponents", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localPolicyComponents, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://neethi.apache.org/xsd", "policyComponents", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localAssertionsTracker) { - - if (this.localAssertions != null) { - if (this.localAssertions instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localAssertions).serialize(new javax.xml.namespace.QName( - "http://neethi.apache.org/xsd", "assertions"), xmlWriter, true); - } else { - writeStartElement(null, "http://neethi.apache.org/xsd", "assertions", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localAssertions, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://neethi.apache.org/xsd", "assertions", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localTypeTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "type", xmlWriter); - - if (this.localType == java.lang.Short.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("type cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } - - xmlWriter.writeEndElement(); - } - if (this.localAlternativesTracker) { - if (this.localAlternatives == null) { - - writeStartElement(null, "http://neethi.apache.org/xsd", "alternatives", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAlternatives.serialize(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "alternatives"), xmlWriter); - } - } - if (this.localAttributesTracker) { - if (this.localAttributes == null) { - - writeStartElement(null, "http://neethi.apache.org/xsd", "attributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAttributes.serialize(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "attributes"), xmlWriter); - } - } - if (this.localIdTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "id", xmlWriter); - - - if (this.localId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localNameTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localTypeTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "type", xmlWriter); - - if (this.localType == java.lang.Short.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("type cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://neethi.apache.org/xsd")) { - return "ns21"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://neethi.apache.org/xsd", "Policy")); - if (this.localEmptyTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "empty")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localEmpty)); - } - if (this.localFirstPolicyComponentTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "firstPolicyComponent")); - - - elementList.add(this.localFirstPolicyComponent == null ? null : this.localFirstPolicyComponent); - } - if (this.localPolicyComponentsTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "policyComponents")); - - - elementList.add(this.localPolicyComponents == null ? null : this.localPolicyComponents); - } - if (this.localAssertionsTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "assertions")); - - - elementList.add(this.localAssertions == null ? null : this.localAssertions); - } - if (this.localTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "type")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } - if (this.localAlternativesTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "alternatives")); - - - elementList.add(this.localAlternatives == null ? null : this.localAlternatives); - } - if (this.localAttributesTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "attributes")); - - - elementList.add(this.localAttributes == null ? null : this.localAttributes); - } - if (this.localIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "id")); - - elementList.add(this.localId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localId)); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "type")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Policy parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Policy object = new Policy(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Policy".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Policy) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "empty").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setEmpty(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://neethi.apache.org/xsd", - "firstPolicyComponent").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFirstPolicyComponent(null); - reader.next(); - - reader.next(); - - } else { - - object.setFirstPolicyComponent(org.apache.neethi.xsd.PolicyComponent.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://neethi.apache.org/xsd", - "policyComponents").equals(reader.getName())) { - - object.setPolicyComponents(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "assertions").equals(reader.getName())) { - - object.setAssertions(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "type").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setType(org.apache.axis2.databinding.utils.ConverterUtil.convertToShort(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setType(java.lang.Short.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", - "alternatives").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAlternatives(null); - reader.next(); - - reader.next(); - - } else { - - object.setAlternatives(authclient.java.util.xsd.Iterator.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://neethi.apache.org/xsd", - "attributes").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAttributes(null); - reader.next(); - - reader.next(); - - } else { - - object.setAttributes(authclient.java.util.xsd.Map.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://neethi.apache.org/xsd", "id").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "type").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setType(org.apache.axis2.databinding.utils.ConverterUtil.convertToShort(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setType(java.lang.Short.MIN_VALUE); - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/PolicyComponent.java b/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/PolicyComponent.java deleted file mode 100644 index 3a1c9631b..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/neethi/xsd/PolicyComponent.java +++ /dev/null @@ -1,457 +0,0 @@ - -/** - * PolicyComponent.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.neethi.xsd; - - -/** - * PolicyComponent bean class - */ - -public abstract class PolicyComponent implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = PolicyComponent Namespace URI = - * http://neethi.apache.org/xsd Namespace Prefix = ns21 - */ - - - /** - * - */ - private static final long serialVersionUID = -5225929539690006594L; - - /** - * field for Type - */ - - - protected short localType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return short - */ - public short getType() { - return this.localType; - } - - - - /** - * Auto generated setter method - * - * @param param Type - */ - public void setType(final short param) { - - // setting primitive attribute tracker to true - this.localTypeTracker = param != java.lang.Short.MIN_VALUE; - - this.localType = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://neethi.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":PolicyComponent", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PolicyComponent", - xmlWriter); - } - - - } - if (this.localTypeTracker) { - namespace = "http://neethi.apache.org/xsd"; - writeStartElement(null, namespace, "type", xmlWriter); - - if (this.localType == java.lang.Short.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("type cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://neethi.apache.org/xsd")) { - return "ns21"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "type")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static PolicyComponent parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final PolicyComponent object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"PolicyComponent".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PolicyComponent) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://neethi.apache.org/xsd", "type").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setType(org.apache.axis2.databinding.utils.ConverterUtil.convertToShort(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setType(java.lang.Short.MIN_VALUE); - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/constants/xsd/Enum.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/constants/xsd/Enum.java deleted file mode 100644 index ebc97323a..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/constants/xsd/Enum.java +++ /dev/null @@ -1,469 +0,0 @@ - -/** - * Enum.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.constants.xsd; - - -/** - * Enum bean class - */ - -public abstract class Enum implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Enum Namespace URI = - * http://constants.schema.commons.ws.apache.org/xsd Namespace Prefix = ns24 - */ - - - /** - * - */ - private static final long serialVersionUID = -4673771029243810363L; - - /** - * field for Value - */ - - - protected java.lang.String localValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localValueTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getValue() { - return this.localValue; - } - - - - /** - * Auto generated setter method - * - * @param param Value - */ - public void setValue(final java.lang.String param) { - this.localValueTracker = true; - - this.localValue = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://constants.schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Enum", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Enum", xmlWriter); - } - - - } - if (this.localValueTracker) { - namespace = "http://constants.schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "value", xmlWriter); - - - if (this.localValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localValue); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://constants.schema.commons.ws.apache.org/xsd")) { - return "ns24"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://constants.schema.commons.ws.apache.org/xsd", - "value")); - - elementList.add(this.localValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localValue)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Enum parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Enum object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Enum".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Enum) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://constants.schema.commons.ws.apache.org/xsd", - "value").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaAnnotated.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaAnnotated.java deleted file mode 100644 index cca3a5d0d..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaAnnotated.java +++ /dev/null @@ -1,923 +0,0 @@ - -/** - * XmlSchemaAnnotated.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - -import org.w3c.dom.xsd.Attr; - -/** - * XmlSchemaAnnotated bean class - */ - -public class XmlSchemaAnnotated extends org.apache.ws.commons.schema.xsd.XmlSchemaObject - implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaAnnotated Namespace URI - * = http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = 1649979508155391949L; - - /** - * field for Annotation - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation localAnnotation; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAnnotationTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation getAnnotation() { - return this.localAnnotation; - } - - - - /** - * Auto generated setter method - * - * @param param Annotation - */ - public void setAnnotation(final org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation param) { - this.localAnnotationTracker = true; - - this.localAnnotation = param; - - - } - - - /** - * field for Id - */ - - - protected java.lang.String localId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIdTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getId() { - return this.localId; - } - - - - /** - * Auto generated setter method - * - * @param param Id - */ - public void setId(final java.lang.String param) { - this.localIdTracker = true; - - this.localId = param; - - - } - - - /** - * field for UnhandledAttributes This was an Array! - */ - - - protected org.w3c.dom.xsd.Attr[] localUnhandledAttributes; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUnhandledAttributesTracker = false; - - - /** - * Auto generated getter method - * - * @return org.w3c.dom.xsd.Attr[] - */ - public org.w3c.dom.xsd.Attr[] getUnhandledAttributes() { - return this.localUnhandledAttributes; - } - - - - /** - * validate the array for UnhandledAttributes - */ - protected void validateUnhandledAttributes(final org.w3c.dom.xsd.Attr[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param UnhandledAttributes - */ - public void setUnhandledAttributes(final org.w3c.dom.xsd.Attr[] param) { - - validateUnhandledAttributes(param); - - this.localUnhandledAttributesTracker = true; - - this.localUnhandledAttributes = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.w3c.dom.xsd.Attr - */ - public void addUnhandledAttributes(final org.w3c.dom.xsd.Attr param) { - if (this.localUnhandledAttributes == null) { - this.localUnhandledAttributes = new org.w3c.dom.xsd.Attr[] {}; - } - - - // update the setting tracker - this.localUnhandledAttributesTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localUnhandledAttributes); - list.add(param); - this.localUnhandledAttributes = (org.w3c.dom.xsd.Attr[]) list.toArray(new org.w3c.dom.xsd.Attr[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaAnnotated", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaAnnotated", xmlWriter); - } - - if (this.localLineNumberTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "lineNumber", xmlWriter); - - if (this.localLineNumber == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lineNumber cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - - xmlWriter.writeEndElement(); - } - if (this.localLinePositionTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "linePosition", xmlWriter); - - if (this.localLinePosition == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("linePosition cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMetaInfoMapTracker) { - if (this.localMetaInfoMap == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "metaInfoMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMetaInfoMap.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap"), xmlWriter); - } - } - if (this.localSourceURITracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "sourceURI", xmlWriter); - - - if (this.localSourceURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSourceURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localAnnotationTracker) { - if (this.localAnnotation == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "annotation", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAnnotation.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "annotation"), xmlWriter); - } - } - if (this.localIdTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "id", xmlWriter); - - - if (this.localId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localUnhandledAttributesTracker) { - if (this.localUnhandledAttributes != null) { - for (final Attr localUnhandledAttribute : this.localUnhandledAttributes) { - if (localUnhandledAttribute != null) { - localUnhandledAttribute.serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes"), xmlWriter); - } else { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://schema.commons.ws.apache.org/xsd", "XmlSchemaAnnotated")); - if (this.localLineNumberTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "lineNumber")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - if (this.localLinePositionTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "linePosition")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - if (this.localMetaInfoMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "metaInfoMap")); - - - elementList.add(this.localMetaInfoMap == null ? null : this.localMetaInfoMap); - } - if (this.localSourceURITracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "sourceURI")); - - elementList.add(this.localSourceURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSourceURI)); - } - if (this.localAnnotationTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "annotation")); - - - elementList.add(this.localAnnotation == null ? null : this.localAnnotation); - } - if (this.localIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "id")); - - elementList.add(this.localId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localId)); - } - if (this.localUnhandledAttributesTracker) { - if (this.localUnhandledAttributes != null) { - for (final Attr localUnhandledAttribute : this.localUnhandledAttributes) { - - if (localUnhandledAttribute != null) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(localUnhandledAttribute); - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(this.localUnhandledAttributes); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaAnnotated parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaAnnotated object = new XmlSchemaAnnotated(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaAnnotated".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaAnnotated) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list7 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "lineNumber").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLineNumber(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLineNumber(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "linePosition").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLinePosition(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLinePosition(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMetaInfoMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setMetaInfoMap(authclient.java.util.xsd.Map.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://schema.commons.ws.apache.org/xsd", - "sourceURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSourceURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "annotation").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAnnotation(null); - reader.next(); - - reader.next(); - - } else { - - object.setAnnotation(org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation.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://schema.commons.ws.apache.org/xsd", - "id").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - reader.next(); - } else { - list7.add(org.w3c.dom.xsd.Attr.Factory.parse(reader)); - } - // loop until we find a start element that is not part of this array - boolean loopDone7 = false; - while (!loopDone7) { - // 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 - loopDone7 = true; - } else { - if (new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - reader.next(); - } else { - list7.add(org.w3c.dom.xsd.Attr.Factory.parse(reader)); - } - } else { - loopDone7 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setUnhandledAttributes((org.w3c.dom.xsd.Attr[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.w3c.dom.xsd.Attr.class, - list7)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaAnnotation.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaAnnotation.java deleted file mode 100644 index 783c55d7b..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaAnnotation.java +++ /dev/null @@ -1,639 +0,0 @@ - -/** - * XmlSchemaAnnotation.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - - -/** - * XmlSchemaAnnotation bean class - */ - -public class XmlSchemaAnnotation extends org.apache.ws.commons.schema.xsd.XmlSchemaObject - implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaAnnotation Namespace - * URI = http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = -5211386334370859883L; - - /** - * field for Items - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection localItems; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localItemsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection getItems() { - return this.localItems; - } - - - - /** - * Auto generated setter method - * - * @param param Items - */ - public void setItems(final org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection param) { - this.localItemsTracker = true; - - this.localItems = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaAnnotation", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaAnnotation", - xmlWriter); - } - - if (this.localLineNumberTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "lineNumber", xmlWriter); - - if (this.localLineNumber == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lineNumber cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - - xmlWriter.writeEndElement(); - } - if (this.localLinePositionTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "linePosition", xmlWriter); - - if (this.localLinePosition == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("linePosition cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMetaInfoMapTracker) { - if (this.localMetaInfoMap == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "metaInfoMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMetaInfoMap.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap"), xmlWriter); - } - } - if (this.localSourceURITracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "sourceURI", xmlWriter); - - - if (this.localSourceURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSourceURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localItemsTracker) { - if (this.localItems == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "items", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localItems.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "items"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://schema.commons.ws.apache.org/xsd", "XmlSchemaAnnotation")); - if (this.localLineNumberTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "lineNumber")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - if (this.localLinePositionTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "linePosition")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - if (this.localMetaInfoMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "metaInfoMap")); - - - elementList.add(this.localMetaInfoMap == null ? null : this.localMetaInfoMap); - } - if (this.localSourceURITracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "sourceURI")); - - elementList.add(this.localSourceURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSourceURI)); - } - if (this.localItemsTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "items")); - - - elementList.add(this.localItems == null ? null : this.localItems); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaAnnotation parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaAnnotation object = new XmlSchemaAnnotation(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaAnnotation".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaAnnotation) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "lineNumber").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLineNumber(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLineNumber(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "linePosition").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLinePosition(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLinePosition(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMetaInfoMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setMetaInfoMap(authclient.java.util.xsd.Map.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://schema.commons.ws.apache.org/xsd", - "sourceURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSourceURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "items").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setItems(null); - reader.next(); - - reader.next(); - - } else { - - object.setItems(org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaDatatype.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaDatatype.java deleted file mode 100644 index 7ce4aab16..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaDatatype.java +++ /dev/null @@ -1,380 +0,0 @@ - -/** - * XmlSchemaDatatype.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - - -/** - * XmlSchemaDatatype bean class - */ - -public abstract class XmlSchemaDatatype implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaDatatype Namespace URI - * = http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - - /** - * - */ - private static final long serialVersionUID = -979014177303868931L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaDatatype", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaDatatype", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 XmlSchemaDatatype parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaDatatype object = null; - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaDatatype".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaDatatype) org.apache.axis2.transaction.xsd.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. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaDerivationMethod.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaDerivationMethod.java deleted file mode 100644 index 464502b7c..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaDerivationMethod.java +++ /dev/null @@ -1,630 +0,0 @@ - -/** - * XmlSchemaDerivationMethod.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - - -/** - * XmlSchemaDerivationMethod bean class - */ - -public class XmlSchemaDerivationMethod extends org.apache.ws.commons.schema.constants.xsd.Enum - implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaDerivationMethod - * Namespace URI = http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = -2435996696541262845L; - - /** - * field for Values This was an Array! - */ - - - protected java.lang.String[] localValues; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localValuesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getValues() { - return this.localValues; - } - - - - /** - * validate the array for Values - */ - protected void validateValues(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Values - */ - public void setValues(final java.lang.String[] param) { - - validateValues(param); - - this.localValuesTracker = true; - - this.localValues = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addValues(final java.lang.String param) { - if (this.localValues == null) { - this.localValues = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localValuesTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localValues); - list.add(param); - this.localValues = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaDerivationMethod", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaDerivationMethod", - xmlWriter); - } - - if (this.localValueTracker) { - namespace = "http://constants.schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "value", xmlWriter); - - - if (this.localValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localValue); - - } - - xmlWriter.writeEndElement(); - } - if (this.localValuesTracker) { - if (this.localValues != null) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - for (final String localValue2 : this.localValues) { - - if (localValue2 != null) { - - writeStartElement(null, namespace, "values", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue2)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "values", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "values", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://schema.commons.ws.apache.org/xsd", - "XmlSchemaDerivationMethod")); - if (this.localValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://constants.schema.commons.ws.apache.org/xsd", - "value")); - - elementList.add(this.localValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localValue)); - } - if (this.localValuesTracker) { - if (this.localValues != null) { - for (final String localValue2 : this.localValues) { - - if (localValue2 != null) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "values")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue2)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "values")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "values")); - elementList.add(null); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaDerivationMethod parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaDerivationMethod object = new XmlSchemaDerivationMethod(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaDerivationMethod".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaDerivationMethod) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list2 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://constants.schema.commons.ws.apache.org/xsd", - "value").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "values").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list2.add(null); - - reader.next(); - } else { - 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://schema.commons.ws.apache.org/xsd", - "values").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list2.add(null); - - reader.next(); - } else { - list2.add(reader.getElementText()); - } - } else { - loopDone2 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setValues((java.lang.String[]) list2.toArray(new java.lang.String[list2.size()])); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaElement.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaElement.java deleted file mode 100644 index 5deb152b1..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaElement.java +++ /dev/null @@ -1,2332 +0,0 @@ - -/** - * XmlSchemaElement.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - -import org.w3c.dom.xsd.Attr; - -/** - * XmlSchemaElement bean class - */ - -public class XmlSchemaElement extends org.apache.ws.commons.schema.xsd.XmlSchemaParticle - implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaElement Namespace URI = - * http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = -5251329982547667556L; - - /** - * field for QName - */ - - - protected java.lang.Object localQName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localQNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getQName() { - return this.localQName; - } - - - - /** - * Auto generated setter method - * - * @param param QName - */ - public void setQName(final java.lang.Object param) { - this.localQNameTracker = true; - - this.localQName = param; - - - } - - - /** - * field for _abstract - */ - - - protected boolean local_abstract; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_abstractTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean get_abstract() { - return this.local_abstract; - } - - - - /** - * Auto generated setter method - * - * @param param _abstract - */ - public void set_abstract(final boolean param) { - - // setting primitive attribute tracker to true - this.local_abstractTracker = true; - - this.local_abstract = param; - - - } - - - /** - * field for Block - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod localBlock; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localBlockTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod getBlock() { - return this.localBlock; - } - - - - /** - * Auto generated setter method - * - * @param param Block - */ - public void setBlock(final org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod param) { - this.localBlockTracker = true; - - this.localBlock = param; - - - } - - - /** - * field for BlockResolved - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod localBlockResolved; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localBlockResolvedTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod getBlockResolved() { - return this.localBlockResolved; - } - - - - /** - * Auto generated setter method - * - * @param param BlockResolved - */ - public void setBlockResolved(final org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod param) { - this.localBlockResolvedTracker = true; - - this.localBlockResolved = param; - - - } - - - /** - * field for Constraints - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection localConstraints; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localConstraintsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection getConstraints() { - return this.localConstraints; - } - - - - /** - * Auto generated setter method - * - * @param param Constraints - */ - public void setConstraints(final org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection param) { - this.localConstraintsTracker = true; - - this.localConstraints = param; - - - } - - - /** - * field for DefaultValue - */ - - - protected java.lang.String localDefaultValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDefaultValueTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getDefaultValue() { - return this.localDefaultValue; - } - - - - /** - * Auto generated setter method - * - * @param param DefaultValue - */ - public void setDefaultValue(final java.lang.String param) { - this.localDefaultValueTracker = true; - - this.localDefaultValue = param; - - - } - - - /** - * field for ElementType - */ - - - protected java.lang.Object localElementType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localElementTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getElementType() { - return this.localElementType; - } - - - - /** - * Auto generated setter method - * - * @param param ElementType - */ - public void setElementType(final java.lang.Object param) { - this.localElementTypeTracker = true; - - this.localElementType = param; - - - } - - - /** - * field for _final - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod local_final; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_finalTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod get_final() { - return this.local_final; - } - - - - /** - * Auto generated setter method - * - * @param param _final - */ - public void set_final(final org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod param) { - this.local_finalTracker = true; - - this.local_final = param; - - - } - - - /** - * field for FixedValue - */ - - - protected java.lang.String localFixedValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFixedValueTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFixedValue() { - return this.localFixedValue; - } - - - - /** - * Auto generated setter method - * - * @param param FixedValue - */ - public void setFixedValue(final java.lang.String param) { - this.localFixedValueTracker = true; - - this.localFixedValue = param; - - - } - - - /** - * field for Form - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaForm localForm; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFormTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaForm - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaForm getForm() { - return this.localForm; - } - - - - /** - * Auto generated setter method - * - * @param param Form - */ - public void setForm(final org.apache.ws.commons.schema.xsd.XmlSchemaForm param) { - this.localFormTracker = true; - - this.localForm = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for Nillable - */ - - - protected boolean localNillable; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNillableTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getNillable() { - return this.localNillable; - } - - - - /** - * Auto generated setter method - * - * @param param Nillable - */ - public void setNillable(final boolean param) { - - // setting primitive attribute tracker to true - this.localNillableTracker = true; - - this.localNillable = param; - - - } - - - /** - * field for RefName - */ - - - protected java.lang.Object localRefName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRefNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getRefName() { - return this.localRefName; - } - - - - /** - * Auto generated setter method - * - * @param param RefName - */ - public void setRefName(final java.lang.Object param) { - this.localRefNameTracker = true; - - this.localRefName = param; - - - } - - - /** - * field for SchemaType - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaType localSchemaType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaType - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaType getSchemaType() { - return this.localSchemaType; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaType - */ - public void setSchemaType(final org.apache.ws.commons.schema.xsd.XmlSchemaType param) { - this.localSchemaTypeTracker = true; - - this.localSchemaType = param; - - - } - - - /** - * field for SchemaTypeName - */ - - - protected java.lang.Object localSchemaTypeName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaTypeNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getSchemaTypeName() { - return this.localSchemaTypeName; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaTypeName - */ - public void setSchemaTypeName(final java.lang.Object param) { - this.localSchemaTypeNameTracker = true; - - this.localSchemaTypeName = param; - - - } - - - /** - * field for SubstitutionGroup - */ - - - protected java.lang.Object localSubstitutionGroup; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSubstitutionGroupTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getSubstitutionGroup() { - return this.localSubstitutionGroup; - } - - - - /** - * Auto generated setter method - * - * @param param SubstitutionGroup - */ - public void setSubstitutionGroup(final java.lang.Object param) { - this.localSubstitutionGroupTracker = true; - - this.localSubstitutionGroup = param; - - - } - - - /** - * field for Type - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaType localType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaType - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaType getType() { - return this.localType; - } - - - - /** - * Auto generated setter method - * - * @param param Type - */ - public void setType(final org.apache.ws.commons.schema.xsd.XmlSchemaType param) { - this.localTypeTracker = true; - - this.localType = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaElement", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaElement", xmlWriter); - } - - if (this.localLineNumberTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "lineNumber", xmlWriter); - - if (this.localLineNumber == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lineNumber cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - - xmlWriter.writeEndElement(); - } - if (this.localLinePositionTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "linePosition", xmlWriter); - - if (this.localLinePosition == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("linePosition cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMetaInfoMapTracker) { - if (this.localMetaInfoMap == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "metaInfoMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMetaInfoMap.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap"), xmlWriter); - } - } - if (this.localSourceURITracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "sourceURI", xmlWriter); - - - if (this.localSourceURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSourceURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localAnnotationTracker) { - if (this.localAnnotation == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "annotation", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAnnotation.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "annotation"), xmlWriter); - } - } - if (this.localIdTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "id", xmlWriter); - - - if (this.localId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localUnhandledAttributesTracker) { - if (this.localUnhandledAttributes != null) { - for (final Attr localUnhandledAttribute : this.localUnhandledAttributes) { - if (localUnhandledAttribute != null) { - localUnhandledAttribute.serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes"), xmlWriter); - } else { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - if (this.localMaxOccursTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "maxOccurs", xmlWriter); - - if (this.localMaxOccurs == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("maxOccurs cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMaxOccurs)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMinOccursTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "minOccurs", xmlWriter); - - if (this.localMinOccurs == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("minOccurs cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMinOccurs)); - } - - xmlWriter.writeEndElement(); - } - if (this.localQNameTracker) { - - if (this.localQName != null) { - if (this.localQName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localQName).serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "QName"), xmlWriter, true); - } else { - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "QName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localQName, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "QName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.local_abstractTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "abstract", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("abstract cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_abstract)); - } - - xmlWriter.writeEndElement(); - } - if (this.localBlockTracker) { - if (this.localBlock == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "block", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localBlock.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "block"), xmlWriter); - } - } - if (this.localBlockResolvedTracker) { - if (this.localBlockResolved == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "blockResolved", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localBlockResolved.serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "blockResolved"), xmlWriter); - } - } - if (this.localConstraintsTracker) { - if (this.localConstraints == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "constraints", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localConstraints.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "constraints"), xmlWriter); - } - } - if (this.localDefaultValueTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "defaultValue", xmlWriter); - - - if (this.localDefaultValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localDefaultValue); - - } - - xmlWriter.writeEndElement(); - } - if (this.localElementTypeTracker) { - - if (this.localElementType != null) { - if (this.localElementType instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localElementType).serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "elementType"), xmlWriter, true); - } else { - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "elementType", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localElementType, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "elementType", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.local_finalTracker) { - if (this.local_final == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "final", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.local_final.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "final"), xmlWriter); - } - } - if (this.localFixedValueTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "fixedValue", xmlWriter); - - - if (this.localFixedValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localFixedValue); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFormTracker) { - if (this.localForm == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "form", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localForm.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "form"), xmlWriter); - } - } - if (this.localNameTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localNillableTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "nillable", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("nillable cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNillable)); - } - - xmlWriter.writeEndElement(); - } - if (this.localRefNameTracker) { - - if (this.localRefName != null) { - if (this.localRefName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localRefName).serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "refName"), xmlWriter, true); - } else { - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "refName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localRefName, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "refName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localSchemaTypeTracker) { - if (this.localSchemaType == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "schemaType", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSchemaType.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "schemaType"), xmlWriter); - } - } - if (this.localSchemaTypeNameTracker) { - - if (this.localSchemaTypeName != null) { - if (this.localSchemaTypeName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localSchemaTypeName).serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "schemaTypeName"), xmlWriter, true); - } else { - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "schemaTypeName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localSchemaTypeName, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "schemaTypeName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localSubstitutionGroupTracker) { - - if (this.localSubstitutionGroup != null) { - if (this.localSubstitutionGroup instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localSubstitutionGroup).serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "substitutionGroup"), xmlWriter, true); - } else { - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "substitutionGroup", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localSubstitutionGroup, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "substitutionGroup", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localTypeTracker) { - if (this.localType == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "type", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localType.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "type"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://schema.commons.ws.apache.org/xsd", "XmlSchemaElement")); - if (this.localLineNumberTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "lineNumber")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - if (this.localLinePositionTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "linePosition")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - if (this.localMetaInfoMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "metaInfoMap")); - - - elementList.add(this.localMetaInfoMap == null ? null : this.localMetaInfoMap); - } - if (this.localSourceURITracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "sourceURI")); - - elementList.add(this.localSourceURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSourceURI)); - } - if (this.localAnnotationTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "annotation")); - - - elementList.add(this.localAnnotation == null ? null : this.localAnnotation); - } - if (this.localIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "id")); - - elementList.add(this.localId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localId)); - } - if (this.localUnhandledAttributesTracker) { - if (this.localUnhandledAttributes != null) { - for (final Attr localUnhandledAttribute : this.localUnhandledAttributes) { - - if (localUnhandledAttribute != null) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(localUnhandledAttribute); - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(this.localUnhandledAttributes); - - } - - } - if (this.localMaxOccursTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "maxOccurs")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMaxOccurs)); - } - if (this.localMinOccursTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "minOccurs")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMinOccurs)); - } - if (this.localQNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "QName")); - - - elementList.add(this.localQName == null ? null : this.localQName); - } - if (this.local_abstractTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "abstract")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_abstract)); - } - if (this.localBlockTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "block")); - - - elementList.add(this.localBlock == null ? null : this.localBlock); - } - if (this.localBlockResolvedTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "blockResolved")); - - - elementList.add(this.localBlockResolved == null ? null : this.localBlockResolved); - } - if (this.localConstraintsTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "constraints")); - - - elementList.add(this.localConstraints == null ? null : this.localConstraints); - } - if (this.localDefaultValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "defaultValue")); - - elementList.add(this.localDefaultValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDefaultValue)); - } - if (this.localElementTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "elementType")); - - - elementList.add(this.localElementType == null ? null : this.localElementType); - } - if (this.local_finalTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "final")); - - - elementList.add(this.local_final == null ? null : this.local_final); - } - if (this.localFixedValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "fixedValue")); - - elementList.add(this.localFixedValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFixedValue)); - } - if (this.localFormTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "form")); - - - elementList.add(this.localForm == null ? null : this.localForm); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localNillableTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "nillable")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNillable)); - } - if (this.localRefNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "refName")); - - - elementList.add(this.localRefName == null ? null : this.localRefName); - } - if (this.localSchemaTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "schemaType")); - - - elementList.add(this.localSchemaType == null ? null : this.localSchemaType); - } - if (this.localSchemaTypeNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "schemaTypeName")); - - - elementList.add(this.localSchemaTypeName == null ? null : this.localSchemaTypeName); - } - if (this.localSubstitutionGroupTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "substitutionGroup")); - - - elementList.add(this.localSubstitutionGroup == null ? null : this.localSubstitutionGroup); - } - if (this.localTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "type")); - - - elementList.add(this.localType == null ? null : this.localType); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaElement parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaElement object = new XmlSchemaElement(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaElement".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaElement) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list7 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "lineNumber").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLineNumber(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLineNumber(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "linePosition").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLinePosition(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLinePosition(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMetaInfoMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setMetaInfoMap(authclient.java.util.xsd.Map.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://schema.commons.ws.apache.org/xsd", - "sourceURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSourceURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "annotation").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAnnotation(null); - reader.next(); - - reader.next(); - - } else { - - object.setAnnotation(org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation.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://schema.commons.ws.apache.org/xsd", - "id").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - reader.next(); - } else { - list7.add(org.w3c.dom.xsd.Attr.Factory.parse(reader)); - } - // loop until we find a start element that is not part of this array - boolean loopDone7 = false; - while (!loopDone7) { - // 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 - loopDone7 = true; - } else { - if (new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - reader.next(); - } else { - list7.add(org.w3c.dom.xsd.Attr.Factory.parse(reader)); - } - } else { - loopDone7 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setUnhandledAttributes((org.w3c.dom.xsd.Attr[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.w3c.dom.xsd.Attr.class, - list7)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "maxOccurs").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setMaxOccurs(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setMaxOccurs(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "minOccurs").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setMinOccurs(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setMinOccurs(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "QName").equals(reader.getName())) { - - object.setQName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "abstract").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_abstract(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://schema.commons.ws.apache.org/xsd", - "block").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setBlock(null); - reader.next(); - - reader.next(); - - } else { - - object.setBlock(org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod.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://schema.commons.ws.apache.org/xsd", - "blockResolved").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setBlockResolved(null); - reader.next(); - - reader.next(); - - } else { - - object.setBlockResolved(org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod.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://schema.commons.ws.apache.org/xsd", - "constraints").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setConstraints(null); - reader.next(); - - reader.next(); - - } else { - - object.setConstraints(org.apache.ws.commons.schema.xsd.XmlSchemaObjectCollection.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://schema.commons.ws.apache.org/xsd", - "defaultValue").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setDefaultValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "elementType").equals(reader.getName())) { - - object.setElementType(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "final").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.set_final(null); - reader.next(); - - reader.next(); - - } else { - - object.set_final(org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod.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://schema.commons.ws.apache.org/xsd", - "fixedValue").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setFixedValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "form").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setForm(null); - reader.next(); - - reader.next(); - - } else { - - object.setForm(org.apache.ws.commons.schema.xsd.XmlSchemaForm.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://schema.commons.ws.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "nillable").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setNillable(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://schema.commons.ws.apache.org/xsd", - "refName").equals(reader.getName())) { - - object.setRefName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "schemaType").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSchemaType(null); - reader.next(); - - reader.next(); - - } else { - - object.setSchemaType(org.apache.ws.commons.schema.xsd.XmlSchemaType.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://schema.commons.ws.apache.org/xsd", - "schemaTypeName").equals(reader.getName())) { - - object.setSchemaTypeName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "substitutionGroup").equals(reader.getName())) { - - object.setSubstitutionGroup(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "type").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setType(null); - reader.next(); - - reader.next(); - - } else { - - object.setType(org.apache.ws.commons.schema.xsd.XmlSchemaType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaForm.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaForm.java deleted file mode 100644 index d7d9f9592..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaForm.java +++ /dev/null @@ -1,628 +0,0 @@ - -/** - * XmlSchemaForm.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - - -/** - * XmlSchemaForm bean class - */ - -public class XmlSchemaForm extends org.apache.ws.commons.schema.constants.xsd.Enum - implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaForm Namespace URI = - * http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = 6894882670379389894L; - - /** - * field for Values This was an Array! - */ - - - protected java.lang.String[] localValues; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localValuesTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getValues() { - return this.localValues; - } - - - - /** - * validate the array for Values - */ - protected void validateValues(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Values - */ - public void setValues(final java.lang.String[] param) { - - validateValues(param); - - this.localValuesTracker = true; - - this.localValues = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addValues(final java.lang.String param) { - if (this.localValues == null) { - this.localValues = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localValuesTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localValues); - list.add(param); - this.localValues = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaForm", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaForm", xmlWriter); - } - - if (this.localValueTracker) { - namespace = "http://constants.schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "value", xmlWriter); - - - if (this.localValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localValue); - - } - - xmlWriter.writeEndElement(); - } - if (this.localValuesTracker) { - if (this.localValues != null) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - for (final String localValue2 : this.localValues) { - - if (localValue2 != null) { - - writeStartElement(null, namespace, "values", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue2)); - - xmlWriter.writeEndElement(); - - } else { - - // write null attribute - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "values", xmlWriter); - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - // write the null attribute - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "values", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://schema.commons.ws.apache.org/xsd", "XmlSchemaForm")); - if (this.localValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://constants.schema.commons.ws.apache.org/xsd", - "value")); - - elementList.add(this.localValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localValue)); - } - if (this.localValuesTracker) { - if (this.localValues != null) { - for (final String localValue2 : this.localValues) { - - if (localValue2 != null) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "values")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localValue2)); - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "values")); - elementList.add(null); - - } - - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "values")); - elementList.add(null); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaForm parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaForm object = new XmlSchemaForm(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaForm".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaForm) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list2 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://constants.schema.commons.ws.apache.org/xsd", - "value").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "values").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list2.add(null); - - reader.next(); - } else { - 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://schema.commons.ws.apache.org/xsd", - "values").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list2.add(null); - - reader.next(); - } else { - list2.add(reader.getElementText()); - } - } else { - loopDone2 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setValues((java.lang.String[]) list2.toArray(new java.lang.String[list2.size()])); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaObject.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaObject.java deleted file mode 100644 index 31077605c..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaObject.java +++ /dev/null @@ -1,718 +0,0 @@ - -/** - * XmlSchemaObject.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - - -/** - * XmlSchemaObject bean class - */ - -public abstract class XmlSchemaObject implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaObject Namespace URI = - * http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = -704268812696930982L; - - /** - * field for LineNumber - */ - - - protected int localLineNumber; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLineNumberTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getLineNumber() { - return this.localLineNumber; - } - - - - /** - * Auto generated setter method - * - * @param param LineNumber - */ - public void setLineNumber(final int param) { - - // setting primitive attribute tracker to true - this.localLineNumberTracker = param != java.lang.Integer.MIN_VALUE; - - this.localLineNumber = param; - - - } - - - /** - * field for LinePosition - */ - - - protected int localLinePosition; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localLinePositionTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getLinePosition() { - return this.localLinePosition; - } - - - - /** - * Auto generated setter method - * - * @param param LinePosition - */ - public void setLinePosition(final int param) { - - // setting primitive attribute tracker to true - this.localLinePositionTracker = param != java.lang.Integer.MIN_VALUE; - - this.localLinePosition = param; - - - } - - - /** - * field for MetaInfoMap - */ - - - protected authclient.java.util.xsd.Map localMetaInfoMap; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMetaInfoMapTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Map - */ - public authclient.java.util.xsd.Map getMetaInfoMap() { - return this.localMetaInfoMap; - } - - - - /** - * Auto generated setter method - * - * @param param MetaInfoMap - */ - public void setMetaInfoMap(final authclient.java.util.xsd.Map param) { - this.localMetaInfoMapTracker = true; - - this.localMetaInfoMap = param; - - - } - - - /** - * field for SourceURI - */ - - - protected java.lang.String localSourceURI; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSourceURITracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSourceURI() { - return this.localSourceURI; - } - - - - /** - * Auto generated setter method - * - * @param param SourceURI - */ - public void setSourceURI(final java.lang.String param) { - this.localSourceURITracker = true; - - this.localSourceURI = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaObject", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaObject", - xmlWriter); - } - - - } - if (this.localLineNumberTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "lineNumber", xmlWriter); - - if (this.localLineNumber == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lineNumber cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - - xmlWriter.writeEndElement(); - } - if (this.localLinePositionTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "linePosition", xmlWriter); - - if (this.localLinePosition == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("linePosition cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMetaInfoMapTracker) { - if (this.localMetaInfoMap == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "metaInfoMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMetaInfoMap.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap"), xmlWriter); - } - } - if (this.localSourceURITracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "sourceURI", xmlWriter); - - - if (this.localSourceURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSourceURI); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localLineNumberTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "lineNumber")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - if (this.localLinePositionTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "linePosition")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - if (this.localMetaInfoMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "metaInfoMap")); - - - elementList.add(this.localMetaInfoMap == null ? null : this.localMetaInfoMap); - } - if (this.localSourceURITracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "sourceURI")); - - elementList.add(this.localSourceURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSourceURI)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaObject parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaObject object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaObject".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaObject) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "lineNumber").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLineNumber(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLineNumber(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "linePosition").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLinePosition(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLinePosition(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMetaInfoMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setMetaInfoMap(authclient.java.util.xsd.Map.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://schema.commons.ws.apache.org/xsd", - "sourceURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSourceURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaObjectCollection.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaObjectCollection.java deleted file mode 100644 index 1a4b30428..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaObjectCollection.java +++ /dev/null @@ -1,540 +0,0 @@ - -/** - * XmlSchemaObjectCollection.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - - -/** - * XmlSchemaObjectCollection bean class - */ - -public class XmlSchemaObjectCollection implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaObjectCollection - * Namespace URI = http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = -6324261120787674642L; - - /** - * field for Count - */ - - - protected int localCount; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCountTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getCount() { - return this.localCount; - } - - - - /** - * Auto generated setter method - * - * @param param Count - */ - public void setCount(final int param) { - - // setting primitive attribute tracker to true - this.localCountTracker = param != java.lang.Integer.MIN_VALUE; - - this.localCount = param; - - - } - - - /** - * field for Iterator - */ - - - protected authclient.java.util.xsd.Iterator localIterator; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIteratorTracker = false; - - - /** - * Auto generated getter method - * - * @return authclient.java.util.xsd.Iterator - */ - public authclient.java.util.xsd.Iterator getIterator() { - return this.localIterator; - } - - - - /** - * Auto generated setter method - * - * @param param Iterator - */ - public void setIterator(final authclient.java.util.xsd.Iterator param) { - this.localIteratorTracker = true; - - this.localIterator = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaObjectCollection", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaObjectCollection", - xmlWriter); - } - - - } - if (this.localCountTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "count", xmlWriter); - - if (this.localCount == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("count cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCount)); - } - - xmlWriter.writeEndElement(); - } - if (this.localIteratorTracker) { - if (this.localIterator == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "iterator", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localIterator.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "iterator"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localCountTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "count")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCount)); - } - if (this.localIteratorTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "iterator")); - - - elementList.add(this.localIterator == null ? null : this.localIterator); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaObjectCollection parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaObjectCollection object = new XmlSchemaObjectCollection(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaObjectCollection".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaObjectCollection) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "count").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCount(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setCount(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "iterator").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setIterator(null); - reader.next(); - - reader.next(); - - } else { - - object.setIterator(authclient.java.util.xsd.Iterator.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaParticle.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaParticle.java deleted file mode 100644 index c52fd107a..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaParticle.java +++ /dev/null @@ -1,937 +0,0 @@ - -/** - * XmlSchemaParticle.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - -import org.w3c.dom.xsd.Attr; - -/** - * XmlSchemaParticle bean class - */ - -public class XmlSchemaParticle extends org.apache.ws.commons.schema.xsd.XmlSchemaAnnotated - implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaParticle Namespace URI - * = http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = 4868290789199550102L; - - /** - * field for MaxOccurs - */ - - - protected long localMaxOccurs; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMaxOccursTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getMaxOccurs() { - return this.localMaxOccurs; - } - - - - /** - * Auto generated setter method - * - * @param param MaxOccurs - */ - public void setMaxOccurs(final long param) { - - // setting primitive attribute tracker to true - this.localMaxOccursTracker = param != java.lang.Long.MIN_VALUE; - - this.localMaxOccurs = param; - - - } - - - /** - * field for MinOccurs - */ - - - protected long localMinOccurs; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMinOccursTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getMinOccurs() { - return this.localMinOccurs; - } - - - - /** - * Auto generated setter method - * - * @param param MinOccurs - */ - public void setMinOccurs(final long param) { - - // setting primitive attribute tracker to true - this.localMinOccursTracker = param != java.lang.Long.MIN_VALUE; - - this.localMinOccurs = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaParticle", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaParticle", xmlWriter); - } - - if (this.localLineNumberTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "lineNumber", xmlWriter); - - if (this.localLineNumber == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lineNumber cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - - xmlWriter.writeEndElement(); - } - if (this.localLinePositionTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "linePosition", xmlWriter); - - if (this.localLinePosition == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("linePosition cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMetaInfoMapTracker) { - if (this.localMetaInfoMap == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "metaInfoMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMetaInfoMap.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap"), xmlWriter); - } - } - if (this.localSourceURITracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "sourceURI", xmlWriter); - - - if (this.localSourceURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSourceURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localAnnotationTracker) { - if (this.localAnnotation == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "annotation", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAnnotation.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "annotation"), xmlWriter); - } - } - if (this.localIdTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "id", xmlWriter); - - - if (this.localId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localUnhandledAttributesTracker) { - if (this.localUnhandledAttributes != null) { - for (final Attr localUnhandledAttribute : this.localUnhandledAttributes) { - if (localUnhandledAttribute != null) { - localUnhandledAttribute.serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes"), xmlWriter); - } else { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - if (this.localMaxOccursTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "maxOccurs", xmlWriter); - - if (this.localMaxOccurs == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("maxOccurs cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMaxOccurs)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMinOccursTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "minOccurs", xmlWriter); - - if (this.localMinOccurs == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("minOccurs cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMinOccurs)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://schema.commons.ws.apache.org/xsd", "XmlSchemaParticle")); - if (this.localLineNumberTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "lineNumber")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - if (this.localLinePositionTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "linePosition")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - if (this.localMetaInfoMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "metaInfoMap")); - - - elementList.add(this.localMetaInfoMap == null ? null : this.localMetaInfoMap); - } - if (this.localSourceURITracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "sourceURI")); - - elementList.add(this.localSourceURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSourceURI)); - } - if (this.localAnnotationTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "annotation")); - - - elementList.add(this.localAnnotation == null ? null : this.localAnnotation); - } - if (this.localIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "id")); - - elementList.add(this.localId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localId)); - } - if (this.localUnhandledAttributesTracker) { - if (this.localUnhandledAttributes != null) { - for (final Attr localUnhandledAttribute : this.localUnhandledAttributes) { - - if (localUnhandledAttribute != null) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(localUnhandledAttribute); - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(this.localUnhandledAttributes); - - } - - } - if (this.localMaxOccursTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "maxOccurs")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMaxOccurs)); - } - if (this.localMinOccursTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "minOccurs")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMinOccurs)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaParticle parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaParticle object = new XmlSchemaParticle(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaParticle".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaParticle) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list7 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "lineNumber").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLineNumber(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLineNumber(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "linePosition").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLinePosition(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLinePosition(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMetaInfoMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setMetaInfoMap(authclient.java.util.xsd.Map.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://schema.commons.ws.apache.org/xsd", - "sourceURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSourceURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "annotation").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAnnotation(null); - reader.next(); - - reader.next(); - - } else { - - object.setAnnotation(org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation.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://schema.commons.ws.apache.org/xsd", - "id").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - reader.next(); - } else { - list7.add(org.w3c.dom.xsd.Attr.Factory.parse(reader)); - } - // loop until we find a start element that is not part of this array - boolean loopDone7 = false; - while (!loopDone7) { - // 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 - loopDone7 = true; - } else { - if (new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - reader.next(); - } else { - list7.add(org.w3c.dom.xsd.Attr.Factory.parse(reader)); - } - } else { - loopDone7 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setUnhandledAttributes((org.w3c.dom.xsd.Attr[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.w3c.dom.xsd.Attr.class, - list7)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "maxOccurs").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setMaxOccurs(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setMaxOccurs(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "minOccurs").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setMinOccurs(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setMinOccurs(java.lang.Long.MIN_VALUE); - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaType.java b/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaType.java deleted file mode 100644 index 77c4ae65a..000000000 --- a/org.opentosca.container.connector.bps/src/org/apache/ws/commons/schema/xsd/XmlSchemaType.java +++ /dev/null @@ -1,1553 +0,0 @@ - -/** - * XmlSchemaType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.apache.ws.commons.schema.xsd; - -import org.w3c.dom.xsd.Attr; - -/** - * XmlSchemaType bean class - */ - -public class XmlSchemaType extends org.apache.ws.commons.schema.xsd.XmlSchemaAnnotated - implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = XmlSchemaType Namespace URI = - * http://schema.commons.ws.apache.org/xsd Namespace Prefix = ns22 - */ - - - /** - * - */ - private static final long serialVersionUID = -3811256173958320914L; - - /** - * field for QName - */ - - - protected java.lang.Object localQName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localQNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getQName() { - return this.localQName; - } - - - - /** - * Auto generated setter method - * - * @param param QName - */ - public void setQName(final java.lang.Object param) { - this.localQNameTracker = true; - - this.localQName = param; - - - } - - - /** - * field for BaseSchemaType - */ - - - protected java.lang.Object localBaseSchemaType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localBaseSchemaTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getBaseSchemaType() { - return this.localBaseSchemaType; - } - - - - /** - * Auto generated setter method - * - * @param param BaseSchemaType - */ - public void setBaseSchemaType(final java.lang.Object param) { - this.localBaseSchemaTypeTracker = true; - - this.localBaseSchemaType = param; - - - } - - - /** - * field for BaseSchemaTypeName - */ - - - protected java.lang.Object localBaseSchemaTypeName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localBaseSchemaTypeNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.Object - */ - public java.lang.Object getBaseSchemaTypeName() { - return this.localBaseSchemaTypeName; - } - - - - /** - * Auto generated setter method - * - * @param param BaseSchemaTypeName - */ - public void setBaseSchemaTypeName(final java.lang.Object param) { - this.localBaseSchemaTypeNameTracker = true; - - this.localBaseSchemaTypeName = param; - - - } - - - /** - * field for DataType - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaDatatype localDataType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDataTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaDatatype - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaDatatype getDataType() { - return this.localDataType; - } - - - - /** - * Auto generated setter method - * - * @param param DataType - */ - public void setDataType(final org.apache.ws.commons.schema.xsd.XmlSchemaDatatype param) { - this.localDataTypeTracker = true; - - this.localDataType = param; - - - } - - - /** - * field for DeriveBy - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod localDeriveBy; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDeriveByTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod getDeriveBy() { - return this.localDeriveBy; - } - - - - /** - * Auto generated setter method - * - * @param param DeriveBy - */ - public void setDeriveBy(final org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod param) { - this.localDeriveByTracker = true; - - this.localDeriveBy = param; - - - } - - - /** - * field for _final - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod local_final; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_finalTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod get_final() { - return this.local_final; - } - - - - /** - * Auto generated setter method - * - * @param param _final - */ - public void set_final(final org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod param) { - this.local_finalTracker = true; - - this.local_final = param; - - - } - - - /** - * field for FinalResolved - */ - - - protected org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod localFinalResolved; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFinalResolvedTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod - */ - public org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod getFinalResolved() { - return this.localFinalResolved; - } - - - - /** - * Auto generated setter method - * - * @param param FinalResolved - */ - public void setFinalResolved(final org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod param) { - this.localFinalResolvedTracker = true; - - this.localFinalResolved = param; - - - } - - - /** - * field for Mixed - */ - - - protected boolean localMixed; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMixedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getMixed() { - return this.localMixed; - } - - - - /** - * Auto generated setter method - * - * @param param Mixed - */ - public void setMixed(final boolean param) { - - // setting primitive attribute tracker to true - this.localMixedTracker = true; - - this.localMixed = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://schema.commons.ws.apache.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":XmlSchemaType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "XmlSchemaType", xmlWriter); - } - - if (this.localLineNumberTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "lineNumber", xmlWriter); - - if (this.localLineNumber == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lineNumber cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - - xmlWriter.writeEndElement(); - } - if (this.localLinePositionTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "linePosition", xmlWriter); - - if (this.localLinePosition == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("linePosition cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMetaInfoMapTracker) { - if (this.localMetaInfoMap == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "metaInfoMap", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMetaInfoMap.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap"), xmlWriter); - } - } - if (this.localSourceURITracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "sourceURI", xmlWriter); - - - if (this.localSourceURI == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localSourceURI); - - } - - xmlWriter.writeEndElement(); - } - if (this.localAnnotationTracker) { - if (this.localAnnotation == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "annotation", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAnnotation.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "annotation"), xmlWriter); - } - } - if (this.localIdTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "id", xmlWriter); - - - if (this.localId == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localId); - - } - - xmlWriter.writeEndElement(); - } - if (this.localUnhandledAttributesTracker) { - if (this.localUnhandledAttributes != null) { - for (final Attr localUnhandledAttribute : this.localUnhandledAttributes) { - if (localUnhandledAttribute != null) { - localUnhandledAttribute.serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes"), xmlWriter); - } else { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "unhandledAttributes", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - if (this.localQNameTracker) { - - if (this.localQName != null) { - if (this.localQName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localQName).serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "QName"), xmlWriter, true); - } else { - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "QName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localQName, xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "QName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localBaseSchemaTypeTracker) { - - if (this.localBaseSchemaType != null) { - if (this.localBaseSchemaType instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localBaseSchemaType).serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "baseSchemaType"), xmlWriter, true); - } else { - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "baseSchemaType", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localBaseSchemaType, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "baseSchemaType", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localBaseSchemaTypeNameTracker) { - - if (this.localBaseSchemaTypeName != null) { - if (this.localBaseSchemaTypeName instanceof org.apache.axis2.databinding.ADBBean) { - ((org.apache.axis2.databinding.ADBBean) this.localBaseSchemaTypeName).serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "baseSchemaTypeName"), xmlWriter, true); - } else { - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "baseSchemaTypeName", xmlWriter); - org.apache.axis2.databinding.utils.ConverterUtil.serializeAnyType(this.localBaseSchemaTypeName, - xmlWriter); - xmlWriter.writeEndElement(); - } - } else { - - // write null attribute - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "baseSchemaTypeName", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - - } - if (this.localDataTypeTracker) { - if (this.localDataType == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "dataType", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localDataType.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "dataType"), xmlWriter); - } - } - if (this.localDeriveByTracker) { - if (this.localDeriveBy == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "deriveBy", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localDeriveBy.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "deriveBy"), xmlWriter); - } - } - if (this.local_finalTracker) { - if (this.local_final == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "final", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.local_final.serialize(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "final"), xmlWriter); - } - } - if (this.localFinalResolvedTracker) { - if (this.localFinalResolved == null) { - - writeStartElement(null, "http://schema.commons.ws.apache.org/xsd", "finalResolved", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localFinalResolved.serialize(new javax.xml.namespace.QName( - "http://schema.commons.ws.apache.org/xsd", "finalResolved"), xmlWriter); - } - } - if (this.localMixedTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "mixed", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("mixed cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMixed)); - } - - xmlWriter.writeEndElement(); - } - if (this.localNameTracker) { - namespace = "http://schema.commons.ws.apache.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://schema.commons.ws.apache.org/xsd")) { - return "ns22"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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://schema.commons.ws.apache.org/xsd", "XmlSchemaType")); - if (this.localLineNumberTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "lineNumber")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - if (this.localLinePositionTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "linePosition")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLinePosition)); - } - if (this.localMetaInfoMapTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "metaInfoMap")); - - - elementList.add(this.localMetaInfoMap == null ? null : this.localMetaInfoMap); - } - if (this.localSourceURITracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "sourceURI")); - - elementList.add(this.localSourceURI == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSourceURI)); - } - if (this.localAnnotationTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "annotation")); - - - elementList.add(this.localAnnotation == null ? null : this.localAnnotation); - } - if (this.localIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "id")); - - elementList.add(this.localId == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localId)); - } - if (this.localUnhandledAttributesTracker) { - if (this.localUnhandledAttributes != null) { - for (final Attr localUnhandledAttribute : this.localUnhandledAttributes) { - - if (localUnhandledAttribute != null) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(localUnhandledAttribute); - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes")); - elementList.add(this.localUnhandledAttributes); - - } - - } - if (this.localQNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "QName")); - - - elementList.add(this.localQName == null ? null : this.localQName); - } - if (this.localBaseSchemaTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "baseSchemaType")); - - - elementList.add(this.localBaseSchemaType == null ? null : this.localBaseSchemaType); - } - if (this.localBaseSchemaTypeNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "baseSchemaTypeName")); - - - elementList.add(this.localBaseSchemaTypeName == null ? null : this.localBaseSchemaTypeName); - } - if (this.localDataTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "dataType")); - - - elementList.add(this.localDataType == null ? null : this.localDataType); - } - if (this.localDeriveByTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "deriveBy")); - - - elementList.add(this.localDeriveBy == null ? null : this.localDeriveBy); - } - if (this.local_finalTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "final")); - - - elementList.add(this.local_final == null ? null : this.local_final); - } - if (this.localFinalResolvedTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "finalResolved")); - - - elementList.add(this.localFinalResolved == null ? null : this.localFinalResolved); - } - if (this.localMixedTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "mixed")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMixed)); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static XmlSchemaType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final XmlSchemaType object = new XmlSchemaType(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"XmlSchemaType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (XmlSchemaType) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list7 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "lineNumber").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLineNumber(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLineNumber(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "linePosition").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLinePosition(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setLinePosition(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "metaInfoMap").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMetaInfoMap(null); - reader.next(); - - reader.next(); - - } else { - - object.setMetaInfoMap(authclient.java.util.xsd.Map.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://schema.commons.ws.apache.org/xsd", - "sourceURI").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setSourceURI(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "annotation").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAnnotation(null); - reader.next(); - - reader.next(); - - } else { - - object.setAnnotation(org.apache.ws.commons.schema.xsd.XmlSchemaAnnotation.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://schema.commons.ws.apache.org/xsd", - "id").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setId(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - reader.next(); - } else { - list7.add(org.w3c.dom.xsd.Attr.Factory.parse(reader)); - } - // loop until we find a start element that is not part of this array - boolean loopDone7 = false; - while (!loopDone7) { - // 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 - loopDone7 = true; - } else { - if (new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "unhandledAttributes").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list7.add(null); - reader.next(); - } else { - list7.add(org.w3c.dom.xsd.Attr.Factory.parse(reader)); - } - } else { - loopDone7 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setUnhandledAttributes((org.w3c.dom.xsd.Attr[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.w3c.dom.xsd.Attr.class, - list7)); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "QName").equals(reader.getName())) { - - object.setQName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "baseSchemaType").equals(reader.getName())) { - - object.setBaseSchemaType(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "baseSchemaTypeName").equals(reader.getName())) { - - object.setBaseSchemaTypeName(org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(reader, - org.apache.axis2.transaction.xsd.ExtensionMapper.class)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://schema.commons.ws.apache.org/xsd", - "dataType").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setDataType(null); - reader.next(); - - reader.next(); - - } else { - - object.setDataType(org.apache.ws.commons.schema.xsd.XmlSchemaDatatype.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://schema.commons.ws.apache.org/xsd", - "deriveBy").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setDeriveBy(null); - reader.next(); - - reader.next(); - - } else { - - object.setDeriveBy(org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod.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://schema.commons.ws.apache.org/xsd", - "final").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.set_final(null); - reader.next(); - - reader.next(); - - } else { - - object.set_final(org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod.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://schema.commons.ws.apache.org/xsd", - "finalResolved").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setFinalResolved(null); - reader.next(); - - reader.next(); - - } else { - - object.setFinalResolved(org.apache.ws.commons.schema.xsd.XmlSchemaDerivationMethod.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://schema.commons.ws.apache.org/xsd", - "mixed").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setMixed(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://schema.commons.ws.apache.org/xsd", - "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/opentosca/container/connector/bps/Activator.java b/org.opentosca.container.connector.bps/src/org/opentosca/container/connector/bps/Activator.java deleted file mode 100644 index 9be5712a2..000000000 --- a/org.opentosca.container.connector.bps/src/org/opentosca/container/connector/bps/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.connector.bps; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.connector.bps/src/org/opentosca/container/connector/bps/BpsConnector.java b/org.opentosca.container.connector.bps/src/org/opentosca/container/connector/bps/BpsConnector.java deleted file mode 100644 index e244e7948..000000000 --- a/org.opentosca.container.connector.bps/src/org/opentosca/container/connector/bps/BpsConnector.java +++ /dev/null @@ -1,770 +0,0 @@ -package org.opentosca.container.connector.bps; - -import java.io.File; -import java.net.InetAddress; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.UnknownHostException; -import java.rmi.RemoteException; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.activation.DataHandler; -import javax.activation.FileDataSource; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.xml.namespace.QName; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.Constants; -import org.apache.axis2.client.ServiceClient; -import org.apache.axis2.client.Stub; -import org.apache.axis2.java.security.SSLProtocolSocketFactory; -import org.apache.axis2.java.security.TrustAllTrustManager; -import org.apache.axis2.transport.http.HTTPConstants; -import org.apache.commons.httpclient.protocol.Protocol; -import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wso2.bps.management.schema.DeployedPackagesPaginated; -import org.wso2.bps.management.schema.EndpointRef_type0; -import org.wso2.bps.management.schema.GetAllProcesses; -import org.wso2.bps.management.schema.GetProcessInfoIn; -import org.wso2.bps.management.schema.ListDeployedPackagesPaginated; -import org.wso2.bps.management.schema.Package_type0; -import org.wso2.bps.management.schema.ProcessIDList; -import org.wso2.bps.management.schema.ProcessInfo; -import org.wso2.bps.management.schema.ProcessStatus; -import org.wso2.bps.management.schema.UndeployBPELPackage; -import org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementServiceStub; -import org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException; -import org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException; -import org.wso2.bps.management.wsdl.processmanagement.ProcessManagementServiceStub; -import org.wso2.carbon.bpel.deployer.services.BPELUploaderStub; -import org.wso2.carbon.bpel.deployer.services.UploadService; -import org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem; -import org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException; -import org.wso2.carbon.core.services.authentication.AuthenticationAdminStub; -import org.wso2.carbon.core.services.authentication.Login; - -/** - * This class is a connector to deploy and undeploy a - * WS-BPEL 2.0 Processes on a - * WSO2 Business Process Server. - * - * The class uses the generated stubs of:
- *
    - *
  • /META-INF/resources/BPELUploader.wsdl
  • - *
  • /META-INF/resources/AuthenticationAdmin.wsdl
  • - *
- * These .wsdl files are published in the backend of a WSO2 BPS and allow authentication plus - * upload. - * - * @see WSO2 Business Process Server - * @see WS-BPEL 2.0 Processes - */ - -public class BpsConnector { - - private String adress; - private String user; - private String passwd; - private String cookie; - - private final static Logger LOG = LoggerFactory.getLogger(BpsConnector.class); - - /** - * Sets the endpoint of this connector - * - * @param uri the uri to the endpoint of WSO2 BPS - */ - private void setEndpoint(final String uri) { - BpsConnector.LOG.debug("Setting address"); - this.adress = uri; - } - - /** - * Sets the login data of this connector - * - * @param user admin name - * @param pw admin password - */ - private void setLogin(final String user, final String pw) { - BpsConnector.LOG.debug("Setting login data"); - this.user = user; - this.passwd = pw; - } - - /** - * Deploys a WS-BPEL 2.0 process unto the referenced WSO2 BPS - * - * @param process the process to deploy packaged for a WSO2 BPS - * @param uri the URI of the WSO2 BPS - * @param user the username for the WSO2 BPS - * @param pw the password for the WSO2 BPS - * @return a string containing the PID (ProcessId) of the deployed process if everything was - * successful, else null - */ - public String deploy(final File process, final String uri, final String user, final String pw) throws Exception { - if (uri == null | user == null | pw == null) { - return null; - } - String pid = null; - try { - this.setEndpoint(uri); - this.setLogin(user, pw); - this.login(); - final String fileName = process.getName(); - final String fileType = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); - BpsConnector.LOG.debug("Trying to deploy file: {}", process.getAbsolutePath()); - final String packageId = this.deployFile(process, fileName, fileType); - List pidsOfPackage = new ArrayList<>(); - // this is a "brutal" hack <=> pulling from server until a pid is - // set - int pullCount = 0; - while (pidsOfPackage.isEmpty() & pullCount < 50) { - BpsConnector.LOG.debug("Polling for pid with packageId " + packageId); - pidsOfPackage = this.getPIDsForPackageId(packageId, uri, user, pw); - if (pidsOfPackage.isEmpty()) { - // as we don't want the bps to be overworked we wait here - try { - Thread.sleep(2000); - } - catch (final InterruptedException e) { - e.printStackTrace(); - } - } - // for safety - pullCount++; - } - - pid = this.calcHighestPid(pidsOfPackage, packageId); - - if (pid == null || pid.isEmpty()) { - throw new Exception("Couldn't deploy plan " + fileName); - } - - final ProcessManagementServiceStub stub = this.getProcessManagementServiceStub(); - - final GetProcessInfoIn req2 = new GetProcessInfoIn(); - - req2.setPid(QName.valueOf(pid)); - // request process info for pid - ProcessInfo info = ((ProcessManagementServiceStub) this.setCookie(stub)).getProcessInfo(req2); - BpsConnector.LOG.debug("Checking packageName for Pid: " + pid); - BpsConnector.LOG.debug("Package name of PID is: " - + info.getProcessInfo().getDeploymentInfo().getPackageName()); - - // check deployment state until its active - while (info.getProcessInfo().getStatus() != ProcessStatus.ACTIVE) { - info = ((ProcessManagementServiceStub) this.setCookie(stub)).getProcessInfo(req2); - Thread.sleep(500); - } - - } - catch (final RemoteException e) { - BpsConnector.LOG.error("RemoteException: Server not available", e); - return null; - } - catch (final AuthenticationAdminAuthenticationExceptionException e) { - BpsConnector.LOG.error("Auth at BPS failed", e); - return null; - } - catch (final ProcessManagementException e) { - BpsConnector.LOG.error("The Process isn't valid", e); - return null; - } - catch (final UnknownHostException e) { - BpsConnector.LOG.error("UnknownHostException: ", e); - return null; - } - catch (final InterruptedException e) { - BpsConnector.LOG.error("InterruptedException: ", e); - return null; - } - return pid; - } - - private String calcHighestPid(final List pids, final String packageId) { - BpsConnector.LOG.debug("Starting to calculate highest PID number for package: " + packageId); - if (pids.isEmpty()) { - BpsConnector.LOG.warn("PID list is empty"); - return null; - } - final List idNums = new ArrayList<>(); - String ns = null; - for (final QName pid : pids) { - if (ns == null) { - ns = pid.getNamespaceURI(); - BpsConnector.LOG.debug("Found namespace for PIDs:" + ns); - } - final String localPart = pid.getLocalPart(); - BpsConnector.LOG.debug("PID has localPart " + localPart + " defined"); - - final String idNum = localPart.substring(localPart.lastIndexOf("-") + 1); - - BpsConnector.LOG.debug("Trying to parse PID Number " + idNum); - idNums.add(Integer.valueOf(idNum)); - } - Collections.sort(idNums); - final int highestNumber = idNums.get(idNums.size() - 1); - for (final QName pid : pids) { - if (pid.getLocalPart().endsWith("-" + String.valueOf(highestNumber))) { - return pid.toString(); - } - } - - return null; - } - - /** - * Returns pids for the given package on the referenced bps - * - * @param packageId a String representing the packageId on a bps - * @param uri the uri to the bps - * @param user the user account - * @param pw the password for the user account - * @return a possibly empty List of QName denoting PIDs - */ - public List getPIDsForPackageId(final String packageId, final String uri, final String user, - final String pw) { - final List pids = new ArrayList<>(); - - try { - // set up authentication - this.setEndpoint(uri); - this.setLogin(user, pw); - this.login(); - - BpsConnector.LOG.debug("Fetching pid for package: " + packageId); - // set up service stub and data for request - final ProcessManagementServiceStub stub = this.getProcessManagementServiceStub(); - final GetAllProcesses processReq = new GetAllProcesses(); - - // takes all processes, taken from - // http://wso2.org/project/bps/2.1.0/docs/management_api.html - processReq.setGetAllProcesses("name}}* namespace=*"); - - // another pulling hack - - ProcessIDList pidList = null; - while (pidList == null) { - // send request - pidList = ((ProcessManagementServiceStub) this.setCookie(stub)).getAllProcesses(processReq); - } - - // this can happen if the bps has no process deployed - if (pidList != null && pidList.getPid() != null) { - BpsConnector.LOG.debug("Found following PIDs:"); - for (final String pid : pidList.getPid()) { - BpsConnector.LOG.debug("pid: " + pid); - } - - // get ProcessInfo per pid - final GetProcessInfoIn req2 = new GetProcessInfoIn(); - for (final String pid : pidList.getPid()) { - req2.setPid(QName.valueOf(pid)); - // request process info for pid - final ProcessInfo info = ((ProcessManagementServiceStub) this.setCookie(stub)).getProcessInfo(req2); - BpsConnector.LOG.debug("Checking packageName for Pid: " + pid); - BpsConnector.LOG.debug("Package name of PID is: " - + info.getProcessInfo().getDeploymentInfo().getPackageName()); - if (info.getProcessInfo().getDeploymentInfo().getPackageName().startsWith(packageId + "-")) { - pids.add(QName.valueOf(pid)); - } - - } - } - } - catch (final UnknownHostException e1) { - BpsConnector.LOG.error("Host address not reachable", e1); - } - catch (final AuthenticationAdminAuthenticationExceptionException e1) { - BpsConnector.LOG.error("Error with request-processing at AdminAuthenticationService", e1); - } - catch (final RemoteException e) { - BpsConnector.LOG.error("Error while sending Request", e); - } - catch (final ProcessManagementException e) { - BpsConnector.LOG.error("Error with request-processing at ProcessManagementService", e); - } - return pids; - } - - /** - * Undeploys processes from the referenced WSO2 BPS - * - * @param PID The ProcessId (on a WSO2 BPS) of the WS-BPEL 2.0 process to undeploy - * @param uri the uri of the WSO2 BPS to undeploy from - * @param user the username for the WSO2 BPS - * @param pw the password for the WSO2 BPS - * @return true if undeployment was successful - */ - public boolean undeploy(final String PID, final String uri, final String user, final String pw) { - if (uri == null | user == null | pw == null) { - return false; - } - final UndeployBPELPackage request = new UndeployBPELPackage(); - request.set_package(PID); - try { - this.setEndpoint(uri); - this.setLogin(user, pw); - this.login(); - final BPELPackageManagementServiceStub stub = this.getBPELPackageManagementServiceStub(); - ((BPELPackageManagementServiceStub) this.setCookie(stub)).undeployBPELPackage(request); - } - catch (final AxisFault e) { - BpsConnector.LOG.error("AxisFault: ", e); - return false; - } - catch (final RemoteException e) { - BpsConnector.LOG.error("Remote Exception: Server not available: ", e); - return false; - } - catch (final PackageManagementException e) { - BpsConnector.LOG.error("PackageManagementException: Package wasn't valid: ", e); - return false; - } - catch (final AuthenticationAdminAuthenticationExceptionException e) { - BpsConnector.LOG.error("AuthenticationAdminAuthenticationException: Logindata wasn't valid", e); - return false; - } - catch (final UnknownHostException e) { - BpsConnector.LOG.error("UnknownHostException: System can't determine localhost", e); - return false; - } - return true; - } - - /** - * Undeploys a BPEL Process which is given as a zip file - * - * @param file the BPEL Process to undeploy as a zip file - * @param uri the URI of the BPS the process has to be undeployed - * @param user the userId to authenticate with the BPS - * @param pw the password to for the given user account - * @return true iff undeployment was successful - */ - public boolean undeploy(final File file, final String uri, final String user, final String pw) { - // check input - if (file == null | user == null | pw == null) { - BpsConnector.LOG.error("Some parameter is null!"); - if (file == null) { - BpsConnector.LOG.error("BPEL process file is null"); - } - if (user == null) { - BpsConnector.LOG.error("UserId is null"); - } - if (pw == null) { - BpsConnector.LOG.error("Password is null"); - } - return false; - } - - BpsConnector.LOG.debug("Path of process file: " + file.getAbsolutePath()); - BpsConnector.LOG.debug("File name: " + file.getName()); - BpsConnector.LOG.debug("UserName: " + user); - BpsConnector.LOG.debug("UserPw: " + pw); - - if (!file.isFile()) { - BpsConnector.LOG.error("Path of file doesn't denote to a file"); - return false; - } - - if (!file.getName().endsWith(".zip")) { - BpsConnector.LOG.error("File is not a .zip file"); - return false; - } - - // setup request message - final UndeployBPELPackage request = new UndeployBPELPackage(); - final String packageName = file.getName().substring(0, file.getName().length() - 4); - BpsConnector.LOG.debug("Trying to undeploy with packageName: " + packageName); - request.set_package(packageName); - - try { - // authenticate with bps - this.setEndpoint(uri); - this.setLogin(user, pw); - this.login(); - } - catch (final RemoteException e) { - BpsConnector.LOG.error("Some remote exception occured while calling the BPS", e); - return false; - } - catch (final UnknownHostException e) { - BpsConnector.LOG.error("The given URI doesn't point to a BPS", e); - return false; - } - catch (final AuthenticationAdminAuthenticationExceptionException e) { - BpsConnector.LOG.error("Some error at the BPS occured", e); - return false; - } - - try { - // Init axis2 stub - final BPELPackageManagementServiceStub stub = this.getBPELPackageManagementServiceStub(); - // set the cookie from authentication and call BPS backend - ((BPELPackageManagementServiceStub) this.setCookie(stub)).undeployBPELPackage(request); - } - catch (final AxisFault e) { - BpsConnector.LOG.error("Initializing Axis2 Stub for BPS access failed", e); - return false; - } - catch (final RemoteException e) { - BpsConnector.LOG.error("Some remote exception occured while calling the BPS", e); - return false; - } - catch (final PackageManagementException e) { - BpsConnector.LOG.error("Some error at the BPS occured", e); - return false; - } - - return true; - } - - /** - * Logs into the WSO2 BPS declared in the address field - * - * @throws RemoteException is thrown when connection failed - * @throws AuthenticationAdminAuthenticationExceptionException is thrown when login was wrong - * @throws UnknownHostException is thrown when no connection can be established - */ - private void login() throws RemoteException, AuthenticationAdminAuthenticationExceptionException, - UnknownHostException { - BpsConnector.LOG.debug("Logging in to BPS"); - final Login login = new Login(); - login.setUsername(this.user); - login.setPassword(this.passwd); - login.setRemoteAddress(InetAddress.getLocalHost().getHostAddress()); - final AuthenticationAdminStub stub = this.getAuthenticationAdminStub(); - stub._getServiceClient().getOptions().setManageSession(true); - stub.login(login); - this.cookie = - (String) stub._getServiceClient().getLastOperationContext().getProperty(HTTPConstants.COOKIE_STRING); - } - - /** - * Deploys process referenced in FileObject - * - * @param file process to deploy - * @param fileName name of the process file - * @param fileType type of the process file - * @return Id Id of the uploaded package - * @throws RemoteException is thrown when no connection is available - * @throws ProcessManagementException is thrown when deployment had a failure - */ - private String deployFile(final File file, final String fileName, - final String fileType) throws RemoteException, ProcessManagementException { - final String fileNameshort = fileName.substring(0, fileName.indexOf("." + fileType)); - - final UploadedFileItem tempFile = new UploadedFileItem(); - tempFile.setDataHandler(new DataHandler(new FileDataSource(file))); - tempFile.setFileName(fileName); - tempFile.setFileType(fileType); - final UploadService upload = new UploadService(); - upload.addFileItems(tempFile); - - final BPELUploaderStub stub = this.getBPELUploaderStub(); - - ((BPELUploaderStub) this.setCookie(stub)).uploadService(upload); - return fileNameshort; - } - - /** - * Returns the deployed packages on the given BPS - * - * @param uri the address to the bps - * @param user user account - * @param pw user account password - * @return a list of strings containing the names of the deployed packages - */ - public List getDeployedPackages(final String uri, final String user, final String pw) { - final List packageIds = new ArrayList<>(); - - try { - this.setEndpoint(uri); - this.setLogin(user, pw); - this.login(); - - // set up service stub and data for request - final BPELPackageManagementServiceStub stub = this.getBPELPackageManagementServiceStub(); - - final ListDeployedPackagesPaginated processReq = new ListDeployedPackagesPaginated(); - int count = 0; - int pages = 1; - - while (count < pages) { - processReq.setPage(count); - // make request - final DeployedPackagesPaginated result = - ((BPELPackageManagementServiceStub) this.setCookie(stub)).listDeployedPackagesPaginated(processReq); - - // process response - pages = result.getPages(); - for (final Package_type0 packageInResult : result.get_package()) { - packageIds.add(packageInResult.getName()); - } - count++; - } - } - catch (final AxisFault e) { - BpsConnector.LOG.error("Error with Axis2 Framework", e); - } - catch (final RemoteException e) { - BpsConnector.LOG.error("Error while sending request", e); - } - catch (final PackageManagementException e) { - BpsConnector.LOG.error("Error with request-processing at PackageManagementService", e); - } - catch (final UnknownHostException e) { - BpsConnector.LOG.error("Error with host address", e); - } - catch (final AuthenticationAdminAuthenticationExceptionException e) { - BpsConnector.LOG.error("Error with request-processing at AdminAuthenticationService", e); - } - return packageIds; - } - - /** - * Sets the cookie for a given axis2 client request - * - * @param stub org.apache.axis2.client.Stub Object of the Axis2 library - * @return the changed stub - */ - private Stub setCookie(final Stub stub) { - stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); - stub._getServiceClient().getOptions().setManageSession(true); - stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(60000000); - stub._getServiceClient().getOptions().setProperty(HTTPConstants.COOKIE_STRING, this.cookie); - return stub; - } - - /** - * Returns a map from partnerLink as string to an endpoint as URI, denoting the partnerLink - * - * @param pid the PID of the BPEL 2.0 Process, from which the partnerlink endpoints should be - * determined - * @param uri the URI to WSO2 BPS (2.1.2 - 3.0.0) - * @param user the login username for the WSO2 BPS - * @param pw the login password for the WSO2 BPS - * @return a Map from String to URI denoting partnerLinks and their endpoints - */ - public Map getEndpointsForPID(final String pid, final String uri, final String user, final String pw) { - final Map partnerLinkToEndpointURIs = new HashMap<>(); - if (pid == null) { - BpsConnector.LOG.warn("PID is null! Not possible to find Endpoints on BPS"); - return partnerLinkToEndpointURIs; - } - - if (uri == null) { - BpsConnector.LOG.warn("URI for BPS is null"); - return partnerLinkToEndpointURIs; - } - - if (user == null) { - BpsConnector.LOG.warn("User for BPS is null"); - return partnerLinkToEndpointURIs; - } - - if (pw == null) { - BpsConnector.LOG.warn("Password for BPS is null"); - return partnerLinkToEndpointURIs; - } - - BpsConnector.LOG.debug("Trying to get all endpoints"); - BpsConnector.LOG.debug("Using PID: " + pid); - BpsConnector.LOG.debug("Using URI: " + uri); - BpsConnector.LOG.debug("Using User: " + user); - BpsConnector.LOG.debug("Using Password: " + pw); - - // set up authentication - try { - this.setEndpoint(uri); - this.setLogin(user, pw); - this.login(); - - // set up service stub and data for request - final ProcessManagementServiceStub stub = this.getProcessManagementServiceStub(); - final GetProcessInfoIn processReq = new GetProcessInfoIn(); - processReq.setPid(QName.valueOf(pid)); - - // make request - final ProcessInfo info = ((ProcessManagementServiceStub) this.setCookie(stub)).getProcessInfo(processReq); - - BpsConnector.LOG.debug("Looking for endpoint for process " - + info.getProcessInfo().getDefinitionInfo().getProcessName()); - - // process response - for (final EndpointRef_type0 endpointRef : info.getProcessInfo().getEndpoints().getEndpointRef()) { - - BpsConnector.LOG.debug("Found partnerlink: " + endpointRef.getPartnerLink()); - BpsConnector.LOG.debug("Found service: " + endpointRef.getService().toString()); - - for (final String endpointString : endpointRef.getServiceLocations().getServiceLocation()) { - try { - partnerLinkToEndpointURIs.put(endpointRef.getPartnerLink(), new URI( - endpointString.replace("?tryit", "").replace("localhost", URI.create(uri).getHost()))); - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - } - } - - } - catch (final UnknownHostException e1) { - BpsConnector.LOG.error("Error with host address", e1); - } - catch (final AuthenticationAdminAuthenticationExceptionException e1) { - BpsConnector.LOG.error("Error with request-processing at AdminAuthenticationService", e1); - } - catch (final AxisFault e1) { - BpsConnector.LOG.error("Error in Axis2 Framework", e1); - } - catch (final RemoteException e1) { - BpsConnector.LOG.error("Error while sending request", e1); - } - catch (final ProcessManagementException e1) { - BpsConnector.LOG.error("Error with request-processing at ProcessManagementService", e1); - } - - return partnerLinkToEndpointURIs; - } - - public List getAllPIDs(final String uri, final String user, final String pw) { - final List pidStringList = new ArrayList<>(); - - try { - // set up authentication - this.setEndpoint(uri); - this.setLogin(user, pw); - this.login(); - - // set up service stub and data for request - final ProcessManagementServiceStub stub = this.getProcessManagementServiceStub(); - final GetAllProcesses processReq = new GetAllProcesses(); - - // takes all processes, taken from - // http://wso2.org/project/bps/2.1.0/docs/management_api.html - processReq.setGetAllProcesses("name}}* namespace=*"); - - // send request - final ProcessIDList pidList = - ((ProcessManagementServiceStub) this.setCookie(stub)).getAllProcesses(processReq); - - // check for case when there are no process deployed anymore - if (pidList.getPid() == null) { - BpsConnector.LOG.debug("Returned ProcessIDList from BPS is null, assuming no process is deployed on BPS"); - return new ArrayList<>(); - } - - // process response - for (final String pid : pidList.getPid()) { - pidStringList.add(pid); - } - } - catch (final UnknownHostException e1) { - e1.printStackTrace(); - } - catch (final AuthenticationAdminAuthenticationExceptionException e1) { - e1.printStackTrace(); - } - catch (final RemoteException e) { - e.printStackTrace(); - } - catch (final ProcessManagementException e) { - e.printStackTrace(); - } - - return pidStringList; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return "openTOSCA WSO2 BPS Connector v1.0"; - } - - /** - * Initializes a ProcessManagementServiceStub with added SSL Options - * - * @return a ProcessManagementServiceStub with added SSL Options - * @throws AxisFault is thrown when initalizing the Axis2 stub fails - */ - private ProcessManagementServiceStub getProcessManagementServiceStub() throws AxisFault { - final ProcessManagementServiceStub stub = - new ProcessManagementServiceStub(this.adress + "/services/ProcessManagementService"); - this.setSSLTrustManager(stub._getServiceClient()); - return stub; - } - - /** - * Initializes a BPELPackageManagementStub with added SSL Options - * - * @return a BPELPackageManagementStub with added SSL Options - * @throws AxisFault is thrown when initalizing the Axis2 stub fails - */ - private BPELPackageManagementServiceStub getBPELPackageManagementServiceStub() throws AxisFault { - final BPELPackageManagementServiceStub stub = - new BPELPackageManagementServiceStub(this.adress + "/services/BPELPackageManagementService"); - this.setSSLTrustManager(stub._getServiceClient()); - return stub; - } - - /** - * Initializes a BPELUploaderStub with added SSL Options - * - * @return a BPELUploaderStub with added SSL Options - * @throws AxisFault is thrown when initalizing the Axis2 stub fails - */ - private BPELUploaderStub getBPELUploaderStub() throws AxisFault { - final BPELUploaderStub stub = new BPELUploaderStub(this.adress + "/services/BPELUploader"); - this.setSSLTrustManager(stub._getServiceClient()); - return stub; - } - - /** - * Initializes an AuthenticationAdminStub with added SSL Options - * - * @return an AuthenticationAdminStub with added SSL Options - * @throws AxisFault is thrown when initalizing the Axis2 stub fails - */ - private AuthenticationAdminStub getAuthenticationAdminStub() throws AxisFault { - final AuthenticationAdminStub stub = new AuthenticationAdminStub(this.adress + "/services/AuthenticationAdmin"); - this.setSSLTrustManager(stub._getServiceClient()); - return stub; - } - - /** - * Sets options on given serviceClient to accept all SSL certificates - * - * @param serviceClient an Axis2 serviceClient - */ - private void setSSLTrustManager(final ServiceClient serviceClient) { - - try { - // following excerpt is taken from here: - // http://axis.apache.org/axis2/java/core/api/org/apache/axis2/java/security/TrustAllTrustManager.html - final SSLContext sslCtx = SSLContext.getInstance("SSL"); - sslCtx.init(null, new TrustManager[] {new TrustAllTrustManager()}, null); - serviceClient.getOptions().setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, new Protocol("https", - (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslCtx), 443)); - - } - catch (final NoSuchAlgorithmException e) { - BpsConnector.LOG.warn("Couldn't load SSLContext", e); - } - catch (final KeyManagementException e) { - BpsConnector.LOG.warn("Couldn't load TrustManager into SSLContext", e); - } - } - -} diff --git a/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/Attr.java b/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/Attr.java deleted file mode 100644 index 0903c8fbf..000000000 --- a/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/Attr.java +++ /dev/null @@ -1,889 +0,0 @@ - -/** - * Attr.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.w3c.dom.xsd; - - -/** - * Attr bean class - */ - -public abstract class Attr implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Attr Namespace URI = - * http://dom.w3c.org/xsd Namespace Prefix = ns23 - */ - - - /** - * - */ - private static final long serialVersionUID = 6850975547297487217L; - - /** - * field for Id - */ - - - protected boolean localId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIdTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getId() { - return this.localId; - } - - - - /** - * Auto generated setter method - * - * @param param Id - */ - public void setId(final boolean param) { - - // setting primitive attribute tracker to true - this.localIdTracker = true; - - this.localId = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = true; - - this.localName = param; - - - } - - - /** - * field for OwnerElement - */ - - - protected org.w3c.dom.xsd.Element localOwnerElement; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localOwnerElementTracker = false; - - - /** - * Auto generated getter method - * - * @return org.w3c.dom.xsd.Element - */ - public org.w3c.dom.xsd.Element getOwnerElement() { - return this.localOwnerElement; - } - - - - /** - * Auto generated setter method - * - * @param param OwnerElement - */ - public void setOwnerElement(final org.w3c.dom.xsd.Element param) { - this.localOwnerElementTracker = true; - - this.localOwnerElement = param; - - - } - - - /** - * field for SchemaTypeInfo - */ - - - protected org.w3c.dom.xsd.TypeInfo localSchemaTypeInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaTypeInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.w3c.dom.xsd.TypeInfo - */ - public org.w3c.dom.xsd.TypeInfo getSchemaTypeInfo() { - return this.localSchemaTypeInfo; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaTypeInfo - */ - public void setSchemaTypeInfo(final org.w3c.dom.xsd.TypeInfo param) { - this.localSchemaTypeInfoTracker = true; - - this.localSchemaTypeInfo = param; - - - } - - - /** - * field for Specified - */ - - - protected boolean localSpecified; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSpecifiedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getSpecified() { - return this.localSpecified; - } - - - - /** - * Auto generated setter method - * - * @param param Specified - */ - public void setSpecified(final boolean param) { - - // setting primitive attribute tracker to true - this.localSpecifiedTracker = true; - - this.localSpecified = param; - - - } - - - /** - * field for Value - */ - - - protected java.lang.String localValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localValueTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getValue() { - return this.localValue; - } - - - - /** - * Auto generated setter method - * - * @param param Value - */ - public void setValue(final java.lang.String param) { - this.localValueTracker = true; - - this.localValue = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://dom.w3c.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Attr", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Attr", xmlWriter); - } - - - } - if (this.localIdTracker) { - namespace = "http://dom.w3c.org/xsd"; - writeStartElement(null, namespace, "id", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("id cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localId)); - } - - xmlWriter.writeEndElement(); - } - if (this.localNameTracker) { - namespace = "http://dom.w3c.org/xsd"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localOwnerElementTracker) { - if (this.localOwnerElement == null) { - - writeStartElement(null, "http://dom.w3c.org/xsd", "ownerElement", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localOwnerElement.serialize(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", - "ownerElement"), xmlWriter); - } - } - if (this.localSchemaTypeInfoTracker) { - if (this.localSchemaTypeInfo == null) { - - writeStartElement(null, "http://dom.w3c.org/xsd", "schemaTypeInfo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSchemaTypeInfo.serialize(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", - "schemaTypeInfo"), xmlWriter); - } - } - if (this.localSpecifiedTracker) { - namespace = "http://dom.w3c.org/xsd"; - writeStartElement(null, namespace, "specified", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("specified cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSpecified)); - } - - xmlWriter.writeEndElement(); - } - if (this.localValueTracker) { - namespace = "http://dom.w3c.org/xsd"; - writeStartElement(null, namespace, "value", xmlWriter); - - - if (this.localValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localValue); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://dom.w3c.org/xsd")) { - return "ns23"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "id")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localId)); - } - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "name")); - - elementList.add(this.localName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } - if (this.localOwnerElementTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "ownerElement")); - - - elementList.add(this.localOwnerElement == null ? null : this.localOwnerElement); - } - if (this.localSchemaTypeInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "schemaTypeInfo")); - - - elementList.add(this.localSchemaTypeInfo == null ? null : this.localSchemaTypeInfo); - } - if (this.localSpecifiedTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "specified")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSpecified)); - } - if (this.localValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "value")); - - elementList.add(this.localValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localValue)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Attr parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Attr object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Attr".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Attr) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "id").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setId(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://dom.w3c.org/xsd", "name").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://dom.w3c.org/xsd", - "ownerElement").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setOwnerElement(null); - reader.next(); - - reader.next(); - - } else { - - object.setOwnerElement(org.w3c.dom.xsd.Element.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://dom.w3c.org/xsd", - "schemaTypeInfo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSchemaTypeInfo(null); - reader.next(); - - reader.next(); - - } else { - - object.setSchemaTypeInfo(org.w3c.dom.xsd.TypeInfo.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://dom.w3c.org/xsd", "specified").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSpecified(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://dom.w3c.org/xsd", "value").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/Element.java b/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/Element.java deleted file mode 100644 index cdc3a0fc6..000000000 --- a/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/Element.java +++ /dev/null @@ -1,551 +0,0 @@ - -/** - * Element.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.w3c.dom.xsd; - - -/** - * Element bean class - */ - -public abstract class Element implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = Element Namespace URI = - * http://dom.w3c.org/xsd Namespace Prefix = ns23 - */ - - - /** - * - */ - private static final long serialVersionUID = -3521058482554042391L; - - /** - * field for SchemaTypeInfo - */ - - - protected org.w3c.dom.xsd.TypeInfo localSchemaTypeInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localSchemaTypeInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.w3c.dom.xsd.TypeInfo - */ - public org.w3c.dom.xsd.TypeInfo getSchemaTypeInfo() { - return this.localSchemaTypeInfo; - } - - - - /** - * Auto generated setter method - * - * @param param SchemaTypeInfo - */ - public void setSchemaTypeInfo(final org.w3c.dom.xsd.TypeInfo param) { - this.localSchemaTypeInfoTracker = true; - - this.localSchemaTypeInfo = param; - - - } - - - /** - * field for TagName - */ - - - protected java.lang.String localTagName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTagNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getTagName() { - return this.localTagName; - } - - - - /** - * Auto generated setter method - * - * @param param TagName - */ - public void setTagName(final java.lang.String param) { - this.localTagNameTracker = true; - - this.localTagName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://dom.w3c.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":Element", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "Element", xmlWriter); - } - - - } - if (this.localSchemaTypeInfoTracker) { - if (this.localSchemaTypeInfo == null) { - - writeStartElement(null, "http://dom.w3c.org/xsd", "schemaTypeInfo", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localSchemaTypeInfo.serialize(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", - "schemaTypeInfo"), xmlWriter); - } - } - if (this.localTagNameTracker) { - namespace = "http://dom.w3c.org/xsd"; - writeStartElement(null, namespace, "tagName", xmlWriter); - - - if (this.localTagName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localTagName); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://dom.w3c.org/xsd")) { - return "ns23"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localSchemaTypeInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "schemaTypeInfo")); - - - elementList.add(this.localSchemaTypeInfo == null ? null : this.localSchemaTypeInfo); - } - if (this.localTagNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "tagName")); - - elementList.add(this.localTagName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTagName)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Element parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Element object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"Element".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Element) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://dom.w3c.org/xsd", - "schemaTypeInfo").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setSchemaTypeInfo(null); - reader.next(); - - reader.next(); - - } else { - - object.setSchemaTypeInfo(org.w3c.dom.xsd.TypeInfo.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://dom.w3c.org/xsd", "tagName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setTagName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/TypeInfo.java b/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/TypeInfo.java deleted file mode 100644 index 4d08acacf..000000000 --- a/org.opentosca.container.connector.bps/src/org/w3c/dom/xsd/TypeInfo.java +++ /dev/null @@ -1,560 +0,0 @@ - -/** - * TypeInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.w3c.dom.xsd; - - -/** - * TypeInfo bean class - */ - -public abstract class TypeInfo implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = TypeInfo Namespace URI = - * http://dom.w3c.org/xsd Namespace Prefix = ns23 - */ - - - /** - * - */ - private static final long serialVersionUID = -3498825360786778732L; - - /** - * field for TypeName - */ - - - protected java.lang.String localTypeName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTypeNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getTypeName() { - return this.localTypeName; - } - - - - /** - * Auto generated setter method - * - * @param param TypeName - */ - public void setTypeName(final java.lang.String param) { - this.localTypeNameTracker = true; - - this.localTypeName = param; - - - } - - - /** - * field for TypeNamespace - */ - - - protected java.lang.String localTypeNamespace; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localTypeNamespaceTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getTypeNamespace() { - return this.localTypeNamespace; - } - - - - /** - * Auto generated setter method - * - * @param param TypeNamespace - */ - public void setTypeNamespace(final java.lang.String param) { - this.localTypeNamespaceTracker = true; - - this.localTypeNamespace = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://dom.w3c.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":TypeInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "TypeInfo", xmlWriter); - } - - - } - if (this.localTypeNameTracker) { - namespace = "http://dom.w3c.org/xsd"; - writeStartElement(null, namespace, "typeName", xmlWriter); - - - if (this.localTypeName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localTypeName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localTypeNamespaceTracker) { - namespace = "http://dom.w3c.org/xsd"; - writeStartElement(null, namespace, "typeNamespace", xmlWriter); - - - if (this.localTypeNamespace == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localTypeNamespace); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://dom.w3c.org/xsd")) { - return "ns23"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localTypeNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "typeName")); - - elementList.add(this.localTypeName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTypeName)); - } - if (this.localTypeNamespaceTracker) { - elementList.add(new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "typeNamespace")); - - elementList.add(this.localTypeNamespace == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTypeNamespace)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static TypeInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TypeInfo object = null; - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"TypeInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TypeInfo) org.apache.axis2.transaction.xsd.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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://dom.w3c.org/xsd", "typeName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setTypeName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://dom.w3c.org/xsd", - "typeNamespace").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setTypeNamespace(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Action_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Action_type0.java deleted file mode 100644 index 12cc64fb2..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Action_type0.java +++ /dev/null @@ -1,459 +0,0 @@ - -/** - * Action_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * Action_type0 bean class - */ - -public class Action_type0 implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 4388877590084978361L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "action_type0", "ns1"); - - - - /** - * field for Action_type0 - */ - - - protected java.lang.String localAction_type0; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected Action_type0(final java.lang.String value, final boolean isRegisterValue) { - this.localAction_type0 = value; - if (isRegisterValue) { - - _table_.put(this.localAction_type0, this); - - } - - } - - public static final java.lang.String _cancel = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("cancel"); - - public static final java.lang.String _retry = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("retry"); - - public static final java.lang.String _fault = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("fault"); - - public static final Action_type0 cancel = new Action_type0(_cancel, true); - - public static final Action_type0 retry = new Action_type0(_retry, true); - - public static final Action_type0 fault = new Action_type0(_fault, true); - - - public java.lang.String getValue() { - return this.localAction_type0; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localAction_type0.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":action_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "action_type0", xmlWriter); - } - } - - if (this.localAction_type0 == null) { - - throw new org.apache.axis2.databinding.ADBException("action_type0 cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localAction_type0); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localAction_type0)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static Action_type0 fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final Action_type0 enumeration = (Action_type0) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static Action_type0 fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static Action_type0 fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return Action_type0.Factory.fromString(content, namespaceUri); - } else { - return Action_type0.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 Action_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - Action_type0 object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = Action_type0.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 = Action_type0.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Action_type1.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Action_type1.java deleted file mode 100644 index 9277b0526..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Action_type1.java +++ /dev/null @@ -1,459 +0,0 @@ - -/** - * Action_type1.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * Action_type1 bean class - */ - -public class Action_type1 implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8353099972283390630L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "action_type1", "ns1"); - - - - /** - * field for Action_type0 - */ - - - protected java.lang.String localAction_type0; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected Action_type1(final java.lang.String value, final boolean isRegisterValue) { - this.localAction_type0 = value; - if (isRegisterValue) { - - _table_.put(this.localAction_type0, this); - - } - - } - - public static final java.lang.String _cancel = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("cancel"); - - public static final java.lang.String _retry = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("retry"); - - public static final java.lang.String _fault = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("fault"); - - public static final Action_type1 cancel = new Action_type1(_cancel, true); - - public static final Action_type1 retry = new Action_type1(_retry, true); - - public static final Action_type1 fault = new Action_type1(_fault, true); - - - public java.lang.String getValue() { - return this.localAction_type0; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localAction_type0.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":action_type1", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "action_type1", xmlWriter); - } - } - - if (this.localAction_type0 == null) { - - throw new org.apache.axis2.databinding.ADBException("action_type0 cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localAction_type0); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localAction_type0)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static Action_type1 fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final Action_type1 enumeration = (Action_type1) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static Action_type1 fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static Action_type1 fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return Action_type1.Factory.fromString(content, namespaceUri); - } else { - return Action_type1.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 Action_type1 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - Action_type1 object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = Action_type1.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 = Action_type1.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivateProcessIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivateProcessIn.java deleted file mode 100644 index 456614c8d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivateProcessIn.java +++ /dev/null @@ -1,464 +0,0 @@ - -/** - * ActivateProcessIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ActivateProcessIn bean class - */ - -public class ActivateProcessIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 3860406421382871502L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "activateProcessIn", "ns1"); - - - - /** - * field for Pid - */ - - - protected javax.xml.namespace.QName localPid; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final javax.xml.namespace.QName param) { - - this.localPid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":activateProcessIn", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "activateProcessIn", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - writeQName(this.localPid, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ActivateProcessIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ActivateProcessIn object = new ActivateProcessIn(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"activateProcessIn".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ActivateProcessIn) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivitiesWithEvents_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivitiesWithEvents_type0.java deleted file mode 100644 index cd88b56f5..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivitiesWithEvents_type0.java +++ /dev/null @@ -1,538 +0,0 @@ - -/** - * ActivitiesWithEvents_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ActivitiesWithEvents_type0 bean class - */ - -public class ActivitiesWithEvents_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = activitiesWithEvents_type0 - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -4522449658986485460L; - - /** - * field for ActivityInfoWithEvents This was an Array! - */ - - - protected org.wso2.bps.management.schema.ActivityInfoWithEventsType[] localActivityInfoWithEvents; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActivityInfoWithEventsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ActivityInfoWithEventsType[] - */ - public org.wso2.bps.management.schema.ActivityInfoWithEventsType[] getActivityInfoWithEvents() { - return this.localActivityInfoWithEvents; - } - - - - /** - * validate the array for ActivityInfoWithEvents - */ - protected void validateActivityInfoWithEvents(final org.wso2.bps.management.schema.ActivityInfoWithEventsType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ActivityInfoWithEvents - */ - public void setActivityInfoWithEvents(final org.wso2.bps.management.schema.ActivityInfoWithEventsType[] param) { - - validateActivityInfoWithEvents(param); - - this.localActivityInfoWithEventsTracker = param != null; - - this.localActivityInfoWithEvents = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.ActivityInfoWithEventsType - */ - public void addActivityInfoWithEvents(final org.wso2.bps.management.schema.ActivityInfoWithEventsType param) { - if (this.localActivityInfoWithEvents == null) { - this.localActivityInfoWithEvents = new org.wso2.bps.management.schema.ActivityInfoWithEventsType[] {}; - } - - - // update the setting tracker - this.localActivityInfoWithEventsTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localActivityInfoWithEvents); - list.add(param); - this.localActivityInfoWithEvents = - (org.wso2.bps.management.schema.ActivityInfoWithEventsType[]) list.toArray(new org.wso2.bps.management.schema.ActivityInfoWithEventsType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":activitiesWithEvents_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "activitiesWithEvents_type0", - xmlWriter); - } - - - } - if (this.localActivityInfoWithEventsTracker) { - if (this.localActivityInfoWithEvents != null) { - for (final ActivityInfoWithEventsType localActivityInfoWithEvent : this.localActivityInfoWithEvents) { - if (localActivityInfoWithEvent != null) { - localActivityInfoWithEvent.serialize(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/schema", "activityInfoWithEvents"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("activityInfoWithEvents cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localActivityInfoWithEventsTracker) { - if (this.localActivityInfoWithEvents != null) { - for (final ActivityInfoWithEventsType localActivityInfoWithEvent : this.localActivityInfoWithEvents) { - - if (localActivityInfoWithEvent != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityInfoWithEvents")); - elementList.add(localActivityInfoWithEvent); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("activityInfoWithEvents cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ActivitiesWithEvents_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ActivitiesWithEvents_type0 object = new ActivitiesWithEvents_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"activitiesWithEvents_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ActivitiesWithEvents_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityInfoWithEvents").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.ActivityInfoWithEventsType.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://wso2.org/bps/management/schema", - "activityInfoWithEvents").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.ActivityInfoWithEventsType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setActivityInfoWithEvents((org.wso2.bps.management.schema.ActivityInfoWithEventsType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.ActivityInfoWithEventsType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Activities_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Activities_type0.java deleted file mode 100644 index d02f3c7f2..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Activities_type0.java +++ /dev/null @@ -1,537 +0,0 @@ - -/** - * Activities_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * Activities_type0 bean class - */ - -public class Activities_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = activities_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 7445409949100119070L; - - /** - * field for ActivityInfo This was an Array! - */ - - - protected org.wso2.bps.management.schema.ActivityInfoType[] localActivityInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActivityInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ActivityInfoType[] - */ - public org.wso2.bps.management.schema.ActivityInfoType[] getActivityInfo() { - return this.localActivityInfo; - } - - - - /** - * validate the array for ActivityInfo - */ - protected void validateActivityInfo(final org.wso2.bps.management.schema.ActivityInfoType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ActivityInfo - */ - public void setActivityInfo(final org.wso2.bps.management.schema.ActivityInfoType[] param) { - - validateActivityInfo(param); - - this.localActivityInfoTracker = param != null; - - this.localActivityInfo = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.ActivityInfoType - */ - public void addActivityInfo(final org.wso2.bps.management.schema.ActivityInfoType param) { - if (this.localActivityInfo == null) { - this.localActivityInfo = new org.wso2.bps.management.schema.ActivityInfoType[] {}; - } - - - // update the setting tracker - this.localActivityInfoTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localActivityInfo); - list.add(param); - this.localActivityInfo = - (org.wso2.bps.management.schema.ActivityInfoType[]) list.toArray(new org.wso2.bps.management.schema.ActivityInfoType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":activities_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "activities_type0", - xmlWriter); - } - - - } - if (this.localActivityInfoTracker) { - if (this.localActivityInfo != null) { - for (final ActivityInfoType element : this.localActivityInfo) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityInfo"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("activityInfo cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localActivityInfoTracker) { - if (this.localActivityInfo != null) { - for (final ActivityInfoType element : this.localActivityInfo) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityInfo")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("activityInfo cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Activities_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Activities_type0 object = new Activities_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"activities_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Activities_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityInfo").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.ActivityInfoType.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://wso2.org/bps/management/schema", - "activityInfo").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.ActivityInfoType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setActivityInfo((org.wso2.bps.management.schema.ActivityInfoType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.ActivityInfoType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityInfoType.java deleted file mode 100644 index d4997e7fa..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityInfoType.java +++ /dev/null @@ -1,1104 +0,0 @@ - -/** - * ActivityInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ActivityInfoType bean class - */ - -public class ActivityInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ActivityInfoType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 5072654299462275373L; - - /** - * field for Name - */ - - - protected java.lang.String localName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - this.localNameTracker = param != null; - - this.localName = param; - - - } - - - /** - * field for Type - */ - - - protected java.lang.String localType; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getType() { - return this.localType; - } - - - - /** - * Auto generated setter method - * - * @param param Type - */ - public void setType(final java.lang.String param) { - - this.localType = param; - - - } - - - /** - * field for Aiid - */ - - - protected java.lang.String localAiid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getAiid() { - return this.localAiid; - } - - - - /** - * Auto generated setter method - * - * @param param Aiid - */ - public void setAiid(final java.lang.String param) { - - this.localAiid = param; - - - } - - - /** - * field for Status - */ - - - protected org.wso2.bps.management.schema.ActivityStatusType localStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ActivityStatusType - */ - public org.wso2.bps.management.schema.ActivityStatusType getStatus() { - return this.localStatus; - } - - - - /** - * Auto generated setter method - * - * @param param Status - */ - public void setStatus(final org.wso2.bps.management.schema.ActivityStatusType param) { - - this.localStatus = param; - - - } - - - /** - * field for DateEnabled - */ - - - protected java.util.Calendar localDateEnabled; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDateEnabledTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateEnabled() { - return this.localDateEnabled; - } - - - - /** - * Auto generated setter method - * - * @param param DateEnabled - */ - public void setDateEnabled(final java.util.Calendar param) { - this.localDateEnabledTracker = param != null; - - this.localDateEnabled = param; - - - } - - - /** - * field for DateStarted - */ - - - protected java.util.Calendar localDateStarted; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDateStartedTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateStarted() { - return this.localDateStarted; - } - - - - /** - * Auto generated setter method - * - * @param param DateStarted - */ - public void setDateStarted(final java.util.Calendar param) { - this.localDateStartedTracker = param != null; - - this.localDateStarted = param; - - - } - - - /** - * field for DateCompleted - */ - - - protected java.util.Calendar localDateCompleted; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDateCompletedTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateCompleted() { - return this.localDateCompleted; - } - - - - /** - * Auto generated setter method - * - * @param param DateCompleted - */ - public void setDateCompleted(final java.util.Calendar param) { - this.localDateCompletedTracker = param != null; - - this.localDateCompleted = param; - - - } - - - /** - * field for Datedied - */ - - - protected java.util.Calendar localDatedied; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDatediedTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDatedied() { - return this.localDatedied; - } - - - - /** - * Auto generated setter method - * - * @param param Datedied - */ - public void setDatedied(final java.util.Calendar param) { - this.localDatediedTracker = param != null; - - this.localDatedied = param; - - - } - - - /** - * field for Failure - */ - - - protected org.wso2.bps.management.schema.FailureInfoType localFailure; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFailureTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.FailureInfoType - */ - public org.wso2.bps.management.schema.FailureInfoType getFailure() { - return this.localFailure; - } - - - - /** - * Auto generated setter method - * - * @param param Failure - */ - public void setFailure(final org.wso2.bps.management.schema.FailureInfoType param) { - this.localFailureTracker = param != null; - - this.localFailure = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ActivityInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ActivityInfoType", - xmlWriter); - } - - - } - if (this.localNameTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - } - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "type", xmlWriter); - - - if (this.localType == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("type cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localType); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "aiid", xmlWriter); - - - if (this.localAiid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("aiid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localAiid); - - } - - xmlWriter.writeEndElement(); - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - this.localStatus.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status"), - xmlWriter); - if (this.localDateEnabledTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateEnabled", xmlWriter); - - - if (this.localDateEnabled == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateEnabled cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateEnabled)); - - } - - xmlWriter.writeEndElement(); - } - if (this.localDateStartedTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateStarted", xmlWriter); - - - if (this.localDateStarted == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateStarted cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateStarted)); - - } - - xmlWriter.writeEndElement(); - } - if (this.localDateCompletedTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateCompleted", xmlWriter); - - - if (this.localDateCompleted == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateCompleted cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateCompleted)); - - } - - xmlWriter.writeEndElement(); - } - if (this.localDatediedTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "datedied", xmlWriter); - - - if (this.localDatedied == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("datedied cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDatedied)); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFailureTracker) { - if (this.localFailure == null) { - throw new org.apache.axis2.databinding.ADBException("failure cannot be null!!"); - } - this.localFailure.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "failure"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "name")); - - if (this.localName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "type")); - - if (this.localType != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } else { - throw new org.apache.axis2.databinding.ADBException("type cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "aiid")); - - if (this.localAiid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAiid)); - } else { - throw new org.apache.axis2.databinding.ADBException("aiid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status")); - - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - elementList.add(this.localStatus); - if (this.localDateEnabledTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateEnabled")); - - if (this.localDateEnabled != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateEnabled)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateEnabled cannot be null!!"); - } - } - if (this.localDateStartedTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateStarted")); - - if (this.localDateStarted != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateStarted)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateStarted cannot be null!!"); - } - } - if (this.localDateCompletedTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateCompleted")); - - if (this.localDateCompleted != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateCompleted)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateCompleted cannot be null!!"); - } - } - if (this.localDatediedTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "datedied")); - - if (this.localDatedied != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDatedied)); - } else { - throw new org.apache.axis2.databinding.ADBException("datedied cannot be null!!"); - } - } - if (this.localFailureTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "failure")); - - - if (this.localFailure == null) { - throw new org.apache.axis2.databinding.ADBException("failure cannot be null!!"); - } - elementList.add(this.localFailure); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ActivityInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ActivityInfoType object = new ActivityInfoType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ActivityInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ActivityInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "name").equals(reader.getName())) { - - final 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 { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "type").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setType(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "aiid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setAiid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "status").equals(reader.getName())) { - - object.setStatus(org.wso2.bps.management.schema.ActivityStatusType.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "dateEnabled").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateEnabled(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://wso2.org/bps/management/schema", - "dateStarted").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateStarted(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://wso2.org/bps/management/schema", - "dateCompleted").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateCompleted(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://wso2.org/bps/management/schema", - "datedied").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDatedied(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://wso2.org/bps/management/schema", - "failure").equals(reader.getName())) { - - object.setFailure(org.wso2.bps.management.schema.FailureInfoType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityInfoWithEventsType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityInfoWithEventsType.java deleted file mode 100644 index 9f1fe816e..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityInfoWithEventsType.java +++ /dev/null @@ -1,512 +0,0 @@ - -/** - * ActivityInfoWithEventsType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ActivityInfoWithEventsType bean class - */ - -public class ActivityInfoWithEventsType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ActivityInfoWithEventsType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -8824018493434194888L; - - /** - * field for ActivityInfo - */ - - - protected org.wso2.bps.management.schema.ActivityInfoType localActivityInfo; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ActivityInfoType - */ - public org.wso2.bps.management.schema.ActivityInfoType getActivityInfo() { - return this.localActivityInfo; - } - - - - /** - * Auto generated setter method - * - * @param param ActivityInfo - */ - public void setActivityInfo(final org.wso2.bps.management.schema.ActivityInfoType param) { - - this.localActivityInfo = param; - - - } - - - /** - * field for ActivityEventsList - */ - - - protected org.wso2.bps.management.schema.EventInfoList localActivityEventsList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActivityEventsListTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.EventInfoList - */ - public org.wso2.bps.management.schema.EventInfoList getActivityEventsList() { - return this.localActivityEventsList; - } - - - - /** - * Auto generated setter method - * - * @param param ActivityEventsList - */ - public void setActivityEventsList(final org.wso2.bps.management.schema.EventInfoList param) { - this.localActivityEventsListTracker = param != null; - - this.localActivityEventsList = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ActivityInfoWithEventsType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ActivityInfoWithEventsType", - xmlWriter); - } - - - } - - if (this.localActivityInfo == null) { - throw new org.apache.axis2.databinding.ADBException("activityInfo cannot be null!!"); - } - this.localActivityInfo.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityInfo"), xmlWriter); - if (this.localActivityEventsListTracker) { - if (this.localActivityEventsList == null) { - throw new org.apache.axis2.databinding.ADBException("activityEventsList cannot be null!!"); - } - this.localActivityEventsList.serialize(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/schema", "activityEventsList"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "activityInfo")); - - - if (this.localActivityInfo == null) { - throw new org.apache.axis2.databinding.ADBException("activityInfo cannot be null!!"); - } - elementList.add(this.localActivityInfo); - if (this.localActivityEventsListTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityEventsList")); - - - if (this.localActivityEventsList == null) { - throw new org.apache.axis2.databinding.ADBException("activityEventsList cannot be null!!"); - } - elementList.add(this.localActivityEventsList); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ActivityInfoWithEventsType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ActivityInfoWithEventsType object = new ActivityInfoWithEventsType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ActivityInfoWithEventsType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ActivityInfoWithEventsType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityInfo").equals(reader.getName())) { - - object.setActivityInfo(org.wso2.bps.management.schema.ActivityInfoType.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activityEventsList").equals(reader.getName())) { - - object.setActivityEventsList(org.wso2.bps.management.schema.EventInfoList.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEvents.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEvents.java deleted file mode 100644 index e6afed52c..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEvents.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * ActivityLifeCycleEvents.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ActivityLifeCycleEvents bean class - */ - -public class ActivityLifeCycleEvents implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 472937713614896221L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ActivityLifeCycleEvents", "ns1"); - - - - /** - * field for ActivityLifeCycleEvents - */ - - - protected org.wso2.bps.management.schema.ActivityLifeCycleEventsType localActivityLifeCycleEvents; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ActivityLifeCycleEventsType - */ - public org.wso2.bps.management.schema.ActivityLifeCycleEventsType getActivityLifeCycleEvents() { - return this.localActivityLifeCycleEvents; - } - - - - /** - * Auto generated setter method - * - * @param param ActivityLifeCycleEvents - */ - public void setActivityLifeCycleEvents(final org.wso2.bps.management.schema.ActivityLifeCycleEventsType param) { - - this.localActivityLifeCycleEvents = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localActivityLifeCycleEvents == null) { - throw new org.apache.axis2.databinding.ADBException("ActivityLifeCycleEvents cannot be null!"); - } - this.localActivityLifeCycleEvents.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localActivityLifeCycleEvents.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ActivityLifeCycleEvents parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ActivityLifeCycleEvents object = new ActivityLifeCycleEvents(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "ActivityLifeCycleEvents").equals(reader.getName())) { - - object.setActivityLifeCycleEvents(org.wso2.bps.management.schema.ActivityLifeCycleEventsType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEventsListType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEventsListType.java deleted file mode 100644 index 93833b578..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEventsListType.java +++ /dev/null @@ -1,537 +0,0 @@ - -/** - * ActivityLifeCycleEventsListType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ActivityLifeCycleEventsListType bean class - */ - -public class ActivityLifeCycleEventsListType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ActivityLifeCycleEventsListType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -8408305995808887198L; - - /** - * field for EventInfo This was an Array! - */ - - - protected org.wso2.bps.management.schema.EventInfo[] localEventInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEventInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.EventInfo[] - */ - public org.wso2.bps.management.schema.EventInfo[] getEventInfo() { - return this.localEventInfo; - } - - - - /** - * validate the array for EventInfo - */ - protected void validateEventInfo(final org.wso2.bps.management.schema.EventInfo[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param EventInfo - */ - public void setEventInfo(final org.wso2.bps.management.schema.EventInfo[] param) { - - validateEventInfo(param); - - this.localEventInfoTracker = param != null; - - this.localEventInfo = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.EventInfo - */ - public void addEventInfo(final org.wso2.bps.management.schema.EventInfo param) { - if (this.localEventInfo == null) { - this.localEventInfo = new org.wso2.bps.management.schema.EventInfo[] {}; - } - - - // update the setting tracker - this.localEventInfoTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localEventInfo); - list.add(param); - this.localEventInfo = - (org.wso2.bps.management.schema.EventInfo[]) list.toArray(new org.wso2.bps.management.schema.EventInfo[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ActivityLifeCycleEventsListType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "ActivityLifeCycleEventsListType", xmlWriter); - } - - - } - if (this.localEventInfoTracker) { - if (this.localEventInfo != null) { - for (final EventInfo element : this.localEventInfo) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "event-info"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("event-info cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localEventInfoTracker) { - if (this.localEventInfo != null) { - for (final EventInfo element : this.localEventInfo) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "event-info")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("event-info cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ActivityLifeCycleEventsListType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ActivityLifeCycleEventsListType object = new ActivityLifeCycleEventsListType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ActivityLifeCycleEventsListType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ActivityLifeCycleEventsListType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "event-info").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.EventInfo.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://wso2.org/bps/management/schema", - "event-info").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.EventInfo.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setEventInfo((org.wso2.bps.management.schema.EventInfo[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.EventInfo.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEventsType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEventsType.java deleted file mode 100644 index ed41e95e1..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityLifeCycleEventsType.java +++ /dev/null @@ -1,605 +0,0 @@ - -/** - * ActivityLifeCycleEventsType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ActivityLifeCycleEventsType bean class - */ - -public class ActivityLifeCycleEventsType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ActivityLifeCycleEventsType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 2174799164037704730L; - - /** - * field for Iid - */ - - - protected java.lang.String localIid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final java.lang.String param) { - - this.localIid = param; - - - } - - - /** - * field for Pid - */ - - - protected java.lang.String localPid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final java.lang.String param) { - - this.localPid = param; - - - } - - - /** - * field for EventInfoList - */ - - - protected org.wso2.bps.management.schema.ActivityLifeCycleEventsListType localEventInfoList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEventInfoListTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ActivityLifeCycleEventsListType - */ - public org.wso2.bps.management.schema.ActivityLifeCycleEventsListType getEventInfoList() { - return this.localEventInfoList; - } - - - - /** - * Auto generated setter method - * - * @param param EventInfoList - */ - public void setEventInfoList(final org.wso2.bps.management.schema.ActivityLifeCycleEventsListType param) { - this.localEventInfoListTracker = param != null; - - this.localEventInfoList = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ActivityLifeCycleEventsType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "ActivityLifeCycleEventsType", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - - if (this.localIid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localIid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localPid); - - } - - xmlWriter.writeEndElement(); - if (this.localEventInfoListTracker) { - if (this.localEventInfoList == null) { - throw new org.apache.axis2.databinding.ADBException("eventInfoList cannot be null!!"); - } - this.localEventInfoList.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "eventInfoList"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - if (this.localIid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } else { - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - if (this.localEventInfoListTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "eventInfoList")); - - - if (this.localEventInfoList == null) { - throw new org.apache.axis2.databinding.ADBException("eventInfoList cannot be null!!"); - } - elementList.add(this.localEventInfoList); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ActivityLifeCycleEventsType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ActivityLifeCycleEventsType object = new ActivityLifeCycleEventsType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ActivityLifeCycleEventsType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ActivityLifeCycleEventsType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "eventInfoList").equals(reader.getName())) { - - object.setEventInfoList(org.wso2.bps.management.schema.ActivityLifeCycleEventsListType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityStatusType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityStatusType.java deleted file mode 100644 index 3566d2fec..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ActivityStatusType.java +++ /dev/null @@ -1,470 +0,0 @@ - -/** - * ActivityStatusType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ActivityStatusType bean class - */ - -public class ActivityStatusType implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -66371271190563709L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ActivityStatusType", "ns1"); - - - - /** - * field for ActivityStatusType - */ - - - protected java.lang.String localActivityStatusType; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected ActivityStatusType(final java.lang.String value, final boolean isRegisterValue) { - this.localActivityStatusType = value; - if (isRegisterValue) { - - _table_.put(this.localActivityStatusType, this); - - } - - } - - public static final java.lang.String _ENABLED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("ENABLED"); - - public static final java.lang.String _STARTED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("STARTED"); - - public static final java.lang.String _COMPLETED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COMPLETED"); - - public static final java.lang.String _FAILURE = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAILURE"); - - public static final java.lang.String _DEAD = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("DEAD"); - - public static final ActivityStatusType ENABLED = new ActivityStatusType(_ENABLED, true); - - public static final ActivityStatusType STARTED = new ActivityStatusType(_STARTED, true); - - public static final ActivityStatusType COMPLETED = new ActivityStatusType(_COMPLETED, true); - - public static final ActivityStatusType FAILURE = new ActivityStatusType(_FAILURE, true); - - public static final ActivityStatusType DEAD = new ActivityStatusType(_DEAD, true); - - - public java.lang.String getValue() { - return this.localActivityStatusType; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localActivityStatusType.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ActivityStatusType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ActivityStatusType", - xmlWriter); - } - } - - if (this.localActivityStatusType == null) { - - throw new org.apache.axis2.databinding.ADBException("ActivityStatusType cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localActivityStatusType); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localActivityStatusType)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static ActivityStatusType fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final ActivityStatusType enumeration = (ActivityStatusType) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static ActivityStatusType fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static ActivityStatusType fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return ActivityStatusType.Factory.fromString(content, namespaceUri); - } else { - return ActivityStatusType.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 ActivityStatusType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - ActivityStatusType object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = ActivityStatusType.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 = ActivityStatusType.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/BpelDefinition.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/BpelDefinition.java deleted file mode 100644 index ae8ddc8ef..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/BpelDefinition.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * BpelDefinition.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * BpelDefinition bean class - */ - -public class BpelDefinition implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = bpelDefinition Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -4639988684758858164L; - /** - * field for ExtraElement - */ - - - protected org.apache.axiom.om.OMElement localExtraElement; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getExtraElement() { - return this.localExtraElement; - } - - - - /** - * Auto generated setter method - * - * @param param ExtraElement - */ - public void setExtraElement(final org.apache.axiom.om.OMElement param) { - - this.localExtraElement = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":bpelDefinition", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "bpelDefinition", xmlWriter); - } - - - } - - - if (this.localExtraElement != null) { - this.localExtraElement.serialize(xmlWriter); - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - if (this.localExtraElement != null) { - elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); - elementList.add(this.localExtraElement); - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static BpelDefinition parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final BpelDefinition object = new BpelDefinition(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"bpelDefinition".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (BpelDefinition) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - - - // use the QName from the parser as the name for the builder - final javax.xml.namespace.QName startQname1 = reader.getName(); - - // We need to wrap the reader so that it produces a fake START_DOCUMENT event - // this is needed by the builder classes - final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = - new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( - new org.apache.axis2.util.StreamWrapper(reader), startQname1); - object.setExtraElement(builder1.getOMElement()); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ChildrenWithEvents_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ChildrenWithEvents_type0.java deleted file mode 100644 index e6566b357..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ChildrenWithEvents_type0.java +++ /dev/null @@ -1,538 +0,0 @@ - -/** - * ChildrenWithEvents_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ChildrenWithEvents_type0 bean class - */ - -public class ChildrenWithEvents_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = childrenWithEvents_type0 - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -6379632616202833765L; - - /** - * field for ChildWithEventsRef This was an Array! - */ - - - protected org.wso2.bps.management.schema.ScopeInfoWithEventsType[] localChildWithEventsRef; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localChildWithEventsRefTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ScopeInfoWithEventsType[] - */ - public org.wso2.bps.management.schema.ScopeInfoWithEventsType[] getChildWithEventsRef() { - return this.localChildWithEventsRef; - } - - - - /** - * validate the array for ChildWithEventsRef - */ - protected void validateChildWithEventsRef(final org.wso2.bps.management.schema.ScopeInfoWithEventsType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ChildWithEventsRef - */ - public void setChildWithEventsRef(final org.wso2.bps.management.schema.ScopeInfoWithEventsType[] param) { - - validateChildWithEventsRef(param); - - this.localChildWithEventsRefTracker = param != null; - - this.localChildWithEventsRef = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.ScopeInfoWithEventsType - */ - public void addChildWithEventsRef(final org.wso2.bps.management.schema.ScopeInfoWithEventsType param) { - if (this.localChildWithEventsRef == null) { - this.localChildWithEventsRef = new org.wso2.bps.management.schema.ScopeInfoWithEventsType[] {}; - } - - - // update the setting tracker - this.localChildWithEventsRefTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localChildWithEventsRef); - list.add(param); - this.localChildWithEventsRef = - (org.wso2.bps.management.schema.ScopeInfoWithEventsType[]) list.toArray(new org.wso2.bps.management.schema.ScopeInfoWithEventsType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":childrenWithEvents_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "childrenWithEvents_type0", - xmlWriter); - } - - - } - if (this.localChildWithEventsRefTracker) { - if (this.localChildWithEventsRef != null) { - for (final ScopeInfoWithEventsType element : this.localChildWithEventsRef) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "childWithEventsRef"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("childWithEventsRef cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localChildWithEventsRefTracker) { - if (this.localChildWithEventsRef != null) { - for (final ScopeInfoWithEventsType element : this.localChildWithEventsRef) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "childWithEventsRef")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("childWithEventsRef cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ChildrenWithEvents_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ChildrenWithEvents_type0 object = new ChildrenWithEvents_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"childrenWithEvents_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ChildrenWithEvents_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "childWithEventsRef").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.ScopeInfoWithEventsType.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://wso2.org/bps/management/schema", - "childWithEventsRef").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.ScopeInfoWithEventsType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setChildWithEventsRef((org.wso2.bps.management.schema.ScopeInfoWithEventsType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.ScopeInfoWithEventsType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Children_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Children_type0.java deleted file mode 100644 index 9db814a44..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Children_type0.java +++ /dev/null @@ -1,536 +0,0 @@ - -/** - * Children_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * Children_type0 bean class - */ - -public class Children_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = children_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -5501650273900667803L; - - /** - * field for ChildRef This was an Array! - */ - - - protected org.wso2.bps.management.schema.ScopeInfoType[] localChildRef; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localChildRefTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ScopeInfoType[] - */ - public org.wso2.bps.management.schema.ScopeInfoType[] getChildRef() { - return this.localChildRef; - } - - - - /** - * validate the array for ChildRef - */ - protected void validateChildRef(final org.wso2.bps.management.schema.ScopeInfoType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ChildRef - */ - public void setChildRef(final org.wso2.bps.management.schema.ScopeInfoType[] param) { - - validateChildRef(param); - - this.localChildRefTracker = param != null; - - this.localChildRef = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.ScopeInfoType - */ - public void addChildRef(final org.wso2.bps.management.schema.ScopeInfoType param) { - if (this.localChildRef == null) { - this.localChildRef = new org.wso2.bps.management.schema.ScopeInfoType[] {}; - } - - - // update the setting tracker - this.localChildRefTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localChildRef); - list.add(param); - this.localChildRef = - (org.wso2.bps.management.schema.ScopeInfoType[]) list.toArray(new org.wso2.bps.management.schema.ScopeInfoType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":children_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "children_type0", xmlWriter); - } - - - } - if (this.localChildRefTracker) { - if (this.localChildRef != null) { - for (final ScopeInfoType element : this.localChildRef) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "childRef"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("childRef cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localChildRefTracker) { - if (this.localChildRef != null) { - for (final ScopeInfoType element : this.localChildRef) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "childRef")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("childRef cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Children_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Children_type0 object = new Children_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"children_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Children_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "childRef").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.ScopeInfoType.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://wso2.org/bps/management/schema", - "childRef").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.ScopeInfoType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setChildRef((org.wso2.bps.management.schema.ScopeInfoType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.ScopeInfoType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationPropertyType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationPropertyType.java deleted file mode 100644 index 15313565a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationPropertyType.java +++ /dev/null @@ -1,607 +0,0 @@ - -/** - * CorrelationPropertyType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * CorrelationPropertyType bean class - */ - -public class CorrelationPropertyType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = CorrelationPropertyType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 5735747781258041450L; - /** - * field for String - */ - - - protected java.lang.String localString; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getString() { - return this.localString; - } - - - - /** - * Auto generated setter method - * - * @param param String - */ - public void setString(final java.lang.String param) { - - this.localString = param; - - - } - - - @Override - public java.lang.String toString() { - - return this.localString.toString(); - - } - - - /** - * field for Csetid This was an Attribute! - */ - - - protected java.lang.String localCsetid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCsetid() { - return this.localCsetid; - } - - - - /** - * Auto generated setter method - * - * @param param Csetid - */ - public void setCsetid(final java.lang.String param) { - - this.localCsetid = param; - - - } - - - /** - * field for PropertyName This was an Attribute! - */ - - - protected javax.xml.namespace.QName localPropertyName; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getPropertyName() { - return this.localPropertyName; - } - - - - /** - * Auto generated setter method - * - * @param param PropertyName - */ - public void setPropertyName(final javax.xml.namespace.QName param) { - - this.localPropertyName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":CorrelationPropertyType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "CorrelationPropertyType", - xmlWriter); - } - - - } - - if (this.localCsetid != null) { - - writeAttribute("", "csetid", - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCsetid), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localCsetid is null"); - } - - if (this.localPropertyName != null) { - - writeQNameAttribute("", "propertyName", this.localPropertyName, xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localPropertyName is null"); - } - - - if (this.localString == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("string cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localString); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - - elementList.add(org.apache.axis2.databinding.utils.reader.ADBXMLStreamReader.ELEMENT_TEXT); - - if (this.localString != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localString)); - } else { - throw new org.apache.axis2.databinding.ADBException("string cannot be null!!"); - } - - attribList.add(new javax.xml.namespace.QName("", "csetid")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCsetid)); - - attribList.add(new javax.xml.namespace.QName("", "propertyName")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPropertyName)); - - - return 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 CorrelationPropertyType fromString(final java.lang.String value, - final java.lang.String namespaceURI) { - final CorrelationPropertyType returnValue = new CorrelationPropertyType(); - - returnValue.setString(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - return returnValue; - } - - public static CorrelationPropertyType fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return CorrelationPropertyType.Factory.fromString(content, namespaceUri); - } else { - return CorrelationPropertyType.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 CorrelationPropertyType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final CorrelationPropertyType object = new CorrelationPropertyType(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"CorrelationPropertyType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CorrelationPropertyType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // handle attribute "csetid" - final java.lang.String tempAttribCsetid = - - reader.getAttributeValue(null, "csetid"); - - if (tempAttribCsetid != null) { - final java.lang.String content = tempAttribCsetid; - - object.setCsetid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribCsetid)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute csetid is missing"); - - } - handledAttributes.add("csetid"); - - // handle attribute "propertyName" - final java.lang.String tempAttribPropertyName = - - reader.getAttributeValue(null, "propertyName"); - - if (tempAttribPropertyName != null) { - final java.lang.String content = tempAttribPropertyName; - - final int index = tempAttribPropertyName.indexOf(":"); - if (index > -1) { - prefix = tempAttribPropertyName.substring(0, index); - } else { - // i.e this is in default namesace - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - - object.setPropertyName(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(tempAttribPropertyName, - namespaceuri)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute propertyName is missing"); - - } - handledAttributes.add("propertyName"); - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - if (reader.isStartElement() || reader.hasText()) { - - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSet_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSet_type0.java deleted file mode 100644 index 0a627ec53..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSet_type0.java +++ /dev/null @@ -1,670 +0,0 @@ - -/** - * CorrelationSet_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * CorrelationSet_type0 bean class - */ - -public class CorrelationSet_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = correlationSet_type0 Namespace - * URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 6256187781417288738L; - - /** - * field for CorrelationProperty This was an Array! - */ - - - protected org.wso2.bps.management.schema.CorrelationPropertyType[] localCorrelationProperty; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCorrelationPropertyTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.CorrelationPropertyType[] - */ - public org.wso2.bps.management.schema.CorrelationPropertyType[] getCorrelationProperty() { - return this.localCorrelationProperty; - } - - - - /** - * validate the array for CorrelationProperty - */ - protected void validateCorrelationProperty(final org.wso2.bps.management.schema.CorrelationPropertyType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param CorrelationProperty - */ - public void setCorrelationProperty(final org.wso2.bps.management.schema.CorrelationPropertyType[] param) { - - validateCorrelationProperty(param); - - this.localCorrelationPropertyTracker = param != null; - - this.localCorrelationProperty = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.CorrelationPropertyType - */ - public void addCorrelationProperty(final org.wso2.bps.management.schema.CorrelationPropertyType param) { - if (this.localCorrelationProperty == null) { - this.localCorrelationProperty = new org.wso2.bps.management.schema.CorrelationPropertyType[] {}; - } - - - // update the setting tracker - this.localCorrelationPropertyTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localCorrelationProperty); - list.add(param); - this.localCorrelationProperty = - (org.wso2.bps.management.schema.CorrelationPropertyType[]) list.toArray(new org.wso2.bps.management.schema.CorrelationPropertyType[list.size()]); - - } - - - /** - * field for Name This was an Attribute! - */ - - - protected java.lang.String localName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - - this.localName = param; - - - } - - - /** - * field for Csetid This was an Attribute! - */ - - - protected java.lang.String localCsetid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCsetid() { - return this.localCsetid; - } - - - - /** - * Auto generated setter method - * - * @param param Csetid - */ - public void setCsetid(final java.lang.String param) { - - this.localCsetid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":correlationSet_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "correlationSet_type0", - xmlWriter); - } - - - } - - if (this.localName != null) { - - writeAttribute("", "name", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localName is null"); - } - - if (this.localCsetid != null) { - - writeAttribute("", "csetid", - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCsetid), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localCsetid is null"); - } - if (this.localCorrelationPropertyTracker) { - if (this.localCorrelationProperty != null) { - for (final CorrelationPropertyType element : this.localCorrelationProperty) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationProperty"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationProperty cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localCorrelationPropertyTracker) { - if (this.localCorrelationProperty != null) { - for (final CorrelationPropertyType element : this.localCorrelationProperty) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationProperty")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationProperty cannot be null!!"); - - } - - } - attribList.add(new javax.xml.namespace.QName("", "name")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - - attribList.add(new javax.xml.namespace.QName("", "csetid")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCsetid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static CorrelationSet_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final CorrelationSet_type0 object = new CorrelationSet_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"correlationSet_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CorrelationSet_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // handle attribute "name" - final java.lang.String tempAttribName = - - reader.getAttributeValue(null, "name"); - - if (tempAttribName != null) { - final java.lang.String content = tempAttribName; - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribName)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute name is missing"); - - } - handledAttributes.add("name"); - - // handle attribute "csetid" - final java.lang.String tempAttribCsetid = - - reader.getAttributeValue(null, "csetid"); - - if (tempAttribCsetid != null) { - final java.lang.String content = tempAttribCsetid; - - object.setCsetid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribCsetid)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute csetid is missing"); - - } - handledAttributes.add("csetid"); - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationProperty").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.CorrelationPropertyType.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://wso2.org/bps/management/schema", - "correlationProperty").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.CorrelationPropertyType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCorrelationProperty((org.wso2.bps.management.schema.CorrelationPropertyType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.CorrelationPropertyType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSet_type1.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSet_type1.java deleted file mode 100644 index faada1524..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSet_type1.java +++ /dev/null @@ -1,670 +0,0 @@ - -/** - * CorrelationSet_type1.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * CorrelationSet_type1 bean class - */ - -public class CorrelationSet_type1 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = correlationSet_type1 Namespace - * URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -1416852611496067895L; - - /** - * field for CorrelationProperty This was an Array! - */ - - - protected org.wso2.bps.management.schema.CorrelationPropertyType[] localCorrelationProperty; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCorrelationPropertyTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.CorrelationPropertyType[] - */ - public org.wso2.bps.management.schema.CorrelationPropertyType[] getCorrelationProperty() { - return this.localCorrelationProperty; - } - - - - /** - * validate the array for CorrelationProperty - */ - protected void validateCorrelationProperty(final org.wso2.bps.management.schema.CorrelationPropertyType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param CorrelationProperty - */ - public void setCorrelationProperty(final org.wso2.bps.management.schema.CorrelationPropertyType[] param) { - - validateCorrelationProperty(param); - - this.localCorrelationPropertyTracker = param != null; - - this.localCorrelationProperty = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.CorrelationPropertyType - */ - public void addCorrelationProperty(final org.wso2.bps.management.schema.CorrelationPropertyType param) { - if (this.localCorrelationProperty == null) { - this.localCorrelationProperty = new org.wso2.bps.management.schema.CorrelationPropertyType[] {}; - } - - - // update the setting tracker - this.localCorrelationPropertyTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localCorrelationProperty); - list.add(param); - this.localCorrelationProperty = - (org.wso2.bps.management.schema.CorrelationPropertyType[]) list.toArray(new org.wso2.bps.management.schema.CorrelationPropertyType[list.size()]); - - } - - - /** - * field for Name This was an Attribute! - */ - - - protected java.lang.String localName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - - this.localName = param; - - - } - - - /** - * field for Csetid This was an Attribute! - */ - - - protected java.lang.String localCsetid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCsetid() { - return this.localCsetid; - } - - - - /** - * Auto generated setter method - * - * @param param Csetid - */ - public void setCsetid(final java.lang.String param) { - - this.localCsetid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":correlationSet_type1", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "correlationSet_type1", - xmlWriter); - } - - - } - - if (this.localName != null) { - - writeAttribute("", "name", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localName is null"); - } - - if (this.localCsetid != null) { - - writeAttribute("", "csetid", - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCsetid), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localCsetid is null"); - } - if (this.localCorrelationPropertyTracker) { - if (this.localCorrelationProperty != null) { - for (final CorrelationPropertyType element : this.localCorrelationProperty) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationProperty"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationProperty cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localCorrelationPropertyTracker) { - if (this.localCorrelationProperty != null) { - for (final CorrelationPropertyType element : this.localCorrelationProperty) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationProperty")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationProperty cannot be null!!"); - - } - - } - attribList.add(new javax.xml.namespace.QName("", "name")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - - attribList.add(new javax.xml.namespace.QName("", "csetid")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCsetid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static CorrelationSet_type1 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final CorrelationSet_type1 object = new CorrelationSet_type1(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"correlationSet_type1".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CorrelationSet_type1) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // handle attribute "name" - final java.lang.String tempAttribName = - - reader.getAttributeValue(null, "name"); - - if (tempAttribName != null) { - final java.lang.String content = tempAttribName; - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribName)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute name is missing"); - - } - handledAttributes.add("name"); - - // handle attribute "csetid" - final java.lang.String tempAttribCsetid = - - reader.getAttributeValue(null, "csetid"); - - if (tempAttribCsetid != null) { - final java.lang.String content = tempAttribCsetid; - - object.setCsetid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribCsetid)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute csetid is missing"); - - } - handledAttributes.add("csetid"); - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationProperty").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.CorrelationPropertyType.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://wso2.org/bps/management/schema", - "correlationProperty").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.CorrelationPropertyType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCorrelationProperty((org.wso2.bps.management.schema.CorrelationPropertyType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.CorrelationPropertyType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSets_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSets_type0.java deleted file mode 100644 index e160e365f..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSets_type0.java +++ /dev/null @@ -1,532 +0,0 @@ - -/** - * CorrelationSets_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * CorrelationSets_type0 bean class - */ - -public class CorrelationSets_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = correlationSets_type0 Namespace - * URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 2066255255412278230L; - /** - * field for CorrelationSet This was an Array! - */ - - - protected org.wso2.bps.management.schema.CorrelationSet_type0[] localCorrelationSet; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.CorrelationSet_type0[] - */ - public org.wso2.bps.management.schema.CorrelationSet_type0[] getCorrelationSet() { - return this.localCorrelationSet; - } - - - - /** - * validate the array for CorrelationSet - */ - protected void validateCorrelationSet(final org.wso2.bps.management.schema.CorrelationSet_type0[] param) { - - if (param != null && param.length < 1) { - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * - * @param param CorrelationSet - */ - public void setCorrelationSet(final org.wso2.bps.management.schema.CorrelationSet_type0[] param) { - - validateCorrelationSet(param); - - - this.localCorrelationSet = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.CorrelationSet_type0 - */ - public void addCorrelationSet(final org.wso2.bps.management.schema.CorrelationSet_type0 param) { - if (this.localCorrelationSet == null) { - this.localCorrelationSet = new org.wso2.bps.management.schema.CorrelationSet_type0[] {}; - } - - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localCorrelationSet); - list.add(param); - this.localCorrelationSet = - (org.wso2.bps.management.schema.CorrelationSet_type0[]) list.toArray(new org.wso2.bps.management.schema.CorrelationSet_type0[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":correlationSets_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "correlationSets_type0", - xmlWriter); - } - - - } - - if (this.localCorrelationSet != null) { - for (final CorrelationSet_type0 element : this.localCorrelationSet) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationSet"), xmlWriter); - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationSet cannot be null!!"); - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationSet cannot be null!!"); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - if (this.localCorrelationSet != null) { - for (final CorrelationSet_type0 element : this.localCorrelationSet) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationSet")); - elementList.add(element); - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationSet cannot be null !!"); - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationSet cannot be null!!"); - - } - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static CorrelationSets_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final CorrelationSets_type0 object = new CorrelationSets_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"correlationSets_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CorrelationSets_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationSet").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.CorrelationSet_type0.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://wso2.org/bps/management/schema", - "correlationSet").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.CorrelationSet_type0.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCorrelationSet((org.wso2.bps.management.schema.CorrelationSet_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.CorrelationSet_type0.class, - list1)); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSets_type1.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSets_type1.java deleted file mode 100644 index 8ebd9c120..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/CorrelationSets_type1.java +++ /dev/null @@ -1,532 +0,0 @@ - -/** - * CorrelationSets_type1.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * CorrelationSets_type1 bean class - */ - -public class CorrelationSets_type1 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = correlationSets_type1 Namespace - * URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 5086046504491750443L; - /** - * field for CorrelationSet This was an Array! - */ - - - protected org.wso2.bps.management.schema.CorrelationSet_type1[] localCorrelationSet; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.CorrelationSet_type1[] - */ - public org.wso2.bps.management.schema.CorrelationSet_type1[] getCorrelationSet() { - return this.localCorrelationSet; - } - - - - /** - * validate the array for CorrelationSet - */ - protected void validateCorrelationSet(final org.wso2.bps.management.schema.CorrelationSet_type1[] param) { - - if (param != null && param.length < 1) { - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * - * @param param CorrelationSet - */ - public void setCorrelationSet(final org.wso2.bps.management.schema.CorrelationSet_type1[] param) { - - validateCorrelationSet(param); - - - this.localCorrelationSet = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.CorrelationSet_type1 - */ - public void addCorrelationSet(final org.wso2.bps.management.schema.CorrelationSet_type1 param) { - if (this.localCorrelationSet == null) { - this.localCorrelationSet = new org.wso2.bps.management.schema.CorrelationSet_type1[] {}; - } - - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localCorrelationSet); - list.add(param); - this.localCorrelationSet = - (org.wso2.bps.management.schema.CorrelationSet_type1[]) list.toArray(new org.wso2.bps.management.schema.CorrelationSet_type1[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":correlationSets_type1", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "correlationSets_type1", - xmlWriter); - } - - - } - - if (this.localCorrelationSet != null) { - for (final CorrelationSet_type1 element : this.localCorrelationSet) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationSet"), xmlWriter); - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationSet cannot be null!!"); - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationSet cannot be null!!"); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - if (this.localCorrelationSet != null) { - for (final CorrelationSet_type1 element : this.localCorrelationSet) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationSet")); - elementList.add(element); - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationSet cannot be null !!"); - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("correlationSet cannot be null!!"); - - } - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static CorrelationSets_type1 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final CorrelationSets_type1 object = new CorrelationSets_type1(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"correlationSets_type1".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (CorrelationSets_type1) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationSet").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.CorrelationSet_type1.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://wso2.org/bps/management/schema", - "correlationSet").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.CorrelationSet_type1.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setCorrelationSet((org.wso2.bps.management.schema.CorrelationSet_type1[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.CorrelationSet_type1.class, - list1)); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Data_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Data_type0.java deleted file mode 100644 index c9fccc98f..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Data_type0.java +++ /dev/null @@ -1,526 +0,0 @@ - -/** - * Data_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - -import org.apache.axiom.om.OMElement; - -/** - * Data_type0 bean class - */ - -public class Data_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = data_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 8807540169735949113L; - - /** - * field for ExtraElement This was an Array! - */ - - - protected org.apache.axiom.om.OMElement[] localExtraElement; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtraElementTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement[] - */ - public org.apache.axiom.om.OMElement[] getExtraElement() { - return this.localExtraElement; - } - - - - /** - * validate the array for ExtraElement - */ - protected void validateExtraElement(final org.apache.axiom.om.OMElement[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ExtraElement - */ - public void setExtraElement(final org.apache.axiom.om.OMElement[] param) { - - validateExtraElement(param); - - this.localExtraElementTracker = param != null; - - this.localExtraElement = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axiom.om.OMElement - */ - public void addExtraElement(final org.apache.axiom.om.OMElement param) { - if (this.localExtraElement == null) { - this.localExtraElement = new org.apache.axiom.om.OMElement[] {}; - } - - - // update the setting tracker - this.localExtraElementTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtraElement); - list.add(param); - this.localExtraElement = - (org.apache.axiom.om.OMElement[]) list.toArray(new org.apache.axiom.om.OMElement[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":data_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "data_type0", xmlWriter); - } - - - } - if (this.localExtraElementTracker) { - - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - element.serialize(xmlWriter); - } else { - - // we have to do nothing since minOccures zero - - } - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localExtraElementTracker) { - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - elementList.add(new javax.xml.namespace.QName("", "extraElement")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - // have to do nothing - - } - - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Data_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Data_type0 object = new Data_type0(); - - int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"data_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Data_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - - - // Process the array and step past its final element's end. - - boolean loopDone1 = false; - - while (!loopDone1) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) { - - // We need to wrap the reader so that it produces a fake START_DOCUEMENT event - final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = - new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( - new org.apache.axis2.util.StreamWrapper(reader), reader.getName()); - - list1.add(builder1.getOMElement()); - reader.next(); - if (reader.isEndElement()) { - // we have two countinuos end elements - loopDone1 = true; - } - - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event) { - loopDone1 = true; - } else { - reader.next(); - } - - } - - - object.setExtraElement((org.apache.axiom.om.OMElement[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.apache.axiom.om.OMElement.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DefinitionInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DefinitionInfo.java deleted file mode 100644 index 3068e86ad..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DefinitionInfo.java +++ /dev/null @@ -1,526 +0,0 @@ - -/** - * DefinitionInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DefinitionInfo bean class - */ - -public class DefinitionInfo implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = DefinitionInfo Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 1810652078208704713L; - /** - * field for ProcessName - */ - - - protected javax.xml.namespace.QName localProcessName; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getProcessName() { - return this.localProcessName; - } - - - - /** - * Auto generated setter method - * - * @param param ProcessName - */ - public void setProcessName(final javax.xml.namespace.QName param) { - - this.localProcessName = param; - - - } - - - /** - * field for Definition - */ - - - protected org.wso2.bps.management.schema.BpelDefinition localDefinition; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.BpelDefinition - */ - public org.wso2.bps.management.schema.BpelDefinition getDefinition() { - return this.localDefinition; - } - - - - /** - * Auto generated setter method - * - * @param param Definition - */ - public void setDefinition(final org.wso2.bps.management.schema.BpelDefinition param) { - - this.localDefinition = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":DefinitionInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "DefinitionInfo", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "ProcessName", xmlWriter); - - - if (this.localProcessName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("ProcessName cannot be null!!"); - - } else { - - - writeQName(this.localProcessName, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - if (this.localDefinition == null) { - throw new org.apache.axis2.databinding.ADBException("Definition cannot be null!!"); - } - this.localDefinition.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "Definition"), xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ProcessName")); - - if (this.localProcessName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localProcessName)); - } else { - throw new org.apache.axis2.databinding.ADBException("ProcessName cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "Definition")); - - - if (this.localDefinition == null) { - throw new org.apache.axis2.databinding.ADBException("Definition cannot be null!!"); - } - elementList.add(this.localDefinition); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DefinitionInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DefinitionInfo object = new DefinitionInfo(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"DefinitionInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DefinitionInfo) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "ProcessName").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setProcessName(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "Definition").equals(reader.getName())) { - - object.setDefinition(org.wso2.bps.management.schema.BpelDefinition.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstance.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstance.java deleted file mode 100644 index efe06b6a0..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstance.java +++ /dev/null @@ -1,446 +0,0 @@ - -/** - * DeleteInstance.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeleteInstance bean class - */ - -public class DeleteInstance implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 5541691965963290234L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deleteInstance", "ns1"); - - - - /** - * field for Iid - */ - - - protected long localIid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final long param) { - - this.localIid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":deleteInstance", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "deleteInstance", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - if (this.localIid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DeleteInstance parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DeleteInstance object = new DeleteInstance(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"deleteInstance".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteInstance) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstanceOut.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstanceOut.java deleted file mode 100644 index c1d22d3c2..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstanceOut.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * DeleteInstanceOut.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeleteInstanceOut bean class - */ - -public class DeleteInstanceOut implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 8337500676634934021L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deleteInstanceOut", "ns1"); - - - - /** - * field for DeleteInstanceOut - */ - - - protected org.wso2.bps.management.schema.InstanceDeleteStatusType localDeleteInstanceOut; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceDeleteStatusType - */ - public org.wso2.bps.management.schema.InstanceDeleteStatusType getDeleteInstanceOut() { - return this.localDeleteInstanceOut; - } - - - - /** - * Auto generated setter method - * - * @param param DeleteInstanceOut - */ - public void setDeleteInstanceOut(final org.wso2.bps.management.schema.InstanceDeleteStatusType param) { - - this.localDeleteInstanceOut = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localDeleteInstanceOut == null) { - throw new org.apache.axis2.databinding.ADBException("deleteInstanceOut cannot be null!"); - } - this.localDeleteInstanceOut.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localDeleteInstanceOut.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DeleteInstanceOut parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DeleteInstanceOut object = new DeleteInstanceOut(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "deleteInstanceOut").equals(reader.getName())) { - - object.setDeleteInstanceOut(org.wso2.bps.management.schema.InstanceDeleteStatusType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstanceResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstanceResponse.java deleted file mode 100644 index 9b5ab57a8..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstanceResponse.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * DeleteInstanceResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeleteInstanceResponse bean class - */ - -public class DeleteInstanceResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -4833929584486775389L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deleteInstanceResponse", "ns1"); - - - - /** - * field for NumberOfInstances - */ - - - protected int localNumberOfInstances; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getNumberOfInstances() { - return this.localNumberOfInstances; - } - - - - /** - * Auto generated setter method - * - * @param param NumberOfInstances - */ - public void setNumberOfInstances(final int param) { - - this.localNumberOfInstances = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":deleteInstanceResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "deleteInstanceResponse", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "numberOfInstances", xmlWriter); - - if (this.localNumberOfInstances == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("numberOfInstances cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNumberOfInstances)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "numberOfInstances")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localNumberOfInstances)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DeleteInstanceResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DeleteInstanceResponse object = new DeleteInstanceResponse(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"deleteInstanceResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteInstanceResponse) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "numberOfInstances").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setNumberOfInstances(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstances.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstances.java deleted file mode 100644 index 23a365e39..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteInstances.java +++ /dev/null @@ -1,528 +0,0 @@ - -/** - * DeleteInstances.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeleteInstances bean class - */ - -public class DeleteInstances implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -510604033227784588L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deleteInstances", "ns1"); - - - - /** - * field for Filter - */ - - - protected java.lang.String localFilter; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFilter() { - return this.localFilter; - } - - - - /** - * Auto generated setter method - * - * @param param Filter - */ - public void setFilter(final java.lang.String param) { - - this.localFilter = param; - - - } - - - /** - * field for DeleteMessageExchanges - */ - - - protected boolean localDeleteMessageExchanges; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getDeleteMessageExchanges() { - return this.localDeleteMessageExchanges; - } - - - - /** - * Auto generated setter method - * - * @param param DeleteMessageExchanges - */ - public void setDeleteMessageExchanges(final boolean param) { - - this.localDeleteMessageExchanges = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":deleteInstances", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "deleteInstances", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "filter", xmlWriter); - - - if (this.localFilter == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("filter cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localFilter); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "deleteMessageExchanges", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("deleteMessageExchanges cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDeleteMessageExchanges)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "filter")); - - if (this.localFilter != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFilter)); - } else { - throw new org.apache.axis2.databinding.ADBException("filter cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "deleteMessageExchanges")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDeleteMessageExchanges)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DeleteInstances parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DeleteInstances object = new DeleteInstances(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"deleteInstances".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeleteInstances) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "filter").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFilter(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "deleteMessageExchanges").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDeleteMessageExchanges(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeletePackage.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeletePackage.java deleted file mode 100644 index 205eaf4e9..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeletePackage.java +++ /dev/null @@ -1,455 +0,0 @@ - -/** - * DeletePackage.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeletePackage bean class - */ - -public class DeletePackage implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -1635448168346195377L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deletePackage", "ns1"); - - - - /** - * field for _package - */ - - - protected java.lang.String local_package; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String get_package() { - return this.local_package; - } - - - - /** - * Auto generated setter method - * - * @param param _package - */ - public void set_package(final java.lang.String param) { - - this.local_package = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":deletePackage", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "deletePackage", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "package", xmlWriter); - - - if (this.local_package == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.local_package); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "package")); - - if (this.local_package != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_package)); - } else { - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DeletePackage parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DeletePackage object = new DeletePackage(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"deletePackage".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeletePackage) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "package").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_package(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteStatus.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteStatus.java deleted file mode 100644 index 1bfa073cb..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteStatus.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * DeleteStatus.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeleteStatus bean class - */ - -public class DeleteStatus implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 5004135347605091666L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deleteStatus", "ns1"); - - - - /** - * field for DeleteStatus - */ - - - protected org.wso2.bps.management.schema.DeleteStatus_type0 localDeleteStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.DeleteStatus_type0 - */ - public org.wso2.bps.management.schema.DeleteStatus_type0 getDeleteStatus() { - return this.localDeleteStatus; - } - - - - /** - * Auto generated setter method - * - * @param param DeleteStatus - */ - public void setDeleteStatus(final org.wso2.bps.management.schema.DeleteStatus_type0 param) { - - this.localDeleteStatus = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localDeleteStatus == null) { - throw new org.apache.axis2.databinding.ADBException("deleteStatus cannot be null!"); - } - this.localDeleteStatus.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localDeleteStatus.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DeleteStatus parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DeleteStatus object = new DeleteStatus(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "deleteStatus").equals(reader.getName())) { - - object.setDeleteStatus(org.wso2.bps.management.schema.DeleteStatus_type0.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteStatus_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteStatus_type0.java deleted file mode 100644 index c476815ed..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeleteStatus_type0.java +++ /dev/null @@ -1,465 +0,0 @@ - -/** - * DeleteStatus_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeleteStatus_type0 bean class - */ - -public class DeleteStatus_type0 implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 2760613496349590908L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deleteStatus_type0", "ns1"); - - - - /** - * field for DeleteStatus_type0 - */ - - - protected java.lang.String localDeleteStatus_type0; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected DeleteStatus_type0(final java.lang.String value, final boolean isRegisterValue) { - this.localDeleteStatus_type0 = value; - if (isRegisterValue) { - - _table_.put(this.localDeleteStatus_type0, this); - - } - - } - - public static final java.lang.String _SUCCESS = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("SUCCESS"); - - public static final java.lang.String _FAILED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAILED"); - - public static final java.lang.String _REGFAILED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("REGFAILED"); - - public static final java.lang.String _INVALID_PACKAGE_NAME = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("INVALID_PACKAGE_NAME"); - - public static final DeleteStatus_type0 SUCCESS = new DeleteStatus_type0(_SUCCESS, true); - - public static final DeleteStatus_type0 FAILED = new DeleteStatus_type0(_FAILED, true); - - public static final DeleteStatus_type0 REGFAILED = new DeleteStatus_type0(_REGFAILED, true); - - public static final DeleteStatus_type0 INVALID_PACKAGE_NAME = new DeleteStatus_type0(_INVALID_PACKAGE_NAME, true); - - - public java.lang.String getValue() { - return this.localDeleteStatus_type0; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localDeleteStatus_type0.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":deleteStatus_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "deleteStatus_type0", - xmlWriter); - } - } - - if (this.localDeleteStatus_type0 == null) { - - throw new org.apache.axis2.databinding.ADBException("deleteStatus_type0 cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localDeleteStatus_type0); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localDeleteStatus_type0)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static DeleteStatus_type0 fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final DeleteStatus_type0 enumeration = (DeleteStatus_type0) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static DeleteStatus_type0 fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static DeleteStatus_type0 fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return DeleteStatus_type0.Factory.fromString(content, namespaceUri); - } else { - return DeleteStatus_type0.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 DeleteStatus_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - DeleteStatus_type0 object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = DeleteStatus_type0.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 = DeleteStatus_type0.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeployedPackagesPaginated.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeployedPackagesPaginated.java deleted file mode 100644 index 900df78f8..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeployedPackagesPaginated.java +++ /dev/null @@ -1,610 +0,0 @@ - -/** - * DeployedPackagesPaginated.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeployedPackagesPaginated bean class - */ - -public class DeployedPackagesPaginated implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -1115641568930577352L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deployedPackagesPaginated", "ns1"); - - - - /** - * field for Pages - */ - - - protected int localPages; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getPages() { - return this.localPages; - } - - - - /** - * Auto generated setter method - * - * @param param Pages - */ - public void setPages(final int param) { - - this.localPages = param; - - - } - - - /** - * field for _package This was an Array! - */ - - - protected org.wso2.bps.management.schema.Package_type0[] local_package; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_packageTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Package_type0[] - */ - public org.wso2.bps.management.schema.Package_type0[] get_package() { - return this.local_package; - } - - - - /** - * validate the array for _package - */ - protected void validate_package(final org.wso2.bps.management.schema.Package_type0[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param _package - */ - public void set_package(final org.wso2.bps.management.schema.Package_type0[] param) { - - validate_package(param); - - this.local_packageTracker = param != null; - - this.local_package = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.Package_type0 - */ - public void add_package(final org.wso2.bps.management.schema.Package_type0 param) { - if (this.local_package == null) { - this.local_package = new org.wso2.bps.management.schema.Package_type0[] {}; - } - - - // update the setting tracker - this.local_packageTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.local_package); - list.add(param); - this.local_package = - (org.wso2.bps.management.schema.Package_type0[]) list.toArray(new org.wso2.bps.management.schema.Package_type0[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":deployedPackagesPaginated", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "deployedPackagesPaginated", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pages", xmlWriter); - - if (this.localPages == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("pages cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPages)); - } - - xmlWriter.writeEndElement(); - if (this.local_packageTracker) { - if (this.local_package != null) { - for (final Package_type0 element : this.local_package) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "package"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pages")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPages)); - if (this.local_packageTracker) { - if (this.local_package != null) { - for (final Package_type0 element : this.local_package) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "package")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DeployedPackagesPaginated parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DeployedPackagesPaginated object = new DeployedPackagesPaginated(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"deployedPackagesPaginated".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeployedPackagesPaginated) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list2 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pages").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPages(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://wso2.org/bps/management/schema", - "package").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list2.add(org.wso2.bps.management.schema.Package_type0.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://wso2.org/bps/management/schema", - "package").equals(reader.getName())) { - list2.add(org.wso2.bps.management.schema.Package_type0.Factory.parse(reader)); - - } else { - loopDone2 = true; - } - } - } - // call the converter utility to convert and set the array - - object.set_package((org.wso2.bps.management.schema.Package_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.Package_type0.class, - list2)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeploymentInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeploymentInfo.java deleted file mode 100644 index 756cbd81f..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/DeploymentInfo.java +++ /dev/null @@ -1,692 +0,0 @@ - -/** - * DeploymentInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * DeploymentInfo bean class - */ - -public class DeploymentInfo implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = DeploymentInfo Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 7636423940706766539L; - /** - * field for PackageName - */ - - - protected java.lang.String localPackageName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPackageName() { - return this.localPackageName; - } - - - - /** - * Auto generated setter method - * - * @param param PackageName - */ - public void setPackageName(final java.lang.String param) { - - this.localPackageName = param; - - - } - - - /** - * field for Document - */ - - - protected java.lang.String localDocument; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getDocument() { - return this.localDocument; - } - - - - /** - * Auto generated setter method - * - * @param param Document - */ - public void setDocument(final java.lang.String param) { - - this.localDocument = param; - - - } - - - /** - * field for DeployDate - */ - - - protected java.util.Calendar localDeployDate; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDeployDate() { - return this.localDeployDate; - } - - - - /** - * Auto generated setter method - * - * @param param DeployDate - */ - public void setDeployDate(final java.util.Calendar param) { - - this.localDeployDate = param; - - - } - - - /** - * field for Deployer - */ - - - protected java.lang.String localDeployer; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getDeployer() { - return this.localDeployer; - } - - - - /** - * Auto generated setter method - * - * @param param Deployer - */ - public void setDeployer(final java.lang.String param) { - - this.localDeployer = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":DeploymentInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "DeploymentInfo", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "packageName", xmlWriter); - - - if (this.localPackageName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("packageName cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localPackageName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "document", xmlWriter); - - - if (this.localDocument == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("document cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localDocument); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "deployDate", xmlWriter); - - - if (this.localDeployDate == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("deployDate cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDeployDate)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "deployer", xmlWriter); - - - if (this.localDeployer == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("deployer cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localDeployer); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "packageName")); - - if (this.localPackageName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPackageName)); - } else { - throw new org.apache.axis2.databinding.ADBException("packageName cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "document")); - - if (this.localDocument != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDocument)); - } else { - throw new org.apache.axis2.databinding.ADBException("document cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deployDate")); - - if (this.localDeployDate != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDeployDate)); - } else { - throw new org.apache.axis2.databinding.ADBException("deployDate cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deployer")); - - if (this.localDeployer != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDeployer)); - } else { - throw new org.apache.axis2.databinding.ADBException("deployer cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static DeploymentInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final DeploymentInfo object = new DeploymentInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"DeploymentInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (DeploymentInfo) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "packageName").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPackageName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "document").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDocument(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "deployDate").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDeployDate(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://wso2.org/bps/management/schema", - "deployer").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDeployer(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EndpointRef_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EndpointRef_type0.java deleted file mode 100644 index 63276b925..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EndpointRef_type0.java +++ /dev/null @@ -1,761 +0,0 @@ - -/** - * EndpointRef_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - -import org.apache.axiom.om.OMElement; - -/** - * EndpointRef_type0 bean class - */ - -public class EndpointRef_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = endpointRef_type0 Namespace URI - * = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 4082172345318692557L; - - /** - * field for PartnerLink - */ - - - protected java.lang.String localPartnerLink; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPartnerLink() { - return this.localPartnerLink; - } - - - - /** - * Auto generated setter method - * - * @param param PartnerLink - */ - public void setPartnerLink(final java.lang.String param) { - - this.localPartnerLink = param; - - - } - - - /** - * field for Service - */ - - - protected javax.xml.namespace.QName localService; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getService() { - return this.localService; - } - - - - /** - * Auto generated setter method - * - * @param param Service - */ - public void setService(final javax.xml.namespace.QName param) { - - this.localService = param; - - - } - - - /** - * field for ServiceLocations - */ - - - protected org.wso2.bps.management.schema.ServiceLocation localServiceLocations; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ServiceLocation - */ - public org.wso2.bps.management.schema.ServiceLocation getServiceLocations() { - return this.localServiceLocations; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceLocations - */ - public void setServiceLocations(final org.wso2.bps.management.schema.ServiceLocation param) { - - this.localServiceLocations = param; - - - } - - - /** - * field for ExtraElement This was an Array! - */ - - - protected org.apache.axiom.om.OMElement[] localExtraElement; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtraElementTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement[] - */ - public org.apache.axiom.om.OMElement[] getExtraElement() { - return this.localExtraElement; - } - - - - /** - * validate the array for ExtraElement - */ - protected void validateExtraElement(final org.apache.axiom.om.OMElement[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ExtraElement - */ - public void setExtraElement(final org.apache.axiom.om.OMElement[] param) { - - validateExtraElement(param); - - this.localExtraElementTracker = param != null; - - this.localExtraElement = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axiom.om.OMElement - */ - public void addExtraElement(final org.apache.axiom.om.OMElement param) { - if (this.localExtraElement == null) { - this.localExtraElement = new org.apache.axiom.om.OMElement[] {}; - } - - - // update the setting tracker - this.localExtraElementTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtraElement); - list.add(param); - this.localExtraElement = - (org.apache.axiom.om.OMElement[]) list.toArray(new org.apache.axiom.om.OMElement[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":endpointRef_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "endpointRef_type0", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "partnerLink", xmlWriter); - - - if (this.localPartnerLink == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("partnerLink cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localPartnerLink); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "service", xmlWriter); - - - if (this.localService == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("service cannot be null!!"); - - } else { - - - writeQName(this.localService, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - if (this.localServiceLocations == null) { - throw new org.apache.axis2.databinding.ADBException("serviceLocations cannot be null!!"); - } - this.localServiceLocations.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "serviceLocations"), xmlWriter); - if (this.localExtraElementTracker) { - - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - element.serialize(xmlWriter); - } else { - - // we have to do nothing since minOccures zero - - } - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "partnerLink")); - - if (this.localPartnerLink != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPartnerLink)); - } else { - throw new org.apache.axis2.databinding.ADBException("partnerLink cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "service")); - - if (this.localService != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localService)); - } else { - throw new org.apache.axis2.databinding.ADBException("service cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "serviceLocations")); - - - if (this.localServiceLocations == null) { - throw new org.apache.axis2.databinding.ADBException("serviceLocations cannot be null!!"); - } - elementList.add(this.localServiceLocations); - if (this.localExtraElementTracker) { - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - elementList.add(new javax.xml.namespace.QName("", "extraElement")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - // have to do nothing - - } - - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static EndpointRef_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final EndpointRef_type0 object = new EndpointRef_type0(); - - int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"endpointRef_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (EndpointRef_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list4 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "partnerLink").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPartnerLink(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "service").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setService(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "serviceLocations").equals(reader.getName())) { - - object.setServiceLocations(org.wso2.bps.management.schema.ServiceLocation.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - - - // Process the array and step past its final element's end. - - boolean loopDone4 = false; - - while (!loopDone4) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) { - - // We need to wrap the reader so that it produces a fake START_DOCUEMENT event - final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder4 = - new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( - new org.apache.axis2.util.StreamWrapper(reader), reader.getName()); - - list4.add(builder4.getOMElement()); - reader.next(); - if (reader.isEndElement()) { - // we have two countinuos end elements - loopDone4 = true; - } - - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event) { - loopDone4 = true; - } else { - reader.next(); - } - - } - - - object.setExtraElement((org.apache.axiom.om.OMElement[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.apache.axiom.om.OMElement.class, - list4)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EndpointReferencesType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EndpointReferencesType.java deleted file mode 100644 index fff796c96..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EndpointReferencesType.java +++ /dev/null @@ -1,532 +0,0 @@ - -/** - * EndpointReferencesType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * EndpointReferencesType bean class - */ - -public class EndpointReferencesType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = EndpointReferencesType Namespace - * URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -6579457559509034252L; - /** - * field for EndpointRef This was an Array! - */ - - - protected org.wso2.bps.management.schema.EndpointRef_type0[] localEndpointRef; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.EndpointRef_type0[] - */ - public org.wso2.bps.management.schema.EndpointRef_type0[] getEndpointRef() { - return this.localEndpointRef; - } - - - - /** - * validate the array for EndpointRef - */ - protected void validateEndpointRef(final org.wso2.bps.management.schema.EndpointRef_type0[] param) { - - if (param != null && param.length < 1) { - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * - * @param param EndpointRef - */ - public void setEndpointRef(final org.wso2.bps.management.schema.EndpointRef_type0[] param) { - - validateEndpointRef(param); - - - this.localEndpointRef = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.EndpointRef_type0 - */ - public void addEndpointRef(final org.wso2.bps.management.schema.EndpointRef_type0 param) { - if (this.localEndpointRef == null) { - this.localEndpointRef = new org.wso2.bps.management.schema.EndpointRef_type0[] {}; - } - - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localEndpointRef); - list.add(param); - this.localEndpointRef = - (org.wso2.bps.management.schema.EndpointRef_type0[]) list.toArray(new org.wso2.bps.management.schema.EndpointRef_type0[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":EndpointReferencesType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "EndpointReferencesType", - xmlWriter); - } - - - } - - if (this.localEndpointRef != null) { - for (final EndpointRef_type0 element : this.localEndpointRef) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "endpointRef"), xmlWriter); - } else { - - throw new org.apache.axis2.databinding.ADBException("endpointRef cannot be null!!"); - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("endpointRef cannot be null!!"); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - if (this.localEndpointRef != null) { - for (final EndpointRef_type0 element : this.localEndpointRef) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "endpointRef")); - elementList.add(element); - } else { - - throw new org.apache.axis2.databinding.ADBException("endpointRef cannot be null !!"); - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("endpointRef cannot be null!!"); - - } - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static EndpointReferencesType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final EndpointReferencesType object = new EndpointReferencesType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"EndpointReferencesType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (EndpointReferencesType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "endpointRef").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.EndpointRef_type0.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://wso2.org/bps/management/schema", - "endpointRef").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.EndpointRef_type0.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setEndpointRef((org.wso2.bps.management.schema.EndpointRef_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.EndpointRef_type0.class, - list1)); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfo.java deleted file mode 100644 index 9213683fc..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfo.java +++ /dev/null @@ -1,1188 +0,0 @@ - -/** - * EventInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * EventInfo bean class - */ - -public class EventInfo implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = EventInfo Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -5740310387651463371L; - - /** - * field for Name - */ - - - protected java.lang.String localName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - - this.localName = param; - - - } - - - /** - * field for Type - */ - - - protected java.lang.String localType; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getType() { - return this.localType; - } - - - - /** - * Auto generated setter method - * - * @param param Type - */ - public void setType(final java.lang.String param) { - - this.localType = param; - - - } - - - /** - * field for LineNumber - */ - - - protected int localLineNumber; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getLineNumber() { - return this.localLineNumber; - } - - - - /** - * Auto generated setter method - * - * @param param LineNumber - */ - public void setLineNumber(final int param) { - - this.localLineNumber = param; - - - } - - - /** - * field for Timestamp - */ - - - protected java.util.Calendar localTimestamp; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getTimestamp() { - return this.localTimestamp; - } - - - - /** - * Auto generated setter method - * - * @param param Timestamp - */ - public void setTimestamp(final java.util.Calendar param) { - - this.localTimestamp = param; - - - } - - - /** - * field for ScopeId - */ - - - protected long localScopeId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localScopeIdTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getScopeId() { - return this.localScopeId; - } - - - - /** - * Auto generated setter method - * - * @param param ScopeId - */ - public void setScopeId(final long param) { - - // setting primitive attribute tracker to true - this.localScopeIdTracker = param != java.lang.Long.MIN_VALUE; - - this.localScopeId = param; - - - } - - - /** - * field for ScopeName - */ - - - protected java.lang.String localScopeName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localScopeNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getScopeName() { - return this.localScopeName; - } - - - - /** - * Auto generated setter method - * - * @param param ScopeName - */ - public void setScopeName(final java.lang.String param) { - this.localScopeNameTracker = param != null; - - this.localScopeName = param; - - - } - - - /** - * field for ActivityId - */ - - - protected long localActivityId; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActivityIdTracker = false; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getActivityId() { - return this.localActivityId; - } - - - - /** - * Auto generated setter method - * - * @param param ActivityId - */ - public void setActivityId(final long param) { - - // setting primitive attribute tracker to true - this.localActivityIdTracker = param != java.lang.Long.MIN_VALUE; - - this.localActivityId = param; - - - } - - - /** - * field for ActivityName - */ - - - protected java.lang.String localActivityName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActivityNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getActivityName() { - return this.localActivityName; - } - - - - /** - * Auto generated setter method - * - * @param param ActivityName - */ - public void setActivityName(final java.lang.String param) { - this.localActivityNameTracker = param != null; - - this.localActivityName = param; - - - } - - - /** - * field for ActivityType - */ - - - protected java.lang.String localActivityType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActivityTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getActivityType() { - return this.localActivityType; - } - - - - /** - * Auto generated setter method - * - * @param param ActivityType - */ - public void setActivityType(final java.lang.String param) { - this.localActivityTypeTracker = param != null; - - this.localActivityType = param; - - - } - - - /** - * field for IsRecoveryRequired - */ - - - protected boolean localIsRecoveryRequired; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localIsRecoveryRequiredTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getIsRecoveryRequired() { - return this.localIsRecoveryRequired; - } - - - - /** - * Auto generated setter method - * - * @param param IsRecoveryRequired - */ - public void setIsRecoveryRequired(final boolean param) { - - // setting primitive attribute tracker to true - this.localIsRecoveryRequiredTracker = true; - - this.localIsRecoveryRequired = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":EventInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "EventInfo", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "type", xmlWriter); - - - if (this.localType == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("type cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localType); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "line-number", xmlWriter); - - if (this.localLineNumber == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("line-number cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "timestamp", xmlWriter); - - - if (this.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(this.localTimestamp)); - - } - - xmlWriter.writeEndElement(); - if (this.localScopeIdTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "scope-id", xmlWriter); - - if (this.localScopeId == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("scope-id cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localScopeId)); - } - - xmlWriter.writeEndElement(); - } - if (this.localScopeNameTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "scope-name", xmlWriter); - - - if (this.localScopeName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("scope-name cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localScopeName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localActivityIdTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "activity-id", xmlWriter); - - if (this.localActivityId == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("activity-id cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActivityId)); - } - - xmlWriter.writeEndElement(); - } - if (this.localActivityNameTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "activity-name", xmlWriter); - - - if (this.localActivityName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("activity-name cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localActivityName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localActivityTypeTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "activity-type", xmlWriter); - - - if (this.localActivityType == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("activity-type cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localActivityType); - - } - - xmlWriter.writeEndElement(); - } - if (this.localIsRecoveryRequiredTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "isRecoveryRequired", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("isRecoveryRequired cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIsRecoveryRequired)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "name")); - - if (this.localName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "type")); - - if (this.localType != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localType)); - } else { - throw new org.apache.axis2.databinding.ADBException("type cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "line-number")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "timestamp")); - - if (this.localTimestamp != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTimestamp)); - } else { - throw new org.apache.axis2.databinding.ADBException("timestamp cannot be null!!"); - } - if (this.localScopeIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "scope-id")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localScopeId)); - } - if (this.localScopeNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "scope-name")); - - if (this.localScopeName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localScopeName)); - } else { - throw new org.apache.axis2.databinding.ADBException("scope-name cannot be null!!"); - } - } - if (this.localActivityIdTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "activity-id")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActivityId)); - } - if (this.localActivityNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "activity-name")); - - if (this.localActivityName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActivityName)); - } else { - throw new org.apache.axis2.databinding.ADBException("activity-name cannot be null!!"); - } - } - if (this.localActivityTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "activity-type")); - - if (this.localActivityType != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActivityType)); - } else { - throw new org.apache.axis2.databinding.ADBException("activity-type cannot be null!!"); - } - } - if (this.localIsRecoveryRequiredTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "isRecoveryRequired")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIsRecoveryRequired)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static EventInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final EventInfo object = new EventInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"EventInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (EventInfo) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "name").equals(reader.getName())) { - - final 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://wso2.org/bps/management/schema", - "type").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setType(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "line-number").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLineNumber(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://wso2.org/bps/management/schema", - "timestamp").equals(reader.getName())) { - - final 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 { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "scope-id").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setScopeId(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setScopeId(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "scope-name").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setScopeName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activity-id").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setActivityId(org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setActivityId(java.lang.Long.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activity-name").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setActivityName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activity-type").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setActivityType(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "isRecoveryRequired").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIsRecoveryRequired(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfoE.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfoE.java deleted file mode 100644 index b26dee386..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfoE.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * EventInfoE.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * EventInfoE bean class - */ - -public class EventInfoE implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 5911724862343461102L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "event-info", "ns1"); - - - - /** - * field for EventInfo - */ - - - protected org.wso2.bps.management.schema.EventInfo localEventInfo; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.EventInfo - */ - public org.wso2.bps.management.schema.EventInfo getEventInfo() { - return this.localEventInfo; - } - - - - /** - * Auto generated setter method - * - * @param param EventInfo - */ - public void setEventInfo(final org.wso2.bps.management.schema.EventInfo param) { - - this.localEventInfo = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localEventInfo == null) { - throw new org.apache.axis2.databinding.ADBException("event-info cannot be null!"); - } - this.localEventInfo.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localEventInfo.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static EventInfoE parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final EventInfoE object = new EventInfoE(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "event-info").equals(reader.getName())) { - - object.setEventInfo(org.wso2.bps.management.schema.EventInfo.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfoList.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfoList.java deleted file mode 100644 index 0caa4baab..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/EventInfoList.java +++ /dev/null @@ -1,536 +0,0 @@ - -/** - * EventInfoList.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * EventInfoList bean class - */ - -public class EventInfoList implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = EventInfoList Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 6616970150204319089L; - - /** - * field for EventInfo This was an Array! - */ - - - protected org.wso2.bps.management.schema.EventInfo[] localEventInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localEventInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.EventInfo[] - */ - public org.wso2.bps.management.schema.EventInfo[] getEventInfo() { - return this.localEventInfo; - } - - - - /** - * validate the array for EventInfo - */ - protected void validateEventInfo(final org.wso2.bps.management.schema.EventInfo[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param EventInfo - */ - public void setEventInfo(final org.wso2.bps.management.schema.EventInfo[] param) { - - validateEventInfo(param); - - this.localEventInfoTracker = param != null; - - this.localEventInfo = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.EventInfo - */ - public void addEventInfo(final org.wso2.bps.management.schema.EventInfo param) { - if (this.localEventInfo == null) { - this.localEventInfo = new org.wso2.bps.management.schema.EventInfo[] {}; - } - - - // update the setting tracker - this.localEventInfoTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localEventInfo); - list.add(param); - this.localEventInfo = - (org.wso2.bps.management.schema.EventInfo[]) list.toArray(new org.wso2.bps.management.schema.EventInfo[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":EventInfoList", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "EventInfoList", xmlWriter); - } - - - } - if (this.localEventInfoTracker) { - if (this.localEventInfo != null) { - for (final EventInfo element : this.localEventInfo) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "event-info"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("event-info cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localEventInfoTracker) { - if (this.localEventInfo != null) { - for (final EventInfo element : this.localEventInfo) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "event-info")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("event-info cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static EventInfoList parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final EventInfoList object = new EventInfoList(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"EventInfoList".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (EventInfoList) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "event-info").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.EventInfo.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://wso2.org/bps/management/schema", - "event-info").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.EventInfo.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setEventInfo((org.wso2.bps.management.schema.EventInfo[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.EventInfo.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailureInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailureInfoType.java deleted file mode 100644 index 4fd3103be..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailureInfoType.java +++ /dev/null @@ -1,684 +0,0 @@ - -/** - * FailureInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * FailureInfoType bean class - */ - -public class FailureInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = FailureInfoType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 5423385740662761122L; - /** - * field for DateFailure - */ - - - protected java.util.Calendar localDateFailure; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateFailure() { - return this.localDateFailure; - } - - - - /** - * Auto generated setter method - * - * @param param DateFailure - */ - public void setDateFailure(final java.util.Calendar param) { - - this.localDateFailure = param; - - - } - - - /** - * field for Retries - */ - - - protected int localRetries; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getRetries() { - return this.localRetries; - } - - - - /** - * Auto generated setter method - * - * @param param Retries - */ - public void setRetries(final int param) { - - this.localRetries = param; - - - } - - - /** - * field for Reason - */ - - - protected java.lang.String localReason; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getReason() { - return this.localReason; - } - - - - /** - * Auto generated setter method - * - * @param param Reason - */ - public void setReason(final java.lang.String param) { - - this.localReason = param; - - - } - - - /** - * field for Actions - */ - - - protected java.lang.String localActions; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getActions() { - return this.localActions; - } - - - - /** - * Auto generated setter method - * - * @param param Actions - */ - public void setActions(final java.lang.String param) { - - this.localActions = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":FailureInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "FailureInfoType", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateFailure", xmlWriter); - - - if (this.localDateFailure == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateFailure cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateFailure)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "retries", xmlWriter); - - if (this.localRetries == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("retries cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRetries)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "reason", xmlWriter); - - - if (this.localReason == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("reason cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localReason); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "actions", xmlWriter); - - - if (this.localActions == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("actions cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localActions); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateFailure")); - - if (this.localDateFailure != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateFailure)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateFailure cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "retries")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRetries)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "reason")); - - if (this.localReason != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localReason)); - } else { - throw new org.apache.axis2.databinding.ADBException("reason cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "actions")); - - if (this.localActions != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActions)); - } else { - throw new org.apache.axis2.databinding.ADBException("actions cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static FailureInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final FailureInfoType object = new FailureInfoType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"FailureInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (FailureInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "dateFailure").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateFailure(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://wso2.org/bps/management/schema", - "retries").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setRetries(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://wso2.org/bps/management/schema", - "reason").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setReason(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "actions").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setActions(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailuresInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailuresInfo.java deleted file mode 100644 index 55182ab43..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailuresInfo.java +++ /dev/null @@ -1,523 +0,0 @@ - -/** - * FailuresInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * FailuresInfo bean class - */ - -public class FailuresInfo implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = FailuresInfo Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -722226266203929820L; - /** - * field for FailureDate - */ - - - protected java.util.Calendar localFailureDate; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getFailureDate() { - return this.localFailureDate; - } - - - - /** - * Auto generated setter method - * - * @param param FailureDate - */ - public void setFailureDate(final java.util.Calendar param) { - - this.localFailureDate = param; - - - } - - - /** - * field for Count - */ - - - protected int localCount; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getCount() { - return this.localCount; - } - - - - /** - * Auto generated setter method - * - * @param param Count - */ - public void setCount(final int param) { - - this.localCount = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":FailuresInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "FailuresInfo", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "failureDate", xmlWriter); - - - if (this.localFailureDate == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("failureDate cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFailureDate)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "count", xmlWriter); - - if (this.localCount == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("count cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCount)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "failureDate")); - - if (this.localFailureDate != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFailureDate)); - } else { - throw new org.apache.axis2.databinding.ADBException("failureDate cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "count")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCount)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static FailuresInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final FailuresInfo object = new FailuresInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"FailuresInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (FailuresInfo) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "failureDate").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFailureDate(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://wso2.org/bps/management/schema", - "count").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCount(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailuresInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailuresInfoType.java deleted file mode 100644 index 60fd88b42..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FailuresInfoType.java +++ /dev/null @@ -1,524 +0,0 @@ - -/** - * FailuresInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * FailuresInfoType bean class - */ - -public class FailuresInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = FailuresInfoType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -7877416287334096735L; - /** - * field for DateFailure - */ - - - protected java.util.Calendar localDateFailure; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateFailure() { - return this.localDateFailure; - } - - - - /** - * Auto generated setter method - * - * @param param DateFailure - */ - public void setDateFailure(final java.util.Calendar param) { - - this.localDateFailure = param; - - - } - - - /** - * field for Count - */ - - - protected int localCount; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getCount() { - return this.localCount; - } - - - - /** - * Auto generated setter method - * - * @param param Count - */ - public void setCount(final int param) { - - this.localCount = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":FailuresInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "FailuresInfoType", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateFailure", xmlWriter); - - - if (this.localDateFailure == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateFailure cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateFailure)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "count", xmlWriter); - - if (this.localCount == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("count cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCount)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateFailure")); - - if (this.localDateFailure != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateFailure)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateFailure cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "count")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCount)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static FailuresInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final FailuresInfoType object = new FailuresInfoType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"FailuresInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (FailuresInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "dateFailure").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateFailure(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://wso2.org/bps/management/schema", - "count").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCount(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInfoType.java deleted file mode 100644 index ad0b858bd..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInfoType.java +++ /dev/null @@ -1,759 +0,0 @@ - -/** - * FaultInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * FaultInfoType bean class - */ - -public class FaultInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = FaultInfoType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 6962379999326731464L; - - /** - * field for Name - */ - - - protected javax.xml.namespace.QName localName; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final javax.xml.namespace.QName param) { - - this.localName = param; - - - } - - - /** - * field for Explanation - */ - - - protected java.lang.String localExplanation; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExplanationTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getExplanation() { - return this.localExplanation; - } - - - - /** - * Auto generated setter method - * - * @param param Explanation - */ - public void setExplanation(final java.lang.String param) { - this.localExplanationTracker = param != null; - - this.localExplanation = param; - - - } - - - /** - * field for LineNumber - */ - - - protected int localLineNumber; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getLineNumber() { - return this.localLineNumber; - } - - - - /** - * Auto generated setter method - * - * @param param LineNumber - */ - public void setLineNumber(final int param) { - - this.localLineNumber = param; - - - } - - - /** - * field for Aiid - */ - - - protected int localAiid; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getAiid() { - return this.localAiid; - } - - - - /** - * Auto generated setter method - * - * @param param Aiid - */ - public void setAiid(final int param) { - - this.localAiid = param; - - - } - - - /** - * field for Data - */ - - - protected org.wso2.bps.management.schema.Data_type0 localData; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDataTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Data_type0 - */ - public org.wso2.bps.management.schema.Data_type0 getData() { - return this.localData; - } - - - - /** - * Auto generated setter method - * - * @param param Data - */ - public void setData(final org.wso2.bps.management.schema.Data_type0 param) { - this.localDataTracker = param != null; - - this.localData = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":FaultInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "FaultInfoType", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - - } else { - - - writeQName(this.localName, xmlWriter); - - } - - xmlWriter.writeEndElement(); - if (this.localExplanationTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "explanation", xmlWriter); - - - if (this.localExplanation == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("explanation cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localExplanation); - - } - - xmlWriter.writeEndElement(); - } - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "lineNumber", xmlWriter); - - if (this.localLineNumber == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("lineNumber cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "aiid", xmlWriter); - - if (this.localAiid == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("aiid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAiid)); - } - - xmlWriter.writeEndElement(); - if (this.localDataTracker) { - if (this.localData == null) { - throw new org.apache.axis2.databinding.ADBException("data cannot be null!!"); - } - this.localData.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "data"), - xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "name")); - - if (this.localName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - } - if (this.localExplanationTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "explanation")); - - if (this.localExplanation != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localExplanation)); - } else { - throw new org.apache.axis2.databinding.ADBException("explanation cannot be null!!"); - } - } - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "lineNumber")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLineNumber)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "aiid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAiid)); - if (this.localDataTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "data")); - - - if (this.localData == null) { - throw new org.apache.axis2.databinding.ADBException("data cannot be null!!"); - } - elementList.add(this.localData); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static FaultInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final FaultInfoType object = new FaultInfoType(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"FaultInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (FaultInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "name").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "explanation").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setExplanation(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "lineNumber").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLineNumber(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://wso2.org/bps/management/schema", - "aiid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setAiid(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://wso2.org/bps/management/schema", - "data").equals(reader.getName())) { - - object.setData(org.wso2.bps.management.schema.Data_type0.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInstance.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInstance.java deleted file mode 100644 index bb02fc1eb..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInstance.java +++ /dev/null @@ -1,609 +0,0 @@ - -/** - * FaultInstance.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * FaultInstance bean class - */ - -public class FaultInstance implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 7424129606780628023L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "faultInstance", "ns1"); - - - - /** - * field for Iid - */ - - - protected long localIid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final long param) { - - this.localIid = param; - - - } - - - /** - * field for FaultName - */ - - - protected javax.xml.namespace.QName localFaultName; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getFaultName() { - return this.localFaultName; - } - - - - /** - * Auto generated setter method - * - * @param param FaultName - */ - public void setFaultName(final javax.xml.namespace.QName param) { - - this.localFaultName = param; - - - } - - - /** - * field for ExtraElement - */ - - - protected org.apache.axiom.om.OMElement localExtraElement; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement - */ - public org.apache.axiom.om.OMElement getExtraElement() { - return this.localExtraElement; - } - - - - /** - * Auto generated setter method - * - * @param param ExtraElement - */ - public void setExtraElement(final org.apache.axiom.om.OMElement param) { - - this.localExtraElement = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":faultInstance", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "faultInstance", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - if (this.localIid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "faultName", xmlWriter); - - - if (this.localFaultName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("faultName cannot be null!!"); - - } else { - - - writeQName(this.localFaultName, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - - if (this.localExtraElement != null) { - this.localExtraElement.serialize(xmlWriter); - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "faultName")); - - if (this.localFaultName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFaultName)); - } else { - throw new org.apache.axis2.databinding.ADBException("faultName cannot be null!!"); - } - - if (this.localExtraElement != null) { - elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); - elementList.add(this.localExtraElement); - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static FaultInstance parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final FaultInstance object = new FaultInstance(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"faultInstance".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (FaultInstance) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(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://wso2.org/bps/management/schema", - "faultName").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setFaultName(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - - - // use the QName from the parser as the name for the builder - final javax.xml.namespace.QName startQname3 = reader.getName(); - - // We need to wrap the reader so that it produces a fake START_DOCUMENT event - // this is needed by the builder classes - final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder3 = - new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( - new org.apache.axis2.util.StreamWrapper(reader), startQname3); - object.setExtraElement(builder3.getOMElement()); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInstanceOut.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInstanceOut.java deleted file mode 100644 index 6c3a585d9..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/FaultInstanceOut.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * FaultInstanceOut.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * FaultInstanceOut bean class - */ - -public class FaultInstanceOut implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 3745209364367331440L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "faultInstanceOut", "ns1"); - - - - /** - * field for FaultInstanceOut - */ - - - protected org.wso2.bps.management.schema.InstanceInfoType localFaultInstanceOut; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceInfoType - */ - public org.wso2.bps.management.schema.InstanceInfoType getFaultInstanceOut() { - return this.localFaultInstanceOut; - } - - - - /** - * Auto generated setter method - * - * @param param FaultInstanceOut - */ - public void setFaultInstanceOut(final org.wso2.bps.management.schema.InstanceInfoType param) { - - this.localFaultInstanceOut = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localFaultInstanceOut == null) { - throw new org.apache.axis2.databinding.ADBException("faultInstanceOut cannot be null!"); - } - this.localFaultInstanceOut.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localFaultInstanceOut.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static FaultInstanceOut parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final FaultInstanceOut object = new FaultInstanceOut(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "faultInstanceOut").equals(reader.getName())) { - - object.setFaultInstanceOut(org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetActivityLifeCycleFilterIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetActivityLifeCycleFilterIn.java deleted file mode 100644 index ac1ecb222..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetActivityLifeCycleFilterIn.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * GetActivityLifeCycleFilterIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetActivityLifeCycleFilterIn bean class - */ - -public class GetActivityLifeCycleFilterIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -2963602036152858779L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getActivityLifeCycleFilterIn", "ns1"); - - - - /** - * field for Iid - */ - - - protected long localIid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final long param) { - - this.localIid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getActivityLifeCycleFilterIn", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "getActivityLifeCycleFilterIn", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - if (this.localIid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetActivityLifeCycleFilterIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetActivityLifeCycleFilterIn object = new GetActivityLifeCycleFilterIn(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getActivityLifeCycleFilterIn".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetActivityLifeCycleFilterIn) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetAllProcesses.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetAllProcesses.java deleted file mode 100644 index 314e42113..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetAllProcesses.java +++ /dev/null @@ -1,393 +0,0 @@ - -/** - * GetAllProcesses.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetAllProcesses bean class - */ - -public class GetAllProcesses implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -3497546562237159082L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getAllProcesses", "ns1"); - - - - /** - * field for GetAllProcesses - */ - - - protected java.lang.String localGetAllProcesses; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getGetAllProcesses() { - return this.localGetAllProcesses; - } - - - - /** - * Auto generated setter method - * - * @param param GetAllProcesses - */ - public void setGetAllProcesses(final java.lang.String param) { - - this.localGetAllProcesses = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = "http://wso2.org/bps/management/schema"; - final java.lang.String localName = "getAllProcesses"; - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getAllProcesses", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getAllProcesses", - xmlWriter); - } - } - - if (this.localGetAllProcesses == null) { - - throw new org.apache.axis2.databinding.ADBException("getAllProcesses cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localGetAllProcesses); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localGetAllProcesses)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetAllProcesses parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetAllProcesses object = new GetAllProcesses(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "getAllProcesses").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setGetAllProcesses(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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetInstanceInfoIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetInstanceInfoIn.java deleted file mode 100644 index abd760554..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetInstanceInfoIn.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * GetInstanceInfoIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetInstanceInfoIn bean class - */ - -public class GetInstanceInfoIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -1823230015990333319L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getInstanceInfoIn", "ns1"); - - - - /** - * field for Iid - */ - - - protected long localIid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final long param) { - - this.localIid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getInstanceInfoIn", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getInstanceInfoIn", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - if (this.localIid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetInstanceInfoIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetInstanceInfoIn object = new GetInstanceInfoIn(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getInstanceInfoIn".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetInstanceInfoIn) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetInstanceSummaryIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetInstanceSummaryIn.java deleted file mode 100644 index 5ffced487..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetInstanceSummaryIn.java +++ /dev/null @@ -1,464 +0,0 @@ - -/** - * GetInstanceSummaryIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetInstanceSummaryIn bean class - */ - -public class GetInstanceSummaryIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6598601339422518967L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getInstanceSummaryIn", "ns1"); - - - - /** - * field for Pid - */ - - - protected javax.xml.namespace.QName localPid; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final javax.xml.namespace.QName param) { - - this.localPid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getInstanceSummaryIn", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getInstanceSummaryIn", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - writeQName(this.localPid, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetInstanceSummaryIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetInstanceSummaryIn object = new GetInstanceSummaryIn(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getInstanceSummaryIn".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetInstanceSummaryIn) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetLongRunningInstancesInput.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetLongRunningInstancesInput.java deleted file mode 100644 index 5bb5de176..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetLongRunningInstancesInput.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * GetLongRunningInstancesInput.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetLongRunningInstancesInput bean class - */ - -public class GetLongRunningInstancesInput implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8519283298277323067L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getLongRunningInstancesInput", "ns1"); - - - - /** - * field for Limit - */ - - - protected int localLimit; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getLimit() { - return this.localLimit; - } - - - - /** - * Auto generated setter method - * - * @param param Limit - */ - public void setLimit(final int param) { - - this.localLimit = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getLongRunningInstancesInput", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "getLongRunningInstancesInput", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "limit", xmlWriter); - - if (this.localLimit == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("limit cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLimit)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "limit")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLimit)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetLongRunningInstancesInput parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetLongRunningInstancesInput object = new GetLongRunningInstancesInput(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getLongRunningInstancesInput".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetLongRunningInstancesInput) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "limit").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLimit(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetLongRunningInstancesResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetLongRunningInstancesResponse.java deleted file mode 100644 index d308d62e4..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetLongRunningInstancesResponse.java +++ /dev/null @@ -1,539 +0,0 @@ - -/** - * GetLongRunningInstancesResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetLongRunningInstancesResponse bean class - */ - -public class GetLongRunningInstancesResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -7486398488389859049L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://wso2.org/bps/management/schema", "getLongRunningInstancesResponse", "ns1"); - - - - /** - * field for Instance This was an Array! - */ - - - protected org.wso2.bps.management.schema.LimitedInstanceInfoType[] localInstance; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInstanceTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.LimitedInstanceInfoType[] - */ - public org.wso2.bps.management.schema.LimitedInstanceInfoType[] getInstance() { - return this.localInstance; - } - - - - /** - * validate the array for Instance - */ - protected void validateInstance(final org.wso2.bps.management.schema.LimitedInstanceInfoType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Instance - */ - public void setInstance(final org.wso2.bps.management.schema.LimitedInstanceInfoType[] param) { - - validateInstance(param); - - this.localInstanceTracker = param != null; - - this.localInstance = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.LimitedInstanceInfoType - */ - public void addInstance(final org.wso2.bps.management.schema.LimitedInstanceInfoType param) { - if (this.localInstance == null) { - this.localInstance = new org.wso2.bps.management.schema.LimitedInstanceInfoType[] {}; - } - - - // update the setting tracker - this.localInstanceTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localInstance); - list.add(param); - this.localInstance = - (org.wso2.bps.management.schema.LimitedInstanceInfoType[]) list.toArray(new org.wso2.bps.management.schema.LimitedInstanceInfoType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getLongRunningInstancesResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "getLongRunningInstancesResponse", xmlWriter); - } - - - } - if (this.localInstanceTracker) { - if (this.localInstance != null) { - for (final LimitedInstanceInfoType element : this.localInstance) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "Instance"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Instance cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localInstanceTracker) { - if (this.localInstance != null) { - for (final LimitedInstanceInfoType element : this.localInstance) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "Instance")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Instance cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetLongRunningInstancesResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetLongRunningInstancesResponse object = new GetLongRunningInstancesResponse(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getLongRunningInstancesResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetLongRunningInstancesResponse) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "Instance").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.LimitedInstanceInfoType.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://wso2.org/bps/management/schema", - "Instance").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.LimitedInstanceInfoType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setInstance((org.wso2.bps.management.schema.LimitedInstanceInfoType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.LimitedInstanceInfoType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedInstanceListInput.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedInstanceListInput.java deleted file mode 100644 index c32252693..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedInstanceListInput.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * GetPaginatedInstanceListInput.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetPaginatedInstanceListInput bean class - */ - -public class GetPaginatedInstanceListInput implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -401005686035918366L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getPaginatedInstanceListInput", "ns1"); - - - - /** - * field for GetPaginatedInstanceListInput - */ - - - protected org.wso2.bps.management.schema.GetPaginatedInstanceListInputType localGetPaginatedInstanceListInput; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.GetPaginatedInstanceListInputType - */ - public org.wso2.bps.management.schema.GetPaginatedInstanceListInputType getGetPaginatedInstanceListInput() { - return this.localGetPaginatedInstanceListInput; - } - - - - /** - * Auto generated setter method - * - * @param param GetPaginatedInstanceListInput - */ - public void setGetPaginatedInstanceListInput(final org.wso2.bps.management.schema.GetPaginatedInstanceListInputType param) { - - this.localGetPaginatedInstanceListInput = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localGetPaginatedInstanceListInput == null) { - throw new org.apache.axis2.databinding.ADBException("getPaginatedInstanceListInput cannot be null!"); - } - this.localGetPaginatedInstanceListInput.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localGetPaginatedInstanceListInput.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetPaginatedInstanceListInput parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetPaginatedInstanceListInput object = new GetPaginatedInstanceListInput(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "getPaginatedInstanceListInput").equals(reader.getName())) { - - object.setGetPaginatedInstanceListInput(org.wso2.bps.management.schema.GetPaginatedInstanceListInputType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedInstanceListInputType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedInstanceListInputType.java deleted file mode 100644 index 24504db9a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedInstanceListInputType.java +++ /dev/null @@ -1,676 +0,0 @@ - -/** - * GetPaginatedInstanceListInputType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetPaginatedInstanceListInputType bean class - */ - -public class GetPaginatedInstanceListInputType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = - * getPaginatedInstanceListInputType Namespace URI = http://wso2.org/bps/management/schema Namespace - * Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 8266818994325465298L; - /** - * field for Filter - */ - - - protected java.lang.String localFilter; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFilter() { - return this.localFilter; - } - - - - /** - * Auto generated setter method - * - * @param param Filter - */ - public void setFilter(final java.lang.String param) { - - this.localFilter = param; - - - } - - - /** - * field for Order - */ - - - protected java.lang.String localOrder; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getOrder() { - return this.localOrder; - } - - - - /** - * Auto generated setter method - * - * @param param Order - */ - public void setOrder(final java.lang.String param) { - - this.localOrder = param; - - - } - - - /** - * field for Limit - */ - - - protected int localLimit; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getLimit() { - return this.localLimit; - } - - - - /** - * Auto generated setter method - * - * @param param Limit - */ - public void setLimit(final int param) { - - this.localLimit = param; - - - } - - - /** - * field for Page - */ - - - protected int localPage; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getPage() { - return this.localPage; - } - - - - /** - * Auto generated setter method - * - * @param param Page - */ - public void setPage(final int param) { - - this.localPage = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getPaginatedInstanceListInputType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "getPaginatedInstanceListInputType", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "filter", xmlWriter); - - - if (this.localFilter == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("filter cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localFilter); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "order", xmlWriter); - - - if (this.localOrder == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("order cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localOrder); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "limit", xmlWriter); - - if (this.localLimit == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("limit cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLimit)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "page", xmlWriter); - - if (this.localPage == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("page cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPage)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "filter")); - - if (this.localFilter != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFilter)); - } else { - throw new org.apache.axis2.databinding.ADBException("filter cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "order")); - - if (this.localOrder != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOrder)); - } else { - throw new org.apache.axis2.databinding.ADBException("order cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "limit")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localLimit)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "page")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPage)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetPaginatedInstanceListInputType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetPaginatedInstanceListInputType object = new GetPaginatedInstanceListInputType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getPaginatedInstanceListInputType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetPaginatedInstanceListInputType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "filter").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFilter(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "order").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setOrder(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "limit").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setLimit(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://wso2.org/bps/management/schema", - "page").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPage(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedProcessListInput.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedProcessListInput.java deleted file mode 100644 index 75c3d0f22..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedProcessListInput.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * GetPaginatedProcessListInput.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetPaginatedProcessListInput bean class - */ - -public class GetPaginatedProcessListInput implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -86818550036911740L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getPaginatedProcessListInput", "ns1"); - - - - /** - * field for GetPaginatedProcessListInput - */ - - - protected org.wso2.bps.management.schema.GetPaginatedProcessListInputType localGetPaginatedProcessListInput; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.GetPaginatedProcessListInputType - */ - public org.wso2.bps.management.schema.GetPaginatedProcessListInputType getGetPaginatedProcessListInput() { - return this.localGetPaginatedProcessListInput; - } - - - - /** - * Auto generated setter method - * - * @param param GetPaginatedProcessListInput - */ - public void setGetPaginatedProcessListInput(final org.wso2.bps.management.schema.GetPaginatedProcessListInputType param) { - - this.localGetPaginatedProcessListInput = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localGetPaginatedProcessListInput == null) { - throw new org.apache.axis2.databinding.ADBException("getPaginatedProcessListInput cannot be null!"); - } - this.localGetPaginatedProcessListInput.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localGetPaginatedProcessListInput.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetPaginatedProcessListInput parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetPaginatedProcessListInput object = new GetPaginatedProcessListInput(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "getPaginatedProcessListInput").equals(reader.getName())) { - - object.setGetPaginatedProcessListInput(org.wso2.bps.management.schema.GetPaginatedProcessListInputType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedProcessListInputType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedProcessListInputType.java deleted file mode 100644 index 47fe57a75..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetPaginatedProcessListInputType.java +++ /dev/null @@ -1,604 +0,0 @@ - -/** - * GetPaginatedProcessListInputType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetPaginatedProcessListInputType bean class - */ - -public class GetPaginatedProcessListInputType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = getPaginatedProcessListInputType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -1584232471895523922L; - /** - * field for Filter - */ - - - protected java.lang.String localFilter; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFilter() { - return this.localFilter; - } - - - - /** - * Auto generated setter method - * - * @param param Filter - */ - public void setFilter(final java.lang.String param) { - - this.localFilter = param; - - - } - - - /** - * field for OrderbyKeys - */ - - - protected java.lang.String localOrderbyKeys; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getOrderbyKeys() { - return this.localOrderbyKeys; - } - - - - /** - * Auto generated setter method - * - * @param param OrderbyKeys - */ - public void setOrderbyKeys(final java.lang.String param) { - - this.localOrderbyKeys = param; - - - } - - - /** - * field for Page - */ - - - protected int localPage; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getPage() { - return this.localPage; - } - - - - /** - * Auto generated setter method - * - * @param param Page - */ - public void setPage(final int param) { - - this.localPage = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getPaginatedProcessListInputType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "getPaginatedProcessListInputType", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "filter", xmlWriter); - - - if (this.localFilter == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("filter cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localFilter); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "orderbyKeys", xmlWriter); - - - if (this.localOrderbyKeys == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("orderbyKeys cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localOrderbyKeys); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "page", xmlWriter); - - if (this.localPage == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("page cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPage)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "filter")); - - if (this.localFilter != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFilter)); - } else { - throw new org.apache.axis2.databinding.ADBException("filter cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "orderbyKeys")); - - if (this.localOrderbyKeys != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOrderbyKeys)); - } else { - throw new org.apache.axis2.databinding.ADBException("orderbyKeys cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "page")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPage)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetPaginatedProcessListInputType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetPaginatedProcessListInputType object = new GetPaginatedProcessListInputType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getPaginatedProcessListInputType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetPaginatedProcessListInputType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "filter").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFilter(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "orderbyKeys").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setOrderbyKeys(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "page").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPage(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessDefinitionIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessDefinitionIn.java deleted file mode 100644 index cba8376b0..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessDefinitionIn.java +++ /dev/null @@ -1,401 +0,0 @@ - -/** - * GetProcessDefinitionIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetProcessDefinitionIn bean class - */ - -public class GetProcessDefinitionIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -6898179968715471155L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getProcessDefinitionIn", "ns1"); - - - - /** - * field for GetProcessDefinitionIn - */ - - - protected javax.xml.namespace.QName localGetProcessDefinitionIn; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getGetProcessDefinitionIn() { - return this.localGetProcessDefinitionIn; - } - - - - /** - * Auto generated setter method - * - * @param param GetProcessDefinitionIn - */ - public void setGetProcessDefinitionIn(final javax.xml.namespace.QName param) { - - this.localGetProcessDefinitionIn = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = "http://wso2.org/bps/management/schema"; - final java.lang.String localName = "getProcessDefinitionIn"; - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getProcessDefinitionIn", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getProcessDefinitionIn", - xmlWriter); - } - } - - if (this.localGetProcessDefinitionIn == null) { - - throw new org.apache.axis2.databinding.ADBException("getProcessDefinitionIn cannot be null !!"); - - } else { - - writeQName(this.localGetProcessDefinitionIn, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localGetProcessDefinitionIn)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetProcessDefinitionIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetProcessDefinitionIn object = new GetProcessDefinitionIn(); - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "getProcessDefinitionIn").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setGetProcessDefinitionIn(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessInfoCustomIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessInfoCustomIn.java deleted file mode 100644 index c90368ec5..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessInfoCustomIn.java +++ /dev/null @@ -1,544 +0,0 @@ - -/** - * GetProcessInfoCustomIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetProcessInfoCustomIn bean class - */ - -public class GetProcessInfoCustomIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6956458444760455200L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getProcessInfoCustomIn", "ns1"); - - - - /** - * field for Pid - */ - - - protected javax.xml.namespace.QName localPid; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final javax.xml.namespace.QName param) { - - this.localPid = param; - - - } - - - /** - * field for Customizer - */ - - - protected java.lang.String localCustomizer; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCustomizer() { - return this.localCustomizer; - } - - - - /** - * Auto generated setter method - * - * @param param Customizer - */ - public void setCustomizer(final java.lang.String param) { - - this.localCustomizer = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getProcessInfoCustomIn", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getProcessInfoCustomIn", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - writeQName(this.localPid, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "customizer", xmlWriter); - - - if (this.localCustomizer == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("customizer cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localCustomizer); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "customizer")); - - if (this.localCustomizer != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCustomizer)); - } else { - throw new org.apache.axis2.databinding.ADBException("customizer cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetProcessInfoCustomIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetProcessInfoCustomIn object = new GetProcessInfoCustomIn(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getProcessInfoCustomIn".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetProcessInfoCustomIn) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "customizer").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCustomizer(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessInfoIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessInfoIn.java deleted file mode 100644 index 5b6618b1e..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetProcessInfoIn.java +++ /dev/null @@ -1,464 +0,0 @@ - -/** - * GetProcessInfoIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetProcessInfoIn bean class - */ - -public class GetProcessInfoIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8933225489862263420L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getProcessInfoIn", "ns1"); - - - - /** - * field for Pid - */ - - - protected javax.xml.namespace.QName localPid; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final javax.xml.namespace.QName param) { - - this.localPid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getProcessInfoIn", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getProcessInfoIn", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - writeQName(this.localPid, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetProcessInfoIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetProcessInfoIn object = new GetProcessInfoIn(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getProcessInfoIn".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetProcessInfoIn) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetScopeInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetScopeInfo.java deleted file mode 100644 index 57683ed56..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetScopeInfo.java +++ /dev/null @@ -1,446 +0,0 @@ - -/** - * GetScopeInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetScopeInfo bean class - */ - -public class GetScopeInfo implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6213921875914860750L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getScopeInfo", "ns1"); - - - - /** - * field for Siid - */ - - - protected long localSiid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getSiid() { - return this.localSiid; - } - - - - /** - * Auto generated setter method - * - * @param param Siid - */ - public void setSiid(final long param) { - - this.localSiid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getScopeInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getScopeInfo", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "siid", xmlWriter); - - if (this.localSiid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("siid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSiid)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "siid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSiid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetScopeInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetScopeInfo object = new GetScopeInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getScopeInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetScopeInfo) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "siid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSiid(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetScopeInfoWithActivities.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetScopeInfoWithActivities.java deleted file mode 100644 index 38662d8bf..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetScopeInfoWithActivities.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * GetScopeInfoWithActivities.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetScopeInfoWithActivities bean class - */ - -public class GetScopeInfoWithActivities implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 3846678212389393518L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getScopeInfoWithActivities", "ns1"); - - - - /** - * field for Siid - */ - - - protected long localSiid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getSiid() { - return this.localSiid; - } - - - - /** - * Auto generated setter method - * - * @param param Siid - */ - public void setSiid(final long param) { - - this.localSiid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getScopeInfoWithActivities", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getScopeInfoWithActivities", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "siid", xmlWriter); - - if (this.localSiid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("siid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSiid)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "siid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSiid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetScopeInfoWithActivities parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetScopeInfoWithActivities object = new GetScopeInfoWithActivities(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getScopeInfoWithActivities".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetScopeInfoWithActivities) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "siid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSiid(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetServiceLocationForProcess.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetServiceLocationForProcess.java deleted file mode 100644 index 4a7569818..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetServiceLocationForProcess.java +++ /dev/null @@ -1,464 +0,0 @@ - -/** - * GetServiceLocationForProcess.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetServiceLocationForProcess bean class - */ - -public class GetServiceLocationForProcess implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 8033314774209115005L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getServiceLocationForProcess", "ns1"); - - - - /** - * field for ProcessId - */ - - - protected javax.xml.namespace.QName localProcessId; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getProcessId() { - return this.localProcessId; - } - - - - /** - * Auto generated setter method - * - * @param param ProcessId - */ - public void setProcessId(final javax.xml.namespace.QName param) { - - this.localProcessId = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getServiceLocationForProcess", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "getServiceLocationForProcess", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "processId", xmlWriter); - - - if (this.localProcessId == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("processId cannot be null!!"); - - } else { - - - writeQName(this.localProcessId, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processId")); - - if (this.localProcessId != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localProcessId)); - } else { - throw new org.apache.axis2.databinding.ADBException("processId cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetServiceLocationForProcess parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetServiceLocationForProcess object = new GetServiceLocationForProcess(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getServiceLocationForProcess".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetServiceLocationForProcess) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "processId").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setProcessId(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetVariableInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetVariableInfo.java deleted file mode 100644 index 761524b43..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/GetVariableInfo.java +++ /dev/null @@ -1,536 +0,0 @@ - -/** - * GetVariableInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * GetVariableInfo bean class - */ - -public class GetVariableInfo implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 7446737985007133948L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "getVariableInfo", "ns1"); - - - - /** - * field for Sid - */ - - - protected java.lang.String localSid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSid() { - return this.localSid; - } - - - - /** - * Auto generated setter method - * - * @param param Sid - */ - public void setSid(final java.lang.String param) { - - this.localSid = param; - - - } - - - /** - * field for VarName - */ - - - protected java.lang.String localVarName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getVarName() { - return this.localVarName; - } - - - - /** - * Auto generated setter method - * - * @param param VarName - */ - public void setVarName(final java.lang.String param) { - - this.localVarName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getVariableInfo", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getVariableInfo", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "sid", xmlWriter); - - - if (this.localSid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("sid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localSid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "varName", xmlWriter); - - - if (this.localVarName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("varName cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localVarName); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "sid")); - - if (this.localSid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSid)); - } else { - throw new org.apache.axis2.databinding.ADBException("sid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "varName")); - - if (this.localVarName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localVarName)); - } else { - throw new org.apache.axis2.databinding.ADBException("varName cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetVariableInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetVariableInfo object = new GetVariableInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getVariableInfo".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetVariableInfo) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "sid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "varName").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setVarName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/HasInstances.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/HasInstances.java deleted file mode 100644 index 8de61ba6c..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/HasInstances.java +++ /dev/null @@ -1,463 +0,0 @@ - -/** - * HasInstances.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * HasInstances bean class - */ - -public class HasInstances implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8078276101173357432L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "hasInstances", "ns1"); - - - - /** - * field for Pid - */ - - - protected javax.xml.namespace.QName localPid; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final javax.xml.namespace.QName param) { - - this.localPid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":hasInstances", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "hasInstances", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - writeQName(this.localPid, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static HasInstances parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final HasInstances object = new HasInstances(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"hasInstances".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (HasInstances) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/HasInstancesResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/HasInstancesResponse.java deleted file mode 100644 index 9a2340bb8..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/HasInstancesResponse.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * HasInstancesResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * HasInstancesResponse bean class - */ - -public class HasInstancesResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 443814587232545478L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "hasInstancesResponse", "ns1"); - - - - /** - * field for Result - */ - - - protected boolean localResult; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getResult() { - return this.localResult; - } - - - - /** - * Auto generated setter method - * - * @param param Result - */ - public void setResult(final boolean param) { - - this.localResult = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":hasInstancesResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "hasInstancesResponse", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "result", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("result cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localResult)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "result")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localResult)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static HasInstancesResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final HasInstancesResponse object = new HasInstancesResponse(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"hasInstancesResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (HasInstancesResponse) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "result").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setResult(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceDeleteStatusType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceDeleteStatusType.java deleted file mode 100644 index 33a1a6a1d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceDeleteStatusType.java +++ /dev/null @@ -1,455 +0,0 @@ - -/** - * InstanceDeleteStatusType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceDeleteStatusType bean class - */ - -public class InstanceDeleteStatusType implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6606373453578530431L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "InstanceDeleteStatusType", "ns1"); - - - - /** - * field for InstanceDeleteStatusType - */ - - - protected java.lang.String localInstanceDeleteStatusType; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected InstanceDeleteStatusType(final java.lang.String value, final boolean isRegisterValue) { - this.localInstanceDeleteStatusType = value; - if (isRegisterValue) { - - _table_.put(this.localInstanceDeleteStatusType, this); - - } - - } - - public static final java.lang.String _SUCCESS = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("SUCCESS"); - - public static final java.lang.String _FAILED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAILED"); - - public static final InstanceDeleteStatusType SUCCESS = new InstanceDeleteStatusType(_SUCCESS, true); - - public static final InstanceDeleteStatusType FAILED = new InstanceDeleteStatusType(_FAILED, true); - - - public java.lang.String getValue() { - return this.localInstanceDeleteStatusType; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localInstanceDeleteStatusType.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":InstanceDeleteStatusType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "InstanceDeleteStatusType", - xmlWriter); - } - } - - if (this.localInstanceDeleteStatusType == null) { - - throw new org.apache.axis2.databinding.ADBException("InstanceDeleteStatusType cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localInstanceDeleteStatusType); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localInstanceDeleteStatusType)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static InstanceDeleteStatusType fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final InstanceDeleteStatusType enumeration = (InstanceDeleteStatusType) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static InstanceDeleteStatusType fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static InstanceDeleteStatusType fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return InstanceDeleteStatusType.Factory.fromString(content, namespaceUri); - } else { - return InstanceDeleteStatusType.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 InstanceDeleteStatusType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - InstanceDeleteStatusType object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = InstanceDeleteStatusType.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 = InstanceDeleteStatusType.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfo.java deleted file mode 100644 index 23cd112c6..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfo.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * InstanceInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceInfo bean class - */ - -public class InstanceInfo implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -2635457105036822898L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "InstanceInfo", "ns1"); - - - - /** - * field for InstanceInfo - */ - - - protected org.wso2.bps.management.schema.InstanceInfoType localInstanceInfo; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceInfoType - */ - public org.wso2.bps.management.schema.InstanceInfoType getInstanceInfo() { - return this.localInstanceInfo; - } - - - - /** - * Auto generated setter method - * - * @param param InstanceInfo - */ - public void setInstanceInfo(final org.wso2.bps.management.schema.InstanceInfoType param) { - - this.localInstanceInfo = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localInstanceInfo == null) { - throw new org.apache.axis2.databinding.ADBException("InstanceInfo cannot be null!"); - } - this.localInstanceInfo.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localInstanceInfo.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static InstanceInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InstanceInfo object = new InstanceInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "InstanceInfo").equals(reader.getName())) { - - object.setInstanceInfo(org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoType.java deleted file mode 100644 index fdfdb6879..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoType.java +++ /dev/null @@ -1,1069 +0,0 @@ - -/** - * InstanceInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceInfoType bean class - */ - -public class InstanceInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = InstanceInfoType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -8437408050417562227L; - - /** - * field for Iid - */ - - - protected java.lang.String localIid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final java.lang.String param) { - - this.localIid = param; - - - } - - - /** - * field for Pid - */ - - - protected java.lang.String localPid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final java.lang.String param) { - - this.localPid = param; - - - } - - - /** - * field for RootScope - */ - - - protected org.wso2.bps.management.schema.ScopeInfoType localRootScope; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRootScopeTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ScopeInfoType - */ - public org.wso2.bps.management.schema.ScopeInfoType getRootScope() { - return this.localRootScope; - } - - - - /** - * Auto generated setter method - * - * @param param RootScope - */ - public void setRootScope(final org.wso2.bps.management.schema.ScopeInfoType param) { - this.localRootScopeTracker = param != null; - - this.localRootScope = param; - - - } - - - /** - * field for Status - */ - - - protected org.wso2.bps.management.schema.InstanceStatus localStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceStatus - */ - public org.wso2.bps.management.schema.InstanceStatus getStatus() { - return this.localStatus; - } - - - - /** - * Auto generated setter method - * - * @param param Status - */ - public void setStatus(final org.wso2.bps.management.schema.InstanceStatus param) { - - this.localStatus = param; - - - } - - - /** - * field for DateStarted - */ - - - protected java.util.Calendar localDateStarted; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateStarted() { - return this.localDateStarted; - } - - - - /** - * Auto generated setter method - * - * @param param DateStarted - */ - public void setDateStarted(final java.util.Calendar param) { - - this.localDateStarted = param; - - - } - - - /** - * field for DateLastActive - */ - - - protected java.util.Calendar localDateLastActive; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDateLastActiveTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateLastActive() { - return this.localDateLastActive; - } - - - - /** - * Auto generated setter method - * - * @param param DateLastActive - */ - public void setDateLastActive(final java.util.Calendar param) { - this.localDateLastActiveTracker = param != null; - - this.localDateLastActive = param; - - - } - - - /** - * field for DateErrorSince - */ - - - protected java.util.Calendar localDateErrorSince; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDateErrorSinceTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateErrorSince() { - return this.localDateErrorSince; - } - - - - /** - * Auto generated setter method - * - * @param param DateErrorSince - */ - public void setDateErrorSince(final java.util.Calendar param) { - this.localDateErrorSinceTracker = param != null; - - this.localDateErrorSince = param; - - - } - - - /** - * field for FaultInfo - */ - - - protected org.wso2.bps.management.schema.FaultInfoType localFaultInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.FaultInfoType - */ - public org.wso2.bps.management.schema.FaultInfoType getFaultInfo() { - return this.localFaultInfo; - } - - - - /** - * Auto generated setter method - * - * @param param FaultInfo - */ - public void setFaultInfo(final org.wso2.bps.management.schema.FaultInfoType param) { - this.localFaultInfoTracker = param != null; - - this.localFaultInfo = param; - - - } - - - /** - * field for FailuresInfo - */ - - - protected org.wso2.bps.management.schema.FailuresInfoType localFailuresInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFailuresInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.FailuresInfoType - */ - public org.wso2.bps.management.schema.FailuresInfoType getFailuresInfo() { - return this.localFailuresInfo; - } - - - - /** - * Auto generated setter method - * - * @param param FailuresInfo - */ - public void setFailuresInfo(final org.wso2.bps.management.schema.FailuresInfoType param) { - this.localFailuresInfoTracker = param != null; - - this.localFailuresInfo = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":InstanceInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "InstanceInfoType", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - - if (this.localIid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localIid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localPid); - - } - - xmlWriter.writeEndElement(); - if (this.localRootScopeTracker) { - if (this.localRootScope == null) { - throw new org.apache.axis2.databinding.ADBException("rootScope cannot be null!!"); - } - this.localRootScope.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "rootScope"), xmlWriter); - } - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - this.localStatus.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status"), - xmlWriter); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateStarted", xmlWriter); - - - if (this.localDateStarted == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateStarted cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateStarted)); - - } - - xmlWriter.writeEndElement(); - if (this.localDateLastActiveTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateLastActive", xmlWriter); - - - if (this.localDateLastActive == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateLastActive cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateLastActive)); - - } - - xmlWriter.writeEndElement(); - } - if (this.localDateErrorSinceTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateErrorSince", xmlWriter); - - - if (this.localDateErrorSince == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateErrorSince cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateErrorSince)); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFaultInfoTracker) { - if (this.localFaultInfo == null) { - throw new org.apache.axis2.databinding.ADBException("faultInfo cannot be null!!"); - } - this.localFaultInfo.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "faultInfo"), xmlWriter); - } - if (this.localFailuresInfoTracker) { - if (this.localFailuresInfo == null) { - throw new org.apache.axis2.databinding.ADBException("failuresInfo cannot be null!!"); - } - this.localFailuresInfo.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "failuresInfo"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - if (this.localIid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } else { - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - if (this.localRootScopeTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "rootScope")); - - - if (this.localRootScope == null) { - throw new org.apache.axis2.databinding.ADBException("rootScope cannot be null!!"); - } - elementList.add(this.localRootScope); - } - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status")); - - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - elementList.add(this.localStatus); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateStarted")); - - if (this.localDateStarted != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateStarted)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateStarted cannot be null!!"); - } - if (this.localDateLastActiveTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateLastActive")); - - if (this.localDateLastActive != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateLastActive)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateLastActive cannot be null!!"); - } - } - if (this.localDateErrorSinceTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateErrorSince")); - - if (this.localDateErrorSince != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateErrorSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateErrorSince cannot be null!!"); - } - } - if (this.localFaultInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "faultInfo")); - - - if (this.localFaultInfo == null) { - throw new org.apache.axis2.databinding.ADBException("faultInfo cannot be null!!"); - } - elementList.add(this.localFaultInfo); - } - if (this.localFailuresInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "failuresInfo")); - - - if (this.localFailuresInfo == null) { - throw new org.apache.axis2.databinding.ADBException("failuresInfo cannot be null!!"); - } - elementList.add(this.localFailuresInfo); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static InstanceInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InstanceInfoType object = new InstanceInfoType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"InstanceInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (InstanceInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "rootScope").equals(reader.getName())) { - - object.setRootScope(org.wso2.bps.management.schema.ScopeInfoType.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://wso2.org/bps/management/schema", - "status").equals(reader.getName())) { - - object.setStatus(org.wso2.bps.management.schema.InstanceStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "dateStarted").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateStarted(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://wso2.org/bps/management/schema", - "dateLastActive").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateLastActive(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://wso2.org/bps/management/schema", - "dateErrorSince").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateErrorSince(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://wso2.org/bps/management/schema", - "faultInfo").equals(reader.getName())) { - - object.setFaultInfo(org.wso2.bps.management.schema.FaultInfoType.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://wso2.org/bps/management/schema", - "failuresInfo").equals(reader.getName())) { - - object.setFailuresInfo(org.wso2.bps.management.schema.FailuresInfoType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoWithEvents.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoWithEvents.java deleted file mode 100644 index 2184c8959..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoWithEvents.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * InstanceInfoWithEvents.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceInfoWithEvents bean class - */ - -public class InstanceInfoWithEvents implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -6329199257579524056L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "InstanceInfoWithEvents", "ns1"); - - - - /** - * field for InstanceInfoWithEvents - */ - - - protected org.wso2.bps.management.schema.InstanceInfoWithEventsType localInstanceInfoWithEvents; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceInfoWithEventsType - */ - public org.wso2.bps.management.schema.InstanceInfoWithEventsType getInstanceInfoWithEvents() { - return this.localInstanceInfoWithEvents; - } - - - - /** - * Auto generated setter method - * - * @param param InstanceInfoWithEvents - */ - public void setInstanceInfoWithEvents(final org.wso2.bps.management.schema.InstanceInfoWithEventsType param) { - - this.localInstanceInfoWithEvents = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localInstanceInfoWithEvents == null) { - throw new org.apache.axis2.databinding.ADBException("InstanceInfoWithEvents cannot be null!"); - } - this.localInstanceInfoWithEvents.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localInstanceInfoWithEvents.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static InstanceInfoWithEvents parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InstanceInfoWithEvents object = new InstanceInfoWithEvents(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "InstanceInfoWithEvents").equals(reader.getName())) { - - object.setInstanceInfoWithEvents(org.wso2.bps.management.schema.InstanceInfoWithEventsType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoWithEventsType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoWithEventsType.java deleted file mode 100644 index b82942014..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceInfoWithEventsType.java +++ /dev/null @@ -1,1069 +0,0 @@ - -/** - * InstanceInfoWithEventsType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceInfoWithEventsType bean class - */ - -public class InstanceInfoWithEventsType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = InstanceInfoWithEventsType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -2792663236103460972L; - - /** - * field for Iid - */ - - - protected java.lang.String localIid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final java.lang.String param) { - - this.localIid = param; - - - } - - - /** - * field for Pid - */ - - - protected java.lang.String localPid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final java.lang.String param) { - - this.localPid = param; - - - } - - - /** - * field for RootScope - */ - - - protected org.wso2.bps.management.schema.ScopeInfoWithEventsType localRootScope; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRootScopeTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ScopeInfoWithEventsType - */ - public org.wso2.bps.management.schema.ScopeInfoWithEventsType getRootScope() { - return this.localRootScope; - } - - - - /** - * Auto generated setter method - * - * @param param RootScope - */ - public void setRootScope(final org.wso2.bps.management.schema.ScopeInfoWithEventsType param) { - this.localRootScopeTracker = param != null; - - this.localRootScope = param; - - - } - - - /** - * field for Status - */ - - - protected org.wso2.bps.management.schema.InstanceStatus localStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceStatus - */ - public org.wso2.bps.management.schema.InstanceStatus getStatus() { - return this.localStatus; - } - - - - /** - * Auto generated setter method - * - * @param param Status - */ - public void setStatus(final org.wso2.bps.management.schema.InstanceStatus param) { - - this.localStatus = param; - - - } - - - /** - * field for DateStarted - */ - - - protected java.util.Calendar localDateStarted; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateStarted() { - return this.localDateStarted; - } - - - - /** - * Auto generated setter method - * - * @param param DateStarted - */ - public void setDateStarted(final java.util.Calendar param) { - - this.localDateStarted = param; - - - } - - - /** - * field for DateLastActive - */ - - - protected java.util.Calendar localDateLastActive; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDateLastActiveTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateLastActive() { - return this.localDateLastActive; - } - - - - /** - * Auto generated setter method - * - * @param param DateLastActive - */ - public void setDateLastActive(final java.util.Calendar param) { - this.localDateLastActiveTracker = param != null; - - this.localDateLastActive = param; - - - } - - - /** - * field for DateErrorSince - */ - - - protected java.util.Calendar localDateErrorSince; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDateErrorSinceTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateErrorSince() { - return this.localDateErrorSince; - } - - - - /** - * Auto generated setter method - * - * @param param DateErrorSince - */ - public void setDateErrorSince(final java.util.Calendar param) { - this.localDateErrorSinceTracker = param != null; - - this.localDateErrorSince = param; - - - } - - - /** - * field for FaultInfo - */ - - - protected org.wso2.bps.management.schema.FaultInfoType localFaultInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFaultInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.FaultInfoType - */ - public org.wso2.bps.management.schema.FaultInfoType getFaultInfo() { - return this.localFaultInfo; - } - - - - /** - * Auto generated setter method - * - * @param param FaultInfo - */ - public void setFaultInfo(final org.wso2.bps.management.schema.FaultInfoType param) { - this.localFaultInfoTracker = param != null; - - this.localFaultInfo = param; - - - } - - - /** - * field for FailuresInfo - */ - - - protected org.wso2.bps.management.schema.FailuresInfoType localFailuresInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFailuresInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.FailuresInfoType - */ - public org.wso2.bps.management.schema.FailuresInfoType getFailuresInfo() { - return this.localFailuresInfo; - } - - - - /** - * Auto generated setter method - * - * @param param FailuresInfo - */ - public void setFailuresInfo(final org.wso2.bps.management.schema.FailuresInfoType param) { - this.localFailuresInfoTracker = param != null; - - this.localFailuresInfo = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":InstanceInfoWithEventsType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "InstanceInfoWithEventsType", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - - if (this.localIid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localIid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localPid); - - } - - xmlWriter.writeEndElement(); - if (this.localRootScopeTracker) { - if (this.localRootScope == null) { - throw new org.apache.axis2.databinding.ADBException("rootScope cannot be null!!"); - } - this.localRootScope.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "rootScope"), xmlWriter); - } - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - this.localStatus.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status"), - xmlWriter); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateStarted", xmlWriter); - - - if (this.localDateStarted == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateStarted cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateStarted)); - - } - - xmlWriter.writeEndElement(); - if (this.localDateLastActiveTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateLastActive", xmlWriter); - - - if (this.localDateLastActive == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateLastActive cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateLastActive)); - - } - - xmlWriter.writeEndElement(); - } - if (this.localDateErrorSinceTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateErrorSince", xmlWriter); - - - if (this.localDateErrorSince == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateErrorSince cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateErrorSince)); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFaultInfoTracker) { - if (this.localFaultInfo == null) { - throw new org.apache.axis2.databinding.ADBException("faultInfo cannot be null!!"); - } - this.localFaultInfo.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "faultInfo"), xmlWriter); - } - if (this.localFailuresInfoTracker) { - if (this.localFailuresInfo == null) { - throw new org.apache.axis2.databinding.ADBException("failuresInfo cannot be null!!"); - } - this.localFailuresInfo.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "failuresInfo"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - if (this.localIid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } else { - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - if (this.localRootScopeTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "rootScope")); - - - if (this.localRootScope == null) { - throw new org.apache.axis2.databinding.ADBException("rootScope cannot be null!!"); - } - elementList.add(this.localRootScope); - } - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status")); - - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - elementList.add(this.localStatus); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateStarted")); - - if (this.localDateStarted != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateStarted)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateStarted cannot be null!!"); - } - if (this.localDateLastActiveTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateLastActive")); - - if (this.localDateLastActive != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateLastActive)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateLastActive cannot be null!!"); - } - } - if (this.localDateErrorSinceTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateErrorSince")); - - if (this.localDateErrorSince != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateErrorSince)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateErrorSince cannot be null!!"); - } - } - if (this.localFaultInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "faultInfo")); - - - if (this.localFaultInfo == null) { - throw new org.apache.axis2.databinding.ADBException("faultInfo cannot be null!!"); - } - elementList.add(this.localFaultInfo); - } - if (this.localFailuresInfoTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "failuresInfo")); - - - if (this.localFailuresInfo == null) { - throw new org.apache.axis2.databinding.ADBException("failuresInfo cannot be null!!"); - } - elementList.add(this.localFailuresInfo); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static InstanceInfoWithEventsType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InstanceInfoWithEventsType object = new InstanceInfoWithEventsType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"InstanceInfoWithEventsType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (InstanceInfoWithEventsType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "rootScope").equals(reader.getName())) { - - object.setRootScope(org.wso2.bps.management.schema.ScopeInfoWithEventsType.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://wso2.org/bps/management/schema", - "status").equals(reader.getName())) { - - object.setStatus(org.wso2.bps.management.schema.InstanceStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "dateStarted").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateStarted(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://wso2.org/bps/management/schema", - "dateLastActive").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateLastActive(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://wso2.org/bps/management/schema", - "dateErrorSince").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateErrorSince(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://wso2.org/bps/management/schema", - "faultInfo").equals(reader.getName())) { - - object.setFaultInfo(org.wso2.bps.management.schema.FaultInfoType.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://wso2.org/bps/management/schema", - "failuresInfo").equals(reader.getName())) { - - object.setFailuresInfo(org.wso2.bps.management.schema.FailuresInfoType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceManagementException.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceManagementException.java deleted file mode 100644 index cd7a0104a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceManagementException.java +++ /dev/null @@ -1,536 +0,0 @@ - -/** - * InstanceManagementException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceManagementException bean class - */ - -public class InstanceManagementException implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -1012725723491905509L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException", "ns1"); - - - - /** - * field for Result - */ - - - protected java.lang.String localResult; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getResult() { - return this.localResult; - } - - - - /** - * Auto generated setter method - * - * @param param Result - */ - public void setResult(final java.lang.String param) { - - this.localResult = param; - - - } - - - /** - * field for StackTrace - */ - - - protected java.lang.String localStackTrace; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getStackTrace() { - return this.localStackTrace; - } - - - - /** - * Auto generated setter method - * - * @param param StackTrace - */ - public void setStackTrace(final java.lang.String param) { - - this.localStackTrace = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":instanceManagementException", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "instanceManagementException", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "result", xmlWriter); - - - if (this.localResult == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("result cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localResult); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "stackTrace", xmlWriter); - - - if (this.localStackTrace == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("stackTrace cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localStackTrace); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "result")); - - if (this.localResult != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localResult)); - } else { - throw new org.apache.axis2.databinding.ADBException("result cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "stackTrace")); - - if (this.localStackTrace != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localStackTrace)); - } else { - throw new org.apache.axis2.databinding.ADBException("stackTrace cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static InstanceManagementException parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InstanceManagementException object = new InstanceManagementException(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"instanceManagementException".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (InstanceManagementException) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "result").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setResult(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "stackTrace").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setStackTrace(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceStatus.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceStatus.java deleted file mode 100644 index 98c49f582..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceStatus.java +++ /dev/null @@ -1,469 +0,0 @@ - -/** - * InstanceStatus.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceStatus bean class - */ - -public class InstanceStatus implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -4753119603988978410L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "InstanceStatus", "ns1"); - - - - /** - * field for InstanceStatus - */ - - - protected java.lang.String localInstanceStatus; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected InstanceStatus(final java.lang.String value, final boolean isRegisterValue) { - this.localInstanceStatus = value; - if (isRegisterValue) { - - _table_.put(this.localInstanceStatus, this); - - } - - } - - public static final java.lang.String _ACTIVE = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("ACTIVE"); - - public static final java.lang.String _COMPLETED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COMPLETED"); - - public static final java.lang.String _TERMINATED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("TERMINATED"); - - public static final java.lang.String _FAILED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAILED"); - - public static final java.lang.String _SUSPENDED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("SUSPENDED"); - - public static final InstanceStatus ACTIVE = new InstanceStatus(_ACTIVE, true); - - public static final InstanceStatus COMPLETED = new InstanceStatus(_COMPLETED, true); - - public static final InstanceStatus TERMINATED = new InstanceStatus(_TERMINATED, true); - - public static final InstanceStatus FAILED = new InstanceStatus(_FAILED, true); - - public static final InstanceStatus SUSPENDED = new InstanceStatus(_SUSPENDED, true); - - - public java.lang.String getValue() { - return this.localInstanceStatus; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localInstanceStatus.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":InstanceStatus", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "InstanceStatus", xmlWriter); - } - } - - if (this.localInstanceStatus == null) { - - throw new org.apache.axis2.databinding.ADBException("InstanceStatus cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localInstanceStatus); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localInstanceStatus)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static InstanceStatus fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final InstanceStatus enumeration = (InstanceStatus) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static InstanceStatus fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static InstanceStatus fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return InstanceStatus.Factory.fromString(content, namespaceUri); - } else { - return InstanceStatus.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 InstanceStatus parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - InstanceStatus object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = InstanceStatus.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 = InstanceStatus.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummary.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummary.java deleted file mode 100644 index 91b57488e..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummary.java +++ /dev/null @@ -1,610 +0,0 @@ - -/** - * InstanceSummary.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceSummary bean class - */ - -public class InstanceSummary implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = InstanceSummary Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -8661132890982447769L; - - /** - * field for Instances This was an Array! - */ - - - protected org.wso2.bps.management.schema.Instances_type0[] localInstances; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInstancesTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Instances_type0[] - */ - public org.wso2.bps.management.schema.Instances_type0[] getInstances() { - return this.localInstances; - } - - - - /** - * validate the array for Instances - */ - protected void validateInstances(final org.wso2.bps.management.schema.Instances_type0[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Instances - */ - public void setInstances(final org.wso2.bps.management.schema.Instances_type0[] param) { - - validateInstances(param); - - this.localInstancesTracker = param != null; - - this.localInstances = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.Instances_type0 - */ - public void addInstances(final org.wso2.bps.management.schema.Instances_type0 param) { - if (this.localInstances == null) { - this.localInstances = new org.wso2.bps.management.schema.Instances_type0[] {}; - } - - - // update the setting tracker - this.localInstancesTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localInstances); - list.add(param); - this.localInstances = - (org.wso2.bps.management.schema.Instances_type0[]) list.toArray(new org.wso2.bps.management.schema.Instances_type0[list.size()]); - - } - - - /** - * field for Failures - */ - - - protected org.wso2.bps.management.schema.FailuresInfo localFailures; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFailuresTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.FailuresInfo - */ - public org.wso2.bps.management.schema.FailuresInfo getFailures() { - return this.localFailures; - } - - - - /** - * Auto generated setter method - * - * @param param Failures - */ - public void setFailures(final org.wso2.bps.management.schema.FailuresInfo param) { - this.localFailuresTracker = param != null; - - this.localFailures = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":InstanceSummary", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "InstanceSummary", - xmlWriter); - } - - - } - if (this.localInstancesTracker) { - if (this.localInstances != null) { - for (final Instances_type0 localInstance : this.localInstances) { - if (localInstance != null) { - localInstance.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "instances"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("instances cannot be null!!"); - - } - } - if (this.localFailuresTracker) { - if (this.localFailures == null) { - throw new org.apache.axis2.databinding.ADBException("failures cannot be null!!"); - } - this.localFailures.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "failures"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localInstancesTracker) { - if (this.localInstances != null) { - for (final Instances_type0 localInstance : this.localInstances) { - - if (localInstance != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "instances")); - elementList.add(localInstance); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("instances cannot be null!!"); - - } - - } - if (this.localFailuresTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "failures")); - - - if (this.localFailures == null) { - throw new org.apache.axis2.databinding.ADBException("failures cannot be null!!"); - } - elementList.add(this.localFailures); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static InstanceSummary parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InstanceSummary object = new InstanceSummary(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"InstanceSummary".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (InstanceSummary) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "instances").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.Instances_type0.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://wso2.org/bps/management/schema", - "instances").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.Instances_type0.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setInstances((org.wso2.bps.management.schema.Instances_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.Instances_type0.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://wso2.org/bps/management/schema", - "failures").equals(reader.getName())) { - - object.setFailures(org.wso2.bps.management.schema.FailuresInfo.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummaryE.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummaryE.java deleted file mode 100644 index 59371841d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummaryE.java +++ /dev/null @@ -1,731 +0,0 @@ - -/** - * InstanceSummaryE.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceSummaryE bean class - */ - -public class InstanceSummaryE implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -2180644006560462909L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceSummary", "ns1"); - - - - /** - * field for Active - */ - - - protected int localActive; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getActive() { - return this.localActive; - } - - - - /** - * Auto generated setter method - * - * @param param Active - */ - public void setActive(final int param) { - - this.localActive = param; - - - } - - - /** - * field for Completed - */ - - - protected int localCompleted; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getCompleted() { - return this.localCompleted; - } - - - - /** - * Auto generated setter method - * - * @param param Completed - */ - public void setCompleted(final int param) { - - this.localCompleted = param; - - - } - - - /** - * field for Terminated - */ - - - protected int localTerminated; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getTerminated() { - return this.localTerminated; - } - - - - /** - * Auto generated setter method - * - * @param param Terminated - */ - public void setTerminated(final int param) { - - this.localTerminated = param; - - - } - - - /** - * field for Failed - */ - - - protected int localFailed; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getFailed() { - return this.localFailed; - } - - - - /** - * Auto generated setter method - * - * @param param Failed - */ - public void setFailed(final int param) { - - this.localFailed = param; - - - } - - - /** - * field for Suspended - */ - - - protected int localSuspended; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getSuspended() { - return this.localSuspended; - } - - - - /** - * Auto generated setter method - * - * @param param Suspended - */ - public void setSuspended(final int param) { - - this.localSuspended = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":instanceSummary", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "instanceSummary", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "active", xmlWriter); - - if (this.localActive == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("active cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActive)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "completed", xmlWriter); - - if (this.localCompleted == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("completed cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCompleted)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "terminated", xmlWriter); - - if (this.localTerminated == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("terminated cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTerminated)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "failed", xmlWriter); - - if (this.localFailed == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("failed cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFailed)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "suspended", xmlWriter); - - if (this.localSuspended == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("suspended cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSuspended)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "active")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActive)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "completed")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCompleted)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "terminated")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTerminated)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "failed")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFailed)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "suspended")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSuspended)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static InstanceSummaryE parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InstanceSummaryE object = new InstanceSummaryE(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"instanceSummary".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (InstanceSummaryE) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "active").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setActive(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://wso2.org/bps/management/schema", - "completed").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCompleted(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://wso2.org/bps/management/schema", - "terminated").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setTerminated(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://wso2.org/bps/management/schema", - "failed").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFailed(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://wso2.org/bps/management/schema", - "suspended").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSuspended(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummaryType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummaryType.java deleted file mode 100644 index a84bc660a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/InstanceSummaryType.java +++ /dev/null @@ -1,799 +0,0 @@ - -/** - * InstanceSummaryType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * InstanceSummaryType bean class - */ - -public class InstanceSummaryType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = InstanceSummaryType Namespace - * URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 1190900623712629146L; - /** - * field for Active - */ - - - protected int localActive; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getActive() { - return this.localActive; - } - - - - /** - * Auto generated setter method - * - * @param param Active - */ - public void setActive(final int param) { - - this.localActive = param; - - - } - - - /** - * field for Completed - */ - - - protected int localCompleted; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getCompleted() { - return this.localCompleted; - } - - - - /** - * Auto generated setter method - * - * @param param Completed - */ - public void setCompleted(final int param) { - - this.localCompleted = param; - - - } - - - /** - * field for Terminated - */ - - - protected int localTerminated; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getTerminated() { - return this.localTerminated; - } - - - - /** - * Auto generated setter method - * - * @param param Terminated - */ - public void setTerminated(final int param) { - - this.localTerminated = param; - - - } - - - /** - * field for Suspended - */ - - - protected int localSuspended; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getSuspended() { - return this.localSuspended; - } - - - - /** - * Auto generated setter method - * - * @param param Suspended - */ - public void setSuspended(final int param) { - - this.localSuspended = param; - - - } - - - /** - * field for Failed - */ - - - protected int localFailed; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getFailed() { - return this.localFailed; - } - - - - /** - * Auto generated setter method - * - * @param param Failed - */ - public void setFailed(final int param) { - - this.localFailed = param; - - - } - - - /** - * field for Error - */ - - - protected int localError; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getError() { - return this.localError; - } - - - - /** - * Auto generated setter method - * - * @param param Error - */ - public void setError(final int param) { - - this.localError = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":InstanceSummaryType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "InstanceSummaryType", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "active", xmlWriter); - - if (this.localActive == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("active cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActive)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "completed", xmlWriter); - - if (this.localCompleted == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("completed cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCompleted)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "terminated", xmlWriter); - - if (this.localTerminated == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("terminated cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTerminated)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "suspended", xmlWriter); - - if (this.localSuspended == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("suspended cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSuspended)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "failed", xmlWriter); - - if (this.localFailed == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("failed cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFailed)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "error", xmlWriter); - - if (this.localError == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("error cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localError)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "active")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActive)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "completed")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCompleted)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "terminated")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localTerminated)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "suspended")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSuspended)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "failed")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFailed)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "error")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localError)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static InstanceSummaryType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final InstanceSummaryType object = new InstanceSummaryType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"InstanceSummaryType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (InstanceSummaryType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "active").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setActive(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://wso2.org/bps/management/schema", - "completed").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCompleted(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://wso2.org/bps/management/schema", - "terminated").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setTerminated(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://wso2.org/bps/management/schema", - "suspended").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSuspended(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://wso2.org/bps/management/schema", - "failed").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFailed(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://wso2.org/bps/management/schema", - "error").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setError(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Instances_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Instances_type0.java deleted file mode 100644 index 0342b41cb..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Instances_type0.java +++ /dev/null @@ -1,486 +0,0 @@ - -/** - * Instances_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * Instances_type0 bean class - */ - -public class Instances_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = instances_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -2706941991022145655L; - /** - * field for Count This was an Attribute! - */ - - - protected int localCount; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getCount() { - return this.localCount; - } - - - - /** - * Auto generated setter method - * - * @param param Count - */ - public void setCount(final int param) { - - this.localCount = param; - - - } - - - /** - * field for State This was an Attribute! - */ - - - protected org.wso2.bps.management.schema.InstanceStatus localState; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceStatus - */ - public org.wso2.bps.management.schema.InstanceStatus getState() { - return this.localState; - } - - - - /** - * Auto generated setter method - * - * @param param State - */ - public void setState(final org.wso2.bps.management.schema.InstanceStatus param) { - - this.localState = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":instances_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "instances_type0", - xmlWriter); - } - - - } - - if (this.localCount != java.lang.Integer.MIN_VALUE) { - - writeAttribute("", "count", - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCount), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localCount is null"); - } - - - if (this.localState != null) { - writeAttribute("", "state", this.localState.toString(), xmlWriter); - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("", "count")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCount)); - - attribList.add(new javax.xml.namespace.QName("", "state")); - - attribList.add(this.localState.toString()); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Instances_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Instances_type0 object = new Instances_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"instances_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Instances_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // handle attribute "count" - final java.lang.String tempAttribCount = - - reader.getAttributeValue(null, "count"); - - if (tempAttribCount != null) { - final java.lang.String content = tempAttribCount; - - object.setCount(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(tempAttribCount)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute count is missing"); - - } - handledAttributes.add("count"); - - // handle attribute "state" - final java.lang.String tempAttribState = - - reader.getAttributeValue(null, "state"); - - if (tempAttribState != null) { - final java.lang.String content = tempAttribState; - - object.setState(org.wso2.bps.management.schema.InstanceStatus.Factory.fromString(reader, - tempAttribState)); - - } else { - - } - handledAttributes.add("state"); - - - reader.next(); - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/LimitedInstanceInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/LimitedInstanceInfoType.java deleted file mode 100644 index ce1918d49..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/LimitedInstanceInfoType.java +++ /dev/null @@ -1,765 +0,0 @@ - -/** - * LimitedInstanceInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * LimitedInstanceInfoType bean class - */ - -public class LimitedInstanceInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = LimitedInstanceInfoType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -1691875120020248768L; - - /** - * field for Iid - */ - - - protected java.lang.String localIid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final java.lang.String param) { - - this.localIid = param; - - - } - - - /** - * field for Pid - */ - - - protected java.lang.String localPid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final java.lang.String param) { - - this.localPid = param; - - - } - - - /** - * field for Status - */ - - - protected org.wso2.bps.management.schema.InstanceStatus localStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceStatus - */ - public org.wso2.bps.management.schema.InstanceStatus getStatus() { - return this.localStatus; - } - - - - /** - * Auto generated setter method - * - * @param param Status - */ - public void setStatus(final org.wso2.bps.management.schema.InstanceStatus param) { - - this.localStatus = param; - - - } - - - /** - * field for DateStarted - */ - - - protected java.util.Calendar localDateStarted; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateStarted() { - return this.localDateStarted; - } - - - - /** - * Auto generated setter method - * - * @param param DateStarted - */ - public void setDateStarted(final java.util.Calendar param) { - - this.localDateStarted = param; - - - } - - - /** - * field for DateLastActive - */ - - - protected java.util.Calendar localDateLastActive; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDateLastActiveTracker = false; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDateLastActive() { - return this.localDateLastActive; - } - - - - /** - * Auto generated setter method - * - * @param param DateLastActive - */ - public void setDateLastActive(final java.util.Calendar param) { - this.localDateLastActiveTracker = param != null; - - this.localDateLastActive = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":LimitedInstanceInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "LimitedInstanceInfoType", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - - if (this.localIid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localIid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localPid); - - } - - xmlWriter.writeEndElement(); - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - this.localStatus.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status"), - xmlWriter); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateStarted", xmlWriter); - - - if (this.localDateStarted == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateStarted cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateStarted)); - - } - - xmlWriter.writeEndElement(); - if (this.localDateLastActiveTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "dateLastActive", xmlWriter); - - - if (this.localDateLastActive == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("dateLastActive cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateLastActive)); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - if (this.localIid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } else { - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status")); - - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - elementList.add(this.localStatus); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateStarted")); - - if (this.localDateStarted != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateStarted)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateStarted cannot be null!!"); - } - if (this.localDateLastActiveTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "dateLastActive")); - - if (this.localDateLastActive != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDateLastActive)); - } else { - throw new org.apache.axis2.databinding.ADBException("dateLastActive cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static LimitedInstanceInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LimitedInstanceInfoType object = new LimitedInstanceInfoType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"LimitedInstanceInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LimitedInstanceInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "status").equals(reader.getName())) { - - object.setStatus(org.wso2.bps.management.schema.InstanceStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "dateStarted").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateStarted(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://wso2.org/bps/management/schema", - "dateLastActive").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDateLastActive(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/LimitedProcessInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/LimitedProcessInfoType.java deleted file mode 100644 index 2c94e556d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/LimitedProcessInfoType.java +++ /dev/null @@ -1,741 +0,0 @@ - -/** - * LimitedProcessInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * LimitedProcessInfoType bean class - */ - -public class LimitedProcessInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = LimitedProcessInfoType Namespace - * URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 5060681883899657957L; - /** - * field for Pid - */ - - - protected java.lang.String localPid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final java.lang.String param) { - - this.localPid = param; - - - } - - - /** - * field for Version - */ - - - protected long localVersion; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getVersion() { - return this.localVersion; - } - - - - /** - * Auto generated setter method - * - * @param param Version - */ - public void setVersion(final long param) { - - this.localVersion = param; - - - } - - - /** - * field for Status - */ - - - protected org.wso2.bps.management.schema.ProcessStatus localStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ProcessStatus - */ - public org.wso2.bps.management.schema.ProcessStatus getStatus() { - return this.localStatus; - } - - - - /** - * Auto generated setter method - * - * @param param Status - */ - public void setStatus(final org.wso2.bps.management.schema.ProcessStatus param) { - - this.localStatus = param; - - - } - - - /** - * field for DeployedDate - */ - - - protected java.util.Calendar localDeployedDate; - - - /** - * Auto generated getter method - * - * @return java.util.Calendar - */ - public java.util.Calendar getDeployedDate() { - return this.localDeployedDate; - } - - - - /** - * Auto generated setter method - * - * @param param DeployedDate - */ - public void setDeployedDate(final java.util.Calendar param) { - - this.localDeployedDate = param; - - - } - - - /** - * field for OlderVersion - */ - - - protected int localOlderVersion; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getOlderVersion() { - return this.localOlderVersion; - } - - - - /** - * Auto generated setter method - * - * @param param OlderVersion - */ - public void setOlderVersion(final int param) { - - this.localOlderVersion = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":LimitedProcessInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "LimitedProcessInfoType", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localPid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "version", xmlWriter); - - if (this.localVersion == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("version cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localVersion)); - } - - xmlWriter.writeEndElement(); - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - this.localStatus.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status"), - xmlWriter); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "deployedDate", xmlWriter); - - - if (this.localDeployedDate == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("deployedDate cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDeployedDate)); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "olderVersion", xmlWriter); - - if (this.localOlderVersion == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("olderVersion cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOlderVersion)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "version")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localVersion)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status")); - - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - elementList.add(this.localStatus); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deployedDate")); - - if (this.localDeployedDate != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDeployedDate)); - } else { - throw new org.apache.axis2.databinding.ADBException("deployedDate cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "olderVersion")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOlderVersion)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static LimitedProcessInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LimitedProcessInfoType object = new LimitedProcessInfoType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"LimitedProcessInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LimitedProcessInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "version").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setVersion(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://wso2.org/bps/management/schema", - "status").equals(reader.getName())) { - - object.setStatus(org.wso2.bps.management.schema.ProcessStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "deployedDate").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDeployedDate(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://wso2.org/bps/management/schema", - "olderVersion").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setOlderVersion(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListDeployedPackagesPaginated.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListDeployedPackagesPaginated.java deleted file mode 100644 index 08390d0ed..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListDeployedPackagesPaginated.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * ListDeployedPackagesPaginated.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ListDeployedPackagesPaginated bean class - */ - -public class ListDeployedPackagesPaginated implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 3140864953212021377L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "listDeployedPackagesPaginated", "ns1"); - - - - /** - * field for Page - */ - - - protected int localPage; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getPage() { - return this.localPage; - } - - - - /** - * Auto generated setter method - * - * @param param Page - */ - public void setPage(final int param) { - - this.localPage = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":listDeployedPackagesPaginated", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "listDeployedPackagesPaginated", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "page", xmlWriter); - - if (this.localPage == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("page cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPage)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "page")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPage)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ListDeployedPackagesPaginated parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ListDeployedPackagesPaginated object = new ListDeployedPackagesPaginated(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"listDeployedPackagesPaginated".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListDeployedPackagesPaginated) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "page").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPage(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesCustomPaginatedIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesCustomPaginatedIn.java deleted file mode 100644 index 72b01a014..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesCustomPaginatedIn.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * ListProcessesCustomPaginatedIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ListProcessesCustomPaginatedIn bean class - */ - -public class ListProcessesCustomPaginatedIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 782006749968875327L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "listProcessesCustomPaginatedIn", "ns1"); - - - - /** - * field for ListProcessesCustomPaginatedIn - */ - - - protected org.wso2.bps.management.schema.ListProcessesCustomPaginatedInput localListProcessesCustomPaginatedIn; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ListProcessesCustomPaginatedInput - */ - public org.wso2.bps.management.schema.ListProcessesCustomPaginatedInput getListProcessesCustomPaginatedIn() { - return this.localListProcessesCustomPaginatedIn; - } - - - - /** - * Auto generated setter method - * - * @param param ListProcessesCustomPaginatedIn - */ - public void setListProcessesCustomPaginatedIn(final org.wso2.bps.management.schema.ListProcessesCustomPaginatedInput param) { - - this.localListProcessesCustomPaginatedIn = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localListProcessesCustomPaginatedIn == null) { - throw new org.apache.axis2.databinding.ADBException("listProcessesCustomPaginatedIn cannot be null!"); - } - this.localListProcessesCustomPaginatedIn.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localListProcessesCustomPaginatedIn.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ListProcessesCustomPaginatedIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ListProcessesCustomPaginatedIn object = new ListProcessesCustomPaginatedIn(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "listProcessesCustomPaginatedIn").equals(reader.getName())) { - - object.setListProcessesCustomPaginatedIn(org.wso2.bps.management.schema.ListProcessesCustomPaginatedInput.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesCustomPaginatedInput.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesCustomPaginatedInput.java deleted file mode 100644 index 13bc92a6d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesCustomPaginatedInput.java +++ /dev/null @@ -1,685 +0,0 @@ - -/** - * ListProcessesCustomPaginatedInput.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ListProcessesCustomPaginatedInput bean class - */ - -public class ListProcessesCustomPaginatedInput implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = - * listProcessesCustomPaginatedInput Namespace URI = http://wso2.org/bps/management/schema Namespace - * Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 3449847511458820421L; - /** - * field for Filter - */ - - - protected java.lang.String localFilter; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFilter() { - return this.localFilter; - } - - - - /** - * Auto generated setter method - * - * @param param Filter - */ - public void setFilter(final java.lang.String param) { - - this.localFilter = param; - - - } - - - /** - * field for OrderbyKeys - */ - - - protected java.lang.String localOrderbyKeys; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getOrderbyKeys() { - return this.localOrderbyKeys; - } - - - - /** - * Auto generated setter method - * - * @param param OrderbyKeys - */ - public void setOrderbyKeys(final java.lang.String param) { - - this.localOrderbyKeys = param; - - - } - - - /** - * field for Customizer - */ - - - protected java.lang.String localCustomizer; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCustomizer() { - return this.localCustomizer; - } - - - - /** - * Auto generated setter method - * - * @param param Customizer - */ - public void setCustomizer(final java.lang.String param) { - - this.localCustomizer = param; - - - } - - - /** - * field for Page - */ - - - protected int localPage; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getPage() { - return this.localPage; - } - - - - /** - * Auto generated setter method - * - * @param param Page - */ - public void setPage(final int param) { - - this.localPage = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":listProcessesCustomPaginatedInput", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "listProcessesCustomPaginatedInput", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "filter", xmlWriter); - - - if (this.localFilter == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("filter cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localFilter); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "orderbyKeys", xmlWriter); - - - if (this.localOrderbyKeys == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("orderbyKeys cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localOrderbyKeys); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "customizer", xmlWriter); - - - if (this.localCustomizer == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("customizer cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localCustomizer); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "page", xmlWriter); - - if (this.localPage == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("page cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPage)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "filter")); - - if (this.localFilter != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFilter)); - } else { - throw new org.apache.axis2.databinding.ADBException("filter cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "orderbyKeys")); - - if (this.localOrderbyKeys != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOrderbyKeys)); - } else { - throw new org.apache.axis2.databinding.ADBException("orderbyKeys cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "customizer")); - - if (this.localCustomizer != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCustomizer)); - } else { - throw new org.apache.axis2.databinding.ADBException("customizer cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "page")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPage)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ListProcessesCustomPaginatedInput parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ListProcessesCustomPaginatedInput object = new ListProcessesCustomPaginatedInput(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"listProcessesCustomPaginatedInput".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListProcessesCustomPaginatedInput) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "filter").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setFilter(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "orderbyKeys").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setOrderbyKeys(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "customizer").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setCustomizer(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "page").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPage(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesInPackage.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesInPackage.java deleted file mode 100644 index 8c4127102..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ListProcessesInPackage.java +++ /dev/null @@ -1,456 +0,0 @@ - -/** - * ListProcessesInPackage.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ListProcessesInPackage bean class - */ - -public class ListProcessesInPackage implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 7159337413480914396L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "listProcessesInPackage", "ns1"); - - - - /** - * field for _package - */ - - - protected java.lang.String local_package; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String get_package() { - return this.local_package; - } - - - - /** - * Auto generated setter method - * - * @param param _package - */ - public void set_package(final java.lang.String param) { - - this.local_package = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":listProcessesInPackage", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "listProcessesInPackage", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "package", xmlWriter); - - - if (this.local_package == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.local_package); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "package")); - - if (this.local_package != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_package)); - } else { - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ListProcessesInPackage parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ListProcessesInPackage object = new ListProcessesInPackage(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"listProcessesInPackage".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ListProcessesInPackage) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "package").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_package(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PackageManagementException.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PackageManagementException.java deleted file mode 100644 index a0bc39d29..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PackageManagementException.java +++ /dev/null @@ -1,536 +0,0 @@ - -/** - * PackageManagementException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * PackageManagementException bean class - */ - -public class PackageManagementException implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 7754755011013951572L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "packageManagementException", "ns1"); - - - - /** - * field for Result - */ - - - protected java.lang.String localResult; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getResult() { - return this.localResult; - } - - - - /** - * Auto generated setter method - * - * @param param Result - */ - public void setResult(final java.lang.String param) { - - this.localResult = param; - - - } - - - /** - * field for StackTrace - */ - - - protected java.lang.String localStackTrace; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getStackTrace() { - return this.localStackTrace; - } - - - - /** - * Auto generated setter method - * - * @param param StackTrace - */ - public void setStackTrace(final java.lang.String param) { - - this.localStackTrace = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":packageManagementException", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "packageManagementException", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "result", xmlWriter); - - - if (this.localResult == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("result cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localResult); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "stackTrace", xmlWriter); - - - if (this.localStackTrace == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("stackTrace cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localStackTrace); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "result")); - - if (this.localResult != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localResult)); - } else { - throw new org.apache.axis2.databinding.ADBException("result cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "stackTrace")); - - if (this.localStackTrace != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localStackTrace)); - } else { - throw new org.apache.axis2.databinding.ADBException("stackTrace cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static PackageManagementException parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final PackageManagementException object = new PackageManagementException(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"packageManagementException".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PackageManagementException) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "result").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setResult(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "stackTrace").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setStackTrace(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PackageStatusType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PackageStatusType.java deleted file mode 100644 index fd1ea12ba..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PackageStatusType.java +++ /dev/null @@ -1,470 +0,0 @@ - -/** - * PackageStatusType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * PackageStatusType bean class - */ - -public class PackageStatusType implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6187334727448908369L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "PackageStatusType", "ns1"); - - - - /** - * field for PackageStatusType - */ - - - protected java.lang.String localPackageStatusType; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected PackageStatusType(final java.lang.String value, final boolean isRegisterValue) { - this.localPackageStatusType = value; - if (isRegisterValue) { - - _table_.put(this.localPackageStatusType, this); - - } - - } - - public static final java.lang.String _UNDEPLOYED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("UNDEPLOYED"); - - public static final java.lang.String _DEPLOYED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("DEPLOYED"); - - public static final java.lang.String _UPDATED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("UPDATED"); - - public static final java.lang.String _FAILED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAILED"); - - public static final java.lang.String _UNDEFINED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("UNDEFINED"); - - public static final PackageStatusType UNDEPLOYED = new PackageStatusType(_UNDEPLOYED, true); - - public static final PackageStatusType DEPLOYED = new PackageStatusType(_DEPLOYED, true); - - public static final PackageStatusType UPDATED = new PackageStatusType(_UPDATED, true); - - public static final PackageStatusType FAILED = new PackageStatusType(_FAILED, true); - - public static final PackageStatusType UNDEFINED = new PackageStatusType(_UNDEFINED, true); - - - public java.lang.String getValue() { - return this.localPackageStatusType; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localPackageStatusType.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":PackageStatusType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PackageStatusType", - xmlWriter); - } - } - - if (this.localPackageStatusType == null) { - - throw new org.apache.axis2.databinding.ADBException("PackageStatusType cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localPackageStatusType); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localPackageStatusType)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static PackageStatusType fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final PackageStatusType enumeration = (PackageStatusType) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static PackageStatusType fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static PackageStatusType fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return PackageStatusType.Factory.fromString(content, namespaceUri); - } else { - return PackageStatusType.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 PackageStatusType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - PackageStatusType object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = PackageStatusType.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 = PackageStatusType.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Package_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Package_type0.java deleted file mode 100644 index cf9c35f89..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Package_type0.java +++ /dev/null @@ -1,662 +0,0 @@ - -/** - * Package_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * Package_type0 bean class - */ - -public class Package_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = package_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 5431963653421267234L; - - /** - * field for Name - */ - - - protected java.lang.String localName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - - this.localName = param; - - - } - - - /** - * field for Versions - */ - - - protected org.wso2.bps.management.schema.Versions_type0 localVersions; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Versions_type0 - */ - public org.wso2.bps.management.schema.Versions_type0 getVersions() { - return this.localVersions; - } - - - - /** - * Auto generated setter method - * - * @param param Versions - */ - public void setVersions(final org.wso2.bps.management.schema.Versions_type0 param) { - - this.localVersions = param; - - - } - - - /** - * field for ErrorLog - */ - - - protected java.lang.String localErrorLog; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localErrorLogTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getErrorLog() { - return this.localErrorLog; - } - - - - /** - * Auto generated setter method - * - * @param param ErrorLog - */ - public void setErrorLog(final java.lang.String param) { - this.localErrorLogTracker = param != null; - - this.localErrorLog = param; - - - } - - - /** - * field for State This was an Attribute! - */ - - - protected org.wso2.bps.management.schema.PackageStatusType localState; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.PackageStatusType - */ - public org.wso2.bps.management.schema.PackageStatusType getState() { - return this.localState; - } - - - - /** - * Auto generated setter method - * - * @param param State - */ - public void setState(final org.wso2.bps.management.schema.PackageStatusType param) { - - this.localState = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":package_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "package_type0", xmlWriter); - } - - - } - - - if (this.localState != null) { - writeAttribute("", "state", this.localState.toString(), xmlWriter); - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - - if (this.localVersions == null) { - throw new org.apache.axis2.databinding.ADBException("versions cannot be null!!"); - } - this.localVersions.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "versions"), - xmlWriter); - if (this.localErrorLogTracker) { - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "errorLog", xmlWriter); - - - if (this.localErrorLog == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("errorLog cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localErrorLog); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "name")); - - if (this.localName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "versions")); - - - if (this.localVersions == null) { - throw new org.apache.axis2.databinding.ADBException("versions cannot be null!!"); - } - elementList.add(this.localVersions); - if (this.localErrorLogTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "errorLog")); - - if (this.localErrorLog != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localErrorLog)); - } else { - throw new org.apache.axis2.databinding.ADBException("errorLog cannot be null!!"); - } - } - attribList.add(new javax.xml.namespace.QName("", "state")); - - attribList.add(this.localState.toString()); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Package_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Package_type0 object = new Package_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"package_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Package_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // handle attribute "state" - final java.lang.String tempAttribState = - - reader.getAttributeValue(null, "state"); - - if (tempAttribState != null) { - final java.lang.String content = tempAttribState; - - object.setState(org.wso2.bps.management.schema.PackageStatusType.Factory.fromString(reader, - tempAttribState)); - - } else { - - } - handledAttributes.add("state"); - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "name").equals(reader.getName())) { - - final 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://wso2.org/bps/management/schema", - "versions").equals(reader.getName())) { - - object.setVersions(org.wso2.bps.management.schema.Versions_type0.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "errorLog").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setErrorLog(org.apache.axis2.databinding.utils.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PaginatedInstanceList.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PaginatedInstanceList.java deleted file mode 100644 index 03dd04f69..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PaginatedInstanceList.java +++ /dev/null @@ -1,610 +0,0 @@ - -/** - * PaginatedInstanceList.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * PaginatedInstanceList bean class - */ - -public class PaginatedInstanceList implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 1986789658511481287L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "PaginatedInstanceList", "ns1"); - - - - /** - * field for Pages - */ - - - protected int localPages; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getPages() { - return this.localPages; - } - - - - /** - * Auto generated setter method - * - * @param param Pages - */ - public void setPages(final int param) { - - this.localPages = param; - - - } - - - /** - * field for Instance This was an Array! - */ - - - protected org.wso2.bps.management.schema.LimitedInstanceInfoType[] localInstance; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInstanceTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.LimitedInstanceInfoType[] - */ - public org.wso2.bps.management.schema.LimitedInstanceInfoType[] getInstance() { - return this.localInstance; - } - - - - /** - * validate the array for Instance - */ - protected void validateInstance(final org.wso2.bps.management.schema.LimitedInstanceInfoType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Instance - */ - public void setInstance(final org.wso2.bps.management.schema.LimitedInstanceInfoType[] param) { - - validateInstance(param); - - this.localInstanceTracker = param != null; - - this.localInstance = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.LimitedInstanceInfoType - */ - public void addInstance(final org.wso2.bps.management.schema.LimitedInstanceInfoType param) { - if (this.localInstance == null) { - this.localInstance = new org.wso2.bps.management.schema.LimitedInstanceInfoType[] {}; - } - - - // update the setting tracker - this.localInstanceTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localInstance); - list.add(param); - this.localInstance = - (org.wso2.bps.management.schema.LimitedInstanceInfoType[]) list.toArray(new org.wso2.bps.management.schema.LimitedInstanceInfoType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":PaginatedInstanceList", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PaginatedInstanceList", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pages", xmlWriter); - - if (this.localPages == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("pages cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPages)); - } - - xmlWriter.writeEndElement(); - if (this.localInstanceTracker) { - if (this.localInstance != null) { - for (final LimitedInstanceInfoType element : this.localInstance) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "Instance"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Instance cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pages")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPages)); - if (this.localInstanceTracker) { - if (this.localInstance != null) { - for (final LimitedInstanceInfoType element : this.localInstance) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "Instance")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("Instance cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static PaginatedInstanceList parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final PaginatedInstanceList object = new PaginatedInstanceList(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"PaginatedInstanceList".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PaginatedInstanceList) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list2 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pages").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPages(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://wso2.org/bps/management/schema", - "Instance").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list2.add(org.wso2.bps.management.schema.LimitedInstanceInfoType.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://wso2.org/bps/management/schema", - "Instance").equals(reader.getName())) { - list2.add(org.wso2.bps.management.schema.LimitedInstanceInfoType.Factory.parse(reader)); - - } else { - loopDone2 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setInstance((org.wso2.bps.management.schema.LimitedInstanceInfoType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.LimitedInstanceInfoType.class, - list2)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PaginatedProcessInfoList.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PaginatedProcessInfoList.java deleted file mode 100644 index a8cc5e485..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/PaginatedProcessInfoList.java +++ /dev/null @@ -1,610 +0,0 @@ - -/** - * PaginatedProcessInfoList.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * PaginatedProcessInfoList bean class - */ - -public class PaginatedProcessInfoList implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -9223065646229327067L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "PaginatedProcessInfoList", "ns1"); - - - - /** - * field for Pages - */ - - - protected int localPages; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getPages() { - return this.localPages; - } - - - - /** - * Auto generated setter method - * - * @param param Pages - */ - public void setPages(final int param) { - - this.localPages = param; - - - } - - - /** - * field for ProcessInfo This was an Array! - */ - - - protected org.wso2.bps.management.schema.LimitedProcessInfoType[] localProcessInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localProcessInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.LimitedProcessInfoType[] - */ - public org.wso2.bps.management.schema.LimitedProcessInfoType[] getProcessInfo() { - return this.localProcessInfo; - } - - - - /** - * validate the array for ProcessInfo - */ - protected void validateProcessInfo(final org.wso2.bps.management.schema.LimitedProcessInfoType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ProcessInfo - */ - public void setProcessInfo(final org.wso2.bps.management.schema.LimitedProcessInfoType[] param) { - - validateProcessInfo(param); - - this.localProcessInfoTracker = param != null; - - this.localProcessInfo = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.LimitedProcessInfoType - */ - public void addProcessInfo(final org.wso2.bps.management.schema.LimitedProcessInfoType param) { - if (this.localProcessInfo == null) { - this.localProcessInfo = new org.wso2.bps.management.schema.LimitedProcessInfoType[] {}; - } - - - // update the setting tracker - this.localProcessInfoTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localProcessInfo); - list.add(param); - this.localProcessInfo = - (org.wso2.bps.management.schema.LimitedProcessInfoType[]) list.toArray(new org.wso2.bps.management.schema.LimitedProcessInfoType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":PaginatedProcessInfoList", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "PaginatedProcessInfoList", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pages", xmlWriter); - - if (this.localPages == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("pages cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPages)); - } - - xmlWriter.writeEndElement(); - if (this.localProcessInfoTracker) { - if (this.localProcessInfo != null) { - for (final LimitedProcessInfoType element : this.localProcessInfo) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "ProcessInfo"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("ProcessInfo cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pages")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPages)); - if (this.localProcessInfoTracker) { - if (this.localProcessInfo != null) { - for (final LimitedProcessInfoType element : this.localProcessInfo) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "ProcessInfo")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("ProcessInfo cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static PaginatedProcessInfoList parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final PaginatedProcessInfoList object = new PaginatedProcessInfoList(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"PaginatedProcessInfoList".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (PaginatedProcessInfoList) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list2 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pages").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPages(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://wso2.org/bps/management/schema", - "ProcessInfo").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list2.add(org.wso2.bps.management.schema.LimitedProcessInfoType.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://wso2.org/bps/management/schema", - "ProcessInfo").equals(reader.getName())) { - list2.add(org.wso2.bps.management.schema.LimitedProcessInfoType.Factory.parse(reader)); - - } else { - loopDone2 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setProcessInfo((org.wso2.bps.management.schema.LimitedProcessInfoType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.LimitedProcessInfoType.class, - list2)); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessAndInstanceSummary.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessAndInstanceSummary.java deleted file mode 100644 index cd8033ad5..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessAndInstanceSummary.java +++ /dev/null @@ -1,655 +0,0 @@ - -/** - * ProcessAndInstanceSummary.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessAndInstanceSummary bean class - */ - -public class ProcessAndInstanceSummary implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6281794185660592200L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ProcessAndInstanceSummary", "ns1"); - - - - /** - * field for Instances - */ - - - protected org.wso2.bps.management.schema.InstanceSummaryType localInstances; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceSummaryType - */ - public org.wso2.bps.management.schema.InstanceSummaryType getInstances() { - return this.localInstances; - } - - - - /** - * Auto generated setter method - * - * @param param Instances - */ - public void setInstances(final org.wso2.bps.management.schema.InstanceSummaryType param) { - - this.localInstances = param; - - - } - - - /** - * field for ActiveProcesses - */ - - - protected int localActiveProcesses; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getActiveProcesses() { - return this.localActiveProcesses; - } - - - - /** - * Auto generated setter method - * - * @param param ActiveProcesses - */ - public void setActiveProcesses(final int param) { - - this.localActiveProcesses = param; - - - } - - - /** - * field for RetiredProcesses - */ - - - protected int localRetiredProcesses; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getRetiredProcesses() { - return this.localRetiredProcesses; - } - - - - /** - * Auto generated setter method - * - * @param param RetiredProcesses - */ - public void setRetiredProcesses(final int param) { - - this.localRetiredProcesses = param; - - - } - - - /** - * field for DisabledProcesses - */ - - - protected int localDisabledProcesses; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getDisabledProcesses() { - return this.localDisabledProcesses; - } - - - - /** - * Auto generated setter method - * - * @param param DisabledProcesses - */ - public void setDisabledProcesses(final int param) { - - this.localDisabledProcesses = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ProcessAndInstanceSummary", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ProcessAndInstanceSummary", - xmlWriter); - } - - - } - - if (this.localInstances == null) { - throw new org.apache.axis2.databinding.ADBException("instances cannot be null!!"); - } - this.localInstances.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "instances"), xmlWriter); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "activeProcesses", xmlWriter); - - if (this.localActiveProcesses == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("activeProcesses cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActiveProcesses)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "retiredProcesses", xmlWriter); - - if (this.localRetiredProcesses == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("retiredProcesses cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRetiredProcesses)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "disabledProcesses", xmlWriter); - - if (this.localDisabledProcesses == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("disabledProcesses cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDisabledProcesses)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instances")); - - - if (this.localInstances == null) { - throw new org.apache.axis2.databinding.ADBException("instances cannot be null!!"); - } - elementList.add(this.localInstances); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "activeProcesses")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localActiveProcesses)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "retiredProcesses")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRetiredProcesses)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "disabledProcesses")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localDisabledProcesses)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessAndInstanceSummary parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessAndInstanceSummary object = new ProcessAndInstanceSummary(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ProcessAndInstanceSummary".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ProcessAndInstanceSummary) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "instances").equals(reader.getName())) { - - object.setInstances(org.wso2.bps.management.schema.InstanceSummaryType.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activeProcesses").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setActiveProcesses(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://wso2.org/bps/management/schema", - "retiredProcesses").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setRetiredProcesses(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://wso2.org/bps/management/schema", - "disabledProcesses").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setDisabledProcesses(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessDefinition.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessDefinition.java deleted file mode 100644 index 62c534505..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessDefinition.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * ProcessDefinition.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessDefinition bean class - */ - -public class ProcessDefinition implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -7947865401122058484L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processDefinition", "ns1"); - - - - /** - * field for ProcessDefinition - */ - - - protected org.wso2.bps.management.schema.BpelDefinition localProcessDefinition; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.BpelDefinition - */ - public org.wso2.bps.management.schema.BpelDefinition getProcessDefinition() { - return this.localProcessDefinition; - } - - - - /** - * Auto generated setter method - * - * @param param ProcessDefinition - */ - public void setProcessDefinition(final org.wso2.bps.management.schema.BpelDefinition param) { - - this.localProcessDefinition = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localProcessDefinition == null) { - throw new org.apache.axis2.databinding.ADBException("processDefinition cannot be null!"); - } - this.localProcessDefinition.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localProcessDefinition.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessDefinition parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessDefinition object = new ProcessDefinition(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "processDefinition").equals(reader.getName())) { - - object.setProcessDefinition(org.wso2.bps.management.schema.BpelDefinition.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessIDList.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessIDList.java deleted file mode 100644 index 764596671..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessIDList.java +++ /dev/null @@ -1,545 +0,0 @@ - -/** - * ProcessIDList.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessIDList bean class - */ - -public class ProcessIDList implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 4042149297127681908L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ProcessIDList", "ns1"); - - - - /** - * field for Pid This was an Array! - */ - - - protected java.lang.String[] localPid; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPidTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getPid() { - return this.localPid; - } - - - - /** - * validate the array for Pid - */ - protected void validatePid(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final java.lang.String[] param) { - - validatePid(param); - - this.localPidTracker = param != null; - - this.localPid = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addPid(final java.lang.String param) { - if (this.localPid == null) { - this.localPid = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localPidTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localPid); - list.add(param); - this.localPid = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ProcessIDList", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ProcessIDList", xmlWriter); - } - - - } - if (this.localPidTracker) { - if (this.localPid != null) { - namespace = "http://wso2.org/bps/management/schema"; - for (final String element : this.localPid) { - - if (element != null) { - - writeStartElement(null, namespace, "pid", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localPidTracker) { - if (this.localPid != null) { - for (final String element : this.localPid) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessIDList parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessIDList object = new ProcessIDList(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ProcessIDList".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ProcessIDList) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(reader.getElementText()); - - // loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while (!loopDone1) { - // 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 - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - list1.add(reader.getElementText()); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setPid((java.lang.String[]) list1.toArray(new java.lang.String[list1.size()])); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInfo.java deleted file mode 100644 index d13b887fd..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInfo.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * ProcessInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessInfo bean class - */ - -public class ProcessInfo implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -457137391895045267L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ProcessInfo", "ns1"); - - - - /** - * field for ProcessInfo - */ - - - protected org.wso2.bps.management.schema.ProcessInfoType localProcessInfo; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ProcessInfoType - */ - public org.wso2.bps.management.schema.ProcessInfoType getProcessInfo() { - return this.localProcessInfo; - } - - - - /** - * Auto generated setter method - * - * @param param ProcessInfo - */ - public void setProcessInfo(final org.wso2.bps.management.schema.ProcessInfoType param) { - - this.localProcessInfo = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localProcessInfo == null) { - throw new org.apache.axis2.databinding.ADBException("ProcessInfo cannot be null!"); - } - this.localProcessInfo.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localProcessInfo.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessInfo object = new ProcessInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "ProcessInfo").equals(reader.getName())) { - - object.setProcessInfo(org.wso2.bps.management.schema.ProcessInfoType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInfoType.java deleted file mode 100644 index dd341443f..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInfoType.java +++ /dev/null @@ -1,1261 +0,0 @@ - -/** - * ProcessInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - -import org.apache.axiom.om.OMAttribute; -import org.apache.axiom.om.OMElement; - -/** - * ProcessInfoType bean class - */ - -public class ProcessInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ProcessInfoType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 8513222610797331327L; - - /** - * field for Pid - */ - - - protected java.lang.String localPid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final java.lang.String param) { - - this.localPid = param; - - - } - - - /** - * field for Version - */ - - - protected long localVersion; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getVersion() { - return this.localVersion; - } - - - - /** - * Auto generated setter method - * - * @param param Version - */ - public void setVersion(final long param) { - - this.localVersion = param; - - - } - - - /** - * field for Status - */ - - - protected org.wso2.bps.management.schema.ProcessStatus localStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ProcessStatus - */ - public org.wso2.bps.management.schema.ProcessStatus getStatus() { - return this.localStatus; - } - - - - /** - * Auto generated setter method - * - * @param param Status - */ - public void setStatus(final org.wso2.bps.management.schema.ProcessStatus param) { - - this.localStatus = param; - - - } - - - /** - * field for OlderVersion - */ - - - protected int localOlderVersion; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getOlderVersion() { - return this.localOlderVersion; - } - - - - /** - * Auto generated setter method - * - * @param param OlderVersion - */ - public void setOlderVersion(final int param) { - - this.localOlderVersion = param; - - - } - - - /** - * field for DefinitionInfo - */ - - - protected org.wso2.bps.management.schema.DefinitionInfo localDefinitionInfo; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.DefinitionInfo - */ - public org.wso2.bps.management.schema.DefinitionInfo getDefinitionInfo() { - return this.localDefinitionInfo; - } - - - - /** - * Auto generated setter method - * - * @param param DefinitionInfo - */ - public void setDefinitionInfo(final org.wso2.bps.management.schema.DefinitionInfo param) { - - this.localDefinitionInfo = param; - - - } - - - /** - * field for DeploymentInfo - */ - - - protected org.wso2.bps.management.schema.DeploymentInfo localDeploymentInfo; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.DeploymentInfo - */ - public org.wso2.bps.management.schema.DeploymentInfo getDeploymentInfo() { - return this.localDeploymentInfo; - } - - - - /** - * Auto generated setter method - * - * @param param DeploymentInfo - */ - public void setDeploymentInfo(final org.wso2.bps.management.schema.DeploymentInfo param) { - - this.localDeploymentInfo = param; - - - } - - - /** - * field for InstanceSummary - */ - - - protected org.wso2.bps.management.schema.InstanceSummary localInstanceSummary; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInstanceSummaryTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceSummary - */ - public org.wso2.bps.management.schema.InstanceSummary getInstanceSummary() { - return this.localInstanceSummary; - } - - - - /** - * Auto generated setter method - * - * @param param InstanceSummary - */ - public void setInstanceSummary(final org.wso2.bps.management.schema.InstanceSummary param) { - this.localInstanceSummaryTracker = param != null; - - this.localInstanceSummary = param; - - - } - - - /** - * field for Properties - */ - - - protected org.wso2.bps.management.schema.ProcessProperties localProperties; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPropertiesTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ProcessProperties - */ - public org.wso2.bps.management.schema.ProcessProperties getProperties() { - return this.localProperties; - } - - - - /** - * Auto generated setter method - * - * @param param Properties - */ - public void setProperties(final org.wso2.bps.management.schema.ProcessProperties param) { - this.localPropertiesTracker = param != null; - - this.localProperties = param; - - - } - - - /** - * field for Endpoints - */ - - - protected org.wso2.bps.management.schema.EndpointReferencesType localEndpoints; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.EndpointReferencesType - */ - public org.wso2.bps.management.schema.EndpointReferencesType getEndpoints() { - return this.localEndpoints; - } - - - - /** - * Auto generated setter method - * - * @param param Endpoints - */ - public void setEndpoints(final org.wso2.bps.management.schema.EndpointReferencesType param) { - - this.localEndpoints = param; - - - } - - - /** - * field for ExtraElement This was an Array! - */ - - - protected org.apache.axiom.om.OMElement[] localExtraElement; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtraElementTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement[] - */ - public org.apache.axiom.om.OMElement[] getExtraElement() { - return this.localExtraElement; - } - - - - /** - * validate the array for ExtraElement - */ - protected void validateExtraElement(final org.apache.axiom.om.OMElement[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ExtraElement - */ - public void setExtraElement(final org.apache.axiom.om.OMElement[] param) { - - validateExtraElement(param); - - this.localExtraElementTracker = param != null; - - this.localExtraElement = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axiom.om.OMElement - */ - public void addExtraElement(final org.apache.axiom.om.OMElement param) { - if (this.localExtraElement == null) { - this.localExtraElement = new org.apache.axiom.om.OMElement[] {}; - } - - - // update the setting tracker - this.localExtraElementTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtraElement); - list.add(param); - this.localExtraElement = - (org.apache.axiom.om.OMElement[]) list.toArray(new org.apache.axiom.om.OMElement[list.size()]); - - } - - - /** - * field for ExtraAttributes This was an Attribute! This was an Array! - */ - - - protected org.apache.axiom.om.OMAttribute[] localExtraAttributes; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMAttribute[] - */ - public org.apache.axiom.om.OMAttribute[] getExtraAttributes() { - return this.localExtraAttributes; - } - - - - /** - * validate the array for ExtraAttributes - */ - protected void validateExtraAttributes(final org.apache.axiom.om.OMAttribute[] param) { - - if (param != null && param.length > 1) { - throw new java.lang.RuntimeException(); - } - - if (param != null && param.length < 1) { - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * - * @param param ExtraAttributes - */ - public void setExtraAttributes(final org.apache.axiom.om.OMAttribute[] param) { - - validateExtraAttributes(param); - - - this.localExtraAttributes = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axiom.om.OMAttribute - */ - public void addExtraAttributes(final org.apache.axiom.om.OMAttribute param) { - if (this.localExtraAttributes == null) { - this.localExtraAttributes = new org.apache.axiom.om.OMAttribute[] {}; - } - - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtraAttributes); - list.add(param); - this.localExtraAttributes = - (org.apache.axiom.om.OMAttribute[]) list.toArray(new org.apache.axiom.om.OMAttribute[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ProcessInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ProcessInfoType", - xmlWriter); - } - - - } - - if (this.localExtraAttributes != null) { - for (final OMAttribute localExtraAttribute : this.localExtraAttributes) { - writeAttribute(localExtraAttribute.getNamespace().getName(), localExtraAttribute.getLocalName(), - localExtraAttribute.getAttributeValue(), xmlWriter); - } - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localPid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "version", xmlWriter); - - if (this.localVersion == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("version cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localVersion)); - } - - xmlWriter.writeEndElement(); - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - this.localStatus.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status"), - xmlWriter); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "olderVersion", xmlWriter); - - if (this.localOlderVersion == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("olderVersion cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOlderVersion)); - } - - xmlWriter.writeEndElement(); - - if (this.localDefinitionInfo == null) { - throw new org.apache.axis2.databinding.ADBException("definitionInfo cannot be null!!"); - } - this.localDefinitionInfo.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "definitionInfo"), xmlWriter); - - if (this.localDeploymentInfo == null) { - throw new org.apache.axis2.databinding.ADBException("deploymentInfo cannot be null!!"); - } - this.localDeploymentInfo.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "deploymentInfo"), xmlWriter); - if (this.localInstanceSummaryTracker) { - if (this.localInstanceSummary == null) { - throw new org.apache.axis2.databinding.ADBException("instanceSummary cannot be null!!"); - } - this.localInstanceSummary.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "instanceSummary"), xmlWriter); - } - if (this.localPropertiesTracker) { - if (this.localProperties == null) { - throw new org.apache.axis2.databinding.ADBException("properties cannot be null!!"); - } - this.localProperties.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "properties"), xmlWriter); - } - if (this.localEndpoints == null) { - throw new org.apache.axis2.databinding.ADBException("endpoints cannot be null!!"); - } - this.localEndpoints.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "endpoints"), xmlWriter); - if (this.localExtraElementTracker) { - - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - element.serialize(xmlWriter); - } else { - - // we have to do nothing since minOccures zero - - } - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "version")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localVersion)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status")); - - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - elementList.add(this.localStatus); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "olderVersion")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localOlderVersion)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "definitionInfo")); - - - if (this.localDefinitionInfo == null) { - throw new org.apache.axis2.databinding.ADBException("definitionInfo cannot be null!!"); - } - elementList.add(this.localDefinitionInfo); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "deploymentInfo")); - - - if (this.localDeploymentInfo == null) { - throw new org.apache.axis2.databinding.ADBException("deploymentInfo cannot be null!!"); - } - elementList.add(this.localDeploymentInfo); - if (this.localInstanceSummaryTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceSummary")); - - - if (this.localInstanceSummary == null) { - throw new org.apache.axis2.databinding.ADBException("instanceSummary cannot be null!!"); - } - elementList.add(this.localInstanceSummary); - } - if (this.localPropertiesTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "properties")); - - - if (this.localProperties == null) { - throw new org.apache.axis2.databinding.ADBException("properties cannot be null!!"); - } - elementList.add(this.localProperties); - } - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "endpoints")); - - - if (this.localEndpoints == null) { - throw new org.apache.axis2.databinding.ADBException("endpoints cannot be null!!"); - } - elementList.add(this.localEndpoints); - if (this.localExtraElementTracker) { - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - elementList.add(new javax.xml.namespace.QName("", "extraElement")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - // have to do nothing - - } - - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - for (final OMAttribute localExtraAttribute : this.localExtraAttributes) { - attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); - attribList.add(localExtraAttribute); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessInfoType object = new ProcessInfoType(); - - int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ProcessInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ProcessInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // now run through all any or extra attributes - // which were not reflected until now - for (int i = 0; i < reader.getAttributeCount(); i++) { - if (!handledAttributes.contains(reader.getAttributeLocalName(i))) { - // this is an anyAttribute and we create - // an OMAttribute for this - final org.apache.axiom.om.impl.llom.OMAttributeImpl attr = - new org.apache.axiom.om.impl.llom.OMAttributeImpl(reader.getAttributeLocalName(i), - new org.apache.axiom.om.impl.dom.NamespaceImpl(reader.getAttributeNamespace(i), - reader.getAttributePrefix(i)), - reader.getAttributeValue(i), org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - - // and add it to the extra attributes - - object.addExtraAttributes(attr); - - - } - } - - - reader.next(); - - final java.util.ArrayList list10 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "version").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setVersion(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://wso2.org/bps/management/schema", - "status").equals(reader.getName())) { - - object.setStatus(org.wso2.bps.management.schema.ProcessStatus.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "olderVersion").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setOlderVersion(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://wso2.org/bps/management/schema", - "definitionInfo").equals(reader.getName())) { - - object.setDefinitionInfo(org.wso2.bps.management.schema.DefinitionInfo.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "deploymentInfo").equals(reader.getName())) { - - object.setDeploymentInfo(org.wso2.bps.management.schema.DeploymentInfo.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "instanceSummary").equals(reader.getName())) { - - object.setInstanceSummary(org.wso2.bps.management.schema.InstanceSummary.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://wso2.org/bps/management/schema", - "properties").equals(reader.getName())) { - - object.setProperties(org.wso2.bps.management.schema.ProcessProperties.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://wso2.org/bps/management/schema", - "endpoints").equals(reader.getName())) { - - object.setEndpoints(org.wso2.bps.management.schema.EndpointReferencesType.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - - - // Process the array and step past its final element's end. - - boolean loopDone10 = false; - - while (!loopDone10) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) { - - // We need to wrap the reader so that it produces a fake START_DOCUEMENT event - final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder10 = - new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( - new org.apache.axis2.util.StreamWrapper(reader), reader.getName()); - - list10.add(builder10.getOMElement()); - reader.next(); - if (reader.isEndElement()) { - // we have two countinuos end elements - loopDone10 = true; - } - - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event) { - loopDone10 = true; - } else { - reader.next(); - } - - } - - - object.setExtraElement((org.apache.axiom.om.OMElement[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.apache.axiom.om.OMElement.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInstanceSummary.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInstanceSummary.java deleted file mode 100644 index 0300be8f2..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessInstanceSummary.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * ProcessInstanceSummary.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessInstanceSummary bean class - */ - -public class ProcessInstanceSummary implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8959372704069595197L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ProcessInstanceSummary", "ns1"); - - - - /** - * field for ProcessInstanceSummary - */ - - - protected org.wso2.bps.management.schema.InstanceSummaryType localProcessInstanceSummary; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceSummaryType - */ - public org.wso2.bps.management.schema.InstanceSummaryType getProcessInstanceSummary() { - return this.localProcessInstanceSummary; - } - - - - /** - * Auto generated setter method - * - * @param param ProcessInstanceSummary - */ - public void setProcessInstanceSummary(final org.wso2.bps.management.schema.InstanceSummaryType param) { - - this.localProcessInstanceSummary = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localProcessInstanceSummary == null) { - throw new org.apache.axis2.databinding.ADBException("ProcessInstanceSummary cannot be null!"); - } - this.localProcessInstanceSummary.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localProcessInstanceSummary.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessInstanceSummary parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessInstanceSummary object = new ProcessInstanceSummary(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "ProcessInstanceSummary").equals(reader.getName())) { - - object.setProcessInstanceSummary(org.wso2.bps.management.schema.InstanceSummaryType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessManagementException.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessManagementException.java deleted file mode 100644 index e16caee47..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessManagementException.java +++ /dev/null @@ -1,536 +0,0 @@ - -/** - * ProcessManagementException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessManagementException bean class - */ - -public class ProcessManagementException implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -7876592507988076968L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException", "ns1"); - - - - /** - * field for Result - */ - - - protected java.lang.String localResult; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getResult() { - return this.localResult; - } - - - - /** - * Auto generated setter method - * - * @param param Result - */ - public void setResult(final java.lang.String param) { - - this.localResult = param; - - - } - - - /** - * field for StackTrace - */ - - - protected java.lang.String localStackTrace; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getStackTrace() { - return this.localStackTrace; - } - - - - /** - * Auto generated setter method - * - * @param param StackTrace - */ - public void setStackTrace(final java.lang.String param) { - - this.localStackTrace = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":processManagementException", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "processManagementException", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "result", xmlWriter); - - - if (this.localResult == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("result cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localResult); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "stackTrace", xmlWriter); - - - if (this.localStackTrace == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("stackTrace cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localStackTrace); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "result")); - - if (this.localResult != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localResult)); - } else { - throw new org.apache.axis2.databinding.ADBException("result cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "stackTrace")); - - if (this.localStackTrace != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localStackTrace)); - } else { - throw new org.apache.axis2.databinding.ADBException("stackTrace cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessManagementException parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessManagementException object = new ProcessManagementException(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"processManagementException".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ProcessManagementException) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "result").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setResult(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "stackTrace").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setStackTrace(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessProperties.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessProperties.java deleted file mode 100644 index 9158901aa..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessProperties.java +++ /dev/null @@ -1,537 +0,0 @@ - -/** - * ProcessProperties.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessProperties bean class - */ - -public class ProcessProperties implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ProcessProperties Namespace URI - * = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -2414904911951734509L; - - /** - * field for Property This was an Array! - */ - - - protected org.wso2.bps.management.schema.Property_type0[] localProperty; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPropertyTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Property_type0[] - */ - public org.wso2.bps.management.schema.Property_type0[] getProperty() { - return this.localProperty; - } - - - - /** - * validate the array for Property - */ - protected void validateProperty(final org.wso2.bps.management.schema.Property_type0[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Property - */ - public void setProperty(final org.wso2.bps.management.schema.Property_type0[] param) { - - validateProperty(param); - - this.localPropertyTracker = param != null; - - this.localProperty = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.Property_type0 - */ - public void addProperty(final org.wso2.bps.management.schema.Property_type0 param) { - if (this.localProperty == null) { - this.localProperty = new org.wso2.bps.management.schema.Property_type0[] {}; - } - - - // update the setting tracker - this.localPropertyTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localProperty); - list.add(param); - this.localProperty = - (org.wso2.bps.management.schema.Property_type0[]) list.toArray(new org.wso2.bps.management.schema.Property_type0[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ProcessProperties", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ProcessProperties", - xmlWriter); - } - - - } - if (this.localPropertyTracker) { - if (this.localProperty != null) { - for (final Property_type0 element : this.localProperty) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "property"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("property cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localPropertyTracker) { - if (this.localProperty != null) { - for (final Property_type0 element : this.localProperty) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "property")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("property cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessProperties parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessProperties object = new ProcessProperties(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ProcessProperties".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ProcessProperties) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "property").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.Property_type0.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://wso2.org/bps/management/schema", - "property").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.Property_type0.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setProperty((org.wso2.bps.management.schema.Property_type0[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.Property_type0.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessStatus.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessStatus.java deleted file mode 100644 index 8012ccdfa..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessStatus.java +++ /dev/null @@ -1,459 +0,0 @@ - -/** - * ProcessStatus.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessStatus bean class - */ - -public class ProcessStatus implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -3097534371679023916L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ProcessStatus", "ns1"); - - - - /** - * field for ProcessStatus - */ - - - protected java.lang.String localProcessStatus; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected ProcessStatus(final java.lang.String value, final boolean isRegisterValue) { - this.localProcessStatus = value; - if (isRegisterValue) { - - _table_.put(this.localProcessStatus, this); - - } - - } - - public static final java.lang.String _ACTIVE = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("ACTIVE"); - - public static final java.lang.String _RETIRED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("RETIRED"); - - public static final java.lang.String _DISABLED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("DISABLED"); - - public static final ProcessStatus ACTIVE = new ProcessStatus(_ACTIVE, true); - - public static final ProcessStatus RETIRED = new ProcessStatus(_RETIRED, true); - - public static final ProcessStatus DISABLED = new ProcessStatus(_DISABLED, true); - - - public java.lang.String getValue() { - return this.localProcessStatus; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localProcessStatus.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ProcessStatus", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ProcessStatus", xmlWriter); - } - } - - if (this.localProcessStatus == null) { - - throw new org.apache.axis2.databinding.ADBException("ProcessStatus cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localProcessStatus); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localProcessStatus)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static ProcessStatus fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final ProcessStatus enumeration = (ProcessStatus) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static ProcessStatus fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static ProcessStatus fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return ProcessStatus.Factory.fromString(content, namespaceUri); - } else { - return ProcessStatus.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 ProcessStatus parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - ProcessStatus object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = ProcessStatus.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 = ProcessStatus.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessesInPackage.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessesInPackage.java deleted file mode 100644 index 23934461d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ProcessesInPackage.java +++ /dev/null @@ -1,608 +0,0 @@ - -/** - * ProcessesInPackage.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ProcessesInPackage bean class - */ - -public class ProcessesInPackage implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -4508435230589621221L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processesInPackage", "ns1"); - - - - /** - * field for Process This was an Array! - */ - - - protected java.lang.String[] localProcess; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localProcessTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getProcess() { - return this.localProcess; - } - - - - /** - * validate the array for Process - */ - protected void validateProcess(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param Process - */ - public void setProcess(final java.lang.String[] param) { - - validateProcess(param); - - this.localProcessTracker = param != null; - - this.localProcess = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addProcess(final java.lang.String param) { - if (this.localProcess == null) { - this.localProcess = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localProcessTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localProcess); - list.add(param); - this.localProcess = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - /** - * field for PackageName This was an Attribute! - */ - - - protected java.lang.String localPackageName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPackageName() { - return this.localPackageName; - } - - - - /** - * Auto generated setter method - * - * @param param PackageName - */ - public void setPackageName(final java.lang.String param) { - - this.localPackageName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":processesInPackage", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "processesInPackage", - xmlWriter); - } - - - } - - if (this.localPackageName != null) { - - writeAttribute("", "packageName", - org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPackageName), - xmlWriter); - - - } - if (this.localProcessTracker) { - if (this.localProcess != null) { - namespace = "http://wso2.org/bps/management/schema"; - for (final String localProces : this.localProcess) { - - if (localProces != null) { - - writeStartElement(null, namespace, "process", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProces)); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("process cannot be null!!"); - - } - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localProcessTracker) { - if (this.localProcess != null) { - for (final String localProces : this.localProcess) { - - if (localProces != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "process")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProces)); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("process cannot be null!!"); - - } - - } - attribList.add(new javax.xml.namespace.QName("", "packageName")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPackageName)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ProcessesInPackage parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ProcessesInPackage object = new ProcessesInPackage(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"processesInPackage".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ProcessesInPackage) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // handle attribute "packageName" - final java.lang.String tempAttribPackageName = - - reader.getAttributeValue(null, "packageName"); - - if (tempAttribPackageName != null) { - final java.lang.String content = tempAttribPackageName; - - object.setPackageName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribPackageName)); - - } else { - - } - handledAttributes.add("packageName"); - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "process").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(reader.getElementText()); - - // loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while (!loopDone1) { - // 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 - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "process").equals(reader.getName())) { - list1.add(reader.getElementText()); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setProcess((java.lang.String[]) list1.toArray(new java.lang.String[list1.size()])); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Property_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Property_type0.java deleted file mode 100644 index 6729393ed..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Property_type0.java +++ /dev/null @@ -1,595 +0,0 @@ - -/** - * Property_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - -import org.apache.axiom.om.OMElement; - -/** - * Property_type0 bean class - */ - -public class Property_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = property_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 2773793821690885536L; - - /** - * field for ExtraElement This was an Array! - */ - - - protected org.apache.axiom.om.OMElement[] localExtraElement; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtraElementTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement[] - */ - public org.apache.axiom.om.OMElement[] getExtraElement() { - return this.localExtraElement; - } - - - - /** - * validate the array for ExtraElement - */ - protected void validateExtraElement(final org.apache.axiom.om.OMElement[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ExtraElement - */ - public void setExtraElement(final org.apache.axiom.om.OMElement[] param) { - - validateExtraElement(param); - - this.localExtraElementTracker = param != null; - - this.localExtraElement = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axiom.om.OMElement - */ - public void addExtraElement(final org.apache.axiom.om.OMElement param) { - if (this.localExtraElement == null) { - this.localExtraElement = new org.apache.axiom.om.OMElement[] {}; - } - - - // update the setting tracker - this.localExtraElementTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtraElement); - list.add(param); - this.localExtraElement = - (org.apache.axiom.om.OMElement[]) list.toArray(new org.apache.axiom.om.OMElement[list.size()]); - - } - - - /** - * field for Name This was an Attribute! - */ - - - protected javax.xml.namespace.QName localName; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final javax.xml.namespace.QName param) { - - this.localName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":property_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "property_type0", xmlWriter); - } - - - } - - if (this.localName != null) { - - writeQNameAttribute("", "name", this.localName, xmlWriter); - - - } - if (this.localExtraElementTracker) { - - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - element.serialize(xmlWriter); - } else { - - // we have to do nothing since minOccures zero - - } - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localExtraElementTracker) { - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - elementList.add(new javax.xml.namespace.QName("", "extraElement")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - // have to do nothing - - } - - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - attribList.add(new javax.xml.namespace.QName("", "name")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Property_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Property_type0 object = new Property_type0(); - - int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"property_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Property_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // handle attribute "name" - final java.lang.String tempAttribName = - - reader.getAttributeValue(null, "name"); - - if (tempAttribName != null) { - final java.lang.String content = tempAttribName; - - final int index = tempAttribName.indexOf(":"); - if (index > -1) { - prefix = tempAttribName.substring(0, index); - } else { - // i.e this is in default namesace - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(tempAttribName, - namespaceuri)); - - } else { - - } - handledAttributes.add("name"); - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - - - // Process the array and step past its final element's end. - - boolean loopDone1 = false; - - while (!loopDone1) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) { - - // We need to wrap the reader so that it produces a fake START_DOCUEMENT event - final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = - new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( - new org.apache.axis2.util.StreamWrapper(reader), reader.getName()); - - list1.add(builder1.getOMElement()); - reader.next(); - if (reader.isEndElement()) { - // we have two countinuos end elements - loopDone1 = true; - } - - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event) { - loopDone1 = true; - } else { - reader.next(); - } - - } - - - object.setExtraElement((org.apache.axiom.om.OMElement[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.apache.axiom.om.OMElement.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RecoverActivity.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RecoverActivity.java deleted file mode 100644 index b4880a9a2..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RecoverActivity.java +++ /dev/null @@ -1,584 +0,0 @@ - -/** - * RecoverActivity.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * RecoverActivity bean class - */ - -public class RecoverActivity implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -5426017452215063808L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "recoverActivity", "ns1"); - - - - /** - * field for Iid - */ - - - protected long localIid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final long param) { - - this.localIid = param; - - - } - - - /** - * field for Aid - */ - - - protected long localAid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getAid() { - return this.localAid; - } - - - - /** - * Auto generated setter method - * - * @param param Aid - */ - public void setAid(final long param) { - - this.localAid = param; - - - } - - - /** - * field for Action - */ - - - protected org.wso2.bps.management.schema.Action_type1 localAction; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Action_type1 - */ - public org.wso2.bps.management.schema.Action_type1 getAction() { - return this.localAction; - } - - - - /** - * Auto generated setter method - * - * @param param Action - */ - public void setAction(final org.wso2.bps.management.schema.Action_type1 param) { - - this.localAction = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":recoverActivity", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "recoverActivity", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - if (this.localIid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "aid", xmlWriter); - - if (this.localAid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("aid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAid)); - } - - xmlWriter.writeEndElement(); - - if (this.localAction == null) { - throw new org.apache.axis2.databinding.ADBException("action cannot be null!!"); - } - this.localAction.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "action"), - xmlWriter); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "aid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAid)); - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "action")); - - - if (this.localAction == null) { - throw new org.apache.axis2.databinding.ADBException("action cannot be null!!"); - } - elementList.add(this.localAction); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static RecoverActivity parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final RecoverActivity object = new RecoverActivity(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"recoverActivity".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (RecoverActivity) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(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://wso2.org/bps/management/schema", - "aid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setAid(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://wso2.org/bps/management/schema", - "action").equals(reader.getName())) { - - object.setAction(org.wso2.bps.management.schema.Action_type1.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployPackage.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployPackage.java deleted file mode 100644 index 6b747cdc8..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployPackage.java +++ /dev/null @@ -1,456 +0,0 @@ - -/** - * RedeployPackage.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * RedeployPackage bean class - */ - -public class RedeployPackage implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 7757995862164696097L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "redeployPackage", "ns1"); - - - - /** - * field for _package - */ - - - protected java.lang.String local_package; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String get_package() { - return this.local_package; - } - - - - /** - * Auto generated setter method - * - * @param param _package - */ - public void set_package(final java.lang.String param) { - - this.local_package = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":redeployPackage", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "redeployPackage", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "package", xmlWriter); - - - if (this.local_package == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.local_package); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "package")); - - if (this.local_package != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_package)); - } else { - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static RedeployPackage parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final RedeployPackage object = new RedeployPackage(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"redeployPackage".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (RedeployPackage) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "package").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_package(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployStatus.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployStatus.java deleted file mode 100644 index 16986375a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployStatus.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * RedeployStatus.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * RedeployStatus bean class - */ - -public class RedeployStatus implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -1176285531797719426L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "redeployStatus", "ns1"); - - - - /** - * field for RedeployStatus - */ - - - protected org.wso2.bps.management.schema.RedeployStatus_type0 localRedeployStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.RedeployStatus_type0 - */ - public org.wso2.bps.management.schema.RedeployStatus_type0 getRedeployStatus() { - return this.localRedeployStatus; - } - - - - /** - * Auto generated setter method - * - * @param param RedeployStatus - */ - public void setRedeployStatus(final org.wso2.bps.management.schema.RedeployStatus_type0 param) { - - this.localRedeployStatus = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localRedeployStatus == null) { - throw new org.apache.axis2.databinding.ADBException("redeployStatus cannot be null!"); - } - this.localRedeployStatus.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localRedeployStatus.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static RedeployStatus parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final RedeployStatus object = new RedeployStatus(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "redeployStatus").equals(reader.getName())) { - - object.setRedeployStatus(org.wso2.bps.management.schema.RedeployStatus_type0.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployStatus_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployStatus_type0.java deleted file mode 100644 index 951566c1a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RedeployStatus_type0.java +++ /dev/null @@ -1,471 +0,0 @@ - -/** - * RedeployStatus_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * RedeployStatus_type0 bean class - */ - -public class RedeployStatus_type0 implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6795905849068353205L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "redeployStatus_type0", "ns1"); - - - - /** - * field for RedeployStatus_type0 - */ - - - protected java.lang.String localRedeployStatus_type0; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected RedeployStatus_type0(final java.lang.String value, final boolean isRegisterValue) { - this.localRedeployStatus_type0 = value; - if (isRegisterValue) { - - _table_.put(this.localRedeployStatus_type0, this); - - } - - } - - public static final java.lang.String _SUCCESS = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("SUCCESS"); - - public static final java.lang.String _FAILED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAILED"); - - public static final java.lang.String _EXISITS = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("EXISITS"); - - public static final java.lang.String _NOTINREGISTRY = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("NOTINREGISTRY"); - - public static final java.lang.String _INVALID_PACKAGE_NAME = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("INVALID_PACKAGE_NAME"); - - public static final RedeployStatus_type0 SUCCESS = new RedeployStatus_type0(_SUCCESS, true); - - public static final RedeployStatus_type0 FAILED = new RedeployStatus_type0(_FAILED, true); - - public static final RedeployStatus_type0 EXISITS = new RedeployStatus_type0(_EXISITS, true); - - public static final RedeployStatus_type0 NOTINREGISTRY = new RedeployStatus_type0(_NOTINREGISTRY, true); - - public static final RedeployStatus_type0 INVALID_PACKAGE_NAME = - new RedeployStatus_type0(_INVALID_PACKAGE_NAME, true); - - - public java.lang.String getValue() { - return this.localRedeployStatus_type0; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localRedeployStatus_type0.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":redeployStatus_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "redeployStatus_type0", - xmlWriter); - } - } - - if (this.localRedeployStatus_type0 == null) { - - throw new org.apache.axis2.databinding.ADBException("redeployStatus_type0 cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localRedeployStatus_type0); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localRedeployStatus_type0)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static RedeployStatus_type0 fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final RedeployStatus_type0 enumeration = (RedeployStatus_type0) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static RedeployStatus_type0 fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static RedeployStatus_type0 fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return RedeployStatus_type0.Factory.fromString(content, namespaceUri); - } else { - return RedeployStatus_type0.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 RedeployStatus_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - RedeployStatus_type0 object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = RedeployStatus_type0.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 = RedeployStatus_type0.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ResumeInstance.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ResumeInstance.java deleted file mode 100644 index 0796fdc02..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ResumeInstance.java +++ /dev/null @@ -1,446 +0,0 @@ - -/** - * ResumeInstance.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ResumeInstance bean class - */ - -public class ResumeInstance implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8858597916700092536L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "resumeInstance", "ns1"); - - - - /** - * field for Iid - */ - - - protected long localIid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final long param) { - - this.localIid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":resumeInstance", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "resumeInstance", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - if (this.localIid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ResumeInstance parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ResumeInstance object = new ResumeInstance(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"resumeInstance".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ResumeInstance) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ResumeInstanceOut.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ResumeInstanceOut.java deleted file mode 100644 index b84a56f84..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ResumeInstanceOut.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * ResumeInstanceOut.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ResumeInstanceOut bean class - */ - -public class ResumeInstanceOut implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -4338119380293109488L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "resumeInstanceOut", "ns1"); - - - - /** - * field for ResumeInstanceOut - */ - - - protected org.wso2.bps.management.schema.InstanceInfoType localResumeInstanceOut; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceInfoType - */ - public org.wso2.bps.management.schema.InstanceInfoType getResumeInstanceOut() { - return this.localResumeInstanceOut; - } - - - - /** - * Auto generated setter method - * - * @param param ResumeInstanceOut - */ - public void setResumeInstanceOut(final org.wso2.bps.management.schema.InstanceInfoType param) { - - this.localResumeInstanceOut = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localResumeInstanceOut == null) { - throw new org.apache.axis2.databinding.ADBException("resumeInstanceOut cannot be null!"); - } - this.localResumeInstanceOut.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localResumeInstanceOut.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ResumeInstanceOut parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ResumeInstanceOut object = new ResumeInstanceOut(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "resumeInstanceOut").equals(reader.getName())) { - - object.setResumeInstanceOut(org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RetireProcessIn.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RetireProcessIn.java deleted file mode 100644 index 6cea85e5f..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/RetireProcessIn.java +++ /dev/null @@ -1,464 +0,0 @@ - -/** - * RetireProcessIn.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * RetireProcessIn bean class - */ - -public class RetireProcessIn implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6128266703333329901L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "retireProcessIn", "ns1"); - - - - /** - * field for Pid - */ - - - protected javax.xml.namespace.QName localPid; - - - /** - * Auto generated getter method - * - * @return javax.xml.namespace.QName - */ - public javax.xml.namespace.QName getPid() { - return this.localPid; - } - - - - /** - * Auto generated setter method - * - * @param param Pid - */ - public void setPid(final javax.xml.namespace.QName param) { - - this.localPid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":retireProcessIn", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "retireProcessIn", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "pid", xmlWriter); - - - if (this.localPid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - - } else { - - - writeQName(this.localPid, xmlWriter); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "pid")); - - if (this.localPid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPid)); - } else { - throw new org.apache.axis2.databinding.ADBException("pid cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static RetireProcessIn parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final RetireProcessIn object = new RetireProcessIn(); - - final int event; - final java.lang.String nillableValue = null; - java.lang.String prefix = ""; - java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"retireProcessIn".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (RetireProcessIn) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "pid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - final int index = content.indexOf(":"); - if (index > 0) { - prefix = content.substring(0, index); - } else { - prefix = ""; - } - namespaceuri = reader.getNamespaceURI(prefix); - object.setPid(org.apache.axis2.databinding.utils.ConverterUtil.convertToQName(content, - namespaceuri)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfo.java deleted file mode 100644 index 4d72f9df2..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfo.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * ScopeInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ScopeInfo bean class - */ - -public class ScopeInfo implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -7798393569732934394L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ScopeInfo", "ns1"); - - - - /** - * field for ScopeInfo - */ - - - protected org.wso2.bps.management.schema.ScopeInfoType localScopeInfo; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ScopeInfoType - */ - public org.wso2.bps.management.schema.ScopeInfoType getScopeInfo() { - return this.localScopeInfo; - } - - - - /** - * Auto generated setter method - * - * @param param ScopeInfo - */ - public void setScopeInfo(final org.wso2.bps.management.schema.ScopeInfoType param) { - - this.localScopeInfo = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localScopeInfo == null) { - throw new org.apache.axis2.databinding.ADBException("ScopeInfo cannot be null!"); - } - this.localScopeInfo.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localScopeInfo.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ScopeInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ScopeInfo object = new ScopeInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "ScopeInfo").equals(reader.getName())) { - - object.setScopeInfo(org.wso2.bps.management.schema.ScopeInfoType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfoType.java deleted file mode 100644 index 128c67c3d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfoType.java +++ /dev/null @@ -1,889 +0,0 @@ - -/** - * ScopeInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ScopeInfoType bean class - */ - -public class ScopeInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ScopeInfoType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 3669228929613469562L; - - /** - * field for Siid - */ - - - protected java.lang.String localSiid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSiid() { - return this.localSiid; - } - - - - /** - * Auto generated setter method - * - * @param param Siid - */ - public void setSiid(final java.lang.String param) { - - this.localSiid = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - - this.localName = param; - - - } - - - /** - * field for Status - */ - - - protected org.wso2.bps.management.schema.ScopeStatusType localStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ScopeStatusType - */ - public org.wso2.bps.management.schema.ScopeStatusType getStatus() { - return this.localStatus; - } - - - - /** - * Auto generated setter method - * - * @param param Status - */ - public void setStatus(final org.wso2.bps.management.schema.ScopeStatusType param) { - - this.localStatus = param; - - - } - - - /** - * field for Children - */ - - - protected org.wso2.bps.management.schema.Children_type0 localChildren; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localChildrenTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Children_type0 - */ - public org.wso2.bps.management.schema.Children_type0 getChildren() { - return this.localChildren; - } - - - - /** - * Auto generated setter method - * - * @param param Children - */ - public void setChildren(final org.wso2.bps.management.schema.Children_type0 param) { - this.localChildrenTracker = param != null; - - this.localChildren = param; - - - } - - - /** - * field for Activities - */ - - - protected org.wso2.bps.management.schema.Activities_type0 localActivities; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActivitiesTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Activities_type0 - */ - public org.wso2.bps.management.schema.Activities_type0 getActivities() { - return this.localActivities; - } - - - - /** - * Auto generated setter method - * - * @param param Activities - */ - public void setActivities(final org.wso2.bps.management.schema.Activities_type0 param) { - this.localActivitiesTracker = param != null; - - this.localActivities = param; - - - } - - - /** - * field for Variables - */ - - - protected org.wso2.bps.management.schema.Variables_type0 localVariables; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localVariablesTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Variables_type0 - */ - public org.wso2.bps.management.schema.Variables_type0 getVariables() { - return this.localVariables; - } - - - - /** - * Auto generated setter method - * - * @param param Variables - */ - public void setVariables(final org.wso2.bps.management.schema.Variables_type0 param) { - this.localVariablesTracker = param != null; - - this.localVariables = param; - - - } - - - /** - * field for CorrelationSets - */ - - - protected org.wso2.bps.management.schema.CorrelationSets_type0 localCorrelationSets; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCorrelationSetsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.CorrelationSets_type0 - */ - public org.wso2.bps.management.schema.CorrelationSets_type0 getCorrelationSets() { - return this.localCorrelationSets; - } - - - - /** - * Auto generated setter method - * - * @param param CorrelationSets - */ - public void setCorrelationSets(final org.wso2.bps.management.schema.CorrelationSets_type0 param) { - this.localCorrelationSetsTracker = param != null; - - this.localCorrelationSets = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ScopeInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ScopeInfoType", xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "siid", xmlWriter); - - - if (this.localSiid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("siid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localSiid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - this.localStatus.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status"), - xmlWriter); - if (this.localChildrenTracker) { - if (this.localChildren == null) { - throw new org.apache.axis2.databinding.ADBException("children cannot be null!!"); - } - this.localChildren.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "children"), xmlWriter); - } - if (this.localActivitiesTracker) { - if (this.localActivities == null) { - throw new org.apache.axis2.databinding.ADBException("activities cannot be null!!"); - } - this.localActivities.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activities"), xmlWriter); - } - if (this.localVariablesTracker) { - if (this.localVariables == null) { - throw new org.apache.axis2.databinding.ADBException("variables cannot be null!!"); - } - this.localVariables.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "variables"), xmlWriter); - } - if (this.localCorrelationSetsTracker) { - if (this.localCorrelationSets == null) { - throw new org.apache.axis2.databinding.ADBException("correlationSets cannot be null!!"); - } - this.localCorrelationSets.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationSets"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "siid")); - - if (this.localSiid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSiid)); - } else { - throw new org.apache.axis2.databinding.ADBException("siid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "name")); - - if (this.localName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status")); - - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - elementList.add(this.localStatus); - if (this.localChildrenTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "children")); - - - if (this.localChildren == null) { - throw new org.apache.axis2.databinding.ADBException("children cannot be null!!"); - } - elementList.add(this.localChildren); - } - if (this.localActivitiesTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "activities")); - - - if (this.localActivities == null) { - throw new org.apache.axis2.databinding.ADBException("activities cannot be null!!"); - } - elementList.add(this.localActivities); - } - if (this.localVariablesTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "variables")); - - - if (this.localVariables == null) { - throw new org.apache.axis2.databinding.ADBException("variables cannot be null!!"); - } - elementList.add(this.localVariables); - } - if (this.localCorrelationSetsTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "correlationSets")); - - - if (this.localCorrelationSets == null) { - throw new org.apache.axis2.databinding.ADBException("correlationSets cannot be null!!"); - } - elementList.add(this.localCorrelationSets); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ScopeInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ScopeInfoType object = new ScopeInfoType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ScopeInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ScopeInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "siid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSiid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "name").equals(reader.getName())) { - - final 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://wso2.org/bps/management/schema", - "status").equals(reader.getName())) { - - object.setStatus(org.wso2.bps.management.schema.ScopeStatusType.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "children").equals(reader.getName())) { - - object.setChildren(org.wso2.bps.management.schema.Children_type0.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://wso2.org/bps/management/schema", - "activities").equals(reader.getName())) { - - object.setActivities(org.wso2.bps.management.schema.Activities_type0.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://wso2.org/bps/management/schema", - "variables").equals(reader.getName())) { - - object.setVariables(org.wso2.bps.management.schema.Variables_type0.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://wso2.org/bps/management/schema", - "correlationSets").equals(reader.getName())) { - - object.setCorrelationSets(org.wso2.bps.management.schema.CorrelationSets_type0.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfoWithEventsType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfoWithEventsType.java deleted file mode 100644 index 334c5693a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeInfoWithEventsType.java +++ /dev/null @@ -1,893 +0,0 @@ - -/** - * ScopeInfoWithEventsType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ScopeInfoWithEventsType bean class - */ - -public class ScopeInfoWithEventsType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = ScopeInfoWithEventsType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -3264334215446866969L; - - /** - * field for Siid - */ - - - protected java.lang.String localSiid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSiid() { - return this.localSiid; - } - - - - /** - * Auto generated setter method - * - * @param param Siid - */ - public void setSiid(final java.lang.String param) { - - this.localSiid = param; - - - } - - - /** - * field for Name - */ - - - protected java.lang.String localName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - - this.localName = param; - - - } - - - /** - * field for Status - */ - - - protected org.wso2.bps.management.schema.ScopeStatusType localStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ScopeStatusType - */ - public org.wso2.bps.management.schema.ScopeStatusType getStatus() { - return this.localStatus; - } - - - - /** - * Auto generated setter method - * - * @param param Status - */ - public void setStatus(final org.wso2.bps.management.schema.ScopeStatusType param) { - - this.localStatus = param; - - - } - - - /** - * field for ChildrenWithEvents - */ - - - protected org.wso2.bps.management.schema.ChildrenWithEvents_type0 localChildrenWithEvents; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localChildrenWithEventsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ChildrenWithEvents_type0 - */ - public org.wso2.bps.management.schema.ChildrenWithEvents_type0 getChildrenWithEvents() { - return this.localChildrenWithEvents; - } - - - - /** - * Auto generated setter method - * - * @param param ChildrenWithEvents - */ - public void setChildrenWithEvents(final org.wso2.bps.management.schema.ChildrenWithEvents_type0 param) { - this.localChildrenWithEventsTracker = param != null; - - this.localChildrenWithEvents = param; - - - } - - - /** - * field for ActivitiesWithEvents - */ - - - protected org.wso2.bps.management.schema.ActivitiesWithEvents_type0 localActivitiesWithEvents; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localActivitiesWithEventsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ActivitiesWithEvents_type0 - */ - public org.wso2.bps.management.schema.ActivitiesWithEvents_type0 getActivitiesWithEvents() { - return this.localActivitiesWithEvents; - } - - - - /** - * Auto generated setter method - * - * @param param ActivitiesWithEvents - */ - public void setActivitiesWithEvents(final org.wso2.bps.management.schema.ActivitiesWithEvents_type0 param) { - this.localActivitiesWithEventsTracker = param != null; - - this.localActivitiesWithEvents = param; - - - } - - - /** - * field for VariablesWithEvents - */ - - - protected org.wso2.bps.management.schema.VariablesWithEvents_type0 localVariablesWithEvents; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localVariablesWithEventsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.VariablesWithEvents_type0 - */ - public org.wso2.bps.management.schema.VariablesWithEvents_type0 getVariablesWithEvents() { - return this.localVariablesWithEvents; - } - - - - /** - * Auto generated setter method - * - * @param param VariablesWithEvents - */ - public void setVariablesWithEvents(final org.wso2.bps.management.schema.VariablesWithEvents_type0 param) { - this.localVariablesWithEventsTracker = param != null; - - this.localVariablesWithEvents = param; - - - } - - - /** - * field for CorrelationSets - */ - - - protected org.wso2.bps.management.schema.CorrelationSets_type1 localCorrelationSets; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCorrelationSetsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.CorrelationSets_type1 - */ - public org.wso2.bps.management.schema.CorrelationSets_type1 getCorrelationSets() { - return this.localCorrelationSets; - } - - - - /** - * Auto generated setter method - * - * @param param CorrelationSets - */ - public void setCorrelationSets(final org.wso2.bps.management.schema.CorrelationSets_type1 param) { - this.localCorrelationSetsTracker = param != null; - - this.localCorrelationSets = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ScopeInfoWithEventsType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ScopeInfoWithEventsType", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "siid", xmlWriter); - - - if (this.localSiid == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("siid cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localSiid); - - } - - xmlWriter.writeEndElement(); - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "name", xmlWriter); - - - if (this.localName == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.localName); - - } - - xmlWriter.writeEndElement(); - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - this.localStatus.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status"), - xmlWriter); - if (this.localChildrenWithEventsTracker) { - if (this.localChildrenWithEvents == null) { - throw new org.apache.axis2.databinding.ADBException("childrenWithEvents cannot be null!!"); - } - this.localChildrenWithEvents.serialize(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/schema", "childrenWithEvents"), xmlWriter); - } - if (this.localActivitiesWithEventsTracker) { - if (this.localActivitiesWithEvents == null) { - throw new org.apache.axis2.databinding.ADBException("activitiesWithEvents cannot be null!!"); - } - this.localActivitiesWithEvents.serialize(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/schema", "activitiesWithEvents"), xmlWriter); - } - if (this.localVariablesWithEventsTracker) { - if (this.localVariablesWithEvents == null) { - throw new org.apache.axis2.databinding.ADBException("variablesWithEvents cannot be null!!"); - } - this.localVariablesWithEvents.serialize(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/schema", "variablesWithEvents"), xmlWriter); - } - if (this.localCorrelationSetsTracker) { - if (this.localCorrelationSets == null) { - throw new org.apache.axis2.databinding.ADBException("correlationSets cannot be null!!"); - } - this.localCorrelationSets.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "correlationSets"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "siid")); - - if (this.localSiid != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSiid)); - } else { - throw new org.apache.axis2.databinding.ADBException("siid cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "name")); - - if (this.localName != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - } else { - throw new org.apache.axis2.databinding.ADBException("name cannot be null!!"); - } - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "status")); - - - if (this.localStatus == null) { - throw new org.apache.axis2.databinding.ADBException("status cannot be null!!"); - } - elementList.add(this.localStatus); - if (this.localChildrenWithEventsTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "childrenWithEvents")); - - - if (this.localChildrenWithEvents == null) { - throw new org.apache.axis2.databinding.ADBException("childrenWithEvents cannot be null!!"); - } - elementList.add(this.localChildrenWithEvents); - } - if (this.localActivitiesWithEventsTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "activitiesWithEvents")); - - - if (this.localActivitiesWithEvents == null) { - throw new org.apache.axis2.databinding.ADBException("activitiesWithEvents cannot be null!!"); - } - elementList.add(this.localActivitiesWithEvents); - } - if (this.localVariablesWithEventsTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "variablesWithEvents")); - - - if (this.localVariablesWithEvents == null) { - throw new org.apache.axis2.databinding.ADBException("variablesWithEvents cannot be null!!"); - } - elementList.add(this.localVariablesWithEvents); - } - if (this.localCorrelationSetsTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "correlationSets")); - - - if (this.localCorrelationSets == null) { - throw new org.apache.axis2.databinding.ADBException("correlationSets cannot be null!!"); - } - elementList.add(this.localCorrelationSets); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ScopeInfoWithEventsType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ScopeInfoWithEventsType object = new ScopeInfoWithEventsType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"ScopeInfoWithEventsType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ScopeInfoWithEventsType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "siid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setSiid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "name").equals(reader.getName())) { - - final 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://wso2.org/bps/management/schema", - "status").equals(reader.getName())) { - - object.setStatus(org.wso2.bps.management.schema.ScopeStatusType.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "childrenWithEvents").equals(reader.getName())) { - - object.setChildrenWithEvents(org.wso2.bps.management.schema.ChildrenWithEvents_type0.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://wso2.org/bps/management/schema", - "activitiesWithEvents").equals(reader.getName())) { - - object.setActivitiesWithEvents(org.wso2.bps.management.schema.ActivitiesWithEvents_type0.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://wso2.org/bps/management/schema", - "variablesWithEvents").equals(reader.getName())) { - - object.setVariablesWithEvents(org.wso2.bps.management.schema.VariablesWithEvents_type0.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://wso2.org/bps/management/schema", - "correlationSets").equals(reader.getName())) { - - object.setCorrelationSets(org.wso2.bps.management.schema.CorrelationSets_type1.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeStatusType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeStatusType.java deleted file mode 100644 index 542a7d64e..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ScopeStatusType.java +++ /dev/null @@ -1,484 +0,0 @@ - -/** - * ScopeStatusType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ScopeStatusType bean class - */ - -public class ScopeStatusType implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 2766227762780536938L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "ScopeStatusType", "ns1"); - - - - /** - * field for ScopeStatusType - */ - - - protected java.lang.String localScopeStatusType; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected ScopeStatusType(final java.lang.String value, final boolean isRegisterValue) { - this.localScopeStatusType = value; - if (isRegisterValue) { - - _table_.put(this.localScopeStatusType, this); - - } - - } - - public static final java.lang.String _ACTIVE = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("ACTIVE"); - - public static final java.lang.String _COMPLETED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COMPLETED"); - - public static final java.lang.String _FAULTED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAULTED"); - - public static final java.lang.String _FAULTHANDLING = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAULTHANDLING"); - - public static final java.lang.String _COMPENSATING = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COMPENSATING"); - - public static final java.lang.String _COMPENSATED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("COMPENSATED"); - - public static final java.lang.String _NEW = org.apache.axis2.databinding.utils.ConverterUtil.convertToString("NEW"); - - public static final java.lang.String _FAULT = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAULT"); - - public static final ScopeStatusType ACTIVE = new ScopeStatusType(_ACTIVE, true); - - public static final ScopeStatusType COMPLETED = new ScopeStatusType(_COMPLETED, true); - - public static final ScopeStatusType FAULTED = new ScopeStatusType(_FAULTED, true); - - public static final ScopeStatusType FAULTHANDLING = new ScopeStatusType(_FAULTHANDLING, true); - - public static final ScopeStatusType COMPENSATING = new ScopeStatusType(_COMPENSATING, true); - - public static final ScopeStatusType COMPENSATED = new ScopeStatusType(_COMPENSATED, true); - - public static final ScopeStatusType NEW = new ScopeStatusType(_NEW, true); - - public static final ScopeStatusType FAULT = new ScopeStatusType(_FAULT, true); - - - public java.lang.String getValue() { - return this.localScopeStatusType; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localScopeStatusType.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":ScopeStatusType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "ScopeStatusType", - xmlWriter); - } - } - - if (this.localScopeStatusType == null) { - - throw new org.apache.axis2.databinding.ADBException("ScopeStatusType cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localScopeStatusType); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localScopeStatusType)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static ScopeStatusType fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final ScopeStatusType enumeration = (ScopeStatusType) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static ScopeStatusType fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static ScopeStatusType fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return ScopeStatusType.Factory.fromString(content, namespaceUri); - } else { - return ScopeStatusType.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 ScopeStatusType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - ScopeStatusType object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = ScopeStatusType.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 = ScopeStatusType.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ServiceLocation.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ServiceLocation.java deleted file mode 100644 index 523743d0c..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ServiceLocation.java +++ /dev/null @@ -1,540 +0,0 @@ - -/** - * ServiceLocation.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ServiceLocation bean class - */ - -public class ServiceLocation implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = serviceLocation Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -5467960940547048178L; - /** - * field for ServiceLocation This was an Array! - */ - - - protected java.lang.String[] localServiceLocation; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getServiceLocation() { - return this.localServiceLocation; - } - - - - /** - * validate the array for ServiceLocation - */ - protected void validateServiceLocation(final java.lang.String[] param) { - - if (param != null && param.length < 1) { - throw new java.lang.RuntimeException(); - } - - } - - - /** - * Auto generated setter method - * - * @param param ServiceLocation - */ - public void setServiceLocation(final java.lang.String[] param) { - - validateServiceLocation(param); - - - this.localServiceLocation = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addServiceLocation(final java.lang.String param) { - if (this.localServiceLocation == null) { - this.localServiceLocation = new java.lang.String[] {}; - } - - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localServiceLocation); - list.add(param); - this.localServiceLocation = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":serviceLocation", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "serviceLocation", - xmlWriter); - } - - - } - - if (this.localServiceLocation != null) { - namespace = "http://wso2.org/bps/management/schema"; - for (final String element : this.localServiceLocation) { - - if (element != null) { - - writeStartElement(null, namespace, "serviceLocation", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - - xmlWriter.writeEndElement(); - - } else { - - throw new org.apache.axis2.databinding.ADBException("serviceLocation cannot be null!!"); - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("serviceLocation cannot be null!!"); - - } - - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - if (this.localServiceLocation != null) { - for (final String element : this.localServiceLocation) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "serviceLocation")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - throw new org.apache.axis2.databinding.ADBException("serviceLocation cannot be null!!"); - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("serviceLocation cannot be null!!"); - - } - - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ServiceLocation parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ServiceLocation object = new ServiceLocation(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"serviceLocation".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (ServiceLocation) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "serviceLocation").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(reader.getElementText()); - - // loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while (!loopDone1) { - // 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 - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "serviceLocation").equals(reader.getName())) { - list1.add(reader.getElementText()); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setServiceLocation((java.lang.String[]) list1.toArray(new java.lang.String[list1.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ServiceLocationForProcess.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ServiceLocationForProcess.java deleted file mode 100644 index b2887153c..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/ServiceLocationForProcess.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * ServiceLocationForProcess.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * ServiceLocationForProcess bean class - */ - -public class ServiceLocationForProcess implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -7760687532827337875L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "serviceLocationForProcess", "ns1"); - - - - /** - * field for ServiceLocationForProcess - */ - - - protected org.wso2.bps.management.schema.ServiceLocation localServiceLocationForProcess; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.ServiceLocation - */ - public org.wso2.bps.management.schema.ServiceLocation getServiceLocationForProcess() { - return this.localServiceLocationForProcess; - } - - - - /** - * Auto generated setter method - * - * @param param ServiceLocationForProcess - */ - public void setServiceLocationForProcess(final org.wso2.bps.management.schema.ServiceLocation param) { - - this.localServiceLocationForProcess = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localServiceLocationForProcess == null) { - throw new org.apache.axis2.databinding.ADBException("serviceLocationForProcess cannot be null!"); - } - this.localServiceLocationForProcess.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localServiceLocationForProcess.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static ServiceLocationForProcess parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final ServiceLocationForProcess object = new ServiceLocationForProcess(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "serviceLocationForProcess").equals(reader.getName())) { - - object.setServiceLocationForProcess(org.wso2.bps.management.schema.ServiceLocation.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/SuspendInstance.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/SuspendInstance.java deleted file mode 100644 index c34903671..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/SuspendInstance.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * SuspendInstance.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * SuspendInstance bean class - */ - -public class SuspendInstance implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6272235200934713536L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "suspendInstance", "ns1"); - - - - /** - * field for Iid - */ - - - protected long localIid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final long param) { - - this.localIid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":suspendInstance", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "suspendInstance", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - if (this.localIid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SuspendInstance parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SuspendInstance object = new SuspendInstance(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"suspendInstance".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SuspendInstance) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/SuspendInstanceOut.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/SuspendInstanceOut.java deleted file mode 100644 index 4758baed3..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/SuspendInstanceOut.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * SuspendInstanceOut.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * SuspendInstanceOut bean class - */ - -public class SuspendInstanceOut implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 4020213978198134955L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "suspendInstanceOut", "ns1"); - - - - /** - * field for SuspendInstanceOut - */ - - - protected org.wso2.bps.management.schema.InstanceInfoType localSuspendInstanceOut; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceInfoType - */ - public org.wso2.bps.management.schema.InstanceInfoType getSuspendInstanceOut() { - return this.localSuspendInstanceOut; - } - - - - /** - * Auto generated setter method - * - * @param param SuspendInstanceOut - */ - public void setSuspendInstanceOut(final org.wso2.bps.management.schema.InstanceInfoType param) { - - this.localSuspendInstanceOut = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localSuspendInstanceOut == null) { - throw new org.apache.axis2.databinding.ADBException("suspendInstanceOut cannot be null!"); - } - this.localSuspendInstanceOut.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localSuspendInstanceOut.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SuspendInstanceOut parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SuspendInstanceOut object = new SuspendInstanceOut(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "suspendInstanceOut").equals(reader.getName())) { - - object.setSuspendInstanceOut(org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/TerminateInstance.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/TerminateInstance.java deleted file mode 100644 index 79226c02f..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/TerminateInstance.java +++ /dev/null @@ -1,447 +0,0 @@ - -/** - * TerminateInstance.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * TerminateInstance bean class - */ - -public class TerminateInstance implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -5152758986048215164L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "terminateInstance", "ns1"); - - - - /** - * field for Iid - */ - - - protected long localIid; - - - /** - * Auto generated getter method - * - * @return long - */ - public long getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final long param) { - - this.localIid = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":terminateInstance", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "terminateInstance", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "iid", xmlWriter); - - if (this.localIid == java.lang.Long.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("iid cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "iid")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static TerminateInstance parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TerminateInstance object = new TerminateInstance(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"terminateInstance".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (TerminateInstance) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "iid").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setIid(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/TerminateInstanceOut.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/TerminateInstanceOut.java deleted file mode 100644 index 00b41128f..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/TerminateInstanceOut.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * TerminateInstanceOut.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * TerminateInstanceOut bean class - */ - -public class TerminateInstanceOut implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 3835019919121683599L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "terminateInstanceOut", "ns1"); - - - - /** - * field for TerminateInstanceOut - */ - - - protected org.wso2.bps.management.schema.InstanceInfoType localTerminateInstanceOut; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.InstanceInfoType - */ - public org.wso2.bps.management.schema.InstanceInfoType getTerminateInstanceOut() { - return this.localTerminateInstanceOut; - } - - - - /** - * Auto generated setter method - * - * @param param TerminateInstanceOut - */ - public void setTerminateInstanceOut(final org.wso2.bps.management.schema.InstanceInfoType param) { - - this.localTerminateInstanceOut = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localTerminateInstanceOut == null) { - throw new org.apache.axis2.databinding.ADBException("terminateInstanceOut cannot be null!"); - } - this.localTerminateInstanceOut.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localTerminateInstanceOut.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static TerminateInstanceOut parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final TerminateInstanceOut object = new TerminateInstanceOut(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "terminateInstanceOut").equals(reader.getName())) { - - object.setTerminateInstanceOut(org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployBPELPackage.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployBPELPackage.java deleted file mode 100644 index 404c5e0c6..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployBPELPackage.java +++ /dev/null @@ -1,456 +0,0 @@ - -/** - * UndeployBPELPackage.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * UndeployBPELPackage bean class - */ - -public class UndeployBPELPackage implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 8465402359191802544L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "undeployBPELPackage", "ns1"); - - - - /** - * field for _package - */ - - - protected java.lang.String local_package; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String get_package() { - return this.local_package; - } - - - - /** - * Auto generated setter method - * - * @param param _package - */ - public void set_package(final java.lang.String param) { - - this.local_package = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":undeployBPELPackage", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "undeployBPELPackage", - xmlWriter); - } - - - } - - namespace = "http://wso2.org/bps/management/schema"; - writeStartElement(null, namespace, "package", xmlWriter); - - - if (this.local_package == null) { - // write the nil attribute - - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - - } else { - - - xmlWriter.writeCharacters(this.local_package); - - } - - xmlWriter.writeEndElement(); - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "package")); - - if (this.local_package != null) { - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_package)); - } else { - throw new org.apache.axis2.databinding.ADBException("package cannot be null!!"); - } - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static UndeployBPELPackage parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final UndeployBPELPackage object = new UndeployBPELPackage(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"undeployBPELPackage".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (UndeployBPELPackage) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "package").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_package(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployStatus.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployStatus.java deleted file mode 100644 index 4e33a4255..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployStatus.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * UndeployStatus.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * UndeployStatus bean class - */ - -public class UndeployStatus implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 4886729813450932766L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "undeployStatus", "ns1"); - - - - /** - * field for UndeployStatus - */ - - - protected org.wso2.bps.management.schema.UndeployStatus_type0 localUndeployStatus; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.UndeployStatus_type0 - */ - public org.wso2.bps.management.schema.UndeployStatus_type0 getUndeployStatus() { - return this.localUndeployStatus; - } - - - - /** - * Auto generated setter method - * - * @param param UndeployStatus - */ - public void setUndeployStatus(final org.wso2.bps.management.schema.UndeployStatus_type0 param) { - - this.localUndeployStatus = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localUndeployStatus == null) { - throw new org.apache.axis2.databinding.ADBException("undeployStatus cannot be null!"); - } - this.localUndeployStatus.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localUndeployStatus.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static UndeployStatus parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final UndeployStatus object = new UndeployStatus(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "undeployStatus").equals(reader.getName())) { - - object.setUndeployStatus(org.wso2.bps.management.schema.UndeployStatus_type0.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployStatus_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployStatus_type0.java deleted file mode 100644 index 3196db165..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/UndeployStatus_type0.java +++ /dev/null @@ -1,467 +0,0 @@ - -/** - * UndeployStatus_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * UndeployStatus_type0 bean class - */ - -public class UndeployStatus_type0 implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8642666122910211802L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "undeployStatus_type0", "ns1"); - - - - /** - * field for UndeployStatus_type0 - */ - - - protected java.lang.String localUndeployStatus_type0; - - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - - protected UndeployStatus_type0(final java.lang.String value, final boolean isRegisterValue) { - this.localUndeployStatus_type0 = value; - if (isRegisterValue) { - - _table_.put(this.localUndeployStatus_type0, this); - - } - - } - - public static final java.lang.String _SUCCESS = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("SUCCESS"); - - public static final java.lang.String _FAILED = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("FAILED"); - - public static final java.lang.String _INVALID_PACKAGE_NAME = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("INVALID_PACKAGE_NAME"); - - public static final java.lang.String _REGISTRY_OUT_OF_SYNC = - org.apache.axis2.databinding.utils.ConverterUtil.convertToString("REGISTRY_OUT_OF_SYNC"); - - public static final UndeployStatus_type0 SUCCESS = new UndeployStatus_type0(_SUCCESS, true); - - public static final UndeployStatus_type0 FAILED = new UndeployStatus_type0(_FAILED, true); - - public static final UndeployStatus_type0 INVALID_PACKAGE_NAME = - new UndeployStatus_type0(_INVALID_PACKAGE_NAME, true); - - public static final UndeployStatus_type0 REGISTRY_OUT_OF_SYNC = - new UndeployStatus_type0(_REGISTRY_OUT_OF_SYNC, true); - - - public java.lang.String getValue() { - return this.localUndeployStatus_type0; - } - - @Override - public boolean equals(final java.lang.Object obj) { - return obj == this; - } - - @Override - public int hashCode() { - return toString().hashCode(); - } - - @Override - public java.lang.String toString() { - - return this.localUndeployStatus_type0.toString(); - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - final java.lang.String namespace = parentQName.getNamespaceURI(); - final java.lang.String localName = parentQName.getLocalPart(); - - writeStartElement(null, namespace, localName, xmlWriter); - - // add the type details if this is used in a simple type - if (serializeType) { - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":undeployStatus_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "undeployStatus_type0", - xmlWriter); - } - } - - if (this.localUndeployStatus_type0 == null) { - - throw new org.apache.axis2.databinding.ADBException("undeployStatus_type0 cannot be null !!"); - - } else { - - xmlWriter.writeCharacters(this.localUndeployStatus_type0); - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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(this.localUndeployStatus_type0)}, - null); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - public static UndeployStatus_type0 fromValue(final java.lang.String value) throws java.lang.IllegalArgumentException { - final UndeployStatus_type0 enumeration = (UndeployStatus_type0) - - _table_.get(value); - - - if (enumeration == null) { - throw new java.lang.IllegalArgumentException(); - } - return enumeration; - } - - public static UndeployStatus_type0 fromString(final java.lang.String value, - final java.lang.String namespaceURI) throws java.lang.IllegalArgumentException { - try { - - return fromValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(value)); - - - } - catch (final java.lang.Exception e) { - throw new java.lang.IllegalArgumentException(); - } - } - - public static UndeployStatus_type0 fromString(final javax.xml.stream.XMLStreamReader xmlStreamReader, - final java.lang.String content) { - if (content.indexOf(":") > -1) { - final java.lang.String prefix = content.substring(0, content.indexOf(":")); - final java.lang.String namespaceUri = xmlStreamReader.getNamespaceContext().getNamespaceURI(prefix); - return UndeployStatus_type0.Factory.fromString(content, namespaceUri); - } else { - return UndeployStatus_type0.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 UndeployStatus_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - UndeployStatus_type0 object = null; - // initialize a hash map to keep values - final java.util.Map attributeMap = new java.util.HashMap(); - final java.util.List extraAttributeList = new java.util.ArrayList(); - - - final int event; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement() || reader.hasText()) { - - final 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 = UndeployStatus_type0.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 = UndeployStatus_type0.Factory.fromString(content, ""); - } - - - } else { - reader.next(); - } - } // end of while loop - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Value_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Value_type0.java deleted file mode 100644 index 6f2044490..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Value_type0.java +++ /dev/null @@ -1,526 +0,0 @@ - -/** - * Value_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - -import org.apache.axiom.om.OMElement; - -/** - * Value_type0 bean class - */ - -public class Value_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = value_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -2575512549989434933L; - - /** - * field for ExtraElement This was an Array! - */ - - - protected org.apache.axiom.om.OMElement[] localExtraElement; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtraElementTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement[] - */ - public org.apache.axiom.om.OMElement[] getExtraElement() { - return this.localExtraElement; - } - - - - /** - * validate the array for ExtraElement - */ - protected void validateExtraElement(final org.apache.axiom.om.OMElement[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ExtraElement - */ - public void setExtraElement(final org.apache.axiom.om.OMElement[] param) { - - validateExtraElement(param); - - this.localExtraElementTracker = param != null; - - this.localExtraElement = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axiom.om.OMElement - */ - public void addExtraElement(final org.apache.axiom.om.OMElement param) { - if (this.localExtraElement == null) { - this.localExtraElement = new org.apache.axiom.om.OMElement[] {}; - } - - - // update the setting tracker - this.localExtraElementTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtraElement); - list.add(param); - this.localExtraElement = - (org.apache.axiom.om.OMElement[]) list.toArray(new org.apache.axiom.om.OMElement[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":value_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "value_type0", xmlWriter); - } - - - } - if (this.localExtraElementTracker) { - - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - element.serialize(xmlWriter); - } else { - - // we have to do nothing since minOccures zero - - } - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localExtraElementTracker) { - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - elementList.add(new javax.xml.namespace.QName("", "extraElement")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - // have to do nothing - - } - - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Value_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Value_type0 object = new Value_type0(); - - int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"value_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Value_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - - - // Process the array and step past its final element's end. - - boolean loopDone1 = false; - - while (!loopDone1) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) { - - // We need to wrap the reader so that it produces a fake START_DOCUEMENT event - final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = - new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( - new org.apache.axis2.util.StreamWrapper(reader), reader.getName()); - - list1.add(builder1.getOMElement()); - reader.next(); - if (reader.isEndElement()) { - // we have two countinuos end elements - loopDone1 = true; - } - - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event) { - loopDone1 = true; - } else { - reader.next(); - } - - } - - - object.setExtraElement((org.apache.axiom.om.OMElement[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.apache.axiom.om.OMElement.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Value_type1.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Value_type1.java deleted file mode 100644 index 888fe8238..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Value_type1.java +++ /dev/null @@ -1,526 +0,0 @@ - -/** - * Value_type1.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - -import org.apache.axiom.om.OMElement; - -/** - * Value_type1 bean class - */ - -public class Value_type1 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = value_type1 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 6904201895138778900L; - - /** - * field for ExtraElement This was an Array! - */ - - - protected org.apache.axiom.om.OMElement[] localExtraElement; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localExtraElementTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axiom.om.OMElement[] - */ - public org.apache.axiom.om.OMElement[] getExtraElement() { - return this.localExtraElement; - } - - - - /** - * validate the array for ExtraElement - */ - protected void validateExtraElement(final org.apache.axiom.om.OMElement[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param ExtraElement - */ - public void setExtraElement(final org.apache.axiom.om.OMElement[] param) { - - validateExtraElement(param); - - this.localExtraElementTracker = param != null; - - this.localExtraElement = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.apache.axiom.om.OMElement - */ - public void addExtraElement(final org.apache.axiom.om.OMElement param) { - if (this.localExtraElement == null) { - this.localExtraElement = new org.apache.axiom.om.OMElement[] {}; - } - - - // update the setting tracker - this.localExtraElementTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtraElement); - list.add(param); - this.localExtraElement = - (org.apache.axiom.om.OMElement[]) list.toArray(new org.apache.axiom.om.OMElement[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":value_type1", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "value_type1", xmlWriter); - } - - - } - if (this.localExtraElementTracker) { - - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - element.serialize(xmlWriter); - } else { - - // we have to do nothing since minOccures zero - - } - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localExtraElementTracker) { - if (this.localExtraElement != null) { - for (final OMElement element : this.localExtraElement) { - if (element != null) { - elementList.add(new javax.xml.namespace.QName("", "extraElement")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - // have to do nothing - - } - - } - } else { - throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); - } - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Value_type1 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Value_type1 object = new Value_type1(); - - int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"value_type1".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Value_type1) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - - - - // Process the array and step past its final element's end. - - boolean loopDone1 = false; - - while (!loopDone1) { - event = reader.getEventType(); - if (javax.xml.stream.XMLStreamConstants.START_ELEMENT == event) { - - // We need to wrap the reader so that it produces a fake START_DOCUEMENT event - final org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = - new org.apache.axis2.databinding.utils.NamedStaxOMBuilder( - new org.apache.axis2.util.StreamWrapper(reader), reader.getName()); - - list1.add(builder1.getOMElement()); - reader.next(); - if (reader.isEndElement()) { - // we have two countinuos end elements - loopDone1 = true; - } - - } else if (javax.xml.stream.XMLStreamConstants.END_ELEMENT == event) { - loopDone1 = true; - } else { - reader.next(); - } - - } - - - object.setExtraElement((org.apache.axiom.om.OMElement[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.apache.axiom.om.OMElement.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfo.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfo.java deleted file mode 100644 index 2baac94be..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfo.java +++ /dev/null @@ -1,364 +0,0 @@ - -/** - * VariableInfo.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * VariableInfo bean class - */ - -public class VariableInfo implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -6956859381619628725L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "VariableInfo", "ns1"); - - - - /** - * field for VariableInfo - */ - - - protected org.wso2.bps.management.schema.VariableInfoType localVariableInfo; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.VariableInfoType - */ - public org.wso2.bps.management.schema.VariableInfoType getVariableInfo() { - return this.localVariableInfo; - } - - - - /** - * Auto generated setter method - * - * @param param VariableInfo - */ - public void setVariableInfo(final org.wso2.bps.management.schema.VariableInfoType param) { - - this.localVariableInfo = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final 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 - - if (this.localVariableInfo == null) { - throw new org.apache.axis2.databinding.ADBException("VariableInfo cannot be null!"); - } - this.localVariableInfo.serialize(MY_QNAME, xmlWriter); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final 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 this.localVariableInfo.getPullParser(MY_QNAME); - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static VariableInfo parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final VariableInfo object = new VariableInfo(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final 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. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - while (!reader.isEndElement()) { - if (reader.isStartElement()) { - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "VariableInfo").equals(reader.getName())) { - - object.setVariableInfo(org.wso2.bps.management.schema.VariableInfoType.Factory.parse(reader)); - - } // End of if for expected property start element - - else { - // 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfoType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfoType.java deleted file mode 100644 index 27a1f7ead..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfoType.java +++ /dev/null @@ -1,511 +0,0 @@ - -/** - * VariableInfoType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * VariableInfoType bean class - */ - -public class VariableInfoType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = VariableInfoType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -2769524843280716254L; - - /** - * field for Self - */ - - - protected org.wso2.bps.management.schema.VariableRefType localSelf; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.VariableRefType - */ - public org.wso2.bps.management.schema.VariableRefType getSelf() { - return this.localSelf; - } - - - - /** - * Auto generated setter method - * - * @param param Self - */ - public void setSelf(final org.wso2.bps.management.schema.VariableRefType param) { - - this.localSelf = param; - - - } - - - /** - * field for Value - */ - - - protected org.wso2.bps.management.schema.Value_type0 localValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localValueTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Value_type0 - */ - public org.wso2.bps.management.schema.Value_type0 getValue() { - return this.localValue; - } - - - - /** - * Auto generated setter method - * - * @param param Value - */ - public void setValue(final org.wso2.bps.management.schema.Value_type0 param) { - this.localValueTracker = param != null; - - this.localValue = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":VariableInfoType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "VariableInfoType", - xmlWriter); - } - - - } - - if (this.localSelf == null) { - throw new org.apache.axis2.databinding.ADBException("self cannot be null!!"); - } - this.localSelf.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "self"), - xmlWriter); - if (this.localValueTracker) { - if (this.localValue == null) { - throw new org.apache.axis2.databinding.ADBException("value cannot be null!!"); - } - this.localValue.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "value"), - xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "self")); - - - if (this.localSelf == null) { - throw new org.apache.axis2.databinding.ADBException("self cannot be null!!"); - } - elementList.add(this.localSelf); - if (this.localValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "value")); - - - if (this.localValue == null) { - throw new org.apache.axis2.databinding.ADBException("value cannot be null!!"); - } - elementList.add(this.localValue); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static VariableInfoType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final VariableInfoType object = new VariableInfoType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"VariableInfoType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (VariableInfoType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "self").equals(reader.getName())) { - - object.setSelf(org.wso2.bps.management.schema.VariableRefType.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "value").equals(reader.getName())) { - - object.setValue(org.wso2.bps.management.schema.Value_type0.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfoWithEventsType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfoWithEventsType.java deleted file mode 100644 index 18c0f3243..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableInfoWithEventsType.java +++ /dev/null @@ -1,585 +0,0 @@ - -/** - * VariableInfoWithEventsType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * VariableInfoWithEventsType bean class - */ - -public class VariableInfoWithEventsType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = VariableInfoWithEventsType - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -6657309777910021580L; - - /** - * field for Self - */ - - - protected org.wso2.bps.management.schema.VariableRefType localSelf; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.VariableRefType - */ - public org.wso2.bps.management.schema.VariableRefType getSelf() { - return this.localSelf; - } - - - - /** - * Auto generated setter method - * - * @param param Self - */ - public void setSelf(final org.wso2.bps.management.schema.VariableRefType param) { - - this.localSelf = param; - - - } - - - /** - * field for Value - */ - - - protected org.wso2.bps.management.schema.Value_type1 localValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localValueTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.Value_type1 - */ - public org.wso2.bps.management.schema.Value_type1 getValue() { - return this.localValue; - } - - - - /** - * Auto generated setter method - * - * @param param Value - */ - public void setValue(final org.wso2.bps.management.schema.Value_type1 param) { - this.localValueTracker = param != null; - - this.localValue = param; - - - } - - - /** - * field for VariableEventsList - */ - - - protected org.wso2.bps.management.schema.EventInfoList localVariableEventsList; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localVariableEventsListTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.EventInfoList - */ - public org.wso2.bps.management.schema.EventInfoList getVariableEventsList() { - return this.localVariableEventsList; - } - - - - /** - * Auto generated setter method - * - * @param param VariableEventsList - */ - public void setVariableEventsList(final org.wso2.bps.management.schema.EventInfoList param) { - this.localVariableEventsListTracker = param != null; - - this.localVariableEventsList = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":VariableInfoWithEventsType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "VariableInfoWithEventsType", - xmlWriter); - } - - - } - - if (this.localSelf == null) { - throw new org.apache.axis2.databinding.ADBException("self cannot be null!!"); - } - this.localSelf.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "self"), - xmlWriter); - if (this.localValueTracker) { - if (this.localValue == null) { - throw new org.apache.axis2.databinding.ADBException("value cannot be null!!"); - } - this.localValue.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "value"), - xmlWriter); - } - if (this.localVariableEventsListTracker) { - if (this.localVariableEventsList == null) { - throw new org.apache.axis2.databinding.ADBException("variableEventsList cannot be null!!"); - } - this.localVariableEventsList.serialize(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/schema", "variableEventsList"), xmlWriter); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "self")); - - - if (this.localSelf == null) { - throw new org.apache.axis2.databinding.ADBException("self cannot be null!!"); - } - elementList.add(this.localSelf); - if (this.localValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "value")); - - - if (this.localValue == null) { - throw new org.apache.axis2.databinding.ADBException("value cannot be null!!"); - } - elementList.add(this.localValue); - } - if (this.localVariableEventsListTracker) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "variableEventsList")); - - - if (this.localVariableEventsList == null) { - throw new org.apache.axis2.databinding.ADBException("variableEventsList cannot be null!!"); - } - elementList.add(this.localVariableEventsList); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static VariableInfoWithEventsType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final VariableInfoWithEventsType object = new VariableInfoWithEventsType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"VariableInfoWithEventsType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (VariableInfoWithEventsType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "self").equals(reader.getName())) { - - object.setSelf(org.wso2.bps.management.schema.VariableRefType.Factory.parse(reader)); - - reader.next(); - - } // End of if for expected property start element - - else { - // A start element we are not expecting indicates an invalid parameter was passed - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "value").equals(reader.getName())) { - - object.setValue(org.wso2.bps.management.schema.Value_type1.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://wso2.org/bps/management/schema", - "variableEventsList").equals(reader.getName())) { - - object.setVariableEventsList(org.wso2.bps.management.schema.EventInfoList.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableRefType.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableRefType.java deleted file mode 100644 index 6bc9a8a0d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariableRefType.java +++ /dev/null @@ -1,558 +0,0 @@ - -/** - * VariableRefType.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * VariableRefType bean class - */ - -public class VariableRefType implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = VariableRefType Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 8141202504282753334L; - /** - * field for Iid This was an Attribute! - */ - - - protected java.lang.String localIid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getIid() { - return this.localIid; - } - - - - /** - * Auto generated setter method - * - * @param param Iid - */ - public void setIid(final java.lang.String param) { - - this.localIid = param; - - - } - - - /** - * field for Siid This was an Attribute! - */ - - - protected java.lang.String localSiid; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getSiid() { - return this.localSiid; - } - - - - /** - * Auto generated setter method - * - * @param param Siid - */ - public void setSiid(final java.lang.String param) { - - this.localSiid = param; - - - } - - - /** - * field for Name This was an Attribute! - */ - - - protected java.lang.String localName; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getName() { - return this.localName; - } - - - - /** - * Auto generated setter method - * - * @param param Name - */ - public void setName(final java.lang.String param) { - - this.localName = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":VariableRefType", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "VariableRefType", - xmlWriter); - } - - - } - - if (this.localIid != null) { - - writeAttribute("", "iid", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localIid is null"); - } - - if (this.localSiid != null) { - - writeAttribute("", "siid", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSiid), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localSiid is null"); - } - - if (this.localName != null) { - - writeAttribute("", "name", org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName), - xmlWriter); - - - } - - else { - throw new org.apache.axis2.databinding.ADBException("required attribute localName is null"); - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - - attribList.add(new javax.xml.namespace.QName("", "iid")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localIid)); - - attribList.add(new javax.xml.namespace.QName("", "siid")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localSiid)); - - attribList.add(new javax.xml.namespace.QName("", "name")); - - attribList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localName)); - - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static VariableRefType parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final VariableRefType object = new VariableRefType(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"VariableRefType".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (VariableRefType) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - // handle attribute "iid" - final java.lang.String tempAttribIid = - - reader.getAttributeValue(null, "iid"); - - if (tempAttribIid != null) { - final java.lang.String content = tempAttribIid; - - object.setIid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribIid)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute iid is missing"); - - } - handledAttributes.add("iid"); - - // handle attribute "siid" - final java.lang.String tempAttribSiid = - - reader.getAttributeValue(null, "siid"); - - if (tempAttribSiid != null) { - final java.lang.String content = tempAttribSiid; - - object.setSiid(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribSiid)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute siid is missing"); - - } - handledAttributes.add("siid"); - - // handle attribute "name" - final java.lang.String tempAttribName = - - reader.getAttributeValue(null, "name"); - - if (tempAttribName != null) { - final java.lang.String content = tempAttribName; - - object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(tempAttribName)); - - } else { - - throw new org.apache.axis2.databinding.ADBException("Required attribute name is missing"); - - } - handledAttributes.add("name"); - - - reader.next(); - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariablesWithEvents_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariablesWithEvents_type0.java deleted file mode 100644 index d3ca66d86..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/VariablesWithEvents_type0.java +++ /dev/null @@ -1,538 +0,0 @@ - -/** - * VariablesWithEvents_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * VariablesWithEvents_type0 bean class - */ - -public class VariablesWithEvents_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = variablesWithEvents_type0 - * Namespace URI = http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 3342533487916892L; - - /** - * field for VariableInfoWithEvents This was an Array! - */ - - - protected org.wso2.bps.management.schema.VariableInfoWithEventsType[] localVariableInfoWithEvents; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localVariableInfoWithEventsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.VariableInfoWithEventsType[] - */ - public org.wso2.bps.management.schema.VariableInfoWithEventsType[] getVariableInfoWithEvents() { - return this.localVariableInfoWithEvents; - } - - - - /** - * validate the array for VariableInfoWithEvents - */ - protected void validateVariableInfoWithEvents(final org.wso2.bps.management.schema.VariableInfoWithEventsType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param VariableInfoWithEvents - */ - public void setVariableInfoWithEvents(final org.wso2.bps.management.schema.VariableInfoWithEventsType[] param) { - - validateVariableInfoWithEvents(param); - - this.localVariableInfoWithEventsTracker = param != null; - - this.localVariableInfoWithEvents = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.VariableInfoWithEventsType - */ - public void addVariableInfoWithEvents(final org.wso2.bps.management.schema.VariableInfoWithEventsType param) { - if (this.localVariableInfoWithEvents == null) { - this.localVariableInfoWithEvents = new org.wso2.bps.management.schema.VariableInfoWithEventsType[] {}; - } - - - // update the setting tracker - this.localVariableInfoWithEventsTracker = true; - - - final java.util.List list = - org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localVariableInfoWithEvents); - list.add(param); - this.localVariableInfoWithEvents = - (org.wso2.bps.management.schema.VariableInfoWithEventsType[]) list.toArray(new org.wso2.bps.management.schema.VariableInfoWithEventsType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":variablesWithEvents_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "variablesWithEvents_type0", - xmlWriter); - } - - - } - if (this.localVariableInfoWithEventsTracker) { - if (this.localVariableInfoWithEvents != null) { - for (final VariableInfoWithEventsType localVariableInfoWithEvent : this.localVariableInfoWithEvents) { - if (localVariableInfoWithEvent != null) { - localVariableInfoWithEvent.serialize(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/schema", "variableInfoWithEvents"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("variableInfoWithEvents cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localVariableInfoWithEventsTracker) { - if (this.localVariableInfoWithEvents != null) { - for (final VariableInfoWithEventsType localVariableInfoWithEvent : this.localVariableInfoWithEvents) { - - if (localVariableInfoWithEvent != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "variableInfoWithEvents")); - elementList.add(localVariableInfoWithEvent); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("variableInfoWithEvents cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static VariablesWithEvents_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final VariablesWithEvents_type0 object = new VariablesWithEvents_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"variablesWithEvents_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (VariablesWithEvents_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "variableInfoWithEvents").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.VariableInfoWithEventsType.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://wso2.org/bps/management/schema", - "variableInfoWithEvents").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.VariableInfoWithEventsType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setVariableInfoWithEvents((org.wso2.bps.management.schema.VariableInfoWithEventsType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.VariableInfoWithEventsType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Variables_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Variables_type0.java deleted file mode 100644 index c9e15bc61..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Variables_type0.java +++ /dev/null @@ -1,537 +0,0 @@ - -/** - * Variables_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * Variables_type0 bean class - */ - -public class Variables_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = variables_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = -357891409731159561L; - - /** - * field for VariableInfo This was an Array! - */ - - - protected org.wso2.bps.management.schema.VariableInfoType[] localVariableInfo; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localVariableInfoTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.bps.management.schema.VariableInfoType[] - */ - public org.wso2.bps.management.schema.VariableInfoType[] getVariableInfo() { - return this.localVariableInfo; - } - - - - /** - * validate the array for VariableInfo - */ - protected void validateVariableInfo(final org.wso2.bps.management.schema.VariableInfoType[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param VariableInfo - */ - public void setVariableInfo(final org.wso2.bps.management.schema.VariableInfoType[] param) { - - validateVariableInfo(param); - - this.localVariableInfoTracker = param != null; - - this.localVariableInfo = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.bps.management.schema.VariableInfoType - */ - public void addVariableInfo(final org.wso2.bps.management.schema.VariableInfoType param) { - if (this.localVariableInfo == null) { - this.localVariableInfo = new org.wso2.bps.management.schema.VariableInfoType[] {}; - } - - - // update the setting tracker - this.localVariableInfoTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localVariableInfo); - list.add(param); - this.localVariableInfo = - (org.wso2.bps.management.schema.VariableInfoType[]) list.toArray(new org.wso2.bps.management.schema.VariableInfoType[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":variables_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "variables_type0", - xmlWriter); - } - - - } - if (this.localVariableInfoTracker) { - if (this.localVariableInfo != null) { - for (final VariableInfoType element : this.localVariableInfo) { - if (element != null) { - element.serialize(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "variableInfo"), xmlWriter); - } else { - - // we don't have to do any thing since minOccures is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("variableInfo cannot be null!!"); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localVariableInfoTracker) { - if (this.localVariableInfo != null) { - for (final VariableInfoType element : this.localVariableInfo) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "variableInfo")); - elementList.add(element); - } else { - - // nothing to do - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("variableInfo cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Variables_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Variables_type0 object = new Variables_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"variables_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Variables_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "variableInfo").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(org.wso2.bps.management.schema.VariableInfoType.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://wso2.org/bps/management/schema", - "variableInfo").equals(reader.getName())) { - list1.add(org.wso2.bps.management.schema.VariableInfoType.Factory.parse(reader)); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setVariableInfo((org.wso2.bps.management.schema.VariableInfoType[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.bps.management.schema.VariableInfoType.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Versions_type0.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Versions_type0.java deleted file mode 100644 index 4b762ba49..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/schema/Versions_type0.java +++ /dev/null @@ -1,544 +0,0 @@ - -/** - * Versions_type0.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.schema; - - -/** - * Versions_type0 bean class - */ - -public class Versions_type0 implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = versions_type0 Namespace URI = - * http://wso2.org/bps/management/schema Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 8476689481406181460L; - - /** - * field for PackageName This was an Array! - */ - - - protected java.lang.String[] localPackageName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPackageNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String[] - */ - public java.lang.String[] getPackageName() { - return this.localPackageName; - } - - - - /** - * validate the array for PackageName - */ - protected void validatePackageName(final java.lang.String[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param PackageName - */ - public void setPackageName(final java.lang.String[] param) { - - validatePackageName(param); - - this.localPackageNameTracker = param != null; - - this.localPackageName = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param java.lang.String - */ - public void addPackageName(final java.lang.String param) { - if (this.localPackageName == null) { - this.localPackageName = new java.lang.String[] {}; - } - - - // update the setting tracker - this.localPackageNameTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localPackageName); - list.add(param); - this.localPackageName = (java.lang.String[]) list.toArray(new java.lang.String[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://wso2.org/bps/management/schema"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":versions_type0", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "versions_type0", xmlWriter); - } - - - } - if (this.localPackageNameTracker) { - if (this.localPackageName != null) { - namespace = "http://wso2.org/bps/management/schema"; - for (final String element : this.localPackageName) { - - if (element != null) { - - writeStartElement(null, namespace, "packageName", xmlWriter); - - - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - - xmlWriter.writeEndElement(); - - } else { - - // we have to do nothing since minOccurs is zero - - } - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("packageName cannot be null!!"); - - } - - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://wso2.org/bps/management/schema")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localPackageNameTracker) { - if (this.localPackageName != null) { - for (final String element : this.localPackageName) { - - if (element != null) { - elementList.add(new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "packageName")); - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(element)); - } else { - - // have to do nothing - - } - - - } - } else { - - throw new org.apache.axis2.databinding.ADBException("packageName cannot be null!!"); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Versions_type0 parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Versions_type0 object = new Versions_type0(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"versions_type0".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Versions_type0) org.wso2.bps.management.wsdl.instancemanagement.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "packageName").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - list1.add(reader.getElementText()); - - // loop until we find a start element that is not part of this array - boolean loopDone1 = false; - while (!loopDone1) { - // 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 - loopDone1 = true; - } else { - if (new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", - "packageName").equals(reader.getName())) { - list1.add(reader.getElementText()); - - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setPackageName((java.lang.String[]) list1.toArray(new java.lang.String[list1.size()])); - - } // End of if for expected property start element - - else { - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementService.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementService.java deleted file mode 100644 index b232e1a11..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementService.java +++ /dev/null @@ -1,86 +0,0 @@ - - -/** - * BPELPackageManagementService.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.bpelpackagemanagement; - -/* - * BPELPackageManagementService java interface - */ - -public interface BPELPackageManagementService { - - - /** - * Auto generated method signature - * - * @param undeployBPELPackage0 - * - * @throws org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException : - */ - - - public org.wso2.bps.management.schema.UndeployStatus undeployBPELPackage( - - org.wso2.bps.management.schema.UndeployBPELPackage undeployBPELPackage0) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param undeployBPELPackage0 - * - */ - public void startundeployBPELPackage( - - org.wso2.bps.management.schema.UndeployBPELPackage undeployBPELPackage0, - - final org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param listDeployedPackagesPaginated2 - * - * @throws org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException : - */ - - - public org.wso2.bps.management.schema.DeployedPackagesPaginated listDeployedPackagesPaginated( - - org.wso2.bps.management.schema.ListDeployedPackagesPaginated listDeployedPackagesPaginated2) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param listDeployedPackagesPaginated2 - * - */ - public void startlistDeployedPackagesPaginated( - - org.wso2.bps.management.schema.ListDeployedPackagesPaginated listDeployedPackagesPaginated2, - - final org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - // -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementServiceCallbackHandler.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementServiceCallbackHandler.java deleted file mode 100644 index 9558c1d4a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementServiceCallbackHandler.java +++ /dev/null @@ -1,74 +0,0 @@ - -/** - * BPELPackageManagementServiceCallbackHandler.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.bpelpackagemanagement; - -/** - * BPELPackageManagementServiceCallbackHandler Callback class, Users can extend this class and - * implement their own receiveResult and receiveError methods. - */ -public abstract class BPELPackageManagementServiceCallbackHandler { - - - - 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 BPELPackageManagementServiceCallbackHandler(final Object clientData) { - this.clientData = clientData; - } - - /** - * Please use this constructor if you don't want to set any clientData - */ - public BPELPackageManagementServiceCallbackHandler() { - this.clientData = null; - } - - /** - * Get the client data - */ - - public Object getClientData() { - return this.clientData; - } - - - /** - * auto generated Axis2 call back method for undeployBPELPackage method override this method for - * handling normal response from undeployBPELPackage operation - */ - public void receiveResultundeployBPELPackage(final org.wso2.bps.management.schema.UndeployStatus result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * undeployBPELPackage operation - */ - public void receiveErrorundeployBPELPackage(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for listDeployedPackagesPaginated method override this - * method for handling normal response from listDeployedPackagesPaginated operation - */ - public void receiveResultlistDeployedPackagesPaginated(final org.wso2.bps.management.schema.DeployedPackagesPaginated result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * listDeployedPackagesPaginated operation - */ - public void receiveErrorlistDeployedPackagesPaginated(final java.lang.Exception e) {} - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementServiceStub.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementServiceStub.java deleted file mode 100644 index b7dc62da2..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/BPELPackageManagementServiceStub.java +++ /dev/null @@ -1,1015 +0,0 @@ - -/** - * BPELPackageManagementServiceStub.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ -package org.wso2.bps.management.wsdl.bpelpackagemanagement; - -import javax.xml.namespace.QName; - -/* - * BPELPackageManagementServiceStub java implementation - */ - - -public class BPELPackageManagementServiceStub extends org.apache.axis2.client.Stub - implements BPELPackageManagementService { - protected org.apache.axis2.description.AxisOperation[] _operations; - - // hashmaps to keep the fault mapping - private final java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); - private final java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); - private final 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(java.lang.System.currentTimeMillis()) + "_" + counter; - } - - - private void populateAxisService() throws org.apache.axis2.AxisFault { - - // creating the Service with a unique name - this._service = - new org.apache.axis2.description.AxisService("BPELPackageManagementService" + getUniqueSuffix()); - addAnonymousOperations(); - - // creating the operations - org.apache.axis2.description.AxisOperation __operation; - - this._operations = new org.apache.axis2.description.AxisOperation[2]; - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/BPELPackageManagement", - "undeployBPELPackage")); - this._service.addOperation(__operation); - - - - this._operations[0] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/BPELPackageManagement", - "listDeployedPackagesPaginated")); - this._service.addOperation(__operation); - - - - this._operations[1] = __operation; - - - } - - // populates the faults - private void populateFaults() { - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "packageManagementException"), - "undeployBPELPackage"), "org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "packageManagementException"), - "undeployBPELPackage"), "org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "packageManagementException"), - "undeployBPELPackage"), "org.wso2.bps.management.schema.PackageManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "packageManagementException"), - "listDeployedPackagesPaginated"), - "org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "packageManagementException"), - "listDeployedPackagesPaginated"), - "org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "packageManagementException"), - "listDeployedPackagesPaginated"), "org.wso2.bps.management.schema.PackageManagementException"); - - - - } - - /** - * Constructor that takes in a configContext - */ - - public BPELPackageManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(configurationContext, targetEndpoint, false); - } - - - /** - * Constructor that takes in a configContext and useseperate listner - */ - public BPELPackageManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint, - final boolean useSeparateListener) throws org.apache.axis2.AxisFault { - // To populate AxisService - populateAxisService(); - populateFaults(); - - this._serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext, this._service); - - - this._serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(targetEndpoint)); - this._serviceClient.getOptions().setUseSeparateListener(useSeparateListener); - - - } - - /** - * Default Constructor - */ - public BPELPackageManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { - - this(configurationContext, "http://localhost:9763/services/BPELPackageManagementService"); - - } - - /** - * Default Constructor - */ - public BPELPackageManagementServiceStub() throws org.apache.axis2.AxisFault { - - this("http://localhost:9763/services/BPELPackageManagementService"); - - } - - /** - * Constructor taking the target endpoint - */ - public BPELPackageManagementServiceStub(final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(null, targetEndpoint); - } - - - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementService#undeployBPELPackage - * @param undeployBPELPackage4 - * - * @throws org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.UndeployStatus undeployBPELPackage( - - final org.wso2.bps.management.schema.UndeployBPELPackage undeployBPELPackage4) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:undeployBPELPackage"); - _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()), undeployBPELPackage4, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/BPELPackageManagement", "undeployBPELPackage"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), org.wso2.bps.management.schema.UndeployStatus.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.UndeployStatus) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "undeployBPELPackage"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "undeployBPELPackage")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "undeployBPELPackage")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException) { - throw (org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementService#startundeployBPELPackage - * @param undeployBPELPackage4 - * - */ - @Override - public void startundeployBPELPackage( - - final org.wso2.bps.management.schema.UndeployBPELPackage undeployBPELPackage4, - - final org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:undeployBPELPackage"); - _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()), undeployBPELPackage4, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/BPELPackageManagement", "undeployBPELPackage"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.UndeployStatus.class, getEnvelopeNamespaces(resultEnv)); - callback.receiveResultundeployBPELPackage((org.wso2.bps.management.schema.UndeployStatus) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorundeployBPELPackage(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (BPELPackageManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "undeployBPELPackage"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) BPELPackageManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "undeployBPELPackage")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) BPELPackageManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "undeployBPELPackage")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException) { - callback.receiveErrorundeployBPELPackage(ex); - return; - } - - - callback.receiveErrorundeployBPELPackage(new java.rmi.RemoteException(ex.getMessage(), - ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorundeployBPELPackage(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorundeployBPELPackage(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorundeployBPELPackage(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorundeployBPELPackage(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorundeployBPELPackage(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorundeployBPELPackage(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorundeployBPELPackage(f); - } - } else { - callback.receiveErrorundeployBPELPackage(f); - } - } else { - callback.receiveErrorundeployBPELPackage(f); - } - } else { - callback.receiveErrorundeployBPELPackage(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorundeployBPELPackage(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[0].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[0].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementService#listDeployedPackagesPaginated - * @param listDeployedPackagesPaginated6 - * - * @throws org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.DeployedPackagesPaginated listDeployedPackagesPaginated( - - final org.wso2.bps.management.schema.ListDeployedPackagesPaginated listDeployedPackagesPaginated6) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[1].getName()); - _operationClient.getOptions().setAction("urn:listDeployedPackagesPaginated"); - _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()), - listDeployedPackagesPaginated6, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/BPELPackageManagement", - "listDeployedPackagesPaginated"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.DeployedPackagesPaginated.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.DeployedPackagesPaginated) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "listDeployedPackagesPaginated"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "listDeployedPackagesPaginated")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "listDeployedPackagesPaginated")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException) { - throw (org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementService#startlistDeployedPackagesPaginated - * @param listDeployedPackagesPaginated6 - * - */ - @Override - public void startlistDeployedPackagesPaginated( - - final org.wso2.bps.management.schema.ListDeployedPackagesPaginated listDeployedPackagesPaginated6, - - final org.wso2.bps.management.wsdl.bpelpackagemanagement.BPELPackageManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[1].getName()); - _operationClient.getOptions().setAction("urn:listDeployedPackagesPaginated"); - _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()), listDeployedPackagesPaginated6, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/BPELPackageManagement", - "listDeployedPackagesPaginated"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.DeployedPackagesPaginated.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultlistDeployedPackagesPaginated((org.wso2.bps.management.schema.DeployedPackagesPaginated) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorlistDeployedPackagesPaginated(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (BPELPackageManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "listDeployedPackagesPaginated"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) BPELPackageManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "listDeployedPackagesPaginated")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) BPELPackageManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "listDeployedPackagesPaginated")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.bpelpackagemanagement.PackageManagementException) { - callback.receiveErrorlistDeployedPackagesPaginated(ex); - return; - } - - - callback.receiveErrorlistDeployedPackagesPaginated(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - } else { - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - } else { - callback.receiveErrorlistDeployedPackagesPaginated(f); - } - } else { - callback.receiveErrorlistDeployedPackagesPaginated(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorlistDeployedPackagesPaginated(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[1].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[1].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - - - /** - * A utility method that copies the namepaces from the SOAPEnvelope - */ - private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); - final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); - while (namespaceIterator.hasNext()) { - final org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); - returnMap.put(ns.getPrefix(), ns.getNamespaceURI()); - } - return returnMap; - } - - - - private final javax.xml.namespace.QName[] opNameArray = null; - - private boolean optimizeContent(final javax.xml.namespace.QName opName) { - - - if (this.opNameArray == null) { - return false; - } - for (final QName element : this.opNameArray) { - if (opName.equals(element)) { - return true; - } - } - return false; - } - - // http://localhost:9763/services/BPELPackageManagementService - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.UndeployBPELPackage param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.UndeployBPELPackage.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.UndeployStatus param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.UndeployStatus.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.PackageManagementException param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.PackageManagementException.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.ListDeployedPackagesPaginated param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.ListDeployedPackagesPaginated.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.DeployedPackagesPaginated param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.DeployedPackagesPaginated.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.UndeployBPELPackage param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.UndeployBPELPackage.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.ListDeployedPackagesPaginated param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.ListDeployedPackagesPaginated.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory) { - return factory.getDefaultEnvelope(); - } - - - private java.lang.Object fromOM(final org.apache.axiom.om.OMElement param, final java.lang.Class type, - final java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault { - - try { - - if (org.wso2.bps.management.schema.UndeployBPELPackage.class.equals(type)) { - - return org.wso2.bps.management.schema.UndeployBPELPackage.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.UndeployStatus.class.equals(type)) { - - return org.wso2.bps.management.schema.UndeployStatus.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.PackageManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.PackageManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ListDeployedPackagesPaginated.class.equals(type)) { - - return org.wso2.bps.management.schema.ListDeployedPackagesPaginated.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.DeployedPackagesPaginated.class.equals(type)) { - - return org.wso2.bps.management.schema.DeployedPackagesPaginated.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.PackageManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.PackageManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - } - catch (final java.lang.Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - return null; - } - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/ExtensionMapper.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/ExtensionMapper.java deleted file mode 100644 index be7177bbb..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/ExtensionMapper.java +++ /dev/null @@ -1,504 +0,0 @@ - -/** - * ExtensionMapper.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.wsdl.bpelpackagemanagement; - -/** - * ExtensionMapper class - */ - -public class ExtensionMapper { - - public static java.lang.Object getTypeObject(final java.lang.String namespaceURI, final java.lang.String typeName, - final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "action_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Action_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EventInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.EventInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ScopeInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "variables_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Variables_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "property_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Property_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceSummaryType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceSummaryType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailuresInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.FailuresInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "activities_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Activities_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FaultInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FaultInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "bpelDefinition".equals(typeName)) { - - return org.wso2.bps.management.schema.BpelDefinition.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "package_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Package_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "listProcessesCustomPaginatedInput".equals(typeName)) { - - return org.wso2.bps.management.schema.ListProcessesCustomPaginatedInput.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "LimitedProcessInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.LimitedProcessInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "CorrelationPropertyType".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationPropertyType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessProperties".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessProperties.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailuresInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FailuresInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "DeploymentInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.DeploymentInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EventInfoList".equals(typeName)) { - - return org.wso2.bps.management.schema.EventInfoList.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ActivityInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "getPaginatedInstanceListInputType".equals(typeName)) { - - return org.wso2.bps.management.schema.GetPaginatedInstanceListInputType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSet_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSet_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "value_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Value_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "instances_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Instances_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "value_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Value_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "InstanceInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityLifeCycleEventsListType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityLifeCycleEventsListType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSet_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSet_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "getPaginatedProcessListInputType".equals(typeName)) { - - return org.wso2.bps.management.schema.GetPaginatedProcessListInputType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "LimitedInstanceInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.LimitedInstanceInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceStatus".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceStatus.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "childrenWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.ChildrenWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "action_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Action_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "DefinitionInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.DefinitionInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSets_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSets_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "VariableInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSets_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSets_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "children_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Children_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ScopeInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "PackageStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.PackageStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceSummary".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceSummary.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "variablesWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.VariablesWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityLifeCycleEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityLifeCycleEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessStatus".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessStatus.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "VariableInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "InstanceDeleteStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceDeleteStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "VariableRefType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableRefType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "data_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Data_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "versions_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Versions_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "endpointRef_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.EndpointRef_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ScopeStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailureInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FailureInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ActivityStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "activitiesWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivitiesWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "serviceLocation".equals(typeName)) { - - return org.wso2.bps.management.schema.ServiceLocation.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EndpointReferencesType".equals(typeName)) { - - return org.wso2.bps.management.schema.EndpointReferencesType.Factory.parse(reader); - - - } - - - throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); - } - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/PackageManagementException.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/PackageManagementException.java deleted file mode 100644 index f9fc1dd1d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/bpelpackagemanagement/PackageManagementException.java +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * PackageManagementException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.bpelpackagemanagement; - -public class PackageManagementException extends java.lang.Exception { - - private static final long serialVersionUID = 1330000208818L; - - private org.wso2.bps.management.schema.PackageManagementException faultMessage; - - - public PackageManagementException() { - super("PackageManagementException"); - } - - public PackageManagementException(final java.lang.String s) { - super(s); - } - - public PackageManagementException(final java.lang.String s, final java.lang.Throwable ex) { - super(s, ex); - } - - public PackageManagementException(final java.lang.Throwable cause) { - super(cause); - } - - - public void setFaultMessage(final org.wso2.bps.management.schema.PackageManagementException msg) { - this.faultMessage = msg; - } - - public org.wso2.bps.management.schema.PackageManagementException getFaultMessage() { - return this.faultMessage; - } -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/ExtensionMapper.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/ExtensionMapper.java deleted file mode 100644 index 1510471e9..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/ExtensionMapper.java +++ /dev/null @@ -1,504 +0,0 @@ - -/** - * ExtensionMapper.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.wsdl.instancemanagement; - -/** - * ExtensionMapper class - */ - -public class ExtensionMapper { - - public static java.lang.Object getTypeObject(final java.lang.String namespaceURI, final java.lang.String typeName, - final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "action_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Action_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EventInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.EventInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ScopeInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "variables_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Variables_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "property_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Property_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceSummaryType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceSummaryType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailuresInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.FailuresInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "activities_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Activities_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FaultInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FaultInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "bpelDefinition".equals(typeName)) { - - return org.wso2.bps.management.schema.BpelDefinition.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "package_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Package_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "listProcessesCustomPaginatedInput".equals(typeName)) { - - return org.wso2.bps.management.schema.ListProcessesCustomPaginatedInput.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "LimitedProcessInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.LimitedProcessInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "CorrelationPropertyType".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationPropertyType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessProperties".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessProperties.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailuresInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FailuresInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "DeploymentInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.DeploymentInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EventInfoList".equals(typeName)) { - - return org.wso2.bps.management.schema.EventInfoList.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ActivityInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "getPaginatedInstanceListInputType".equals(typeName)) { - - return org.wso2.bps.management.schema.GetPaginatedInstanceListInputType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSet_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSet_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "value_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Value_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "instances_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Instances_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "value_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Value_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "InstanceInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityLifeCycleEventsListType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityLifeCycleEventsListType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSet_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSet_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "getPaginatedProcessListInputType".equals(typeName)) { - - return org.wso2.bps.management.schema.GetPaginatedProcessListInputType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "LimitedInstanceInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.LimitedInstanceInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceStatus".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceStatus.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "childrenWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.ChildrenWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "action_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Action_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "DefinitionInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.DefinitionInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSets_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSets_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "VariableInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSets_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSets_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "children_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Children_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ScopeInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "PackageStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.PackageStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceSummary".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceSummary.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "variablesWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.VariablesWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityLifeCycleEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityLifeCycleEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessStatus".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessStatus.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "VariableInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "InstanceDeleteStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceDeleteStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "VariableRefType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableRefType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "data_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Data_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "versions_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Versions_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "endpointRef_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.EndpointRef_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ScopeStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailureInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FailureInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ActivityStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "activitiesWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivitiesWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "serviceLocation".equals(typeName)) { - - return org.wso2.bps.management.schema.ServiceLocation.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EndpointReferencesType".equals(typeName)) { - - return org.wso2.bps.management.schema.EndpointReferencesType.Factory.parse(reader); - - - } - - - throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); - } - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementException.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementException.java deleted file mode 100644 index 55b825c13..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementException.java +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * InstanceManagementException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.instancemanagement; - -public class InstanceManagementException extends java.lang.Exception { - - private static final long serialVersionUID = 1330000308258L; - - private org.wso2.bps.management.schema.InstanceManagementException faultMessage; - - - public InstanceManagementException() { - super("InstanceManagementException"); - } - - public InstanceManagementException(final java.lang.String s) { - super(s); - } - - public InstanceManagementException(final java.lang.String s, final java.lang.Throwable ex) { - super(s, ex); - } - - public InstanceManagementException(final java.lang.Throwable cause) { - super(cause); - } - - - public void setFaultMessage(final org.wso2.bps.management.schema.InstanceManagementException msg) { - this.faultMessage = msg; - } - - public org.wso2.bps.management.schema.InstanceManagementException getFaultMessage() { - return this.faultMessage; - } -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementService.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementService.java deleted file mode 100644 index 3cda2af86..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementService.java +++ /dev/null @@ -1,298 +0,0 @@ - - -/** - * InstanceManagementService.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.instancemanagement; - -/* - * InstanceManagementService java interface - */ - -public interface InstanceManagementService { - - - /** - * Auto generated method signature - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - public org.wso2.bps.management.schema.InstanceSummaryE getInstanceSummary( - - ) throws java.rmi.RemoteException - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - */ - public void startgetInstanceSummary( - - - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - public void resumeInstance(org.wso2.bps.management.schema.ResumeInstance resumeInstance4 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - - /** - * Auto generated method signature - * - * @param getPaginatedInstanceListInput5 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - public org.wso2.bps.management.schema.PaginatedInstanceList getPaginatedInstanceList( - - org.wso2.bps.management.schema.GetPaginatedInstanceListInput getPaginatedInstanceListInput5) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getPaginatedInstanceListInput5 - * - */ - public void startgetPaginatedInstanceList( - - org.wso2.bps.management.schema.GetPaginatedInstanceListInput getPaginatedInstanceListInput5, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param getActivityLifeCycleFilterIn7 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - public org.wso2.bps.management.schema.ActivityLifeCycleEvents getActivityLifeCycleFilter( - - org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn getActivityLifeCycleFilterIn7) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getActivityLifeCycleFilterIn7 - * - */ - public void startgetActivityLifeCycleFilter( - - org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn getActivityLifeCycleFilterIn7, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param getInstanceInfoIn9 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - public org.wso2.bps.management.schema.InstanceInfo getInstanceInfo( - - org.wso2.bps.management.schema.GetInstanceInfoIn getInstanceInfoIn9) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getInstanceInfoIn9 - * - */ - public void startgetInstanceInfo( - - org.wso2.bps.management.schema.GetInstanceInfoIn getInstanceInfoIn9, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - public void suspendInstance(org.wso2.bps.management.schema.SuspendInstance suspendInstance11 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - - /** - * Auto generated method signature - * - * @param deleteInstances12 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - public org.wso2.bps.management.schema.DeleteInstanceResponse deleteInstances( - - org.wso2.bps.management.schema.DeleteInstances deleteInstances12) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param deleteInstances12 - * - */ - public void startdeleteInstances( - - org.wso2.bps.management.schema.DeleteInstances deleteInstances12, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param getInstanceInfoIn14 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - public org.wso2.bps.management.schema.InstanceInfoWithEvents getInstanceInfoWithEvents( - - org.wso2.bps.management.schema.GetInstanceInfoIn getInstanceInfoIn14) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getInstanceInfoIn14 - * - */ - public void startgetInstanceInfoWithEvents( - - org.wso2.bps.management.schema.GetInstanceInfoIn getInstanceInfoIn14, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param getLongRunningInstancesInput16 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - public org.wso2.bps.management.schema.GetLongRunningInstancesResponse getLongRunningInstances( - - org.wso2.bps.management.schema.GetLongRunningInstancesInput getLongRunningInstancesInput16) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getLongRunningInstancesInput16 - * - */ - public void startgetLongRunningInstances( - - org.wso2.bps.management.schema.GetLongRunningInstancesInput getLongRunningInstancesInput16, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - public void recoverActivity(org.wso2.bps.management.schema.RecoverActivity recoverActivity18 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - public void terminateInstance(org.wso2.bps.management.schema.TerminateInstance terminateInstance19 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException; - - - - // -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementServiceCallbackHandler.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementServiceCallbackHandler.java deleted file mode 100644 index 0ea004494..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementServiceCallbackHandler.java +++ /dev/null @@ -1,142 +0,0 @@ - -/** - * InstanceManagementServiceCallbackHandler.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.instancemanagement; - -/** - * InstanceManagementServiceCallbackHandler Callback class, Users can extend this class and - * implement their own receiveResult and receiveError methods. - */ -public abstract class InstanceManagementServiceCallbackHandler { - - - - 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 InstanceManagementServiceCallbackHandler(final Object clientData) { - this.clientData = clientData; - } - - /** - * Please use this constructor if you don't want to set any clientData - */ - public InstanceManagementServiceCallbackHandler() { - this.clientData = null; - } - - /** - * Get the client data - */ - - public Object getClientData() { - return this.clientData; - } - - - /** - * auto generated Axis2 call back method for getInstanceSummary method override this method for - * handling normal response from getInstanceSummary operation - */ - public void receiveResultgetInstanceSummary(final org.wso2.bps.management.schema.InstanceSummaryE result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getInstanceSummary operation - */ - public void receiveErrorgetInstanceSummary(final java.lang.Exception e) {} - - // No methods generated for meps other than in-out - - /** - * auto generated Axis2 call back method for getPaginatedInstanceList method override this method - * for handling normal response from getPaginatedInstanceList operation - */ - public void receiveResultgetPaginatedInstanceList(final org.wso2.bps.management.schema.PaginatedInstanceList result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getPaginatedInstanceList operation - */ - public void receiveErrorgetPaginatedInstanceList(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for getActivityLifeCycleFilter method override this method - * for handling normal response from getActivityLifeCycleFilter operation - */ - public void receiveResultgetActivityLifeCycleFilter(final org.wso2.bps.management.schema.ActivityLifeCycleEvents result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getActivityLifeCycleFilter operation - */ - public void receiveErrorgetActivityLifeCycleFilter(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for getInstanceInfo method override this method for - * handling normal response from getInstanceInfo operation - */ - public void receiveResultgetInstanceInfo(final org.wso2.bps.management.schema.InstanceInfo result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getInstanceInfo operation - */ - public void receiveErrorgetInstanceInfo(final java.lang.Exception e) {} - - // No methods generated for meps other than in-out - - /** - * auto generated Axis2 call back method for deleteInstances method override this method for - * handling normal response from deleteInstances operation - */ - public void receiveResultdeleteInstances(final org.wso2.bps.management.schema.DeleteInstanceResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * deleteInstances operation - */ - public void receiveErrordeleteInstances(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for getInstanceInfoWithEvents method override this method - * for handling normal response from getInstanceInfoWithEvents operation - */ - public void receiveResultgetInstanceInfoWithEvents(final org.wso2.bps.management.schema.InstanceInfoWithEvents result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getInstanceInfoWithEvents operation - */ - public void receiveErrorgetInstanceInfoWithEvents(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for getLongRunningInstances method override this method for - * handling normal response from getLongRunningInstances operation - */ - public void receiveResultgetLongRunningInstances(final org.wso2.bps.management.schema.GetLongRunningInstancesResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getLongRunningInstances operation - */ - public void receiveErrorgetLongRunningInstances(final java.lang.Exception e) {} - - // No methods generated for meps other than in-out - - // No methods generated for meps other than in-out - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementServiceStub.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementServiceStub.java deleted file mode 100644 index f01c16aba..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/instancemanagement/InstanceManagementServiceStub.java +++ /dev/null @@ -1,3759 +0,0 @@ - -/** - * InstanceManagementServiceStub.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ -package org.wso2.bps.management.wsdl.instancemanagement; - -import javax.xml.namespace.QName; - -/* - * InstanceManagementServiceStub java implementation - */ - - -public class InstanceManagementServiceStub extends org.apache.axis2.client.Stub implements InstanceManagementService { - protected org.apache.axis2.description.AxisOperation[] _operations; - - // hashmaps to keep the fault mapping - private final java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); - private final java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); - private final 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(java.lang.System.currentTimeMillis()) + "_" + counter; - } - - - private void populateAxisService() throws org.apache.axis2.AxisFault { - - // creating the Service with a unique name - this._service = new org.apache.axis2.description.AxisService("InstanceManagementService" + getUniqueSuffix()); - addAnonymousOperations(); - - // creating the operations - org.apache.axis2.description.AxisOperation __operation; - - this._operations = new org.apache.axis2.description.AxisOperation[11]; - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "getInstanceSummary")); - this._service.addOperation(__operation); - - - - this._operations[0] = __operation; - - - __operation = new org.apache.axis2.description.RobustOutOnlyAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "resumeInstance")); - this._service.addOperation(__operation); - - - - this._operations[1] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "getPaginatedInstanceList")); - this._service.addOperation(__operation); - - - - this._operations[2] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "getActivityLifeCycleFilter")); - this._service.addOperation(__operation); - - - - this._operations[3] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "getInstanceInfo")); - this._service.addOperation(__operation); - - - - this._operations[4] = __operation; - - - __operation = new org.apache.axis2.description.RobustOutOnlyAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "suspendInstance")); - this._service.addOperation(__operation); - - - - this._operations[5] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "deleteInstances")); - this._service.addOperation(__operation); - - - - this._operations[6] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "getInstanceInfoWithEvents")); - this._service.addOperation(__operation); - - - - this._operations[7] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "getLongRunningInstances")); - this._service.addOperation(__operation); - - - - this._operations[8] = __operation; - - - __operation = new org.apache.axis2.description.RobustOutOnlyAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "recoverActivity")); - this._service.addOperation(__operation); - - - - this._operations[9] = __operation; - - - __operation = new org.apache.axis2.description.RobustOutOnlyAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/InstanceManagement", - "terminateInstance")); - this._service.addOperation(__operation); - - - - this._operations[10] = __operation; - - - } - - // populates the faults - private void populateFaults() { - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceSummary"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceSummary"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceSummary"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "resumeInstance"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "resumeInstance"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "resumeInstance"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getPaginatedInstanceList"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getPaginatedInstanceList"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getPaginatedInstanceList"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getActivityLifeCycleFilter"), - "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getActivityLifeCycleFilter"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getActivityLifeCycleFilter"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceInfo"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceInfo"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceInfo"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "suspendInstance"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "suspendInstance"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "suspendInstance"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "deleteInstances"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "deleteInstances"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "deleteInstances"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceInfoWithEvents"), - "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceInfoWithEvents"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getInstanceInfoWithEvents"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getLongRunningInstances"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getLongRunningInstances"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "getLongRunningInstances"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "recoverActivity"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "recoverActivity"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "recoverActivity"), "org.wso2.bps.management.schema.InstanceManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "terminateInstance"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "terminateInstance"), "org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "instanceManagementException"), - "terminateInstance"), "org.wso2.bps.management.schema.InstanceManagementException"); - - - - } - - /** - * Constructor that takes in a configContext - */ - - public InstanceManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(configurationContext, targetEndpoint, false); - } - - - /** - * Constructor that takes in a configContext and useseperate listner - */ - public InstanceManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint, - final boolean useSeparateListener) throws org.apache.axis2.AxisFault { - // To populate AxisService - populateAxisService(); - populateFaults(); - - this._serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext, this._service); - - - this._serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(targetEndpoint)); - this._serviceClient.getOptions().setUseSeparateListener(useSeparateListener); - - - } - - /** - * Default Constructor - */ - public InstanceManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { - - this(configurationContext, "http://localhost:9763/services/InstanceManagementService"); - - } - - /** - * Default Constructor - */ - public InstanceManagementServiceStub() throws org.apache.axis2.AxisFault { - - this("http://localhost:9763/services/InstanceManagementService"); - - } - - /** - * Constructor taking the target endpoint - */ - public InstanceManagementServiceStub(final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(null, targetEndpoint); - } - - - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#getInstanceSummary - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.InstanceSummaryE getInstanceSummary( - - ) - - - throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:getInstanceSummary"); - _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; - - // Style is taken to be "document". No input parameters - // according to the WS-Basic profile in this case we have to send an empty soap message - final org.apache.axiom.soap.SOAPFactory factory = - getFactory(_operationClient.getOptions().getSoapVersionURI()); - env = factory.getDefaultEnvelope(); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), org.wso2.bps.management.schema.InstanceSummaryE.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.InstanceSummaryE) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getInstanceSummary"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceSummary")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceSummary")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#startgetInstanceSummary - */ - @Override - public void startgetInstanceSummary( - - - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:getInstanceSummary"); - _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 taken to be "document". No input parameters - // according to the WS-Basic profile in this case we have to send an empty soap message - final org.apache.axiom.soap.SOAPFactory factory = getFactory(_operationClient.getOptions().getSoapVersionURI()); - env = factory.getDefaultEnvelope(); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.InstanceSummaryE.class, getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetInstanceSummary((org.wso2.bps.management.schema.InstanceSummaryE) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetInstanceSummary(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (InstanceManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceSummary"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceSummary")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceSummary")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - callback.receiveErrorgetInstanceSummary(ex); - return; - } - - - callback.receiveErrorgetInstanceSummary(new java.rmi.RemoteException(ex.getMessage(), - ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceSummary(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceSummary(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceSummary(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceSummary(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceSummary(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceSummary(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceSummary(f); - } - } else { - callback.receiveErrorgetInstanceSummary(f); - } - } else { - callback.receiveErrorgetInstanceSummary(f); - } - } else { - callback.receiveErrorgetInstanceSummary(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetInstanceSummary(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[0].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[0].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - - /** - * Auto generated method signature - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - @Override - public void resumeInstance(final org.wso2.bps.management.schema.ResumeInstance resumeInstance22 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[1].getName()); - _operationClient.getOptions().setAction("urn:resumeInstance"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient, - org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, - "&"); - - org.apache.axiom.soap.SOAPEnvelope env = null; - _messageContext = new org.apache.axis2.context.MessageContext(); - - - // Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), resumeInstance22, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "resumeInstance"))); - - - // adding SOAP soap_headers - this._serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - _operationClient.execute(true); - - - } - catch (final org.apache.axis2.AxisFault f) { - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "resumeInstance"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "resumeInstance")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "resumeInstance")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - return; - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#getPaginatedInstanceList - * @param getPaginatedInstanceListInput23 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.PaginatedInstanceList getPaginatedInstanceList( - - final org.wso2.bps.management.schema.GetPaginatedInstanceListInput getPaginatedInstanceListInput23) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[2].getName()); - _operationClient.getOptions().setAction("urn:getPaginatedInstanceList"); - _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()), - getPaginatedInstanceListInput23, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", - "getPaginatedInstanceList"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.PaginatedInstanceList.class, getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.PaginatedInstanceList) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getPaginatedInstanceList"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedInstanceList")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedInstanceList")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#startgetPaginatedInstanceList - * @param getPaginatedInstanceListInput23 - * - */ - @Override - public void startgetPaginatedInstanceList( - - final org.wso2.bps.management.schema.GetPaginatedInstanceListInput getPaginatedInstanceListInput23, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[2].getName()); - _operationClient.getOptions().setAction("urn:getPaginatedInstanceList"); - _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()), getPaginatedInstanceListInput23, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "getPaginatedInstanceList"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.PaginatedInstanceList.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetPaginatedInstanceList((org.wso2.bps.management.schema.PaginatedInstanceList) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetPaginatedInstanceList(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (InstanceManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedInstanceList"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedInstanceList")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedInstanceList")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - callback.receiveErrorgetPaginatedInstanceList(ex); - return; - } - - - callback.receiveErrorgetPaginatedInstanceList(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedInstanceList(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedInstanceList(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedInstanceList(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedInstanceList(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedInstanceList(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedInstanceList(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedInstanceList(f); - } - } else { - callback.receiveErrorgetPaginatedInstanceList(f); - } - } else { - callback.receiveErrorgetPaginatedInstanceList(f); - } - } else { - callback.receiveErrorgetPaginatedInstanceList(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetPaginatedInstanceList(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[2].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[2].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#getActivityLifeCycleFilter - * @param getActivityLifeCycleFilterIn25 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.ActivityLifeCycleEvents getActivityLifeCycleFilter( - - final org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn getActivityLifeCycleFilterIn25) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[3].getName()); - _operationClient.getOptions().setAction("urn:getActivityLifeCycleFilter"); - _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()), - getActivityLifeCycleFilterIn25, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", - "getActivityLifeCycleFilter"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.ActivityLifeCycleEvents.class, getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.ActivityLifeCycleEvents) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getActivityLifeCycleFilter"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getActivityLifeCycleFilter")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getActivityLifeCycleFilter")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#startgetActivityLifeCycleFilter - * @param getActivityLifeCycleFilterIn25 - * - */ - @Override - public void startgetActivityLifeCycleFilter( - - final org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn getActivityLifeCycleFilterIn25, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[3].getName()); - _operationClient.getOptions().setAction("urn:getActivityLifeCycleFilter"); - _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()), getActivityLifeCycleFilterIn25, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "getActivityLifeCycleFilter"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.ActivityLifeCycleEvents.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetActivityLifeCycleFilter((org.wso2.bps.management.schema.ActivityLifeCycleEvents) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetActivityLifeCycleFilter(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (InstanceManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getActivityLifeCycleFilter"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getActivityLifeCycleFilter")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getActivityLifeCycleFilter")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - callback.receiveErrorgetActivityLifeCycleFilter(ex); - return; - } - - - callback.receiveErrorgetActivityLifeCycleFilter(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - } else { - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - } else { - callback.receiveErrorgetActivityLifeCycleFilter(f); - } - } else { - callback.receiveErrorgetActivityLifeCycleFilter(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetActivityLifeCycleFilter(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[3].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[3].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#getInstanceInfo - * @param getInstanceInfoIn27 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.InstanceInfo getInstanceInfo( - - final org.wso2.bps.management.schema.GetInstanceInfoIn getInstanceInfoIn27) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[4].getName()); - _operationClient.getOptions().setAction("urn:getInstanceInfo"); - _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()), getInstanceInfoIn27, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "getInstanceInfo"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), org.wso2.bps.management.schema.InstanceInfo.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.InstanceInfo) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getInstanceInfo"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfo")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfo")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#startgetInstanceInfo - * @param getInstanceInfoIn27 - * - */ - @Override - public void startgetInstanceInfo( - - final org.wso2.bps.management.schema.GetInstanceInfoIn getInstanceInfoIn27, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[4].getName()); - _operationClient.getOptions().setAction("urn:getInstanceInfo"); - _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()), getInstanceInfoIn27, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "getInstanceInfo"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), org.wso2.bps.management.schema.InstanceInfo.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetInstanceInfo((org.wso2.bps.management.schema.InstanceInfo) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetInstanceInfo(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (InstanceManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfo"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfo")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfo")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - callback.receiveErrorgetInstanceInfo(ex); - return; - } - - - callback.receiveErrorgetInstanceInfo(new java.rmi.RemoteException(ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfo(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfo(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfo(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfo(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfo(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfo(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfo(f); - } - } else { - callback.receiveErrorgetInstanceInfo(f); - } - } else { - callback.receiveErrorgetInstanceInfo(f); - } - } else { - callback.receiveErrorgetInstanceInfo(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetInstanceInfo(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[4].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[4].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - - /** - * Auto generated method signature - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - @Override - public void suspendInstance(final org.wso2.bps.management.schema.SuspendInstance suspendInstance29 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[5].getName()); - _operationClient.getOptions().setAction("urn:suspendInstance"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient, - org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, - "&"); - - org.apache.axiom.soap.SOAPEnvelope env = null; - _messageContext = new org.apache.axis2.context.MessageContext(); - - - // Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), suspendInstance29, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "suspendInstance"))); - - - // adding SOAP soap_headers - this._serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - _operationClient.execute(true); - - - } - catch (final org.apache.axis2.AxisFault f) { - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "suspendInstance"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "suspendInstance")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "suspendInstance")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - return; - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#deleteInstances - * @param deleteInstances30 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.DeleteInstanceResponse deleteInstances( - - final org.wso2.bps.management.schema.DeleteInstances deleteInstances30) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[6].getName()); - _operationClient.getOptions().setAction("urn:deleteInstances"); - _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()), deleteInstances30, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "deleteInstances"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.DeleteInstanceResponse.class, getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.DeleteInstanceResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "deleteInstances"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "deleteInstances")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "deleteInstances")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#startdeleteInstances - * @param deleteInstances30 - * - */ - @Override - public void startdeleteInstances( - - final org.wso2.bps.management.schema.DeleteInstances deleteInstances30, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[6].getName()); - _operationClient.getOptions().setAction("urn:deleteInstances"); - _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()), deleteInstances30, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "deleteInstances"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.DeleteInstanceResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultdeleteInstances((org.wso2.bps.management.schema.DeleteInstanceResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrordeleteInstances(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (InstanceManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "deleteInstances"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "deleteInstances")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "deleteInstances")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - callback.receiveErrordeleteInstances(ex); - return; - } - - - callback.receiveErrordeleteInstances(new java.rmi.RemoteException(ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteInstances(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteInstances(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteInstances(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteInstances(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteInstances(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteInstances(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrordeleteInstances(f); - } - } else { - callback.receiveErrordeleteInstances(f); - } - } else { - callback.receiveErrordeleteInstances(f); - } - } else { - callback.receiveErrordeleteInstances(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrordeleteInstances(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[6].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[6].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#getInstanceInfoWithEvents - * @param getInstanceInfoIn32 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.InstanceInfoWithEvents getInstanceInfoWithEvents( - - final org.wso2.bps.management.schema.GetInstanceInfoIn getInstanceInfoIn32) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[7].getName()); - _operationClient.getOptions().setAction("urn:getInstanceInfoWithEvents"); - _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()), getInstanceInfoIn32, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", - "getInstanceInfoWithEvents"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.InstanceInfoWithEvents.class, getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.InstanceInfoWithEvents) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getInstanceInfoWithEvents"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfoWithEvents")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfoWithEvents")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#startgetInstanceInfoWithEvents - * @param getInstanceInfoIn32 - * - */ - @Override - public void startgetInstanceInfoWithEvents( - - final org.wso2.bps.management.schema.GetInstanceInfoIn getInstanceInfoIn32, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[7].getName()); - _operationClient.getOptions().setAction("urn:getInstanceInfoWithEvents"); - _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()), getInstanceInfoIn32, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "getInstanceInfoWithEvents"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.InstanceInfoWithEvents.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetInstanceInfoWithEvents((org.wso2.bps.management.schema.InstanceInfoWithEvents) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetInstanceInfoWithEvents(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (InstanceManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfoWithEvents"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfoWithEvents")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getInstanceInfoWithEvents")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - callback.receiveErrorgetInstanceInfoWithEvents(ex); - return; - } - - - callback.receiveErrorgetInstanceInfoWithEvents(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - } else { - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - } else { - callback.receiveErrorgetInstanceInfoWithEvents(f); - } - } else { - callback.receiveErrorgetInstanceInfoWithEvents(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetInstanceInfoWithEvents(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[7].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[7].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#getLongRunningInstances - * @param getLongRunningInstancesInput34 - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.GetLongRunningInstancesResponse getLongRunningInstances( - - final org.wso2.bps.management.schema.GetLongRunningInstancesInput getLongRunningInstancesInput34) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[8].getName()); - _operationClient.getOptions().setAction("urn:getLongRunningInstances"); - _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()), - getLongRunningInstancesInput34, optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "getLongRunningInstances"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.GetLongRunningInstancesResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.GetLongRunningInstancesResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getLongRunningInstances"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getLongRunningInstances")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getLongRunningInstances")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementService#startgetLongRunningInstances - * @param getLongRunningInstancesInput34 - * - */ - @Override - public void startgetLongRunningInstances( - - final org.wso2.bps.management.schema.GetLongRunningInstancesInput getLongRunningInstancesInput34, - - final org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[8].getName()); - _operationClient.getOptions().setAction("urn:getLongRunningInstances"); - _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()), getLongRunningInstancesInput34, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "getLongRunningInstances"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.GetLongRunningInstancesResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetLongRunningInstances((org.wso2.bps.management.schema.GetLongRunningInstancesResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetLongRunningInstances(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (InstanceManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getLongRunningInstances"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getLongRunningInstances")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) InstanceManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getLongRunningInstances")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - callback.receiveErrorgetLongRunningInstances(ex); - return; - } - - - callback.receiveErrorgetLongRunningInstances(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetLongRunningInstances(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetLongRunningInstances(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetLongRunningInstances(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetLongRunningInstances(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetLongRunningInstances(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetLongRunningInstances(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetLongRunningInstances(f); - } - } else { - callback.receiveErrorgetLongRunningInstances(f); - } - } else { - callback.receiveErrorgetLongRunningInstances(f); - } - } else { - callback.receiveErrorgetLongRunningInstances(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetLongRunningInstances(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[8].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[8].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - - /** - * Auto generated method signature - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - @Override - public void recoverActivity(final org.wso2.bps.management.schema.RecoverActivity recoverActivity36 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[9].getName()); - _operationClient.getOptions().setAction("urn:recoverActivity"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient, - org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, - "&"); - - org.apache.axiom.soap.SOAPEnvelope env = null; - _messageContext = new org.apache.axis2.context.MessageContext(); - - - // Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), recoverActivity36, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "recoverActivity"))); - - - // adding SOAP soap_headers - this._serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - _operationClient.execute(true); - - - } - catch (final org.apache.axis2.AxisFault f) { - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "recoverActivity"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "recoverActivity")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "recoverActivity")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - return; - } - - - /** - * Auto generated method signature - * - * @throws org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException : - */ - @Override - public void terminateInstance(final org.wso2.bps.management.schema.TerminateInstance terminateInstance37 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[10].getName()); - _operationClient.getOptions().setAction("urn:terminateInstance"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient, - org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, - "&"); - - org.apache.axiom.soap.SOAPEnvelope env = null; - _messageContext = new org.apache.axis2.context.MessageContext(); - - - // Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), terminateInstance37, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/InstanceManagement", "terminateInstance"))); - - - // adding SOAP soap_headers - this._serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - _operationClient.execute(true); - - - } - catch (final org.apache.axis2.AxisFault f) { - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "terminateInstance"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "terminateInstance")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "terminateInstance")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) { - throw (org.wso2.bps.management.wsdl.instancemanagement.InstanceManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - return; - } - - - - /** - * A utility method that copies the namepaces from the SOAPEnvelope - */ - private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); - final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); - while (namespaceIterator.hasNext()) { - final org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); - returnMap.put(ns.getPrefix(), ns.getNamespaceURI()); - } - return returnMap; - } - - - - private final javax.xml.namespace.QName[] opNameArray = null; - - private boolean optimizeContent(final javax.xml.namespace.QName opName) { - - - if (this.opNameArray == null) { - return false; - } - for (final QName element : this.opNameArray) { - if (opName.equals(element)) { - return true; - } - } - return false; - } - - // http://localhost:9763/services/InstanceManagementService - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.InstanceSummaryE param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.InstanceSummaryE.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.InstanceManagementException param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.InstanceManagementException.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.ResumeInstance param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.ResumeInstance.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.GetPaginatedInstanceListInput param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.GetPaginatedInstanceListInput.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.PaginatedInstanceList param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.PaginatedInstanceList.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.ActivityLifeCycleEvents param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.ActivityLifeCycleEvents.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.GetInstanceInfoIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.GetInstanceInfoIn.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.InstanceInfo param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.InstanceInfo.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.SuspendInstance param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.SuspendInstance.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.DeleteInstances param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.DeleteInstances.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.DeleteInstanceResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.DeleteInstanceResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.InstanceInfoWithEvents param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.InstanceInfoWithEvents.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.GetLongRunningInstancesInput param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.GetLongRunningInstancesInput.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.GetLongRunningInstancesResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.GetLongRunningInstancesResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.RecoverActivity param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.RecoverActivity.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.TerminateInstance param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.TerminateInstance.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.ResumeInstance param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.ResumeInstance.MY_QNAME, factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.GetPaginatedInstanceListInput param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.GetPaginatedInstanceListInput.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.GetInstanceInfoIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.GetInstanceInfoIn.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.SuspendInstance param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(org.wso2.bps.management.schema.SuspendInstance.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.DeleteInstances param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(org.wso2.bps.management.schema.DeleteInstances.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.GetLongRunningInstancesInput param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.GetLongRunningInstancesInput.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.RecoverActivity param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(org.wso2.bps.management.schema.RecoverActivity.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.TerminateInstance param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.TerminateInstance.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory) { - return factory.getDefaultEnvelope(); - } - - - private java.lang.Object fromOM(final org.apache.axiom.om.OMElement param, final java.lang.Class type, - final java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault { - - try { - - if (org.wso2.bps.management.schema.InstanceSummaryE.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceSummaryE.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ResumeInstance.class.equals(type)) { - - return org.wso2.bps.management.schema.ResumeInstance.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.GetPaginatedInstanceListInput.class.equals(type)) { - - return org.wso2.bps.management.schema.GetPaginatedInstanceListInput.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.PaginatedInstanceList.class.equals(type)) { - - return org.wso2.bps.management.schema.PaginatedInstanceList.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn.class.equals(type)) { - - return org.wso2.bps.management.schema.GetActivityLifeCycleFilterIn.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ActivityLifeCycleEvents.class.equals(type)) { - - return org.wso2.bps.management.schema.ActivityLifeCycleEvents.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.GetInstanceInfoIn.class.equals(type)) { - - return org.wso2.bps.management.schema.GetInstanceInfoIn.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceInfo.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceInfo.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.SuspendInstance.class.equals(type)) { - - return org.wso2.bps.management.schema.SuspendInstance.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.DeleteInstances.class.equals(type)) { - - return org.wso2.bps.management.schema.DeleteInstances.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.DeleteInstanceResponse.class.equals(type)) { - - return org.wso2.bps.management.schema.DeleteInstanceResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.GetInstanceInfoIn.class.equals(type)) { - - return org.wso2.bps.management.schema.GetInstanceInfoIn.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceInfoWithEvents.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceInfoWithEvents.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.GetLongRunningInstancesInput.class.equals(type)) { - - return org.wso2.bps.management.schema.GetLongRunningInstancesInput.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.GetLongRunningInstancesResponse.class.equals(type)) { - - return org.wso2.bps.management.schema.GetLongRunningInstancesResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.RecoverActivity.class.equals(type)) { - - return org.wso2.bps.management.schema.RecoverActivity.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.TerminateInstance.class.equals(type)) { - - return org.wso2.bps.management.schema.TerminateInstance.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.InstanceManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.InstanceManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - } - catch (final java.lang.Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - return null; - } - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ExtensionMapper.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ExtensionMapper.java deleted file mode 100644 index e38921228..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ExtensionMapper.java +++ /dev/null @@ -1,504 +0,0 @@ - -/** - * ExtensionMapper.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.bps.management.wsdl.processmanagement; - -/** - * ExtensionMapper class - */ - -public class ExtensionMapper { - - public static java.lang.Object getTypeObject(final java.lang.String namespaceURI, final java.lang.String typeName, - final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "action_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Action_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EventInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.EventInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ScopeInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "variables_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Variables_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "property_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Property_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceSummaryType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceSummaryType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailuresInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.FailuresInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "activities_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Activities_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FaultInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FaultInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "bpelDefinition".equals(typeName)) { - - return org.wso2.bps.management.schema.BpelDefinition.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "package_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Package_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "listProcessesCustomPaginatedInput".equals(typeName)) { - - return org.wso2.bps.management.schema.ListProcessesCustomPaginatedInput.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "LimitedProcessInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.LimitedProcessInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "CorrelationPropertyType".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationPropertyType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessProperties".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessProperties.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailuresInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FailuresInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "DeploymentInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.DeploymentInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EventInfoList".equals(typeName)) { - - return org.wso2.bps.management.schema.EventInfoList.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ActivityInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "getPaginatedInstanceListInputType".equals(typeName)) { - - return org.wso2.bps.management.schema.GetPaginatedInstanceListInputType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSet_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSet_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "value_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Value_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "instances_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Instances_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "value_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Value_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "InstanceInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityLifeCycleEventsListType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityLifeCycleEventsListType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSet_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSet_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "getPaginatedProcessListInputType".equals(typeName)) { - - return org.wso2.bps.management.schema.GetPaginatedProcessListInputType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "LimitedInstanceInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.LimitedInstanceInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceStatus".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceStatus.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "childrenWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.ChildrenWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "action_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.Action_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "DefinitionInfo".equals(typeName)) { - - return org.wso2.bps.management.schema.DefinitionInfo.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSets_type1".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSets_type1.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "VariableInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "correlationSets_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.CorrelationSets_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "children_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Children_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ScopeInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "PackageStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.PackageStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "InstanceSummary".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceSummary.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "variablesWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.VariablesWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityLifeCycleEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityLifeCycleEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "ActivityInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ProcessStatus".equals(typeName)) { - - return org.wso2.bps.management.schema.ProcessStatus.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "VariableInfoWithEventsType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableInfoWithEventsType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "InstanceDeleteStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.InstanceDeleteStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "VariableRefType".equals(typeName)) { - - return org.wso2.bps.management.schema.VariableRefType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "data_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Data_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "versions_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.Versions_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "endpointRef_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.EndpointRef_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ScopeStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.ScopeStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "FailureInfoType".equals(typeName)) { - - return org.wso2.bps.management.schema.FailureInfoType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "ActivityStatusType".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivityStatusType.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) - && "activitiesWithEvents_type0".equals(typeName)) { - - return org.wso2.bps.management.schema.ActivitiesWithEvents_type0.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "serviceLocation".equals(typeName)) { - - return org.wso2.bps.management.schema.ServiceLocation.Factory.parse(reader); - - - } - - - if ("http://wso2.org/bps/management/schema".equals(namespaceURI) && "EndpointReferencesType".equals(typeName)) { - - return org.wso2.bps.management.schema.EndpointReferencesType.Factory.parse(reader); - - - } - - - throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); - } - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementException.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementException.java deleted file mode 100644 index d3d515f6d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementException.java +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * ProcessManagementException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.processmanagement; - -public class ProcessManagementException extends java.lang.Exception { - - private static final long serialVersionUID = 1330000259067L; - - private org.wso2.bps.management.schema.ProcessManagementException faultMessage; - - - public ProcessManagementException() { - super("ProcessManagementException"); - } - - public ProcessManagementException(final java.lang.String s) { - super(s); - } - - public ProcessManagementException(final java.lang.String s, final java.lang.Throwable ex) { - super(s, ex); - } - - public ProcessManagementException(final java.lang.Throwable cause) { - super(cause); - } - - - public void setFaultMessage(final org.wso2.bps.management.schema.ProcessManagementException msg) { - this.faultMessage = msg; - } - - public org.wso2.bps.management.schema.ProcessManagementException getFaultMessage() { - return this.faultMessage; - } -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementService.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementService.java deleted file mode 100644 index 1cb37d989..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementService.java +++ /dev/null @@ -1,145 +0,0 @@ - - -/** - * ProcessManagementService.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.processmanagement; - -/* - * ProcessManagementService java interface - */ - -public interface ProcessManagementService { - - - /** - * Auto generated method signature - * - * @param getAllProcesses0 - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - - - public org.wso2.bps.management.schema.ProcessIDList getAllProcesses( - - org.wso2.bps.management.schema.GetAllProcesses getAllProcesses0) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getAllProcesses0 - * - */ - public void startgetAllProcesses( - - org.wso2.bps.management.schema.GetAllProcesses getAllProcesses0, - - final org.wso2.bps.management.wsdl.processmanagement.ProcessManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - public void retireProcess(org.wso2.bps.management.schema.RetireProcessIn retireProcessIn2 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException; - - - - /** - * Auto generated method signature - * - * @param getPaginatedProcessListInput3 - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - - - public org.wso2.bps.management.schema.PaginatedProcessInfoList getPaginatedProcessList( - - org.wso2.bps.management.schema.GetPaginatedProcessListInput getPaginatedProcessListInput3) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getPaginatedProcessListInput3 - * - */ - public void startgetPaginatedProcessList( - - org.wso2.bps.management.schema.GetPaginatedProcessListInput getPaginatedProcessListInput3, - - final org.wso2.bps.management.wsdl.processmanagement.ProcessManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param getProcessInfoIn5 - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - - - public org.wso2.bps.management.schema.ProcessInfo getProcessInfo( - - org.wso2.bps.management.schema.GetProcessInfoIn getProcessInfoIn5) throws java.rmi.RemoteException - - , - org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getProcessInfoIn5 - * - */ - public void startgetProcessInfo( - - org.wso2.bps.management.schema.GetProcessInfoIn getProcessInfoIn5, - - final org.wso2.bps.management.wsdl.processmanagement.ProcessManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - public void activateProcess(org.wso2.bps.management.schema.ActivateProcessIn activateProcessIn7 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException; - - - - // -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementServiceCallbackHandler.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementServiceCallbackHandler.java deleted file mode 100644 index 2c37db4da..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementServiceCallbackHandler.java +++ /dev/null @@ -1,90 +0,0 @@ - -/** - * ProcessManagementServiceCallbackHandler.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.bps.management.wsdl.processmanagement; - -/** - * ProcessManagementServiceCallbackHandler Callback class, Users can extend this class and implement - * their own receiveResult and receiveError methods. - */ -public abstract class ProcessManagementServiceCallbackHandler { - - - - 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 ProcessManagementServiceCallbackHandler(final Object clientData) { - this.clientData = clientData; - } - - /** - * Please use this constructor if you don't want to set any clientData - */ - public ProcessManagementServiceCallbackHandler() { - this.clientData = null; - } - - /** - * Get the client data - */ - - public Object getClientData() { - return this.clientData; - } - - - /** - * auto generated Axis2 call back method for getAllProcesses method override this method for - * handling normal response from getAllProcesses operation - */ - public void receiveResultgetAllProcesses(final org.wso2.bps.management.schema.ProcessIDList result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getAllProcesses operation - */ - public void receiveErrorgetAllProcesses(final java.lang.Exception e) {} - - // No methods generated for meps other than in-out - - /** - * auto generated Axis2 call back method for getPaginatedProcessList method override this method for - * handling normal response from getPaginatedProcessList operation - */ - public void receiveResultgetPaginatedProcessList(final org.wso2.bps.management.schema.PaginatedProcessInfoList result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getPaginatedProcessList operation - */ - public void receiveErrorgetPaginatedProcessList(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for getProcessInfo method override this method for handling - * normal response from getProcessInfo operation - */ - public void receiveResultgetProcessInfo(final org.wso2.bps.management.schema.ProcessInfo result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getProcessInfo operation - */ - public void receiveErrorgetProcessInfo(final java.lang.Exception e) {} - - // No methods generated for meps other than in-out - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementServiceStub.java b/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementServiceStub.java deleted file mode 100644 index ee478ec6a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/bps/management/wsdl/processmanagement/ProcessManagementServiceStub.java +++ /dev/null @@ -1,1809 +0,0 @@ - -/** - * ProcessManagementServiceStub.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ -package org.wso2.bps.management.wsdl.processmanagement; - -import javax.xml.namespace.QName; - -/* - * ProcessManagementServiceStub java implementation - */ - - -public class ProcessManagementServiceStub extends org.apache.axis2.client.Stub implements ProcessManagementService { - protected org.apache.axis2.description.AxisOperation[] _operations; - - // hashmaps to keep the fault mapping - private final java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); - private final java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); - private final 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(java.lang.System.currentTimeMillis()) + "_" + counter; - } - - - private void populateAxisService() throws org.apache.axis2.AxisFault { - - // creating the Service with a unique name - this._service = new org.apache.axis2.description.AxisService("ProcessManagementService" + getUniqueSuffix()); - addAnonymousOperations(); - - // creating the operations - org.apache.axis2.description.AxisOperation __operation; - - this._operations = new org.apache.axis2.description.AxisOperation[5]; - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/ProcessManagement", - "getAllProcesses")); - this._service.addOperation(__operation); - - - - this._operations[0] = __operation; - - - __operation = new org.apache.axis2.description.RobustOutOnlyAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/ProcessManagement", - "retireProcess")); - this._service.addOperation(__operation); - - - - this._operations[1] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/ProcessManagement", - "getPaginatedProcessList")); - this._service.addOperation(__operation); - - - - this._operations[2] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/ProcessManagement", - "getProcessInfo")); - this._service.addOperation(__operation); - - - - this._operations[3] = __operation; - - - __operation = new org.apache.axis2.description.RobustOutOnlyAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://wso2.org/bps/management/wsdl/ProcessManagement", - "activateProcess")); - this._service.addOperation(__operation); - - - - this._operations[4] = __operation; - - - } - - // populates the faults - private void populateFaults() { - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getAllProcesses"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getAllProcesses"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getAllProcesses"), "org.wso2.bps.management.schema.ProcessManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "retireProcess"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "retireProcess"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "retireProcess"), "org.wso2.bps.management.schema.ProcessManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getPaginatedProcessList"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getPaginatedProcessList"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getPaginatedProcessList"), "org.wso2.bps.management.schema.ProcessManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getProcessInfo"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getProcessInfo"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "getProcessInfo"), "org.wso2.bps.management.schema.ProcessManagementException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "activateProcess"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "activateProcess"), "org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://wso2.org/bps/management/schema", "processManagementException"), - "activateProcess"), "org.wso2.bps.management.schema.ProcessManagementException"); - - - - } - - /** - * Constructor that takes in a configContext - */ - - public ProcessManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(configurationContext, targetEndpoint, false); - } - - - /** - * Constructor that takes in a configContext and useseperate listner - */ - public ProcessManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint, - final boolean useSeparateListener) throws org.apache.axis2.AxisFault { - // To populate AxisService - populateAxisService(); - populateFaults(); - - this._serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext, this._service); - - - this._serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(targetEndpoint)); - this._serviceClient.getOptions().setUseSeparateListener(useSeparateListener); - - - } - - /** - * Default Constructor - */ - public ProcessManagementServiceStub(final org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { - - this(configurationContext, "http://localhost:9763/services/ProcessManagementService"); - - } - - /** - * Default Constructor - */ - public ProcessManagementServiceStub() throws org.apache.axis2.AxisFault { - - this("http://localhost:9763/services/ProcessManagementService"); - - } - - /** - * Constructor taking the target endpoint - */ - public ProcessManagementServiceStub(final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(null, targetEndpoint); - } - - - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.processmanagement.ProcessManagementService#getAllProcesses - * @param getAllProcesses8 - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.ProcessIDList getAllProcesses( - - final org.wso2.bps.management.schema.GetAllProcesses getAllProcesses8) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:getAllProcesses"); - _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()), getAllProcesses8, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/ProcessManagement", "getAllProcesses"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), org.wso2.bps.management.schema.ProcessIDList.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.ProcessIDList) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getAllProcesses"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAllProcesses")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAllProcesses")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) { - throw (org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.processmanagement.ProcessManagementService#startgetAllProcesses - * @param getAllProcesses8 - * - */ - @Override - public void startgetAllProcesses( - - final org.wso2.bps.management.schema.GetAllProcesses getAllProcesses8, - - final org.wso2.bps.management.wsdl.processmanagement.ProcessManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:getAllProcesses"); - _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()), getAllProcesses8, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/ProcessManagement", "getAllProcesses"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.ProcessIDList.class, getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetAllProcesses((org.wso2.bps.management.schema.ProcessIDList) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetAllProcesses(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (ProcessManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAllProcesses"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) ProcessManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAllProcesses")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) ProcessManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAllProcesses")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) { - callback.receiveErrorgetAllProcesses(ex); - return; - } - - - callback.receiveErrorgetAllProcesses(new java.rmi.RemoteException(ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAllProcesses(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAllProcesses(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAllProcesses(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAllProcesses(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAllProcesses(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAllProcesses(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAllProcesses(f); - } - } else { - callback.receiveErrorgetAllProcesses(f); - } - } else { - callback.receiveErrorgetAllProcesses(f); - } - } else { - callback.receiveErrorgetAllProcesses(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetAllProcesses(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[0].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[0].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - - /** - * Auto generated method signature - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - @Override - public void retireProcess(final org.wso2.bps.management.schema.RetireProcessIn retireProcessIn10 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[1].getName()); - _operationClient.getOptions().setAction("urn:retireProcess"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient, - org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, - "&"); - - org.apache.axiom.soap.SOAPEnvelope env = null; - _messageContext = new org.apache.axis2.context.MessageContext(); - - - // Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), retireProcessIn10, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/ProcessManagement", "retireProcess"))); - - - // adding SOAP soap_headers - this._serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - _operationClient.execute(true); - - - } - catch (final org.apache.axis2.AxisFault f) { - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "retireProcess"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "retireProcess")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "retireProcess")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) { - throw (org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - return; - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.processmanagement.ProcessManagementService#getPaginatedProcessList - * @param getPaginatedProcessListInput11 - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.PaginatedProcessInfoList getPaginatedProcessList( - - final org.wso2.bps.management.schema.GetPaginatedProcessListInput getPaginatedProcessListInput11) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[2].getName()); - _operationClient.getOptions().setAction("urn:getPaginatedProcessList"); - _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()), - getPaginatedProcessListInput11, optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/ProcessManagement", "getPaginatedProcessList"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.PaginatedProcessInfoList.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.PaginatedProcessInfoList) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getPaginatedProcessList"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedProcessList")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedProcessList")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) { - throw (org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.processmanagement.ProcessManagementService#startgetPaginatedProcessList - * @param getPaginatedProcessListInput11 - * - */ - @Override - public void startgetPaginatedProcessList( - - final org.wso2.bps.management.schema.GetPaginatedProcessListInput getPaginatedProcessListInput11, - - final org.wso2.bps.management.wsdl.processmanagement.ProcessManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[2].getName()); - _operationClient.getOptions().setAction("urn:getPaginatedProcessList"); - _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()), getPaginatedProcessListInput11, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/ProcessManagement", "getPaginatedProcessList"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.bps.management.schema.PaginatedProcessInfoList.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetPaginatedProcessList((org.wso2.bps.management.schema.PaginatedProcessInfoList) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetPaginatedProcessList(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (ProcessManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedProcessList"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) ProcessManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedProcessList")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) ProcessManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPaginatedProcessList")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) { - callback.receiveErrorgetPaginatedProcessList(ex); - return; - } - - - callback.receiveErrorgetPaginatedProcessList(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedProcessList(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedProcessList(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedProcessList(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedProcessList(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedProcessList(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedProcessList(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPaginatedProcessList(f); - } - } else { - callback.receiveErrorgetPaginatedProcessList(f); - } - } else { - callback.receiveErrorgetPaginatedProcessList(f); - } - } else { - callback.receiveErrorgetPaginatedProcessList(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetPaginatedProcessList(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[2].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[2].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.bps.management.wsdl.processmanagement.ProcessManagementService#getProcessInfo - * @param getProcessInfoIn13 - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - - - - @Override - public org.wso2.bps.management.schema.ProcessInfo getProcessInfo( - - final org.wso2.bps.management.schema.GetProcessInfoIn getProcessInfoIn13) - - - throws java.rmi.RemoteException - - - , - org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[3].getName()); - _operationClient.getOptions().setAction("urn:getProcessInfo"); - _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()), getProcessInfoIn13, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/ProcessManagement", "getProcessInfo"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), org.wso2.bps.management.schema.ProcessInfo.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.bps.management.schema.ProcessInfo) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getProcessInfo"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getProcessInfo")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getProcessInfo")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) { - throw (org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.bps.management.wsdl.processmanagement.ProcessManagementService#startgetProcessInfo - * @param getProcessInfoIn13 - * - */ - @Override - public void startgetProcessInfo( - - final org.wso2.bps.management.schema.GetProcessInfoIn getProcessInfoIn13, - - final org.wso2.bps.management.wsdl.processmanagement.ProcessManagementServiceCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[3].getName()); - _operationClient.getOptions().setAction("urn:getProcessInfo"); - _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()), getProcessInfoIn13, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/ProcessManagement", "getProcessInfo"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), org.wso2.bps.management.schema.ProcessInfo.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetProcessInfo((org.wso2.bps.management.schema.ProcessInfo) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetProcessInfo(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (ProcessManagementServiceStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getProcessInfo"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) ProcessManagementServiceStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getProcessInfo")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) ProcessManagementServiceStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getProcessInfo")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) { - callback.receiveErrorgetProcessInfo(ex); - return; - } - - - callback.receiveErrorgetProcessInfo(new java.rmi.RemoteException(ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetProcessInfo(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetProcessInfo(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetProcessInfo(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetProcessInfo(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetProcessInfo(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetProcessInfo(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetProcessInfo(f); - } - } else { - callback.receiveErrorgetProcessInfo(f); - } - } else { - callback.receiveErrorgetProcessInfo(f); - } - } else { - callback.receiveErrorgetProcessInfo(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetProcessInfo(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[3].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[3].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - - /** - * Auto generated method signature - * - * @throws org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException : - */ - @Override - public void activateProcess(final org.wso2.bps.management.schema.ActivateProcessIn activateProcessIn15 - - ) throws java.rmi.RemoteException - - - , org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException { - org.apache.axis2.context.MessageContext _messageContext = null; - - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[4].getName()); - _operationClient.getOptions().setAction("urn:activateProcess"); - _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - - - - addPropertyToOperationClient(_operationClient, - org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, - "&"); - - org.apache.axiom.soap.SOAPEnvelope env = null; - _messageContext = new org.apache.axis2.context.MessageContext(); - - - // Style is Doc. - - - env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), activateProcessIn15, - optimizeContent(new javax.xml.namespace.QName( - "http://wso2.org/bps/management/wsdl/ProcessManagement", "activateProcess"))); - - - // adding SOAP soap_headers - this._serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - - _messageContext.setEnvelope(env); - - // add the message contxt to the operation client - _operationClient.addMessageContext(_messageContext); - - _operationClient.execute(true); - - - } - catch (final org.apache.axis2.AxisFault f) { - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "activateProcess"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "activateProcess")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "activateProcess")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) { - throw (org.wso2.bps.management.wsdl.processmanagement.ProcessManagementException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - - return; - } - - - - /** - * A utility method that copies the namepaces from the SOAPEnvelope - */ - private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); - final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); - while (namespaceIterator.hasNext()) { - final org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); - returnMap.put(ns.getPrefix(), ns.getNamespaceURI()); - } - return returnMap; - } - - - - private final javax.xml.namespace.QName[] opNameArray = null; - - private boolean optimizeContent(final javax.xml.namespace.QName opName) { - - - if (this.opNameArray == null) { - return false; - } - for (final QName element : this.opNameArray) { - if (opName.equals(element)) { - return true; - } - } - return false; - } - - // http://localhost:9763/services/ProcessManagementService - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.GetAllProcesses param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.GetAllProcesses.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.ProcessIDList param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.ProcessIDList.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.ProcessManagementException param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.ProcessManagementException.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.RetireProcessIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.RetireProcessIn.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.GetPaginatedProcessListInput param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.GetPaginatedProcessListInput.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.PaginatedProcessInfoList param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.PaginatedProcessInfoList.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.GetProcessInfoIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.GetProcessInfoIn.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.ProcessInfo param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.ProcessInfo.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.bps.management.schema.ActivateProcessIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.bps.management.schema.ActivateProcessIn.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.GetAllProcesses param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(org.wso2.bps.management.schema.GetAllProcesses.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.RetireProcessIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody().addChild(param.getOMElement(org.wso2.bps.management.schema.RetireProcessIn.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.GetPaginatedProcessListInput param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.GetPaginatedProcessListInput.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.GetProcessInfoIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.GetProcessInfoIn.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.bps.management.schema.ActivateProcessIn param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.bps.management.schema.ActivateProcessIn.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory) { - return factory.getDefaultEnvelope(); - } - - - private java.lang.Object fromOM(final org.apache.axiom.om.OMElement param, final java.lang.Class type, - final java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault { - - try { - - if (org.wso2.bps.management.schema.GetAllProcesses.class.equals(type)) { - - return org.wso2.bps.management.schema.GetAllProcesses.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ProcessIDList.class.equals(type)) { - - return org.wso2.bps.management.schema.ProcessIDList.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ProcessManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.ProcessManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.RetireProcessIn.class.equals(type)) { - - return org.wso2.bps.management.schema.RetireProcessIn.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ProcessManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.ProcessManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.GetPaginatedProcessListInput.class.equals(type)) { - - return org.wso2.bps.management.schema.GetPaginatedProcessListInput.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.PaginatedProcessInfoList.class.equals(type)) { - - return org.wso2.bps.management.schema.PaginatedProcessInfoList.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ProcessManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.ProcessManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.GetProcessInfoIn.class.equals(type)) { - - return org.wso2.bps.management.schema.GetProcessInfoIn.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ProcessInfo.class.equals(type)) { - - return org.wso2.bps.management.schema.ProcessInfo.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ProcessManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.ProcessManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ActivateProcessIn.class.equals(type)) { - - return org.wso2.bps.management.schema.ActivateProcessIn.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.bps.management.schema.ProcessManagementException.class.equals(type)) { - - return org.wso2.bps.management.schema.ProcessManagementException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - } - catch (final java.lang.Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - return null; - } - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploader.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploader.java deleted file mode 100644 index 9ad916e0b..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploader.java +++ /dev/null @@ -1,49 +0,0 @@ - - -/** - * BPELUploader.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.carbon.bpel.deployer.services; - -/* - * BPELUploader java interface - */ - -public interface BPELUploader { - - - /** - * Auto generated method signature - * - * @param uploadService1 - * - */ - - - public void uploadService( - - org.wso2.carbon.bpel.deployer.services.UploadService uploadService1) throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param uploadService1 - * - */ - public void startuploadService( - - org.wso2.carbon.bpel.deployer.services.UploadService uploadService1, - - final org.wso2.carbon.bpel.deployer.services.BPELUploaderCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - // -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploaderCallbackHandler.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploaderCallbackHandler.java deleted file mode 100644 index dac890d45..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploaderCallbackHandler.java +++ /dev/null @@ -1,62 +0,0 @@ - -/** - * BPELUploaderCallbackHandler.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.carbon.bpel.deployer.services; - -/** - * BPELUploaderCallbackHandler Callback class, Users can extend this class and implement their own - * receiveResult and receiveError methods. - */ -public abstract class BPELUploaderCallbackHandler { - - - - 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 BPELUploaderCallbackHandler(final Object clientData) { - this.clientData = clientData; - } - - /** - * Please use this constructor if you don't want to set any clientData - */ - public BPELUploaderCallbackHandler() { - this.clientData = null; - } - - /** - * Get the client data - */ - - public Object getClientData() { - return this.clientData; - } - - - /** - * auto generated Axis2 call back method for uploadService method override this method for handling - * normal response from uploadService operation - */ - public void receiveResultuploadService() {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * uploadService operation - */ - public void receiveErroruploadService(final java.lang.Exception e) {} - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploaderStub.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploaderStub.java deleted file mode 100644 index 6b95e22a5..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/BPELUploaderStub.java +++ /dev/null @@ -1,420 +0,0 @@ - -/** - * BPELUploaderStub.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ -package org.wso2.carbon.bpel.deployer.services; - -import javax.xml.namespace.QName; - -/* - * BPELUploaderStub java implementation - */ - - -public class BPELUploaderStub extends org.apache.axis2.client.Stub implements BPELUploader { - protected org.apache.axis2.description.AxisOperation[] _operations; - - // hashmaps to keep the fault mapping - private final java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); - private final java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); - private final 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(java.lang.System.currentTimeMillis()) + "_" + counter; - } - - - private void populateAxisService() throws org.apache.axis2.AxisFault { - - // creating the Service with a unique name - this._service = new org.apache.axis2.description.AxisService("BPELUploader" + getUniqueSuffix()); - addAnonymousOperations(); - - // creating the operations - org.apache.axis2.description.AxisOperation __operation; - - this._operations = new org.apache.axis2.description.AxisOperation[1]; - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://services.deployer.bpel.carbon.wso2.org", - "uploadService")); - this._service.addOperation(__operation); - - - - this._operations[0] = __operation; - - - } - - // populates the faults - private void populateFaults() { - - - - } - - /** - * Constructor that takes in a configContext - */ - - public BPELUploaderStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(configurationContext, targetEndpoint, false); - } - - - /** - * Constructor that takes in a configContext and useseperate listner - */ - public BPELUploaderStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint, - final boolean useSeparateListener) throws org.apache.axis2.AxisFault { - // To populate AxisService - populateAxisService(); - populateFaults(); - - this._serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext, this._service); - - - this._serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(targetEndpoint)); - this._serviceClient.getOptions().setUseSeparateListener(useSeparateListener); - - - } - - /** - * Default Constructor - */ - public BPELUploaderStub(final org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { - - this(configurationContext, - "https://192.168.178.21:9443/services/BPELUploader.BPELUploaderHttpsSoap11Endpoint/"); - - } - - /** - * Default Constructor - */ - public BPELUploaderStub() throws org.apache.axis2.AxisFault { - - this("https://192.168.178.21:9443/services/BPELUploader.BPELUploaderHttpsSoap11Endpoint/"); - - } - - /** - * Constructor taking the target endpoint - */ - public BPELUploaderStub(final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(null, targetEndpoint); - } - - - - /** - * Auto generated method signature - * - * @see org.wso2.carbon.bpel.deployer.services.BPELUploader#uploadService - * @param uploadService3 - * - */ - - - - @Override - public void uploadService( - - final org.wso2.carbon.bpel.deployer.services.UploadService uploadService3) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:uploadService"); - _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()), uploadService3, - optimizeContent(new javax.xml.namespace.QName( - "http://services.deployer.bpel.carbon.wso2.org", "uploadService"))); - - // adding SOAP soap_headers - this._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); - - - return; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "uploadService"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "uploadService")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "uploadService")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final 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 (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.carbon.bpel.deployer.services.BPELUploader#startuploadService - * @param uploadService3 - * - */ - @Override - public void startuploadService( - - final org.wso2.carbon.bpel.deployer.services.UploadService uploadService3, - - final org.wso2.carbon.bpel.deployer.services.BPELUploaderCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:uploadService"); - _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()), uploadService3, - optimizeContent(new javax.xml.namespace.QName("http://services.deployer.bpel.carbon.wso2.org", - "uploadService"))); - - // adding SOAP soap_headers - this._serviceClient.addHeadersToEnvelope(env); - // create message context with that soap envelope - _messageContext.setEnvelope(env); - - // add the message context to the operation client - _operationClient.addMessageContext(_messageContext); - - - - // Nothing to pass as the callback!!! - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[0].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[0].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - - - /** - * A utility method that copies the namepaces from the SOAPEnvelope - */ - private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); - final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); - while (namespaceIterator.hasNext()) { - final org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); - returnMap.put(ns.getPrefix(), ns.getNamespaceURI()); - } - return returnMap; - } - - - - private final javax.xml.namespace.QName[] opNameArray = null; - - private boolean optimizeContent(final javax.xml.namespace.QName opName) { - - - if (this.opNameArray == null) { - return false; - } - for (final QName element : this.opNameArray) { - if (opName.equals(element)) { - return true; - } - } - return false; - } - - // https://192.168.178.21:9443/services/BPELUploader.BPELUploaderHttpsSoap11Endpoint/ - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.bpel.deployer.services.UploadService param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.bpel.deployer.services.UploadService.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.carbon.bpel.deployer.services.UploadService param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.carbon.bpel.deployer.services.UploadService.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory) { - return factory.getDefaultEnvelope(); - } - - - private java.lang.Object fromOM(final org.apache.axiom.om.OMElement param, final java.lang.Class type, - final java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault { - - try { - - if (org.wso2.carbon.bpel.deployer.services.UploadService.class.equals(type)) { - - return org.wso2.carbon.bpel.deployer.services.UploadService.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - } - catch (final java.lang.Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - return null; - } - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/UploadService.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/UploadService.java deleted file mode 100644 index 207dbc303..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/UploadService.java +++ /dev/null @@ -1,567 +0,0 @@ - -/** - * UploadService.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.bpel.deployer.services; - -import org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem; - -/** - * UploadService bean class - */ - -public class UploadService implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 4338247998026638950L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://services.deployer.bpel.carbon.wso2.org", "uploadService", "ns2"); - - - - /** - * field for FileItems This was an Array! - */ - - - protected org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[] localFileItems; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFileItemsTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[] - */ - public org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[] getFileItems() { - return this.localFileItems; - } - - - - /** - * validate the array for FileItems - */ - protected void validateFileItems(final org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[] param) { - - } - - - /** - * Auto generated setter method - * - * @param param FileItems - */ - public void setFileItems(final org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[] param) { - - validateFileItems(param); - - this.localFileItemsTracker = true; - - this.localFileItems = param; - } - - - - /** - * Auto generated add method for the array for convenience - * - * @param param org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem - */ - public void addFileItems(final org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem param) { - if (this.localFileItems == null) { - this.localFileItems = new org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[] {}; - } - - - // update the setting tracker - this.localFileItemsTracker = true; - - - final java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localFileItems); - list.add(param); - this.localFileItems = - (org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[]) list.toArray(new org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[list.size()]); - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://services.deployer.bpel.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":uploadService", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "uploadService", xmlWriter); - } - - - } - if (this.localFileItemsTracker) { - if (this.localFileItems != null) { - for (final UploadedFileItem localFileItem : this.localFileItems) { - if (localFileItem != null) { - localFileItem.serialize(new javax.xml.namespace.QName( - "http://services.deployer.bpel.carbon.wso2.org", "fileItems"), xmlWriter); - } else { - - writeStartElement(null, "http://services.deployer.bpel.carbon.wso2.org", "fileItems", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - - } - } else { - - writeStartElement(null, "http://services.deployer.bpel.carbon.wso2.org", "fileItems", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://services.deployer.bpel.carbon.wso2.org")) { - return "ns2"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localFileItemsTracker) { - if (this.localFileItems != null) { - for (final UploadedFileItem localFileItem : this.localFileItems) { - - if (localFileItem != null) { - elementList.add(new javax.xml.namespace.QName("http://services.deployer.bpel.carbon.wso2.org", - "fileItems")); - elementList.add(localFileItem); - } else { - - elementList.add(new javax.xml.namespace.QName("http://services.deployer.bpel.carbon.wso2.org", - "fileItems")); - elementList.add(null); - - } - - } - } else { - - elementList.add(new javax.xml.namespace.QName("http://services.deployer.bpel.carbon.wso2.org", - "fileItems")); - elementList.add(this.localFileItems); - - } - - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static UploadService parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final UploadService object = new UploadService(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"uploadService".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (UploadService) org.wso2.carbon.bpel.deployer.services.types.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - final java.util.ArrayList list1 = new java.util.ArrayList(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://services.deployer.bpel.carbon.wso2.org", - "fileItems").equals(reader.getName())) { - - - - // Process the array and step past its final element's end. - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list1.add(null); - reader.next(); - } else { - list1.add(org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem.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://services.deployer.bpel.carbon.wso2.org", - "fileItems").equals(reader.getName())) { - - nillableValue = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - list1.add(null); - reader.next(); - } else { - list1.add(org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem.Factory.parse(reader)); - } - } else { - loopDone1 = true; - } - } - } - // call the converter utility to convert and set the array - - object.setFileItems((org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem[]) org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/types/xsd/ExtensionMapper.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/types/xsd/ExtensionMapper.java deleted file mode 100644 index f609cd33f..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/types/xsd/ExtensionMapper.java +++ /dev/null @@ -1,34 +0,0 @@ - -/** - * ExtensionMapper.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.bpel.deployer.services.types.xsd; - -/** - * ExtensionMapper class - */ - -public class ExtensionMapper { - - public static java.lang.Object getTypeObject(final java.lang.String namespaceURI, final java.lang.String typeName, - final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - - - if ("http://types.services.deployer.bpel.carbon.wso2.org/xsd".equals(namespaceURI) - && "UploadedFileItem".equals(typeName)) { - - return org.wso2.carbon.bpel.deployer.services.types.xsd.UploadedFileItem.Factory.parse(reader); - - - } - - - throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); - } - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/types/xsd/UploadedFileItem.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/types/xsd/UploadedFileItem.java deleted file mode 100644 index afb924c11..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/bpel/deployer/services/types/xsd/UploadedFileItem.java +++ /dev/null @@ -1,656 +0,0 @@ - -/** - * UploadedFileItem.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.bpel.deployer.services.types.xsd; - - -/** - * UploadedFileItem bean class - */ - -public class UploadedFileItem implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = UploadedFileItem Namespace URI = - * http://types.services.deployer.bpel.carbon.wso2.org/xsd Namespace Prefix = ns1 - */ - - - /** - * - */ - private static final long serialVersionUID = 4314843331535486509L; - - /** - * field for DataHandler - */ - - - protected javax.activation.DataHandler localDataHandler; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localDataHandlerTracker = false; - - - /** - * Auto generated getter method - * - * @return javax.activation.DataHandler - */ - public javax.activation.DataHandler getDataHandler() { - return this.localDataHandler; - } - - - - /** - * Auto generated setter method - * - * @param param DataHandler - */ - public void setDataHandler(final javax.activation.DataHandler param) { - this.localDataHandlerTracker = true; - - this.localDataHandler = param; - - - } - - - /** - * field for FileName - */ - - - protected java.lang.String localFileName; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFileNameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFileName() { - return this.localFileName; - } - - - - /** - * Auto generated setter method - * - * @param param FileName - */ - public void setFileName(final java.lang.String param) { - this.localFileNameTracker = true; - - this.localFileName = param; - - - } - - - /** - * field for FileType - */ - - - protected java.lang.String localFileType; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localFileTypeTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getFileType() { - return this.localFileType; - } - - - - /** - * Auto generated setter method - * - * @param param FileType - */ - public void setFileType(final java.lang.String param) { - this.localFileTypeTracker = true; - - this.localFileType = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://types.services.deployer.bpel.carbon.wso2.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":UploadedFileItem", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "UploadedFileItem", - xmlWriter); - } - - - } - if (this.localDataHandlerTracker) { - namespace = "http://types.services.deployer.bpel.carbon.wso2.org/xsd"; - writeStartElement(null, namespace, "dataHandler", xmlWriter); - - - if (this.localDataHandler != null) { - try { - org.apache.axiom.util.stax.XMLStreamWriterUtils.writeDataHandler(xmlWriter, this.localDataHandler, - null, true); - } - catch (final java.io.IOException ex) { - throw new javax.xml.stream.XMLStreamException("Unable to read data handler for dataHandler", ex); - } - } else { - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFileNameTracker) { - namespace = "http://types.services.deployer.bpel.carbon.wso2.org/xsd"; - writeStartElement(null, namespace, "fileName", xmlWriter); - - - if (this.localFileName == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localFileName); - - } - - xmlWriter.writeEndElement(); - } - if (this.localFileTypeTracker) { - namespace = "http://types.services.deployer.bpel.carbon.wso2.org/xsd"; - writeStartElement(null, namespace, "fileType", xmlWriter); - - - if (this.localFileType == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localFileType); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://types.services.deployer.bpel.carbon.wso2.org/xsd")) { - return "ns1"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localDataHandlerTracker) { - elementList.add(new javax.xml.namespace.QName("http://types.services.deployer.bpel.carbon.wso2.org/xsd", - "dataHandler")); - - elementList.add(this.localDataHandler); - } - if (this.localFileNameTracker) { - elementList.add(new javax.xml.namespace.QName("http://types.services.deployer.bpel.carbon.wso2.org/xsd", - "fileName")); - - elementList.add(this.localFileName == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFileName)); - } - if (this.localFileTypeTracker) { - elementList.add(new javax.xml.namespace.QName("http://types.services.deployer.bpel.carbon.wso2.org/xsd", - "fileType")); - - elementList.add(this.localFileType == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localFileType)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static UploadedFileItem parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final UploadedFileItem object = new UploadedFileItem(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"UploadedFileItem".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (UploadedFileItem) org.wso2.carbon.bpel.deployer.services.types.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://types.services.deployer.bpel.carbon.wso2.org/xsd", - "dataHandler").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setDataHandler(null); - reader.next(); - } else { - - object.setDataHandler(org.apache.axiom.util.stax.XMLStreamReaderUtils.getDataHandlerFromElement(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://types.services.deployer.bpel.carbon.wso2.org/xsd", - "fileName").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setFileName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://types.services.deployer.bpel.carbon.wso2.org/xsd", - "fileType").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setFileType(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/common/xsd/AuthenticationException.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/common/xsd/AuthenticationException.java deleted file mode 100644 index 23d9dc383..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/common/xsd/AuthenticationException.java +++ /dev/null @@ -1,377 +0,0 @@ - -/** - * AuthenticationException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.common.xsd; - - -/** - * AuthenticationException bean class - */ - -public class AuthenticationException implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = AuthenticationException - * Namespace URI = http://common.core.carbon.wso2.org/xsd Namespace Prefix = ns30 - */ - - - - /** - * - */ - private static final long serialVersionUID = 1062294419734010018L; - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://common.core.carbon.wso2.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AuthenticationException", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "AuthenticationException", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://common.core.carbon.wso2.org/xsd")) { - return "ns30"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 AuthenticationException parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AuthenticationException object = new AuthenticationException(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AuthenticationException".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AuthenticationException) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticateWithRememberMe.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticateWithRememberMe.java deleted file mode 100644 index bb1569ac8..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticateWithRememberMe.java +++ /dev/null @@ -1,463 +0,0 @@ - -/** - * AuthenticateWithRememberMe.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * AuthenticateWithRememberMe bean class - */ - -public class AuthenticateWithRememberMe implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6589922455439690743L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "authenticateWithRememberMe", "ns31"); - - - - /** - * field for MessageContext - */ - - - protected org.apache.axis2.context.xsd.MessageContext localMessageContext; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMessageContextTracker = false; - - - /** - * Auto generated getter method - * - * @return org.apache.axis2.context.xsd.MessageContext - */ - public org.apache.axis2.context.xsd.MessageContext getMessageContext() { - return this.localMessageContext; - } - - - - /** - * Auto generated setter method - * - * @param param MessageContext - */ - public void setMessageContext(final org.apache.axis2.context.xsd.MessageContext param) { - this.localMessageContextTracker = true; - - this.localMessageContext = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":authenticateWithRememberMe", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "authenticateWithRememberMe", - xmlWriter); - } - - - } - if (this.localMessageContextTracker) { - if (this.localMessageContext == null) { - - writeStartElement(null, "http://authentication.services.core.carbon.wso2.org", "messageContext", - xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localMessageContext.serialize(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "messageContext"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localMessageContextTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "messageContext")); - - - elementList.add(this.localMessageContext == null ? null : this.localMessageContext); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AuthenticateWithRememberMe parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AuthenticateWithRememberMe object = new AuthenticateWithRememberMe(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"authenticateWithRememberMe".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AuthenticateWithRememberMe) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "messageContext").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setMessageContext(null); - reader.next(); - - reader.next(); - - } else { - - object.setMessageContext(org.apache.axis2.context.xsd.MessageContext.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticateWithRememberMeResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticateWithRememberMeResponse.java deleted file mode 100644 index f3eb7f34d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticateWithRememberMeResponse.java +++ /dev/null @@ -1,457 +0,0 @@ - -/** - * AuthenticateWithRememberMeResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * AuthenticateWithRememberMeResponse bean class - */ - -public class AuthenticateWithRememberMeResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 5836885576355079336L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "authenticateWithRememberMeResponse", "ns31"); - - - - /** - * field for _return - */ - - - protected boolean local_return; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_returnTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean get_return() { - return this.local_return; - } - - - - /** - * Auto generated setter method - * - * @param param _return - */ - public void set_return(final boolean param) { - - // setting primitive attribute tracker to true - this.local_returnTracker = true; - - this.local_return = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":authenticateWithRememberMeResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "authenticateWithRememberMeResponse", xmlWriter); - } - - - } - if (this.local_returnTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "return", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("return cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.local_returnTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AuthenticateWithRememberMeResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AuthenticateWithRememberMeResponse object = new AuthenticateWithRememberMeResponse(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"authenticateWithRememberMeResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AuthenticateWithRememberMeResponse) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_return(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdmin.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdmin.java deleted file mode 100644 index 862456ee3..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdmin.java +++ /dev/null @@ -1,233 +0,0 @@ - - -/** - * AuthenticationAdmin.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.carbon.core.services.authentication; - -/* - * AuthenticationAdmin java interface - */ - -public interface AuthenticationAdmin { - - - /** - * Auto generated method signature - * - * @param loginWithRememberMeOption0 - * - * @throws org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException - * : - */ - - - public org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse loginWithRememberMeOption( - - org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption loginWithRememberMeOption0) throws java.rmi.RemoteException - - , - org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param loginWithRememberMeOption0 - * - */ - public void startloginWithRememberMeOption( - - org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption loginWithRememberMeOption0, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param login2 - * - * @throws org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException - * : - */ - - - public org.wso2.carbon.core.services.authentication.LoginResponse login( - - org.wso2.carbon.core.services.authentication.Login login2) throws java.rmi.RemoteException - - , - org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param login2 - * - */ - public void startlogin( - - org.wso2.carbon.core.services.authentication.Login login2, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param getAuthenticatorName4 - * - */ - - - public org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse getAuthenticatorName( - - org.wso2.carbon.core.services.authentication.GetAuthenticatorName getAuthenticatorName4) throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getAuthenticatorName4 - * - */ - public void startgetAuthenticatorName( - - org.wso2.carbon.core.services.authentication.GetAuthenticatorName getAuthenticatorName4, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param getPriority6 - * - */ - - - public org.wso2.carbon.core.services.authentication.GetPriorityResponse getPriority( - - org.wso2.carbon.core.services.authentication.GetPriority getPriority6) throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param getPriority6 - * - */ - public void startgetPriority( - - org.wso2.carbon.core.services.authentication.GetPriority getPriority6, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param isDisabled8 - * - */ - - - public org.wso2.carbon.core.services.authentication.IsDisabledResponse isDisabled( - - org.wso2.carbon.core.services.authentication.IsDisabled isDisabled8) throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param isDisabled8 - * - */ - public void startisDisabled( - - org.wso2.carbon.core.services.authentication.IsDisabled isDisabled8, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param authenticateWithRememberMe10 - * - */ - - - public org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse authenticateWithRememberMe( - - org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe authenticateWithRememberMe10) throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param authenticateWithRememberMe10 - * - */ - public void startauthenticateWithRememberMe( - - org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe authenticateWithRememberMe10, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - /** - * Auto generated method signature - * - * @param loginWithRememberMeCookie12 - * - */ - - - public org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse loginWithRememberMeCookie( - - org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie loginWithRememberMeCookie12) throws java.rmi.RemoteException; - - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @param loginWithRememberMeCookie12 - * - */ - public void startloginWithRememberMeCookie( - - org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie loginWithRememberMeCookie12, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException; - - - - // -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminAuthenticationException.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminAuthenticationException.java deleted file mode 100644 index 49e37a1e7..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminAuthenticationException.java +++ /dev/null @@ -1,463 +0,0 @@ - -/** - * AuthenticationAdminAuthenticationException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * AuthenticationAdminAuthenticationException bean class - */ - -public class AuthenticationAdminAuthenticationException implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8647348264016999520L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "AuthenticationAdminAuthenticationException", "ns31"); - - - - /** - * field for AuthenticationException - */ - - - protected org.wso2.carbon.core.common.xsd.AuthenticationException localAuthenticationException; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAuthenticationExceptionTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.carbon.core.common.xsd.AuthenticationException - */ - public org.wso2.carbon.core.common.xsd.AuthenticationException getAuthenticationException() { - return this.localAuthenticationException; - } - - - - /** - * Auto generated setter method - * - * @param param AuthenticationException - */ - public void setAuthenticationException(final org.wso2.carbon.core.common.xsd.AuthenticationException param) { - this.localAuthenticationExceptionTracker = true; - - this.localAuthenticationException = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":AuthenticationAdminAuthenticationException", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "AuthenticationAdminAuthenticationException", xmlWriter); - } - - - } - if (this.localAuthenticationExceptionTracker) { - if (this.localAuthenticationException == null) { - - writeStartElement(null, "http://authentication.services.core.carbon.wso2.org", - "AuthenticationException", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.localAuthenticationException.serialize(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "AuthenticationException"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAuthenticationExceptionTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "AuthenticationException")); - - - elementList.add(this.localAuthenticationException == null ? null : this.localAuthenticationException); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static AuthenticationAdminAuthenticationException parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final AuthenticationAdminAuthenticationException object = new AuthenticationAdminAuthenticationException(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"AuthenticationAdminAuthenticationException".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (AuthenticationAdminAuthenticationException) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "AuthenticationException").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.setAuthenticationException(null); - reader.next(); - - reader.next(); - - } else { - - object.setAuthenticationException(org.wso2.carbon.core.common.xsd.AuthenticationException.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminAuthenticationExceptionException.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminAuthenticationExceptionException.java deleted file mode 100644 index d13d1791d..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminAuthenticationExceptionException.java +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * AuthenticationAdminAuthenticationExceptionException.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.carbon.core.services.authentication; - -public class AuthenticationAdminAuthenticationExceptionException extends java.lang.Exception { - - private static final long serialVersionUID = 1329838889320L; - - private org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException faultMessage; - - - public AuthenticationAdminAuthenticationExceptionException() { - super("AuthenticationAdminAuthenticationExceptionException"); - } - - public AuthenticationAdminAuthenticationExceptionException(final java.lang.String s) { - super(s); - } - - public AuthenticationAdminAuthenticationExceptionException(final java.lang.String s, final java.lang.Throwable ex) { - super(s, ex); - } - - public AuthenticationAdminAuthenticationExceptionException(final java.lang.Throwable cause) { - super(cause); - } - - - public void setFaultMessage(final org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException msg) { - this.faultMessage = msg; - } - - public org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException getFaultMessage() { - return this.faultMessage; - } -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminCallbackHandler.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminCallbackHandler.java deleted file mode 100644 index 27282f988..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminCallbackHandler.java +++ /dev/null @@ -1,134 +0,0 @@ - -/** - * AuthenticationAdminCallbackHandler.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ - -package org.wso2.carbon.core.services.authentication; - -/** - * AuthenticationAdminCallbackHandler Callback class, Users can extend this class and implement - * their own receiveResult and receiveError methods. - */ -public abstract class AuthenticationAdminCallbackHandler { - - - - 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 AuthenticationAdminCallbackHandler(final Object clientData) { - this.clientData = clientData; - } - - /** - * Please use this constructor if you don't want to set any clientData - */ - public AuthenticationAdminCallbackHandler() { - this.clientData = null; - } - - /** - * Get the client data - */ - - public Object getClientData() { - return this.clientData; - } - - - /** - * auto generated Axis2 call back method for loginWithRememberMeOption method override this method - * for handling normal response from loginWithRememberMeOption operation - */ - public void receiveResultloginWithRememberMeOption(final org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * loginWithRememberMeOption operation - */ - public void receiveErrorloginWithRememberMeOption(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for login method override this method for handling normal - * response from login operation - */ - public void receiveResultlogin(final org.wso2.carbon.core.services.authentication.LoginResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from login - * operation - */ - public void receiveErrorlogin(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for getAuthenticatorName method override this method for - * handling normal response from getAuthenticatorName operation - */ - public void receiveResultgetAuthenticatorName(final org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getAuthenticatorName operation - */ - public void receiveErrorgetAuthenticatorName(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for getPriority method override this method for handling - * normal response from getPriority operation - */ - public void receiveResultgetPriority(final org.wso2.carbon.core.services.authentication.GetPriorityResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * getPriority operation - */ - public void receiveErrorgetPriority(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for isDisabled method override this method for handling - * normal response from isDisabled operation - */ - public void receiveResultisDisabled(final org.wso2.carbon.core.services.authentication.IsDisabledResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * isDisabled operation - */ - public void receiveErrorisDisabled(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for authenticateWithRememberMe method override this method - * for handling normal response from authenticateWithRememberMe operation - */ - public void receiveResultauthenticateWithRememberMe(final org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * authenticateWithRememberMe operation - */ - public void receiveErrorauthenticateWithRememberMe(final java.lang.Exception e) {} - - /** - * auto generated Axis2 call back method for loginWithRememberMeCookie method override this method - * for handling normal response from loginWithRememberMeCookie operation - */ - public void receiveResultloginWithRememberMeCookie(final org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse result) {} - - /** - * auto generated Axis2 Error handler override this method for handling error response from - * loginWithRememberMeCookie operation - */ - public void receiveErrorloginWithRememberMeCookie(final java.lang.Exception e) {} - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminStub.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminStub.java deleted file mode 100644 index 20d5719db..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/AuthenticationAdminStub.java +++ /dev/null @@ -1,2938 +0,0 @@ - -/** - * AuthenticationAdminStub.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:33:10 UTC) - */ -package org.wso2.carbon.core.services.authentication; - -import javax.xml.namespace.QName; - -/* - * AuthenticationAdminStub java implementation - */ - - -public class AuthenticationAdminStub extends org.apache.axis2.client.Stub implements AuthenticationAdmin { - protected org.apache.axis2.description.AxisOperation[] _operations; - - // hashmaps to keep the fault mapping - private final java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); - private final java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); - private final 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(java.lang.System.currentTimeMillis()) + "_" + counter; - } - - - private void populateAxisService() throws org.apache.axis2.AxisFault { - - // creating the Service with a unique name - this._service = new org.apache.axis2.description.AxisService("AuthenticationAdmin" + getUniqueSuffix()); - addAnonymousOperations(); - - // creating the operations - org.apache.axis2.description.AxisOperation __operation; - - this._operations = new org.apache.axis2.description.AxisOperation[7]; - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "loginWithRememberMeOption")); - this._service.addOperation(__operation); - - - - this._operations[0] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "login")); - this._service.addOperation(__operation); - - - - this._operations[1] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "getAuthenticatorName")); - this._service.addOperation(__operation); - - - - this._operations[2] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "getPriority")); - this._service.addOperation(__operation); - - - - this._operations[3] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "isDisabled")); - this._service.addOperation(__operation); - - - - this._operations[4] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "authenticateWithRememberMe")); - this._service.addOperation(__operation); - - - - this._operations[5] = __operation; - - - __operation = new org.apache.axis2.description.OutInAxisOperation(); - - - __operation.setName(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "loginWithRememberMeCookie")); - this._service.addOperation(__operation); - - - - this._operations[6] = __operation; - - - } - - // populates the faults - private void populateFaults() { - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "AuthenticationAdminAuthenticationException"), - "loginWithRememberMeOption"), - "org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "AuthenticationAdminAuthenticationException"), - "loginWithRememberMeOption"), "org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "AuthenticationAdminAuthenticationException"), - "loginWithRememberMeOption"), - "org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException"); - - this.faultExceptionNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "AuthenticationAdminAuthenticationException"), - "login"), "org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException"); - this.faultExceptionClassNameMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "AuthenticationAdminAuthenticationException"), - "login"), "org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException"); - this.faultMessageMap.put(new org.apache.axis2.client.FaultMapKey( - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "AuthenticationAdminAuthenticationException"), - "login"), "org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException"); - - - - } - - /** - * Constructor that takes in a configContext - */ - - public AuthenticationAdminStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(configurationContext, targetEndpoint, false); - } - - - /** - * Constructor that takes in a configContext and useseperate listner - */ - public AuthenticationAdminStub(final org.apache.axis2.context.ConfigurationContext configurationContext, - final java.lang.String targetEndpoint, - final boolean useSeparateListener) throws org.apache.axis2.AxisFault { - // To populate AxisService - populateAxisService(); - populateFaults(); - - this._serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext, this._service); - - - this._serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(targetEndpoint)); - this._serviceClient.getOptions().setUseSeparateListener(useSeparateListener); - - - } - - /** - * Default Constructor - */ - public AuthenticationAdminStub(final org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { - - this(configurationContext, - "https://192.168.178.21:9443/services/AuthenticationAdmin.AuthenticationAdminHttpsSoap11Endpoint/"); - - } - - /** - * Default Constructor - */ - public AuthenticationAdminStub() throws org.apache.axis2.AxisFault { - - this("https://192.168.178.21:9443/services/AuthenticationAdmin.AuthenticationAdminHttpsSoap11Endpoint/"); - - } - - /** - * Constructor taking the target endpoint - */ - public AuthenticationAdminStub(final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { - this(null, targetEndpoint); - } - - - - /** - * Auto generated method signature - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#loginWithRememberMeOption - * @param loginWithRememberMeOption14 - * - * @throws org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException - * : - */ - - - - @Override - public org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse loginWithRememberMeOption( - - final org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption loginWithRememberMeOption14) - - - throws java.rmi.RemoteException - - - , - org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:loginWithRememberMeOption"); - _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()), loginWithRememberMeOption14, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "loginWithRememberMeOption"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "loginWithRememberMeOption"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeOption")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeOption")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException) { - throw (org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#startloginWithRememberMeOption - * @param loginWithRememberMeOption14 - * - */ - @Override - public void startloginWithRememberMeOption( - - final org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption loginWithRememberMeOption14, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[0].getName()); - _operationClient.getOptions().setAction("urn:loginWithRememberMeOption"); - _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()), loginWithRememberMeOption14, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "loginWithRememberMeOption"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultloginWithRememberMeOption((org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorloginWithRememberMeOption(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (AuthenticationAdminStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeOption"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) AuthenticationAdminStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeOption")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) AuthenticationAdminStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeOption")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException) { - callback.receiveErrorloginWithRememberMeOption(ex); - return; - } - - - callback.receiveErrorloginWithRememberMeOption(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeOption(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeOption(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeOption(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeOption(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeOption(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeOption(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeOption(f); - } - } else { - callback.receiveErrorloginWithRememberMeOption(f); - } - } else { - callback.receiveErrorloginWithRememberMeOption(f); - } - } else { - callback.receiveErrorloginWithRememberMeOption(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorloginWithRememberMeOption(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[0].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[0].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#login - * @param login16 - * - * @throws org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException - * : - */ - - - - @Override - public org.wso2.carbon.core.services.authentication.LoginResponse login( - - final org.wso2.carbon.core.services.authentication.Login login16) - - - throws java.rmi.RemoteException - - - , - org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[1].getName()); - _operationClient.getOptions().setAction("urn:login"); - _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()), login16, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "login"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.LoginResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.carbon.core.services.authentication.LoginResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "login"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "login")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "login")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException) { - throw (org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException) ex; - } - - - throw new java.rmi.RemoteException(ex.getMessage(), ex); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#startlogin - * @param login16 - * - */ - @Override - public void startlogin( - - final org.wso2.carbon.core.services.authentication.Login login16, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[1].getName()); - _operationClient.getOptions().setAction("urn:login"); - _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()), login16, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "login"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.LoginResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultlogin((org.wso2.carbon.core.services.authentication.LoginResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorlogin(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (AuthenticationAdminStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "login"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) AuthenticationAdminStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "login")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) AuthenticationAdminStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "login")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - if (ex instanceof org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationExceptionException) { - callback.receiveErrorlogin(ex); - return; - } - - - callback.receiveErrorlogin(new java.rmi.RemoteException(ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlogin(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlogin(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlogin(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlogin(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlogin(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlogin(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorlogin(f); - } - } else { - callback.receiveErrorlogin(f); - } - } else { - callback.receiveErrorlogin(f); - } - } else { - callback.receiveErrorlogin(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorlogin(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[1].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[1].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#getAuthenticatorName - * @param getAuthenticatorName18 - * - */ - - - - @Override - public org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse getAuthenticatorName( - - final org.wso2.carbon.core.services.authentication.GetAuthenticatorName getAuthenticatorName18) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[2].getName()); - _operationClient.getOptions().setAction("urn:getAuthenticatorName"); - _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()), getAuthenticatorName18, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "getAuthenticatorName"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getAuthenticatorName"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAuthenticatorName")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAuthenticatorName")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final 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 (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#startgetAuthenticatorName - * @param getAuthenticatorName18 - * - */ - @Override - public void startgetAuthenticatorName( - - final org.wso2.carbon.core.services.authentication.GetAuthenticatorName getAuthenticatorName18, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[2].getName()); - _operationClient.getOptions().setAction("urn:getAuthenticatorName"); - _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()), getAuthenticatorName18, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "getAuthenticatorName"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetAuthenticatorName((org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetAuthenticatorName(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (AuthenticationAdminStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAuthenticatorName"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) AuthenticationAdminStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAuthenticatorName")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) AuthenticationAdminStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getAuthenticatorName")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - - callback.receiveErrorgetAuthenticatorName(new java.rmi.RemoteException(ex.getMessage(), - ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAuthenticatorName(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAuthenticatorName(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAuthenticatorName(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAuthenticatorName(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAuthenticatorName(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAuthenticatorName(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetAuthenticatorName(f); - } - } else { - callback.receiveErrorgetAuthenticatorName(f); - } - } else { - callback.receiveErrorgetAuthenticatorName(f); - } - } else { - callback.receiveErrorgetAuthenticatorName(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetAuthenticatorName(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[2].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[2].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#getPriority - * @param getPriority20 - * - */ - - - - @Override - public org.wso2.carbon.core.services.authentication.GetPriorityResponse getPriority( - - final org.wso2.carbon.core.services.authentication.GetPriority getPriority20) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[3].getName()); - _operationClient.getOptions().setAction("urn:getPriority"); - _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()), getPriority20, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "getPriority"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.GetPriorityResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.carbon.core.services.authentication.GetPriorityResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "getPriority"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPriority")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPriority")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final 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 (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#startgetPriority - * @param getPriority20 - * - */ - @Override - public void startgetPriority( - - final org.wso2.carbon.core.services.authentication.GetPriority getPriority20, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[3].getName()); - _operationClient.getOptions().setAction("urn:getPriority"); - _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()), getPriority20, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "getPriority"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.GetPriorityResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultgetPriority((org.wso2.carbon.core.services.authentication.GetPriorityResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorgetPriority(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (AuthenticationAdminStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPriority"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) AuthenticationAdminStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPriority")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) AuthenticationAdminStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "getPriority")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - - callback.receiveErrorgetPriority(new java.rmi.RemoteException(ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPriority(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPriority(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPriority(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPriority(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPriority(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPriority(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorgetPriority(f); - } - } else { - callback.receiveErrorgetPriority(f); - } - } else { - callback.receiveErrorgetPriority(f); - } - } else { - callback.receiveErrorgetPriority(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorgetPriority(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[3].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[3].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#isDisabled - * @param isDisabled22 - * - */ - - - - @Override - public org.wso2.carbon.core.services.authentication.IsDisabledResponse isDisabled( - - final org.wso2.carbon.core.services.authentication.IsDisabled isDisabled22) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[4].getName()); - _operationClient.getOptions().setAction("urn:isDisabled"); - _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()), isDisabled22, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "isDisabled"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.IsDisabledResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.carbon.core.services.authentication.IsDisabledResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "isDisabled"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "isDisabled")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "isDisabled")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final 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 (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#startisDisabled - * @param isDisabled22 - * - */ - @Override - public void startisDisabled( - - final org.wso2.carbon.core.services.authentication.IsDisabled isDisabled22, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[4].getName()); - _operationClient.getOptions().setAction("urn:isDisabled"); - _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()), isDisabled22, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "isDisabled"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.IsDisabledResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultisDisabled((org.wso2.carbon.core.services.authentication.IsDisabledResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorisDisabled(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (AuthenticationAdminStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "isDisabled"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) AuthenticationAdminStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "isDisabled")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) AuthenticationAdminStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "isDisabled")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - - callback.receiveErrorisDisabled(new java.rmi.RemoteException(ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorisDisabled(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorisDisabled(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorisDisabled(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorisDisabled(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorisDisabled(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorisDisabled(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorisDisabled(f); - } - } else { - callback.receiveErrorisDisabled(f); - } - } else { - callback.receiveErrorisDisabled(f); - } - } else { - callback.receiveErrorisDisabled(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorisDisabled(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[4].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[4].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#authenticateWithRememberMe - * @param authenticateWithRememberMe24 - * - */ - - - - @Override - public org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse authenticateWithRememberMe( - - final org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe authenticateWithRememberMe24) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[5].getName()); - _operationClient.getOptions().setAction("urn:authenticateWithRememberMe"); - _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()), - authenticateWithRememberMe24, optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "authenticateWithRememberMe"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "authenticateWithRememberMe"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "authenticateWithRememberMe")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "authenticateWithRememberMe")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final 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 (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#startauthenticateWithRememberMe - * @param authenticateWithRememberMe24 - * - */ - @Override - public void startauthenticateWithRememberMe( - - final org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe authenticateWithRememberMe24, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[5].getName()); - _operationClient.getOptions().setAction("urn:authenticateWithRememberMe"); - _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()), authenticateWithRememberMe24, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "authenticateWithRememberMe"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultauthenticateWithRememberMe((org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorauthenticateWithRememberMe(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (AuthenticationAdminStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "authenticateWithRememberMe"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) AuthenticationAdminStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "authenticateWithRememberMe")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) AuthenticationAdminStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "authenticateWithRememberMe")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - - callback.receiveErrorauthenticateWithRememberMe(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorauthenticateWithRememberMe(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorauthenticateWithRememberMe(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorauthenticateWithRememberMe(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorauthenticateWithRememberMe(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorauthenticateWithRememberMe(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorauthenticateWithRememberMe(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorauthenticateWithRememberMe(f); - } - } else { - callback.receiveErrorauthenticateWithRememberMe(f); - } - } else { - callback.receiveErrorauthenticateWithRememberMe(f); - } - } else { - callback.receiveErrorauthenticateWithRememberMe(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorauthenticateWithRememberMe(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[5].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[5].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - /** - * Auto generated method signature - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#loginWithRememberMeCookie - * @param loginWithRememberMeCookie26 - * - */ - - - - @Override - public org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse loginWithRememberMeCookie( - - final org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie loginWithRememberMeCookie26) - - - throws java.rmi.RemoteException - - { - org.apache.axis2.context.MessageContext _messageContext = null; - try { - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[6].getName()); - _operationClient.getOptions().setAction("urn:loginWithRememberMeCookie"); - _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()), loginWithRememberMeCookie26, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "loginWithRememberMeCookie"))); - - // adding SOAP soap_headers - this._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); - - - final org.apache.axis2.context.MessageContext _returnMessageContext = - _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); - final org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - - - final java.lang.Object object = - fromOM(_returnEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse.class, - getEnvelopeNamespaces(_returnEnv)); - - - return (org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse) object; - - } - catch (final org.apache.axis2.AxisFault f) { - - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), - "loginWithRememberMeCookie"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeCookie")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeCookie")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final 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 (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } - } else { - throw f; - } - } else { - throw f; - } - } - finally { - if (_messageContext.getTransportOut() != null) { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - } - } - - /** - * Auto generated method signature for Asynchronous Invocations - * - * @see org.wso2.carbon.core.services.authentication.AuthenticationAdmin#startloginWithRememberMeCookie - * @param loginWithRememberMeCookie26 - * - */ - @Override - public void startloginWithRememberMeCookie( - - final org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie loginWithRememberMeCookie26, - - final org.wso2.carbon.core.services.authentication.AuthenticationAdminCallbackHandler callback) - - throws java.rmi.RemoteException { - - final org.apache.axis2.client.OperationClient _operationClient = - this._serviceClient.createClient(this._operations[6].getName()); - _operationClient.getOptions().setAction("urn:loginWithRememberMeCookie"); - _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()), loginWithRememberMeCookie26, - optimizeContent(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "loginWithRememberMeCookie"))); - - // adding SOAP soap_headers - this._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() { - @Override - public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { - try { - final org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - - final java.lang.Object object = - fromOM(resultEnv.getBody().getFirstElement(), - org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse.class, - getEnvelopeNamespaces(resultEnv)); - callback.receiveResultloginWithRememberMeCookie((org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse) object); - - } - catch (final org.apache.axis2.AxisFault e) { - callback.receiveErrorloginWithRememberMeCookie(e); - } - } - - @Override - public void onError(final java.lang.Exception error) { - if (error instanceof org.apache.axis2.AxisFault) { - final org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error; - final org.apache.axiom.om.OMElement faultElt = f.getDetail(); - if (faultElt != null) { - if (AuthenticationAdminStub.this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeCookie"))) { - // make the fault by reflection - try { - final java.lang.String exceptionClassName = - (java.lang.String) AuthenticationAdminStub.this.faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeCookie")); - final java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName); - final java.lang.Exception ex = (java.lang.Exception) exceptionClass.newInstance(); - // message class - final java.lang.String messageClassName = - (java.lang.String) AuthenticationAdminStub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey( - faultElt.getQName(), "loginWithRememberMeCookie")); - final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); - final java.lang.Object messageObject = fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = - exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] {messageClass}); - m.invoke(ex, new java.lang.Object[] {messageObject}); - - - callback.receiveErrorloginWithRememberMeCookie(new java.rmi.RemoteException( - ex.getMessage(), ex)); - } - catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeCookie(f); - } - catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeCookie(f); - } - catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeCookie(f); - } - catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeCookie(f); - } - catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeCookie(f); - } - catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeCookie(f); - } - catch (final org.apache.axis2.AxisFault e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrorloginWithRememberMeCookie(f); - } - } else { - callback.receiveErrorloginWithRememberMeCookie(f); - } - } else { - callback.receiveErrorloginWithRememberMeCookie(f); - } - } else { - callback.receiveErrorloginWithRememberMeCookie(error); - } - } - - @Override - public void onFault(final org.apache.axis2.context.MessageContext faultContext) { - final org.apache.axis2.AxisFault fault = - org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); - onError(fault); - } - - @Override - public void onComplete() { - try { - _messageContext.getTransportOut().getSender().cleanup(_messageContext); - } - catch (final org.apache.axis2.AxisFault axisFault) { - callback.receiveErrorloginWithRememberMeCookie(axisFault); - } - } - }); - - - org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; - if (this._operations[6].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { - _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); - this._operations[6].setMessageReceiver(_callbackReceiver); - } - - // execute the operation client - _operationClient.execute(false); - - } - - - - /** - * A utility method that copies the namepaces from the SOAPEnvelope - */ - private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); - final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); - while (namespaceIterator.hasNext()) { - final org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); - returnMap.put(ns.getPrefix(), ns.getNamespaceURI()); - } - return returnMap; - } - - - - private final javax.xml.namespace.QName[] opNameArray = null; - - private boolean optimizeContent(final javax.xml.namespace.QName opName) { - - - if (this.opNameArray == null) { - return false; - } - for (final QName element : this.opNameArray) { - if (opName.equals(element)) { - return true; - } - } - return false; - } - - // https://192.168.178.21:9443/services/AuthenticationAdmin.AuthenticationAdminHttpsSoap11Endpoint/ - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.Login param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.Login.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.LoginResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.LoginResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.GetAuthenticatorName param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.GetAuthenticatorName.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.GetPriority param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.GetPriority.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.GetPriorityResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.GetPriorityResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.IsDisabled param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.IsDisabled.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.IsDisabledResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.IsDisabledResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - private org.apache.axiom.om.OMElement toOM(final org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - return param.getOMElement(org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse.MY_QNAME, - org.apache.axiom.om.OMAbstractFactory.getOMFactory()); - } - catch (final org.apache.axis2.databinding.ADBException e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - - - } - - - private org.apache.axiom.soap.SOAPEnvelope toEnvelope(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.carbon.core.services.authentication.Login param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.carbon.core.services.authentication.Login.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.carbon.core.services.authentication.GetAuthenticatorName param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.carbon.core.services.authentication.GetAuthenticatorName.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.carbon.core.services.authentication.GetPriority param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.carbon.core.services.authentication.GetPriority.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.carbon.core.services.authentication.IsDisabled param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.carbon.core.services.authentication.IsDisabled.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory, - final org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie param, - final boolean optimizeContent) throws org.apache.axis2.AxisFault { - - - try { - - final org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); - emptyEnvelope.getBody() - .addChild(param.getOMElement(org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie.MY_QNAME, - factory)); - return emptyEnvelope; - } - catch (final 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(final org.apache.axiom.soap.SOAPFactory factory) { - return factory.getDefaultEnvelope(); - } - - - private java.lang.Object fromOM(final org.apache.axiom.om.OMElement param, final java.lang.Class type, - final java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault { - - try { - - if (org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.LoginWithRememberMeOption.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.LoginWithRememberMeOptionResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.Login.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.Login.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.LoginResponse.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.LoginResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.AuthenticationAdminAuthenticationException.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.GetAuthenticatorName.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.GetAuthenticatorName.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.GetAuthenticatorNameResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.GetPriority.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.GetPriority.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.GetPriorityResponse.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.GetPriorityResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.IsDisabled.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.IsDisabled.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.IsDisabledResponse.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.IsDisabledResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMe.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.AuthenticateWithRememberMeResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookie.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - if (org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse.class.equals(type)) { - - return org.wso2.carbon.core.services.authentication.LoginWithRememberMeCookieResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); - - - } - - } - catch (final java.lang.Exception e) { - throw org.apache.axis2.AxisFault.makeFault(e); - } - return null; - } - - - -} diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetAuthenticatorName.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetAuthenticatorName.java deleted file mode 100644 index 693eb874a..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetAuthenticatorName.java +++ /dev/null @@ -1,373 +0,0 @@ - -/** - * GetAuthenticatorName.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * GetAuthenticatorName bean class - */ - -public class GetAuthenticatorName implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -4016901004239356559L; - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "getAuthenticatorName", "ns31"); - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getAuthenticatorName", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getAuthenticatorName", - xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 GetAuthenticatorName parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetAuthenticatorName object = new GetAuthenticatorName(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getAuthenticatorName".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetAuthenticatorName) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetAuthenticatorNameResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetAuthenticatorNameResponse.java deleted file mode 100644 index e989c758b..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetAuthenticatorNameResponse.java +++ /dev/null @@ -1,470 +0,0 @@ - -/** - * GetAuthenticatorNameResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * GetAuthenticatorNameResponse bean class - */ - -public class GetAuthenticatorNameResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 7714249950908975076L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "getAuthenticatorNameResponse", "ns31"); - - - - /** - * field for _return - */ - - - protected java.lang.String local_return; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_returnTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String get_return() { - return this.local_return; - } - - - - /** - * Auto generated setter method - * - * @param param _return - */ - public void set_return(final java.lang.String param) { - this.local_returnTracker = true; - - this.local_return = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getAuthenticatorNameResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "getAuthenticatorNameResponse", xmlWriter); - } - - - } - if (this.local_returnTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "return", xmlWriter); - - - if (this.local_return == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.local_return); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.local_returnTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return")); - - elementList.add(this.local_return == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetAuthenticatorNameResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetAuthenticatorNameResponse object = new GetAuthenticatorNameResponse(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getAuthenticatorNameResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetAuthenticatorNameResponse) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.set_return(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetPriority.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetPriority.java deleted file mode 100644 index ae19b3aef..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetPriority.java +++ /dev/null @@ -1,372 +0,0 @@ - -/** - * GetPriority.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * GetPriority bean class - */ - -public class GetPriority implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 5890665051745476121L; - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", "getPriority", "ns31"); - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getPriority", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getPriority", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 GetPriority parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetPriority object = new GetPriority(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getPriority".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetPriority) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetPriorityResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetPriorityResponse.java deleted file mode 100644 index 1a6af835b..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/GetPriorityResponse.java +++ /dev/null @@ -1,459 +0,0 @@ - -/** - * GetPriorityResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * GetPriorityResponse bean class - */ - -public class GetPriorityResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -5846901708143685158L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "getPriorityResponse", "ns31"); - - - - /** - * field for _return - */ - - - protected int local_return; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_returnTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int get_return() { - return this.local_return; - } - - - - /** - * Auto generated setter method - * - * @param param _return - */ - public void set_return(final int param) { - - // setting primitive attribute tracker to true - this.local_returnTracker = param != java.lang.Integer.MIN_VALUE; - - this.local_return = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":getPriorityResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "getPriorityResponse", - xmlWriter); - } - - - } - if (this.local_returnTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "return", xmlWriter); - - if (this.local_return == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("return cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.local_returnTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static GetPriorityResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final GetPriorityResponse object = new GetPriorityResponse(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"getPriorityResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (GetPriorityResponse) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_return(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.set_return(java.lang.Integer.MIN_VALUE); - - } - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/IsDisabled.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/IsDisabled.java deleted file mode 100644 index 5e6c9e7e4..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/IsDisabled.java +++ /dev/null @@ -1,372 +0,0 @@ - -/** - * IsDisabled.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * IsDisabled bean class - */ - -public class IsDisabled implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -3642235111941591056L; - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", "isDisabled", "ns31"); - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":isDisabled", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "isDisabled", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 IsDisabled parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final IsDisabled object = new IsDisabled(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"isDisabled".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (IsDisabled) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/IsDisabledResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/IsDisabledResponse.java deleted file mode 100644 index a5e707d7b..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/IsDisabledResponse.java +++ /dev/null @@ -1,457 +0,0 @@ - -/** - * IsDisabledResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * IsDisabledResponse bean class - */ - -public class IsDisabledResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -7312344815352873170L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "isDisabledResponse", "ns31"); - - - - /** - * field for _return - */ - - - protected boolean local_return; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_returnTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean get_return() { - return this.local_return; - } - - - - /** - * Auto generated setter method - * - * @param param _return - */ - public void set_return(final boolean param) { - - // setting primitive attribute tracker to true - this.local_returnTracker = true; - - this.local_return = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":isDisabledResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "isDisabledResponse", - xmlWriter); - } - - - } - if (this.local_returnTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "return", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("return cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.local_returnTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static IsDisabledResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final IsDisabledResponse object = new IsDisabledResponse(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"isDisabledResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (IsDisabledResponse) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_return(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/Login.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/Login.java deleted file mode 100644 index 999a687c7..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/Login.java +++ /dev/null @@ -1,658 +0,0 @@ - -/** - * Login.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * Login bean class - */ - -public class Login implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -7117965560197807361L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", "login", "ns31"); - - - - /** - * field for Username - */ - - - protected java.lang.String localUsername; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUsernameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getUsername() { - return this.localUsername; - } - - - - /** - * Auto generated setter method - * - * @param param Username - */ - public void setUsername(final java.lang.String param) { - this.localUsernameTracker = true; - - this.localUsername = param; - - - } - - - /** - * field for Password - */ - - - protected java.lang.String localPassword; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPasswordTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPassword() { - return this.localPassword; - } - - - - /** - * Auto generated setter method - * - * @param param Password - */ - public void setPassword(final java.lang.String param) { - this.localPasswordTracker = true; - - this.localPassword = param; - - - } - - - /** - * field for RemoteAddress - */ - - - protected java.lang.String localRemoteAddress; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRemoteAddressTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getRemoteAddress() { - return this.localRemoteAddress; - } - - - - /** - * Auto generated setter method - * - * @param param RemoteAddress - */ - public void setRemoteAddress(final java.lang.String param) { - this.localRemoteAddressTracker = true; - - this.localRemoteAddress = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":login", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "login", xmlWriter); - } - - - } - if (this.localUsernameTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "username", xmlWriter); - - - if (this.localUsername == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localUsername); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPasswordTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "password", xmlWriter); - - - if (this.localPassword == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPassword); - - } - - xmlWriter.writeEndElement(); - } - if (this.localRemoteAddressTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "remoteAddress", xmlWriter); - - - if (this.localRemoteAddress == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localRemoteAddress); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localUsernameTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "username")); - - elementList.add(this.localUsername == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUsername)); - } - if (this.localPasswordTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "password")); - - elementList.add(this.localPassword == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPassword)); - } - if (this.localRemoteAddressTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "remoteAddress")); - - elementList.add(this.localRemoteAddress == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRemoteAddress)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static Login parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Login object = new Login(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"login".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Login) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "username").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setUsername(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "password").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPassword(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "remoteAddress").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setRemoteAddress(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginResponse.java deleted file mode 100644 index 8f47d3bfe..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginResponse.java +++ /dev/null @@ -1,456 +0,0 @@ - -/** - * LoginResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * LoginResponse bean class - */ - -public class LoginResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -2565499186004191972L; - - - - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", "loginResponse", "ns31"); - - - - /** - * field for _return - */ - - - protected boolean local_return; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_returnTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean get_return() { - return this.local_return; - } - - - - /** - * Auto generated setter method - * - * @param param _return - */ - public void set_return(final boolean param) { - - // setting primitive attribute tracker to true - this.local_returnTracker = true; - - this.local_return = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":loginResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "loginResponse", xmlWriter); - } - - - } - if (this.local_returnTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "return", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("return cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.local_returnTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static LoginResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LoginResponse object = new LoginResponse(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"loginResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LoginResponse) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_return(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeCookie.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeCookie.java deleted file mode 100644 index effa7aede..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeCookie.java +++ /dev/null @@ -1,470 +0,0 @@ - -/** - * LoginWithRememberMeCookie.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * LoginWithRememberMeCookie bean class - */ - -public class LoginWithRememberMeCookie implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 5810916403049258436L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "loginWithRememberMeCookie", "ns31"); - - - - /** - * field for Cookie - */ - - - protected java.lang.String localCookie; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localCookieTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getCookie() { - return this.localCookie; - } - - - - /** - * Auto generated setter method - * - * @param param Cookie - */ - public void setCookie(final java.lang.String param) { - this.localCookieTracker = true; - - this.localCookie = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":loginWithRememberMeCookie", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "loginWithRememberMeCookie", - xmlWriter); - } - - - } - if (this.localCookieTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "cookie", xmlWriter); - - - if (this.localCookie == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localCookie); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localCookieTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "cookie")); - - elementList.add(this.localCookie == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCookie)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static LoginWithRememberMeCookie parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LoginWithRememberMeCookie object = new LoginWithRememberMeCookie(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"loginWithRememberMeCookie".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LoginWithRememberMeCookie) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "cookie").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setCookie(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeCookieResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeCookieResponse.java deleted file mode 100644 index 10e64d4f2..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeCookieResponse.java +++ /dev/null @@ -1,457 +0,0 @@ - -/** - * LoginWithRememberMeCookieResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * LoginWithRememberMeCookieResponse bean class - */ - -public class LoginWithRememberMeCookieResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -8577847217490135659L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "loginWithRememberMeCookieResponse", "ns31"); - - - - /** - * field for _return - */ - - - protected boolean local_return; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_returnTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean get_return() { - return this.local_return; - } - - - - /** - * Auto generated setter method - * - * @param param _return - */ - public void set_return(final boolean param) { - - // setting primitive attribute tracker to true - this.local_returnTracker = true; - - this.local_return = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":loginWithRememberMeCookieResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "loginWithRememberMeCookieResponse", xmlWriter); - } - - - } - if (this.local_returnTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "return", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("return cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.local_returnTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.local_return)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static LoginWithRememberMeCookieResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LoginWithRememberMeCookieResponse object = new LoginWithRememberMeCookieResponse(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"loginWithRememberMeCookieResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LoginWithRememberMeCookieResponse) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.set_return(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeOption.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeOption.java deleted file mode 100644 index dcb2054c8..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeOption.java +++ /dev/null @@ -1,660 +0,0 @@ - -/** - * LoginWithRememberMeOption.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * LoginWithRememberMeOption bean class - */ - -public class LoginWithRememberMeOption implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = -1267820311466872469L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "loginWithRememberMeOption", "ns31"); - - - - /** - * field for Username - */ - - - protected java.lang.String localUsername; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localUsernameTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getUsername() { - return this.localUsername; - } - - - - /** - * Auto generated setter method - * - * @param param Username - */ - public void setUsername(final java.lang.String param) { - this.localUsernameTracker = true; - - this.localUsername = param; - - - } - - - /** - * field for Password - */ - - - protected java.lang.String localPassword; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localPasswordTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getPassword() { - return this.localPassword; - } - - - - /** - * Auto generated setter method - * - * @param param Password - */ - public void setPassword(final java.lang.String param) { - this.localPasswordTracker = true; - - this.localPassword = param; - - - } - - - /** - * field for RemoteAddress - */ - - - protected java.lang.String localRemoteAddress; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localRemoteAddressTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getRemoteAddress() { - return this.localRemoteAddress; - } - - - - /** - * Auto generated setter method - * - * @param param RemoteAddress - */ - public void setRemoteAddress(final java.lang.String param) { - this.localRemoteAddressTracker = true; - - this.localRemoteAddress = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":loginWithRememberMeOption", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "loginWithRememberMeOption", - xmlWriter); - } - - - } - if (this.localUsernameTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "username", xmlWriter); - - - if (this.localUsername == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localUsername); - - } - - xmlWriter.writeEndElement(); - } - if (this.localPasswordTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "password", xmlWriter); - - - if (this.localPassword == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localPassword); - - } - - xmlWriter.writeEndElement(); - } - if (this.localRemoteAddressTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org"; - writeStartElement(null, namespace, "remoteAddress", xmlWriter); - - - if (this.localRemoteAddress == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localRemoteAddress); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localUsernameTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "username")); - - elementList.add(this.localUsername == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localUsername)); - } - if (this.localPasswordTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "password")); - - elementList.add(this.localPassword == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localPassword)); - } - if (this.localRemoteAddressTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "remoteAddress")); - - elementList.add(this.localRemoteAddress == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localRemoteAddress)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static LoginWithRememberMeOption parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LoginWithRememberMeOption object = new LoginWithRememberMeOption(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"loginWithRememberMeOption".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LoginWithRememberMeOption) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "username").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setUsername(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "password").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setPassword(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - reader.next(); - - } // End of if for expected property start element - - else { - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "remoteAddress").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setRemoteAddress(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeOptionResponse.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeOptionResponse.java deleted file mode 100644 index c251f57da..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/LoginWithRememberMeOptionResponse.java +++ /dev/null @@ -1,462 +0,0 @@ - -/** - * LoginWithRememberMeOptionResponse.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * LoginWithRememberMeOptionResponse bean class - */ - -public class LoginWithRememberMeOptionResponse implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 6023123334839026058L; - - - - public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "loginWithRememberMeOptionResponse", "ns31"); - - - - /** - * field for _return - */ - - - protected org.wso2.carbon.core.services.authentication.xsd.RememberMeData local_return; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean local_returnTracker = false; - - - /** - * Auto generated getter method - * - * @return org.wso2.carbon.core.services.authentication.xsd.RememberMeData - */ - public org.wso2.carbon.core.services.authentication.xsd.RememberMeData get_return() { - return this.local_return; - } - - - - /** - * Auto generated setter method - * - * @param param _return - */ - public void set_return(final org.wso2.carbon.core.services.authentication.xsd.RememberMeData param) { - this.local_returnTracker = true; - - this.local_return = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":loginWithRememberMeOptionResponse", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - "loginWithRememberMeOptionResponse", xmlWriter); - } - - - } - if (this.local_returnTracker) { - if (this.local_return == null) { - - writeStartElement(null, "http://authentication.services.core.carbon.wso2.org", "return", xmlWriter); - - // write the nil attribute - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - xmlWriter.writeEndElement(); - } else { - this.local_return.serialize(new javax.xml.namespace.QName( - "http://authentication.services.core.carbon.wso2.org", "return"), xmlWriter); - } - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.local_returnTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return")); - - - elementList.add(this.local_return == null ? null : this.local_return); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static LoginWithRememberMeOptionResponse parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final LoginWithRememberMeOptionResponse object = new LoginWithRememberMeOptionResponse(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"loginWithRememberMeOptionResponse".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (LoginWithRememberMeOptionResponse) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", - "return").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if ("true".equals(nillableValue) || "1".equals(nillableValue)) { - object.set_return(null); - reader.next(); - - reader.next(); - - } else { - - object.set_return(org.wso2.carbon.core.services.authentication.xsd.RememberMeData.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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/Logout.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/Logout.java deleted file mode 100644 index 542dd0e65..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/Logout.java +++ /dev/null @@ -1,371 +0,0 @@ - -/** - * Logout.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication; - - -/** - * Logout bean class - */ - -public class Logout implements org.apache.axis2.databinding.ADBBean { - - /** - * - */ - private static final long serialVersionUID = 8255614545614835249L; - public static final javax.xml.namespace.QName MY_QNAME = - new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org", "logout", "ns31"); - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, MY_QNAME); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(MY_QNAME, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":logout", - xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "logout", xmlWriter); - } - - - } - - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org")) { - return "ns31"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final 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 Logout parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final Logout object = new Logout(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"logout".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (Logout) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/xsd/RememberMeData.java b/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/xsd/RememberMeData.java deleted file mode 100644 index 505614e00..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/carbon/core/services/authentication/xsd/RememberMeData.java +++ /dev/null @@ -1,633 +0,0 @@ - -/** - * RememberMeData.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.carbon.core.services.authentication.xsd; - - -/** - * RememberMeData bean class - */ - -public class RememberMeData implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = RememberMeData Namespace URI = - * http://authentication.services.core.carbon.wso2.org/xsd Namespace Prefix = ns3 - */ - - - /** - * - */ - private static final long serialVersionUID = -756945348521344441L; - - /** - * field for Authenticated - */ - - - protected boolean localAuthenticated; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localAuthenticatedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getAuthenticated() { - return this.localAuthenticated; - } - - - - /** - * Auto generated setter method - * - * @param param Authenticated - */ - public void setAuthenticated(final boolean param) { - - // setting primitive attribute tracker to true - this.localAuthenticatedTracker = true; - - this.localAuthenticated = param; - - - } - - - /** - * field for MaxAge - */ - - - protected int localMaxAge; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localMaxAgeTracker = false; - - - /** - * Auto generated getter method - * - * @return int - */ - public int getMaxAge() { - return this.localMaxAge; - } - - - - /** - * Auto generated setter method - * - * @param param MaxAge - */ - public void setMaxAge(final int param) { - - // setting primitive attribute tracker to true - this.localMaxAgeTracker = param != java.lang.Integer.MIN_VALUE; - - this.localMaxAge = param; - - - } - - - /** - * field for Value - */ - - - protected java.lang.String localValue; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localValueTracker = false; - - - /** - * Auto generated getter method - * - * @return java.lang.String - */ - public java.lang.String getValue() { - return this.localValue; - } - - - - /** - * Auto generated setter method - * - * @param param Value - */ - public void setValue(final java.lang.String param) { - this.localValueTracker = true; - - this.localValue = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = - registerPrefix(xmlWriter, "http://authentication.services.core.carbon.wso2.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":RememberMeData", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "RememberMeData", xmlWriter); - } - - - } - if (this.localAuthenticatedTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org/xsd"; - writeStartElement(null, namespace, "authenticated", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("authenticated cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAuthenticated)); - } - - xmlWriter.writeEndElement(); - } - if (this.localMaxAgeTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org/xsd"; - writeStartElement(null, namespace, "maxAge", xmlWriter); - - if (this.localMaxAge == java.lang.Integer.MIN_VALUE) { - - throw new org.apache.axis2.databinding.ADBException("maxAge cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMaxAge)); - } - - xmlWriter.writeEndElement(); - } - if (this.localValueTracker) { - namespace = "http://authentication.services.core.carbon.wso2.org/xsd"; - writeStartElement(null, namespace, "value", xmlWriter); - - - if (this.localValue == null) { - // write the nil attribute - - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter); - - } else { - - - xmlWriter.writeCharacters(this.localValue); - - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://authentication.services.core.carbon.wso2.org/xsd")) { - return "ns3"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localAuthenticatedTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org/xsd", - "authenticated")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localAuthenticated)); - } - if (this.localMaxAgeTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org/xsd", - "maxAge")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localMaxAge)); - } - if (this.localValueTracker) { - elementList.add(new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org/xsd", - "value")); - - elementList.add(this.localValue == null ? null - : org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localValue)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static RememberMeData parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final RememberMeData object = new RememberMeData(); - - final int event; - java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"RememberMeData".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (RememberMeData) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org/xsd", - "authenticated").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setAuthenticated(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://authentication.services.core.carbon.wso2.org/xsd", - "maxAge").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setMaxAge(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content)); - - reader.next(); - - } // End of if for expected property start element - - else { - - object.setMaxAge(java.lang.Integer.MIN_VALUE); - - } - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() - && new javax.xml.namespace.QName("http://authentication.services.core.carbon.wso2.org/xsd", - "value").equals(reader.getName())) { - - nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); - if (!"true".equals(nillableValue) && !"1".equals(nillableValue)) { - - final java.lang.String content = reader.getElementText(); - - object.setValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - - } else { - - - reader.getElementText(); // throw away text nodes if any. - } - - 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 (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.bps/src/org/wso2/securevault/xsd/SecretResolver.java b/org.opentosca.container.connector.bps/src/org/wso2/securevault/xsd/SecretResolver.java deleted file mode 100644 index a88f88510..000000000 --- a/org.opentosca.container.connector.bps/src/org/wso2/securevault/xsd/SecretResolver.java +++ /dev/null @@ -1,451 +0,0 @@ - -/** - * SecretResolver.java - * - * This file was auto-generated from WSDL by the Apache Axis2 version: SNAPSHOT Built on : Nov 10, - * 2010 (06:34:21 UTC) - */ - - -package org.wso2.securevault.xsd; - - -/** - * SecretResolver bean class - */ - -public class SecretResolver implements org.apache.axis2.databinding.ADBBean { - /* - * This type was generated from the piece of schema that had name = SecretResolver Namespace URI = - * http://securevault.wso2.org/xsd Namespace Prefix = ns16 - */ - - - /** - * - */ - private static final long serialVersionUID = 830995751597225336L; - - /** - * field for Initialized - */ - - - protected boolean localInitialized; - - /* - * This tracker boolean wil be used to detect whether the user called the set method for this - * attribute. It will be used to determine whether to include this field in the serialized XML - */ - protected boolean localInitializedTracker = false; - - - /** - * Auto generated getter method - * - * @return boolean - */ - public boolean getInitialized() { - return this.localInitialized; - } - - - - /** - * Auto generated setter method - * - * @param param Initialized - */ - public void setInitialized(final boolean param) { - - // setting primitive attribute tracker to true - this.localInitializedTracker = true; - - this.localInitialized = param; - - - } - - - - /** - * - * @param parentQName - * @param factory - * @return org.apache.axiom.om.OMElement - */ - @Override - public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, - final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - - - - final org.apache.axiom.om.OMDataSource dataSource = - new org.apache.axis2.databinding.ADBDataSource(this, parentQName); - return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory, dataSource); - - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - serialize(parentQName, xmlWriter, false); - } - - @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, - final boolean serializeType) throws javax.xml.stream.XMLStreamException, - org.apache.axis2.databinding.ADBException { - - - - java.lang.String prefix = null; - java.lang.String namespace = null; - - - prefix = parentQName.getPrefix(); - namespace = parentQName.getNamespaceURI(); - writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - - if (serializeType) { - - - final java.lang.String namespacePrefix = registerPrefix(xmlWriter, "http://securevault.wso2.org/xsd"); - if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", - namespacePrefix + ":SecretResolver", xmlWriter); - } else { - writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "SecretResolver", xmlWriter); - } - - - } - if (this.localInitializedTracker) { - namespace = "http://securevault.wso2.org/xsd"; - writeStartElement(null, namespace, "initialized", xmlWriter); - - if (false) { - - throw new org.apache.axis2.databinding.ADBException("initialized cannot be null!!"); - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localInitialized)); - } - - xmlWriter.writeEndElement(); - } - xmlWriter.writeEndElement(); - - - } - - private static java.lang.String generatePrefix(final java.lang.String namespace) { - if (namespace.equals("http://securevault.wso2.org/xsd")) { - return "ns16"; - } - return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - - /** - * Utility method to write an element start tag. - */ - private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, - final java.lang.String localPart, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); - if (writerPrefix != null) { - xmlWriter.writeStartElement(namespace, localPart); - } else { - if (namespace.length() == 0) { - prefix = ""; - } else if (prefix == null) { - prefix = generatePrefix(namespace); - } - - xmlWriter.writeStartElement(prefix, localPart, namespace); - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - } - - /** - * Util method to write an attribute with the ns prefix - */ - private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, - final java.lang.String attName, final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (xmlWriter.getPrefix(namespace) == null) { - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - xmlWriter.writeAttribute(namespace, attName, attValue); - } - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, - final java.lang.String attValue, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attValue); - } - } - - - /** - * Util method to write an attribute without the ns prefix - */ - private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, - final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - final java.lang.String attributeNamespace = qname.getNamespaceURI(); - java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); - if (attributePrefix == null) { - attributePrefix = registerPrefix(xmlWriter, attributeNamespace); - } - java.lang.String attributeValue; - if (attributePrefix.trim().length() > 0) { - attributeValue = attributePrefix + ":" + qname.getLocalPart(); - } else { - attributeValue = qname.getLocalPart(); - } - - if (namespace.equals("")) { - xmlWriter.writeAttribute(attName, attributeValue); - } else { - registerPrefix(xmlWriter, namespace); - xmlWriter.writeAttribute(namespace, attName, attributeValue); - } - } - - /** - * method to handle Qnames - */ - - private void writeQName(final javax.xml.namespace.QName qname, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - final java.lang.String namespaceURI = qname.getNamespaceURI(); - if (namespaceURI != null) { - java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - xmlWriter.writeCharacters(prefix + ":" - + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } else { - // i.e this is the default namespace - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - - } else { - xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); - } - } - - private void writeQNames(final javax.xml.namespace.QName[] qnames, - final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - - if (qnames != null) { - // we have to store this data until last moment since it is not possible to write any - // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); - java.lang.String namespaceURI = null; - java.lang.String prefix = null; - - for (int i = 0; i < qnames.length; i++) { - if (i > 0) { - stringToWrite.append(" "); - } - namespaceURI = qnames[i].getNamespaceURI(); - if (namespaceURI != null) { - prefix = xmlWriter.getPrefix(namespaceURI); - if (prefix == null || prefix.length() == 0) { - prefix = generatePrefix(namespaceURI); - xmlWriter.writeNamespace(prefix, namespaceURI); - xmlWriter.setPrefix(prefix, namespaceURI); - } - - if (prefix.trim().length() > 0) { - stringToWrite.append(prefix).append(":") - .append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } else { - stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); - } - } - xmlWriter.writeCharacters(stringToWrite.toString()); - } - - } - - - /** - * Register a namespace prefix - */ - private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, - final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { - java.lang.String prefix = xmlWriter.getPrefix(namespace); - if (prefix == null) { - prefix = generatePrefix(namespace); - while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { - prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); - } - xmlWriter.writeNamespace(prefix, namespace); - xmlWriter.setPrefix(prefix, namespace); - } - return prefix; - } - - - - /** - * databinding method to get an XML representation of this object - * - */ - @Override - public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - - - - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); - - if (this.localInitializedTracker) { - elementList.add(new javax.xml.namespace.QName("http://securevault.wso2.org/xsd", "initialized")); - - elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localInitialized)); - } - - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), - attribList.toArray()); - - - - } - - - - /** - * Factory class that keeps the parse method - */ - public static class Factory { - - - - /** - * static method to create the object Precondition: If this object is an element, the current or - * next start element starts this object and any intervening reader events are ignorable If this - * object is not an element, it is a complex type and the reader is at the event just after the - * outer start element Postcondition: If this object is an element, the reader is positioned at its - * end element If this object is a complex type, the reader is positioned at the end element of its - * outer element - */ - public static SecretResolver parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - final SecretResolver object = new SecretResolver(); - - final int event; - final java.lang.String nillableValue = null; - final java.lang.String prefix = ""; - final java.lang.String namespaceuri = ""; - try { - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - - if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { - final java.lang.String fullTypeName = - reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); - if (fullTypeName != null) { - java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { - nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); - } - nsPrefix = nsPrefix == null ? "" : nsPrefix; - - final java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - - if (!"SecretResolver".equals(type)) { - // find namespace for the prefix - final java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); - return (SecretResolver) org.apache.axis2.transaction.xsd.ExtensionMapper.getTypeObject(nsUri, - type, - reader); - } - - - } - - - } - - - - // Note all attributes that were handled. Used to differ normal attributes - // from anyAttributes. - final java.util.Vector handledAttributes = new java.util.Vector(); - - - - reader.next(); - - - while (!reader.isStartElement() && !reader.isEndElement()) { - reader.next(); - } - - if (reader.isStartElement() && new javax.xml.namespace.QName("http://securevault.wso2.org/xsd", - "initialized").equals(reader.getName())) { - - final java.lang.String content = reader.getElementText(); - - object.setInitialized(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()) { - // A start element we are not expecting indicates a trailing invalid - // property - throw new org.apache.axis2.databinding.ADBException( - "Unexpected subelement " + reader.getLocalName()); - } - - - - } - catch (final javax.xml.stream.XMLStreamException e) { - throw new java.lang.Exception(e); - } - - return object; - } - - }// end of factory class - - - -} - diff --git a/org.opentosca.container.connector.ode/META-INF/MANIFEST.MF b/org.opentosca.container.connector.ode/META-INF/MANIFEST.MF deleted file mode 100644 index e1eba9df7..000000000 --- a/org.opentosca.container.connector.ode/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container ODE Connector -Bundle-SymbolicName: org.opentosca.container.connector.ode -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Import-Package: org.osgi.framework;version="1.3.0", - org.slf4j;version="1.6.4" -Bundle-ClassPath: ., - META-INF/libs/axis.jar, - META-INF/libs/commons-discovery-0.2.jar, - META-INF/libs/javax.wsdl_1.6.2.v201012040545.jar, - META-INF/libs/jaxrpc.jar, - META-INF/libs/org.apache.commons.logging_1.1.1.v201101211721.jar, - META-INF/libs/saaj.jar -Export-Package: org.opentosca.container.connector.ode -Bundle-Activator: org.opentosca.container.connector.ode.Activator diff --git a/org.opentosca.container.connector.ode/build.properties b/org.opentosca.container.connector.ode/build.properties deleted file mode 100644 index 986ad0920..000000000 --- a/org.opentosca.container.connector.ode/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -bin.includes = META-INF/,\ - .,\ - META-INF/libs/axis.jar,\ - META-INF/libs/commons-discovery-0.2.jar,\ - META-INF/libs/javax.wsdl_1.6.2.v201012040545.jar,\ - META-INF/libs/jaxrpc.jar,\ - META-INF/libs/org.apache.commons.logging_1.1.1.v201101211721.jar,\ - META-INF/libs/saaj.jar -source.. = src/ diff --git a/org.opentosca.container.connector.ode/META-INF/libs/axis.jar b/org.opentosca.container.connector.ode/lib/axis.jar similarity index 100% rename from org.opentosca.container.connector.ode/META-INF/libs/axis.jar rename to org.opentosca.container.connector.ode/lib/axis.jar diff --git a/org.opentosca.container.connector.ode/META-INF/libs/commons-discovery-0.2.jar b/org.opentosca.container.connector.ode/lib/commons-discovery-0.2.jar similarity index 100% rename from org.opentosca.container.connector.ode/META-INF/libs/commons-discovery-0.2.jar rename to org.opentosca.container.connector.ode/lib/commons-discovery-0.2.jar diff --git a/org.opentosca.container.connector.ode/META-INF/libs/javax.wsdl_1.6.2.v201012040545.jar b/org.opentosca.container.connector.ode/lib/javax.wsdl_1.6.2.v201012040545.jar similarity index 100% rename from org.opentosca.container.connector.ode/META-INF/libs/javax.wsdl_1.6.2.v201012040545.jar rename to org.opentosca.container.connector.ode/lib/javax.wsdl_1.6.2.v201012040545.jar diff --git a/org.opentosca.container.connector.ode/META-INF/libs/jaxrpc.jar b/org.opentosca.container.connector.ode/lib/jaxrpc.jar similarity index 100% rename from org.opentosca.container.connector.ode/META-INF/libs/jaxrpc.jar rename to org.opentosca.container.connector.ode/lib/jaxrpc.jar diff --git a/org.opentosca.container.connector.ode/META-INF/libs/org.apache.commons.logging_1.1.1.v201101211721.jar b/org.opentosca.container.connector.ode/lib/org.apache.commons.logging_1.1.1.v201101211721.jar similarity index 100% rename from org.opentosca.container.connector.ode/META-INF/libs/org.apache.commons.logging_1.1.1.v201101211721.jar rename to org.opentosca.container.connector.ode/lib/org.apache.commons.logging_1.1.1.v201101211721.jar diff --git a/org.opentosca.container.connector.ode/META-INF/libs/saaj.jar b/org.opentosca.container.connector.ode/lib/saaj.jar similarity index 100% rename from org.opentosca.container.connector.ode/META-INF/libs/saaj.jar rename to org.opentosca.container.connector.ode/lib/saaj.jar diff --git a/org.opentosca.container.connector.ode/pom.xml b/org.opentosca.container.connector.ode/pom.xml index ace4c9e07..789c633ee 100644 --- a/org.opentosca.container.connector.ode/pom.xml +++ b/org.opentosca.container.connector.ode/pom.xml @@ -1,6 +1,6 @@ + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 @@ -10,6 +10,32 @@ org.opentosca.container.connector.ode - eclipse-plugin + + + org.apache.axis + axis + 1.4 + + + commons-discovery + commons-discovery + 0.2 + + + org.apache.axis + axis-jaxrpc + 1.4 + + + org.apache.axis + axis-saaj + 1.4 + + + + wsdl4j + wsdl4j + + diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeployUnit.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeployUnit.java new file mode 100644 index 000000000..0e6a347ed --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeployUnit.java @@ -0,0 +1,164 @@ +/** + * DeployUnit.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.deployapi; + +public class DeployUnit implements java.io.Serializable { + private java.lang.String name; + + private javax.xml.namespace.QName[] id; + + public DeployUnit() { + } + + public DeployUnit( + java.lang.String name, + javax.xml.namespace.QName[] id) { + this.name = name; + this.id = id; + } + + /** + * Gets the name value for this DeployUnit. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + /** + * Sets the name value for this DeployUnit. + */ + public void setName(java.lang.String name) { + this.name = name; + } + + /** + * Gets the id value for this DeployUnit. + * + * @return id + */ + public javax.xml.namespace.QName[] getId() { + return id; + } + + /** + * Sets the id value for this DeployUnit. + */ + public void setId(javax.xml.namespace.QName[] id) { + this.id = id; + } + + public javax.xml.namespace.QName getId(int i) { + return this.id[i]; + } + + public void setId(int i, javax.xml.namespace.QName _value) { + this.id[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof DeployUnit)) return false; + DeployUnit other = (DeployUnit) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))) && + ((this.id == null && other.getId() == null) || + (this.id != null && + java.util.Arrays.equals(this.id, other.getId()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getId() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getId()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getId(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(DeployUnit.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "deployUnit")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentBindingStub.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentBindingStub.java new file mode 100644 index 000000000..c1fc5a524 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentBindingStub.java @@ -0,0 +1,392 @@ +/** + * DeploymentBindingStub.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.deployapi; + +public class DeploymentBindingStub extends org.apache.axis.client.Stub implements org.apache.www.ode.deployapi.DeploymentPortType { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc[] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[5]; + _initOperationDesc1(); + } + + private static void _initOperationDesc1() { + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("deploy"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "name"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "package"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "package"), org.apache.www.ode.deployapi._package.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "deployUnit")); + oper.setReturnClass(org.apache.www.ode.deployapi.DeployUnit.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "response")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + _operations[0] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("undeploy"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "packageName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); + oper.setReturnClass(boolean.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "response")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + _operations[1] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listDeployedPackages"); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "packageNames")); + oper.setReturnClass(java.lang.String[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "deployedPackages")); + param = oper.getReturnParamDesc(); + param.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "name")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + _operations[2] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listProcesses"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "packageName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "processIds")); + oper.setReturnClass(javax.xml.namespace.QName[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "processIds")); + param = oper.getReturnParamDesc(); + param.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "id")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + _operations[3] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getProcessPackage"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "processName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + oper.setReturnClass(java.lang.String.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "packageName")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + _operations[4] = oper; + } + + public DeploymentBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public DeploymentBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public DeploymentBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service) super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "deployUnit"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.deployapi.DeployUnit.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "package"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.deployapi._package.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "packageNames"); + cachedSerQNames.add(qName); + cls = java.lang.String[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "name"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "processIds"); + cachedSerQNames.add(qName); + cls = javax.xml.namespace.QName[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "id"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.w3.org/2005/05/xmlmime", ">contentType"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleSerializerFactory.class, cls, qName)); + cachedDeserFactories.add(org.apache.axis.encoding.ser.BaseDeserializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleDeserializerFactory.class, cls, qName)); + + qName = new javax.xml.namespace.QName("http://www.w3.org/2005/05/xmlmime", "base64Binary"); + cachedSerQNames.add(qName); + cls = org.w3.www._2005._05.xmlmime.Base64Binary.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleSerializerFactory.class, cls, qName)); + cachedDeserFactories.add(org.apache.axis.encoding.ser.BaseDeserializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleDeserializerFactory.class, cls, qName)); + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + public org.apache.www.ode.deployapi.DeployUnit deploy(java.lang.String name, org.apache.www.ode.deployapi._package _package) throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "deploy")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {name, _package}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.deployapi.DeployUnit) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.deployapi.DeployUnit) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.deployapi.DeployUnit.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + throw axisFaultException; + } + } + + public boolean undeploy(javax.xml.namespace.QName packageName) throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "undeploy")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {packageName}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return ((java.lang.Boolean) _resp).booleanValue(); + } catch (java.lang.Exception _exception) { + return ((java.lang.Boolean) org.apache.axis.utils.JavaUtils.convert(_resp, boolean.class)).booleanValue(); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + throw axisFaultException; + } + } + + public java.lang.String[] listDeployedPackages() throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[2]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listDeployedPackages")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (java.lang.String[]) _resp; + } catch (java.lang.Exception _exception) { + return (java.lang.String[]) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + throw axisFaultException; + } + } + + public javax.xml.namespace.QName[] listProcesses(java.lang.String packageName) throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[3]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listProcesses")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {packageName}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (javax.xml.namespace.QName[]) _resp; + } catch (java.lang.Exception _exception) { + return (javax.xml.namespace.QName[]) org.apache.axis.utils.JavaUtils.convert(_resp, javax.xml.namespace.QName[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + throw axisFaultException; + } + } + + public java.lang.String getProcessPackage(javax.xml.namespace.QName processName) throws java.rmi.RemoteException { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[4]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getProcessPackage")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {processName}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (java.lang.String) _resp; + } catch (java.lang.Exception _exception) { + return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + throw axisFaultException; + } + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentPortType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentPortType.java similarity index 85% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentPortType.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentPortType.java index 94ad472e4..e1513e694 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentPortType.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentPortType.java @@ -1,16 +1,19 @@ /** * DeploymentPortType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.deployapi; public interface DeploymentPortType extends java.rmi.Remote { public org.apache.www.ode.deployapi.DeployUnit deploy(java.lang.String name, org.apache.www.ode.deployapi._package _package) throws java.rmi.RemoteException; + public boolean undeploy(javax.xml.namespace.QName packageName) throws java.rmi.RemoteException; + public java.lang.String[] listDeployedPackages() throws java.rmi.RemoteException; + public javax.xml.namespace.QName[] listProcesses(java.lang.String packageName) throws java.rmi.RemoteException; + public java.lang.String getProcessPackage(javax.xml.namespace.QName processName) throws java.rmi.RemoteException; } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentPortTypeProxy.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentPortTypeProxy.java new file mode 100644 index 000000000..72c8fb03b --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentPortTypeProxy.java @@ -0,0 +1,74 @@ +package org.apache.www.ode.deployapi; + +public class DeploymentPortTypeProxy implements org.apache.www.ode.deployapi.DeploymentPortType { + private String _endpoint = null; + private org.apache.www.ode.deployapi.DeploymentPortType deploymentPortType = null; + + public DeploymentPortTypeProxy() { + _initDeploymentPortTypeProxy(); + } + + public DeploymentPortTypeProxy(String endpoint) { + _endpoint = endpoint; + _initDeploymentPortTypeProxy(); + } + + private void _initDeploymentPortTypeProxy() { + try { + deploymentPortType = (new org.apache.www.ode.deployapi.DeploymentServiceLocator()).getDeploymentPort(); + if (deploymentPortType != null) { + if (_endpoint != null) + ((javax.xml.rpc.Stub) deploymentPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + else + _endpoint = (String) ((javax.xml.rpc.Stub) deploymentPortType)._getProperty("javax.xml.rpc.service.endpoint.address"); + } + } catch (javax.xml.rpc.ServiceException serviceException) { + } + } + + public String getEndpoint() { + return _endpoint; + } + + public void setEndpoint(String endpoint) { + _endpoint = endpoint; + if (deploymentPortType != null) + ((javax.xml.rpc.Stub) deploymentPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + } + + public org.apache.www.ode.deployapi.DeploymentPortType getDeploymentPortType() { + if (deploymentPortType == null) + _initDeploymentPortTypeProxy(); + return deploymentPortType; + } + + public org.apache.www.ode.deployapi.DeployUnit deploy(java.lang.String name, org.apache.www.ode.deployapi._package _package) throws java.rmi.RemoteException { + if (deploymentPortType == null) + _initDeploymentPortTypeProxy(); + return deploymentPortType.deploy(name, _package); + } + + public boolean undeploy(javax.xml.namespace.QName packageName) throws java.rmi.RemoteException { + if (deploymentPortType == null) + _initDeploymentPortTypeProxy(); + return deploymentPortType.undeploy(packageName); + } + + public java.lang.String[] listDeployedPackages() throws java.rmi.RemoteException { + if (deploymentPortType == null) + _initDeploymentPortTypeProxy(); + return deploymentPortType.listDeployedPackages(); + } + + public javax.xml.namespace.QName[] listProcesses(java.lang.String packageName) throws java.rmi.RemoteException { + if (deploymentPortType == null) + _initDeploymentPortTypeProxy(); + return deploymentPortType.listProcesses(packageName); + } + + public java.lang.String getProcessPackage(javax.xml.namespace.QName processName) throws java.rmi.RemoteException { + if (deploymentPortType == null) + _initDeploymentPortTypeProxy(); + return deploymentPortType.getProcessPackage(processName); + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentService.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentService.java similarity index 79% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentService.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentService.java index 0855fde71..f552a8c32 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentService.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentService.java @@ -1,8 +1,7 @@ /** * DeploymentService.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.deployapi; diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentServiceLocator.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentServiceLocator.java similarity index 83% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentServiceLocator.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentServiceLocator.java index 9935153ce..d378bc108 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentServiceLocator.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/DeploymentServiceLocator.java @@ -1,8 +1,7 @@ /** * DeploymentServiceLocator.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.deployapi; @@ -12,7 +11,6 @@ public class DeploymentServiceLocator extends org.apache.axis.client.Service imp public DeploymentServiceLocator() { } - public DeploymentServiceLocator(org.apache.axis.EngineConfiguration config) { super(config); } @@ -40,11 +38,10 @@ public void setDeploymentPortWSDDServiceName(java.lang.String name) { } public org.apache.www.ode.deployapi.DeploymentPortType getDeploymentPort() throws javax.xml.rpc.ServiceException { - java.net.URL endpoint; + java.net.URL endpoint; try { endpoint = new java.net.URL(DeploymentPort_address); - } - catch (java.net.MalformedURLException e) { + } catch (java.net.MalformedURLException e) { throw new javax.xml.rpc.ServiceException(e); } return getDeploymentPort(endpoint); @@ -55,8 +52,7 @@ public org.apache.www.ode.deployapi.DeploymentPortType getDeploymentPort(java.ne org.apache.www.ode.deployapi.DeploymentBindingStub _stub = new org.apache.www.ode.deployapi.DeploymentBindingStub(portAddress, this); _stub.setPortName(getDeploymentPortWSDDServiceName()); return _stub; - } - catch (org.apache.axis.AxisFault e) { + } catch (org.apache.axis.AxisFault e) { return null; } } @@ -66,9 +62,8 @@ public void setDeploymentPortEndpointAddress(java.lang.String address) { } /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. + * For the given interface, get the stub implementation. If this service has no port for the given interface, then + * ServiceException is thrown. */ public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { @@ -77,17 +72,15 @@ public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml. _stub.setPortName(getDeploymentPortWSDDServiceName()); return _stub; } - } - catch (java.lang.Throwable t) { + } catch (java.lang.Throwable t) { throw new javax.xml.rpc.ServiceException(t); } throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); } /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. + * For the given interface, get the stub implementation. If this service has no port for the given interface, then + * ServiceException is thrown. */ public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { if (portName == null) { @@ -96,8 +89,7 @@ public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class service java.lang.String inputPortName = portName.getLocalPart(); if ("DeploymentPort".equals(inputPortName)) { return getDeploymentPort(); - } - else { + } else { java.rmi.Remote _stub = getPort(serviceEndpointInterface); ((org.apache.axis.client.Stub) _stub).setPortName(portName); return _stub; @@ -119,24 +111,21 @@ public java.util.Iterator getPorts() { } /** - * Set the endpoint address for the specified port name. - */ + * Set the endpoint address for the specified port name. + */ public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { - -if ("DeploymentPort".equals(portName)) { + + if ("DeploymentPort".equals(portName)) { setDeploymentPortEndpointAddress(address); - } - else -{ // Unknown Port Name + } else { // Unknown Port Name throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); } } /** - * Set the endpoint address for the specified port name. - */ + * Set the endpoint address for the specified port name. + */ public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { setEndpointAddress(portName.getLocalPart(), address); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/_package.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/_package.java new file mode 100644 index 000000000..7e57346ac --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/deployapi/_package.java @@ -0,0 +1,115 @@ +/** + * _package.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.deployapi; + +public class _package implements java.io.Serializable { + private org.w3.www._2005._05.xmlmime.Base64Binary zip; + + public _package() { + } + + public _package( + org.w3.www._2005._05.xmlmime.Base64Binary zip) { + this.zip = zip; + } + + /** + * Gets the zip value for this _package. + * + * @return zip + */ + public org.w3.www._2005._05.xmlmime.Base64Binary getZip() { + return zip; + } + + /** + * Sets the zip value for this _package. + */ + public void setZip(org.w3.www._2005._05.xmlmime.Base64Binary zip) { + this.zip = zip; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof _package)) return false; + _package other = (_package) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.zip == null && other.getZip() == null) || + (this.zip != null && + this.zip.equals(other.getZip()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getZip() != null) { + _hashCode += getZip().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(_package.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "package")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("zip"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "zip")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2005/05/xmlmime", "base64Binary")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/AidsType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/AidsType.java new file mode 100644 index 000000000..db4922149 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/AidsType.java @@ -0,0 +1,115 @@ +/** + * AidsType.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi; + +public class AidsType implements java.io.Serializable { + private java.lang.String aid; + + public AidsType() { + } + + public AidsType( + java.lang.String aid) { + this.aid = aid; + } + + /** + * Gets the aid value for this AidsType. + * + * @return aid + */ + public java.lang.String getAid() { + return aid; + } + + /** + * Sets the aid value for this AidsType. + */ + public void setAid(java.lang.String aid) { + this.aid = aid; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AidsType)) return false; + AidsType other = (AidsType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.aid == null && other.getAid() == null) || + (this.aid != null && + this.aid.equals(other.getAid()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAid() != null) { + _hashCode += getAid().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AidsType.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "aidsType")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aid"); + elemField.setXmlName(new javax.xml.namespace.QName("", "aid")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementBindingStub.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementBindingStub.java new file mode 100644 index 000000000..a28906654 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementBindingStub.java @@ -0,0 +1,1755 @@ +/** + * InstanceManagementBindingStub.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi; + +public class InstanceManagementBindingStub extends org.apache.axis.client.Stub implements org.apache.www.ode.pmapi.InstanceManagementPortType { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc[] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[20]; + _initOperationDesc1(); + _initOperationDesc2(); + } + + private static void _initOperationDesc1() { + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listInstances"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "order"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "limit"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[0] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listInstancesSummary"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "order"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "limit"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[1] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("queryInstances"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "payload"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[2] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listAllInstances"); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[3] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listAllInstancesWithLimit"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "payload"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[4] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getInstanceInfo"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[5] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getScopeInfo"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "siid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "scope-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[6] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getScopeInfoWithActivity"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "sid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "activityInfo"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "scope-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[7] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getVariableInfo"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "sid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "varName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "variable-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[8] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("setVariable"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "sid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "varName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "value"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyType"), java.lang.Object.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "scope-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[9] = oper; + } + + private static void _initOperationDesc2() { + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listEvents"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "instanceFilter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "eventFilter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "maxCount"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "bpel-event-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[10] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getEventTimeline"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "instanceFilter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "eventFilter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType")); + oper.setReturnClass(org.apache.www.ode.pmapi.ListType.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "dates")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[11] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("suspend"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[12] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("resume"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[13] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("terminate"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[14] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("fault"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[15] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("delete"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType")); + oper.setReturnClass(org.apache.www.ode.pmapi.ListType.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[16] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("recoverActivity"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "aid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "action"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[17] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("replay"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "replay"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "Replay"), org.apache.www.ode.pmapi.types._2006._08._02.Replay.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayResponse")); + oper.setReturnClass(long[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "replayResponse")); + param = oper.getReturnParamDesc(); + param.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoredIID")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[18] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getCommunication"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "getCommunication"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunication"), long[].class, false, false); + param.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "iid")); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunicationResponse")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "getCommunicationResponse")); + param = oper.getReturnParamDesc(); + param.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoreInstance")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[19] = oper; + } + + public InstanceManagementBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public InstanceManagementBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public InstanceManagementBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service) super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>mockQueryRequest>pattern"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequestPattern.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>exchange"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeExchange.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>serviceConfig"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeServiceConfig.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">mockQueryRequest"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequest.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tFaultInfo>data"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfoData.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>correlation-properties"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>event-info"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceSummary>instances"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessInfo>documents"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "document"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>activities"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>children"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "child-ref"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>correlation-sets"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-set"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>variables"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "variable-ref"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tVariableInfo>value"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ExchangeType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FailureType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.FailureType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FaultType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.FaultType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunication"); + cachedSerQNames.add(qName); + cls = long[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "iid"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunicationResponse"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoreInstance"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "Replay"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.Replay.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayResponse"); + cachedSerQNames.add(qName); + cls = long[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoredIID"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.ReplayType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ResponseType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.ResponseType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityExtInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityExtInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityStatus"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivitytExtInfoList"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityExtInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-ext-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleSerializerFactory.class, cls, qName)); + cachedDeserFactories.add(org.apache.axis.encoding.ser.BaseDeserializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleDeserializerFactory.class, cls, qName)); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDefinitionInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDeploymentInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEndpointReferences"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoint-ref"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfoList"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "event-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailureInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TFailureInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailuresInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFaultInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "instance-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceStatus"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceSummary"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "process-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessProperties"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "property"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessStatus"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "aidsType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.AidsType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.ListType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstances(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listInstances")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter, order, new java.lang.Integer(limit)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstancesSummary(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listInstancesSummary")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter, order, new java.lang.Integer(limit)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] queryInstances(java.lang.String payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[2]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "queryInstances")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {payload}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstances() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[3]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listAllInstances")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstancesWithLimit(int payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[4]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listAllInstancesWithLimit")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Integer(payload)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo getInstanceInfo(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[5]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getInstanceInfo")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfo(long siid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[6]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getScopeInfo")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(siid)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfoWithActivity(long sid, boolean activityInfo) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[7]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getScopeInfoWithActivity")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(sid), new java.lang.Boolean(activityInfo)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo getVariableInfo(java.lang.String sid, java.lang.String varName) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[8]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getVariableInfo")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {sid, varName}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo setVariable(java.lang.String sid, java.lang.String varName, java.lang.Object value) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[9]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "setVariable")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {sid, varName, value}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[] listEvents(java.lang.String instanceFilter, java.lang.String eventFilter, int maxCount) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[10]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listEvents")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {instanceFilter, eventFilter, new java.lang.Integer(maxCount)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.ListType getEventTimeline(java.lang.String instanceFilter, java.lang.String eventFilter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[11]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getEventTimeline")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {instanceFilter, eventFilter}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.ListType) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.ListType) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.ListType.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo suspend(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[12]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "suspend")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo resume(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[13]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "resume")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo terminate(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[14]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "terminate")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo fault(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[15]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "fault")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.ListType delete(java.lang.String filter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[16]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "delete")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.ListType) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.ListType) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.ListType.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo recoverActivity(long iid, long aid, java.lang.String action) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[17]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "recoverActivity")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid), new java.lang.Long(aid), action}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public long[] replay(org.apache.www.ode.pmapi.types._2006._08._02.Replay replay) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[18]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "replay")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {replay}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (long[]) _resp; + } catch (java.lang.Exception _exception) { + return (long[]) org.apache.axis.utils.JavaUtils.convert(_resp, long[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] getCommunication(long[] getCommunication) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[19]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getCommunication")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {getCommunication}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementPortType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementPortType.java similarity index 96% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementPortType.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementPortType.java index 2e3c1a5b3..94ee2320c 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementPortType.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementPortType.java @@ -1,31 +1,49 @@ /** * InstanceManagementPortType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi; public interface InstanceManagementPortType extends java.rmi.Remote { public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstances(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstancesSummary(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] queryInstances(java.lang.String payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstances() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstancesWithLimit(int payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo getInstanceInfo(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfo(long siid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfoWithActivity(long sid, boolean activityInfo) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo getVariableInfo(java.lang.String sid, java.lang.String varName) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo setVariable(java.lang.String sid, java.lang.String varName, java.lang.Object value) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[] listEvents(java.lang.String instanceFilter, java.lang.String eventFilter, int maxCount) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.ListType getEventTimeline(java.lang.String instanceFilter, java.lang.String eventFilter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo suspend(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo resume(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo terminate(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo fault(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.ListType delete(java.lang.String filter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo recoverActivity(long iid, long aid, java.lang.String action) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public long[] replay(org.apache.www.ode.pmapi.types._2006._08._02.Replay replay) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] getCommunication(long[] getCommunication) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementPortTypeProxy.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementPortTypeProxy.java new file mode 100644 index 000000000..cdeb3591a --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementPortTypeProxy.java @@ -0,0 +1,164 @@ +package org.apache.www.ode.pmapi; + +public class InstanceManagementPortTypeProxy implements org.apache.www.ode.pmapi.InstanceManagementPortType { + private String _endpoint = null; + private org.apache.www.ode.pmapi.InstanceManagementPortType instanceManagementPortType = null; + + public InstanceManagementPortTypeProxy() { + _initInstanceManagementPortTypeProxy(); + } + + public InstanceManagementPortTypeProxy(String endpoint) { + _endpoint = endpoint; + _initInstanceManagementPortTypeProxy(); + } + + private void _initInstanceManagementPortTypeProxy() { + try { + instanceManagementPortType = (new org.apache.www.ode.pmapi.InstanceManagementServiceLocator()).getInstanceManagementPort(); + if (instanceManagementPortType != null) { + if (_endpoint != null) + ((javax.xml.rpc.Stub) instanceManagementPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + else + _endpoint = (String) ((javax.xml.rpc.Stub) instanceManagementPortType)._getProperty("javax.xml.rpc.service.endpoint.address"); + } + } catch (javax.xml.rpc.ServiceException serviceException) { + } + } + + public String getEndpoint() { + return _endpoint; + } + + public void setEndpoint(String endpoint) { + _endpoint = endpoint; + if (instanceManagementPortType != null) + ((javax.xml.rpc.Stub) instanceManagementPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + } + + public org.apache.www.ode.pmapi.InstanceManagementPortType getInstanceManagementPortType() { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType; + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstances(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.listInstances(filter, order, limit); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstancesSummary(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.listInstancesSummary(filter, order, limit); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] queryInstances(java.lang.String payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.queryInstances(payload); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstances() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.listAllInstances(); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstancesWithLimit(int payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.listAllInstancesWithLimit(payload); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo getInstanceInfo(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.getInstanceInfo(iid); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfo(long siid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.getScopeInfo(siid); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfoWithActivity(long sid, boolean activityInfo) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.getScopeInfoWithActivity(sid, activityInfo); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo getVariableInfo(java.lang.String sid, java.lang.String varName) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.getVariableInfo(sid, varName); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo setVariable(java.lang.String sid, java.lang.String varName, java.lang.Object value) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.setVariable(sid, varName, value); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[] listEvents(java.lang.String instanceFilter, java.lang.String eventFilter, int maxCount) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.listEvents(instanceFilter, eventFilter, maxCount); + } + + public org.apache.www.ode.pmapi.ListType getEventTimeline(java.lang.String instanceFilter, java.lang.String eventFilter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.getEventTimeline(instanceFilter, eventFilter); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo suspend(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.suspend(iid); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo resume(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.resume(iid); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo terminate(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.terminate(iid); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo fault(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.fault(iid); + } + + public org.apache.www.ode.pmapi.ListType delete(java.lang.String filter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.delete(filter); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo recoverActivity(long iid, long aid, java.lang.String action) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.recoverActivity(iid, aid, action); + } + + public long[] replay(org.apache.www.ode.pmapi.types._2006._08._02.Replay replay) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.replay(replay); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] getCommunication(long[] getCommunication) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (instanceManagementPortType == null) + _initInstanceManagementPortTypeProxy(); + return instanceManagementPortType.getCommunication(getCommunication); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementService.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementService.java new file mode 100644 index 000000000..09e0175ab --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementService.java @@ -0,0 +1,15 @@ +/** + * InstanceManagementService.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi; + +public interface InstanceManagementService extends javax.xml.rpc.Service { + public java.lang.String getInstanceManagementPortAddress(); + + public org.apache.www.ode.pmapi.InstanceManagementPortType getInstanceManagementPort() throws javax.xml.rpc.ServiceException; + + public org.apache.www.ode.pmapi.InstanceManagementPortType getInstanceManagementPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementServiceLocator.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementServiceLocator.java similarity index 84% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementServiceLocator.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementServiceLocator.java index 63199f77d..723deb244 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementServiceLocator.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/InstanceManagementServiceLocator.java @@ -1,8 +1,7 @@ /** * InstanceManagementServiceLocator.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi; @@ -12,7 +11,6 @@ public class InstanceManagementServiceLocator extends org.apache.axis.client.Ser public InstanceManagementServiceLocator() { } - public InstanceManagementServiceLocator(org.apache.axis.EngineConfiguration config) { super(config); } @@ -40,11 +38,10 @@ public void setInstanceManagementPortWSDDServiceName(java.lang.String name) { } public org.apache.www.ode.pmapi.InstanceManagementPortType getInstanceManagementPort() throws javax.xml.rpc.ServiceException { - java.net.URL endpoint; + java.net.URL endpoint; try { endpoint = new java.net.URL(InstanceManagementPort_address); - } - catch (java.net.MalformedURLException e) { + } catch (java.net.MalformedURLException e) { throw new javax.xml.rpc.ServiceException(e); } return getInstanceManagementPort(endpoint); @@ -55,8 +52,7 @@ public org.apache.www.ode.pmapi.InstanceManagementPortType getInstanceManagement org.apache.www.ode.pmapi.InstanceManagementBindingStub _stub = new org.apache.www.ode.pmapi.InstanceManagementBindingStub(portAddress, this); _stub.setPortName(getInstanceManagementPortWSDDServiceName()); return _stub; - } - catch (org.apache.axis.AxisFault e) { + } catch (org.apache.axis.AxisFault e) { return null; } } @@ -66,9 +62,8 @@ public void setInstanceManagementPortEndpointAddress(java.lang.String address) { } /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. + * For the given interface, get the stub implementation. If this service has no port for the given interface, then + * ServiceException is thrown. */ public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { @@ -77,17 +72,15 @@ public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml. _stub.setPortName(getInstanceManagementPortWSDDServiceName()); return _stub; } - } - catch (java.lang.Throwable t) { + } catch (java.lang.Throwable t) { throw new javax.xml.rpc.ServiceException(t); } throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); } /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. + * For the given interface, get the stub implementation. If this service has no port for the given interface, then + * ServiceException is thrown. */ public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { if (portName == null) { @@ -96,8 +89,7 @@ public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class service java.lang.String inputPortName = portName.getLocalPart(); if ("InstanceManagementPort".equals(inputPortName)) { return getInstanceManagementPort(); - } - else { + } else { java.rmi.Remote _stub = getPort(serviceEndpointInterface); ((org.apache.axis.client.Stub) _stub).setPortName(portName); return _stub; @@ -119,24 +111,21 @@ public java.util.Iterator getPorts() { } /** - * Set the endpoint address for the specified port name. - */ + * Set the endpoint address for the specified port name. + */ public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { - -if ("InstanceManagementPort".equals(portName)) { + + if ("InstanceManagementPort".equals(portName)) { setInstanceManagementPortEndpointAddress(address); - } - else -{ // Unknown Port Name + } else { // Unknown Port Name throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); } } /** - * Set the endpoint address for the specified port name. - */ + * Set the endpoint address for the specified port name. + */ public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { setEndpointAddress(portName.getLocalPart(), address); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ListType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ListType.java new file mode 100644 index 000000000..80349debe --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ListType.java @@ -0,0 +1,115 @@ +/** + * ListType.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi; + +public class ListType implements java.io.Serializable { + private java.lang.String element; + + public ListType() { + } + + public ListType( + java.lang.String element) { + this.element = element; + } + + /** + * Gets the element value for this ListType. + * + * @return element + */ + public java.lang.String getElement() { + return element; + } + + /** + * Sets the element value for this ListType. + */ + public void setElement(java.lang.String element) { + this.element = element; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ListType)) return false; + ListType other = (ListType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.element == null && other.getElement() == null) || + (this.element != null && + this.element.equals(other.getElement()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getElement() != null) { + _hashCode += getElement().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ListType.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("element"); + elemField.setXmlName(new javax.xml.namespace.QName("", "element")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ManagementFault.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ManagementFault.java similarity index 82% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ManagementFault.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ManagementFault.java index 868f5cbf0..b330f6ce3 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ManagementFault.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ManagementFault.java @@ -1,14 +1,14 @@ /** * ManagementFault.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi; public class ManagementFault extends org.apache.axis.AxisFault { public java.lang.String managementFault; + public java.lang.String getManagementFault() { return this.managementFault; } @@ -24,7 +24,7 @@ public ManagementFault(java.lang.String message, java.lang.Throwable t) { super(message, t); } - public ManagementFault(java.lang.String managementFault) { + public ManagementFault(java.lang.String managementFault) { this.managementFault = managementFault; } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementBindingStub.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementBindingStub.java new file mode 100644 index 000000000..cdc3ce3c3 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementBindingStub.java @@ -0,0 +1,1149 @@ +/** + * ProcessManagementBindingStub.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi; + +public class ProcessManagementBindingStub extends org.apache.axis.client.Stub implements org.apache.www.ode.pmapi.ProcessManagementPortType { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc[] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[10]; + _initOperationDesc1(); + } + + private static void _initOperationDesc1() { + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listProcesses"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "orderKeys"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[0] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listAllProcesses"); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[1] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("listProcessesCustom"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "orderKeys"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "customizer"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info-list")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[2] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getProcessInfo"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[3] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getProcessInfoCustom"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "customizer"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[4] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getExtensibilityElements"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "aids"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "aidsType"), org.apache.www.ode.pmapi.AidsType.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[5] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("setProcessProperty"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "propertyName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "propertyValue"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[6] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("setProcessPropertyNode"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "propertyName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "propertyValue"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyType"), java.lang.Object.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[7] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("activate"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[8] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("setRetired"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "retired"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); + oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); + oper.setStyle(org.apache.axis.constants.Style.RPC); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), + "org.apache.www.ode.pmapi.ManagementFault", + new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), + false + )); + _operations[9] = oper; + } + + public ProcessManagementBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public ProcessManagementBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public ProcessManagementBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service) super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>mockQueryRequest>pattern"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequestPattern.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>exchange"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeExchange.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>serviceConfig"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeServiceConfig.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">mockQueryRequest"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequest.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tFaultInfo>data"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfoData.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>correlation-properties"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>event-info"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceSummary>instances"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessInfo>documents"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "document"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>activities"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>children"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "child-ref"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>correlation-sets"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-set"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>variables"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "variable-ref"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tVariableInfo>value"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ExchangeType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FailureType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.FailureType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FaultType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.FaultType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunication"); + cachedSerQNames.add(qName); + cls = long[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "iid"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunicationResponse"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoreInstance"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "Replay"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.Replay.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayResponse"); + cachedSerQNames.add(qName); + cls = long[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoredIID"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.ReplayType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ResponseType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.ResponseType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityExtInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityExtInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityStatus"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivitytExtInfoList"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityExtInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-ext-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleSerializerFactory.class, cls, qName)); + cachedDeserFactories.add(org.apache.axis.encoding.ser.BaseDeserializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleDeserializerFactory.class, cls, qName)); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDefinitionInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDeploymentInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEndpointReferences"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoint-ref"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfoList"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "event-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailureInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TFailureInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailuresInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFaultInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "instance-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceStatus"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceSummary"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "process-info"); + qName2 = null; + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessProperties"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property"); + qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "property"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessStatus"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "aidsType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.AidsType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType"); + cachedSerQNames.add(qName); + cls = org.apache.www.ode.pmapi.ListType.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcesses(java.lang.String filter, java.lang.String orderKeys) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listProcesses")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter, orderKeys}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listAllProcesses() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listAllProcesses")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcessesCustom(java.lang.String filter, java.lang.String orderKeys, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[2]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listProcessesCustom")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter, orderKeys, customizer}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfo(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[3]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getProcessInfo")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfoCustom(javax.xml.namespace.QName pid, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[4]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getProcessInfoCustom")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, customizer}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getExtensibilityElements(javax.xml.namespace.QName pid, org.apache.www.ode.pmapi.AidsType aids) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[5]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getExtensibilityElements")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, aids}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessProperty(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.String propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[6]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "setProcessProperty")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, propertyName, propertyValue}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessPropertyNode(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.Object propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[7]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "setProcessPropertyNode")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, propertyName, propertyValue}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo activate(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[8]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "activate")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setRetired(javax.xml.namespace.QName pid, boolean retired) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[9]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(""); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "setRetired")); + + setRequestHeaders(_call); + setAttachments(_call); + try { + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, new java.lang.Boolean(retired)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) _resp; + } else { + extractAttachments(_call); + try { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; + } catch (java.lang.Exception _exception) { + return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { + throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; + } + } + throw axisFaultException; + } + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementPortType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementPortType.java similarity index 94% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementPortType.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementPortType.java index 36d643bbb..275781b2e 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementPortType.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementPortType.java @@ -1,21 +1,29 @@ /** * ProcessManagementPortType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi; public interface ProcessManagementPortType extends java.rmi.Remote { public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcesses(java.lang.String filter, java.lang.String orderKeys) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listAllProcesses() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcessesCustom(java.lang.String filter, java.lang.String orderKeys, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfo(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfoCustom(javax.xml.namespace.QName pid, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessProperty(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.String propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessPropertyNode(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.Object propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getExtensibilityElements(javax.xml.namespace.QName pid, org.apache.www.ode.pmapi.AidsType aids) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo activate(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setRetired(javax.xml.namespace.QName pid, boolean retired) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault; } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementPortTypeProxy.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementPortTypeProxy.java new file mode 100644 index 000000000..009c5a855 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementPortTypeProxy.java @@ -0,0 +1,104 @@ +package org.apache.www.ode.pmapi; + +public class ProcessManagementPortTypeProxy implements org.apache.www.ode.pmapi.ProcessManagementPortType { + private String _endpoint = null; + private org.apache.www.ode.pmapi.ProcessManagementPortType processManagementPortType = null; + + public ProcessManagementPortTypeProxy() { + _initProcessManagementPortTypeProxy(); + } + + public ProcessManagementPortTypeProxy(String endpoint) { + _endpoint = endpoint; + _initProcessManagementPortTypeProxy(); + } + + private void _initProcessManagementPortTypeProxy() { + try { + processManagementPortType = (new org.apache.www.ode.pmapi.ProcessManagementServiceLocator()).getProcessManagementPort(); + if (processManagementPortType != null) { + if (_endpoint != null) + ((javax.xml.rpc.Stub) processManagementPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + else + _endpoint = (String) ((javax.xml.rpc.Stub) processManagementPortType)._getProperty("javax.xml.rpc.service.endpoint.address"); + } + } catch (javax.xml.rpc.ServiceException serviceException) { + } + } + + public String getEndpoint() { + return _endpoint; + } + + public void setEndpoint(String endpoint) { + _endpoint = endpoint; + if (processManagementPortType != null) + ((javax.xml.rpc.Stub) processManagementPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); + } + + public org.apache.www.ode.pmapi.ProcessManagementPortType getProcessManagementPortType() { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType; + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcesses(java.lang.String filter, java.lang.String orderKeys) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.listProcesses(filter, orderKeys); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listAllProcesses() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.listAllProcesses(); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcessesCustom(java.lang.String filter, java.lang.String orderKeys, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.listProcessesCustom(filter, orderKeys, customizer); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfo(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.getProcessInfo(pid); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfoCustom(javax.xml.namespace.QName pid, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.getProcessInfoCustom(pid, customizer); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessProperty(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.String propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.setProcessProperty(pid, propertyName, propertyValue); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessPropertyNode(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.Object propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.setProcessPropertyNode(pid, propertyName, propertyValue); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getExtensibilityElements(javax.xml.namespace.QName pid, org.apache.www.ode.pmapi.AidsType aids) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.getExtensibilityElements(pid, aids); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo activate(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.activate(pid); + } + + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setRetired(javax.xml.namespace.QName pid, boolean retired) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { + if (processManagementPortType == null) + _initProcessManagementPortTypeProxy(); + return processManagementPortType.setRetired(pid, retired); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementService.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementService.java new file mode 100644 index 000000000..ed9413ad8 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementService.java @@ -0,0 +1,15 @@ +/** + * ProcessManagementService.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi; + +public interface ProcessManagementService extends javax.xml.rpc.Service { + public java.lang.String getProcessManagementPortAddress(); + + public org.apache.www.ode.pmapi.ProcessManagementPortType getProcessManagementPort() throws javax.xml.rpc.ServiceException; + + public org.apache.www.ode.pmapi.ProcessManagementPortType getProcessManagementPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementServiceLocator.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementServiceLocator.java similarity index 83% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementServiceLocator.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementServiceLocator.java index b5322bd08..5830453dd 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementServiceLocator.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/ProcessManagementServiceLocator.java @@ -1,8 +1,7 @@ /** * ProcessManagementServiceLocator.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi; @@ -12,7 +11,6 @@ public class ProcessManagementServiceLocator extends org.apache.axis.client.Serv public ProcessManagementServiceLocator() { } - public ProcessManagementServiceLocator(org.apache.axis.EngineConfiguration config) { super(config); } @@ -40,11 +38,10 @@ public void setProcessManagementPortWSDDServiceName(java.lang.String name) { } public org.apache.www.ode.pmapi.ProcessManagementPortType getProcessManagementPort() throws javax.xml.rpc.ServiceException { - java.net.URL endpoint; + java.net.URL endpoint; try { endpoint = new java.net.URL(ProcessManagementPort_address); - } - catch (java.net.MalformedURLException e) { + } catch (java.net.MalformedURLException e) { throw new javax.xml.rpc.ServiceException(e); } return getProcessManagementPort(endpoint); @@ -55,8 +52,7 @@ public org.apache.www.ode.pmapi.ProcessManagementPortType getProcessManagementPo org.apache.www.ode.pmapi.ProcessManagementBindingStub _stub = new org.apache.www.ode.pmapi.ProcessManagementBindingStub(portAddress, this); _stub.setPortName(getProcessManagementPortWSDDServiceName()); return _stub; - } - catch (org.apache.axis.AxisFault e) { + } catch (org.apache.axis.AxisFault e) { return null; } } @@ -66,9 +62,8 @@ public void setProcessManagementPortEndpointAddress(java.lang.String address) { } /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. + * For the given interface, get the stub implementation. If this service has no port for the given interface, then + * ServiceException is thrown. */ public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { @@ -77,17 +72,15 @@ public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml. _stub.setPortName(getProcessManagementPortWSDDServiceName()); return _stub; } - } - catch (java.lang.Throwable t) { + } catch (java.lang.Throwable t) { throw new javax.xml.rpc.ServiceException(t); } throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); } /** - * For the given interface, get the stub implementation. - * If this service has no port for the given interface, - * then ServiceException is thrown. + * For the given interface, get the stub implementation. If this service has no port for the given interface, then + * ServiceException is thrown. */ public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { if (portName == null) { @@ -96,8 +89,7 @@ public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class service java.lang.String inputPortName = portName.getLocalPart(); if ("ProcessManagementPort".equals(inputPortName)) { return getProcessManagementPort(); - } - else { + } else { java.rmi.Remote _stub = getPort(serviceEndpointInterface); ((org.apache.axis.client.Stub) _stub).setPortName(portName); return _stub; @@ -119,24 +111,21 @@ public java.util.Iterator getPorts() { } /** - * Set the endpoint address for the specified port name. - */ + * Set the endpoint address for the specified port name. + */ public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { - -if ("ProcessManagementPort".equals(portName)) { + + if ("ProcessManagementPort".equals(portName)) { setProcessManagementPortEndpointAddress(address); - } - else -{ // Unknown Port Name + } else { // Unknown Port Name throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); } } /** - * Set the endpoint address for the specified port name. - */ + * Set the endpoint address for the specified port name. + */ public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { setEndpointAddress(portName.getLocalPart(), address); } - } diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationType.java similarity index 75% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationType.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationType.java index c5e6bc5b9..2ec54c525 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationType.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationType.java @@ -1,13 +1,12 @@ /** * CommunicationType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; -public class CommunicationType implements java.io.Serializable { +public class CommunicationType implements java.io.Serializable { private javax.xml.namespace.QName processType; private java.lang.Boolean rollbackOnFault; @@ -20,71 +19,59 @@ public CommunicationType() { } public CommunicationType( - javax.xml.namespace.QName processType, - java.lang.Boolean rollbackOnFault, - org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeServiceConfig[] serviceConfig, - org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeExchange[] exchange) { - this.processType = processType; - this.rollbackOnFault = rollbackOnFault; - this.serviceConfig = serviceConfig; - this.exchange = exchange; + javax.xml.namespace.QName processType, + java.lang.Boolean rollbackOnFault, + org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeServiceConfig[] serviceConfig, + org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeExchange[] exchange) { + this.processType = processType; + this.rollbackOnFault = rollbackOnFault; + this.serviceConfig = serviceConfig; + this.exchange = exchange; } - /** * Gets the processType value for this CommunicationType. - * + * * @return processType */ public javax.xml.namespace.QName getProcessType() { return processType; } - /** * Sets the processType value for this CommunicationType. - * - * @param processType */ public void setProcessType(javax.xml.namespace.QName processType) { this.processType = processType; } - /** * Gets the rollbackOnFault value for this CommunicationType. - * + * * @return rollbackOnFault */ public java.lang.Boolean getRollbackOnFault() { return rollbackOnFault; } - /** * Sets the rollbackOnFault value for this CommunicationType. - * - * @param rollbackOnFault */ public void setRollbackOnFault(java.lang.Boolean rollbackOnFault) { this.rollbackOnFault = rollbackOnFault; } - /** * Gets the serviceConfig value for this CommunicationType. - * + * * @return serviceConfig */ public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeServiceConfig[] getServiceConfig() { return serviceConfig; } - /** * Sets the serviceConfig value for this CommunicationType. - * - * @param serviceConfig */ public void setServiceConfig(org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeServiceConfig[] serviceConfig) { this.serviceConfig = serviceConfig; @@ -98,21 +85,17 @@ public void setServiceConfig(int i, org.apache.www.ode.pmapi.types._2006._08._02 this.serviceConfig[i] = _value; } - /** * Gets the exchange value for this CommunicationType. - * + * * @return exchange */ public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeExchange[] getExchange() { return exchange; } - /** * Sets the exchange value for this CommunicationType. - * - * @param exchange */ public void setExchange(org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeExchange[] exchange) { this.exchange = exchange; @@ -127,6 +110,7 @@ public void setExchange(int i, org.apache.www.ode.pmapi.types._2006._08._02.Comm } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof CommunicationType)) return false; CommunicationType other = (CommunicationType) obj; @@ -137,24 +121,25 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.processType==null && other.getProcessType()==null) || - (this.processType!=null && - this.processType.equals(other.getProcessType()))) && - ((this.rollbackOnFault==null && other.getRollbackOnFault()==null) || - (this.rollbackOnFault!=null && - this.rollbackOnFault.equals(other.getRollbackOnFault()))) && - ((this.serviceConfig==null && other.getServiceConfig()==null) || - (this.serviceConfig!=null && - java.util.Arrays.equals(this.serviceConfig, other.getServiceConfig()))) && - ((this.exchange==null && other.getExchange()==null) || - (this.exchange!=null && - java.util.Arrays.equals(this.exchange, other.getExchange()))); + _equals = true && + ((this.processType == null && other.getProcessType() == null) || + (this.processType != null && + this.processType.equals(other.getProcessType()))) && + ((this.rollbackOnFault == null && other.getRollbackOnFault() == null) || + (this.rollbackOnFault != null && + this.rollbackOnFault.equals(other.getRollbackOnFault()))) && + ((this.serviceConfig == null && other.getServiceConfig() == null) || + (this.serviceConfig != null && + java.util.Arrays.equals(this.serviceConfig, other.getServiceConfig()))) && + ((this.exchange == null && other.getExchange() == null) || + (this.exchange != null && + java.util.Arrays.equals(this.exchange, other.getExchange()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -168,8 +153,8 @@ public synchronized int hashCode() { _hashCode += getRollbackOnFault().hashCode(); } if (getServiceConfig() != null) { - for (int i=0; - i + * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; -public class CommunicationTypeExchange implements java.io.Serializable { +public class CommunicationTypeExchange implements java.io.Serializable { private org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType type; private java.util.Calendar createTime; @@ -28,185 +27,154 @@ public CommunicationTypeExchange() { } public CommunicationTypeExchange( - org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType type, - java.util.Calendar createTime, - javax.xml.namespace.QName service, - java.lang.String operation, - java.lang.Object in, - java.lang.Object out, - org.apache.www.ode.pmapi.types._2006._08._02.FaultType fault, - org.apache.www.ode.pmapi.types._2006._08._02.FailureType failure) { - this.type = type; - this.createTime = createTime; - this.service = service; - this.operation = operation; - this.in = in; - this.out = out; - this.fault = fault; - this.failure = failure; + org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType type, + java.util.Calendar createTime, + javax.xml.namespace.QName service, + java.lang.String operation, + java.lang.Object in, + java.lang.Object out, + org.apache.www.ode.pmapi.types._2006._08._02.FaultType fault, + org.apache.www.ode.pmapi.types._2006._08._02.FailureType failure) { + this.type = type; + this.createTime = createTime; + this.service = service; + this.operation = operation; + this.in = in; + this.out = out; + this.fault = fault; + this.failure = failure; } - /** * Gets the type value for this CommunicationTypeExchange. - * + * * @return type */ public org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType getType() { return type; } - /** * Sets the type value for this CommunicationTypeExchange. - * - * @param type */ public void setType(org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType type) { this.type = type; } - /** * Gets the createTime value for this CommunicationTypeExchange. - * + * * @return createTime */ public java.util.Calendar getCreateTime() { return createTime; } - /** * Sets the createTime value for this CommunicationTypeExchange. - * - * @param createTime */ public void setCreateTime(java.util.Calendar createTime) { this.createTime = createTime; } - /** * Gets the service value for this CommunicationTypeExchange. - * + * * @return service */ public javax.xml.namespace.QName getService() { return service; } - /** * Sets the service value for this CommunicationTypeExchange. - * - * @param service */ public void setService(javax.xml.namespace.QName service) { this.service = service; } - /** * Gets the operation value for this CommunicationTypeExchange. - * + * * @return operation */ public java.lang.String getOperation() { return operation; } - /** * Sets the operation value for this CommunicationTypeExchange. - * - * @param operation */ public void setOperation(java.lang.String operation) { this.operation = operation; } - /** * Gets the in value for this CommunicationTypeExchange. - * + * * @return in */ public java.lang.Object getIn() { return in; } - /** * Sets the in value for this CommunicationTypeExchange. - * - * @param in */ public void setIn(java.lang.Object in) { this.in = in; } - /** * Gets the out value for this CommunicationTypeExchange. - * + * * @return out */ public java.lang.Object getOut() { return out; } - /** * Sets the out value for this CommunicationTypeExchange. - * - * @param out */ public void setOut(java.lang.Object out) { this.out = out; } - /** * Gets the fault value for this CommunicationTypeExchange. - * + * * @return fault */ public org.apache.www.ode.pmapi.types._2006._08._02.FaultType getFault() { return fault; } - /** * Sets the fault value for this CommunicationTypeExchange. - * - * @param fault */ public void setFault(org.apache.www.ode.pmapi.types._2006._08._02.FaultType fault) { this.fault = fault; } - /** * Gets the failure value for this CommunicationTypeExchange. - * + * * @return failure */ public org.apache.www.ode.pmapi.types._2006._08._02.FailureType getFailure() { return failure; } - /** * Sets the failure value for this CommunicationTypeExchange. - * - * @param failure */ public void setFailure(org.apache.www.ode.pmapi.types._2006._08._02.FailureType failure) { this.failure = failure; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof CommunicationTypeExchange)) return false; CommunicationTypeExchange other = (CommunicationTypeExchange) obj; @@ -217,36 +185,37 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.type==null && other.getType()==null) || - (this.type!=null && - this.type.equals(other.getType()))) && - ((this.createTime==null && other.getCreateTime()==null) || - (this.createTime!=null && - this.createTime.equals(other.getCreateTime()))) && - ((this.service==null && other.getService()==null) || - (this.service!=null && - this.service.equals(other.getService()))) && - ((this.operation==null && other.getOperation()==null) || - (this.operation!=null && - this.operation.equals(other.getOperation()))) && - ((this.in==null && other.getIn()==null) || - (this.in!=null && - this.in.equals(other.getIn()))) && - ((this.out==null && other.getOut()==null) || - (this.out!=null && - this.out.equals(other.getOut()))) && - ((this.fault==null && other.getFault()==null) || - (this.fault!=null && - this.fault.equals(other.getFault()))) && - ((this.failure==null && other.getFailure()==null) || - (this.failure!=null && - this.failure.equals(other.getFailure()))); + _equals = true && + ((this.type == null && other.getType() == null) || + (this.type != null && + this.type.equals(other.getType()))) && + ((this.createTime == null && other.getCreateTime() == null) || + (this.createTime != null && + this.createTime.equals(other.getCreateTime()))) && + ((this.service == null && other.getService() == null) || + (this.service != null && + this.service.equals(other.getService()))) && + ((this.operation == null && other.getOperation() == null) || + (this.operation != null && + this.operation.equals(other.getOperation()))) && + ((this.in == null && other.getIn() == null) || + (this.in != null && + this.in.equals(other.getIn()))) && + ((this.out == null && other.getOut() == null) || + (this.out != null && + this.out.equals(other.getOut()))) && + ((this.fault == null && other.getFault() == null) || + (this.fault != null && + this.fault.equals(other.getFault()))) && + ((this.failure == null && other.getFailure() == null) || + (this.failure != null && + this.failure.equals(other.getFailure()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -351,24 +320,23 @@ public static org.apache.axis.description.TypeDesc getTypeDesc() { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationTypeServiceConfig.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationTypeServiceConfig.java new file mode 100644 index 000000000..5e256f7e3 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationTypeServiceConfig.java @@ -0,0 +1,147 @@ +/** + * CommunicationTypeServiceConfig.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class CommunicationTypeServiceConfig implements java.io.Serializable { + private javax.xml.namespace.QName service; + + private org.apache.www.ode.pmapi.types._2006._08._02.ReplayType replayType; + + public CommunicationTypeServiceConfig() { + } + + public CommunicationTypeServiceConfig( + javax.xml.namespace.QName service, + org.apache.www.ode.pmapi.types._2006._08._02.ReplayType replayType) { + this.service = service; + this.replayType = replayType; + } + + /** + * Gets the service value for this CommunicationTypeServiceConfig. + * + * @return service + */ + public javax.xml.namespace.QName getService() { + return service; + } + + /** + * Sets the service value for this CommunicationTypeServiceConfig. + */ + public void setService(javax.xml.namespace.QName service) { + this.service = service; + } + + /** + * Gets the replayType value for this CommunicationTypeServiceConfig. + * + * @return replayType + */ + public org.apache.www.ode.pmapi.types._2006._08._02.ReplayType getReplayType() { + return replayType; + } + + /** + * Sets the replayType value for this CommunicationTypeServiceConfig. + */ + public void setReplayType(org.apache.www.ode.pmapi.types._2006._08._02.ReplayType replayType) { + this.replayType = replayType; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CommunicationTypeServiceConfig)) return false; + CommunicationTypeServiceConfig other = (CommunicationTypeServiceConfig) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.service == null && other.getService() == null) || + (this.service != null && + this.service.equals(other.getService()))) && + ((this.replayType == null && other.getReplayType() == null) || + (this.replayType != null && + this.replayType.equals(other.getReplayType()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getService() != null) { + _hashCode += getService().hashCode(); + } + if (getReplayType() != null) { + _hashCode += getReplayType().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CommunicationTypeServiceConfig.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>serviceConfig")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("service"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "service")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("replayType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "replayType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayType")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ExchangeType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ExchangeType.java new file mode 100644 index 000000000..a017b08f6 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ExchangeType.java @@ -0,0 +1,89 @@ +/** + * ExchangeType.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class ExchangeType implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected ExchangeType(java.lang.String value) { + _value_ = value; + _table_.put(_value_, this); + } + + public static final java.lang.String _M = "M"; + public static final java.lang.String _P = "P"; + public static final ExchangeType M = new ExchangeType(_M); + public static final ExchangeType P = new ExchangeType(_P); + + public java.lang.String getValue() { + return _value_; + } + + public static ExchangeType fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + ExchangeType enumeration = (ExchangeType) + _table_.get(value); + if (enumeration == null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + + public static ExchangeType fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + + public boolean equals(java.lang.Object obj) { + return (obj == this); + } + + public int hashCode() { + return toString().hashCode(); + } + + public java.lang.String toString() { + return _value_; + } + + public java.lang.Object readResolve() throws java.io.ObjectStreamException { + return fromValue(_value_); + } + + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumSerializer( + _javaType, _xmlType); + } + + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumDeserializer( + _javaType, _xmlType); + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ExchangeType.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ExchangeType")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/FailureType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/FailureType.java new file mode 100644 index 000000000..4257178fe --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/FailureType.java @@ -0,0 +1,115 @@ +/** + * FailureType.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class FailureType implements java.io.Serializable { + private java.lang.String explanation; + + public FailureType() { + } + + public FailureType( + java.lang.String explanation) { + this.explanation = explanation; + } + + /** + * Gets the explanation value for this FailureType. + * + * @return explanation + */ + public java.lang.String getExplanation() { + return explanation; + } + + /** + * Sets the explanation value for this FailureType. + */ + public void setExplanation(java.lang.String explanation) { + this.explanation = explanation; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof FailureType)) return false; + FailureType other = (FailureType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.explanation == null && other.getExplanation() == null) || + (this.explanation != null && + this.explanation.equals(other.getExplanation()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getExplanation() != null) { + _hashCode += getExplanation().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(FailureType.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FailureType")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("explanation"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "explanation")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/FaultType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/FaultType.java new file mode 100644 index 000000000..cee258a85 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/FaultType.java @@ -0,0 +1,179 @@ +/** + * FaultType.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class FaultType implements java.io.Serializable { + private javax.xml.namespace.QName type; + + private java.lang.String explanation; + + private java.lang.Object message; + + public FaultType() { + } + + public FaultType( + javax.xml.namespace.QName type, + java.lang.String explanation, + java.lang.Object message) { + this.type = type; + this.explanation = explanation; + this.message = message; + } + + /** + * Gets the type value for this FaultType. + * + * @return type + */ + public javax.xml.namespace.QName getType() { + return type; + } + + /** + * Sets the type value for this FaultType. + */ + public void setType(javax.xml.namespace.QName type) { + this.type = type; + } + + /** + * Gets the explanation value for this FaultType. + * + * @return explanation + */ + public java.lang.String getExplanation() { + return explanation; + } + + /** + * Sets the explanation value for this FaultType. + */ + public void setExplanation(java.lang.String explanation) { + this.explanation = explanation; + } + + /** + * Gets the message value for this FaultType. + * + * @return message + */ + public java.lang.Object getMessage() { + return message; + } + + /** + * Sets the message value for this FaultType. + */ + public void setMessage(java.lang.Object message) { + this.message = message; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof FaultType)) return false; + FaultType other = (FaultType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.type == null && other.getType() == null) || + (this.type != null && + this.type.equals(other.getType()))) && + ((this.explanation == null && other.getExplanation() == null) || + (this.explanation != null && + this.explanation.equals(other.getExplanation()))) && + ((this.message == null && other.getMessage() == null) || + (this.message != null && + this.message.equals(other.getMessage()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getExplanation() != null) { + _hashCode += getExplanation().hashCode(); + } + if (getMessage() != null) { + _hashCode += getMessage().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(FaultType.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FaultType")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("type"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "type")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("explanation"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "explanation")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "message")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyType")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequest.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequest.java similarity index 75% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequest.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequest.java index a120bba1f..ad1102370 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequest.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequest.java @@ -1,13 +1,12 @@ /** * MockQueryRequest.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; -public class MockQueryRequest implements java.io.Serializable { +public class MockQueryRequest implements java.io.Serializable { private java.util.Calendar createTime; private javax.xml.namespace.QName service; @@ -22,119 +21,100 @@ public MockQueryRequest() { } public MockQueryRequest( - java.util.Calendar createTime, - javax.xml.namespace.QName service, - java.lang.String operation, - java.lang.Object in, - org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequestPattern pattern) { - this.createTime = createTime; - this.service = service; - this.operation = operation; - this.in = in; - this.pattern = pattern; + java.util.Calendar createTime, + javax.xml.namespace.QName service, + java.lang.String operation, + java.lang.Object in, + org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequestPattern pattern) { + this.createTime = createTime; + this.service = service; + this.operation = operation; + this.in = in; + this.pattern = pattern; } - /** * Gets the createTime value for this MockQueryRequest. - * + * * @return createTime */ public java.util.Calendar getCreateTime() { return createTime; } - /** * Sets the createTime value for this MockQueryRequest. - * - * @param createTime */ public void setCreateTime(java.util.Calendar createTime) { this.createTime = createTime; } - /** * Gets the service value for this MockQueryRequest. - * + * * @return service */ public javax.xml.namespace.QName getService() { return service; } - /** * Sets the service value for this MockQueryRequest. - * - * @param service */ public void setService(javax.xml.namespace.QName service) { this.service = service; } - /** * Gets the operation value for this MockQueryRequest. - * + * * @return operation */ public java.lang.String getOperation() { return operation; } - /** * Sets the operation value for this MockQueryRequest. - * - * @param operation */ public void setOperation(java.lang.String operation) { this.operation = operation; } - /** * Gets the in value for this MockQueryRequest. - * + * * @return in */ public java.lang.Object getIn() { return in; } - /** * Sets the in value for this MockQueryRequest. - * - * @param in */ public void setIn(java.lang.Object in) { this.in = in; } - /** * Gets the pattern value for this MockQueryRequest. - * + * * @return pattern */ public org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequestPattern getPattern() { return pattern; } - /** * Sets the pattern value for this MockQueryRequest. - * - * @param pattern */ public void setPattern(org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequestPattern pattern) { this.pattern = pattern; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof MockQueryRequest)) return false; MockQueryRequest other = (MockQueryRequest) obj; @@ -145,27 +125,28 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.createTime==null && other.getCreateTime()==null) || - (this.createTime!=null && - this.createTime.equals(other.getCreateTime()))) && - ((this.service==null && other.getService()==null) || - (this.service!=null && - this.service.equals(other.getService()))) && - ((this.operation==null && other.getOperation()==null) || - (this.operation!=null && - this.operation.equals(other.getOperation()))) && - ((this.in==null && other.getIn()==null) || - (this.in!=null && - this.in.equals(other.getIn()))) && - ((this.pattern==null && other.getPattern()==null) || - (this.pattern!=null && - this.pattern.equals(other.getPattern()))); + _equals = true && + ((this.createTime == null && other.getCreateTime() == null) || + (this.createTime != null && + this.createTime.equals(other.getCreateTime()))) && + ((this.service == null && other.getService() == null) || + (this.service != null && + this.service.equals(other.getService()))) && + ((this.operation == null && other.getOperation() == null) || + (this.operation != null && + this.operation.equals(other.getOperation()))) && + ((this.in == null && other.getIn() == null) || + (this.in != null && + this.in.equals(other.getIn()))) && + ((this.pattern == null && other.getPattern() == null) || + (this.pattern != null && + this.pattern.equals(other.getPattern()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -240,24 +221,23 @@ public static org.apache.axis.description.TypeDesc getTypeDesc() { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequestPattern.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequestPattern.java new file mode 100644 index 000000000..07acb7f7e --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequestPattern.java @@ -0,0 +1,89 @@ +/** + * MockQueryRequestPattern.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class MockQueryRequestPattern implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected MockQueryRequestPattern(java.lang.String value) { + _value_ = value; + _table_.put(_value_, this); + } + + public static final java.lang.String _IN_ONLY = "IN_ONLY"; + public static final java.lang.String _IN_OUT = "IN_OUT"; + public static final MockQueryRequestPattern IN_ONLY = new MockQueryRequestPattern(_IN_ONLY); + public static final MockQueryRequestPattern IN_OUT = new MockQueryRequestPattern(_IN_OUT); + + public java.lang.String getValue() { + return _value_; + } + + public static MockQueryRequestPattern fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + MockQueryRequestPattern enumeration = (MockQueryRequestPattern) + _table_.get(value); + if (enumeration == null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + + public static MockQueryRequestPattern fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + + public boolean equals(java.lang.Object obj) { + return (obj == this); + } + + public int hashCode() { + return toString().hashCode(); + } + + public java.lang.String toString() { + return _value_; + } + + public java.lang.Object readResolve() throws java.io.ObjectStreamException { + return fromValue(_value_); + } + + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumSerializer( + _javaType, _xmlType); + } + + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumDeserializer( + _javaType, _xmlType); + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(MockQueryRequestPattern.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>mockQueryRequest>pattern")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/Replay.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/Replay.java new file mode 100644 index 000000000..a9c89aef1 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/Replay.java @@ -0,0 +1,233 @@ +/** + * Replay.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class Replay implements java.io.Serializable { + private long[] upgradeInstance; + + private long[] replaceInstance; + + private org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] restoreInstance; + + public Replay() { + } + + public Replay( + long[] upgradeInstance, + long[] replaceInstance, + org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] restoreInstance) { + this.upgradeInstance = upgradeInstance; + this.replaceInstance = replaceInstance; + this.restoreInstance = restoreInstance; + } + + /** + * Gets the upgradeInstance value for this Replay. + * + * @return upgradeInstance + */ + public long[] getUpgradeInstance() { + return upgradeInstance; + } + + /** + * Sets the upgradeInstance value for this Replay. + */ + public void setUpgradeInstance(long[] upgradeInstance) { + this.upgradeInstance = upgradeInstance; + } + + public long getUpgradeInstance(int i) { + return this.upgradeInstance[i]; + } + + public void setUpgradeInstance(int i, long _value) { + this.upgradeInstance[i] = _value; + } + + /** + * Gets the replaceInstance value for this Replay. + * + * @return replaceInstance + */ + public long[] getReplaceInstance() { + return replaceInstance; + } + + /** + * Sets the replaceInstance value for this Replay. + */ + public void setReplaceInstance(long[] replaceInstance) { + this.replaceInstance = replaceInstance; + } + + public long getReplaceInstance(int i) { + return this.replaceInstance[i]; + } + + public void setReplaceInstance(int i, long _value) { + this.replaceInstance[i] = _value; + } + + /** + * Gets the restoreInstance value for this Replay. + * + * @return restoreInstance + */ + public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] getRestoreInstance() { + return restoreInstance; + } + + /** + * Sets the restoreInstance value for this Replay. + */ + public void setRestoreInstance(org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] restoreInstance) { + this.restoreInstance = restoreInstance; + } + + public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType getRestoreInstance(int i) { + return this.restoreInstance[i]; + } + + public void setRestoreInstance(int i, org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType _value) { + this.restoreInstance[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Replay)) return false; + Replay other = (Replay) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.upgradeInstance == null && other.getUpgradeInstance() == null) || + (this.upgradeInstance != null && + java.util.Arrays.equals(this.upgradeInstance, other.getUpgradeInstance()))) && + ((this.replaceInstance == null && other.getReplaceInstance() == null) || + (this.replaceInstance != null && + java.util.Arrays.equals(this.replaceInstance, other.getReplaceInstance()))) && + ((this.restoreInstance == null && other.getRestoreInstance() == null) || + (this.restoreInstance != null && + java.util.Arrays.equals(this.restoreInstance, other.getRestoreInstance()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getUpgradeInstance() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getUpgradeInstance()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getUpgradeInstance(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getReplaceInstance() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getReplaceInstance()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getReplaceInstance(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getRestoreInstance() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getRestoreInstance()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getRestoreInstance(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Replay.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "Replay")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("upgradeInstance"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "upgradeInstance")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("replaceInstance"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "replaceInstance")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("restoreInstance"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoreInstance")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ReplayType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ReplayType.java new file mode 100644 index 000000000..25ff63dcb --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ReplayType.java @@ -0,0 +1,182 @@ +/** + * ReplayType.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class ReplayType implements java.io.Serializable { + private java.lang.String mock; + + private java.lang.String mockQuery; + + private java.lang.String live; + + public ReplayType() { + } + + public ReplayType( + java.lang.String mock, + java.lang.String mockQuery, + java.lang.String live) { + this.mock = mock; + this.mockQuery = mockQuery; + this.live = live; + } + + /** + * Gets the mock value for this ReplayType. + * + * @return mock + */ + public java.lang.String getMock() { + return mock; + } + + /** + * Sets the mock value for this ReplayType. + */ + public void setMock(java.lang.String mock) { + this.mock = mock; + } + + /** + * Gets the mockQuery value for this ReplayType. + * + * @return mockQuery + */ + public java.lang.String getMockQuery() { + return mockQuery; + } + + /** + * Sets the mockQuery value for this ReplayType. + */ + public void setMockQuery(java.lang.String mockQuery) { + this.mockQuery = mockQuery; + } + + /** + * Gets the live value for this ReplayType. + * + * @return live + */ + public java.lang.String getLive() { + return live; + } + + /** + * Sets the live value for this ReplayType. + */ + public void setLive(java.lang.String live) { + this.live = live; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ReplayType)) return false; + ReplayType other = (ReplayType) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.mock == null && other.getMock() == null) || + (this.mock != null && + this.mock.equals(other.getMock()))) && + ((this.mockQuery == null && other.getMockQuery() == null) || + (this.mockQuery != null && + this.mockQuery.equals(other.getMockQuery()))) && + ((this.live == null && other.getLive() == null) || + (this.live != null && + this.live.equals(other.getLive()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getMock() != null) { + _hashCode += getMock().hashCode(); + } + if (getMockQuery() != null) { + _hashCode += getMockQuery().hashCode(); + } + if (getLive() != null) { + _hashCode += getLive().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ReplayType.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayType")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("mock"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "mock")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anySimpleType")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("mockQuery"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "mockQuery")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("live"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "live")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anySimpleType")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/ResponseType.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ResponseType.java similarity index 75% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/ResponseType.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ResponseType.java index bb153da5c..14c82bcdf 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/ResponseType.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/ResponseType.java @@ -1,13 +1,12 @@ /** * ResponseType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; -public class ResponseType implements java.io.Serializable { +public class ResponseType implements java.io.Serializable { private java.lang.Object out; private org.apache.www.ode.pmapi.types._2006._08._02.FaultType fault; @@ -18,75 +17,64 @@ public ResponseType() { } public ResponseType( - java.lang.Object out, - org.apache.www.ode.pmapi.types._2006._08._02.FaultType fault, - org.apache.www.ode.pmapi.types._2006._08._02.FailureType failure) { - this.out = out; - this.fault = fault; - this.failure = failure; + java.lang.Object out, + org.apache.www.ode.pmapi.types._2006._08._02.FaultType fault, + org.apache.www.ode.pmapi.types._2006._08._02.FailureType failure) { + this.out = out; + this.fault = fault; + this.failure = failure; } - /** * Gets the out value for this ResponseType. - * + * * @return out */ public java.lang.Object getOut() { return out; } - /** * Sets the out value for this ResponseType. - * - * @param out */ public void setOut(java.lang.Object out) { this.out = out; } - /** * Gets the fault value for this ResponseType. - * + * * @return fault */ public org.apache.www.ode.pmapi.types._2006._08._02.FaultType getFault() { return fault; } - /** * Sets the fault value for this ResponseType. - * - * @param fault */ public void setFault(org.apache.www.ode.pmapi.types._2006._08._02.FaultType fault) { this.fault = fault; } - /** * Gets the failure value for this ResponseType. - * + * * @return failure */ public org.apache.www.ode.pmapi.types._2006._08._02.FailureType getFailure() { return failure; } - /** * Sets the failure value for this ResponseType. - * - * @param failure */ public void setFailure(org.apache.www.ode.pmapi.types._2006._08._02.FailureType failure) { this.failure = failure; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof ResponseType)) return false; ResponseType other = (ResponseType) obj; @@ -97,21 +85,22 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.out==null && other.getOut()==null) || - (this.out!=null && - this.out.equals(other.getOut()))) && - ((this.fault==null && other.getFault()==null) || - (this.fault!=null && - this.fault.equals(other.getFault()))) && - ((this.failure==null && other.getFailure()==null) || - (this.failure!=null && - this.failure.equals(other.getFailure()))); + _equals = true && + ((this.out == null && other.getOut() == null) || + (this.out != null && + this.out.equals(other.getOut()))) && + ((this.fault == null && other.getFault() == null) || + (this.fault != null && + this.fault.equals(other.getFault()))) && + ((this.failure == null && other.getFailure() == null) || + (this.failure != null && + this.failure.equals(other.getFailure()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -171,24 +160,23 @@ public static org.apache.axis.description.TypeDesc getTypeDesc() { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityExtInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityExtInfo.java new file mode 100644 index 000000000..ffa81dd11 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityExtInfo.java @@ -0,0 +1,152 @@ +/** + * TActivityExtInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Information about an activity. + */ +public class TActivityExtInfo implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { + private java.lang.String aiid; + + private org.apache.axis.message.MessageElement[] _any; + + public TActivityExtInfo() { + } + + public TActivityExtInfo( + java.lang.String aiid, + org.apache.axis.message.MessageElement[] _any) { + this.aiid = aiid; + this._any = _any; + } + + /** + * Gets the aiid value for this TActivityExtInfo. + * + * @return aiid + */ + public java.lang.String getAiid() { + return aiid; + } + + /** + * Sets the aiid value for this TActivityExtInfo. + */ + public void setAiid(java.lang.String aiid) { + this.aiid = aiid; + } + + /** + * Gets the _any value for this TActivityExtInfo. + * + * @return _any + */ + public org.apache.axis.message.MessageElement[] get_any() { + return _any; + } + + /** + * Sets the _any value for this TActivityExtInfo. + */ + public void set_any(org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TActivityExtInfo)) return false; + TActivityExtInfo other = (TActivityExtInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.aiid == null && other.getAiid() == null) || + (this.aiid != null && + this.aiid.equals(other.getAiid()))) && + ((this._any == null && other.get_any() == null) || + (this._any != null && + java.util.Arrays.equals(this._any, other.get_any()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAiid() != null) { + _hashCode += getAiid().hashCode(); + } + if (get_any() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(get_any()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(get_any(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TActivityExtInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityExtInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aiid"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "aiid")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityInfo.java new file mode 100644 index 000000000..73531c074 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityInfo.java @@ -0,0 +1,397 @@ +/** + * TActivityInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Information about an activity. + */ +public class TActivityInfo implements java.io.Serializable { + private java.lang.String name; + + private java.lang.String type; + + private java.lang.String aiid; + + private org.apache.www.ode.pmapi.types._2006._08._02.TActivityStatus status; + + /* ID for scope in which this activity is executing. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef scope; + + /* The date/time when the activity was enabled. */ + private java.util.Calendar dtEnabled; + + /* The date/time when the activity was + * started. */ + private java.util.Calendar dtStarted; + + /* The date/time when the activity was + * completed. */ + private java.util.Calendar dtCompleted; + + /* Indicates activity is in the failure state and requires recovery. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TFailureInfo failure; + + public TActivityInfo() { + } + + public TActivityInfo( + java.lang.String name, + java.lang.String type, + java.lang.String aiid, + org.apache.www.ode.pmapi.types._2006._08._02.TActivityStatus status, + org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef scope, + java.util.Calendar dtEnabled, + java.util.Calendar dtStarted, + java.util.Calendar dtCompleted, + org.apache.www.ode.pmapi.types._2006._08._02.TFailureInfo failure) { + this.name = name; + this.type = type; + this.aiid = aiid; + this.status = status; + this.scope = scope; + this.dtEnabled = dtEnabled; + this.dtStarted = dtStarted; + this.dtCompleted = dtCompleted; + this.failure = failure; + } + + /** + * Gets the name value for this TActivityInfo. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + /** + * Sets the name value for this TActivityInfo. + */ + public void setName(java.lang.String name) { + this.name = name; + } + + /** + * Gets the type value for this TActivityInfo. + * + * @return type + */ + public java.lang.String getType() { + return type; + } + + /** + * Sets the type value for this TActivityInfo. + */ + public void setType(java.lang.String type) { + this.type = type; + } + + /** + * Gets the aiid value for this TActivityInfo. + * + * @return aiid + */ + public java.lang.String getAiid() { + return aiid; + } + + /** + * Sets the aiid value for this TActivityInfo. + */ + public void setAiid(java.lang.String aiid) { + this.aiid = aiid; + } + + /** + * Gets the status value for this TActivityInfo. + * + * @return status + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TActivityStatus getStatus() { + return status; + } + + /** + * Sets the status value for this TActivityInfo. + */ + public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TActivityStatus status) { + this.status = status; + } + + /** + * Gets the scope value for this TActivityInfo. + * + * @return scope * ID for scope in which this activity is executing. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef getScope() { + return scope; + } + + /** + * Sets the scope value for this TActivityInfo. + * + * @param scope * ID for scope in which this activity is executing. + */ + public void setScope(org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef scope) { + this.scope = scope; + } + + /** + * Gets the dtEnabled value for this TActivityInfo. + * + * @return dtEnabled * The date/time when the activity was enabled. + */ + public java.util.Calendar getDtEnabled() { + return dtEnabled; + } + + /** + * Sets the dtEnabled value for this TActivityInfo. + * + * @param dtEnabled * The date/time when the activity was enabled. + */ + public void setDtEnabled(java.util.Calendar dtEnabled) { + this.dtEnabled = dtEnabled; + } + + /** + * Gets the dtStarted value for this TActivityInfo. + * + * @return dtStarted * The date/time when the activity was started. + */ + public java.util.Calendar getDtStarted() { + return dtStarted; + } + + /** + * Sets the dtStarted value for this TActivityInfo. + * + * @param dtStarted * The date/time when the activity was started. + */ + public void setDtStarted(java.util.Calendar dtStarted) { + this.dtStarted = dtStarted; + } + + /** + * Gets the dtCompleted value for this TActivityInfo. + * + * @return dtCompleted * The date/time when the activity was completed. + */ + public java.util.Calendar getDtCompleted() { + return dtCompleted; + } + + /** + * Sets the dtCompleted value for this TActivityInfo. + * + * @param dtCompleted * The date/time when the activity was completed. + */ + public void setDtCompleted(java.util.Calendar dtCompleted) { + this.dtCompleted = dtCompleted; + } + + /** + * Gets the failure value for this TActivityInfo. + * + * @return failure * Indicates activity is in the failure state and requires recovery. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TFailureInfo getFailure() { + return failure; + } + + /** + * Sets the failure value for this TActivityInfo. + * + * @param failure * Indicates activity is in the failure state and requires recovery. + */ + public void setFailure(org.apache.www.ode.pmapi.types._2006._08._02.TFailureInfo failure) { + this.failure = failure; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TActivityInfo)) return false; + TActivityInfo other = (TActivityInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))) && + ((this.type == null && other.getType() == null) || + (this.type != null && + this.type.equals(other.getType()))) && + ((this.aiid == null && other.getAiid() == null) || + (this.aiid != null && + this.aiid.equals(other.getAiid()))) && + ((this.status == null && other.getStatus() == null) || + (this.status != null && + this.status.equals(other.getStatus()))) && + ((this.scope == null && other.getScope() == null) || + (this.scope != null && + this.scope.equals(other.getScope()))) && + ((this.dtEnabled == null && other.getDtEnabled() == null) || + (this.dtEnabled != null && + this.dtEnabled.equals(other.getDtEnabled()))) && + ((this.dtStarted == null && other.getDtStarted() == null) || + (this.dtStarted != null && + this.dtStarted.equals(other.getDtStarted()))) && + ((this.dtCompleted == null && other.getDtCompleted() == null) || + (this.dtCompleted != null && + this.dtCompleted.equals(other.getDtCompleted()))) && + ((this.failure == null && other.getFailure() == null) || + (this.failure != null && + this.failure.equals(other.getFailure()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getAiid() != null) { + _hashCode += getAiid().hashCode(); + } + if (getStatus() != null) { + _hashCode += getStatus().hashCode(); + } + if (getScope() != null) { + _hashCode += getScope().hashCode(); + } + if (getDtEnabled() != null) { + _hashCode += getDtEnabled().hashCode(); + } + if (getDtStarted() != null) { + _hashCode += getDtStarted().hashCode(); + } + if (getDtCompleted() != null) { + _hashCode += getDtCompleted().hashCode(); + } + if (getFailure() != null) { + _hashCode += getFailure().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TActivityInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("type"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "type")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aiid"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "aiid")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("status"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "status")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityStatus")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("scope"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "scope")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dtEnabled"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "dt-enabled")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dtStarted"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "dt-started")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dtCompleted"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "dt-completed")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("failure"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "failure")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailureInfo")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityStatus.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityStatus.java new file mode 100644 index 000000000..d262db797 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TActivityStatus.java @@ -0,0 +1,93 @@ +/** + * TActivityStatus.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TActivityStatus implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected TActivityStatus(java.lang.String value) { + _value_ = value; + _table_.put(_value_, this); + } + + public static final java.lang.String _ENABLED = "ENABLED"; + public static final java.lang.String _STARTED = "STARTED"; + public static final java.lang.String _COMPLETED = "COMPLETED"; + public static final java.lang.String _FAILURE = "FAILURE"; + public static final TActivityStatus ENABLED = new TActivityStatus(_ENABLED); + public static final TActivityStatus STARTED = new TActivityStatus(_STARTED); + public static final TActivityStatus COMPLETED = new TActivityStatus(_COMPLETED); + public static final TActivityStatus FAILURE = new TActivityStatus(_FAILURE); + + public java.lang.String getValue() { + return _value_; + } + + public static TActivityStatus fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + TActivityStatus enumeration = (TActivityStatus) + _table_.get(value); + if (enumeration == null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + + public static TActivityStatus fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + + public boolean equals(java.lang.Object obj) { + return (obj == this); + } + + public int hashCode() { + return toString().hashCode(); + } + + public java.lang.String toString() { + return _value_; + } + + public java.lang.Object readResolve() throws java.io.ObjectStreamException { + return fromValue(_value_); + } + + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumSerializer( + _javaType, _xmlType); + } + + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumDeserializer( + _javaType, _xmlType); + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TActivityStatus.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityStatus")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TCorrelationProperty.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TCorrelationProperty.java new file mode 100644 index 000000000..182ca5886 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TCorrelationProperty.java @@ -0,0 +1,210 @@ +/** + * TCorrelationProperty.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TCorrelationProperty implements java.io.Serializable, org.apache.axis.encoding.SimpleType, org.apache.axis.encoding.MixedContentType { + private java.lang.String _value; + + private org.apache.axis.message.MessageElement[] _any; // attribute + + private java.lang.String csetid; // attribute + + private javax.xml.namespace.QName propertyName; // attribute + + public TCorrelationProperty() { + } + + // Simple Types must have a String constructor + public TCorrelationProperty(java.lang.String _value) { + this._value = _value; + } + + // Simple Types must have a toString for serializing the value + public java.lang.String toString() { + return _value; + } + + /** + * Gets the _value value for this TCorrelationProperty. + * + * @return _value + */ + public java.lang.String get_value() { + return _value; + } + + /** + * Sets the _value value for this TCorrelationProperty. + */ + public void set_value(java.lang.String _value) { + this._value = _value; + } + + /** + * Gets the _any value for this TCorrelationProperty. + * + * @return _any + */ + public org.apache.axis.message.MessageElement[] get_any() { + return _any; + } + + /** + * Sets the _any value for this TCorrelationProperty. + */ + public void set_any(org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + /** + * Gets the csetid value for this TCorrelationProperty. + * + * @return csetid + */ + public java.lang.String getCsetid() { + return csetid; + } + + /** + * Sets the csetid value for this TCorrelationProperty. + */ + public void setCsetid(java.lang.String csetid) { + this.csetid = csetid; + } + + /** + * Gets the propertyName value for this TCorrelationProperty. + * + * @return propertyName + */ + public javax.xml.namespace.QName getPropertyName() { + return propertyName; + } + + /** + * Sets the propertyName value for this TCorrelationProperty. + */ + public void setPropertyName(javax.xml.namespace.QName propertyName) { + this.propertyName = propertyName; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TCorrelationProperty)) return false; + TCorrelationProperty other = (TCorrelationProperty) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this._value == null && other.get_value() == null) || + (this._value != null && + this._value.equals(other.get_value()))) && + ((this._any == null && other.get_any() == null) || + (this._any != null && + java.util.Arrays.equals(this._any, other.get_any()))) && + ((this.csetid == null && other.getCsetid() == null) || + (this.csetid != null && + this.csetid.equals(other.getCsetid()))) && + ((this.propertyName == null && other.getPropertyName() == null) || + (this.propertyName != null && + this.propertyName.equals(other.getPropertyName()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (get_value() != null) { + _hashCode += get_value().hashCode(); + } + if (get_any() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(get_any()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(get_any(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getCsetid() != null) { + _hashCode += getCsetid().hashCode(); + } + if (getPropertyName() != null) { + _hashCode += getPropertyName().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TCorrelationProperty.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty")); + org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("csetid"); + attrField.setXmlName(new javax.xml.namespace.QName("", "csetid")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("propertyName"); + attrField.setXmlName(new javax.xml.namespace.QName("", "propertyName")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); + typeDesc.addFieldDesc(attrField); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("_value"); + elemField.setXmlName(new javax.xml.namespace.QName("", "_value")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.SimpleSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.SimpleDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDefinitionInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDefinitionInfo.java new file mode 100644 index 000000000..23b1fc37d --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDefinitionInfo.java @@ -0,0 +1,122 @@ +/** + * TDefinitionInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Information about the process definition. + */ +public class TDefinitionInfo implements java.io.Serializable { + /* The qualified name of the BPEL + * process. */ + private javax.xml.namespace.QName processName; + + public TDefinitionInfo() { + } + + public TDefinitionInfo( + javax.xml.namespace.QName processName) { + this.processName = processName; + } + + /** + * Gets the processName value for this TDefinitionInfo. + * + * @return processName * The qualified name of the BPEL process. + */ + public javax.xml.namespace.QName getProcessName() { + return processName; + } + + /** + * Sets the processName value for this TDefinitionInfo. + * + * @param processName * The qualified name of the BPEL process. + */ + public void setProcessName(javax.xml.namespace.QName processName) { + this.processName = processName; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TDefinitionInfo)) return false; + TDefinitionInfo other = (TDefinitionInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.processName == null && other.getProcessName() == null) || + (this.processName != null && + this.processName.equals(other.getProcessName()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getProcessName() != null) { + _hashCode += getProcessName().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TDefinitionInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDefinitionInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("processName"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "process-name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDeploymentInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDeploymentInfo.java new file mode 100644 index 000000000..6ab49b3db --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDeploymentInfo.java @@ -0,0 +1,227 @@ +/** + * TDeploymentInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Information about a BPEL process deployment. + */ +public class TDeploymentInfo implements java.io.Serializable { + /* Deployment package the process was deployed into. */ + private java.lang.String _package; + + /* File name of BPEL document. */ + private java.lang.String document; + + /* Date the process was deployed. */ + private java.util.Calendar deployDate; + + /* The user that deployed this + * process. */ + private java.lang.String deployer; + + public TDeploymentInfo() { + } + + public TDeploymentInfo( + java.lang.String _package, + java.lang.String document, + java.util.Calendar deployDate, + java.lang.String deployer) { + this._package = _package; + this.document = document; + this.deployDate = deployDate; + this.deployer = deployer; + } + + /** + * Gets the _package value for this TDeploymentInfo. + * + * @return _package * Deployment package the process was deployed into. + */ + public java.lang.String get_package() { + return _package; + } + + /** + * Sets the _package value for this TDeploymentInfo. + * + * @param _package * Deployment package the process was deployed into. + */ + public void set_package(java.lang.String _package) { + this._package = _package; + } + + /** + * Gets the document value for this TDeploymentInfo. + * + * @return document * File name of BPEL document. + */ + public java.lang.String getDocument() { + return document; + } + + /** + * Sets the document value for this TDeploymentInfo. + * + * @param document * File name of BPEL document. + */ + public void setDocument(java.lang.String document) { + this.document = document; + } + + /** + * Gets the deployDate value for this TDeploymentInfo. + * + * @return deployDate * Date the process was deployed. + */ + public java.util.Calendar getDeployDate() { + return deployDate; + } + + /** + * Sets the deployDate value for this TDeploymentInfo. + * + * @param deployDate * Date the process was deployed. + */ + public void setDeployDate(java.util.Calendar deployDate) { + this.deployDate = deployDate; + } + + /** + * Gets the deployer value for this TDeploymentInfo. + * + * @return deployer * The user that deployed this process. + */ + public java.lang.String getDeployer() { + return deployer; + } + + /** + * Sets the deployer value for this TDeploymentInfo. + * + * @param deployer * The user that deployed this process. + */ + public void setDeployer(java.lang.String deployer) { + this.deployer = deployer; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TDeploymentInfo)) return false; + TDeploymentInfo other = (TDeploymentInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this._package == null && other.get_package() == null) || + (this._package != null && + this._package.equals(other.get_package()))) && + ((this.document == null && other.getDocument() == null) || + (this.document != null && + this.document.equals(other.getDocument()))) && + ((this.deployDate == null && other.getDeployDate() == null) || + (this.deployDate != null && + this.deployDate.equals(other.getDeployDate()))) && + ((this.deployer == null && other.getDeployer() == null) || + (this.deployer != null && + this.deployer.equals(other.getDeployer()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (get_package() != null) { + _hashCode += get_package().hashCode(); + } + if (getDocument() != null) { + _hashCode += getDocument().hashCode(); + } + if (getDeployDate() != null) { + _hashCode += getDeployDate().hashCode(); + } + if (getDeployer() != null) { + _hashCode += getDeployer().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TDeploymentInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDeploymentInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("_package"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "package")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("document"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "document")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("deployDate"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "deploy-date")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("deployer"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "deployer")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDocumentInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDocumentInfo.java new file mode 100644 index 000000000..19c98aa56 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TDocumentInfo.java @@ -0,0 +1,193 @@ +/** + * TDocumentInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Information about a document. + */ +public class TDocumentInfo implements java.io.Serializable { + /* Name of the document. */ + private java.lang.String name; + + /* Type of document (e.g. + * WSDL/BPEL/etc...). */ + private org.apache.axis.types.URI type; + + /* URL where the document can be + * retrieved. */ + private org.apache.axis.types.URI source; + + public TDocumentInfo() { + } + + public TDocumentInfo( + java.lang.String name, + org.apache.axis.types.URI type, + org.apache.axis.types.URI source) { + this.name = name; + this.type = type; + this.source = source; + } + + /** + * Gets the name value for this TDocumentInfo. + * + * @return name * Name of the document. + */ + public java.lang.String getName() { + return name; + } + + /** + * Sets the name value for this TDocumentInfo. + * + * @param name * Name of the document. + */ + public void setName(java.lang.String name) { + this.name = name; + } + + /** + * Gets the type value for this TDocumentInfo. + * + * @return type * Type of document (e.g. WSDL/BPEL/etc...). + */ + public org.apache.axis.types.URI getType() { + return type; + } + + /** + * Sets the type value for this TDocumentInfo. + * + * @param type * Type of document (e.g. WSDL/BPEL/etc...). + */ + public void setType(org.apache.axis.types.URI type) { + this.type = type; + } + + /** + * Gets the source value for this TDocumentInfo. + * + * @return source * URL where the document can be retrieved. + */ + public org.apache.axis.types.URI getSource() { + return source; + } + + /** + * Sets the source value for this TDocumentInfo. + * + * @param source * URL where the document can be retrieved. + */ + public void setSource(org.apache.axis.types.URI source) { + this.source = source; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TDocumentInfo)) return false; + TDocumentInfo other = (TDocumentInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))) && + ((this.type == null && other.getType() == null) || + (this.type != null && + this.type.equals(other.getType()))) && + ((this.source == null && other.getSource() == null) || + (this.source != null && + this.source.equals(other.getSource()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getSource() != null) { + _hashCode += getSource().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TDocumentInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("type"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "type")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyURI")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("source"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "source")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyURI")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEndpointReferencesEndpointRef.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEndpointReferencesEndpointRef.java new file mode 100644 index 000000000..a65ce3598 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEndpointReferencesEndpointRef.java @@ -0,0 +1,210 @@ +/** + * TEndpointReferencesEndpointRef.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TEndpointReferencesEndpointRef implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { + private org.apache.axis.message.MessageElement[] _any; + + private java.lang.String partnerLink; // attribute + + private java.lang.String partnerRole; // attribute + + private java.lang.String myRole; // attribute + + public TEndpointReferencesEndpointRef() { + } + + public TEndpointReferencesEndpointRef( + org.apache.axis.message.MessageElement[] _any, + java.lang.String partnerLink, + java.lang.String partnerRole, + java.lang.String myRole) { + this._any = _any; + this.partnerLink = partnerLink; + this.partnerRole = partnerRole; + this.myRole = myRole; + } + + /** + * Gets the _any value for this TEndpointReferencesEndpointRef. + * + * @return _any + */ + public org.apache.axis.message.MessageElement[] get_any() { + return _any; + } + + /** + * Sets the _any value for this TEndpointReferencesEndpointRef. + */ + public void set_any(org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + /** + * Gets the partnerLink value for this TEndpointReferencesEndpointRef. + * + * @return partnerLink + */ + public java.lang.String getPartnerLink() { + return partnerLink; + } + + /** + * Sets the partnerLink value for this TEndpointReferencesEndpointRef. + */ + public void setPartnerLink(java.lang.String partnerLink) { + this.partnerLink = partnerLink; + } + + /** + * Gets the partnerRole value for this TEndpointReferencesEndpointRef. + * + * @return partnerRole + */ + public java.lang.String getPartnerRole() { + return partnerRole; + } + + /** + * Sets the partnerRole value for this TEndpointReferencesEndpointRef. + */ + public void setPartnerRole(java.lang.String partnerRole) { + this.partnerRole = partnerRole; + } + + /** + * Gets the myRole value for this TEndpointReferencesEndpointRef. + * + * @return myRole + */ + public java.lang.String getMyRole() { + return myRole; + } + + /** + * Sets the myRole value for this TEndpointReferencesEndpointRef. + */ + public void setMyRole(java.lang.String myRole) { + this.myRole = myRole; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TEndpointReferencesEndpointRef)) return false; + TEndpointReferencesEndpointRef other = (TEndpointReferencesEndpointRef) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this._any == null && other.get_any() == null) || + (this._any != null && + java.util.Arrays.equals(this._any, other.get_any()))) && + ((this.partnerLink == null && other.getPartnerLink() == null) || + (this.partnerLink != null && + this.partnerLink.equals(other.getPartnerLink()))) && + ((this.partnerRole == null && other.getPartnerRole() == null) || + (this.partnerRole != null && + this.partnerRole.equals(other.getPartnerRole()))) && + ((this.myRole == null && other.getMyRole() == null) || + (this.myRole != null && + this.myRole.equals(other.getMyRole()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (get_any() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(get_any()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(get_any(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getPartnerLink() != null) { + _hashCode += getPartnerLink().hashCode(); + } + if (getPartnerRole() != null) { + _hashCode += getPartnerRole().hashCode(); + } + if (getMyRole() != null) { + _hashCode += getMyRole().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TEndpointReferencesEndpointRef.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref")); + org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("partnerLink"); + attrField.setXmlName(new javax.xml.namespace.QName("", "partner-link")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("partnerRole"); + attrField.setXmlName(new javax.xml.namespace.QName("", "partner-role")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("myRole"); + attrField.setXmlName(new javax.xml.namespace.QName("", "my-role")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEventInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEventInfo.java similarity index 75% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEventInfo.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEventInfo.java index 3ffd034ed..416efed12 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEventInfo.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TEventInfo.java @@ -1,13 +1,12 @@ /** * TEventInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; -public class TEventInfo implements java.io.Serializable { +public class TEventInfo implements java.io.Serializable { private java.lang.String name; private java.lang.String type; @@ -82,779 +81,640 @@ public TEventInfo() { } public TEventInfo( - java.lang.String name, - java.lang.String type, - int lineNumber, - java.util.Calendar timestamp, - javax.xml.namespace.QName processId, - javax.xml.namespace.QName processType, - java.lang.Long instanceId, - java.lang.Long scopeId, - java.lang.Long parentScopeId, - java.lang.String scopeName, - java.lang.Integer scopeDefinitionId, - java.lang.Long activityId, - java.lang.String activityName, - java.lang.String activityType, - java.lang.Integer activityDefinitionId, - java.lang.String activityFailureReason, - java.lang.String activityRecoveryAction, - java.lang.String variableName, - java.lang.String newValue, - javax.xml.namespace.QName portType, - java.lang.String operation, - java.lang.String correlationSet, - java.lang.String mexId, - java.lang.String correlationKey, - java.lang.String expression, - javax.xml.namespace.QName fault, - java.lang.Integer faultLineNumber, - java.lang.String explanation, - java.lang.String result, - java.lang.Long rootScopeId, - java.lang.Integer rootScopeDeclarationId, - java.lang.String partnerLinkName, - java.lang.Integer oldState, - java.lang.Integer newState, - java.lang.Boolean success) { - this.name = name; - this.type = type; - this.lineNumber = lineNumber; - this.timestamp = timestamp; - this.processId = processId; - this.processType = processType; - this.instanceId = instanceId; - this.scopeId = scopeId; - this.parentScopeId = parentScopeId; - this.scopeName = scopeName; - this.scopeDefinitionId = scopeDefinitionId; - this.activityId = activityId; - this.activityName = activityName; - this.activityType = activityType; - this.activityDefinitionId = activityDefinitionId; - this.activityFailureReason = activityFailureReason; - this.activityRecoveryAction = activityRecoveryAction; - this.variableName = variableName; - this.newValue = newValue; - this.portType = portType; - this.operation = operation; - this.correlationSet = correlationSet; - this.mexId = mexId; - this.correlationKey = correlationKey; - this.expression = expression; - this.fault = fault; - this.faultLineNumber = faultLineNumber; - this.explanation = explanation; - this.result = result; - this.rootScopeId = rootScopeId; - this.rootScopeDeclarationId = rootScopeDeclarationId; - this.partnerLinkName = partnerLinkName; - this.oldState = oldState; - this.newState = newState; - this.success = success; + java.lang.String name, + java.lang.String type, + int lineNumber, + java.util.Calendar timestamp, + javax.xml.namespace.QName processId, + javax.xml.namespace.QName processType, + java.lang.Long instanceId, + java.lang.Long scopeId, + java.lang.Long parentScopeId, + java.lang.String scopeName, + java.lang.Integer scopeDefinitionId, + java.lang.Long activityId, + java.lang.String activityName, + java.lang.String activityType, + java.lang.Integer activityDefinitionId, + java.lang.String activityFailureReason, + java.lang.String activityRecoveryAction, + java.lang.String variableName, + java.lang.String newValue, + javax.xml.namespace.QName portType, + java.lang.String operation, + java.lang.String correlationSet, + java.lang.String mexId, + java.lang.String correlationKey, + java.lang.String expression, + javax.xml.namespace.QName fault, + java.lang.Integer faultLineNumber, + java.lang.String explanation, + java.lang.String result, + java.lang.Long rootScopeId, + java.lang.Integer rootScopeDeclarationId, + java.lang.String partnerLinkName, + java.lang.Integer oldState, + java.lang.Integer newState, + java.lang.Boolean success) { + this.name = name; + this.type = type; + this.lineNumber = lineNumber; + this.timestamp = timestamp; + this.processId = processId; + this.processType = processType; + this.instanceId = instanceId; + this.scopeId = scopeId; + this.parentScopeId = parentScopeId; + this.scopeName = scopeName; + this.scopeDefinitionId = scopeDefinitionId; + this.activityId = activityId; + this.activityName = activityName; + this.activityType = activityType; + this.activityDefinitionId = activityDefinitionId; + this.activityFailureReason = activityFailureReason; + this.activityRecoveryAction = activityRecoveryAction; + this.variableName = variableName; + this.newValue = newValue; + this.portType = portType; + this.operation = operation; + this.correlationSet = correlationSet; + this.mexId = mexId; + this.correlationKey = correlationKey; + this.expression = expression; + this.fault = fault; + this.faultLineNumber = faultLineNumber; + this.explanation = explanation; + this.result = result; + this.rootScopeId = rootScopeId; + this.rootScopeDeclarationId = rootScopeDeclarationId; + this.partnerLinkName = partnerLinkName; + this.oldState = oldState; + this.newState = newState; + this.success = success; } - /** * Gets the name value for this TEventInfo. - * + * * @return name */ public java.lang.String getName() { return name; } - /** * Sets the name value for this TEventInfo. - * - * @param name */ public void setName(java.lang.String name) { this.name = name; } - /** * Gets the type value for this TEventInfo. - * + * * @return type */ public java.lang.String getType() { return type; } - /** * Sets the type value for this TEventInfo. - * - * @param type */ public void setType(java.lang.String type) { this.type = type; } - /** * Gets the lineNumber value for this TEventInfo. - * + * * @return lineNumber */ public int getLineNumber() { return lineNumber; } - /** * Sets the lineNumber value for this TEventInfo. - * - * @param lineNumber */ public void setLineNumber(int lineNumber) { this.lineNumber = lineNumber; } - /** * Gets the timestamp value for this TEventInfo. - * + * * @return timestamp */ public java.util.Calendar getTimestamp() { return timestamp; } - /** * Sets the timestamp value for this TEventInfo. - * - * @param timestamp */ public void setTimestamp(java.util.Calendar timestamp) { this.timestamp = timestamp; } - /** * Gets the processId value for this TEventInfo. - * + * * @return processId */ public javax.xml.namespace.QName getProcessId() { return processId; } - /** * Sets the processId value for this TEventInfo. - * - * @param processId */ public void setProcessId(javax.xml.namespace.QName processId) { this.processId = processId; } - /** * Gets the processType value for this TEventInfo. - * + * * @return processType */ public javax.xml.namespace.QName getProcessType() { return processType; } - /** * Sets the processType value for this TEventInfo. - * - * @param processType */ public void setProcessType(javax.xml.namespace.QName processType) { this.processType = processType; } - /** * Gets the instanceId value for this TEventInfo. - * + * * @return instanceId */ public java.lang.Long getInstanceId() { return instanceId; } - /** * Sets the instanceId value for this TEventInfo. - * - * @param instanceId */ public void setInstanceId(java.lang.Long instanceId) { this.instanceId = instanceId; } - /** * Gets the scopeId value for this TEventInfo. - * + * * @return scopeId */ public java.lang.Long getScopeId() { return scopeId; } - /** * Sets the scopeId value for this TEventInfo. - * - * @param scopeId */ public void setScopeId(java.lang.Long scopeId) { this.scopeId = scopeId; } - /** * Gets the parentScopeId value for this TEventInfo. - * + * * @return parentScopeId */ public java.lang.Long getParentScopeId() { return parentScopeId; } - /** * Sets the parentScopeId value for this TEventInfo. - * - * @param parentScopeId */ public void setParentScopeId(java.lang.Long parentScopeId) { this.parentScopeId = parentScopeId; } - /** * Gets the scopeName value for this TEventInfo. - * + * * @return scopeName */ public java.lang.String getScopeName() { return scopeName; } - /** * Sets the scopeName value for this TEventInfo. - * - * @param scopeName */ public void setScopeName(java.lang.String scopeName) { this.scopeName = scopeName; } - /** * Gets the scopeDefinitionId value for this TEventInfo. - * + * * @return scopeDefinitionId */ public java.lang.Integer getScopeDefinitionId() { return scopeDefinitionId; } - /** * Sets the scopeDefinitionId value for this TEventInfo. - * - * @param scopeDefinitionId */ public void setScopeDefinitionId(java.lang.Integer scopeDefinitionId) { this.scopeDefinitionId = scopeDefinitionId; } - /** * Gets the activityId value for this TEventInfo. - * + * * @return activityId */ public java.lang.Long getActivityId() { return activityId; } - /** * Sets the activityId value for this TEventInfo. - * - * @param activityId */ public void setActivityId(java.lang.Long activityId) { this.activityId = activityId; } - /** * Gets the activityName value for this TEventInfo. - * + * * @return activityName */ public java.lang.String getActivityName() { return activityName; } - /** * Sets the activityName value for this TEventInfo. - * - * @param activityName */ public void setActivityName(java.lang.String activityName) { this.activityName = activityName; } - /** * Gets the activityType value for this TEventInfo. - * + * * @return activityType */ public java.lang.String getActivityType() { return activityType; } - /** * Sets the activityType value for this TEventInfo. - * - * @param activityType */ public void setActivityType(java.lang.String activityType) { this.activityType = activityType; } - /** * Gets the activityDefinitionId value for this TEventInfo. - * + * * @return activityDefinitionId */ public java.lang.Integer getActivityDefinitionId() { return activityDefinitionId; } - /** * Sets the activityDefinitionId value for this TEventInfo. - * - * @param activityDefinitionId */ public void setActivityDefinitionId(java.lang.Integer activityDefinitionId) { this.activityDefinitionId = activityDefinitionId; } - /** * Gets the activityFailureReason value for this TEventInfo. - * + * * @return activityFailureReason */ public java.lang.String getActivityFailureReason() { return activityFailureReason; } - /** * Sets the activityFailureReason value for this TEventInfo. - * - * @param activityFailureReason */ public void setActivityFailureReason(java.lang.String activityFailureReason) { this.activityFailureReason = activityFailureReason; } - /** * Gets the activityRecoveryAction value for this TEventInfo. - * + * * @return activityRecoveryAction */ public java.lang.String getActivityRecoveryAction() { return activityRecoveryAction; } - /** * Sets the activityRecoveryAction value for this TEventInfo. - * - * @param activityRecoveryAction */ public void setActivityRecoveryAction(java.lang.String activityRecoveryAction) { this.activityRecoveryAction = activityRecoveryAction; } - /** * Gets the variableName value for this TEventInfo. - * + * * @return variableName */ public java.lang.String getVariableName() { return variableName; } - /** * Sets the variableName value for this TEventInfo. - * - * @param variableName */ public void setVariableName(java.lang.String variableName) { this.variableName = variableName; } - /** * Gets the newValue value for this TEventInfo. - * + * * @return newValue */ public java.lang.String getNewValue() { return newValue; } - /** * Sets the newValue value for this TEventInfo. - * - * @param newValue */ public void setNewValue(java.lang.String newValue) { this.newValue = newValue; } - /** * Gets the portType value for this TEventInfo. - * + * * @return portType */ public javax.xml.namespace.QName getPortType() { return portType; } - /** * Sets the portType value for this TEventInfo. - * - * @param portType */ public void setPortType(javax.xml.namespace.QName portType) { this.portType = portType; } - /** * Gets the operation value for this TEventInfo. - * + * * @return operation */ public java.lang.String getOperation() { return operation; } - /** * Sets the operation value for this TEventInfo. - * - * @param operation */ public void setOperation(java.lang.String operation) { this.operation = operation; } - /** * Gets the correlationSet value for this TEventInfo. - * + * * @return correlationSet */ public java.lang.String getCorrelationSet() { return correlationSet; } - /** * Sets the correlationSet value for this TEventInfo. - * - * @param correlationSet */ public void setCorrelationSet(java.lang.String correlationSet) { this.correlationSet = correlationSet; } - /** * Gets the mexId value for this TEventInfo. - * + * * @return mexId */ public java.lang.String getMexId() { return mexId; } - /** * Sets the mexId value for this TEventInfo. - * - * @param mexId */ public void setMexId(java.lang.String mexId) { this.mexId = mexId; } - /** * Gets the correlationKey value for this TEventInfo. - * + * * @return correlationKey */ public java.lang.String getCorrelationKey() { return correlationKey; } - /** * Sets the correlationKey value for this TEventInfo. - * - * @param correlationKey */ public void setCorrelationKey(java.lang.String correlationKey) { this.correlationKey = correlationKey; } - /** * Gets the expression value for this TEventInfo. - * + * * @return expression */ public java.lang.String getExpression() { return expression; } - /** * Sets the expression value for this TEventInfo. - * - * @param expression */ public void setExpression(java.lang.String expression) { this.expression = expression; } - /** * Gets the fault value for this TEventInfo. - * + * * @return fault */ public javax.xml.namespace.QName getFault() { return fault; } - /** * Sets the fault value for this TEventInfo. - * - * @param fault */ public void setFault(javax.xml.namespace.QName fault) { this.fault = fault; } - /** * Gets the faultLineNumber value for this TEventInfo. - * + * * @return faultLineNumber */ public java.lang.Integer getFaultLineNumber() { return faultLineNumber; } - /** * Sets the faultLineNumber value for this TEventInfo. - * - * @param faultLineNumber */ public void setFaultLineNumber(java.lang.Integer faultLineNumber) { this.faultLineNumber = faultLineNumber; } - /** * Gets the explanation value for this TEventInfo. - * + * * @return explanation */ public java.lang.String getExplanation() { return explanation; } - /** * Sets the explanation value for this TEventInfo. - * - * @param explanation */ public void setExplanation(java.lang.String explanation) { this.explanation = explanation; } - /** * Gets the result value for this TEventInfo. - * + * * @return result */ public java.lang.String getResult() { return result; } - /** * Sets the result value for this TEventInfo. - * - * @param result */ public void setResult(java.lang.String result) { this.result = result; } - /** * Gets the rootScopeId value for this TEventInfo. - * + * * @return rootScopeId */ public java.lang.Long getRootScopeId() { return rootScopeId; } - /** * Sets the rootScopeId value for this TEventInfo. - * - * @param rootScopeId */ public void setRootScopeId(java.lang.Long rootScopeId) { this.rootScopeId = rootScopeId; } - /** * Gets the rootScopeDeclarationId value for this TEventInfo. - * + * * @return rootScopeDeclarationId */ public java.lang.Integer getRootScopeDeclarationId() { return rootScopeDeclarationId; } - /** * Sets the rootScopeDeclarationId value for this TEventInfo. - * - * @param rootScopeDeclarationId */ public void setRootScopeDeclarationId(java.lang.Integer rootScopeDeclarationId) { this.rootScopeDeclarationId = rootScopeDeclarationId; } - /** * Gets the partnerLinkName value for this TEventInfo. - * + * * @return partnerLinkName */ public java.lang.String getPartnerLinkName() { return partnerLinkName; } - /** * Sets the partnerLinkName value for this TEventInfo. - * - * @param partnerLinkName */ public void setPartnerLinkName(java.lang.String partnerLinkName) { this.partnerLinkName = partnerLinkName; } - /** * Gets the oldState value for this TEventInfo. - * + * * @return oldState */ public java.lang.Integer getOldState() { return oldState; } - /** * Sets the oldState value for this TEventInfo. - * - * @param oldState */ public void setOldState(java.lang.Integer oldState) { this.oldState = oldState; } - /** * Gets the newState value for this TEventInfo. - * + * * @return newState */ public java.lang.Integer getNewState() { return newState; } - /** * Sets the newState value for this TEventInfo. - * - * @param newState */ public void setNewState(java.lang.Integer newState) { this.newState = newState; } - /** * Gets the success value for this TEventInfo. - * + * * @return success */ public java.lang.Boolean getSuccess() { return success; } - /** * Sets the success value for this TEventInfo. - * - * @param success */ public void setSuccess(java.lang.Boolean success) { this.success = success; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof TEventInfo)) return false; TEventInfo other = (TEventInfo) obj; @@ -865,115 +725,116 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.name==null && other.getName()==null) || - (this.name!=null && - this.name.equals(other.getName()))) && - ((this.type==null && other.getType()==null) || - (this.type!=null && - this.type.equals(other.getType()))) && + _equals = true && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))) && + ((this.type == null && other.getType() == null) || + (this.type != null && + this.type.equals(other.getType()))) && this.lineNumber == other.getLineNumber() && - ((this.timestamp==null && other.getTimestamp()==null) || - (this.timestamp!=null && - this.timestamp.equals(other.getTimestamp()))) && - ((this.processId==null && other.getProcessId()==null) || - (this.processId!=null && - this.processId.equals(other.getProcessId()))) && - ((this.processType==null && other.getProcessType()==null) || - (this.processType!=null && - this.processType.equals(other.getProcessType()))) && - ((this.instanceId==null && other.getInstanceId()==null) || - (this.instanceId!=null && - this.instanceId.equals(other.getInstanceId()))) && - ((this.scopeId==null && other.getScopeId()==null) || - (this.scopeId!=null && - this.scopeId.equals(other.getScopeId()))) && - ((this.parentScopeId==null && other.getParentScopeId()==null) || - (this.parentScopeId!=null && - this.parentScopeId.equals(other.getParentScopeId()))) && - ((this.scopeName==null && other.getScopeName()==null) || - (this.scopeName!=null && - this.scopeName.equals(other.getScopeName()))) && - ((this.scopeDefinitionId==null && other.getScopeDefinitionId()==null) || - (this.scopeDefinitionId!=null && - this.scopeDefinitionId.equals(other.getScopeDefinitionId()))) && - ((this.activityId==null && other.getActivityId()==null) || - (this.activityId!=null && - this.activityId.equals(other.getActivityId()))) && - ((this.activityName==null && other.getActivityName()==null) || - (this.activityName!=null && - this.activityName.equals(other.getActivityName()))) && - ((this.activityType==null && other.getActivityType()==null) || - (this.activityType!=null && - this.activityType.equals(other.getActivityType()))) && - ((this.activityDefinitionId==null && other.getActivityDefinitionId()==null) || - (this.activityDefinitionId!=null && - this.activityDefinitionId.equals(other.getActivityDefinitionId()))) && - ((this.activityFailureReason==null && other.getActivityFailureReason()==null) || - (this.activityFailureReason!=null && - this.activityFailureReason.equals(other.getActivityFailureReason()))) && - ((this.activityRecoveryAction==null && other.getActivityRecoveryAction()==null) || - (this.activityRecoveryAction!=null && - this.activityRecoveryAction.equals(other.getActivityRecoveryAction()))) && - ((this.variableName==null && other.getVariableName()==null) || - (this.variableName!=null && - this.variableName.equals(other.getVariableName()))) && - ((this.newValue==null && other.getNewValue()==null) || - (this.newValue!=null && - this.newValue.equals(other.getNewValue()))) && - ((this.portType==null && other.getPortType()==null) || - (this.portType!=null && - this.portType.equals(other.getPortType()))) && - ((this.operation==null && other.getOperation()==null) || - (this.operation!=null && - this.operation.equals(other.getOperation()))) && - ((this.correlationSet==null && other.getCorrelationSet()==null) || - (this.correlationSet!=null && - this.correlationSet.equals(other.getCorrelationSet()))) && - ((this.mexId==null && other.getMexId()==null) || - (this.mexId!=null && - this.mexId.equals(other.getMexId()))) && - ((this.correlationKey==null && other.getCorrelationKey()==null) || - (this.correlationKey!=null && - this.correlationKey.equals(other.getCorrelationKey()))) && - ((this.expression==null && other.getExpression()==null) || - (this.expression!=null && - this.expression.equals(other.getExpression()))) && - ((this.fault==null && other.getFault()==null) || - (this.fault!=null && - this.fault.equals(other.getFault()))) && - ((this.faultLineNumber==null && other.getFaultLineNumber()==null) || - (this.faultLineNumber!=null && - this.faultLineNumber.equals(other.getFaultLineNumber()))) && - ((this.explanation==null && other.getExplanation()==null) || - (this.explanation!=null && - this.explanation.equals(other.getExplanation()))) && - ((this.result==null && other.getResult()==null) || - (this.result!=null && - this.result.equals(other.getResult()))) && - ((this.rootScopeId==null && other.getRootScopeId()==null) || - (this.rootScopeId!=null && - this.rootScopeId.equals(other.getRootScopeId()))) && - ((this.rootScopeDeclarationId==null && other.getRootScopeDeclarationId()==null) || - (this.rootScopeDeclarationId!=null && - this.rootScopeDeclarationId.equals(other.getRootScopeDeclarationId()))) && - ((this.partnerLinkName==null && other.getPartnerLinkName()==null) || - (this.partnerLinkName!=null && - this.partnerLinkName.equals(other.getPartnerLinkName()))) && - ((this.oldState==null && other.getOldState()==null) || - (this.oldState!=null && - this.oldState.equals(other.getOldState()))) && - ((this.newState==null && other.getNewState()==null) || - (this.newState!=null && - this.newState.equals(other.getNewState()))) && - ((this.success==null && other.getSuccess()==null) || - (this.success!=null && - this.success.equals(other.getSuccess()))); + ((this.timestamp == null && other.getTimestamp() == null) || + (this.timestamp != null && + this.timestamp.equals(other.getTimestamp()))) && + ((this.processId == null && other.getProcessId() == null) || + (this.processId != null && + this.processId.equals(other.getProcessId()))) && + ((this.processType == null && other.getProcessType() == null) || + (this.processType != null && + this.processType.equals(other.getProcessType()))) && + ((this.instanceId == null && other.getInstanceId() == null) || + (this.instanceId != null && + this.instanceId.equals(other.getInstanceId()))) && + ((this.scopeId == null && other.getScopeId() == null) || + (this.scopeId != null && + this.scopeId.equals(other.getScopeId()))) && + ((this.parentScopeId == null && other.getParentScopeId() == null) || + (this.parentScopeId != null && + this.parentScopeId.equals(other.getParentScopeId()))) && + ((this.scopeName == null && other.getScopeName() == null) || + (this.scopeName != null && + this.scopeName.equals(other.getScopeName()))) && + ((this.scopeDefinitionId == null && other.getScopeDefinitionId() == null) || + (this.scopeDefinitionId != null && + this.scopeDefinitionId.equals(other.getScopeDefinitionId()))) && + ((this.activityId == null && other.getActivityId() == null) || + (this.activityId != null && + this.activityId.equals(other.getActivityId()))) && + ((this.activityName == null && other.getActivityName() == null) || + (this.activityName != null && + this.activityName.equals(other.getActivityName()))) && + ((this.activityType == null && other.getActivityType() == null) || + (this.activityType != null && + this.activityType.equals(other.getActivityType()))) && + ((this.activityDefinitionId == null && other.getActivityDefinitionId() == null) || + (this.activityDefinitionId != null && + this.activityDefinitionId.equals(other.getActivityDefinitionId()))) && + ((this.activityFailureReason == null && other.getActivityFailureReason() == null) || + (this.activityFailureReason != null && + this.activityFailureReason.equals(other.getActivityFailureReason()))) && + ((this.activityRecoveryAction == null && other.getActivityRecoveryAction() == null) || + (this.activityRecoveryAction != null && + this.activityRecoveryAction.equals(other.getActivityRecoveryAction()))) && + ((this.variableName == null && other.getVariableName() == null) || + (this.variableName != null && + this.variableName.equals(other.getVariableName()))) && + ((this.newValue == null && other.getNewValue() == null) || + (this.newValue != null && + this.newValue.equals(other.getNewValue()))) && + ((this.portType == null && other.getPortType() == null) || + (this.portType != null && + this.portType.equals(other.getPortType()))) && + ((this.operation == null && other.getOperation() == null) || + (this.operation != null && + this.operation.equals(other.getOperation()))) && + ((this.correlationSet == null && other.getCorrelationSet() == null) || + (this.correlationSet != null && + this.correlationSet.equals(other.getCorrelationSet()))) && + ((this.mexId == null && other.getMexId() == null) || + (this.mexId != null && + this.mexId.equals(other.getMexId()))) && + ((this.correlationKey == null && other.getCorrelationKey() == null) || + (this.correlationKey != null && + this.correlationKey.equals(other.getCorrelationKey()))) && + ((this.expression == null && other.getExpression() == null) || + (this.expression != null && + this.expression.equals(other.getExpression()))) && + ((this.fault == null && other.getFault() == null) || + (this.fault != null && + this.fault.equals(other.getFault()))) && + ((this.faultLineNumber == null && other.getFaultLineNumber() == null) || + (this.faultLineNumber != null && + this.faultLineNumber.equals(other.getFaultLineNumber()))) && + ((this.explanation == null && other.getExplanation() == null) || + (this.explanation != null && + this.explanation.equals(other.getExplanation()))) && + ((this.result == null && other.getResult() == null) || + (this.result != null && + this.result.equals(other.getResult()))) && + ((this.rootScopeId == null && other.getRootScopeId() == null) || + (this.rootScopeId != null && + this.rootScopeId.equals(other.getRootScopeId()))) && + ((this.rootScopeDeclarationId == null && other.getRootScopeDeclarationId() == null) || + (this.rootScopeDeclarationId != null && + this.rootScopeDeclarationId.equals(other.getRootScopeDeclarationId()))) && + ((this.partnerLinkName == null && other.getPartnerLinkName() == null) || + (this.partnerLinkName != null && + this.partnerLinkName.equals(other.getPartnerLinkName()))) && + ((this.oldState == null && other.getOldState() == null) || + (this.oldState != null && + this.oldState.equals(other.getOldState()))) && + ((this.newState == null && other.getNewState() == null) || + (this.newState != null && + this.newState.equals(other.getNewState()))) && + ((this.success == null && other.getSuccess() == null) || + (this.success != null && + this.success.equals(other.getSuccess()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -1347,24 +1208,23 @@ public static org.apache.axis.description.TypeDesc getTypeDesc() { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); } - } diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailureInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailureInfo.java similarity index 75% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailureInfo.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailureInfo.java index ceb81f8f1..7428fb864 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailureInfo.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailureInfo.java @@ -1,17 +1,15 @@ /** * TFailureInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; - /** * Indicates activity is in the failure state and requires recovery. */ -public class TFailureInfo implements java.io.Serializable { +public class TFailureInfo implements java.io.Serializable { /* The date/time when failure occurred. */ private java.util.Calendar dtFailure; @@ -28,97 +26,90 @@ public TFailureInfo() { } public TFailureInfo( - java.util.Calendar dtFailure, - int retries, - java.lang.String reason, - java.lang.String actions) { - this.dtFailure = dtFailure; - this.retries = retries; - this.reason = reason; - this.actions = actions; + java.util.Calendar dtFailure, + int retries, + java.lang.String reason, + java.lang.String actions) { + this.dtFailure = dtFailure; + this.retries = retries; + this.reason = reason; + this.actions = actions; } - /** * Gets the dtFailure value for this TFailureInfo. - * + * * @return dtFailure * The date/time when failure occurred. */ public java.util.Calendar getDtFailure() { return dtFailure; } - /** * Sets the dtFailure value for this TFailureInfo. - * - * @param dtFailure * The date/time when failure occurred. + * + * @param dtFailure * The date/time when failure occurred. */ public void setDtFailure(java.util.Calendar dtFailure) { this.dtFailure = dtFailure; } - /** * Gets the retries value for this TFailureInfo. - * + * * @return retries * Number of retries. */ public int getRetries() { return retries; } - /** * Sets the retries value for this TFailureInfo. - * - * @param retries * Number of retries. + * + * @param retries * Number of retries. */ public void setRetries(int retries) { this.retries = retries; } - /** * Gets the reason value for this TFailureInfo. - * + * * @return reason * Reason for failure. */ public java.lang.String getReason() { return reason; } - /** * Sets the reason value for this TFailureInfo. - * - * @param reason * Reason for failure. + * + * @param reason * Reason for failure. */ public void setReason(java.lang.String reason) { this.reason = reason; } - /** * Gets the actions value for this TFailureInfo. - * + * * @return actions * Allowed recovery actions (space separated list of action names). */ public java.lang.String getActions() { return actions; } - /** * Sets the actions value for this TFailureInfo. - * - * @param actions * Allowed recovery actions (space separated list of action names). + * + * @param actions * Allowed recovery actions (space separated list of action names). */ public void setActions(java.lang.String actions) { this.actions = actions; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof TFailureInfo)) return false; TFailureInfo other = (TFailureInfo) obj; @@ -129,22 +120,23 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.dtFailure==null && other.getDtFailure()==null) || - (this.dtFailure!=null && - this.dtFailure.equals(other.getDtFailure()))) && + _equals = true && + ((this.dtFailure == null && other.getDtFailure() == null) || + (this.dtFailure != null && + this.dtFailure.equals(other.getDtFailure()))) && this.retries == other.getRetries() && - ((this.reason==null && other.getReason()==null) || - (this.reason!=null && - this.reason.equals(other.getReason()))) && - ((this.actions==null && other.getActions()==null) || - (this.actions!=null && - this.actions.equals(other.getActions()))); + ((this.reason == null && other.getReason() == null) || + (this.reason != null && + this.reason.equals(other.getReason()))) && + ((this.actions == null && other.getActions() == null) || + (this.actions != null && + this.actions.equals(other.getActions()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -208,24 +200,23 @@ public static org.apache.axis.description.TypeDesc getTypeDesc() { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailuresInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailuresInfo.java new file mode 100644 index 000000000..36071c1da --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailuresInfo.java @@ -0,0 +1,152 @@ +/** + * TFailuresInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Indicates one or more activities are in the failure state and require recovery. + */ +public class TFailuresInfo implements java.io.Serializable { + /* Date/time of last failure. */ + private java.util.Calendar dtFailure; + + /* Number of activities in failure state. */ + private int count; + + public TFailuresInfo() { + } + + public TFailuresInfo( + java.util.Calendar dtFailure, + int count) { + this.dtFailure = dtFailure; + this.count = count; + } + + /** + * Gets the dtFailure value for this TFailuresInfo. + * + * @return dtFailure * Date/time of last failure. + */ + public java.util.Calendar getDtFailure() { + return dtFailure; + } + + /** + * Sets the dtFailure value for this TFailuresInfo. + * + * @param dtFailure * Date/time of last failure. + */ + public void setDtFailure(java.util.Calendar dtFailure) { + this.dtFailure = dtFailure; + } + + /** + * Gets the count value for this TFailuresInfo. + * + * @return count * Number of activities in failure state. + */ + public int getCount() { + return count; + } + + /** + * Sets the count value for this TFailuresInfo. + * + * @param count * Number of activities in failure state. + */ + public void setCount(int count) { + this.count = count; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TFailuresInfo)) return false; + TFailuresInfo other = (TFailuresInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.dtFailure == null && other.getDtFailure() == null) || + (this.dtFailure != null && + this.dtFailure.equals(other.getDtFailure()))) && + this.count == other.getCount(); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getDtFailure() != null) { + _hashCode += getDtFailure().hashCode(); + } + _hashCode += getCount(); + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TFailuresInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailuresInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dtFailure"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "dt-failure")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("count"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "count")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfo.java similarity index 77% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfo.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfo.java index fca6ad3bf..a3508fe6b 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfo.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfo.java @@ -1,17 +1,15 @@ /** * TFaultInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; - /** * Type used for reporting faults. */ -public class TFaultInfo implements java.io.Serializable { +public class TFaultInfo implements java.io.Serializable { private javax.xml.namespace.QName name; private java.lang.String explanation; @@ -26,119 +24,100 @@ public TFaultInfo() { } public TFaultInfo( - javax.xml.namespace.QName name, - java.lang.String explanation, - int lineNumber, - int aiid, - org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfoData data) { - this.name = name; - this.explanation = explanation; - this.lineNumber = lineNumber; - this.aiid = aiid; - this.data = data; + javax.xml.namespace.QName name, + java.lang.String explanation, + int lineNumber, + int aiid, + org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfoData data) { + this.name = name; + this.explanation = explanation; + this.lineNumber = lineNumber; + this.aiid = aiid; + this.data = data; } - /** * Gets the name value for this TFaultInfo. - * + * * @return name */ public javax.xml.namespace.QName getName() { return name; } - /** * Sets the name value for this TFaultInfo. - * - * @param name */ public void setName(javax.xml.namespace.QName name) { this.name = name; } - /** * Gets the explanation value for this TFaultInfo. - * + * * @return explanation */ public java.lang.String getExplanation() { return explanation; } - /** * Sets the explanation value for this TFaultInfo. - * - * @param explanation */ public void setExplanation(java.lang.String explanation) { this.explanation = explanation; } - /** * Gets the lineNumber value for this TFaultInfo. - * + * * @return lineNumber */ public int getLineNumber() { return lineNumber; } - /** * Sets the lineNumber value for this TFaultInfo. - * - * @param lineNumber */ public void setLineNumber(int lineNumber) { this.lineNumber = lineNumber; } - /** * Gets the aiid value for this TFaultInfo. - * + * * @return aiid */ public int getAiid() { return aiid; } - /** * Sets the aiid value for this TFaultInfo. - * - * @param aiid */ public void setAiid(int aiid) { this.aiid = aiid; } - /** * Gets the data value for this TFaultInfo. - * + * * @return data */ public org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfoData getData() { return data; } - /** * Sets the data value for this TFaultInfo. - * - * @param data */ public void setData(org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfoData data) { this.data = data; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof TFaultInfo)) return false; TFaultInfo other = (TFaultInfo) obj; @@ -149,23 +128,24 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.name==null && other.getName()==null) || - (this.name!=null && - this.name.equals(other.getName()))) && - ((this.explanation==null && other.getExplanation()==null) || - (this.explanation!=null && - this.explanation.equals(other.getExplanation()))) && + _equals = true && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))) && + ((this.explanation == null && other.getExplanation() == null) || + (this.explanation != null && + this.explanation.equals(other.getExplanation()))) && this.lineNumber == other.getLineNumber() && this.aiid == other.getAiid() && - ((this.data==null && other.getData()==null) || - (this.data!=null && - this.data.equals(other.getData()))); + ((this.data == null && other.getData() == null) || + (this.data != null && + this.data.equals(other.getData()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -237,24 +217,23 @@ public static org.apache.axis.description.TypeDesc getTypeDesc() { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfoData.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfoData.java new file mode 100644 index 000000000..860d671d2 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfoData.java @@ -0,0 +1,117 @@ +/** + * TFaultInfoData.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TFaultInfoData implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { + private org.apache.axis.message.MessageElement[] _any; + + public TFaultInfoData() { + } + + public TFaultInfoData( + org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + /** + * Gets the _any value for this TFaultInfoData. + * + * @return _any + */ + public org.apache.axis.message.MessageElement[] get_any() { + return _any; + } + + /** + * Sets the _any value for this TFaultInfoData. + */ + public void set_any(org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TFaultInfoData)) return false; + TFaultInfoData other = (TFaultInfoData) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this._any == null && other.get_any() == null) || + (this._any != null && + java.util.Arrays.equals(this._any, other.get_any()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (get_any() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(get_any()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(get_any(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TFaultInfoData.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tFaultInfo>data")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfo.java new file mode 100644 index 000000000..39b1cd5f7 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfo.java @@ -0,0 +1,523 @@ +/** + * TInstanceInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TInstanceInfo implements java.io.Serializable { + /* The unique instance identifier. */ + private java.lang.String iid; + + /* Process id of the process to which this instance + * belongs. */ + private java.lang.String pid; + + private javax.xml.namespace.QName processName; + + /* Root scope id (might not exist). */ + private org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef rootScope; + + /* Status of ths instance. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus status; + + /* The date/time when the instance was + * started. */ + private java.util.Calendar dtStarted; + + /* The date/time when the last activity + * occured. */ + private java.util.Calendar dtLastActive; + + /* If present, indicates the date/time since which the + * instance has been in an error state. */ + private java.util.Calendar dtErrorSince; + + /* Lists all correlation properties with their values that + * are associated with this process instance. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[] correlationProperties; + + /* Information about the events for this instance. If + * absent, indicates events are not available. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo eventInfo; + + /* If present, indicates the fault with which this + * instance failed. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo faultInfo; + + private org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures; + + public TInstanceInfo() { + } + + public TInstanceInfo( + java.lang.String iid, + java.lang.String pid, + javax.xml.namespace.QName processName, + org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef rootScope, + org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus status, + java.util.Calendar dtStarted, + java.util.Calendar dtLastActive, + java.util.Calendar dtErrorSince, + org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[] correlationProperties, + org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo eventInfo, + org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo faultInfo, + org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures) { + this.iid = iid; + this.pid = pid; + this.processName = processName; + this.rootScope = rootScope; + this.status = status; + this.dtStarted = dtStarted; + this.dtLastActive = dtLastActive; + this.dtErrorSince = dtErrorSince; + this.correlationProperties = correlationProperties; + this.eventInfo = eventInfo; + this.faultInfo = faultInfo; + this.failures = failures; + } + + /** + * Gets the iid value for this TInstanceInfo. + * + * @return iid * The unique instance identifier. + */ + public java.lang.String getIid() { + return iid; + } + + /** + * Sets the iid value for this TInstanceInfo. + * + * @param iid * The unique instance identifier. + */ + public void setIid(java.lang.String iid) { + this.iid = iid; + } + + /** + * Gets the pid value for this TInstanceInfo. + * + * @return pid * Process id of the process to which this instance belongs. + */ + public java.lang.String getPid() { + return pid; + } + + /** + * Sets the pid value for this TInstanceInfo. + * + * @param pid * Process id of the process to which this instance belongs. + */ + public void setPid(java.lang.String pid) { + this.pid = pid; + } + + /** + * Gets the processName value for this TInstanceInfo. + * + * @return processName + */ + public javax.xml.namespace.QName getProcessName() { + return processName; + } + + /** + * Sets the processName value for this TInstanceInfo. + */ + public void setProcessName(javax.xml.namespace.QName processName) { + this.processName = processName; + } + + /** + * Gets the rootScope value for this TInstanceInfo. + * + * @return rootScope * Root scope id (might not exist). + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef getRootScope() { + return rootScope; + } + + /** + * Sets the rootScope value for this TInstanceInfo. + * + * @param rootScope * Root scope id (might not exist). + */ + public void setRootScope(org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef rootScope) { + this.rootScope = rootScope; + } + + /** + * Gets the status value for this TInstanceInfo. + * + * @return status * Status of ths instance. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus getStatus() { + return status; + } + + /** + * Sets the status value for this TInstanceInfo. + * + * @param status * Status of ths instance. + */ + public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus status) { + this.status = status; + } + + /** + * Gets the dtStarted value for this TInstanceInfo. + * + * @return dtStarted * The date/time when the instance was started. + */ + public java.util.Calendar getDtStarted() { + return dtStarted; + } + + /** + * Sets the dtStarted value for this TInstanceInfo. + * + * @param dtStarted * The date/time when the instance was started. + */ + public void setDtStarted(java.util.Calendar dtStarted) { + this.dtStarted = dtStarted; + } + + /** + * Gets the dtLastActive value for this TInstanceInfo. + * + * @return dtLastActive * The date/time when the last activity occured. + */ + public java.util.Calendar getDtLastActive() { + return dtLastActive; + } + + /** + * Sets the dtLastActive value for this TInstanceInfo. + * + * @param dtLastActive * The date/time when the last activity occured. + */ + public void setDtLastActive(java.util.Calendar dtLastActive) { + this.dtLastActive = dtLastActive; + } + + /** + * Gets the dtErrorSince value for this TInstanceInfo. + * + * @return dtErrorSince * If present, indicates the date/time since which the instance has been in an error state. + */ + public java.util.Calendar getDtErrorSince() { + return dtErrorSince; + } + + /** + * Sets the dtErrorSince value for this TInstanceInfo. + * + * @param dtErrorSince * If present, indicates the date/time since which the instance has been in an error state. + */ + public void setDtErrorSince(java.util.Calendar dtErrorSince) { + this.dtErrorSince = dtErrorSince; + } + + /** + * Gets the correlationProperties value for this TInstanceInfo. + * + * @return correlationProperties * Lists all correlation properties with their values that are associated with + * this process instance. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[] getCorrelationProperties() { + return correlationProperties; + } + + /** + * Sets the correlationProperties value for this TInstanceInfo. + * + * @param correlationProperties * Lists all correlation properties with their values that are associated with this + * process instance. + */ + public void setCorrelationProperties(org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[] correlationProperties) { + this.correlationProperties = correlationProperties; + } + + /** + * Gets the eventInfo value for this TInstanceInfo. + * + * @return eventInfo * Information about the events for this instance. If absent, indicates events are not + * available. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo getEventInfo() { + return eventInfo; + } + + /** + * Sets the eventInfo value for this TInstanceInfo. + * + * @param eventInfo * Information about the events for this instance. If absent, indicates events are not + * available. + */ + public void setEventInfo(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo eventInfo) { + this.eventInfo = eventInfo; + } + + /** + * Gets the faultInfo value for this TInstanceInfo. + * + * @return faultInfo * If present, indicates the fault with which this instance failed. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo getFaultInfo() { + return faultInfo; + } + + /** + * Sets the faultInfo value for this TInstanceInfo. + * + * @param faultInfo * If present, indicates the fault with which this instance failed. + */ + public void setFaultInfo(org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo faultInfo) { + this.faultInfo = faultInfo; + } + + /** + * Gets the failures value for this TInstanceInfo. + * + * @return failures + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo getFailures() { + return failures; + } + + /** + * Sets the failures value for this TInstanceInfo. + */ + public void setFailures(org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures) { + this.failures = failures; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TInstanceInfo)) return false; + TInstanceInfo other = (TInstanceInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.iid == null && other.getIid() == null) || + (this.iid != null && + this.iid.equals(other.getIid()))) && + ((this.pid == null && other.getPid() == null) || + (this.pid != null && + this.pid.equals(other.getPid()))) && + ((this.processName == null && other.getProcessName() == null) || + (this.processName != null && + this.processName.equals(other.getProcessName()))) && + ((this.rootScope == null && other.getRootScope() == null) || + (this.rootScope != null && + this.rootScope.equals(other.getRootScope()))) && + ((this.status == null && other.getStatus() == null) || + (this.status != null && + this.status.equals(other.getStatus()))) && + ((this.dtStarted == null && other.getDtStarted() == null) || + (this.dtStarted != null && + this.dtStarted.equals(other.getDtStarted()))) && + ((this.dtLastActive == null && other.getDtLastActive() == null) || + (this.dtLastActive != null && + this.dtLastActive.equals(other.getDtLastActive()))) && + ((this.dtErrorSince == null && other.getDtErrorSince() == null) || + (this.dtErrorSince != null && + this.dtErrorSince.equals(other.getDtErrorSince()))) && + ((this.correlationProperties == null && other.getCorrelationProperties() == null) || + (this.correlationProperties != null && + java.util.Arrays.equals(this.correlationProperties, other.getCorrelationProperties()))) && + ((this.eventInfo == null && other.getEventInfo() == null) || + (this.eventInfo != null && + this.eventInfo.equals(other.getEventInfo()))) && + ((this.faultInfo == null && other.getFaultInfo() == null) || + (this.faultInfo != null && + this.faultInfo.equals(other.getFaultInfo()))) && + ((this.failures == null && other.getFailures() == null) || + (this.failures != null && + this.failures.equals(other.getFailures()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getIid() != null) { + _hashCode += getIid().hashCode(); + } + if (getPid() != null) { + _hashCode += getPid().hashCode(); + } + if (getProcessName() != null) { + _hashCode += getProcessName().hashCode(); + } + if (getRootScope() != null) { + _hashCode += getRootScope().hashCode(); + } + if (getStatus() != null) { + _hashCode += getStatus().hashCode(); + } + if (getDtStarted() != null) { + _hashCode += getDtStarted().hashCode(); + } + if (getDtLastActive() != null) { + _hashCode += getDtLastActive().hashCode(); + } + if (getDtErrorSince() != null) { + _hashCode += getDtErrorSince().hashCode(); + } + if (getCorrelationProperties() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getCorrelationProperties()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getCorrelationProperties(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getEventInfo() != null) { + _hashCode += getEventInfo().hashCode(); + } + if (getFaultInfo() != null) { + _hashCode += getFaultInfo().hashCode(); + } + if (getFailures() != null) { + _hashCode += getFailures().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TInstanceInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("iid"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "iid")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("pid"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "pid")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("processName"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "process-name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("rootScope"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "root-scope")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("status"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "status")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceStatus")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dtStarted"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "dt-started")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dtLastActive"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "dt-last-active")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dtErrorSince"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "dt-error-since")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("correlationProperties"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-properties")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("eventInfo"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "event-info")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>event-info")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("faultInfo"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "fault-info")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFaultInfo")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("failures"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "failures")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailuresInfo")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfoEventInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfoEventInfo.java similarity index 75% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfoEventInfo.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfoEventInfo.java index a347b7d61..06bb9fc83 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfoEventInfo.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfoEventInfo.java @@ -1,13 +1,12 @@ /** * TInstanceInfoEventInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; -public class TInstanceInfoEventInfo implements java.io.Serializable { +public class TInstanceInfoEventInfo implements java.io.Serializable { /* Indicates the datetime of the first event */ private int count; @@ -21,75 +20,70 @@ public TInstanceInfoEventInfo() { } public TInstanceInfoEventInfo( - int count, - java.util.Calendar firstDtime, - java.util.Calendar lastDtime) { - this.count = count; - this.firstDtime = firstDtime; - this.lastDtime = lastDtime; + int count, + java.util.Calendar firstDtime, + java.util.Calendar lastDtime) { + this.count = count; + this.firstDtime = firstDtime; + this.lastDtime = lastDtime; } - /** * Gets the count value for this TInstanceInfoEventInfo. - * + * * @return count * Indicates the datetime of the first event */ public int getCount() { return count; } - /** * Sets the count value for this TInstanceInfoEventInfo. - * - * @param count * Indicates the datetime of the first event + * + * @param count * Indicates the datetime of the first event */ public void setCount(int count) { this.count = count; } - /** * Gets the firstDtime value for this TInstanceInfoEventInfo. - * + * * @return firstDtime * Indicates the datetime of the first event */ public java.util.Calendar getFirstDtime() { return firstDtime; } - /** * Sets the firstDtime value for this TInstanceInfoEventInfo. - * - * @param firstDtime * Indicates the datetime of the first event + * + * @param firstDtime * Indicates the datetime of the first event */ public void setFirstDtime(java.util.Calendar firstDtime) { this.firstDtime = firstDtime; } - /** * Gets the lastDtime value for this TInstanceInfoEventInfo. - * + * * @return lastDtime * Indicates the datetime of the last event. */ public java.util.Calendar getLastDtime() { return lastDtime; } - /** * Sets the lastDtime value for this TInstanceInfoEventInfo. - * - * @param lastDtime * Indicates the datetime of the last event. + * + * @param lastDtime * Indicates the datetime of the last event. */ public void setLastDtime(java.util.Calendar lastDtime) { this.lastDtime = lastDtime; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof TInstanceInfoEventInfo)) return false; TInstanceInfoEventInfo other = (TInstanceInfoEventInfo) obj; @@ -100,19 +94,20 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && + _equals = true && this.count == other.getCount() && - ((this.firstDtime==null && other.getFirstDtime()==null) || - (this.firstDtime!=null && - this.firstDtime.equals(other.getFirstDtime()))) && - ((this.lastDtime==null && other.getLastDtime()==null) || - (this.lastDtime!=null && - this.lastDtime.equals(other.getLastDtime()))); + ((this.firstDtime == null && other.getFirstDtime() == null) || + (this.firstDtime != null && + this.firstDtime.equals(other.getFirstDtime()))) && + ((this.lastDtime == null && other.getLastDtime() == null) || + (this.lastDtime != null && + this.lastDtime.equals(other.getLastDtime()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -167,24 +162,23 @@ public static org.apache.axis.description.TypeDesc getTypeDesc() { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceStatus.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceStatus.java new file mode 100644 index 000000000..961111e6c --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceStatus.java @@ -0,0 +1,97 @@ +/** + * TInstanceStatus.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TInstanceStatus implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected TInstanceStatus(java.lang.String value) { + _value_ = value; + _table_.put(_value_, this); + } + + public static final java.lang.String _ACTIVE = "ACTIVE"; + public static final java.lang.String _COMPLETED = "COMPLETED"; + public static final java.lang.String _TERMINATED = "TERMINATED"; + public static final java.lang.String _FAILED = "FAILED"; + public static final java.lang.String _SUSPENDED = "SUSPENDED"; + public static final java.lang.String _ERROR = "ERROR"; + public static final TInstanceStatus ACTIVE = new TInstanceStatus(_ACTIVE); + public static final TInstanceStatus COMPLETED = new TInstanceStatus(_COMPLETED); + public static final TInstanceStatus TERMINATED = new TInstanceStatus(_TERMINATED); + public static final TInstanceStatus FAILED = new TInstanceStatus(_FAILED); + public static final TInstanceStatus SUSPENDED = new TInstanceStatus(_SUSPENDED); + public static final TInstanceStatus ERROR = new TInstanceStatus(_ERROR); + + public java.lang.String getValue() { + return _value_; + } + + public static TInstanceStatus fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + TInstanceStatus enumeration = (TInstanceStatus) + _table_.get(value); + if (enumeration == null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + + public static TInstanceStatus fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + + public boolean equals(java.lang.Object obj) { + return (obj == this); + } + + public int hashCode() { + return toString().hashCode(); + } + + public java.lang.String toString() { + return _value_; + } + + public java.lang.Object readResolve() throws java.io.ObjectStreamException { + return fromValue(_value_); + } + + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumSerializer( + _javaType, _xmlType); + } + + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumDeserializer( + _javaType, _xmlType); + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TInstanceStatus.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceStatus")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } +} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceSummary.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceSummary.java similarity index 75% rename from org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceSummary.java rename to org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceSummary.java index 37786d51c..04a661db1 100644 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceSummary.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceSummary.java @@ -1,17 +1,15 @@ /** * TInstanceSummary.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; - /** * A summary of the number of instances in each state. */ -public class TInstanceSummary implements java.io.Serializable { +public class TInstanceSummary implements java.io.Serializable { private org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances[] instances; private org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures; @@ -20,27 +18,23 @@ public TInstanceSummary() { } public TInstanceSummary( - org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances[] instances, - org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures) { - this.instances = instances; - this.failures = failures; + org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances[] instances, + org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures) { + this.instances = instances; + this.failures = failures; } - /** * Gets the instances value for this TInstanceSummary. - * + * * @return instances */ public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances[] getInstances() { return instances; } - /** * Sets the instances value for this TInstanceSummary. - * - * @param instances */ public void setInstances(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances[] instances) { this.instances = instances; @@ -54,27 +48,24 @@ public void setInstances(int i, org.apache.www.ode.pmapi.types._2006._08._02.TIn this.instances[i] = _value; } - /** * Gets the failures value for this TInstanceSummary. - * + * * @return failures */ public org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo getFailures() { return failures; } - /** * Sets the failures value for this TInstanceSummary. - * - * @param failures */ public void setFailures(org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures) { this.failures = failures; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof TInstanceSummary)) return false; TInstanceSummary other = (TInstanceSummary) obj; @@ -85,18 +76,19 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.instances==null && other.getInstances()==null) || - (this.instances!=null && - java.util.Arrays.equals(this.instances, other.getInstances()))) && - ((this.failures==null && other.getFailures()==null) || - (this.failures!=null && - this.failures.equals(other.getFailures()))); + _equals = true && + ((this.instances == null && other.getInstances() == null) || + (this.instances != null && + java.util.Arrays.equals(this.instances, other.getInstances()))) && + ((this.failures == null && other.getFailures() == null) || + (this.failures != null && + this.failures.equals(other.getFailures()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -104,8 +96,8 @@ public synchronized int hashCode() { __hashCodeCalc = true; int _hashCode = 1; if (getInstances() != null) { - for (int i=0; - i + * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.apache.www.ode.pmapi.types._2006._08._02; -public class TInstanceSummaryInstances implements java.io.Serializable { +public class TInstanceSummaryInstances implements java.io.Serializable { private org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus state; // attribute private int count; // attribute @@ -16,53 +15,46 @@ public TInstanceSummaryInstances() { } public TInstanceSummaryInstances( - org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus state, - int count) { - this.state = state; - this.count = count; + org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus state, + int count) { + this.state = state; + this.count = count; } - /** * Gets the state value for this TInstanceSummaryInstances. - * + * * @return state */ public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus getState() { return state; } - /** * Sets the state value for this TInstanceSummaryInstances. - * - * @param state */ public void setState(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus state) { this.state = state; } - /** * Gets the count value for this TInstanceSummaryInstances. - * + * * @return count */ public int getCount() { return count; } - /** * Sets the count value for this TInstanceSummaryInstances. - * - * @param count */ public void setCount(int count) { this.count = count; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof TInstanceSummaryInstances)) return false; TInstanceSummaryInstances other = (TInstanceSummaryInstances) obj; @@ -73,16 +65,17 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this.state==null && other.getState()==null) || - (this.state!=null && - this.state.equals(other.getState()))) && + _equals = true && + ((this.state == null && other.getState() == null) || + (this.state != null && + this.state.equals(other.getState()))) && this.count == other.getCount(); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -126,24 +119,23 @@ public static org.apache.axis.description.TypeDesc getTypeDesc() { * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); } - } diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessInfo.java new file mode 100644 index 000000000..e6c990582 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessInfo.java @@ -0,0 +1,462 @@ +/** + * TProcessInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Information about a BPEL process. + */ +public class TProcessInfo implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { + /* The unique name/id of the process. */ + private java.lang.String pid; + + /* Process status. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus status; + + /* Process version. */ + private long version; + + /* Information about the process + * definition. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo definitionInfo; + + /* Information about the process + * deployment. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo deploymentInfo; + + /* Summary of the instances belonging to this + * process. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary instanceSummary; + + /* Process properties. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[] properties; + + /* Endpoint references. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints; + + /* Process documents */ + private org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[] documents; + + private org.apache.axis.message.MessageElement[] _any; + + public TProcessInfo() { + } + + public TProcessInfo( + java.lang.String pid, + org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus status, + long version, + org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo definitionInfo, + org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo deploymentInfo, + org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary instanceSummary, + org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[] properties, + org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints, + org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[] documents, + org.apache.axis.message.MessageElement[] _any) { + this.pid = pid; + this.status = status; + this.version = version; + this.definitionInfo = definitionInfo; + this.deploymentInfo = deploymentInfo; + this.instanceSummary = instanceSummary; + this.properties = properties; + this.endpoints = endpoints; + this.documents = documents; + this._any = _any; + } + + /** + * Gets the pid value for this TProcessInfo. + * + * @return pid * The unique name/id of the process. + */ + public java.lang.String getPid() { + return pid; + } + + /** + * Sets the pid value for this TProcessInfo. + * + * @param pid * The unique name/id of the process. + */ + public void setPid(java.lang.String pid) { + this.pid = pid; + } + + /** + * Gets the status value for this TProcessInfo. + * + * @return status * Process status. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus getStatus() { + return status; + } + + /** + * Sets the status value for this TProcessInfo. + * + * @param status * Process status. + */ + public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus status) { + this.status = status; + } + + /** + * Gets the version value for this TProcessInfo. + * + * @return version * Process version. + */ + public long getVersion() { + return version; + } + + /** + * Sets the version value for this TProcessInfo. + * + * @param version * Process version. + */ + public void setVersion(long version) { + this.version = version; + } + + /** + * Gets the definitionInfo value for this TProcessInfo. + * + * @return definitionInfo * Information about the process definition. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo getDefinitionInfo() { + return definitionInfo; + } + + /** + * Sets the definitionInfo value for this TProcessInfo. + * + * @param definitionInfo * Information about the process definition. + */ + public void setDefinitionInfo(org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo definitionInfo) { + this.definitionInfo = definitionInfo; + } + + /** + * Gets the deploymentInfo value for this TProcessInfo. + * + * @return deploymentInfo * Information about the process deployment. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo getDeploymentInfo() { + return deploymentInfo; + } + + /** + * Sets the deploymentInfo value for this TProcessInfo. + * + * @param deploymentInfo * Information about the process deployment. + */ + public void setDeploymentInfo(org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo deploymentInfo) { + this.deploymentInfo = deploymentInfo; + } + + /** + * Gets the instanceSummary value for this TProcessInfo. + * + * @return instanceSummary * Summary of the instances belonging to this process. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary getInstanceSummary() { + return instanceSummary; + } + + /** + * Sets the instanceSummary value for this TProcessInfo. + * + * @param instanceSummary * Summary of the instances belonging to this process. + */ + public void setInstanceSummary(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary instanceSummary) { + this.instanceSummary = instanceSummary; + } + + /** + * Gets the properties value for this TProcessInfo. + * + * @return properties * Process properties. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[] getProperties() { + return properties; + } + + /** + * Sets the properties value for this TProcessInfo. + * + * @param properties * Process properties. + */ + public void setProperties(org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[] properties) { + this.properties = properties; + } + + /** + * Gets the endpoints value for this TProcessInfo. + * + * @return endpoints * Endpoint references. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] getEndpoints() { + return endpoints; + } + + /** + * Sets the endpoints value for this TProcessInfo. + * + * @param endpoints * Endpoint references. + */ + public void setEndpoints(org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints) { + this.endpoints = endpoints; + } + + /** + * Gets the documents value for this TProcessInfo. + * + * @return documents * Process documents + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[] getDocuments() { + return documents; + } + + /** + * Sets the documents value for this TProcessInfo. + * + * @param documents * Process documents + */ + public void setDocuments(org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[] documents) { + this.documents = documents; + } + + /** + * Gets the _any value for this TProcessInfo. + * + * @return _any + */ + public org.apache.axis.message.MessageElement[] get_any() { + return _any; + } + + /** + * Sets the _any value for this TProcessInfo. + */ + public void set_any(org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TProcessInfo)) return false; + TProcessInfo other = (TProcessInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.pid == null && other.getPid() == null) || + (this.pid != null && + this.pid.equals(other.getPid()))) && + ((this.status == null && other.getStatus() == null) || + (this.status != null && + this.status.equals(other.getStatus()))) && + this.version == other.getVersion() && + ((this.definitionInfo == null && other.getDefinitionInfo() == null) || + (this.definitionInfo != null && + this.definitionInfo.equals(other.getDefinitionInfo()))) && + ((this.deploymentInfo == null && other.getDeploymentInfo() == null) || + (this.deploymentInfo != null && + this.deploymentInfo.equals(other.getDeploymentInfo()))) && + ((this.instanceSummary == null && other.getInstanceSummary() == null) || + (this.instanceSummary != null && + this.instanceSummary.equals(other.getInstanceSummary()))) && + ((this.properties == null && other.getProperties() == null) || + (this.properties != null && + java.util.Arrays.equals(this.properties, other.getProperties()))) && + ((this.endpoints == null && other.getEndpoints() == null) || + (this.endpoints != null && + java.util.Arrays.equals(this.endpoints, other.getEndpoints()))) && + ((this.documents == null && other.getDocuments() == null) || + (this.documents != null && + java.util.Arrays.equals(this.documents, other.getDocuments()))) && + ((this._any == null && other.get_any() == null) || + (this._any != null && + java.util.Arrays.equals(this._any, other.get_any()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getPid() != null) { + _hashCode += getPid().hashCode(); + } + if (getStatus() != null) { + _hashCode += getStatus().hashCode(); + } + _hashCode += new Long(getVersion()).hashCode(); + if (getDefinitionInfo() != null) { + _hashCode += getDefinitionInfo().hashCode(); + } + if (getDeploymentInfo() != null) { + _hashCode += getDeploymentInfo().hashCode(); + } + if (getInstanceSummary() != null) { + _hashCode += getInstanceSummary().hashCode(); + } + if (getProperties() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getProperties()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getProperties(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getEndpoints() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getEndpoints()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getEndpoints(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getDocuments() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getDocuments()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getDocuments(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (get_any() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(get_any()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(get_any(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TProcessInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("pid"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "pid")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("status"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "status")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessStatus")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("version"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "version")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("definitionInfo"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "definition-info")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDefinitionInfo")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("deploymentInfo"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "deployment-info")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDeploymentInfo")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("instanceSummary"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "instance-summary")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceSummary")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("properties"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "properties")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property")); + elemField.setNillable(false); + elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "property")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("endpoints"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoints")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref")); + elemField.setNillable(false); + elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoint-ref")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("documents"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "documents")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo")); + elemField.setNillable(false); + elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "document")); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessPropertiesProperty.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessPropertiesProperty.java new file mode 100644 index 000000000..fc21de376 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessPropertiesProperty.java @@ -0,0 +1,148 @@ +/** + * TProcessPropertiesProperty.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TProcessPropertiesProperty implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { + private org.apache.axis.message.MessageElement[] _any; + + private javax.xml.namespace.QName name; // attribute + + public TProcessPropertiesProperty() { + } + + public TProcessPropertiesProperty( + org.apache.axis.message.MessageElement[] _any, + javax.xml.namespace.QName name) { + this._any = _any; + this.name = name; + } + + /** + * Gets the _any value for this TProcessPropertiesProperty. + * + * @return _any + */ + public org.apache.axis.message.MessageElement[] get_any() { + return _any; + } + + /** + * Sets the _any value for this TProcessPropertiesProperty. + */ + public void set_any(org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + /** + * Gets the name value for this TProcessPropertiesProperty. + * + * @return name + */ + public javax.xml.namespace.QName getName() { + return name; + } + + /** + * Sets the name value for this TProcessPropertiesProperty. + */ + public void setName(javax.xml.namespace.QName name) { + this.name = name; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TProcessPropertiesProperty)) return false; + TProcessPropertiesProperty other = (TProcessPropertiesProperty) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this._any == null && other.get_any() == null) || + (this._any != null && + java.util.Arrays.equals(this._any, other.get_any()))) && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (get_any() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(get_any()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(get_any(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getName() != null) { + _hashCode += getName().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TProcessPropertiesProperty.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property")); + org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("name"); + attrField.setXmlName(new javax.xml.namespace.QName("", "name")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); + typeDesc.addFieldDesc(attrField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessStatus.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessStatus.java new file mode 100644 index 000000000..16cb361a8 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessStatus.java @@ -0,0 +1,89 @@ +/** + * TProcessStatus.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TProcessStatus implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected TProcessStatus(java.lang.String value) { + _value_ = value; + _table_.put(_value_, this); + } + + public static final java.lang.String _ACTIVE = "ACTIVE"; + public static final java.lang.String _RETIRED = "RETIRED"; + public static final TProcessStatus ACTIVE = new TProcessStatus(_ACTIVE); + public static final TProcessStatus RETIRED = new TProcessStatus(_RETIRED); + + public java.lang.String getValue() { + return _value_; + } + + public static TProcessStatus fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + TProcessStatus enumeration = (TProcessStatus) + _table_.get(value); + if (enumeration == null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + + public static TProcessStatus fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + + public boolean equals(java.lang.Object obj) { + return (obj == this); + } + + public int hashCode() { + return toString().hashCode(); + } + + public java.lang.String toString() { + return _value_; + } + + public java.lang.Object readResolve() throws java.io.ObjectStreamException { + return fromValue(_value_); + } + + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumSerializer( + _javaType, _xmlType); + } + + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumDeserializer( + _javaType, _xmlType); + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TProcessStatus.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessStatus")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeInfo.java new file mode 100644 index 000000000..d8c7d598f --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeInfo.java @@ -0,0 +1,441 @@ +/** + * TScopeInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TScopeInfo implements java.io.Serializable { + /* Scope instance identifier. */ + private java.lang.String siid; + + /* Scope name. */ + private java.lang.String name; + + /* Scope instance identifier. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status; + + /* Parent scope reference. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef parentScopeRef; + + private org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[] children; + + private org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[] activities; + + private org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[] variables; + + /* Lists all correlation correlation sets associated with + * this scope with their valued correlation properties. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][] correlationSets; + + /* Endpoint references. */ + private org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints; + + public TScopeInfo() { + } + + public TScopeInfo( + java.lang.String siid, + java.lang.String name, + org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status, + org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef parentScopeRef, + org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[] children, + org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[] activities, + org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[] variables, + org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][] correlationSets, + org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints) { + this.siid = siid; + this.name = name; + this.status = status; + this.parentScopeRef = parentScopeRef; + this.children = children; + this.activities = activities; + this.variables = variables; + this.correlationSets = correlationSets; + this.endpoints = endpoints; + } + + /** + * Gets the siid value for this TScopeInfo. + * + * @return siid * Scope instance identifier. + */ + public java.lang.String getSiid() { + return siid; + } + + /** + * Sets the siid value for this TScopeInfo. + * + * @param siid * Scope instance identifier. + */ + public void setSiid(java.lang.String siid) { + this.siid = siid; + } + + /** + * Gets the name value for this TScopeInfo. + * + * @return name * Scope name. + */ + public java.lang.String getName() { + return name; + } + + /** + * Sets the name value for this TScopeInfo. + * + * @param name * Scope name. + */ + public void setName(java.lang.String name) { + this.name = name; + } + + /** + * Gets the status value for this TScopeInfo. + * + * @return status * Scope instance identifier. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus getStatus() { + return status; + } + + /** + * Sets the status value for this TScopeInfo. + * + * @param status * Scope instance identifier. + */ + public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status) { + this.status = status; + } + + /** + * Gets the parentScopeRef value for this TScopeInfo. + * + * @return parentScopeRef * Parent scope reference. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef getParentScopeRef() { + return parentScopeRef; + } + + /** + * Sets the parentScopeRef value for this TScopeInfo. + * + * @param parentScopeRef * Parent scope reference. + */ + public void setParentScopeRef(org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef parentScopeRef) { + this.parentScopeRef = parentScopeRef; + } + + /** + * Gets the children value for this TScopeInfo. + * + * @return children + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[] getChildren() { + return children; + } + + /** + * Sets the children value for this TScopeInfo. + */ + public void setChildren(org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[] children) { + this.children = children; + } + + /** + * Gets the activities value for this TScopeInfo. + * + * @return activities + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[] getActivities() { + return activities; + } + + /** + * Sets the activities value for this TScopeInfo. + */ + public void setActivities(org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[] activities) { + this.activities = activities; + } + + /** + * Gets the variables value for this TScopeInfo. + * + * @return variables + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[] getVariables() { + return variables; + } + + /** + * Sets the variables value for this TScopeInfo. + */ + public void setVariables(org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[] variables) { + this.variables = variables; + } + + /** + * Gets the correlationSets value for this TScopeInfo. + * + * @return correlationSets * Lists all correlation correlation sets associated with this scope with their valued + * correlation properties. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][] getCorrelationSets() { + return correlationSets; + } + + /** + * Sets the correlationSets value for this TScopeInfo. + * + * @param correlationSets * Lists all correlation correlation sets associated with this scope with their valued + * correlation properties. + */ + public void setCorrelationSets(org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][] correlationSets) { + this.correlationSets = correlationSets; + } + + /** + * Gets the endpoints value for this TScopeInfo. + * + * @return endpoints * Endpoint references. + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] getEndpoints() { + return endpoints; + } + + /** + * Sets the endpoints value for this TScopeInfo. + * + * @param endpoints * Endpoint references. + */ + public void setEndpoints(org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints) { + this.endpoints = endpoints; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TScopeInfo)) return false; + TScopeInfo other = (TScopeInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.siid == null && other.getSiid() == null) || + (this.siid != null && + this.siid.equals(other.getSiid()))) && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))) && + ((this.status == null && other.getStatus() == null) || + (this.status != null && + this.status.equals(other.getStatus()))) && + ((this.parentScopeRef == null && other.getParentScopeRef() == null) || + (this.parentScopeRef != null && + this.parentScopeRef.equals(other.getParentScopeRef()))) && + ((this.children == null && other.getChildren() == null) || + (this.children != null && + java.util.Arrays.equals(this.children, other.getChildren()))) && + ((this.activities == null && other.getActivities() == null) || + (this.activities != null && + java.util.Arrays.equals(this.activities, other.getActivities()))) && + ((this.variables == null && other.getVariables() == null) || + (this.variables != null && + java.util.Arrays.equals(this.variables, other.getVariables()))) && + ((this.correlationSets == null && other.getCorrelationSets() == null) || + (this.correlationSets != null && + java.util.Arrays.equals(this.correlationSets, other.getCorrelationSets()))) && + ((this.endpoints == null && other.getEndpoints() == null) || + (this.endpoints != null && + java.util.Arrays.equals(this.endpoints, other.getEndpoints()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getSiid() != null) { + _hashCode += getSiid().hashCode(); + } + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getStatus() != null) { + _hashCode += getStatus().hashCode(); + } + if (getParentScopeRef() != null) { + _hashCode += getParentScopeRef().hashCode(); + } + if (getChildren() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getChildren()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getChildren(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getActivities() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getActivities()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getActivities(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getVariables() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getVariables()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getVariables(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getCorrelationSets() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getCorrelationSets()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getCorrelationSets(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + if (getEndpoints() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(getEndpoints()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(getEndpoints(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TScopeInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("siid"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "siid")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("status"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "status")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("parentScopeRef"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "parent-scope-ref")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("children"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "children")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "child-ref")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("activities"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activities")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-info")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("variables"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "variables")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "variable-ref")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("correlationSets"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-sets")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-set")); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("endpoints"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoints")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref")); + elemField.setNillable(false); + elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoint-ref")); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeRef.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeRef.java new file mode 100644 index 000000000..7e3a8a5cb --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeRef.java @@ -0,0 +1,210 @@ +/** + * TScopeRef.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Reference to a scope. + */ +public class TScopeRef implements java.io.Serializable { + private java.lang.String siid; // attribute + + private java.lang.String name; // attribute + + private java.lang.String modelId; // attribute + + private org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status; // attribute + + public TScopeRef() { + } + + public TScopeRef( + java.lang.String siid, + java.lang.String name, + java.lang.String modelId, + org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status) { + this.siid = siid; + this.name = name; + this.modelId = modelId; + this.status = status; + } + + /** + * Gets the siid value for this TScopeRef. + * + * @return siid + */ + public java.lang.String getSiid() { + return siid; + } + + /** + * Sets the siid value for this TScopeRef. + */ + public void setSiid(java.lang.String siid) { + this.siid = siid; + } + + /** + * Gets the name value for this TScopeRef. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + /** + * Sets the name value for this TScopeRef. + */ + public void setName(java.lang.String name) { + this.name = name; + } + + /** + * Gets the modelId value for this TScopeRef. + * + * @return modelId + */ + public java.lang.String getModelId() { + return modelId; + } + + /** + * Sets the modelId value for this TScopeRef. + */ + public void setModelId(java.lang.String modelId) { + this.modelId = modelId; + } + + /** + * Gets the status value for this TScopeRef. + * + * @return status + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus getStatus() { + return status; + } + + /** + * Sets the status value for this TScopeRef. + */ + public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status) { + this.status = status; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TScopeRef)) return false; + TScopeRef other = (TScopeRef) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.siid == null && other.getSiid() == null) || + (this.siid != null && + this.siid.equals(other.getSiid()))) && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))) && + ((this.modelId == null && other.getModelId() == null) || + (this.modelId != null && + this.modelId.equals(other.getModelId()))) && + ((this.status == null && other.getStatus() == null) || + (this.status != null && + this.status.equals(other.getStatus()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getSiid() != null) { + _hashCode += getSiid().hashCode(); + } + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getModelId() != null) { + _hashCode += getModelId().hashCode(); + } + if (getStatus() != null) { + _hashCode += getStatus().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TScopeRef.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef")); + org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("siid"); + attrField.setXmlName(new javax.xml.namespace.QName("", "siid")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("name"); + attrField.setXmlName(new javax.xml.namespace.QName("", "name")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("modelId"); + attrField.setXmlName(new javax.xml.namespace.QName("", "modelId")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("status"); + attrField.setXmlName(new javax.xml.namespace.QName("", "status")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus")); + typeDesc.addFieldDesc(attrField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeStatus.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeStatus.java new file mode 100644 index 000000000..1f5d533fb --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeStatus.java @@ -0,0 +1,97 @@ +/** + * TScopeStatus.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TScopeStatus implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected TScopeStatus(java.lang.String value) { + _value_ = value; + _table_.put(_value_, this); + } + + public static final java.lang.String _ACTIVE = "ACTIVE"; + public static final java.lang.String _COMPLETED = "COMPLETED"; + public static final java.lang.String _FAULTED = "FAULTED"; + public static final java.lang.String _FAULTHANDLING = "FAULTHANDLING"; + public static final java.lang.String _COMPENSATING = "COMPENSATING"; + public static final java.lang.String _COMPENSATED = "COMPENSATED"; + public static final TScopeStatus ACTIVE = new TScopeStatus(_ACTIVE); + public static final TScopeStatus COMPLETED = new TScopeStatus(_COMPLETED); + public static final TScopeStatus FAULTED = new TScopeStatus(_FAULTED); + public static final TScopeStatus FAULTHANDLING = new TScopeStatus(_FAULTHANDLING); + public static final TScopeStatus COMPENSATING = new TScopeStatus(_COMPENSATING); + public static final TScopeStatus COMPENSATED = new TScopeStatus(_COMPENSATED); + + public java.lang.String getValue() { + return _value_; + } + + public static TScopeStatus fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + TScopeStatus enumeration = (TScopeStatus) + _table_.get(value); + if (enumeration == null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + + public static TScopeStatus fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + + public boolean equals(java.lang.Object obj) { + return (obj == this); + } + + public int hashCode() { + return toString().hashCode(); + } + + public java.lang.String toString() { + return _value_; + } + + public java.lang.Object readResolve() throws java.io.ObjectStreamException { + return fromValue(_value_); + } + + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumSerializer( + _javaType, _xmlType); + } + + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.EnumDeserializer( + _javaType, _xmlType); + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TScopeStatus.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfo.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfo.java new file mode 100644 index 000000000..5e1759e5b --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfo.java @@ -0,0 +1,151 @@ +/** + * TVariableInfo.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Information about a variable (basically the value) + */ +public class TVariableInfo implements java.io.Serializable { + private org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef self; + + private org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue value; + + public TVariableInfo() { + } + + public TVariableInfo( + org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef self, + org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue value) { + this.self = self; + this.value = value; + } + + /** + * Gets the self value for this TVariableInfo. + * + * @return self + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef getSelf() { + return self; + } + + /** + * Sets the self value for this TVariableInfo. + */ + public void setSelf(org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef self) { + this.self = self; + } + + /** + * Gets the value value for this TVariableInfo. + * + * @return value + */ + public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue getValue() { + return value; + } + + /** + * Sets the value value for this TVariableInfo. + */ + public void setValue(org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue value) { + this.value = value; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TVariableInfo)) return false; + TVariableInfo other = (TVariableInfo) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.self == null && other.getSelf() == null) || + (this.self != null && + this.self.equals(other.getSelf()))) && + ((this.value == null && other.getValue() == null) || + (this.value != null && + this.value.equals(other.getValue()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getSelf() != null) { + _hashCode += getSelf().hashCode(); + } + if (getValue() != null) { + _hashCode += getValue().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TVariableInfo.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("self"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "self")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("value"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "value")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tVariableInfo>value")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfoValue.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfoValue.java new file mode 100644 index 000000000..e226ca5a1 --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfoValue.java @@ -0,0 +1,117 @@ +/** + * TVariableInfoValue.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +public class TVariableInfoValue implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { + private org.apache.axis.message.MessageElement[] _any; + + public TVariableInfoValue() { + } + + public TVariableInfoValue( + org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + /** + * Gets the _any value for this TVariableInfoValue. + * + * @return _any + */ + public org.apache.axis.message.MessageElement[] get_any() { + return _any; + } + + /** + * Sets the _any value for this TVariableInfoValue. + */ + public void set_any(org.apache.axis.message.MessageElement[] _any) { + this._any = _any; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TVariableInfoValue)) return false; + TVariableInfoValue other = (TVariableInfoValue) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this._any == null && other.get_any() == null) || + (this._any != null && + java.util.Arrays.equals(this._any, other.get_any()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (get_any() != null) { + for (int i = 0; + i < java.lang.reflect.Array.getLength(get_any()); + i++) { + java.lang.Object obj = java.lang.reflect.Array.get(get_any(), i); + if (obj != null && + !obj.getClass().isArray()) { + _hashCode += obj.hashCode(); + } + } + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TVariableInfoValue.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tVariableInfo>value")); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableRef.java b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableRef.java new file mode 100644 index 000000000..42679af5b --- /dev/null +++ b/org.opentosca.container.connector.ode/src/main/java/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableRef.java @@ -0,0 +1,179 @@ +/** + * TVariableRef.java + *

+ * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.apache.www.ode.pmapi.types._2006._08._02; + +/** + * Reference to a variable. + */ +public class TVariableRef implements java.io.Serializable { + private java.lang.String iid; // attribute + + private java.lang.String siid; // attribute + + private java.lang.String name; // attribute + + public TVariableRef() { + } + + public TVariableRef( + java.lang.String iid, + java.lang.String siid, + java.lang.String name) { + this.iid = iid; + this.siid = siid; + this.name = name; + } + + /** + * Gets the iid value for this TVariableRef. + * + * @return iid + */ + public java.lang.String getIid() { + return iid; + } + + /** + * Sets the iid value for this TVariableRef. + */ + public void setIid(java.lang.String iid) { + this.iid = iid; + } + + /** + * Gets the siid value for this TVariableRef. + * + * @return siid + */ + public java.lang.String getSiid() { + return siid; + } + + /** + * Sets the siid value for this TVariableRef. + */ + public void setSiid(java.lang.String siid) { + this.siid = siid; + } + + /** + * Gets the name value for this TVariableRef. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + /** + * Sets the name value for this TVariableRef. + */ + public void setName(java.lang.String name) { + this.name = name; + } + + private java.lang.Object __equalsCalc = null; + + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof TVariableRef)) return false; + TVariableRef other = (TVariableRef) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.iid == null && other.getIid() == null) || + (this.iid != null && + this.iid.equals(other.getIid()))) && + ((this.siid == null && other.getSiid() == null) || + (this.siid != null && + this.siid.equals(other.getSiid()))) && + ((this.name == null && other.getName() == null) || + (this.name != null && + this.name.equals(other.getName()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getIid() != null) { + _hashCode += getIid().hashCode(); + } + if (getSiid() != null) { + _hashCode += getSiid().hashCode(); + } + if (getName() != null) { + _hashCode += getName().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(TVariableRef.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef")); + org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("iid"); + attrField.setXmlName(new javax.xml.namespace.QName("", "iid")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("siid"); + attrField.setXmlName(new javax.xml.namespace.QName("", "siid")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + attrField = new org.apache.axis.description.AttributeDesc(); + attrField.setFieldName("name"); + attrField.setXmlName(new javax.xml.namespace.QName("", "name")); + attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + typeDesc.addFieldDesc(attrField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } +} diff --git a/org.opentosca.container.connector.ode/src/org/opentosca/container/connector/ode/OdeConnector.java b/org.opentosca.container.connector.ode/src/main/java/org/opentosca/container/connector/ode/OdeConnector.java similarity index 92% rename from org.opentosca.container.connector.ode/src/org/opentosca/container/connector/ode/OdeConnector.java rename to org.opentosca.container.connector.ode/src/main/java/org/opentosca/container/connector/ode/OdeConnector.java index 48c9de4a1..a68f021eb 100644 --- a/org.opentosca.container.connector.ode/src/org/opentosca/container/connector/ode/OdeConnector.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/opentosca/container/connector/ode/OdeConnector.java @@ -42,7 +42,7 @@ * This class is a connector to deploy and undeploy a * WS-BPEL 2.0 Processes on a * Apache ODE BPEL engine. - * + *

* The class uses the generated stubs of:
*

    *
  • /META-INF/resources/deploy.wsdl
  • @@ -56,13 +56,13 @@ public class OdeConnector { - private String address; - private final static String NS_SERVICE_REF = "http://docs.oasis-open.org/wsbpel/2.0/serviceref"; private final static String NS_WS_ADDRESSING = "http://www.w3.org/2005/08/addressing"; private final static Logger LOG = LoggerFactory.getLogger(OdeConnector.class); + private String address; + /** * Sets the endpoint of this connector * @@ -77,9 +77,8 @@ private void setEndpoint(final String uri) { * Deploys a WS-BPEL 2.0 process unto the referenced Apache ODE * * @param process the process to deploy packaged for a Apache ODE - * @param uri the URI of the Apache ODE - * @return a string containing the PID (ProcessId) of the deployed process if everything was - * successful, else null + * @param uri the URI of the Apache ODE + * @return a string containing the PID (ProcessId) of the deployed process if everything was successful, else null */ public String deploy(final File process, final String uri) throws Exception { if (uri == null) { @@ -105,8 +104,7 @@ public String deploy(final File process, final String uri) throws Exception { // as we don't want ODE to be overworked we wait here try { Thread.sleep(2000); - } - catch (final InterruptedException e) { + } catch (final InterruptedException e) { e.printStackTrace(); } } @@ -133,21 +131,16 @@ public String deploy(final File process, final String uri) throws Exception { info = client.getProcessInfo(processId); Thread.sleep(500); } - - } - catch (final ManagementFault e) { + } catch (final ManagementFault e) { OdeConnector.LOG.error("The Process isn't valid", e); return null; - } - catch (final RemoteException e) { + } catch (final RemoteException e) { OdeConnector.LOG.error("RemoteException: Server not available", e); return null; - } - catch (final UnknownHostException e) { + } catch (final UnknownHostException e) { OdeConnector.LOG.error("UnknownHostException: ", e); return null; - } - catch (final InterruptedException e) { + } catch (final InterruptedException e) { OdeConnector.LOG.error("InterruptedException: ", e); return null; } @@ -187,7 +180,7 @@ private String calcHighestPid(final List pids, final String packageId) { Collections.sort(idNums); final int highestNumber = idNums.get(idNums.size() - 1); for (final QName pid : pids) { - if (pid.getLocalPart().endsWith("-" + String.valueOf(highestNumber))) { + if (pid.getLocalPart().endsWith("-" + highestNumber)) { return pid.toString(); } } @@ -199,7 +192,7 @@ private String calcHighestPid(final List pids, final String packageId) { * Returns pids for the given package on the referenced ODE * * @param packageId a String representing the packageId on a ODE - * @param uri the uri to the ODE + * @param uri the uri to the ODE * @return a possibly empty List of QName denoting PIDs */ public List getPIDsForPackageId(final String packageId, final String uri) { @@ -212,7 +205,6 @@ public List getPIDsForPackageId(final String packageId, final String uri) // Create a new deployment client final DeploymentPortType client = getDeploymentServiceClient(); - // Retrieve the process ids contained in the given package QName[] processIds; try { @@ -227,8 +219,7 @@ public List getPIDsForPackageId(final String packageId, final String uri) pids.add(pid); } } - } - catch (final RemoteException e) { + } catch (final RemoteException e) { OdeConnector.LOG.error("Fetching process ids for package '" + packageId + "' caused an exception.", e); } @@ -239,7 +230,7 @@ public List getPIDsForPackageId(final String packageId, final String uri) * Undeploys a package from the referenced ODE * * @param packageName The packageName (on a ODE) of the process deployment unit to undeploy - * @param uri the uri of the ODE to undeploy from + * @param uri the uri of the ODE to undeploy from * @return true if undeployment was successful */ public boolean undeploy(final String packageName, final String uri) { @@ -250,9 +241,7 @@ public boolean undeploy(final String packageName, final String uri) { // Update the service endpoint setEndpoint(uri); - try { - final DeploymentPortType client = getDeploymentServiceClient(); final String[] deployedPackages = client.listDeployedPackages(); @@ -267,9 +256,13 @@ public boolean undeploy(final String packageName, final String uri) { final String pid = calcHighestPidForStrings(filteredPackages, packageName); + if (pid == null || pid.isEmpty()) { + OdeConnector.LOG.error("PID was not correctly defined, aborting undeploy"); + return false; + } + client.undeploy(QName.valueOf(pid)); - } - catch (final RemoteException e) { + } catch (final RemoteException e) { OdeConnector.LOG.error("Trying to undeploy package '" + packageName + "' caused an exception.", e); } @@ -280,7 +273,7 @@ public boolean undeploy(final String packageName, final String uri) { * Undeploys a BPEL Process which is given as a zip file * * @param file the BPEL Process to undeploy as a zip file - * @param uri the URI of the ODE the process has to be undeployed + * @param uri the URI of the ODE the process has to be undeployed * @return true iff undeployment was successful */ public boolean undeploy(final File file, final String uri) { @@ -316,7 +309,7 @@ public boolean undeploy(final File file, final String uri) { /** * Deploys process archive referenced in FileObject * - * @param file process archive to deploy + * @param file process archive to deploy * @param fileName name of the process archive file * @param fileType type of the process archive file * @return the packageName of the uploaded package @@ -361,8 +354,7 @@ public List getDeployedPackages(final String uri) { String[] packages = null; try { packages = client.listDeployedPackages(); - } - catch (final RemoteException e) { + } catch (final RemoteException e) { OdeConnector.LOG.error("Trying to resolve all deployed packages caused an exception.", e); } @@ -376,12 +368,10 @@ public List getDeployedPackages(final String uri) { } /** - * Returns a map from partnerLink as string to endpoints as URIs, denoting the service addresses of - * the inbound partnerLinks', i.e., partnerLinks having a 'myRole' attribute which is implemented by - * the process. + * Returns a map from partnerLink as string to endpoints as URIs, denoting the service addresses of the inbound + * partnerLinks', i.e., partnerLinks having a 'myRole' attribute which is implemented by the process. * - * @param pid the PID of the BPEL 2.0 Process, from which the partnerlink endpoints should be - * determined + * @param pid the PID of the BPEL 2.0 Process, from which the partnerlink endpoints should be determined * @param uri the URI to ODE * @return a Map from String to URI denoting partnerLinks and their endpoints */ @@ -442,20 +432,17 @@ public Map getEndpointsForPID(final String pid, final String uri) { if (endpointRef.getMyRole() != null) { partnerLinkToEndpointURIs.put(partnerLink, serviceURI); } - } - catch (final URISyntaxException e) { + } catch (final URISyntaxException e) { OdeConnector.LOG.error("Trying to create a service URI for the endpoint {} caused a URISyntaxException.", - endpointString); + endpointString); } } } } } - } - catch (final ManagementFault e) { + } catch (final ManagementFault e) { OdeConnector.LOG.error("Unable to resolve the list of endpoints for process model with pid={}", pid); - } - catch (final RemoteException e) { + } catch (final RemoteException e) { OdeConnector.LOG.error("Trying to resolve a list of endpoints for process model with pid '" + pid + "' caused an exception.", e); } @@ -519,8 +506,7 @@ public List getAllPIDs(final String uri) { for (final TProcessInfo pinfo : processList) { pidStringList.add(pinfo.getPid()); } - } - catch (final RemoteException e) { + } catch (final RemoteException e) { OdeConnector.LOG.error("Unable to resolve a list of all processes available at ODE", e); } @@ -546,11 +532,9 @@ private ProcessManagementPortType getProcessManagementServiceClient() { try { final URL url = new URL(serviceLocation); client = new ProcessManagementServiceLocator().getProcessManagementPort(url); - } - catch (final MalformedURLException e) { + } catch (final MalformedURLException e) { OdeConnector.LOG.error("Cannot resolve a URL from the service location {0}", serviceLocation); - } - catch (final ServiceException e) { + } catch (final ServiceException e) { OdeConnector.LOG.error("Initialization of a process management service client caused an exception.", e); } return client; @@ -567,11 +551,9 @@ private DeploymentPortType getDeploymentServiceClient() { try { final URL url = new URL(serviceLocation); client = new DeploymentServiceLocator().getDeploymentPort(url); - } - catch (final MalformedURLException e) { + } catch (final MalformedURLException e) { OdeConnector.LOG.error("Cannot resolve a URL from the service location {0}", serviceLocation); - } - catch (final ServiceException e) { + } catch (final ServiceException e) { OdeConnector.LOG.error("Initialization of a deployment service client caused an exception.", e); } return client; diff --git a/org.opentosca.container.connector.ode/src/org/w3/www/_2005/_05/xmlmime/Base64Binary.java b/org.opentosca.container.connector.ode/src/main/java/org/w3/www/_2005/_05/xmlmime/Base64Binary.java similarity index 76% rename from org.opentosca.container.connector.ode/src/org/w3/www/_2005/_05/xmlmime/Base64Binary.java rename to org.opentosca.container.connector.ode/src/main/java/org/w3/www/_2005/_05/xmlmime/Base64Binary.java index f23668336..b7bfb8f8d 100644 --- a/org.opentosca.container.connector.ode/src/org/w3/www/_2005/_05/xmlmime/Base64Binary.java +++ b/org.opentosca.container.connector.ode/src/main/java/org/w3/www/_2005/_05/xmlmime/Base64Binary.java @@ -1,13 +1,12 @@ /** * Base64Binary.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + *

    + * This file was auto-generated from WSDL by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package org.w3.www._2005._05.xmlmime; -public class Base64Binary implements java.io.Serializable, org.apache.axis.encoding.SimpleType { +public class Base64Binary implements java.io.Serializable, org.apache.axis.encoding.SimpleType { private byte[] _value; private java.lang.String contentType; // attribute @@ -19,6 +18,7 @@ public Base64Binary() { public Base64Binary(byte[] _value) { this._value = _value; } + public Base64Binary(java.lang.String _value) { this._value = org.apache.axis.encoding.Base64.decode(_value); } @@ -28,47 +28,40 @@ public java.lang.String toString() { return _value == null ? null : org.apache.axis.encoding.Base64.encode(_value); } - /** * Gets the _value value for this Base64Binary. - * + * * @return _value */ public byte[] get_value() { return _value; } - /** * Sets the _value value for this Base64Binary. - * - * @param _value */ public void set_value(byte[] _value) { this._value = _value; } - /** * Gets the contentType value for this Base64Binary. - * + * * @return contentType */ public java.lang.String getContentType() { return contentType; } - /** * Sets the contentType value for this Base64Binary. - * - * @param contentType */ public void setContentType(java.lang.String contentType) { this.contentType = contentType; } private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof Base64Binary)) return false; Base64Binary other = (Base64Binary) obj; @@ -79,18 +72,19 @@ public synchronized boolean equals(java.lang.Object obj) { } __equalsCalc = obj; boolean _equals; - _equals = true && - ((this._value==null && other.get_value()==null) || - (this._value!=null && - java.util.Arrays.equals(this._value, other.get_value()))) && - ((this.contentType==null && other.getContentType()==null) || - (this.contentType!=null && - this.contentType.equals(other.getContentType()))); + _equals = true && + ((this._value == null && other.get_value() == null) || + (this._value != null && + java.util.Arrays.equals(this._value, other.get_value()))) && + ((this.contentType == null && other.getContentType() == null) || + (this.contentType != null && + this.contentType.equals(other.getContentType()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; + public synchronized int hashCode() { if (__hashCodeCalc) { return 0; @@ -98,8 +92,8 @@ public synchronized int hashCode() { __hashCodeCalc = true; int _hashCode = 1; if (get_value() != null) { - for (int i=0; - icontentType"); - cachedSerQNames.add(qName); - cls = java.lang.String.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleSerializerFactory.class, cls, qName)); - cachedDeserFactories.add(org.apache.axis.encoding.ser.BaseDeserializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleDeserializerFactory.class, cls, qName)); - - qName = new javax.xml.namespace.QName("http://www.w3.org/2005/05/xmlmime", "base64Binary"); - cachedSerQNames.add(qName); - cls = org.w3.www._2005._05.xmlmime.Base64Binary.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleSerializerFactory.class, cls, qName)); - cachedDeserFactories.add(org.apache.axis.encoding.ser.BaseDeserializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleDeserializerFactory.class, cls, qName)); - - } - - protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { - try { - org.apache.axis.client.Call _call = super._createCall(); - if (super.maintainSessionSet) { - _call.setMaintainSession(super.maintainSession); - } - if (super.cachedUsername != null) { - _call.setUsername(super.cachedUsername); - } - if (super.cachedPassword != null) { - _call.setPassword(super.cachedPassword); - } - if (super.cachedEndpoint != null) { - _call.setTargetEndpointAddress(super.cachedEndpoint); - } - if (super.cachedTimeout != null) { - _call.setTimeout(super.cachedTimeout); - } - if (super.cachedPortName != null) { - _call.setPortName(super.cachedPortName); - } - java.util.Enumeration keys = super.cachedProperties.keys(); - while (keys.hasMoreElements()) { - java.lang.String key = (java.lang.String) keys.nextElement(); - _call.setProperty(key, super.cachedProperties.get(key)); - } - // All the type mapping information is registered - // when the first call is made. - // The type mapping information is actually registered in - // the TypeMappingRegistry of the service, which - // is the reason why registration is only needed for the first call. - synchronized (this) { - if (firstCall()) { - // must set encoding style before registering serializers - _call.setEncodingStyle(null); - for (int i = 0; i < cachedSerFactories.size(); ++i) { - java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); - javax.xml.namespace.QName qName = - (javax.xml.namespace.QName) cachedSerQNames.get(i); - java.lang.Object x = cachedSerFactories.get(i); - if (x instanceof Class) { - java.lang.Class sf = (java.lang.Class) - cachedSerFactories.get(i); - java.lang.Class df = (java.lang.Class) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { - org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) - cachedSerFactories.get(i); - org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - } - } - } - return _call; - } - catch (java.lang.Throwable _t) { - throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); - } - } - - public org.apache.www.ode.deployapi.DeployUnit deploy(java.lang.String name, org.apache.www.ode.deployapi._package _package) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[0]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "deploy")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {name, _package}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.deployapi.DeployUnit) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.deployapi.DeployUnit) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.deployapi.DeployUnit.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public boolean undeploy(javax.xml.namespace.QName packageName) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[1]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "undeploy")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {packageName}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return ((java.lang.Boolean) _resp).booleanValue(); - } catch (java.lang.Exception _exception) { - return ((java.lang.Boolean) org.apache.axis.utils.JavaUtils.convert(_resp, boolean.class)).booleanValue(); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public java.lang.String[] listDeployedPackages() throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[2]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listDeployedPackages")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (java.lang.String[]) _resp; - } catch (java.lang.Exception _exception) { - return (java.lang.String[]) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public javax.xml.namespace.QName[] listProcesses(java.lang.String packageName) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[3]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listProcesses")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {packageName}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (javax.xml.namespace.QName[]) _resp; - } catch (java.lang.Exception _exception) { - return (javax.xml.namespace.QName[]) org.apache.axis.utils.JavaUtils.convert(_resp, javax.xml.namespace.QName[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - - public java.lang.String getProcessPackage(javax.xml.namespace.QName processName) throws java.rmi.RemoteException { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[4]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getProcessPackage")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {processName}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (java.lang.String) _resp; - } catch (java.lang.Exception _exception) { - return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - throw axisFaultException; -} - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentPortTypeProxy.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentPortTypeProxy.java deleted file mode 100644 index 51e559ea3..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/DeploymentPortTypeProxy.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.apache.www.ode.deployapi; - -public class DeploymentPortTypeProxy implements org.apache.www.ode.deployapi.DeploymentPortType { - private String _endpoint = null; - private org.apache.www.ode.deployapi.DeploymentPortType deploymentPortType = null; - - public DeploymentPortTypeProxy() { - _initDeploymentPortTypeProxy(); - } - - public DeploymentPortTypeProxy(String endpoint) { - _endpoint = endpoint; - _initDeploymentPortTypeProxy(); - } - - private void _initDeploymentPortTypeProxy() { - try { - deploymentPortType = (new org.apache.www.ode.deployapi.DeploymentServiceLocator()).getDeploymentPort(); - if (deploymentPortType != null) { - if (_endpoint != null) - ((javax.xml.rpc.Stub)deploymentPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); - else - _endpoint = (String)((javax.xml.rpc.Stub)deploymentPortType)._getProperty("javax.xml.rpc.service.endpoint.address"); - } - - } - catch (javax.xml.rpc.ServiceException serviceException) {} - } - - public String getEndpoint() { - return _endpoint; - } - - public void setEndpoint(String endpoint) { - _endpoint = endpoint; - if (deploymentPortType != null) - ((javax.xml.rpc.Stub)deploymentPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); - - } - - public org.apache.www.ode.deployapi.DeploymentPortType getDeploymentPortType() { - if (deploymentPortType == null) - _initDeploymentPortTypeProxy(); - return deploymentPortType; - } - - public org.apache.www.ode.deployapi.DeployUnit deploy(java.lang.String name, org.apache.www.ode.deployapi._package _package) throws java.rmi.RemoteException{ - if (deploymentPortType == null) - _initDeploymentPortTypeProxy(); - return deploymentPortType.deploy(name, _package); - } - - public boolean undeploy(javax.xml.namespace.QName packageName) throws java.rmi.RemoteException{ - if (deploymentPortType == null) - _initDeploymentPortTypeProxy(); - return deploymentPortType.undeploy(packageName); - } - - public java.lang.String[] listDeployedPackages() throws java.rmi.RemoteException{ - if (deploymentPortType == null) - _initDeploymentPortTypeProxy(); - return deploymentPortType.listDeployedPackages(); - } - - public javax.xml.namespace.QName[] listProcesses(java.lang.String packageName) throws java.rmi.RemoteException{ - if (deploymentPortType == null) - _initDeploymentPortTypeProxy(); - return deploymentPortType.listProcesses(packageName); - } - - public java.lang.String getProcessPackage(javax.xml.namespace.QName processName) throws java.rmi.RemoteException{ - if (deploymentPortType == null) - _initDeploymentPortTypeProxy(); - return deploymentPortType.getProcessPackage(processName); - } - - -} \ No newline at end of file diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/_package.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/_package.java deleted file mode 100644 index 2a54eb619..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/deployapi/_package.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * _package.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.deployapi; - -public class _package implements java.io.Serializable { - private org.w3.www._2005._05.xmlmime.Base64Binary zip; - - public _package() { - } - - public _package( - org.w3.www._2005._05.xmlmime.Base64Binary zip) { - this.zip = zip; - } - - - /** - * Gets the zip value for this _package. - * - * @return zip - */ - public org.w3.www._2005._05.xmlmime.Base64Binary getZip() { - return zip; - } - - - /** - * Sets the zip value for this _package. - * - * @param zip - */ - public void setZip(org.w3.www._2005._05.xmlmime.Base64Binary zip) { - this.zip = zip; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof _package)) return false; - _package other = (_package) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.zip==null && other.getZip()==null) || - (this.zip!=null && - this.zip.equals(other.getZip()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getZip() != null) { - _hashCode += getZip().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(_package.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "package")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("zip"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/deployapi", "zip")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2005/05/xmlmime", "base64Binary")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/AidsType.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/AidsType.java deleted file mode 100644 index 4f9a9ff88..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/AidsType.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * AidsType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi; - -public class AidsType implements java.io.Serializable { - private java.lang.String aid; - - public AidsType() { - } - - public AidsType( - java.lang.String aid) { - this.aid = aid; - } - - - /** - * Gets the aid value for this AidsType. - * - * @return aid - */ - public java.lang.String getAid() { - return aid; - } - - - /** - * Sets the aid value for this AidsType. - * - * @param aid - */ - public void setAid(java.lang.String aid) { - this.aid = aid; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof AidsType)) return false; - AidsType other = (AidsType) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.aid==null && other.getAid()==null) || - (this.aid!=null && - this.aid.equals(other.getAid()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getAid() != null) { - _hashCode += getAid().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(AidsType.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "aidsType")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("aid"); - elemField.setXmlName(new javax.xml.namespace.QName("", "aid")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementBindingStub.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementBindingStub.java deleted file mode 100644 index 6a8d88f53..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementBindingStub.java +++ /dev/null @@ -1,1762 +0,0 @@ -/** - * InstanceManagementBindingStub.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi; - -public class InstanceManagementBindingStub extends org.apache.axis.client.Stub implements org.apache.www.ode.pmapi.InstanceManagementPortType { - private java.util.Vector cachedSerClasses = new java.util.Vector(); - private java.util.Vector cachedSerQNames = new java.util.Vector(); - private java.util.Vector cachedSerFactories = new java.util.Vector(); - private java.util.Vector cachedDeserFactories = new java.util.Vector(); - - static org.apache.axis.description.OperationDesc [] _operations; - - static { - _operations = new org.apache.axis.description.OperationDesc[20]; - _initOperationDesc1(); - _initOperationDesc2(); - } - - private static void _initOperationDesc1(){ - org.apache.axis.description.OperationDesc oper; - org.apache.axis.description.ParameterDesc param; - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("listInstances"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "order"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "limit"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[0] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("listInstancesSummary"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "order"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "limit"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[1] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("queryInstances"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "payload"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[2] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("listAllInstances"); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[3] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("listAllInstancesWithLimit"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "payload"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[4] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getInstanceInfo"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[5] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getScopeInfo"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "siid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "scope-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[6] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getScopeInfoWithActivity"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "sid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "activityInfo"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "scope-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[7] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getVariableInfo"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "sid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "varName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "variable-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[8] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("setVariable"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "sid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "varName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "value"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyType"), java.lang.Object.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "scope-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[9] = oper; - - } - - private static void _initOperationDesc2(){ - org.apache.axis.description.OperationDesc oper; - org.apache.axis.description.ParameterDesc param; - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("listEvents"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "instanceFilter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "eventFilter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "maxCount"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "bpel-event-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[10] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getEventTimeline"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "instanceFilter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "eventFilter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType")); - oper.setReturnClass(org.apache.www.ode.pmapi.ListType.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "dates")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[11] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("suspend"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[12] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("resume"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[13] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("terminate"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[14] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("fault"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[15] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("delete"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType")); - oper.setReturnClass(org.apache.www.ode.pmapi.ListType.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[16] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("recoverActivity"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "iid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "aid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"), long.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "action"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "instance-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[17] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("replay"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "replay"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "Replay"), org.apache.www.ode.pmapi.types._2006._08._02.Replay.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayResponse")); - oper.setReturnClass(long[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "replayResponse")); - param = oper.getReturnParamDesc(); - param.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoredIID")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[18] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getCommunication"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "getCommunication"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunication"), long[].class, false, false); - param.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "iid")); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunicationResponse")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "getCommunicationResponse")); - param = oper.getReturnParamDesc(); - param.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoreInstance")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[19] = oper; - - } - - public InstanceManagementBindingStub() throws org.apache.axis.AxisFault { - this(null); - } - - public InstanceManagementBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { - this(service); - super.cachedEndpoint = endpointURL; - } - - public InstanceManagementBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { - if (service == null) { - super.service = new org.apache.axis.client.Service(); - } else { - super.service = service; - } - ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); - java.lang.Class cls; - javax.xml.namespace.QName qName; - javax.xml.namespace.QName qName2; - java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; - java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; - java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; - java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; - java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; - java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; - java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; - java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; - java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; - java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>mockQueryRequest>pattern"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequestPattern.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>exchange"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeExchange.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>serviceConfig"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeServiceConfig.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">mockQueryRequest"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequest.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tFaultInfo>data"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfoData.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>correlation-properties"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>event-info"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceSummary>instances"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessInfo>documents"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "document"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>activities"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>children"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "child-ref"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>correlation-sets"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-set"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>variables"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "variable-ref"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tVariableInfo>value"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ExchangeType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FailureType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.FailureType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FaultType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.FaultType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunication"); - cachedSerQNames.add(qName); - cls = long[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "iid"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunicationResponse"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoreInstance"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "Replay"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.Replay.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayResponse"); - cachedSerQNames.add(qName); - cls = long[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoredIID"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.ReplayType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ResponseType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.ResponseType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityExtInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityExtInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityStatus"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityStatus.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivitytExtInfoList"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityExtInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-ext-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleSerializerFactory.class, cls, qName)); - cachedDeserFactories.add(org.apache.axis.encoding.ser.BaseDeserializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleDeserializerFactory.class, cls, qName)); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDefinitionInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDeploymentInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEndpointReferences"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoint-ref"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfoList"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "event-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailureInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TFailureInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailuresInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFaultInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "instance-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceStatus"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceSummary"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "process-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessProperties"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "property"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessStatus"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "aidsType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.AidsType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.ListType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - } - - protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { - try { - org.apache.axis.client.Call _call = super._createCall(); - if (super.maintainSessionSet) { - _call.setMaintainSession(super.maintainSession); - } - if (super.cachedUsername != null) { - _call.setUsername(super.cachedUsername); - } - if (super.cachedPassword != null) { - _call.setPassword(super.cachedPassword); - } - if (super.cachedEndpoint != null) { - _call.setTargetEndpointAddress(super.cachedEndpoint); - } - if (super.cachedTimeout != null) { - _call.setTimeout(super.cachedTimeout); - } - if (super.cachedPortName != null) { - _call.setPortName(super.cachedPortName); - } - java.util.Enumeration keys = super.cachedProperties.keys(); - while (keys.hasMoreElements()) { - java.lang.String key = (java.lang.String) keys.nextElement(); - _call.setProperty(key, super.cachedProperties.get(key)); - } - // All the type mapping information is registered - // when the first call is made. - // The type mapping information is actually registered in - // the TypeMappingRegistry of the service, which - // is the reason why registration is only needed for the first call. - synchronized (this) { - if (firstCall()) { - // must set encoding style before registering serializers - _call.setEncodingStyle(null); - for (int i = 0; i < cachedSerFactories.size(); ++i) { - java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); - javax.xml.namespace.QName qName = - (javax.xml.namespace.QName) cachedSerQNames.get(i); - java.lang.Object x = cachedSerFactories.get(i); - if (x instanceof Class) { - java.lang.Class sf = (java.lang.Class) - cachedSerFactories.get(i); - java.lang.Class df = (java.lang.Class) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { - org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) - cachedSerFactories.get(i); - org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - } - } - } - return _call; - } - catch (java.lang.Throwable _t) { - throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); - } - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstances(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[0]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listInstances")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter, order, new java.lang.Integer(limit)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstancesSummary(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[1]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listInstancesSummary")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter, order, new java.lang.Integer(limit)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] queryInstances(java.lang.String payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[2]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "queryInstances")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {payload}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstances() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[3]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listAllInstances")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstancesWithLimit(int payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[4]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listAllInstancesWithLimit")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Integer(payload)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo getInstanceInfo(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[5]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getInstanceInfo")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfo(long siid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[6]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getScopeInfo")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(siid)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfoWithActivity(long sid, boolean activityInfo) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[7]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getScopeInfoWithActivity")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(sid), new java.lang.Boolean(activityInfo)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo getVariableInfo(java.lang.String sid, java.lang.String varName) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[8]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getVariableInfo")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {sid, varName}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo setVariable(java.lang.String sid, java.lang.String varName, java.lang.Object value) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[9]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "setVariable")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {sid, varName, value}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[] listEvents(java.lang.String instanceFilter, java.lang.String eventFilter, int maxCount) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[10]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listEvents")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {instanceFilter, eventFilter, new java.lang.Integer(maxCount)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.ListType getEventTimeline(java.lang.String instanceFilter, java.lang.String eventFilter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[11]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getEventTimeline")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {instanceFilter, eventFilter}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.ListType) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.ListType) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.ListType.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo suspend(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[12]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "suspend")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo resume(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[13]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "resume")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo terminate(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[14]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "terminate")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo fault(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[15]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "fault")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.ListType delete(java.lang.String filter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[16]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "delete")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.ListType) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.ListType) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.ListType.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo recoverActivity(long iid, long aid, java.lang.String action) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[17]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "recoverActivity")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(iid), new java.lang.Long(aid), action}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public long[] replay(org.apache.www.ode.pmapi.types._2006._08._02.Replay replay) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[18]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "replay")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {replay}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (long[]) _resp; - } catch (java.lang.Exception _exception) { - return (long[]) org.apache.axis.utils.JavaUtils.convert(_resp, long[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] getCommunication(long[] getCommunication) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[19]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getCommunication")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {getCommunication}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementPortTypeProxy.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementPortTypeProxy.java deleted file mode 100644 index 740a53844..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementPortTypeProxy.java +++ /dev/null @@ -1,168 +0,0 @@ -package org.apache.www.ode.pmapi; - -public class InstanceManagementPortTypeProxy implements org.apache.www.ode.pmapi.InstanceManagementPortType { - private String _endpoint = null; - private org.apache.www.ode.pmapi.InstanceManagementPortType instanceManagementPortType = null; - - public InstanceManagementPortTypeProxy() { - _initInstanceManagementPortTypeProxy(); - } - - public InstanceManagementPortTypeProxy(String endpoint) { - _endpoint = endpoint; - _initInstanceManagementPortTypeProxy(); - } - - private void _initInstanceManagementPortTypeProxy() { - try { - instanceManagementPortType = (new org.apache.www.ode.pmapi.InstanceManagementServiceLocator()).getInstanceManagementPort(); - if (instanceManagementPortType != null) { - if (_endpoint != null) - ((javax.xml.rpc.Stub)instanceManagementPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); - else - _endpoint = (String)((javax.xml.rpc.Stub)instanceManagementPortType)._getProperty("javax.xml.rpc.service.endpoint.address"); - } - - } - catch (javax.xml.rpc.ServiceException serviceException) {} - } - - public String getEndpoint() { - return _endpoint; - } - - public void setEndpoint(String endpoint) { - _endpoint = endpoint; - if (instanceManagementPortType != null) - ((javax.xml.rpc.Stub)instanceManagementPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); - - } - - public org.apache.www.ode.pmapi.InstanceManagementPortType getInstanceManagementPortType() { - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType; - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstances(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.listInstances(filter, order, limit); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listInstancesSummary(java.lang.String filter, java.lang.String order, int limit) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.listInstancesSummary(filter, order, limit); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] queryInstances(java.lang.String payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.queryInstances(payload); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstances() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.listAllInstances(); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[] listAllInstancesWithLimit(int payload) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.listAllInstancesWithLimit(payload); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo getInstanceInfo(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.getInstanceInfo(iid); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfo(long siid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.getScopeInfo(siid); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo getScopeInfoWithActivity(long sid, boolean activityInfo) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.getScopeInfoWithActivity(sid, activityInfo); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo getVariableInfo(java.lang.String sid, java.lang.String varName) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.getVariableInfo(sid, varName); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo setVariable(java.lang.String sid, java.lang.String varName, java.lang.Object value) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.setVariable(sid, varName, value); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[] listEvents(java.lang.String instanceFilter, java.lang.String eventFilter, int maxCount) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.listEvents(instanceFilter, eventFilter, maxCount); - } - - public org.apache.www.ode.pmapi.ListType getEventTimeline(java.lang.String instanceFilter, java.lang.String eventFilter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.getEventTimeline(instanceFilter, eventFilter); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo suspend(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.suspend(iid); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo resume(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.resume(iid); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo terminate(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.terminate(iid); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo fault(long iid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.fault(iid); - } - - public org.apache.www.ode.pmapi.ListType delete(java.lang.String filter) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.delete(filter); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo recoverActivity(long iid, long aid, java.lang.String action) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.recoverActivity(iid, aid, action); - } - - public long[] replay(org.apache.www.ode.pmapi.types._2006._08._02.Replay replay) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.replay(replay); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] getCommunication(long[] getCommunication) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (instanceManagementPortType == null) - _initInstanceManagementPortTypeProxy(); - return instanceManagementPortType.getCommunication(getCommunication); - } - - -} \ No newline at end of file diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementService.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementService.java deleted file mode 100644 index fc2bb3895..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/InstanceManagementService.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * InstanceManagementService.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi; - -public interface InstanceManagementService extends javax.xml.rpc.Service { - public java.lang.String getInstanceManagementPortAddress(); - - public org.apache.www.ode.pmapi.InstanceManagementPortType getInstanceManagementPort() throws javax.xml.rpc.ServiceException; - - public org.apache.www.ode.pmapi.InstanceManagementPortType getInstanceManagementPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ListType.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ListType.java deleted file mode 100644 index b558e7e7e..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ListType.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * ListType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi; - -public class ListType implements java.io.Serializable { - private java.lang.String element; - - public ListType() { - } - - public ListType( - java.lang.String element) { - this.element = element; - } - - - /** - * Gets the element value for this ListType. - * - * @return element - */ - public java.lang.String getElement() { - return element; - } - - - /** - * Sets the element value for this ListType. - * - * @param element - */ - public void setElement(java.lang.String element) { - this.element = element; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof ListType)) return false; - ListType other = (ListType) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.element==null && other.getElement()==null) || - (this.element!=null && - this.element.equals(other.getElement()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getElement() != null) { - _hashCode += getElement().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(ListType.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("element"); - elemField.setXmlName(new javax.xml.namespace.QName("", "element")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementBindingStub.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementBindingStub.java deleted file mode 100644 index 74a47d35a..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementBindingStub.java +++ /dev/null @@ -1,1155 +0,0 @@ -/** - * ProcessManagementBindingStub.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi; - -public class ProcessManagementBindingStub extends org.apache.axis.client.Stub implements org.apache.www.ode.pmapi.ProcessManagementPortType { - private java.util.Vector cachedSerClasses = new java.util.Vector(); - private java.util.Vector cachedSerQNames = new java.util.Vector(); - private java.util.Vector cachedSerFactories = new java.util.Vector(); - private java.util.Vector cachedDeserFactories = new java.util.Vector(); - - static org.apache.axis.description.OperationDesc [] _operations; - - static { - _operations = new org.apache.axis.description.OperationDesc[10]; - _initOperationDesc1(); - } - - private static void _initOperationDesc1(){ - org.apache.axis.description.OperationDesc oper; - org.apache.axis.description.ParameterDesc param; - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("listProcesses"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "orderKeys"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[0] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("listAllProcesses"); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[1] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("listProcessesCustom"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "filter"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "orderKeys"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "customizer"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info-list")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[2] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getProcessInfo"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[3] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getProcessInfoCustom"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "customizer"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[4] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("getExtensibilityElements"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "aids"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "aidsType"), org.apache.www.ode.pmapi.AidsType.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[5] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("setProcessProperty"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "propertyName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "propertyValue"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[6] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("setProcessPropertyNode"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "propertyName"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "propertyValue"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyType"), java.lang.Object.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[7] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("activate"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[8] = oper; - - oper = new org.apache.axis.description.OperationDesc(); - oper.setName("setRetired"); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "pid"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName"), javax.xml.namespace.QName.class, false, false); - oper.addParameter(param); - param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "retired"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); - oper.addParameter(param); - oper.setReturnType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo")); - oper.setReturnClass(org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - oper.setReturnQName(new javax.xml.namespace.QName("", "process-info")); - oper.setStyle(org.apache.axis.constants.Style.RPC); - oper.setUse(org.apache.axis.constants.Use.LITERAL); - oper.addFault(new org.apache.axis.description.FaultDesc( - new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "ManagementFault"), - "org.apache.www.ode.pmapi.ManagementFault", - new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), - false - )); - _operations[9] = oper; - - } - - public ProcessManagementBindingStub() throws org.apache.axis.AxisFault { - this(null); - } - - public ProcessManagementBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { - this(service); - super.cachedEndpoint = endpointURL; - } - - public ProcessManagementBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { - if (service == null) { - super.service = new org.apache.axis.client.Service(); - } else { - super.service = service; - } - ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); - java.lang.Class cls; - javax.xml.namespace.QName qName; - javax.xml.namespace.QName qName2; - java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; - java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; - java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; - java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; - java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; - java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; - java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; - java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; - java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; - java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>mockQueryRequest>pattern"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequestPattern.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>exchange"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeExchange.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>serviceConfig"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationTypeServiceConfig.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">mockQueryRequest"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.MockQueryRequest.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tFaultInfo>data"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfoData.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>correlation-properties"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-property"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceInfo>event-info"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tInstanceSummary>instances"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummaryInstances.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessInfo>documents"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "document"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>activities"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>children"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "child-ref"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>correlation-sets"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>tScopeInfo>correlation-sets>correlation-set"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-set"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tScopeInfo>variables"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "variable-ref"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tVariableInfo>value"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ExchangeType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.ExchangeType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FailureType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.FailureType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FaultType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.FaultType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunication"); - cachedSerQNames.add(qName); - cls = long[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "iid"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "GetCommunicationResponse"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "CommunicationType"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoreInstance"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "Replay"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.Replay.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayResponse"); - cachedSerQNames.add(qName); - cls = long[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "restoredIID"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.ReplayType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ResponseType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.ResponseType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityExtInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityExtInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivityStatus"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityStatus.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tActivitytExtInfoList"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TActivityExtInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "activity-ext-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tCorrelationProperty"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(org.apache.axis.encoding.ser.BaseSerializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleSerializerFactory.class, cls, qName)); - cachedDeserFactories.add(org.apache.axis.encoding.ser.BaseDeserializerFactory.createFactory(org.apache.axis.encoding.ser.SimpleDeserializerFactory.class, cls, qName)); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDefinitionInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDeploymentInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEndpointReferences"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoint-ref"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tEventInfoList"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TEventInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "event-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailureInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TFailureInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailuresInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFaultInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceInfoList"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "instance-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceStatus"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceSummary"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessInfoList"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "process-info"); - qName2 = null; - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessProperties"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[].class; - cachedSerClasses.add(cls); - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tProcessProperties>property"); - qName2 = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "property"); - cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); - cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessStatus"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(enumsf); - cachedDeserFactories.add(enumdf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfo.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "aidsType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.AidsType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - qName = new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listType"); - cachedSerQNames.add(qName); - cls = org.apache.www.ode.pmapi.ListType.class; - cachedSerClasses.add(cls); - cachedSerFactories.add(beansf); - cachedDeserFactories.add(beandf); - - } - - protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { - try { - org.apache.axis.client.Call _call = super._createCall(); - if (super.maintainSessionSet) { - _call.setMaintainSession(super.maintainSession); - } - if (super.cachedUsername != null) { - _call.setUsername(super.cachedUsername); - } - if (super.cachedPassword != null) { - _call.setPassword(super.cachedPassword); - } - if (super.cachedEndpoint != null) { - _call.setTargetEndpointAddress(super.cachedEndpoint); - } - if (super.cachedTimeout != null) { - _call.setTimeout(super.cachedTimeout); - } - if (super.cachedPortName != null) { - _call.setPortName(super.cachedPortName); - } - java.util.Enumeration keys = super.cachedProperties.keys(); - while (keys.hasMoreElements()) { - java.lang.String key = (java.lang.String) keys.nextElement(); - _call.setProperty(key, super.cachedProperties.get(key)); - } - // All the type mapping information is registered - // when the first call is made. - // The type mapping information is actually registered in - // the TypeMappingRegistry of the service, which - // is the reason why registration is only needed for the first call. - synchronized (this) { - if (firstCall()) { - // must set encoding style before registering serializers - _call.setEncodingStyle(null); - for (int i = 0; i < cachedSerFactories.size(); ++i) { - java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); - javax.xml.namespace.QName qName = - (javax.xml.namespace.QName) cachedSerQNames.get(i); - java.lang.Object x = cachedSerFactories.get(i); - if (x instanceof Class) { - java.lang.Class sf = (java.lang.Class) - cachedSerFactories.get(i); - java.lang.Class df = (java.lang.Class) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { - org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) - cachedSerFactories.get(i); - org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - } - } - } - return _call; - } - catch (java.lang.Throwable _t) { - throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); - } - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcesses(java.lang.String filter, java.lang.String orderKeys) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[0]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listProcesses")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter, orderKeys}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listAllProcesses() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[1]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listAllProcesses")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcessesCustom(java.lang.String filter, java.lang.String orderKeys, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[2]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "listProcessesCustom")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filter, orderKeys, customizer}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[].class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfo(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[3]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getProcessInfo")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfoCustom(javax.xml.namespace.QName pid, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[4]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getProcessInfoCustom")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, customizer}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getExtensibilityElements(javax.xml.namespace.QName pid, org.apache.www.ode.pmapi.AidsType aids) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[5]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "getExtensibilityElements")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, aids}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessProperty(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.String propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[6]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "setProcessProperty")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, propertyName, propertyValue}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessPropertyNode(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.Object propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[7]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "setProcessPropertyNode")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, propertyName, propertyValue}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo activate(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[8]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "activate")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setRetired(javax.xml.namespace.QName pid, boolean retired) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault { - if (super.cachedEndpoint == null) { - throw new org.apache.axis.NoEndPointException(); - } - org.apache.axis.client.Call _call = createCall(); - _call.setOperation(_operations[9]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi", "setRetired")); - - setRequestHeaders(_call); - setAttachments(_call); - try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {pid, new java.lang.Boolean(retired)}); - - if (_resp instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) _resp; - } catch (java.lang.Exception _exception) { - return (org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo) org.apache.axis.utils.JavaUtils.convert(_resp, org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo.class); - } - } - } catch (org.apache.axis.AxisFault axisFaultException) { - if (axisFaultException.detail != null) { - if (axisFaultException.detail instanceof java.rmi.RemoteException) { - throw (java.rmi.RemoteException) axisFaultException.detail; - } - if (axisFaultException.detail instanceof org.apache.www.ode.pmapi.ManagementFault) { - throw (org.apache.www.ode.pmapi.ManagementFault) axisFaultException.detail; - } - } - throw axisFaultException; -} - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementPortTypeProxy.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementPortTypeProxy.java deleted file mode 100644 index f4f0c3b42..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementPortTypeProxy.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.apache.www.ode.pmapi; - -public class ProcessManagementPortTypeProxy implements org.apache.www.ode.pmapi.ProcessManagementPortType { - private String _endpoint = null; - private org.apache.www.ode.pmapi.ProcessManagementPortType processManagementPortType = null; - - public ProcessManagementPortTypeProxy() { - _initProcessManagementPortTypeProxy(); - } - - public ProcessManagementPortTypeProxy(String endpoint) { - _endpoint = endpoint; - _initProcessManagementPortTypeProxy(); - } - - private void _initProcessManagementPortTypeProxy() { - try { - processManagementPortType = (new org.apache.www.ode.pmapi.ProcessManagementServiceLocator()).getProcessManagementPort(); - if (processManagementPortType != null) { - if (_endpoint != null) - ((javax.xml.rpc.Stub)processManagementPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); - else - _endpoint = (String)((javax.xml.rpc.Stub)processManagementPortType)._getProperty("javax.xml.rpc.service.endpoint.address"); - } - - } - catch (javax.xml.rpc.ServiceException serviceException) {} - } - - public String getEndpoint() { - return _endpoint; - } - - public void setEndpoint(String endpoint) { - _endpoint = endpoint; - if (processManagementPortType != null) - ((javax.xml.rpc.Stub)processManagementPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); - - } - - public org.apache.www.ode.pmapi.ProcessManagementPortType getProcessManagementPortType() { - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType; - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcesses(java.lang.String filter, java.lang.String orderKeys) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.listProcesses(filter, orderKeys); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listAllProcesses() throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.listAllProcesses(); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo[] listProcessesCustom(java.lang.String filter, java.lang.String orderKeys, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.listProcessesCustom(filter, orderKeys, customizer); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfo(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.getProcessInfo(pid); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getProcessInfoCustom(javax.xml.namespace.QName pid, java.lang.String customizer) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.getProcessInfoCustom(pid, customizer); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessProperty(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.String propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.setProcessProperty(pid, propertyName, propertyValue); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setProcessPropertyNode(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.Object propertyValue) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.setProcessPropertyNode(pid, propertyName, propertyValue); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo getExtensibilityElements(javax.xml.namespace.QName pid, org.apache.www.ode.pmapi.AidsType aids) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.getExtensibilityElements(pid, aids); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo activate(javax.xml.namespace.QName pid) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.activate(pid); - } - - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessInfo setRetired(javax.xml.namespace.QName pid, boolean retired) throws java.rmi.RemoteException, org.apache.www.ode.pmapi.ManagementFault{ - if (processManagementPortType == null) - _initProcessManagementPortTypeProxy(); - return processManagementPortType.setRetired(pid, retired); - } - - -} \ No newline at end of file diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementService.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementService.java deleted file mode 100644 index 8d393371b..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/ProcessManagementService.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * ProcessManagementService.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi; - -public interface ProcessManagementService extends javax.xml.rpc.Service { - public java.lang.String getProcessManagementPortAddress(); - - public org.apache.www.ode.pmapi.ProcessManagementPortType getProcessManagementPort() throws javax.xml.rpc.ServiceException; - - public org.apache.www.ode.pmapi.ProcessManagementPortType getProcessManagementPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationTypeServiceConfig.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationTypeServiceConfig.java deleted file mode 100644 index 6d55b5f91..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/CommunicationTypeServiceConfig.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * CommunicationTypeServiceConfig.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class CommunicationTypeServiceConfig implements java.io.Serializable { - private javax.xml.namespace.QName service; - - private org.apache.www.ode.pmapi.types._2006._08._02.ReplayType replayType; - - public CommunicationTypeServiceConfig() { - } - - public CommunicationTypeServiceConfig( - javax.xml.namespace.QName service, - org.apache.www.ode.pmapi.types._2006._08._02.ReplayType replayType) { - this.service = service; - this.replayType = replayType; - } - - - /** - * Gets the service value for this CommunicationTypeServiceConfig. - * - * @return service - */ - public javax.xml.namespace.QName getService() { - return service; - } - - - /** - * Sets the service value for this CommunicationTypeServiceConfig. - * - * @param service - */ - public void setService(javax.xml.namespace.QName service) { - this.service = service; - } - - - /** - * Gets the replayType value for this CommunicationTypeServiceConfig. - * - * @return replayType - */ - public org.apache.www.ode.pmapi.types._2006._08._02.ReplayType getReplayType() { - return replayType; - } - - - /** - * Sets the replayType value for this CommunicationTypeServiceConfig. - * - * @param replayType - */ - public void setReplayType(org.apache.www.ode.pmapi.types._2006._08._02.ReplayType replayType) { - this.replayType = replayType; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof CommunicationTypeServiceConfig)) return false; - CommunicationTypeServiceConfig other = (CommunicationTypeServiceConfig) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.service==null && other.getService()==null) || - (this.service!=null && - this.service.equals(other.getService()))) && - ((this.replayType==null && other.getReplayType()==null) || - (this.replayType!=null && - this.replayType.equals(other.getReplayType()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getService() != null) { - _hashCode += getService().hashCode(); - } - if (getReplayType() != null) { - _hashCode += getReplayType().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(CommunicationTypeServiceConfig.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">CommunicationType>serviceConfig")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("service"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "service")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("replayType"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "replayType")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ReplayType")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/ExchangeType.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/ExchangeType.java deleted file mode 100644 index 7683cec20..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/ExchangeType.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * ExchangeType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class ExchangeType implements java.io.Serializable { - private java.lang.String _value_; - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - protected ExchangeType(java.lang.String value) { - _value_ = value; - _table_.put(_value_,this); - } - - public static final java.lang.String _M = "M"; - public static final java.lang.String _P = "P"; - public static final ExchangeType M = new ExchangeType(_M); - public static final ExchangeType P = new ExchangeType(_P); - public java.lang.String getValue() { return _value_;} - public static ExchangeType fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - ExchangeType enumeration = (ExchangeType) - _table_.get(value); - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static ExchangeType fromString(java.lang.String value) - throws java.lang.IllegalArgumentException { - return fromValue(value); - } - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { return _value_;} - public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumSerializer( - _javaType, _xmlType); - } - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumDeserializer( - _javaType, _xmlType); - } - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(ExchangeType.class); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "ExchangeType")); - } - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/FailureType.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/FailureType.java deleted file mode 100644 index f2f31e0de..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/FailureType.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * FailureType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class FailureType implements java.io.Serializable { - private java.lang.String explanation; - - public FailureType() { - } - - public FailureType( - java.lang.String explanation) { - this.explanation = explanation; - } - - - /** - * Gets the explanation value for this FailureType. - * - * @return explanation - */ - public java.lang.String getExplanation() { - return explanation; - } - - - /** - * Sets the explanation value for this FailureType. - * - * @param explanation - */ - public void setExplanation(java.lang.String explanation) { - this.explanation = explanation; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof FailureType)) return false; - FailureType other = (FailureType) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.explanation==null && other.getExplanation()==null) || - (this.explanation!=null && - this.explanation.equals(other.getExplanation()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getExplanation() != null) { - _hashCode += getExplanation().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(FailureType.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FailureType")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("explanation"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "explanation")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/FaultType.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/FaultType.java deleted file mode 100644 index c65c7c8db..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/FaultType.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * FaultType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class FaultType implements java.io.Serializable { - private javax.xml.namespace.QName type; - - private java.lang.String explanation; - - private java.lang.Object message; - - public FaultType() { - } - - public FaultType( - javax.xml.namespace.QName type, - java.lang.String explanation, - java.lang.Object message) { - this.type = type; - this.explanation = explanation; - this.message = message; - } - - - /** - * Gets the type value for this FaultType. - * - * @return type - */ - public javax.xml.namespace.QName getType() { - return type; - } - - - /** - * Sets the type value for this FaultType. - * - * @param type - */ - public void setType(javax.xml.namespace.QName type) { - this.type = type; - } - - - /** - * Gets the explanation value for this FaultType. - * - * @return explanation - */ - public java.lang.String getExplanation() { - return explanation; - } - - - /** - * Sets the explanation value for this FaultType. - * - * @param explanation - */ - public void setExplanation(java.lang.String explanation) { - this.explanation = explanation; - } - - - /** - * Gets the message value for this FaultType. - * - * @return message - */ - public java.lang.Object getMessage() { - return message; - } - - - /** - * Sets the message value for this FaultType. - * - * @param message - */ - public void setMessage(java.lang.Object message) { - this.message = message; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof FaultType)) return false; - FaultType other = (FaultType) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.type==null && other.getType()==null) || - (this.type!=null && - this.type.equals(other.getType()))) && - ((this.explanation==null && other.getExplanation()==null) || - (this.explanation!=null && - this.explanation.equals(other.getExplanation()))) && - ((this.message==null && other.getMessage()==null) || - (this.message!=null && - this.message.equals(other.getMessage()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getType() != null) { - _hashCode += getType().hashCode(); - } - if (getExplanation() != null) { - _hashCode += getExplanation().hashCode(); - } - if (getMessage() != null) { - _hashCode += getMessage().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(FaultType.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "FaultType")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("type"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "type")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("explanation"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "explanation")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("message"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "message")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyType")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequestPattern.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequestPattern.java deleted file mode 100644 index 22a891a71..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/MockQueryRequestPattern.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * MockQueryRequestPattern.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class MockQueryRequestPattern implements java.io.Serializable { - private java.lang.String _value_; - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - protected MockQueryRequestPattern(java.lang.String value) { - _value_ = value; - _table_.put(_value_,this); - } - - public static final java.lang.String _IN_ONLY = "IN_ONLY"; - public static final java.lang.String _IN_OUT = "IN_OUT"; - public static final MockQueryRequestPattern IN_ONLY = new MockQueryRequestPattern(_IN_ONLY); - public static final MockQueryRequestPattern IN_OUT = new MockQueryRequestPattern(_IN_OUT); - public java.lang.String getValue() { return _value_;} - public static MockQueryRequestPattern fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - MockQueryRequestPattern enumeration = (MockQueryRequestPattern) - _table_.get(value); - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static MockQueryRequestPattern fromString(java.lang.String value) - throws java.lang.IllegalArgumentException { - return fromValue(value); - } - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { return _value_;} - public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumSerializer( - _javaType, _xmlType); - } - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumDeserializer( - _javaType, _xmlType); - } - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(MockQueryRequestPattern.class); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">>mockQueryRequest>pattern")); - } - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/Replay.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/Replay.java deleted file mode 100644 index bff6d197b..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/Replay.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * Replay.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class Replay implements java.io.Serializable { - private long[] upgradeInstance; - - private long[] replaceInstance; - - private org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] restoreInstance; - - public Replay() { - } - - public Replay( - long[] upgradeInstance, - long[] replaceInstance, - org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] restoreInstance) { - this.upgradeInstance = upgradeInstance; - this.replaceInstance = replaceInstance; - this.restoreInstance = restoreInstance; - } - - - /** - * Gets the upgradeInstance value for this Replay. - * - * @return upgradeInstance - */ - public long[] getUpgradeInstance() { - return upgradeInstance; - } - - - /** - * Sets the upgradeInstance value for this Replay. - * - * @param upgradeInstance - */ - public void setUpgradeInstance(long[] upgradeInstance) { - this.upgradeInstance = upgradeInstance; - } - - public long getUpgradeInstance(int i) { - return this.upgradeInstance[i]; - } - - public void setUpgradeInstance(int i, long _value) { - this.upgradeInstance[i] = _value; - } - - - /** - * Gets the replaceInstance value for this Replay. - * - * @return replaceInstance - */ - public long[] getReplaceInstance() { - return replaceInstance; - } - - - /** - * Sets the replaceInstance value for this Replay. - * - * @param replaceInstance - */ - public void setReplaceInstance(long[] replaceInstance) { - this.replaceInstance = replaceInstance; - } - - public long getReplaceInstance(int i) { - return this.replaceInstance[i]; - } - - public void setReplaceInstance(int i, long _value) { - this.replaceInstance[i] = _value; - } - - - /** - * Gets the restoreInstance value for this Replay. - * - * @return restoreInstance - */ - public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] getRestoreInstance() { - return restoreInstance; - } - - - /** - * Sets the restoreInstance value for this Replay. - * - * @param restoreInstance - */ - public void setRestoreInstance(org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType[] restoreInstance) { - this.restoreInstance = restoreInstance; - } - - public org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType getRestoreInstance(int i) { - return this.restoreInstance[i]; - } - - public void setRestoreInstance(int i, org.apache.www.ode.pmapi.types._2006._08._02.CommunicationType _value) { - this.restoreInstance[i] = _value; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof Replay)) return false; - Replay other = (Replay) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.upgradeInstance==null && other.getUpgradeInstance()==null) || - (this.upgradeInstance!=null && - java.util.Arrays.equals(this.upgradeInstance, other.getUpgradeInstance()))) && - ((this.replaceInstance==null && other.getReplaceInstance()==null) || - (this.replaceInstance!=null && - java.util.Arrays.equals(this.replaceInstance, other.getReplaceInstance()))) && - ((this.restoreInstance==null && other.getRestoreInstance()==null) || - (this.restoreInstance!=null && - java.util.Arrays.equals(this.restoreInstance, other.getRestoreInstance()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getUpgradeInstance() != null) { - for (int i=0; - itEndpointReferences>endpoint-ref")); - org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("partnerLink"); - attrField.setXmlName(new javax.xml.namespace.QName("", "partner-link")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("partnerRole"); - attrField.setXmlName(new javax.xml.namespace.QName("", "partner-role")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("myRole"); - attrField.setXmlName(new javax.xml.namespace.QName("", "my-role")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailuresInfo.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailuresInfo.java deleted file mode 100644 index c8a1944cb..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFailuresInfo.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * TFailuresInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - - -/** - * Indicates one or more activities are in the failure - * state and require recovery. - */ -public class TFailuresInfo implements java.io.Serializable { - /* Date/time of last failure. */ - private java.util.Calendar dtFailure; - - /* Number of activities in failure state. */ - private int count; - - public TFailuresInfo() { - } - - public TFailuresInfo( - java.util.Calendar dtFailure, - int count) { - this.dtFailure = dtFailure; - this.count = count; - } - - - /** - * Gets the dtFailure value for this TFailuresInfo. - * - * @return dtFailure * Date/time of last failure. - */ - public java.util.Calendar getDtFailure() { - return dtFailure; - } - - - /** - * Sets the dtFailure value for this TFailuresInfo. - * - * @param dtFailure * Date/time of last failure. - */ - public void setDtFailure(java.util.Calendar dtFailure) { - this.dtFailure = dtFailure; - } - - - /** - * Gets the count value for this TFailuresInfo. - * - * @return count * Number of activities in failure state. - */ - public int getCount() { - return count; - } - - - /** - * Sets the count value for this TFailuresInfo. - * - * @param count * Number of activities in failure state. - */ - public void setCount(int count) { - this.count = count; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TFailuresInfo)) return false; - TFailuresInfo other = (TFailuresInfo) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.dtFailure==null && other.getDtFailure()==null) || - (this.dtFailure!=null && - this.dtFailure.equals(other.getDtFailure()))) && - this.count == other.getCount(); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getDtFailure() != null) { - _hashCode += getDtFailure().hashCode(); - } - _hashCode += getCount(); - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(TFailuresInfo.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailuresInfo")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("dtFailure"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "dt-failure")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "dateTime")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("count"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "count")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfoData.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfoData.java deleted file mode 100644 index 758a3a901..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TFaultInfoData.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * TFaultInfoData.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class TFaultInfoData implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { - private org.apache.axis.message.MessageElement [] _any; - - public TFaultInfoData() { - } - - public TFaultInfoData( - org.apache.axis.message.MessageElement [] _any) { - this._any = _any; - } - - - /** - * Gets the _any value for this TFaultInfoData. - * - * @return _any - */ - public org.apache.axis.message.MessageElement [] get_any() { - return _any; - } - - - /** - * Sets the _any value for this TFaultInfoData. - * - * @param _any - */ - public void set_any(org.apache.axis.message.MessageElement [] _any) { - this._any = _any; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TFaultInfoData)) return false; - TFaultInfoData other = (TFaultInfoData) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this._any==null && other.get_any()==null) || - (this._any!=null && - java.util.Arrays.equals(this._any, other.get_any()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (get_any() != null) { - for (int i=0; - itFaultInfo>data")); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfo.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfo.java deleted file mode 100644 index d392212ff..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceInfo.java +++ /dev/null @@ -1,561 +0,0 @@ -/** - * TInstanceInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class TInstanceInfo implements java.io.Serializable { - /* The unique instance identifier. */ - private java.lang.String iid; - - /* Process id of the process to which this instance - * belongs. */ - private java.lang.String pid; - - private javax.xml.namespace.QName processName; - - /* Root scope id (might not exist). */ - private org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef rootScope; - - /* Status of ths instance. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus status; - - /* The date/time when the instance was - * started. */ - private java.util.Calendar dtStarted; - - /* The date/time when the last activity - * occured. */ - private java.util.Calendar dtLastActive; - - /* If present, indicates the date/time since which the - * instance has been in an error state. */ - private java.util.Calendar dtErrorSince; - - /* Lists all correlation properties with their values that - * are associated with this process instance. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[] correlationProperties; - - /* Information about the events for this instance. If - * absent, indicates events are not available. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo eventInfo; - - /* If present, indicates the fault with which this - * instance failed. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo faultInfo; - - private org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures; - - public TInstanceInfo() { - } - - public TInstanceInfo( - java.lang.String iid, - java.lang.String pid, - javax.xml.namespace.QName processName, - org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef rootScope, - org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus status, - java.util.Calendar dtStarted, - java.util.Calendar dtLastActive, - java.util.Calendar dtErrorSince, - org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[] correlationProperties, - org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo eventInfo, - org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo faultInfo, - org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures) { - this.iid = iid; - this.pid = pid; - this.processName = processName; - this.rootScope = rootScope; - this.status = status; - this.dtStarted = dtStarted; - this.dtLastActive = dtLastActive; - this.dtErrorSince = dtErrorSince; - this.correlationProperties = correlationProperties; - this.eventInfo = eventInfo; - this.faultInfo = faultInfo; - this.failures = failures; - } - - - /** - * Gets the iid value for this TInstanceInfo. - * - * @return iid * The unique instance identifier. - */ - public java.lang.String getIid() { - return iid; - } - - - /** - * Sets the iid value for this TInstanceInfo. - * - * @param iid * The unique instance identifier. - */ - public void setIid(java.lang.String iid) { - this.iid = iid; - } - - - /** - * Gets the pid value for this TInstanceInfo. - * - * @return pid * Process id of the process to which this instance - * belongs. - */ - public java.lang.String getPid() { - return pid; - } - - - /** - * Sets the pid value for this TInstanceInfo. - * - * @param pid * Process id of the process to which this instance - * belongs. - */ - public void setPid(java.lang.String pid) { - this.pid = pid; - } - - - /** - * Gets the processName value for this TInstanceInfo. - * - * @return processName - */ - public javax.xml.namespace.QName getProcessName() { - return processName; - } - - - /** - * Sets the processName value for this TInstanceInfo. - * - * @param processName - */ - public void setProcessName(javax.xml.namespace.QName processName) { - this.processName = processName; - } - - - /** - * Gets the rootScope value for this TInstanceInfo. - * - * @return rootScope * Root scope id (might not exist). - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef getRootScope() { - return rootScope; - } - - - /** - * Sets the rootScope value for this TInstanceInfo. - * - * @param rootScope * Root scope id (might not exist). - */ - public void setRootScope(org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef rootScope) { - this.rootScope = rootScope; - } - - - /** - * Gets the status value for this TInstanceInfo. - * - * @return status * Status of ths instance. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus getStatus() { - return status; - } - - - /** - * Sets the status value for this TInstanceInfo. - * - * @param status * Status of ths instance. - */ - public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceStatus status) { - this.status = status; - } - - - /** - * Gets the dtStarted value for this TInstanceInfo. - * - * @return dtStarted * The date/time when the instance was - * started. - */ - public java.util.Calendar getDtStarted() { - return dtStarted; - } - - - /** - * Sets the dtStarted value for this TInstanceInfo. - * - * @param dtStarted * The date/time when the instance was - * started. - */ - public void setDtStarted(java.util.Calendar dtStarted) { - this.dtStarted = dtStarted; - } - - - /** - * Gets the dtLastActive value for this TInstanceInfo. - * - * @return dtLastActive * The date/time when the last activity - * occured. - */ - public java.util.Calendar getDtLastActive() { - return dtLastActive; - } - - - /** - * Sets the dtLastActive value for this TInstanceInfo. - * - * @param dtLastActive * The date/time when the last activity - * occured. - */ - public void setDtLastActive(java.util.Calendar dtLastActive) { - this.dtLastActive = dtLastActive; - } - - - /** - * Gets the dtErrorSince value for this TInstanceInfo. - * - * @return dtErrorSince * If present, indicates the date/time since which the - * instance has been in an error state. - */ - public java.util.Calendar getDtErrorSince() { - return dtErrorSince; - } - - - /** - * Sets the dtErrorSince value for this TInstanceInfo. - * - * @param dtErrorSince * If present, indicates the date/time since which the - * instance has been in an error state. - */ - public void setDtErrorSince(java.util.Calendar dtErrorSince) { - this.dtErrorSince = dtErrorSince; - } - - - /** - * Gets the correlationProperties value for this TInstanceInfo. - * - * @return correlationProperties * Lists all correlation properties with their values that - * are associated with this process instance. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[] getCorrelationProperties() { - return correlationProperties; - } - - - /** - * Sets the correlationProperties value for this TInstanceInfo. - * - * @param correlationProperties * Lists all correlation properties with their values that - * are associated with this process instance. - */ - public void setCorrelationProperties(org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[] correlationProperties) { - this.correlationProperties = correlationProperties; - } - - - /** - * Gets the eventInfo value for this TInstanceInfo. - * - * @return eventInfo * Information about the events for this instance. If - * absent, indicates events are not available. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo getEventInfo() { - return eventInfo; - } - - - /** - * Sets the eventInfo value for this TInstanceInfo. - * - * @param eventInfo * Information about the events for this instance. If - * absent, indicates events are not available. - */ - public void setEventInfo(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceInfoEventInfo eventInfo) { - this.eventInfo = eventInfo; - } - - - /** - * Gets the faultInfo value for this TInstanceInfo. - * - * @return faultInfo * If present, indicates the fault with which this - * instance failed. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo getFaultInfo() { - return faultInfo; - } - - - /** - * Sets the faultInfo value for this TInstanceInfo. - * - * @param faultInfo * If present, indicates the fault with which this - * instance failed. - */ - public void setFaultInfo(org.apache.www.ode.pmapi.types._2006._08._02.TFaultInfo faultInfo) { - this.faultInfo = faultInfo; - } - - - /** - * Gets the failures value for this TInstanceInfo. - * - * @return failures - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo getFailures() { - return failures; - } - - - /** - * Sets the failures value for this TInstanceInfo. - * - * @param failures - */ - public void setFailures(org.apache.www.ode.pmapi.types._2006._08._02.TFailuresInfo failures) { - this.failures = failures; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TInstanceInfo)) return false; - TInstanceInfo other = (TInstanceInfo) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.iid==null && other.getIid()==null) || - (this.iid!=null && - this.iid.equals(other.getIid()))) && - ((this.pid==null && other.getPid()==null) || - (this.pid!=null && - this.pid.equals(other.getPid()))) && - ((this.processName==null && other.getProcessName()==null) || - (this.processName!=null && - this.processName.equals(other.getProcessName()))) && - ((this.rootScope==null && other.getRootScope()==null) || - (this.rootScope!=null && - this.rootScope.equals(other.getRootScope()))) && - ((this.status==null && other.getStatus()==null) || - (this.status!=null && - this.status.equals(other.getStatus()))) && - ((this.dtStarted==null && other.getDtStarted()==null) || - (this.dtStarted!=null && - this.dtStarted.equals(other.getDtStarted()))) && - ((this.dtLastActive==null && other.getDtLastActive()==null) || - (this.dtLastActive!=null && - this.dtLastActive.equals(other.getDtLastActive()))) && - ((this.dtErrorSince==null && other.getDtErrorSince()==null) || - (this.dtErrorSince!=null && - this.dtErrorSince.equals(other.getDtErrorSince()))) && - ((this.correlationProperties==null && other.getCorrelationProperties()==null) || - (this.correlationProperties!=null && - java.util.Arrays.equals(this.correlationProperties, other.getCorrelationProperties()))) && - ((this.eventInfo==null && other.getEventInfo()==null) || - (this.eventInfo!=null && - this.eventInfo.equals(other.getEventInfo()))) && - ((this.faultInfo==null && other.getFaultInfo()==null) || - (this.faultInfo!=null && - this.faultInfo.equals(other.getFaultInfo()))) && - ((this.failures==null && other.getFailures()==null) || - (this.failures!=null && - this.failures.equals(other.getFailures()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getIid() != null) { - _hashCode += getIid().hashCode(); - } - if (getPid() != null) { - _hashCode += getPid().hashCode(); - } - if (getProcessName() != null) { - _hashCode += getProcessName().hashCode(); - } - if (getRootScope() != null) { - _hashCode += getRootScope().hashCode(); - } - if (getStatus() != null) { - _hashCode += getStatus().hashCode(); - } - if (getDtStarted() != null) { - _hashCode += getDtStarted().hashCode(); - } - if (getDtLastActive() != null) { - _hashCode += getDtLastActive().hashCode(); - } - if (getDtErrorSince() != null) { - _hashCode += getDtErrorSince().hashCode(); - } - if (getCorrelationProperties() != null) { - for (int i=0; - itInstanceInfo>event-info")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("faultInfo"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "fault-info")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFaultInfo")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("failures"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "failures")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tFailuresInfo")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceStatus.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceStatus.java deleted file mode 100644 index 134f81863..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TInstanceStatus.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * TInstanceStatus.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class TInstanceStatus implements java.io.Serializable { - private java.lang.String _value_; - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - protected TInstanceStatus(java.lang.String value) { - _value_ = value; - _table_.put(_value_,this); - } - - public static final java.lang.String _ACTIVE = "ACTIVE"; - public static final java.lang.String _COMPLETED = "COMPLETED"; - public static final java.lang.String _TERMINATED = "TERMINATED"; - public static final java.lang.String _FAILED = "FAILED"; - public static final java.lang.String _SUSPENDED = "SUSPENDED"; - public static final java.lang.String _ERROR = "ERROR"; - public static final TInstanceStatus ACTIVE = new TInstanceStatus(_ACTIVE); - public static final TInstanceStatus COMPLETED = new TInstanceStatus(_COMPLETED); - public static final TInstanceStatus TERMINATED = new TInstanceStatus(_TERMINATED); - public static final TInstanceStatus FAILED = new TInstanceStatus(_FAILED); - public static final TInstanceStatus SUSPENDED = new TInstanceStatus(_SUSPENDED); - public static final TInstanceStatus ERROR = new TInstanceStatus(_ERROR); - public java.lang.String getValue() { return _value_;} - public static TInstanceStatus fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - TInstanceStatus enumeration = (TInstanceStatus) - _table_.get(value); - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static TInstanceStatus fromString(java.lang.String value) - throws java.lang.IllegalArgumentException { - return fromValue(value); - } - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { return _value_;} - public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumSerializer( - _javaType, _xmlType); - } - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumDeserializer( - _javaType, _xmlType); - } - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(TInstanceStatus.class); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tInstanceStatus")); - } - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessInfo.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessInfo.java deleted file mode 100644 index 4a48d30cb..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessInfo.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * TProcessInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - - -/** - * Information about a BPEL process. - */ -public class TProcessInfo implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { - /* The unique name/id of the process. */ - private java.lang.String pid; - - /* Process status. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus status; - - /* Process version. */ - private long version; - - /* Information about the process - * definition. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo definitionInfo; - - /* Information about the process - * deployment. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo deploymentInfo; - - /* Summary of the instances belonging to this - * process. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary instanceSummary; - - /* Process properties. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[] properties; - - /* Endpoint references. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints; - - /* Process documents */ - private org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[] documents; - - private org.apache.axis.message.MessageElement [] _any; - - public TProcessInfo() { - } - - public TProcessInfo( - java.lang.String pid, - org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus status, - long version, - org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo definitionInfo, - org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo deploymentInfo, - org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary instanceSummary, - org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[] properties, - org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints, - org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[] documents, - org.apache.axis.message.MessageElement [] _any) { - this.pid = pid; - this.status = status; - this.version = version; - this.definitionInfo = definitionInfo; - this.deploymentInfo = deploymentInfo; - this.instanceSummary = instanceSummary; - this.properties = properties; - this.endpoints = endpoints; - this.documents = documents; - this._any = _any; - } - - - /** - * Gets the pid value for this TProcessInfo. - * - * @return pid * The unique name/id of the process. - */ - public java.lang.String getPid() { - return pid; - } - - - /** - * Sets the pid value for this TProcessInfo. - * - * @param pid * The unique name/id of the process. - */ - public void setPid(java.lang.String pid) { - this.pid = pid; - } - - - /** - * Gets the status value for this TProcessInfo. - * - * @return status * Process status. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus getStatus() { - return status; - } - - - /** - * Sets the status value for this TProcessInfo. - * - * @param status * Process status. - */ - public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TProcessStatus status) { - this.status = status; - } - - - /** - * Gets the version value for this TProcessInfo. - * - * @return version * Process version. - */ - public long getVersion() { - return version; - } - - - /** - * Sets the version value for this TProcessInfo. - * - * @param version * Process version. - */ - public void setVersion(long version) { - this.version = version; - } - - - /** - * Gets the definitionInfo value for this TProcessInfo. - * - * @return definitionInfo * Information about the process - * definition. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo getDefinitionInfo() { - return definitionInfo; - } - - - /** - * Sets the definitionInfo value for this TProcessInfo. - * - * @param definitionInfo * Information about the process - * definition. - */ - public void setDefinitionInfo(org.apache.www.ode.pmapi.types._2006._08._02.TDefinitionInfo definitionInfo) { - this.definitionInfo = definitionInfo; - } - - - /** - * Gets the deploymentInfo value for this TProcessInfo. - * - * @return deploymentInfo * Information about the process - * deployment. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo getDeploymentInfo() { - return deploymentInfo; - } - - - /** - * Sets the deploymentInfo value for this TProcessInfo. - * - * @param deploymentInfo * Information about the process - * deployment. - */ - public void setDeploymentInfo(org.apache.www.ode.pmapi.types._2006._08._02.TDeploymentInfo deploymentInfo) { - this.deploymentInfo = deploymentInfo; - } - - - /** - * Gets the instanceSummary value for this TProcessInfo. - * - * @return instanceSummary * Summary of the instances belonging to this - * process. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary getInstanceSummary() { - return instanceSummary; - } - - - /** - * Sets the instanceSummary value for this TProcessInfo. - * - * @param instanceSummary * Summary of the instances belonging to this - * process. - */ - public void setInstanceSummary(org.apache.www.ode.pmapi.types._2006._08._02.TInstanceSummary instanceSummary) { - this.instanceSummary = instanceSummary; - } - - - /** - * Gets the properties value for this TProcessInfo. - * - * @return properties * Process properties. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[] getProperties() { - return properties; - } - - - /** - * Sets the properties value for this TProcessInfo. - * - * @param properties * Process properties. - */ - public void setProperties(org.apache.www.ode.pmapi.types._2006._08._02.TProcessPropertiesProperty[] properties) { - this.properties = properties; - } - - - /** - * Gets the endpoints value for this TProcessInfo. - * - * @return endpoints * Endpoint references. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] getEndpoints() { - return endpoints; - } - - - /** - * Sets the endpoints value for this TProcessInfo. - * - * @param endpoints * Endpoint references. - */ - public void setEndpoints(org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints) { - this.endpoints = endpoints; - } - - - /** - * Gets the documents value for this TProcessInfo. - * - * @return documents * Process documents - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[] getDocuments() { - return documents; - } - - - /** - * Sets the documents value for this TProcessInfo. - * - * @param documents * Process documents - */ - public void setDocuments(org.apache.www.ode.pmapi.types._2006._08._02.TDocumentInfo[] documents) { - this.documents = documents; - } - - - /** - * Gets the _any value for this TProcessInfo. - * - * @return _any - */ - public org.apache.axis.message.MessageElement [] get_any() { - return _any; - } - - - /** - * Sets the _any value for this TProcessInfo. - * - * @param _any - */ - public void set_any(org.apache.axis.message.MessageElement [] _any) { - this._any = _any; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TProcessInfo)) return false; - TProcessInfo other = (TProcessInfo) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.pid==null && other.getPid()==null) || - (this.pid!=null && - this.pid.equals(other.getPid()))) && - ((this.status==null && other.getStatus()==null) || - (this.status!=null && - this.status.equals(other.getStatus()))) && - this.version == other.getVersion() && - ((this.definitionInfo==null && other.getDefinitionInfo()==null) || - (this.definitionInfo!=null && - this.definitionInfo.equals(other.getDefinitionInfo()))) && - ((this.deploymentInfo==null && other.getDeploymentInfo()==null) || - (this.deploymentInfo!=null && - this.deploymentInfo.equals(other.getDeploymentInfo()))) && - ((this.instanceSummary==null && other.getInstanceSummary()==null) || - (this.instanceSummary!=null && - this.instanceSummary.equals(other.getInstanceSummary()))) && - ((this.properties==null && other.getProperties()==null) || - (this.properties!=null && - java.util.Arrays.equals(this.properties, other.getProperties()))) && - ((this.endpoints==null && other.getEndpoints()==null) || - (this.endpoints!=null && - java.util.Arrays.equals(this.endpoints, other.getEndpoints()))) && - ((this.documents==null && other.getDocuments()==null) || - (this.documents!=null && - java.util.Arrays.equals(this.documents, other.getDocuments()))) && - ((this._any==null && other.get_any()==null) || - (this._any!=null && - java.util.Arrays.equals(this._any, other.get_any()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getPid() != null) { - _hashCode += getPid().hashCode(); - } - if (getStatus() != null) { - _hashCode += getStatus().hashCode(); - } - _hashCode += new Long(getVersion()).hashCode(); - if (getDefinitionInfo() != null) { - _hashCode += getDefinitionInfo().hashCode(); - } - if (getDeploymentInfo() != null) { - _hashCode += getDeploymentInfo().hashCode(); - } - if (getInstanceSummary() != null) { - _hashCode += getInstanceSummary().hashCode(); - } - if (getProperties() != null) { - for (int i=0; - itProcessProperties>property")); - elemField.setNillable(false); - elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "property")); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("endpoints"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoints")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref")); - elemField.setNillable(false); - elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoint-ref")); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("documents"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "documents")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tDocumentInfo")); - elemField.setNillable(false); - elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "document")); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessPropertiesProperty.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessPropertiesProperty.java deleted file mode 100644 index e06853f61..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessPropertiesProperty.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * TProcessPropertiesProperty.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class TProcessPropertiesProperty implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { - private org.apache.axis.message.MessageElement [] _any; - - private javax.xml.namespace.QName name; // attribute - - public TProcessPropertiesProperty() { - } - - public TProcessPropertiesProperty( - org.apache.axis.message.MessageElement [] _any, - javax.xml.namespace.QName name) { - this._any = _any; - this.name = name; - } - - - /** - * Gets the _any value for this TProcessPropertiesProperty. - * - * @return _any - */ - public org.apache.axis.message.MessageElement [] get_any() { - return _any; - } - - - /** - * Sets the _any value for this TProcessPropertiesProperty. - * - * @param _any - */ - public void set_any(org.apache.axis.message.MessageElement [] _any) { - this._any = _any; - } - - - /** - * Gets the name value for this TProcessPropertiesProperty. - * - * @return name - */ - public javax.xml.namespace.QName getName() { - return name; - } - - - /** - * Sets the name value for this TProcessPropertiesProperty. - * - * @param name - */ - public void setName(javax.xml.namespace.QName name) { - this.name = name; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TProcessPropertiesProperty)) return false; - TProcessPropertiesProperty other = (TProcessPropertiesProperty) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this._any==null && other.get_any()==null) || - (this._any!=null && - java.util.Arrays.equals(this._any, other.get_any()))) && - ((this.name==null && other.getName()==null) || - (this.name!=null && - this.name.equals(other.getName()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (get_any() != null) { - for (int i=0; - itProcessProperties>property")); - org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("name"); - attrField.setXmlName(new javax.xml.namespace.QName("", "name")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "QName")); - typeDesc.addFieldDesc(attrField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessStatus.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessStatus.java deleted file mode 100644 index 2be0704f4..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TProcessStatus.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * TProcessStatus.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class TProcessStatus implements java.io.Serializable { - private java.lang.String _value_; - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - protected TProcessStatus(java.lang.String value) { - _value_ = value; - _table_.put(_value_,this); - } - - public static final java.lang.String _ACTIVE = "ACTIVE"; - public static final java.lang.String _RETIRED = "RETIRED"; - public static final TProcessStatus ACTIVE = new TProcessStatus(_ACTIVE); - public static final TProcessStatus RETIRED = new TProcessStatus(_RETIRED); - public java.lang.String getValue() { return _value_;} - public static TProcessStatus fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - TProcessStatus enumeration = (TProcessStatus) - _table_.get(value); - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static TProcessStatus fromString(java.lang.String value) - throws java.lang.IllegalArgumentException { - return fromValue(value); - } - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { return _value_;} - public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumSerializer( - _javaType, _xmlType); - } - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumDeserializer( - _javaType, _xmlType); - } - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(TProcessStatus.class); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tProcessStatus")); - } - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeInfo.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeInfo.java deleted file mode 100644 index 0d5fe605a..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeInfo.java +++ /dev/null @@ -1,465 +0,0 @@ -/** - * TScopeInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class TScopeInfo implements java.io.Serializable { - /* Scope instance identifier. */ - private java.lang.String siid; - - /* Scope name. */ - private java.lang.String name; - - /* Scope instance identifier. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status; - - /* Parent scope reference. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef parentScopeRef; - - private org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[] children; - - private org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[] activities; - - private org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[] variables; - - /* Lists all correlation correlation sets associated with - * this scope with their valued correlation properties. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][] correlationSets; - - /* Endpoint references. */ - private org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints; - - public TScopeInfo() { - } - - public TScopeInfo( - java.lang.String siid, - java.lang.String name, - org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status, - org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef parentScopeRef, - org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[] children, - org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[] activities, - org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[] variables, - org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][] correlationSets, - org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints) { - this.siid = siid; - this.name = name; - this.status = status; - this.parentScopeRef = parentScopeRef; - this.children = children; - this.activities = activities; - this.variables = variables; - this.correlationSets = correlationSets; - this.endpoints = endpoints; - } - - - /** - * Gets the siid value for this TScopeInfo. - * - * @return siid * Scope instance identifier. - */ - public java.lang.String getSiid() { - return siid; - } - - - /** - * Sets the siid value for this TScopeInfo. - * - * @param siid * Scope instance identifier. - */ - public void setSiid(java.lang.String siid) { - this.siid = siid; - } - - - /** - * Gets the name value for this TScopeInfo. - * - * @return name * Scope name. - */ - public java.lang.String getName() { - return name; - } - - - /** - * Sets the name value for this TScopeInfo. - * - * @param name * Scope name. - */ - public void setName(java.lang.String name) { - this.name = name; - } - - - /** - * Gets the status value for this TScopeInfo. - * - * @return status * Scope instance identifier. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus getStatus() { - return status; - } - - - /** - * Sets the status value for this TScopeInfo. - * - * @param status * Scope instance identifier. - */ - public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status) { - this.status = status; - } - - - /** - * Gets the parentScopeRef value for this TScopeInfo. - * - * @return parentScopeRef * Parent scope reference. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef getParentScopeRef() { - return parentScopeRef; - } - - - /** - * Sets the parentScopeRef value for this TScopeInfo. - * - * @param parentScopeRef * Parent scope reference. - */ - public void setParentScopeRef(org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef parentScopeRef) { - this.parentScopeRef = parentScopeRef; - } - - - /** - * Gets the children value for this TScopeInfo. - * - * @return children - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[] getChildren() { - return children; - } - - - /** - * Sets the children value for this TScopeInfo. - * - * @param children - */ - public void setChildren(org.apache.www.ode.pmapi.types._2006._08._02.TScopeRef[] children) { - this.children = children; - } - - - /** - * Gets the activities value for this TScopeInfo. - * - * @return activities - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[] getActivities() { - return activities; - } - - - /** - * Sets the activities value for this TScopeInfo. - * - * @param activities - */ - public void setActivities(org.apache.www.ode.pmapi.types._2006._08._02.TActivityInfo[] activities) { - this.activities = activities; - } - - - /** - * Gets the variables value for this TScopeInfo. - * - * @return variables - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[] getVariables() { - return variables; - } - - - /** - * Sets the variables value for this TScopeInfo. - * - * @param variables - */ - public void setVariables(org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef[] variables) { - this.variables = variables; - } - - - /** - * Gets the correlationSets value for this TScopeInfo. - * - * @return correlationSets * Lists all correlation correlation sets associated with - * this scope with their valued correlation properties. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][] getCorrelationSets() { - return correlationSets; - } - - - /** - * Sets the correlationSets value for this TScopeInfo. - * - * @param correlationSets * Lists all correlation correlation sets associated with - * this scope with their valued correlation properties. - */ - public void setCorrelationSets(org.apache.www.ode.pmapi.types._2006._08._02.TCorrelationProperty[][] correlationSets) { - this.correlationSets = correlationSets; - } - - - /** - * Gets the endpoints value for this TScopeInfo. - * - * @return endpoints * Endpoint references. - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] getEndpoints() { - return endpoints; - } - - - /** - * Sets the endpoints value for this TScopeInfo. - * - * @param endpoints * Endpoint references. - */ - public void setEndpoints(org.apache.www.ode.pmapi.types._2006._08._02.TEndpointReferencesEndpointRef[] endpoints) { - this.endpoints = endpoints; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TScopeInfo)) return false; - TScopeInfo other = (TScopeInfo) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.siid==null && other.getSiid()==null) || - (this.siid!=null && - this.siid.equals(other.getSiid()))) && - ((this.name==null && other.getName()==null) || - (this.name!=null && - this.name.equals(other.getName()))) && - ((this.status==null && other.getStatus()==null) || - (this.status!=null && - this.status.equals(other.getStatus()))) && - ((this.parentScopeRef==null && other.getParentScopeRef()==null) || - (this.parentScopeRef!=null && - this.parentScopeRef.equals(other.getParentScopeRef()))) && - ((this.children==null && other.getChildren()==null) || - (this.children!=null && - java.util.Arrays.equals(this.children, other.getChildren()))) && - ((this.activities==null && other.getActivities()==null) || - (this.activities!=null && - java.util.Arrays.equals(this.activities, other.getActivities()))) && - ((this.variables==null && other.getVariables()==null) || - (this.variables!=null && - java.util.Arrays.equals(this.variables, other.getVariables()))) && - ((this.correlationSets==null && other.getCorrelationSets()==null) || - (this.correlationSets!=null && - java.util.Arrays.equals(this.correlationSets, other.getCorrelationSets()))) && - ((this.endpoints==null && other.getEndpoints()==null) || - (this.endpoints!=null && - java.util.Arrays.equals(this.endpoints, other.getEndpoints()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getSiid() != null) { - _hashCode += getSiid().hashCode(); - } - if (getName() != null) { - _hashCode += getName().hashCode(); - } - if (getStatus() != null) { - _hashCode += getStatus().hashCode(); - } - if (getParentScopeRef() != null) { - _hashCode += getParentScopeRef().hashCode(); - } - if (getChildren() != null) { - for (int i=0; - i>tScopeInfo>correlation-sets>correlation-set")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "correlation-set")); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("endpoints"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoints")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tEndpointReferences>endpoint-ref")); - elemField.setNillable(false); - elemField.setItemQName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "endpoint-ref")); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeRef.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeRef.java deleted file mode 100644 index 88eb8ac11..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeRef.java +++ /dev/null @@ -1,227 +0,0 @@ -/** - * TScopeRef.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - - -/** - * Reference to a scope. - */ -public class TScopeRef implements java.io.Serializable { - private java.lang.String siid; // attribute - - private java.lang.String name; // attribute - - private java.lang.String modelId; // attribute - - private org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status; // attribute - - public TScopeRef() { - } - - public TScopeRef( - java.lang.String siid, - java.lang.String name, - java.lang.String modelId, - org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status) { - this.siid = siid; - this.name = name; - this.modelId = modelId; - this.status = status; - } - - - /** - * Gets the siid value for this TScopeRef. - * - * @return siid - */ - public java.lang.String getSiid() { - return siid; - } - - - /** - * Sets the siid value for this TScopeRef. - * - * @param siid - */ - public void setSiid(java.lang.String siid) { - this.siid = siid; - } - - - /** - * Gets the name value for this TScopeRef. - * - * @return name - */ - public java.lang.String getName() { - return name; - } - - - /** - * Sets the name value for this TScopeRef. - * - * @param name - */ - public void setName(java.lang.String name) { - this.name = name; - } - - - /** - * Gets the modelId value for this TScopeRef. - * - * @return modelId - */ - public java.lang.String getModelId() { - return modelId; - } - - - /** - * Sets the modelId value for this TScopeRef. - * - * @param modelId - */ - public void setModelId(java.lang.String modelId) { - this.modelId = modelId; - } - - - /** - * Gets the status value for this TScopeRef. - * - * @return status - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus getStatus() { - return status; - } - - - /** - * Sets the status value for this TScopeRef. - * - * @param status - */ - public void setStatus(org.apache.www.ode.pmapi.types._2006._08._02.TScopeStatus status) { - this.status = status; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TScopeRef)) return false; - TScopeRef other = (TScopeRef) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.siid==null && other.getSiid()==null) || - (this.siid!=null && - this.siid.equals(other.getSiid()))) && - ((this.name==null && other.getName()==null) || - (this.name!=null && - this.name.equals(other.getName()))) && - ((this.modelId==null && other.getModelId()==null) || - (this.modelId!=null && - this.modelId.equals(other.getModelId()))) && - ((this.status==null && other.getStatus()==null) || - (this.status!=null && - this.status.equals(other.getStatus()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getSiid() != null) { - _hashCode += getSiid().hashCode(); - } - if (getName() != null) { - _hashCode += getName().hashCode(); - } - if (getModelId() != null) { - _hashCode += getModelId().hashCode(); - } - if (getStatus() != null) { - _hashCode += getStatus().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(TScopeRef.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeRef")); - org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("siid"); - attrField.setXmlName(new javax.xml.namespace.QName("", "siid")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("name"); - attrField.setXmlName(new javax.xml.namespace.QName("", "name")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("modelId"); - attrField.setXmlName(new javax.xml.namespace.QName("", "modelId")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("status"); - attrField.setXmlName(new javax.xml.namespace.QName("", "status")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus")); - typeDesc.addFieldDesc(attrField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeStatus.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeStatus.java deleted file mode 100644 index 819fe55e3..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TScopeStatus.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * TScopeStatus.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class TScopeStatus implements java.io.Serializable { - private java.lang.String _value_; - private static java.util.HashMap _table_ = new java.util.HashMap(); - - // Constructor - protected TScopeStatus(java.lang.String value) { - _value_ = value; - _table_.put(_value_,this); - } - - public static final java.lang.String _ACTIVE = "ACTIVE"; - public static final java.lang.String _COMPLETED = "COMPLETED"; - public static final java.lang.String _FAULTED = "FAULTED"; - public static final java.lang.String _FAULTHANDLING = "FAULTHANDLING"; - public static final java.lang.String _COMPENSATING = "COMPENSATING"; - public static final java.lang.String _COMPENSATED = "COMPENSATED"; - public static final TScopeStatus ACTIVE = new TScopeStatus(_ACTIVE); - public static final TScopeStatus COMPLETED = new TScopeStatus(_COMPLETED); - public static final TScopeStatus FAULTED = new TScopeStatus(_FAULTED); - public static final TScopeStatus FAULTHANDLING = new TScopeStatus(_FAULTHANDLING); - public static final TScopeStatus COMPENSATING = new TScopeStatus(_COMPENSATING); - public static final TScopeStatus COMPENSATED = new TScopeStatus(_COMPENSATED); - public java.lang.String getValue() { return _value_;} - public static TScopeStatus fromValue(java.lang.String value) - throws java.lang.IllegalArgumentException { - TScopeStatus enumeration = (TScopeStatus) - _table_.get(value); - if (enumeration==null) throw new java.lang.IllegalArgumentException(); - return enumeration; - } - public static TScopeStatus fromString(java.lang.String value) - throws java.lang.IllegalArgumentException { - return fromValue(value); - } - public boolean equals(java.lang.Object obj) {return (obj == this);} - public int hashCode() { return toString().hashCode();} - public java.lang.String toString() { return _value_;} - public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumSerializer( - _javaType, _xmlType); - } - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.EnumDeserializer( - _javaType, _xmlType); - } - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(TScopeStatus.class); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tScopeStatus")); - } - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfo.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfo.java deleted file mode 100644 index 1d10c7d0e..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfo.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * TVariableInfo.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - - -/** - * Information about a variable (basically the value) - */ -public class TVariableInfo implements java.io.Serializable { - private org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef self; - - private org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue value; - - public TVariableInfo() { - } - - public TVariableInfo( - org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef self, - org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue value) { - this.self = self; - this.value = value; - } - - - /** - * Gets the self value for this TVariableInfo. - * - * @return self - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef getSelf() { - return self; - } - - - /** - * Sets the self value for this TVariableInfo. - * - * @param self - */ - public void setSelf(org.apache.www.ode.pmapi.types._2006._08._02.TVariableRef self) { - this.self = self; - } - - - /** - * Gets the value value for this TVariableInfo. - * - * @return value - */ - public org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue getValue() { - return value; - } - - - /** - * Sets the value value for this TVariableInfo. - * - * @param value - */ - public void setValue(org.apache.www.ode.pmapi.types._2006._08._02.TVariableInfoValue value) { - this.value = value; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TVariableInfo)) return false; - TVariableInfo other = (TVariableInfo) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.self==null && other.getSelf()==null) || - (this.self!=null && - this.self.equals(other.getSelf()))) && - ((this.value==null && other.getValue()==null) || - (this.value!=null && - this.value.equals(other.getValue()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getSelf() != null) { - _hashCode += getSelf().hashCode(); - } - if (getValue() != null) { - _hashCode += getValue().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(TVariableInfo.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableInfo")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("self"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "self")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef")); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("value"); - elemField.setXmlName(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "value")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", ">tVariableInfo>value")); - elemField.setMinOccurs(0); - elemField.setNillable(false); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfoValue.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfoValue.java deleted file mode 100644 index eb42a0542..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableInfoValue.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * TVariableInfoValue.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - -public class TVariableInfoValue implements java.io.Serializable, org.apache.axis.encoding.AnyContentType { - private org.apache.axis.message.MessageElement [] _any; - - public TVariableInfoValue() { - } - - public TVariableInfoValue( - org.apache.axis.message.MessageElement [] _any) { - this._any = _any; - } - - - /** - * Gets the _any value for this TVariableInfoValue. - * - * @return _any - */ - public org.apache.axis.message.MessageElement [] get_any() { - return _any; - } - - - /** - * Sets the _any value for this TVariableInfoValue. - * - * @param _any - */ - public void set_any(org.apache.axis.message.MessageElement [] _any) { - this._any = _any; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TVariableInfoValue)) return false; - TVariableInfoValue other = (TVariableInfoValue) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this._any==null && other.get_any()==null) || - (this._any!=null && - java.util.Arrays.equals(this._any, other.get_any()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (get_any() != null) { - for (int i=0; - itVariableInfo>value")); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableRef.java b/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableRef.java deleted file mode 100644 index d476fd6ef..000000000 --- a/org.opentosca.container.connector.ode/src/org/apache/www/ode/pmapi/types/_2006/_08/_02/TVariableRef.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - * TVariableRef.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. - */ - -package org.apache.www.ode.pmapi.types._2006._08._02; - - -/** - * Reference to a variable. - */ -public class TVariableRef implements java.io.Serializable { - private java.lang.String iid; // attribute - - private java.lang.String siid; // attribute - - private java.lang.String name; // attribute - - public TVariableRef() { - } - - public TVariableRef( - java.lang.String iid, - java.lang.String siid, - java.lang.String name) { - this.iid = iid; - this.siid = siid; - this.name = name; - } - - - /** - * Gets the iid value for this TVariableRef. - * - * @return iid - */ - public java.lang.String getIid() { - return iid; - } - - - /** - * Sets the iid value for this TVariableRef. - * - * @param iid - */ - public void setIid(java.lang.String iid) { - this.iid = iid; - } - - - /** - * Gets the siid value for this TVariableRef. - * - * @return siid - */ - public java.lang.String getSiid() { - return siid; - } - - - /** - * Sets the siid value for this TVariableRef. - * - * @param siid - */ - public void setSiid(java.lang.String siid) { - this.siid = siid; - } - - - /** - * Gets the name value for this TVariableRef. - * - * @return name - */ - public java.lang.String getName() { - return name; - } - - - /** - * Sets the name value for this TVariableRef. - * - * @param name - */ - public void setName(java.lang.String name) { - this.name = name; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof TVariableRef)) return false; - TVariableRef other = (TVariableRef) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.iid==null && other.getIid()==null) || - (this.iid!=null && - this.iid.equals(other.getIid()))) && - ((this.siid==null && other.getSiid()==null) || - (this.siid!=null && - this.siid.equals(other.getSiid()))) && - ((this.name==null && other.getName()==null) || - (this.name!=null && - this.name.equals(other.getName()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getIid() != null) { - _hashCode += getIid().hashCode(); - } - if (getSiid() != null) { - _hashCode += getSiid().hashCode(); - } - if (getName() != null) { - _hashCode += getName().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(TVariableRef.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.apache.org/ode/pmapi/types/2006/08/02/", "tVariableRef")); - org.apache.axis.description.AttributeDesc attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("iid"); - attrField.setXmlName(new javax.xml.namespace.QName("", "iid")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("siid"); - attrField.setXmlName(new javax.xml.namespace.QName("", "siid")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - attrField = new org.apache.axis.description.AttributeDesc(); - attrField.setFieldName("name"); - attrField.setXmlName(new javax.xml.namespace.QName("", "name")); - attrField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(attrField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/org.opentosca.container.connector.ode/src/org/opentosca/container/connector/ode/Activator.java b/org.opentosca.container.connector.ode/src/org/opentosca/container/connector/ode/Activator.java deleted file mode 100644 index 4a5fae967..000000000 --- a/org.opentosca.container.connector.ode/src/org/opentosca/container/connector/ode/Activator.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.connector.ode; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.connector.winery/META-INF/MANIFEST.MF b/org.opentosca.container.connector.winery/META-INF/MANIFEST.MF deleted file mode 100644 index 4df3bb7ec..000000000 --- a/org.opentosca.container.connector.winery/META-INF/MANIFEST.MF +++ /dev/null @@ -1,26 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container Winery Connector -Bundle-SymbolicName: org.opentosca.container.connector.winery -Bundle-Version: 2.0.0.qualifier -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ClassPath: . -Export-Package: org.opentosca.container.connector.winery -Import-Package: com.fasterxml.jackson.core;version="2.6.2", - com.fasterxml.jackson.databind;version="2.6.2", - org.apache.commons.io;version="2.2.0", - org.apache.http;version="4.2.1", - org.apache.http.client;version="4.2.0", - org.apache.http.client.entity;version="4.2.0", - org.apache.http.client.methods;version="4.2.0", - org.apache.http.entity;version="4.3.3", - org.apache.http.entity.mime;version="4.2.0", - org.apache.http.entity.mime.content;version="4.2.0", - org.apache.http.impl.client;version="4.2.0", - org.apache.http.message;version="4.2.1", - org.apache.http.util;version="4.2.1", - org.osgi.framework;version="1.8.0", - org.slf4j;version="1.7.2" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0" -Bundle-Activator: org.opentosca.container.connector.winery.Activator diff --git a/org.opentosca.container.connector.winery/build.properties b/org.opentosca.container.connector.winery/build.properties deleted file mode 100644 index b107977f4..000000000 --- a/org.opentosca.container.connector.winery/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.container.connector.winery/pom.xml b/org.opentosca.container.connector.winery/pom.xml index 0fa7aff61..fc7783a9e 100644 --- a/org.opentosca.container.connector.winery/pom.xml +++ b/org.opentosca.container.connector.winery/pom.xml @@ -1,6 +1,8 @@ - + 4.0.0 @@ -10,6 +12,28 @@ org.opentosca.container.connector.winery - eclipse-plugin + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + + org.apache.httpcomponents + httpclient + 4.5.4 + + + org.apache.httpcomponents + httpmime + 4.5.1 + + + com.fasterxml.jackson.core + jackson-databind + 2.8.9 + + diff --git a/org.opentosca.container.connector.winery/src/org/opentosca/container/connector/winery/WineryConnector.java b/org.opentosca.container.connector.winery/src/main/java/org/opentosca/container/connector/winery/WineryConnector.java similarity index 77% rename from org.opentosca.container.connector.winery/src/org/opentosca/container/connector/winery/WineryConnector.java rename to org.opentosca.container.connector.winery/src/main/java/org/opentosca/container/connector/winery/WineryConnector.java index 531c9ab5c..22237980a 100644 --- a/org.opentosca.container.connector.winery/src/org/opentosca/container/connector/winery/WineryConnector.java +++ b/org.opentosca.container.connector.winery/src/main/java/org/opentosca/container/connector/winery/WineryConnector.java @@ -7,6 +7,8 @@ import java.net.URL; import java.net.URLDecoder; import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; import java.util.Arrays; import java.util.Map; import java.util.Objects; @@ -14,7 +16,6 @@ import javax.xml.namespace.QName; -import org.apache.commons.io.FileUtils; import org.apache.http.HttpEntity; import org.apache.http.HttpHeaders; import org.apache.http.HttpResponse; @@ -38,45 +39,46 @@ import org.slf4j.LoggerFactory; /** - * Copyright 2016 IAAS University of Stuttgart
    - *
    + * Copyright 2016 IAAS University of Stuttgart * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class WineryConnector { final private static Logger LOG = LoggerFactory.getLogger(WineryConnector.class); - private String wineryPath; - private static final String FEATURE_ENRICHMENT_SUFFIX = "/topologytemplate/availablefeatures"; + private final String wineryPath; + public WineryConnector() { - this.wineryPath = Settings.getSetting("org.opentosca.container.connector.winery.url"); - LOG.debug("Initialized Winery Connector for endpoint " + this.wineryPath); - if (!this.wineryPath.endsWith("/")) { - this.wineryPath = this.wineryPath + "/"; + String configurationValue = Settings.getSetting("org.opentosca.container.connector.winery.url"); + if (!configurationValue.endsWith("/")) { + configurationValue = configurationValue + "/"; + } + try { + new URI(configurationValue); + } catch (URISyntaxException e) { + LOG.error("Winery Connector configuration is not valid", e); } + this.wineryPath = configurationValue; + LOG.debug("Initialized Winery Connector for endpoint " + this.wineryPath); } public boolean isWineryRepositoryAvailable() { try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - final URI serviceTemplatesUri = new URI(this.wineryPath + "servicetemplates"); LOG.debug("Checking if winery is available at " + serviceTemplatesUri.toString()); final HttpGet get = new HttpGet(); get.setHeader(HttpHeaders.ACCEPT, ContentType.APPLICATION_JSON.getMimeType()); get.setURI(serviceTemplatesUri); - final CloseableHttpResponse resp = httpClient.execute(get); resp.close(); return resp.getStatusLine().getStatusCode() < 400; - } - catch (IOException | URISyntaxException e) { - LOG.error("Exception while checking for availability of Container Repository: " + e.getMessage()); + } catch (URISyntaxException | IOException e) { + LOG.error("Exception while checking for availability of Container Repository: ", e); return false; } } @@ -88,30 +90,34 @@ public String getWineryPath() { public URI getServiceTemplateURI(final QName serviceTemplateId) { try { LOG.debug("Trying to fetch URI to Service Template" + serviceTemplateId.toString()); - return new URI(this.wineryPath + "servicetemplates/" - + URLEncoder.encode(URLEncoder.encode(serviceTemplateId.getNamespaceURI())) + "/" - + serviceTemplateId.getLocalPart()); - } - catch (final URISyntaxException e) { - LOG.error("Exception while parsing URI for ServiceTemplate: " + e.getMessage()); + String uri = String.format("%sservicetemplates/%s/%s", wineryPath, + URLEncoder.encode(URLEncoder.encode(serviceTemplateId.getNamespaceURI())), + serviceTemplateId.getLocalPart()); + return new URI(uri); + } catch (final URISyntaxException e) { + LOG.warn("URI created from serviceTemplateId {} was malformed", serviceTemplateId, e); return null; } } + public QName uploadCSAR(final File file) throws URISyntaxException, IOException { + return uploadCSAR(file, false); + } + private String uploadCSARToWinery(final File file, final boolean overwrite) throws URISyntaxException, IOException { final MultipartEntityBuilder builder = MultipartEntityBuilder.create(); final ContentBody fileBody = new FileBody(file); final ContentBody overwriteBody = new StringBody(String.valueOf(overwrite), ContentType.TEXT_PLAIN); - final FormBodyPart filePart = FormBodyPartBuilder.create().setName("file").setBody(fileBody).build(); - final FormBodyPart overwritePart = - FormBodyPartBuilder.create().setName("overwrite").setBody(overwriteBody).build(); + final FormBodyPart filePart = FormBodyPartBuilder.create("file", fileBody).build(); + final FormBodyPart overwritePart = FormBodyPartBuilder.create("overwrite", overwriteBody).build(); builder.addPart(filePart); builder.addPart(overwritePart); final HttpEntity entity = builder.build(); final HttpPost wineryPost = new HttpPost(); + wineryPost.setURI(new URI(this.wineryPath)); wineryPost.setEntity(entity); @@ -124,9 +130,8 @@ private String uploadCSARToWinery(final File file, final boolean overwrite) thro location = location.substring(0, location.length() - 1); } return location; - } - catch (final IOException e) { - LOG.error("Exception while uploading CSAR to the Container Repository: " + e.getMessage()); + } catch (final IOException e) { + LOG.error("Exception while uploading CSAR to the Container Repository: ", e); return ""; } } @@ -136,29 +141,28 @@ public QName uploadCSAR(final File file, final boolean overwrite) throws URISynt if (Objects.isNull(location)) { return null; } - // create QName of the created serviceTemplate resource final String localPart = getLastPathFragment(location); final String namespaceDblEnc = getLastPathFragment(location.substring(0, location.lastIndexOf("/"))); final String namespace = URLDecoder.decode(URLDecoder.decode(namespaceDblEnc)); + return new QName(namespace, localPart); } public QName createServiceTemplateFromXaaSPackage(final File file, final QName artifactType, final Set nodeTypes, final QName infrastructureNodeType, final Map tags) throws URISyntaxException, - IOException { + IOException { final MultipartEntityBuilder builder = MultipartEntityBuilder.create(); // file final ContentBody fileBody = new FileBody(file); - final FormBodyPart filePart = FormBodyPartBuilder.create().setName("file").setBody(fileBody).build(); + final FormBodyPart filePart = FormBodyPartBuilder.create("file", fileBody).build(); builder.addPart(filePart); // artefactType final ContentBody artefactTypeBody = new StringBody(artifactType.toString(), ContentType.TEXT_PLAIN); - final FormBodyPart artefactTypePart = - FormBodyPartBuilder.create().setName("artefactType").setBody(artefactTypeBody).build(); + final FormBodyPart artefactTypePart = FormBodyPartBuilder.create("artefactType", artefactTypeBody).build(); builder.addPart(artefactTypePart); // nodeTypes @@ -170,8 +174,7 @@ public QName createServiceTemplateFromXaaSPackage(final File file, final QName a final ContentBody nodeTypesBody = new StringBody(nodeTypesAsString.substring(0, nodeTypesAsString.length() - 1), ContentType.TEXT_PLAIN); - final FormBodyPart nodeTypesPart = - FormBodyPartBuilder.create().setName("nodeTypes").setBody(nodeTypesBody).build(); + final FormBodyPart nodeTypesPart = FormBodyPartBuilder.create("nodeTypes", nodeTypesBody).build(); builder.addPart(nodeTypesPart); } @@ -180,8 +183,7 @@ public QName createServiceTemplateFromXaaSPackage(final File file, final QName a final ContentBody infrastructureNodeTypeBody = new StringBody(infrastructureNodeType.toString(), ContentType.TEXT_PLAIN); final FormBodyPart infrastructureNodeTypePart = - FormBodyPartBuilder.create().setName("infrastructureNodeType").setBody(infrastructureNodeTypeBody) - .build(); + FormBodyPartBuilder.create("infrastructureNodeType", infrastructureNodeTypeBody).build(); builder.addPart(infrastructureNodeTypePart); } @@ -198,12 +200,11 @@ public QName createServiceTemplateFromXaaSPackage(final File file, final QName a final ContentBody tagsBody = new StringBody(tagsString.substring(0, tagsString.length() - 1), ContentType.TEXT_PLAIN); - final FormBodyPart tagsPart = FormBodyPartBuilder.create().setName("tags").setBody(tagsBody).build(); + final FormBodyPart tagsPart = FormBodyPartBuilder.create("tags", tagsBody).build(); builder.addPart(tagsPart); } try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - // POST to XaaSPackager final HttpPost xaasPOST = new HttpPost(); xaasPOST.setURI(new URI(this.wineryPath + "servicetemplates/")); @@ -223,9 +224,8 @@ public QName createServiceTemplateFromXaaSPackage(final File file, final QName a final String namespace = URLDecoder.decode(URLDecoder.decode(namespaceDblEnc)); return new QName(namespace, localPart); - } - catch (final IOException e) { - LOG.error("Exception while calling XaaS packager: " + e.getMessage()); + } catch (final IOException e) { + LOG.error("Exception while calling Xaas packager: ", e); return null; } } @@ -239,8 +239,11 @@ private String getLastPathFragment(final String url) { } private String getHeaderValue(final HttpResponse response, final String headerName) { - return Arrays.stream(response.getAllHeaders()).filter(header -> header.getName().equals(headerName)).findFirst() - .map(header -> header.getValue()).orElse(null); + return Arrays.stream(response.getAllHeaders()) + .filter(header -> header.getName().equals(headerName)) + .findFirst() + .map(header -> header.getValue()) + .orElse(null); } /** @@ -254,13 +257,12 @@ public void performManagementFeatureEnrichment(final File file) { return; } LOG.debug("Container Repository is available. Uploading file {} to repo...", file.getName()); - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { // upload CSAR to enable enrichment in Winery final String location = uploadCSARToWinery(file, false); - if (!Objects.nonNull(location)) { - LOG.error("Upload returned location equal to null!"); + if (Objects.isNull(location)) { + LOG.error("Upload return location equal to null!"); return; } @@ -274,7 +276,7 @@ public void performManagementFeatureEnrichment(final File file) { final String jsonResponse = EntityUtils.toString(resp.getEntity()); resp.close(); - LOG.debug("Container Repository returned the follow features: {}", jsonResponse); + LOG.debug("Container Repository returned the following features:", jsonResponse); // apply the found features to the CSAR final HttpPut put = new HttpPut(); @@ -285,21 +287,14 @@ public void performManagementFeatureEnrichment(final File file) { resp = httpClient.execute(put); resp.close(); - LOG.debug("Feature enrichment retuned status line: {}", resp.getStatusLine()); + LOG.debug("Feature enrichment returned status line: {}", resp.getStatusLine()); - // retrieve updated CSAR from Winery + // retrieve updated CSAR from winery final URL url = new URL(location + "/?csar"); - FileUtils.copyInputStreamToFile(url.openStream(), file); + Files.copy(url.openStream(), file.toPath(), StandardCopyOption.REPLACE_EXISTING); LOG.debug("Updated CSAR file in the Container with enriched topology."); - } - catch (final URISyntaxException e) { - LOG.error("URISyntaxException while performing management feature enrichment: {}", e.getMessage()); - } - catch (final IOException e) { - LOG.error("IOException while performing management feature enrichment: {}", e.getMessage()); - } - catch (final Exception e) { - LOG.error("Exception while performing management feature enrichment: {}", e.getMessage()); + } catch (final Exception e) { + LOG.error("{} while performing management feature enrichment: {}", e.getClass().getSimpleName(), e.getMessage(), e); } } } diff --git a/org.opentosca.container.connector.winery/src/org/opentosca/container/connector/winery/Activator.java b/org.opentosca.container.connector.winery/src/org/opentosca/container/connector/winery/Activator.java deleted file mode 100644 index ce40c9d2d..000000000 --- a/org.opentosca.container.connector.winery/src/org/opentosca/container/connector/winery/Activator.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.connector.winery; - -import org.opentosca.container.core.common.Settings; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - - final String url = context.getProperty("org.opentosca.container.connector.winery.url"); - - if (url != null) { - Settings.setSetting("org.opentosca.container.connector.winery.url", url); - } - - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.control/META-INF/MANIFEST.MF b/org.opentosca.container.control/META-INF/MANIFEST.MF deleted file mode 100644 index 71341a699..000000000 --- a/org.opentosca.container.control/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container Control -Bundle-SymbolicName: org.opentosca.container.control -Bundle-Version: 2.0.0.qualifier -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.opentosca.container.engine.plan, - org.osgi.framework;version="1.8.0", - org.osgi.service.event;version="1.2.0", - org.slf4j;version="1.7.10" -Export-Package: org.opentosca.container.control -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca, - org.opentosca.bus.management.service;bundle-version="1.0.0" -Bundle-Activator: org.opentosca.container.control.Activator -Service-Component: OSGI-INF/* diff --git a/org.opentosca.container.control/OSGI-INF/OpenToscaControlServiceImpl_component.xml b/org.opentosca.container.control/OSGI-INF/OpenToscaControlServiceImpl_component.xml deleted file mode 100644 index 64f5ebb62..000000000 --- a/org.opentosca.container.control/OSGI-INF/OpenToscaControlServiceImpl_component.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/org.opentosca.container.control/OSGI-INF/ServiceBindingTracker_component.xml b/org.opentosca.container.control/OSGI-INF/ServiceBindingTracker_component.xml deleted file mode 100644 index 5ff716594..000000000 --- a/org.opentosca.container.control/OSGI-INF/ServiceBindingTracker_component.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.opentosca.container.control/build.properties b/org.opentosca.container.control/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.container.control/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.container.control/pom.xml b/org.opentosca.container.control/pom.xml index d202f976f..2797d0bbe 100644 --- a/org.opentosca.container.control/pom.xml +++ b/org.opentosca.container.control/pom.xml @@ -1,6 +1,6 @@ + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 @@ -10,6 +10,28 @@ org.opentosca.container.control - eclipse-plugin + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.container.engine.plan + ${project.version} + + + org.opentosca + org.opentosca.container.legacy + ${project.version} + compile + + + + com.github.opentosca.winery + org.eclipse.winery.model.tosca + + diff --git a/org.opentosca.container.control/src/main/java/org/opentosca/container/control/OpenToscaControlService.java b/org.opentosca.container.control/src/main/java/org/opentosca/container/control/OpenToscaControlService.java new file mode 100644 index 000000000..ae22e958d --- /dev/null +++ b/org.opentosca.container.control/src/main/java/org/opentosca/container/control/OpenToscaControlService.java @@ -0,0 +1,71 @@ +package org.opentosca.container.control; + +import java.io.UnsupportedEncodingException; +import java.util.List; +import java.util.Set; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.common.ids.definitions.ServiceTemplateId; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.deployment.process.DeploymentProcessOperation; +import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; +import org.opentosca.container.core.tosca.extension.TPlanDTO; + +/** + * Interface of the control of the OpenTosca Container. + *

    + * The instance of this interface is used by org.opentosca.containerapi which invokes each step in the deployment + * process. For handling the states of processing of each CSAR, this component uses the + * org.opentosca.core.deployment.tracker.service.ICoreDeploymentTrackerService to read and set the current state of a + * certain CSAR and provides a HashSet with the possible process invocations for a certain CSAR. + */ +public interface OpenToscaControlService { + + /** + * This method invokes the processing of the TOSCA content of a certain CSAR. + * + * @param csar the CSAR to process + * @return true for success, false for one or more errors. + */ + boolean invokeToscaProcessing(CsarId csar); + + /** + * Registers the plans for a given ServiceTemplate of a given CSAR + * + * @param csar the CSAR owning the ServiceTemplate to deploy + * @param serviceTemplate the ServiceTemplate to deploy + * @return true for success, false for one or more errors. + */ + boolean generatePlans(CsarId csar, ServiceTemplateId serviceTemplate); + + List deleteCsar(CsarId csar); + + Set executableDeploymentProcessOperations(CsarId csar); + + boolean declareStored(CsarId csar); + + DeploymentProcessState currentDeploymentProcessState(CsarId csar); + + /** + * @deprecated {@link #invokePlanInvocation(CsarId, TServiceTemplate, int, TPlanDTO)} + */ + @Deprecated + String invokePlanInvocation(CsarId csar, QName serviceTemplateID, int instanceId, TPlanDTO plan) throws UnsupportedEncodingException; + + // FIXME evaluate using winery's TPlan instead + String invokePlanInvocation(CsarId csar, TServiceTemplate serviceTemplate, long instanceId, TPlanDTO plan); + + /** + * @deprecated {@link #invokePlanDeployment(CsarId, TServiceTemplate)} + */ + @Deprecated + boolean invokePlanDeployment(CsarId csarId, QName serviceTemplateId); + + boolean invokePlanDeployment(CsarId csar, TServiceTemplate serviceTemplate); + + @Deprecated + List getAllContainedServiceTemplates(CsarId csarid); +} diff --git a/org.opentosca.container.control/src/main/java/org/opentosca/container/control/impl/OpenToscaControlServiceImpl.java b/org.opentosca.container.control/src/main/java/org/opentosca/container/control/impl/OpenToscaControlServiceImpl.java new file mode 100644 index 000000000..4f533c883 --- /dev/null +++ b/org.opentosca.container.control/src/main/java/org/opentosca/container/control/impl/OpenToscaControlServiceImpl.java @@ -0,0 +1,280 @@ +package org.opentosca.container.control.impl; + +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.common.ids.definitions.ServiceTemplateId; +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPlans; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.opentosca.container.control.OpenToscaControlService; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.deployment.process.DeploymentProcessOperation; +import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.DeploymentTracker; +import org.opentosca.container.core.service.IPlanInvocationEngine; +import org.opentosca.container.core.tosca.extension.TPlanDTO; +import org.opentosca.container.engine.plan.IPlanEngineService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import static org.opentosca.container.core.model.deployment.process.DeploymentProcessState.PLANS_DEPLOYED; +import static org.opentosca.container.core.model.deployment.process.DeploymentProcessState.PLAN_DEPLOYMENT_ACTIVE; +import static org.opentosca.container.core.model.deployment.process.DeploymentProcessState.STORED; +import static org.opentosca.container.core.model.deployment.process.DeploymentProcessState.TOSCAPROCESSING_ACTIVE; +import static org.opentosca.container.core.model.deployment.process.DeploymentProcessState.TOSCA_PROCESSED; + +@Service +@NonNullByDefault +public class OpenToscaControlServiceImpl implements OpenToscaControlService { + + private static final Logger LOGGER = LoggerFactory.getLogger(OpenToscaControlServiceImpl.class); + + private final DeploymentTracker deploymentTracker; + private final IPlanEngineService planEngine; + private final IPlanInvocationEngine planInvocationEngine; + private final CsarStorageService storage; + + @Inject + public OpenToscaControlServiceImpl(DeploymentTracker deploymentTracker, + IPlanEngineService planEngine, + IPlanInvocationEngine planInvocationEngine, + CsarStorageService storage) { + this.deploymentTracker = deploymentTracker; + this.planEngine = planEngine; + this.planInvocationEngine = planInvocationEngine; + this.storage = storage; + } + + @Override + public boolean invokeToscaProcessing(CsarId csar) { + LOGGER.debug("Start resolving ServiceTemplates of [{}]", csar.csarName()); + deploymentTracker.storeDeploymentState(csar, TOSCAPROCESSING_ACTIVE); + LOGGER.info("Processing of Definitions completed successfully for [{}]", csar.csarName()); + deploymentTracker.storeDeploymentState(csar, TOSCA_PROCESSED); + return true; + } + + @Override + public boolean generatePlans(CsarId csarId, ServiceTemplateId serviceTemplate) { + Csar csar = storage.findById(csarId); + final TServiceTemplate entryServiceTemplate = csar.entryServiceTemplate(); + if (entryServiceTemplate == null) { + LOGGER.error("No EntryServiceTemplate defined for CSAR [{}]. Aborting plan generation", csarId); + return false; + } + deploymentTracker.storeDeploymentState(csarId, PLAN_DEPLOYMENT_ACTIVE); + TPlans plans = entryServiceTemplate.getPlans(); + if (plans == null) { + LOGGER.info("No Plans to process"); + return true; + } + String namespace = plans.getTargetNamespace(); + if (namespace == null) { + // Plans has no targetNamespace, fallback to ServiceTemplate namespace + namespace = serviceTemplate.getQName().getNamespaceURI(); + } + List undeployed = new ArrayList<>(); + for (final TPlan plan : plans.getPlan()) { + if (!planEngine.deployPlan(plan, namespace, csarId)) { + undeployed.add(plan); + } + } + + if (!undeployed.isEmpty()) { + LOGGER.error("Plan deployment failed"); + deploymentTracker.storeDeploymentState(csarId, TOSCA_PROCESSED); + return false; + } + LOGGER.info("Successfully deployeed management plans of [{}] in CSAR [{}]", serviceTemplate, csarId); + deploymentTracker.storeDeploymentState(csarId, PLANS_DEPLOYED); + // endpointService.printPlanEndpoints(); + return true; + } + + @Override + public String invokePlanInvocation(CsarId csarId, TServiceTemplate serviceTemplate, long instanceId, + TPlanDTO plan) { + LOGGER.info("Invoking Plan [{}]", plan.getName()); + final String correlationId = planInvocationEngine.createCorrelationId(); + planInvocationEngine.invokePlan(csarId, serviceTemplate, instanceId, plan, correlationId); + if (correlationId != null) { + LOGGER.info("Plan Invocation was sucessful."); + } else { + LOGGER.info("Plan Invocation failed."); + } + return correlationId; + } + + @Override + public Set executableDeploymentProcessOperations(CsarId csar) { + final Set operations = new HashSet<>(); + + switch (deploymentTracker.getDeploymentState(csar)) { + case PLANS_DEPLOYED: + case TOSCA_PROCESSED: + operations.add(DeploymentProcessOperation.INVOKE_PLAN_DEPL); + // intentional fallthrough + case STORED: + operations.add(DeploymentProcessOperation.PROCESS_TOSCA); + break; + default: + // during active processing no operations are allowed for the csar + break; + } + return operations; + } + + @Override + public boolean declareStored(CsarId csar) { + LOGGER.trace("Forcibly marking csar {} as STORED", csar.csarName()); + deploymentTracker.storeDeploymentState(csar, STORED); + return true; + } + + @Override + public DeploymentProcessState currentDeploymentProcessState(CsarId csar) { + return deploymentTracker.getDeploymentState(csar); + } + + @Override + public List deleteCsar(CsarId csarId) { + List errors = new ArrayList<>(); + final Csar csar = storage.findById(csarId); + + if (!undeployAllPlans(csar)) { + errors.add("Failed to undeploy all plans for csar " + csarId); + } + deploymentTracker.deleteDeploymentState(csarId); + // FIXME removeEndpoints + try { + storage.deleteCSAR(csarId); + } catch (UserException | SystemException e) { + errors.add(e.getMessage()); + } + return errors; + } + + /** + * Undeploys all plans associated with the given csar + * + * @return true, if undeploying all plans was successful, false otherwise + */ + private boolean undeployAllPlans(Csar csar) { + return csar.serviceTemplates().stream().allMatch(st -> undeployAllPlans(csar.id(), st)); + } + + /** + * Undeploys all plans associated to the given serviceTemplate + * + * @return true, if undeploying all plans was successful, false otherwise + */ + private boolean undeployAllPlans(CsarId csarId, TServiceTemplate serviceTemplate) { + TPlans plans = serviceTemplate.getPlans(); + if (plans == null) { + LOGGER.info("No Plans to undeploy"); + return true; + } + String namespace = plans.getTargetNamespace(); + if (namespace == null) { + // Plans has no targetNamespace, fallback to ServiceTemplate namespace + namespace = serviceTemplate.getTargetNamespace(); + } + List undeployed = new ArrayList<>(); + for (final TPlan plan : plans.getPlan()) { + if (!planEngine.undeployPlan(plan, namespace, csarId)) { + undeployed.add(plan); + } + } + return undeployed.isEmpty(); + } + + @Override + public boolean invokePlanDeployment(CsarId csar, TServiceTemplate serviceTemplate) { + deploymentTracker.storeDeploymentState(csar, PLAN_DEPLOYMENT_ACTIVE); + final List undeployedPlans = new ArrayList<>(); + LOGGER.trace("Invoking PlanEngine to process Plans"); + if (planEngine == null) { + LOGGER.error("PlanEngine is not alive!"); + deploymentTracker.storeDeploymentState(csar, TOSCA_PROCESSED); + return false; + } + + if (serviceTemplate == null) { + LOGGER.warn("Could not find the main ServiceTemplate"); + deploymentTracker.storeDeploymentState(csar, TOSCA_PROCESSED); + return false; + } + + final TPlans plans = serviceTemplate.getPlans(); + if (plans == null || plans.getPlan() == null || plans.getPlan().isEmpty()) { + LOGGER.info("No plans to process"); + return true; + } + + // fallback to serviceTemplate NamespaceURI + final String namespace = plans.getTargetNamespace() == null + ? serviceTemplate.getTargetNamespace() + : plans.getTargetNamespace(); + + for (final TPlan plan : plans.getPlan()) { + if (!planEngine.deployPlan(plan, namespace, csar)) { + undeployedPlans.add(plan); + } + } + + if (!undeployedPlans.isEmpty()) { + LOGGER.warn("Plan deployment failed!"); + deploymentTracker.storeDeploymentState(csar, TOSCA_PROCESSED); + return false; + } + + LOGGER.trace("The deployment of management plans for ServiceTemplate \"{}\" inside CSAR [{}] was successful", serviceTemplate.getId(), csar.csarName()); + deploymentTracker.storeDeploymentState(csar, PLANS_DEPLOYED); + return true; + } + + @Deprecated + @Override + public String invokePlanInvocation(CsarId csarId, QName qname, int instanceId, TPlanDTO plan) throws UnsupportedEncodingException { + Csar csar = storage.findById(csarId); + final Optional serviceTemplate = csar.serviceTemplates().stream() + .filter(st -> st.getId().equals(qname.toString())) + .findFirst(); + return serviceTemplate.isPresent() ? invokePlanInvocation(csarId, serviceTemplate.get(), instanceId, plan) : ""; + } + + @Deprecated + @Override + public boolean invokePlanDeployment(CsarId csarId, QName qname) { + Csar csar = storage.findById(csarId); + final Optional serviceTemplate = csar.serviceTemplates().stream() + .filter(st -> st.getId().equals(qname.toString())) + .findFirst(); + return serviceTemplate.isPresent() ? invokePlanDeployment(csarId, serviceTemplate.get()) : false; + } + + @Deprecated + @Override + public List getAllContainedServiceTemplates(CsarId csarid) { + return storage.findById(csarid).serviceTemplates().stream() + .map(TServiceTemplate::getId) + .map(QName::new).collect(Collectors.toList()); + } +} + diff --git a/org.opentosca.container.control/src/main/resources/spring/context-control.xml b/org.opentosca.container.control/src/main/resources/spring/context-control.xml new file mode 100644 index 000000000..68c96c979 --- /dev/null +++ b/org.opentosca.container.control/src/main/resources/spring/context-control.xml @@ -0,0 +1,16 @@ + + + + Configuration for Spring-Bean service discovery and injection across container.control + + + + + + diff --git a/org.opentosca.container.control/src/org/opentosca/container/control/Activator.java b/org.opentosca.container.control/src/org/opentosca/container/control/Activator.java deleted file mode 100644 index c6dcacc69..000000000 --- a/org.opentosca.container.control/src/org/opentosca/container/control/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.control; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.control/src/org/opentosca/container/control/IOpenToscaControlService.java b/org.opentosca.container.control/src/org/opentosca/container/control/IOpenToscaControlService.java deleted file mode 100644 index 2cfbd763b..000000000 --- a/org.opentosca.container.control/src/org/opentosca/container/control/IOpenToscaControlService.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.opentosca.container.control; - -import java.io.UnsupportedEncodingException; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessOperation; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; -import org.opentosca.container.core.tosca.extension.TPlanDTO; - -/** - * Interface of the control of the OpenTosca Container. - * - * The instance of this interface is used by org.opentosca.container.api which invokes each step in - * the deployment process. For handling the states of processing of each CSAR, this component uses - * the org.opentosca.core.deployment.tracker.service.ICoreDeploymentTrackerService to read and set - * the current state of a certain CSAR and provides a HashSet with the possible process invocations - * for a certain CSAR. - */ -public interface IOpenToscaControlService { - - /** - * This method invokes the processing of the TOSCA content of a certain CSAR. - * - * @param csarID ID which uniquely identifies a CSAR file. - * @return Returns true for success, false for one or more errors. - */ - public Boolean invokeTOSCAProcessing(CSARID csarID); - - /** - * Invoke the deployment of the Plans. - * - * @param csarID ID which uniquely identifies a CSAR file. - * @param serviceTemplateID ID of the ServiceTemplate to deploy. - * @return Returns true for success, false for one or more errors. - */ - public Boolean invokePlanDeployment(CSARID csarID, QName serviceTemplateID); - - /** - * Returns all the stored CSARs inside the OpenTosca Container. - * - * @return List of QNames which each represents a stored CSAR. - */ - public Set getAllStoredCSARs(); - - /** - * This method deletes the stored contents of a certain CSAR inside of the container. - * - * @param csarID the ID of the CSAR which shall be deleted. - * @return List of errors, if list is empty, no error occured - */ - public List deleteCSAR(CSARID csarID); - - /** - * This method returns a list of the QNames contained in a specific CSAR. - * - * @param csarID the ID of the specific CSAR. - * @return A list of the QName of ServiceTemplates if there are some contained in the given CSAR. An - * empty list of none are contained. Null if there is an error. - */ - public List getAllContainedServiceTemplates(CSARID csarID); - - /** - * Returns a Set of executable operations on a currently running deployment process of a CSAR. - * - * @param csarID ID which uniquely identifies a CSAR file. - * @return Set of executable operations. - */ - public Set getExecutableDeploymentProcessOperations(CSARID csarID); - - /** - * Sets the deployment state of a CSAR to STORED. - * - * @param csarID ID which uniquely identifies a CSAR file. - * @return Returns true, if setting was successful, otherwise false. - */ - public Boolean setDeploymentProcessStateStored(CSARID csarID); - - /** - * Returns the current state of a deployment process of a CSAR. - * - * @param csarID ID which uniquely identifies a CSAR file. - * @return Returns true for success, false for one or more errors. - */ - public DeploymentProcessState getDeploymentProcessState(CSARID csarID); - - /** - * Invokes the a process described due the parameter PublicPlan for the given CSAR. - * - * @param csarID the ID of the CSAR - * - * @param serviceTemplateInstanceID the instance id, or -1 if the plan is a build plan - * @param plan which containes the data which with the process is invoked (including the message - * values). - * @return - * @throws UnsupportedEncodingException - */ - public String invokePlanInvocation(CSARID csarID, QName serviceTemplateId, long serviceTemplateInstanceID, - TPlanDTO plan) throws UnsupportedEncodingException; -} diff --git a/org.opentosca.container.control/src/org/opentosca/container/control/ServiceBindingTracker.java b/org.opentosca.container.control/src/org/opentosca/container/control/ServiceBindingTracker.java deleted file mode 100644 index 970edba43..000000000 --- a/org.opentosca.container.control/src/org/opentosca/container/control/ServiceBindingTracker.java +++ /dev/null @@ -1,636 +0,0 @@ -package org.opentosca.container.control; - -import java.lang.reflect.Field; -import java.util.Hashtable; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.opentosca.bus.management.service.IManagementBusService; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.xml.IXMLSerializerService; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.ICoreCapabilityService; -import org.opentosca.container.core.service.ICoreDeploymentTrackerService; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.core.service.ICoreFileService; -import org.opentosca.container.core.service.ICoreModelRepositoryService; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.container.core.service.IHTTPService; -import org.opentosca.container.core.service.IPlanInvocationEngine; -import org.opentosca.container.core.service.internal.ICoreInternalCapabilityService; -import org.opentosca.container.core.service.internal.ICoreInternalDeploymentTrackerService; -import org.opentosca.container.core.service.internal.ICoreInternalEndpointService; -import org.opentosca.container.core.service.internal.ICoreInternalFileService; -import org.opentosca.container.core.service.internal.ICoreInternalModelRepositoryService; -import org.opentosca.container.engine.plan.IPlanEngineService; -import org.osgi.service.event.Event; -import org.osgi.service.event.EventAdmin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class implements a tracker for binding of the core services. If all defined services are - * bound, there is a log output saying that the container is ready for use. - */ -public class ServiceBindingTracker { - - ICoreCapabilityService coreCapabilityService; - ICoreDeploymentTrackerService coreDeploymentTrackerService; - ICoreEndpointService coreEndpointService; - ICoreFileService coreFileService; - ICoreInternalCapabilityService coreInternalCapabilityService; - ICoreInternalDeploymentTrackerService coreInternalDeploymentTrackerService; - ICoreInternalEndpointService coreInternalEndpointService; - ICoreInternalFileService coreInternalFileService; - ICoreInternalModelRepositoryService coreInternalModelRepositoryService; - ICoreModelRepositoryService coreModelRepositoryService; - IFileAccessService fileAccessService; - IHTTPService httpService; - IOpenToscaControlService openToscaControlService; - IPlanEngineService planEngineService; - IToscaEngineService toscaEngineService; - IXMLSerializerService xmlSerializerService; - IPlanInvocationEngine planInvocationEngine; - IManagementBusService managementBusService; - EventAdmin eventAdmin; - - private final Logger LOG = LoggerFactory.getLogger(ServiceBindingTracker.class); - - - /** - * Checks if all services defined by this class are bound. If all are bound there is a log - * output saying that the container is ready for use. - */ - private void checkAvailability() { - - // is true as long as each service is bound - boolean boolAllServicesBound = true; - - // Get all declared fields of this class. This contains all services. - for (final Field field : this.getClass().getDeclaredFields()) { - try { - - // Check if the fields are null or not. As soon as one field is - // null the check field never gets true again. - boolAllServicesBound = boolAllServicesBound && field.get(this) != null; - - } - catch (final IllegalArgumentException e) { - this.LOG.error(e.getLocalizedMessage()); - } - catch (final IllegalAccessException e) { - this.LOG.error(e.getLocalizedMessage()); - } - } - - // put status log - if (boolAllServicesBound) { - logContainerIsAvailable(); - } - } - - /** - * Method for a log output saying that the container is ready for use. - */ - private void logContainerIsAvailable() { - - this.LOG.info("Start of the OpenTOSCA Container, now invoke the resolving and consolidation of TOSCA data inside of stored CSARs."); - for (final CSARID csarID : this.coreFileService.getCSARIDs()) { - this.openToscaControlService.invokeTOSCAProcessing(csarID); - - for (final QName serviceTemplateID : this.toscaEngineService.getToscaReferenceMapper() - .getServiceTemplateIDsContainedInCSAR(csarID)) { - this.openToscaControlService.invokePlanDeployment(csarID, serviceTemplateID); - } - } - - this.toscaEngineService.getToscaReferenceMapper().printStoredData(); - - this.LOG.info("#################################################################################################"); - this.LOG.info("#################################################################################################"); - this.LOG.info("########################### The OpenTOSCA Container is ready for use! ###########################"); - this.LOG.info("#################################################################################################"); - this.LOG.info("#################################################################################################"); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreCapabilityService(final ICoreCapabilityService service) { - if (service == null) { - this.LOG.error("Service ICoreCapabilityService is null."); - } else { - this.LOG.debug("Bind of the ICoreCapabilityService."); - this.coreCapabilityService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreCapabilityService(final ICoreCapabilityService service) { - this.LOG.debug("Unbind of the ICoreCapabilityService."); - this.coreCapabilityService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreDeploymentTrackerService(final ICoreDeploymentTrackerService service) { - if (service == null) { - this.LOG.error("Service ICoreDeploymentTrackerService is null."); - } else { - this.LOG.debug("Bind of the ICoreDeploymentTrackerService."); - this.coreDeploymentTrackerService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreDeploymentTrackerService(final ICoreDeploymentTrackerService service) { - this.LOG.debug("Unbind of the ICoreDeploymentTrackerService."); - this.coreDeploymentTrackerService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreEndpointService(final ICoreEndpointService service) { - if (service == null) { - this.LOG.error("Service ICoreEndpointService is null."); - } else { - this.LOG.debug("Bind of the ICoreEndpointService."); - this.coreEndpointService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreEndpointService(final ICoreEndpointService service) { - this.LOG.debug("Unbind of the ICoreEndpointService."); - this.coreEndpointService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreFileService(final ICoreFileService service) { - if (service == null) { - this.LOG.error("Service ICoreFileService is null."); - } else { - this.LOG.debug("Bind of the ICoreFileService."); - this.coreFileService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreFileService(final ICoreFileService service) { - this.LOG.debug("Unbind of the ICoreFileService."); - this.coreFileService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreInternalCapabilityService(final ICoreInternalCapabilityService service) { - if (service == null) { - this.LOG.error("Service ICoreInternalCapabilityService is null."); - } else { - this.LOG.debug("Bind of the ICoreInternalCapabilityService."); - this.coreInternalCapabilityService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreInternalCapabilityService(final ICoreInternalCapabilityService service) { - this.LOG.debug("Unbind of the ICoreInternalCapabilityService."); - this.coreInternalCapabilityService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreInternalDeploymentTrackerService(final ICoreInternalDeploymentTrackerService service) { - if (service == null) { - this.LOG.error("Service ICoreInternalDeploymentTrackerService is null."); - } else { - this.LOG.debug("Bind of the ICoreInternalDeploymentTrackerService."); - this.coreInternalDeploymentTrackerService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreInternalDeploymentTrackerService(final ICoreInternalDeploymentTrackerService service) { - this.LOG.debug("Unbind of the ICoreInternalDeploymentTrackerService."); - this.coreInternalDeploymentTrackerService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreInternalEndpointService(final ICoreInternalEndpointService service) { - if (service == null) { - this.LOG.error("Service ICoreInternalEndpointService is null."); - } else { - this.LOG.debug("Bind of the ICoreInternalEndpointService."); - this.coreInternalEndpointService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreInternalEndpointService(final ICoreInternalEndpointService service) { - this.LOG.debug("Unbind of the ICoreInternalEndpointService."); - this.coreInternalEndpointService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreInternalFileService(final ICoreInternalFileService service) { - if (service == null) { - this.LOG.error("Service ICoreInternalFileService is null."); - } else { - this.LOG.debug("Bind of the ICoreInternalFileService."); - this.coreInternalFileService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreInternalFileService(final ICoreInternalFileService service) { - this.LOG.debug("Unbind of the ICoreInternalFileService."); - this.coreInternalFileService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreInternalModelRepositoryService(final ICoreInternalModelRepositoryService service) { - if (service == null) { - this.LOG.error("Service ICoreInternalModelRepositoryService is null."); - } else { - this.LOG.debug("Bind of the ICoreInternalModelRepositoryService."); - this.coreInternalModelRepositoryService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreInternalModelRepositoryService(final ICoreInternalModelRepositoryService service) { - this.LOG.debug("Unbind of the ICoreInternalModelRepositoryService."); - this.coreInternalModelRepositoryService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindICoreModelRepositoryService(final ICoreModelRepositoryService service) { - if (service == null) { - this.LOG.error("Service ICoreModelRepositoryService is null."); - } else { - this.LOG.debug("Bind of the ICoreModelRepositoryService."); - this.coreModelRepositoryService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindICoreModelRepositoryService(final ICoreModelRepositoryService service) { - this.LOG.debug("Unbind of the ICoreModelRepositoryService."); - this.coreModelRepositoryService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindIFileAccessService(final IFileAccessService service) { - if (service == null) { - this.LOG.error("Service IFileAccessService is null."); - } else { - this.LOG.debug("Bind of the IFileAccessService."); - this.fileAccessService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindIFileAccessService(final IFileAccessService service) { - this.LOG.debug("Unbind of the IFileAccessService."); - this.fileAccessService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindIHTTPService(final IHTTPService service) { - if (service == null) { - this.LOG.error("Service IHTTPService is null."); - } else { - this.LOG.debug("Bind of the IHTTPService."); - this.httpService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindIHTTPService(final IHTTPService service) { - this.LOG.debug("Unbind of the IHTTPService."); - this.httpService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindIOpenToscaControlService(final IOpenToscaControlService service) { - if (service == null) { - this.LOG.error("Service IOpenToscaControlService is null."); - } else { - this.LOG.debug("Bind of the IOpenToscaControlService."); - this.openToscaControlService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindIOpenToscaControlService(final IOpenToscaControlService service) { - this.LOG.debug("Unbind of the IOpenToscaControlService."); - this.openToscaControlService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindIPlanEngineService(final IPlanEngineService service) { - if (service == null) { - this.LOG.error("Service IPlanEngineService is null."); - } else { - this.LOG.debug("Bind of the IPlanEngineService."); - this.planEngineService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindIPlanEngineService(final IPlanEngineService service) { - this.LOG.debug("Unbind of the IPlanEngineService."); - this.planEngineService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindIToscaEngineService(final IToscaEngineService service) { - if (service == null) { - this.LOG.error("Service IToscaEngineService is null."); - } else { - this.LOG.debug("Bind of the IToscaEngineService."); - this.toscaEngineService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindIToscaEngineService(final IToscaEngineService service) { - this.LOG.debug("Unbind of the IToscaEngineService."); - this.toscaEngineService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindIXMLSerializerService(final IXMLSerializerService service) { - if (service == null) { - this.LOG.error("Service IXMLSerializerService is null."); - } else { - this.LOG.debug("Bind of the IXMLSerializerService."); - this.xmlSerializerService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindIXMLSerializerService(final IXMLSerializerService service) { - this.LOG.debug("Unbind of the IXMLSerializerService."); - this.xmlSerializerService = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindIPlanInvocationEngine(final IPlanInvocationEngine service) { - if (service == null) { - this.LOG.error("Service planInvocationEngine is null."); - } else { - this.LOG.debug("Bind of the planInvocationEngine."); - this.planInvocationEngine = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindIPlanInvocationEngine(final IPlanInvocationEngine service) { - this.LOG.debug("Unbind of the planInvocationEngine."); - this.planInvocationEngine = null; - log_offline(service.getClass().getSimpleName()); - } - - /** - * Bind method for a service. - * - * @param service The service to bind. - */ - protected void bindIManagementBusService(final IManagementBusService service) { - if (service == null) { - this.LOG.error("Service IManagementBusService is null."); - } else { - this.LOG.debug("Bind of the IManagementBusService."); - this.managementBusService = service; - log_online(service.getClass().getSimpleName()); - checkAvailability(); - } - } - - /** - * Unbind method for a service. - * - * @param service The service to unbind. - */ - protected void unbindIManagementBusService(final IManagementBusService service) { - this.LOG.debug("Unbind of the IManagementBusService."); - this.managementBusService = null; - log_offline(service.getClass().getSimpleName()); - } - - protected void bindEventAdmin(final EventAdmin service) { - if (service == null) { - this.LOG.error("Service EventAdmin is null."); - } else { - this.LOG.debug("Bind of the EventAdmin."); - this.eventAdmin = service; - - final Map eventValues = new Hashtable<>(); - eventValues.put("callbackaddressrequest", "request"); - final Event event = new Event("org_opentosca_plans/callbackaddressrequest", eventValues); - - this.LOG.debug("Send callback address request."); - this.eventAdmin.postEvent(event); - log_online(service.getClass().getSimpleName()); - - checkAvailability(); - } - } - - protected void unbindEventAdmin(final EventAdmin service) { - this.LOG.debug("Unbind of the EventAdmin."); - this.eventAdmin = null; - log_offline(service.getClass().getSimpleName()); - } - - private void log_online(final String servicename) { - // this.LOG.info("+++ Service is online: {}", servicename); - } - - private void log_offline(final String servicename) { - this.LOG.warn("--- Service is offline: {}", servicename); - } - -} diff --git a/org.opentosca.container.control/src/org/opentosca/container/control/impl/OpenToscaControlServiceImpl.java b/org.opentosca.container.control/src/org/opentosca/container/control/impl/OpenToscaControlServiceImpl.java deleted file mode 100644 index 3f3b6c28e..000000000 --- a/org.opentosca.container.control/src/org/opentosca/container/control/impl/OpenToscaControlServiceImpl.java +++ /dev/null @@ -1,485 +0,0 @@ -package org.opentosca.container.control.impl; - -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.container.control.IOpenToscaControlService; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.xml.IXMLSerializerService; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessOperation; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; -import org.opentosca.container.core.service.ICoreDeploymentTrackerService; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.core.service.ICoreFileService; -import org.opentosca.container.core.service.ICoreModelRepositoryService; -import org.opentosca.container.core.service.IPlanInvocationEngine; -import org.opentosca.container.core.tosca.extension.TPlanDTO; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPlans; -import org.opentosca.container.core.tosca.model.TServiceTemplate; -import org.opentosca.container.engine.plan.IPlanEngineService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The instance of this interface is used by org.opentosca.container.api which invokes each step in - * the deployment process. For handling the states of processing of each CSAR, this component uses - * the org.opentosca.core.deployment.tracker.service.ICoreDeploymentTrackerService to read and set - * the current state of a certain CSAR and provides a HashSet with the possible process invocations - * for a certain CSAR. - */ -public class OpenToscaControlServiceImpl implements IOpenToscaControlService { - - protected static IPlanEngineService planEngine = null; - protected static ICoreFileService fileService = null; - protected static IToscaEngineService toscaEngine = null; - protected static IXMLSerializerService xmlSerializerService = null; - protected static ICoreDeploymentTrackerService coreDeploymentTracker = null; - protected static ICoreModelRepositoryService modelRepositoryService = null; - protected static ICoreFileService coreFileService = null; - protected static ICoreEndpointService endpointService = null; - protected static IPlanInvocationEngine planInvocationEngine = null; - - private final Logger LOG = LoggerFactory.getLogger(OpenToscaControlServiceImpl.class); - - /** - * {@inheritDoc} - */ - @Override - public Boolean invokeTOSCAProcessing(final CSARID csarID) { - - this.LOG.debug("Start the resolving of the ServiceTemplates of the CSAR \"" + csarID + "\"."); - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.TOSCAPROCESSING_ACTIVE); - - // start the resolving and store the state according to success - if (OpenToscaControlServiceImpl.toscaEngine.resolveDefinitions(csarID)) { - this.LOG.info("Processing of the Definitions completed."); - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.TOSCA_PROCESSED); - } else { - this.LOG.error("Processing of the Definitions failed!"); - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.STORED); - return false; - } - - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean invokePlanDeployment(final CSARID csarID, final QName serviceTemplateID) { - - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.PLAN_DEPLOYMENT_ACTIVE); - - // list of failure - not deployed artifacts - final List listOfUndeployedPlans = new ArrayList<>(); - - // invoke PlanEngine - this.LOG.info("Invoke the PlanEngine for processing the Plans."); - if (OpenToscaControlServiceImpl.planEngine != null) { - - final TServiceTemplate mainServiceTemplate = - (TServiceTemplate) OpenToscaControlServiceImpl.toscaEngine.getToscaReferenceMapper() - .getJAXBReference(csarID, serviceTemplateID); - - if (mainServiceTemplate == null) { - this.LOG.error("Did not found the main ServiceTemplate \"" + serviceTemplateID + "\"."); - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.TOSCA_PROCESSED); - return false; - } - - if (mainServiceTemplate.getPlans() == null) { - this.LOG.info("No plans to process ..."); - return true; - } - - this.LOG.debug("PlanEngine is alive!"); - - final TPlans plans = mainServiceTemplate.getPlans(); - - String namespace = plans.getTargetNamespace(); - - if (namespace == null) { - // the Plans element has no targetNamespace defined fallback to - // ServiceTemplate namespace - namespace = serviceTemplateID.getNamespaceURI(); - } - - for (final TPlan plan : plans.getPlan()) { - - if (!OpenToscaControlServiceImpl.planEngine.deployPlan(plan, namespace, csarID)) { - listOfUndeployedPlans.add(plan); - } - } - - // check the success of the plan deployment - if (listOfUndeployedPlans.size() != 0) { - this.LOG.error("Plan deployment failed!"); - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.TOSCA_PROCESSED); - return false; - } - - } else { - this.LOG.error("PlanEngine is not alive!"); - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.TOSCA_PROCESSED); - return false; - } - - this.LOG.info("The deployment of the management plans of the Service Template " + serviceTemplateID.toString() - + "\" inside of the CSAR \"" + csarID + "\" was successfull."); - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.PLANS_DEPLOYED); - - OpenToscaControlServiceImpl.endpointService.printPlanEndpoints(); - - return true; - } - - /** - * {@inheritDoc} - * - * @throws UnsupportedEncodingException - */ - @Override - public String invokePlanInvocation(final CSARID csarID, final QName serviceTemplateId, final long csarInstanceID, - final TPlanDTO plan) throws UnsupportedEncodingException { - - this.LOG.info("Invoke Plan Invocation!"); - - final String correlationID = OpenToscaControlServiceImpl.planInvocationEngine.createCorrelationId(); - - if (null != correlationID) { - this.LOG.info("The Plan Invocation was successfull!!!"); - OpenToscaControlServiceImpl.planInvocationEngine.invokePlan(csarID, serviceTemplateId, csarInstanceID, plan, - correlationID); - } else { - this.LOG.error("The Plan Invocation was not successfull!!!"); - return null; - } - - return correlationID; - } - - /** - * {@inheritDoc} - */ - @Override - public Set getAllStoredCSARs() { - - return OpenToscaControlServiceImpl.fileService.getCSARIDs(); - } - - /** - * {@inheritDoc} - */ - @Override - public List deleteCSAR(final CSARID csarID) { - - final List errors = new ArrayList<>(); - - // TODO following code should be active again - // if - // (!OpenToscaControlServiceImpl.instanceManagement.getInstancesOfCSAR(csarID).isEmpty()) - // { - // // There are instances, thus deletion is not legal. - // LOG.error("CSAR \"{}\" has instances.", csarID); - // errors.add("CSAR has instances."); - // return errors; - // } - - if (!undeployPlans(csarID)) { - this.LOG.warn("It was not possible to undeploy all plans of the CSAR \"" + csarID + "."); - errors.add("Could not undeploy all plans."); - } - - // Delete operation is legal, thus continue. - if (!OpenToscaControlServiceImpl.toscaEngine.clearCSARContent(csarID)) { - this.LOG.error("It was not possible to delete all content of the CSAR \"" + csarID - + "\" inside the ToscaEngine."); - errors.add("Could not delete TOSCA data."); - } - - OpenToscaControlServiceImpl.coreDeploymentTracker.deleteDeploymentState(csarID); - - // Delete all plan endpoints related to this CSAR. IA endpoints are undeployed and deleted - // by the Management Bus. - OpenToscaControlServiceImpl.endpointService.removePlanEndpoints(Settings.OPENTOSCA_CONTAINER_HOSTNAME, csarID); - - try { - OpenToscaControlServiceImpl.fileService.deleteCSAR(csarID); - } - catch (SystemException | UserException e) { - this.LOG.error("The file service could not delete all data of the CSAR \"{}\". ", csarID, e); - errors.add("Could not delete CSAR files."); - } - - if (errors.isEmpty()) { - this.LOG.info("Contents of CSAR \"" + csarID + "\" deleted."); - } else { - String errorList = ""; - for (final String err : errors) { - errorList = errorList + err + "\\n"; - } - this.LOG.error("Errors while deleting: " + errorList); - } - - return errors; - } - - private boolean undeployPlans(final CSARID csarID) { - final List listOfUndeployedPlans = new ArrayList<>(); - // invoke PlanEngine - if (OpenToscaControlServiceImpl.toscaEngine.getServiceTemplatesInCSAR(csarID) == null) { - // nothing to delete - return true; - } - - switch (getDeploymentProcessState(csarID)) { - case STORED: - case TOSCA_PROCESSED: - case TOSCAPROCESSING_ACTIVE: - return true; - default: - break; - } - - for (final QName serviceTemplateID : OpenToscaControlServiceImpl.toscaEngine.getServiceTemplatesInCSAR(csarID)) { - - this.LOG.info("Invoke the PlanEngine for processing the Plans."); - if (OpenToscaControlServiceImpl.planEngine != null) { - - final TServiceTemplate mainServiceTemplate = - (TServiceTemplate) OpenToscaControlServiceImpl.toscaEngine.getToscaReferenceMapper() - .getJAXBReference(csarID, - serviceTemplateID); - - if (mainServiceTemplate == null) { - this.LOG.error("Did not found the main ServiceTemplate \"" + serviceTemplateID + "\"."); - OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.TOSCA_PROCESSED); - return false; - } - - if (mainServiceTemplate.getPlans() == null) { - this.LOG.info("No plans to process ..."); - return true; - } - - this.LOG.debug("PlanEngine is alive!"); - - final TPlans plans = mainServiceTemplate.getPlans(); - - String namespace = plans.getTargetNamespace(); - - if (namespace == null) { - // the Plans element has no targetNamespace defined fallback - // to ServiceTemplate namespace - namespace = serviceTemplateID.getNamespaceURI(); - } - - for (final TPlan plan : plans.getPlan()) { - if (!OpenToscaControlServiceImpl.planEngine.undeployPlan(plan, namespace, csarID)) { - listOfUndeployedPlans.add(plan); - } - } - - } - } - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public List getAllContainedServiceTemplates(final CSARID csarID) { - return OpenToscaControlServiceImpl.toscaEngine.getToscaReferenceMapper() - .getServiceTemplateIDsContainedInCSAR(csarID); - } - - /** - * {@inheritDoc} - */ - @Override - public Set getExecutableDeploymentProcessOperations(final CSARID csarID) { - - final Set operationList = new HashSet<>(); - - // add all possible operations for a passed CSAR - switch (OpenToscaControlServiceImpl.coreDeploymentTracker.getDeploymentState(csarID)) { - case STORED: - - operationList.add(DeploymentProcessOperation.PROCESS_TOSCA); - - break; - - case TOSCA_PROCESSED: - - operationList.add(DeploymentProcessOperation.PROCESS_TOSCA); - operationList.add(DeploymentProcessOperation.INVOKE_PLAN_DEPL); - break; - - case PLANS_DEPLOYED: - - operationList.add(DeploymentProcessOperation.PROCESS_TOSCA); - operationList.add(DeploymentProcessOperation.INVOKE_PLAN_DEPL); - break; - - default: - - // during active processing (states ending with active) there are no - // operations allowed for a certain CSAR - break; - } - - // return possible operations - return operationList; - } - - /** - * {@inheritDoc} - */ - @Override - public Boolean setDeploymentProcessStateStored(final CSARID csarID) { - this.LOG.trace("Setting CSAR {} to state \"{}\"", csarID, DeploymentProcessState.STORED.name()); - return OpenToscaControlServiceImpl.coreDeploymentTracker.storeDeploymentState(csarID, - DeploymentProcessState.STORED); - } - - /** - * {@inheritDoc} - */ - @Override - public DeploymentProcessState getDeploymentProcessState(final CSARID csarID) { - return OpenToscaControlServiceImpl.coreDeploymentTracker.getDeploymentState(csarID); - } - - protected void bindPlanEngine(final IPlanEngineService service) { - if (service == null) { - this.LOG.error("Service PlanEngine is null."); - } else { - this.LOG.debug("Bind of the PlanEngine."); - OpenToscaControlServiceImpl.planEngine = service; - } - } - - protected void unbindPlanEngine(final IPlanEngineService service) { - this.LOG.debug("Unbind of the PlanEngine."); - OpenToscaControlServiceImpl.planEngine = null; - } - - protected void bindFileService(final ICoreFileService service) { - if (service == null) { - this.LOG.error("Service FileService is null."); - } else { - this.LOG.debug("Bind of the FileService."); - OpenToscaControlServiceImpl.fileService = service; - } - } - - protected void unbindFileService(final ICoreFileService service) { - this.LOG.debug("Unbind of the FileService."); - OpenToscaControlServiceImpl.fileService = null; - } - - protected void bindToscaEngine(final IToscaEngineService service) { - if (service == null) { - this.LOG.error("Service ToscaEngine is null."); - } else { - this.LOG.debug("Bind of the ToscaEngine."); - OpenToscaControlServiceImpl.toscaEngine = service; - } - } - - protected void unbindToscaEngine(final IToscaEngineService service) { - this.LOG.debug("Unbind of the ToscaEngine."); - OpenToscaControlServiceImpl.toscaEngine = null; - } - - protected void bindDeploymentTrackerService(final ICoreDeploymentTrackerService service) { - if (service == null) { - this.LOG.error("Service CoreDeploymentTracker is null."); - } else { - this.LOG.debug("Bind of the Core Deployment Tracker."); - OpenToscaControlServiceImpl.coreDeploymentTracker = service; - } - } - - protected void unbindDeploymentTrackerService(final ICoreDeploymentTrackerService service) { - this.LOG.debug("Unbind of the Core Deployment Tracker."); - OpenToscaControlServiceImpl.coreDeploymentTracker = null; - } - - protected void bindModelRepo(final ICoreModelRepositoryService service) { - if (service == null) { - this.LOG.error("Service ModelRepository is null."); - } else { - this.LOG.debug("Bind of the ModelRepository."); - OpenToscaControlServiceImpl.modelRepositoryService = service; - } - } - - protected void unbindModelRepo(final ICoreModelRepositoryService service) { - this.LOG.debug("Unbind of the ModelRepository."); - OpenToscaControlServiceImpl.modelRepositoryService = null; - } - - protected void bindIXMLSerializerService(final IXMLSerializerService service) { - if (service == null) { - this.LOG.error("Service IXMLSerializerService is null."); - } else { - this.LOG.debug("Bind of the IXMLSerializerService."); - OpenToscaControlServiceImpl.xmlSerializerService = service; - } - } - - protected void unbindIXMLSerializerService(final IXMLSerializerService service) { - this.LOG.debug("Unbind of the IXMLSerializerService."); - OpenToscaControlServiceImpl.xmlSerializerService = null; - } - - protected void bindEndpointService(final ICoreEndpointService service) { - if (service == null) { - this.LOG.error("Service ICoreEndpointService is null."); - } else { - this.LOG.debug("Bind of the ICoreEndpointService."); - OpenToscaControlServiceImpl.endpointService = service; - } - } - - protected void unbindEndpointService(final ICoreEndpointService service) { - this.LOG.debug("Unbind of the ICoreEndpointService."); - OpenToscaControlServiceImpl.endpointService = null; - } - - protected void bindPlanInvocationEngine(final IPlanInvocationEngine service) { - if (service == null) { - this.LOG.error("Service planInvocationEngine is null."); - } else { - this.LOG.debug("Bind of the planInvocationEngine."); - OpenToscaControlServiceImpl.planInvocationEngine = service; - } - } - - protected void unbindPlanInvocationEngine(final IPlanInvocationEngine service) { - this.LOG.debug("Unbind of the planInvocationEngine."); - OpenToscaControlServiceImpl.planInvocationEngine = null; - } -} diff --git a/org.opentosca.container.core.impl/META-INF/MANIFEST.MF b/org.opentosca.container.core.impl/META-INF/MANIFEST.MF deleted file mode 100644 index 76bb50aef..000000000 --- a/org.opentosca.container.core.impl/META-INF/MANIFEST.MF +++ /dev/null @@ -1,47 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container Core Default Implementation -Bundle-SymbolicName: org.opentosca.container.core.impl -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Import-Package: com.google.common.collect;version="15.0.0", - com.google.gson;version="2.2.4", - com.google.inject;version="1.3.0", - com.sun.jersey.api.client;version="1.17.1", - com.sun.jersey.api.client.filter;version="1.17.1", - javax.persistence;version="2.1.1", - javax.persistence.criteria;version="2.1.1", - javax.persistence.spi;version="2.1.1", - org.apache.http;version="4.3.3", - org.apache.http.auth;version="4.5.2", - org.apache.http.client;version="4.3.6", - org.apache.http.client.methods;version="4.5.2", - org.apache.http.cookie;version="4.5.2", - org.apache.http.impl.client;version="4.5.2", - org.apache.http.message;version="4.4.6", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.eclipse.osgi.framework.console;version="1.1.0", - org.eclipse.persistence.config;version="2.6.3", - org.eclipse.persistence.sessions;version="2.6.3", - org.glassfish.jersey.uri;version="2.22.2", - org.h2;version="1.3.168", - org.jclouds.filesystem.reference;version="1.7.3", - org.jclouds.osgi;version="1.7.3", - org.opentosca.planbuilder.csarhandler, - org.osgi.framework;version="1.8.0", - org.osgi.service.event;version="1.2.0", - org.slf4j;version="1.7.2" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0" -Bundle-Activator: org.opentosca.container.core.impl.Activator -Service-Component: OSGI-INF/* -Export-Package: org.opentosca.container.core.impl, - org.opentosca.container.core.impl.persistence, - org.opentosca.container.core.impl.plan, - org.opentosca.container.core.impl.service, - org.opentosca.container.core.impl.service.internal, - org.opentosca.container.core.impl.service.internal.credentials, - org.opentosca.container.core.impl.service.internal.file, - org.opentosca.container.core.impl.service.internal.file.csar, - org.opentosca.container.core.impl.service.internal.file.visitors diff --git a/org.opentosca.container.core.impl/OSGI-INF/CSARFile_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CSARFile_component.xml deleted file mode 100644 index 5f1a973e5..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CSARFile_component.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CSARUnpacker_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CSARUnpacker_component.xml deleted file mode 100644 index 2a78ef1da..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CSARUnpacker_component.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreCapabilityServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreCapabilityServiceImpl_component.xml deleted file mode 100644 index d6779f5de..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreCapabilityServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreCredentialsServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreCredentialsServiceImpl_component.xml deleted file mode 100644 index b7084eb6c..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreCredentialsServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreDeploymentTrackerServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreDeploymentTrackerServiceImpl_component.xml deleted file mode 100644 index 81b9edb9f..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreDeploymentTrackerServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreEndpointServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreEndpointServiceImpl_component.xml deleted file mode 100644 index a555335cf..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreEndpointServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreFileServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreFileServiceImpl_component.xml deleted file mode 100644 index f95bea40e..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreFileServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalCapabilityServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreInternalCapabilityServiceImpl_component.xml deleted file mode 100644 index 0199edd39..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalCapabilityServiceImpl_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalCredentialsServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreInternalCredentialsServiceImpl_component.xml deleted file mode 100644 index 57bf8eb12..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalCredentialsServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalDeploymentTrackerServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreInternalDeploymentTrackerServiceImpl_component.xml deleted file mode 100644 index 92371741c..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalDeploymentTrackerServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalEndpointServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreInternalEndpointServiceImpl_component.xml deleted file mode 100644 index 4f7d3a5f8..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalEndpointServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalFileServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreInternalFileServiceImpl_component.xml deleted file mode 100644 index 1d377ba60..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalFileServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalFileStorageProviderFileSystemServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreInternalFileStorageProviderFileSystemServiceImpl_component.xml deleted file mode 100644 index d821fc127..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalFileStorageProviderFileSystemServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalModelRepositoryServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreInternalModelRepositoryServiceImpl_component.xml deleted file mode 100644 index 642c7f1b3..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreInternalModelRepositoryServiceImpl_component.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CoreModelRepositoryServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CoreModelRepositoryServiceImpl_component.xml deleted file mode 100644 index 164a0dadb..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CoreModelRepositoryServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/CredentialsCommands_component.xml b/org.opentosca.container.core.impl/OSGI-INF/CredentialsCommands_component.xml deleted file mode 100644 index b04a8c15b..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/CredentialsCommands_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/FileAccessServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/FileAccessServiceImpl_component.xml deleted file mode 100644 index 2bf44bc41..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/FileAccessServiceImpl_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/FileServiceCommands_component.xml b/org.opentosca.container.core.impl/OSGI-INF/FileServiceCommands_component.xml deleted file mode 100644 index 277dfd2f8..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/FileServiceCommands_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/HttpServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/HttpServiceImpl_component.xml deleted file mode 100644 index 28354eea9..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/HttpServiceImpl_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/InstanceDataServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/InstanceDataServiceImpl_component.xml deleted file mode 100644 index 624cf705a..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/InstanceDataServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/PlanInvocationEngine_component.xml b/org.opentosca.container.core.impl/OSGI-INF/PlanInvocationEngine_component.xml deleted file mode 100644 index cdd01cd67..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/PlanInvocationEngine_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/ServiceHandler_component.xml b/org.opentosca.container.core.impl/OSGI-INF/ServiceHandler_component.xml deleted file mode 100644 index c123bf226..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/ServiceHandler_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/ServiceProxy_component.xml b/org.opentosca.container.core.impl/OSGI-INF/ServiceProxy_component.xml deleted file mode 100644 index 9c45fe841..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/ServiceProxy_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/StorageProviderManager_component.xml b/org.opentosca.container.core.impl/OSGI-INF/StorageProviderManager_component.xml deleted file mode 100644 index b6d64a569..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/StorageProviderManager_component.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/ToscaEngineServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/ToscaEngineServiceImpl_component.xml deleted file mode 100644 index 19d4cf12e..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/ToscaEngineServiceImpl_component.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/ToscaReferenceMapper_component.xml b/org.opentosca.container.core.impl/OSGI-INF/ToscaReferenceMapper_component.xml deleted file mode 100644 index e2b5b6515..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/ToscaReferenceMapper_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/OSGI-INF/XMLSerializerServiceImpl_component.xml b/org.opentosca.container.core.impl/OSGI-INF/XMLSerializerServiceImpl_component.xml deleted file mode 100644 index 18484f4c9..000000000 --- a/org.opentosca.container.core.impl/OSGI-INF/XMLSerializerServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.core.impl/build.properties b/org.opentosca.container.core.impl/build.properties deleted file mode 100644 index 0be345119..000000000 --- a/org.opentosca.container.core.impl/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = .,\ - META-INF/,\ - OSGI-INF/ diff --git a/org.opentosca.container.core.impl/pom.xml b/org.opentosca.container.core.impl/pom.xml deleted file mode 100644 index d809b42c3..000000000 --- a/org.opentosca.container.core.impl/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.container.core.impl - eclipse-plugin - - diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/Activator.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/Activator.java deleted file mode 100644 index 9e9972a81..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.core.impl; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/NodeInstanceDAO.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/NodeInstanceDAO.java deleted file mode 100644 index a99b5df65..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/NodeInstanceDAO.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.opentosca.container.core.impl.persistence; - -import java.net.URI; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.common.jpa.DocumentConverter; -import org.opentosca.container.core.model.instance.NodeInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstanceProperty; -import org.opentosca.container.core.next.model.NodeTemplateInstanceState; -import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; -import org.opentosca.container.core.next.utils.Enums; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; - -/** - * Data Access Object for NodeInstances - */ -public class NodeInstanceDAO { - - private static Logger logger = LoggerFactory.getLogger(NodeInstanceDAO.class); - - NodeTemplateInstanceRepository repository = new NodeTemplateInstanceRepository(); - - - public void deleteNodeInstance(final NodeInstance si) { - try { - logger.info("NodeInstance: {}", si.toString()); - final Optional o = this.repository.find(DaoUtil.toLong(si.getId())); - if (o.isPresent()) { - final NodeTemplateInstance nti = o.get(); - nti.setState(NodeTemplateInstanceState.DELETED); - this.repository.update(nti); - this.repository.remove(nti); - logger.debug("Deleted NodeInstance with ID: " + si.getId()); - } else { - logger.info("NOT FOUND"); - } - } - catch (final Exception e) { - logger.error("Could not delete node instance: {}", e.getMessage(), e); - e.printStackTrace(); - } - } - - public NodeInstance saveNodeInstance(final NodeInstance nodeInstance) { - try { - logger.info("NodeInstance: {}", nodeInstance.toString()); - final NodeTemplateInstance nti = Converters.convert(nodeInstance); - try { - this.repository.add(nti); - } - catch (final Exception ex) { - logger.info("Object already added, trying to update"); - this.repository.update(nti); - } - return Converters.convert(nti); - } - catch (final Exception e) { - logger.error("Could not save node instance: {}", e.getMessage(), e); - e.printStackTrace(); - } - return nodeInstance; - } - - /** - * this method wraps the setting/saving of the properties - * - * @param nodeInstance - * @param properties - */ - public void setProperties(final NodeInstance nodeInstance, final Document properties) { - try { - logger.info("NodeInstance: {}", nodeInstance.toString()); - final DocumentConverter converter = new DocumentConverter(); - final Optional o = this.repository.find(DaoUtil.toLong(nodeInstance.getId())); - if (o.isPresent()) { - final NodeTemplateInstance nti = o.get(); - if (properties != null) { - final String value = (String) converter.convertObjectValueToDataValue(properties, null); - logger.info("XML: {}", value); - final NodeTemplateInstanceProperty prop = new NodeTemplateInstanceProperty(); - prop.setName("xml"); - prop.setType("xml"); - prop.setValue(value); - nti.addProperty(prop); - } - this.repository.update(nti); - } else { - logger.info("NOT FOUND"); - } - } - catch (final Exception e) { - logger.error("Could not update node instance: {}", e.getMessage(), e); - e.printStackTrace(); - } - } - - /** - * this method wraps the setting/saving of the state - * - * @param nodeInstance - * @param state to be set - */ - public void setState(final NodeInstance nodeInstance, final String state) { - try { - logger.info("NodeInstance: {}", nodeInstance.toString()); - final Optional o = this.repository.find(DaoUtil.toLong(nodeInstance.getId())); - if (o.isPresent()) { - final NodeTemplateInstance nti = o.get(); - nti.setState(Enums.valueOf(NodeTemplateInstanceState.class, state, NodeTemplateInstanceState.ERROR)); - this.repository.update(nti); - } else { - logger.info("NOT FOUND"); - } - } - catch (final Exception e) { - logger.error("Could not update node instance: {}", e.getMessage(), e); - e.printStackTrace(); - } - } - - public List getNodeInstances(final URI serviceInstanceID, final QName nodeTemplateID, - final String nodeTemplateName, final URI nodeInstanceID) { - - logger.info("Not Implemented: Node instances cannot be queried"); - return new ArrayList<>(); - - // final Query getNodeInstancesQuery = this.em.createNamedQuery(NodeInstance.getNodeInstances); - // - // Integer internalID = null; - // if (nodeInstanceID != null) { - // internalID = IdConverter.nodeInstanceUriToID(nodeInstanceID); - // } - // - // Integer internalServiceInstanceID = null; - // if (serviceInstanceID != null) { - // // The serviceInstanceID in this case has the following format: - // // - // http://{hostname}:1337/containerapi/CSARs/{csar}/ServiceTemplates/{template}/Instances/{id} - // // We gonna split the string on character "/" in order to extract - // // the instance ID out of it, which is stored at the end of the - // // resulting string array. - // final String[] parts = serviceInstanceID.getPath().split("/"); - // internalServiceInstanceID = Integer.valueOf(parts[parts.length - 1]); - // - // // This won't work since IdConverter expects a different URL - // // pattern (/instancedata/serviceInstances), which isn't given in - // // this case. - // // internalServiceInstanceID = - // // IdConverter.serviceInstanceUriToID(serviceInstanceID); - // } - // - // // Set Parameters for the Query - // getNodeInstancesQuery.setParameter("internalID", internalID); - // getNodeInstancesQuery.setParameter("nodeTemplateID", - // ((nodeTemplateID != null) ? nodeTemplateID.toString() : null)); - // getNodeInstancesQuery.setParameter("nodeTemplateName", nodeTemplateName); - // getNodeInstancesQuery.setParameter("internalServiceInstanceID", internalServiceInstanceID); - // @SuppressWarnings("unchecked") - // final List queryResults = getNodeInstancesQuery.getResultList(); - // - // return queryResults; - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/ServiceInstanceDAO.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/ServiceInstanceDAO.java deleted file mode 100644 index d8e05befd..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/ServiceInstanceDAO.java +++ /dev/null @@ -1,176 +0,0 @@ -package org.opentosca.container.core.impl.persistence; - -import java.net.URI; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.instance.ServiceInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; -import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; -import org.opentosca.container.core.next.utils.Enums; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class ServiceInstanceDAO { - - private static Logger logger = LoggerFactory.getLogger(ServiceInstanceDAO.class); - - ServiceTemplateInstanceRepository repository = new ServiceTemplateInstanceRepository(); - - - public void deleteServiceInstance(final ServiceInstance si) { - try { - logger.info("ServiceInstance: {}", si.toString()); - final Optional o = this.repository.find(DaoUtil.toLong(si.getId())); - if (o.isPresent()) { - final ServiceTemplateInstance sti = o.get(); - sti.setState(ServiceTemplateInstanceState.DELETED); - this.repository.update(sti); - // repository.remove(sti); - logger.debug("Deleted ServiceInstance with ID: " + si.getId()); - } else { - logger.info("NOT FOUND"); - } - } - catch (final Exception e) { - logger.error("Could not delete service instance: {}", e.getMessage(), e); - e.printStackTrace(); - } - } - - public ServiceInstance storeServiceInstance(final ServiceInstance serviceInstance) { - try { - logger.info("ServiceInstance: {}", serviceInstance.toString()); - final ServiceTemplateInstance sti = Converters.convert(serviceInstance); - try { - this.repository.add(sti); - } - catch (final Exception ex) { - logger.info("Object already added, trying to update"); - this.repository.update(sti); - } - return Converters.convert(sti); - } - catch (final Exception e) { - logger.error("Could not save node instance: {}", e.getMessage(), e); - e.printStackTrace(); - } - return serviceInstance; - } - - public List getServiceInstances(final URI serviceInstanceID, final String serviceTemplateName, - final QName serviceTemplateID) { - - logger.info("Not Implemented: Service instances cannot be queried"); - return new ArrayList<>(); - - // this.init(); - // - // // TODO: Use a query builder !!! - // // final Query getServiceInstancesQuery = - // // this.em.createNamedQuery(ServiceInstance.getServiceInstances); - // final TypedQuery getServiceInstancesQuery; - // - // Integer internalID = null; - // if (serviceInstanceID != null) { - // internalID = IdConverter.serviceInstanceUriToID(serviceInstanceID); - // } - // - // // String serviceTemplateID_String = null; - // // if (serviceTemplateID != null) { - // // serviceTemplateID_String = serviceTemplateID.toString(); - // // } - // - // if (internalID == null) { - // getServiceInstancesQuery = this.em.createQuery( - // "FROM ServiceInstance s WHERE s.serviceTemplateName = :serviceTemplateName AND - // s.serviceTemplateID = :serviceTemplateID", - // ServiceInstance.class); - // getServiceInstancesQuery.setParameter("serviceTemplateName", serviceTemplateName); - // getServiceInstancesQuery.setParameter("serviceTemplateID", serviceTemplateID); - // } else { - // getServiceInstancesQuery = - // this.em.createQuery("FROM ServiceInstance s WHERE s.id = :id", ServiceInstance.class); - // getServiceInstancesQuery.setParameter("id", internalID); - // } - // - // final List queryResults = getServiceInstancesQuery.getResultList(); - // - // return queryResults; - } - - public List getServiceInstances(final CSARID csarId, final QName serviceTemplateId, - final Integer serviceTemplateInstanceID) { - - logger.info("Not Implemented: Service instances cannot be queried"); - return new ArrayList<>(); - - // this.init(); - // - // logger.debug("Try to get Service Template instance objects from persistence for CSAR \"{}\" - // Service Template \"{}\" Instance Id \"{}\"", csarId, serviceTemplateId, - // serviceTemplateInstanceID); - // - // // final Query getServiceInstancesQuery = - // // this.em.createNamedQuery(ServiceInstance.getServiceInstances); - // // TODO: Use a query builder or something else, but please refactor - // // this!! - // - // final String serviceTemplateName = - // InstanceDataServiceImpl.toscaEngineService.getNameOfReference(csarId, serviceTemplateId); - // - // TypedQuery getServiceInstancesQuery = null; - // - // if (serviceTemplateInstanceID == null) { - // getServiceInstancesQuery = this.em.createQuery("FROM ServiceInstance s WHERE - // s.serviceTemplateName = :serviceTemplateName AND s.serviceTemplateID = :serviceTemplateID", - // ServiceInstance.class); - // getServiceInstancesQuery.setParameter("serviceTemplateName", serviceTemplateName); - // getServiceInstancesQuery.setParameter("serviceTemplateID", serviceTemplateId); - // } else { - // getServiceInstancesQuery = this.em.createQuery("FROM ServiceInstance s WHERE s.id = :id", - // ServiceInstance.class); - // getServiceInstancesQuery.setParameter("id", serviceTemplateInstanceID); - // } - // - // final List queryResults = getServiceInstancesQuery.getResultList(); - // - // logger.debug("Found {} instance objects for Service Template instance of CSAR \"{}\" Service - // Template \"{}\" Instance Id \"{}\"", queryResults.size(), csarId, serviceTemplateId, - // serviceTemplateInstanceID); - // - // return queryResults; - } - - /** - * this method wraps the setting/saving of the state - * - * @param nodeInstance - * @param state to be set - */ - public void setState(final ServiceInstance serviceInstance, final String state) { - - try { - logger.info("ServiceInstance: {}", serviceInstance.toString()); - final Optional o = this.repository.find(DaoUtil.toLong(serviceInstance.getId())); - if (o.isPresent()) { - final ServiceTemplateInstance sti = o.get(); - sti.setState(Enums.valueOf(ServiceTemplateInstanceState.class, state, - ServiceTemplateInstanceState.ERROR)); - this.repository.update(sti); - } else { - logger.info("NOT FOUND"); - } - } - catch (final Exception e) { - logger.error("Could not update service instance: {}", e.getMessage(), e); - e.printStackTrace(); - } - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/PlanInvocationEngine.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/PlanInvocationEngine.java deleted file mode 100644 index d5165e272..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/PlanInvocationEngine.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.opentosca.container.core.impl.plan; - -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; -import java.util.Objects; - -import javax.persistence.NoResultException; -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.repository.PlanInstanceRepository; -import org.opentosca.container.core.service.IPlanInvocationEngine; -import org.opentosca.container.core.tosca.extension.TParameterDTO; -import org.opentosca.container.core.tosca.extension.TPlanDTO; -import org.osgi.service.event.Event; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The Implementation of the Plan Invocation Engine. Also deals with OSGI events for communication - * with the Management Bus. - */ -public class PlanInvocationEngine implements IPlanInvocationEngine { - - private final Logger LOG = LoggerFactory.getLogger(PlanInvocationEngine.class); - - private final static PlanInstanceRepository planRepo = new PlanInstanceRepository(); - - @Override - public String createCorrelationId() { - // generate CorrelationId for the plan execution - while (true) { - final String correlationId = String.valueOf(System.currentTimeMillis()); - - try { - PlanInstance instance = planRepo.findByCorrelationId(correlationId); - if(instance == null) { - return correlationId; - } - this.LOG.debug("CorrelationId {} already in use.", correlationId); - } - catch (final NoResultException e) { - return correlationId; - } - } - } - - /** - * {@inheritDoc} - * - * @throws UnsupportedEncodingException - */ - @Override - public void invokePlan(final CSARID csarID, final QName serviceTemplateId, final long serviceTemplateInstanceID, - final TPlanDTO givenPlan, final String correlationID) throws UnsupportedEncodingException { - - if (RulesChecker.areRulesContained(csarID)) { - if (RulesChecker.check(csarID, serviceTemplateId, givenPlan.getInputParameters())) { - this.LOG.debug("Deployment Rules are fulfilled. Continuing the provisioning."); - } else { - this.LOG.debug("Deployment Rules are not fulfilled. Aborting the provisioning."); - return; - } - } - - this.LOG.info("Invoke the Plan {} of type {} of CSAR {}", givenPlan.getId(), givenPlan.getPlanType(), csarID); - - final HashMap input = new HashMap<>(); - for (final TParameterDTO param : givenPlan.getInputParameters().getInputParameter()) { - if (Objects.isNull(param.getValue())) { - input.put(param.getName(), ""); - } else { - input.put(param.getName(), param.getValue()); - } - } - - // prepare the message for the bus - final Map eventValues = new Hashtable<>(); - eventValues.put("CSARID", csarID); - eventValues.put("SERVICETEMPLATEID", serviceTemplateId); - eventValues.put("PLANID", givenPlan.getId()); - eventValues.put("PLANLANGUAGE", givenPlan.getPlanLanguage()); - eventValues.put("SERVICEINSTANCEID", serviceTemplateInstanceID); - eventValues.put("MESSAGEID", correlationID); - eventValues.put("OPERATIONNAME", - ServiceProxy.toscaReferenceMapper.getOperationNameOfPlan(csarID, givenPlan.getId())); - eventValues.put("INPUTS", input); - - // determine execution style (sync/async) - if (Objects.isNull(ServiceProxy.toscaReferenceMapper.isPlanAsynchronous(csarID, givenPlan.getId())) - || ServiceProxy.toscaReferenceMapper.isPlanAsynchronous(csarID, givenPlan.getId())) { - eventValues.put("ASYNC", true); - } else { - eventValues.put("ASYNC", false); - } - - // send the message to the service bus - final Event event = new Event("org_opentosca_plans/requests", eventValues); - this.LOG.debug("Send event with parameters for invocation with the CorrelationID \"{}\".", correlationID); - ServiceProxy.eventAdmin.sendEvent(event); - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/RulesChecker.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/RulesChecker.java deleted file mode 100644 index d7ce22b9d..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/RulesChecker.java +++ /dev/null @@ -1,395 +0,0 @@ -package org.opentosca.container.core.impl.plan; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.AbstractDirectory; -import org.opentosca.container.core.model.AbstractFile; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.TParameterDTO; -import org.opentosca.container.core.tosca.extension.TPlanDTO.InputParameters; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TEntityTemplate; -import org.opentosca.container.core.tosca.model.TEntityTemplate.Properties; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TRelationshipTemplate; -import org.opentosca.container.core.tosca.model.TServiceTemplate; -import org.opentosca.container.core.tosca.model.TTopologyTemplate; -import org.opentosca.planbuilder.csarhandler.CSARHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class RulesChecker { - - private final static Logger LOG = LoggerFactory.getLogger(RulesChecker.class); - - private final static CSARHandler handler = new CSARHandler(); - - static boolean check(final CSARID csarID, final QName serviceTemplateID, final InputParameters inputParameters) { - - RulesChecker.LOG.debug("Checking Rules"); - - - List stWhiteRuleList; - List stBlackRuleList; - try { - stWhiteRuleList = getRules(csarID, true); - stBlackRuleList = getRules(csarID, false); - } - catch (UserException | SystemException e) { - e.printStackTrace(); - return false; - } - - final boolean whiteRulesFulfilled = - checkRules(stWhiteRuleList, "white", csarID, serviceTemplateID, inputParameters); - final boolean blackRulesFulfilled = - checkRules(stBlackRuleList, "black", csarID, serviceTemplateID, inputParameters); - - return whiteRulesFulfilled && blackRulesFulfilled; - } - - - private static boolean checkRules(final List stRuleList, final String ruleType, - final CSARID csarID, final QName serviceTemplateID, - final InputParameters inputParameters) { - - for (final TServiceTemplate stRule : stRuleList) { - - RulesChecker.LOG.debug("Checking Rule: " + stRule.getName() + " RuleType: " + ruleType); - - final TTopologyTemplate rule = stRule.getTopologyTemplate(); - - final List templateRuleList = rule.getNodeTemplateOrRelationshipTemplate(); - - for (final TEntityTemplate templateRule : templateRuleList) { - - if (templateRule instanceof TRelationshipTemplate) { - - final TRelationshipTemplate relationshipRule = (TRelationshipTemplate) templateRule; - - final TNodeTemplate sourceRuleNTemplate = - (TNodeTemplate) relationshipRule.getSourceElement().getRef(); - - final TNodeTemplate targetRuleNTemplate = - (TNodeTemplate) relationshipRule.getTargetElement().getRef(); - - boolean ruleCanBeApplied = false; - - // check for types - if (sourceRuleNTemplate.getId().equals("*")) { - - final List nodeTemplates = - ServiceProxy.toscaEngineService.getNodeTemplatesOfServiceTemplate(csarID, - serviceTemplateID); - - for (final String nodeTemplate : nodeTemplates) { - - final QName nodeType = - ServiceProxy.toscaEngineService.getNodeTypeOfNodeTemplate(csarID, serviceTemplateID, - nodeTemplate); - - // found matching nodetemplate - if (nodeType.equals(sourceRuleNTemplate.getType())) { - RulesChecker.LOG.debug("Rule " + stRule.getName() - + " can be applied to Service Template: " + serviceTemplateID - + ". Reason: Matching Source NodeTypes."); - - ruleCanBeApplied = true; - } - } - - // check for identical IDs - } else { - - // check source - if (ServiceProxy.toscaEngineService.doesNodeTemplateExist(csarID, serviceTemplateID, - sourceRuleNTemplate.getId())) { - - RulesChecker.LOG.debug("Rule " + stRule.getName() + " can be applied to Service Template: " - + serviceTemplateID + ". Reason: Matching Source NodeTemplateIDs."); - - ruleCanBeApplied = true; - } - } - - if (ruleCanBeApplied) { - - if (targetRuleNTemplate.getId().equals("*")) { - - targetRuleNTemplate.getType(); - - boolean found = false; - - while (!found) { - - final String relatedNodeTemplate = - ServiceProxy.toscaEngineService.getRelatedNodeTemplateID(csarID, serviceTemplateID, - sourceRuleNTemplate.getId(), relationshipRule.getType()); - - if (relatedNodeTemplate != null) { - final QName relatedNodeType = - ServiceProxy.toscaEngineService.getNodeTypeOfNodeTemplate(csarID, - serviceTemplateID, relatedNodeTemplate); - - if (relatedNodeType.equals(targetRuleNTemplate.getType())) { - found = true; - RulesChecker.LOG.debug("Matching Target Node Type found. Node Template: " - + relatedNodeTemplate); - - // comparing properties - if (arePropertiesMatching(csarID, serviceTemplateID, relatedNodeTemplate, - inputParameters, targetRuleNTemplate)) { - - switch (ruleType) { - case "white": - RulesChecker.LOG.debug("Properties are matching. Rule is fulfilled."); - break; - case "black": - RulesChecker.LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Properties are matching."); - return false; - } - } else { - switch (ruleType) { - case "white": - RulesChecker.LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Properties are not matching."); - return false; - case "black": - RulesChecker.LOG.debug("Properties are not matching. Rule is fulfilled."); - break; - } - } - } - - } else { - switch (ruleType) { - case "white": - RulesChecker.LOG.warn("Target Node Template not found. Rule not fulfilled."); - return false; - case "black": - RulesChecker.LOG.debug("Nodes are not matching. Rule is fulfilled."); - break; - } - } - } - - // check target nodetemplateID - } else { - - if (ServiceProxy.toscaEngineService.doesNodeTemplateExist(csarID, serviceTemplateID, - targetRuleNTemplate.getId())) { - - // comparing properties - if (arePropertiesMatching(csarID, serviceTemplateID, targetRuleNTemplate.getId(), - inputParameters, targetRuleNTemplate)) { - - switch (ruleType) { - case "white": - RulesChecker.LOG.debug("Properties are matching. Rule is fulfilled."); - break; - case "black": - RulesChecker.LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Properties are matching."); - return false; - } - } else { - switch (ruleType) { - case "white": - RulesChecker.LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Properties are not matching."); - return false; - case "black": - RulesChecker.LOG.debug("Properties are not matching. Rule is fulfilled."); - break; - } - } - - // if source is matching but target isn't, abort - } else { - switch (ruleType) { - case "white": - RulesChecker.LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Source is matching, but target isn't."); - return false; - case "black": - RulesChecker.LOG.debug("Nodes are not matching. Rule is fulfilled."); - break; - } - } - } - - } else { - RulesChecker.LOG.debug("Rule " + stRule.getName() + " can not be applied to Service Template: " - + serviceTemplateID + ".Thus, rule is ignored."); - } - } - } - } - return true; - } - - static boolean areRulesContained(final CSARID csarID) { - - CSARContent content; - try { - content = RulesChecker.handler.getCSARContentForID(csarID); - - final AbstractDirectory dirWhite = content.getDirectory("Rules/Whitelisting"); - final AbstractDirectory dirBlack = content.getDirectory("Rules/Blacklisting"); - if (dirWhite != null || dirBlack != null) { - RulesChecker.LOG.debug("Deployment Rules found."); - return true; - } - RulesChecker.LOG.debug("No Deployment Rules are defined."); - return false; - } - catch (final UserException e) { - e.printStackTrace(); - return false; - } - } - - private static List getRules(final CSARID csarID, final boolean whiteRules) throws UserException, - SystemException { - - final List rulesList = new ArrayList<>(); - - final CSARContent content = RulesChecker.handler.getCSARContentForID(csarID); - AbstractDirectory dir; - if (whiteRules) { - dir = content.getDirectory("Rules/Whitelisting"); - } else { - dir = content.getDirectory("Rules/Blacklisting"); - } - - if (dir != null) { - final Set files = dir.getFiles(); - - if (files != null) { - for (final AbstractFile file : files) { - - RulesChecker.LOG.debug("Filepath: " + file.getPath()); - RulesChecker.LOG.debug("File: " + file.getName()); - - if (file.getName().endsWith("tosca")) { - - RulesChecker.LOG.debug("Rule found"); - - final Definitions def = - ServiceProxy.xmlSerializerService.getXmlSerializer().unmarshal(file.getFileAsInputStream()); - - final List elementsList = - def.getServiceTemplateOrNodeTypeOrNodeTypeImplementation(); - - for (final TExtensibleElements elements : elementsList) { - - final TServiceTemplate st = (TServiceTemplate) elements; - - rulesList.add(st); - } - } - } - } - } - return rulesList; - } - - - - private static HashMap getPropertiesOfNodeTemplate(final TNodeTemplate nodeTemplate) { - - RulesChecker.LOG.debug("Getting Properties."); - if (nodeTemplate != null) { - final Properties properties = nodeTemplate.getProperties(); - if (properties != null) { - final Object any = properties.getAny(); - if (any instanceof Element) { - final Element element = (Element) any; - final Document doc = element.getOwnerDocument(); - return getPropertiesFromDoc(doc); - } else { - RulesChecker.LOG.debug("Properties is not of class Element."); - } - } else { - RulesChecker.LOG.debug("Properties are not set."); - } - } else { - RulesChecker.LOG.debug("The requested NodeTemplate was not found."); - } - - return null; - } - - - private static HashMap getPropertiesFromDoc(final Document doc) { - - final HashMap propertiesMap = new HashMap<>(); - - final NodeList nodeList = doc.getChildNodes(); - for (int i = 0; i < nodeList.getLength(); i++) { - final Node node = nodeList.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - final NodeList nodeList2 = node.getChildNodes(); - for (int i2 = 0; i2 < nodeList2.getLength(); i2++) { - final Node node2 = nodeList2.item(i2); - if (node2.getNodeType() == Node.ELEMENT_NODE) { - final String propName = node2.getNodeName(); - final String propValue = node2.getTextContent(); - RulesChecker.LOG.debug("Property: " + propName + " has Value: " + propValue); - if (propName != null && propValue != null) { - propertiesMap.put(node2.getNodeName(), node2.getTextContent()); - } - } - } - } - } - return propertiesMap; - } - - - private static boolean arePropertiesMatching(final CSARID csarID, final QName serviceTemplateID, - final String relatedNodeTemplate, - final InputParameters inputParameters, - final TNodeTemplate targetRuleNTemplate) { - - final Document propsDoc = - ServiceProxy.toscaEngineService.getPropertiesOfTemplate(csarID, serviceTemplateID, relatedNodeTemplate); - - final HashMap propertiesMap = getPropertiesFromDoc(propsDoc); - final HashMap rulesPropertiesMap = getPropertiesOfNodeTemplate(targetRuleNTemplate); - - - for (final String name : rulesPropertiesMap.keySet()) { - final String value = rulesPropertiesMap.get(name); - if (propertiesMap.containsKey(name)) { - if (propertiesMap.get(name) == null || propertiesMap.get(name).contains("get_input:")) { - for (final TParameterDTO para : inputParameters.getInputParameter()) { - if (para.getName().equals(name)) { - if (!para.getValue().equals(value)) { - RulesChecker.LOG.debug("Property " + name + " not matching. " + para.getValue() + " != " - + value); - return false; - } - } - } - } else if (!propertiesMap.get(name).equals(value)) { - RulesChecker.LOG.debug("Property " + name + " not matching! " + propertiesMap.get(name) + " != " - + value); - return false; - } - } - } - return true; - } - -} - diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/ServiceProxy.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/ServiceProxy.java deleted file mode 100644 index 56ebe041d..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/plan/ServiceProxy.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.opentosca.container.core.impl.plan; - -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.engine.xml.IXMLSerializerService; -import org.osgi.service.event.EventAdmin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Static service handler which provides services of other OSGI components in a static way for - * classes of this bundle. - */ -public class ServiceProxy { - - public static IToscaEngineService toscaEngineService = null; - public static IToscaReferenceMapper toscaReferenceMapper = null; - public static IXMLSerializerService xmlSerializerService = null; - - public static EventAdmin eventAdmin; - - private final Logger LOG = LoggerFactory.getLogger(ServiceProxy.class); - - - protected void bindEventAdmin(final EventAdmin service) { - if (service == null) { - this.LOG.error("Service EventAdmin is null."); - } else { - this.LOG.debug("Bind of the EventAdmin."); - ServiceProxy.eventAdmin = service; - } - } - - protected void unbindEventAdmin(final EventAdmin service) { - this.LOG.debug("Unbind of the EventAdmin."); - ServiceProxy.eventAdmin = null; - } - - protected void bindtoscaEngineService(final IToscaEngineService service) { - if (service == null) { - this.LOG.error("Service toscaEngineService is null."); - } else { - this.LOG.debug("Bind of the toscaEngineService."); - ServiceProxy.toscaEngineService = service; - - if (null != ServiceProxy.toscaEngineService.getToscaReferenceMapper()) { - ServiceProxy.toscaReferenceMapper = ServiceProxy.toscaEngineService.getToscaReferenceMapper(); - } else { - this.LOG.error("The ToscaReferenceMapper is not ready yet."); - } - } - } - - protected void unbindtoscaEngineService(final IToscaEngineService service) { - this.LOG.debug("Unbind of the toscaEngineService."); - ServiceProxy.toscaEngineService = null; - } - - protected void bindIXMLSerializerService(final IXMLSerializerService service) { - if (service == null) { - this.LOG.error("Service IXMLSerializerService is null."); - } else { - this.LOG.debug("Bind of the IXMLSerializerService."); - ServiceProxy.xmlSerializerService = service; - } - } - - protected void unbindIXMLSerializerService(final IXMLSerializerService service) { - this.LOG.debug("Unbind of the IXMLSerializerService."); - ServiceProxy.xmlSerializerService = null; - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreCapabilityServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreCapabilityServiceImpl.java deleted file mode 100644 index b6eacf3b2..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreCapabilityServiceImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.model.capability.provider.ProviderType; -import org.opentosca.container.core.service.ICoreCapabilityService; -import org.opentosca.container.core.service.internal.ICoreInternalCapabilityService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * {@inheritDoc} - * - * This implementation currently acts as a Proxy to the ICoreInternalCapabilityService. It can in - * future be used to modify the incoming parameters to fit another backend - * interface/implementation.
    - *
    - * Copyright 2012 IAAS University of Stuttgart
    - *
    - * - * @see ICoreInternalCapabilityService - * @see ProviderType - * - * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de - * - */ -public class CoreCapabilityServiceImpl implements ICoreCapabilityService { - - /** - * Get the capabilities of the container to store them. - * - * @see org.opentosca.settings.Settings - */ - private final String containerCapabilities = Settings.getSetting("containerCapabilities"); - - private ICoreInternalCapabilityService capabilityService; - - final private static Logger LOG = LoggerFactory.getLogger(CoreCapabilityServiceImpl.class); - - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public void storeCapabilities(final List capabilities, final String providerName, - final ProviderType providerType) { - this.capabilityService.storeCapabilities(capabilities, providerName, providerType); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public Map> getCapabilities(final ProviderType providerType) { - return this.capabilityService.getCapabilities(providerType); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public List getCapabilities(final String providerName, final ProviderType providerType) { - return this.capabilityService.getCapabilities(providerName, providerType); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public void deleteCapabilities(final String providerName) { - this.capabilityService.deleteCapabilities(providerName); - } - - /** - * Binds the CoreInternalCapabilityService. - * - * @param capService to bind. - */ - public void bind(final ICoreInternalCapabilityService capService) { - if (capService == null) { - CoreCapabilityServiceImpl.LOG.error("Can't bind CoreInternalCapabilityService."); - } else { - this.capabilityService = capService; - CoreCapabilityServiceImpl.LOG.debug("CoreInternalCapabilityService bound."); - - // Store Container Capabilities on start up - final List containerCaps = this.getCapabilities(); - this.capabilityService.storeCapabilities(containerCaps, ProviderType.CONTAINER.name(), - ProviderType.CONTAINER); - } - - } - - /** - * Unbinds the CoreInternalCapabilityService. - * - * @param capService to unbind. - */ - public void unbind(final ICoreInternalCapabilityService serv) { - this.capabilityService = null; - CoreCapabilityServiceImpl.LOG.debug("CoreInternalCapabilityService unbound."); - } - - /** - * @return all capabilities of the container. - */ - private List getCapabilities() { - final List capabilities = new ArrayList<>(); - - for (final String capability : this.containerCapabilities.split("[,;]")) { - capabilities.add(capability.trim()); - } - return capabilities; - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreCredentialsServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreCredentialsServiceImpl.java deleted file mode 100644 index 47ea48810..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreCredentialsServiceImpl.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.util.Set; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.credentials.Credentials; -import org.opentosca.container.core.service.ICoreCredentialsService; -import org.opentosca.container.core.service.internal.ICoreInternalCredentialsService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This implementation currently acts as a Proxy to the Core Internal Credentials Service. It can in - * future be used to modify the incoming parameters to fit another back end interface / - * implementation. - * - * @see ICoreInternalCredentialsService - * @see Credentials - */ -public class CoreCredentialsServiceImpl implements ICoreCredentialsService { - - final private static Logger LOG = LoggerFactory.getLogger(CoreCredentialsServiceImpl.class); - - private ICoreInternalCredentialsService internalCredentialsService; - - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public long storeCredentials(final Credentials credentials) throws UserException { - return this.internalCredentialsService.storeCredentials(credentials); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public Credentials getCredentials(final long credentialsID) throws UserException { - return this.internalCredentialsService.getCredentials(credentialsID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public Set getCredentialsIDs() { - return this.internalCredentialsService.getCredentialsIDs(); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public Set getAllCredentialsOfStorageProvider(final String storageProviderID) { - return this.internalCredentialsService.getAllCredentialsOfStorageProvider(storageProviderID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public Set getAllCredentials() { - return this.internalCredentialsService.getAllCredentials(); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public void deleteCredentials(final long credentialsID) throws UserException { - this.internalCredentialsService.deleteCredentials(credentialsID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public void deleteAllCredentials() { - this.internalCredentialsService.deleteAllCredentials(); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public void setCredentialsInStorageProvider(final long credentialsID) throws UserException, SystemException { - this.internalCredentialsService.setCredentialsInStorageProvider(credentialsID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public void deleteCredentialsInStorageProvider(final String storageProviderID) throws SystemException { - this.internalCredentialsService.deleteCredentialsInStorageProvider(storageProviderID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public boolean hasStorageProviderCredentials(final String storageProviderID) throws SystemException { - return this.internalCredentialsService.hasStorageProviderCredentials(storageProviderID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public boolean hasStorageProviderCredentials(final long credentialsID) throws UserException { - return this.internalCredentialsService.hasStorageProviderCredentials(credentialsID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public boolean needsStorageProviderCredentials(final String storageProviderID) throws SystemException { - return this.internalCredentialsService.needsStorageProviderCredentials(storageProviderID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public String getCredentialsIdentityName(final String storageProviderID) throws SystemException { - return this.internalCredentialsService.getCredentialsIdentityName(storageProviderID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public String getCredentialsKeyName(final String storageProviderID) throws SystemException { - return this.internalCredentialsService.getCredentialsKeyName(storageProviderID); - } - - @Override - /** - * {@inheritDoc}
    - *
    - * This currently acts as a proxy. - */ - public Set getStorageProviders() { - return this.internalCredentialsService.getStorageProviders(); - } - - /** - * Binds the Core Internal Credentials Service. - * - * @param credentialsService to bind - */ - public void bindCoreInternalCredentialsService(final ICoreInternalCredentialsService internalCredentialsService) { - if (internalCredentialsService == null) { - CoreCredentialsServiceImpl.LOG.error("Can't bind Core Internal Credentials Service."); - } else { - this.internalCredentialsService = internalCredentialsService; - CoreCredentialsServiceImpl.LOG.debug("Core Internal Credentials Service bound."); - } - - } - - /** - * Unbinds the Core Internal Credentials Service. - * - * @param credentialsService to unbind - */ - public void unbindCoreInternalCredentialsService(final ICoreInternalCredentialsService internalCredentialsService) { - this.internalCredentialsService = null; - CoreCredentialsServiceImpl.LOG.debug("Core Internal Credentials Service unbound."); - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreDeploymentTrackerServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreDeploymentTrackerServiceImpl.java deleted file mode 100644 index 4942058ce..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreDeploymentTrackerServiceImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.util.List; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.deployment.ia.IADeploymentInfo; -import org.opentosca.container.core.model.deployment.ia.IADeploymentState; -import org.opentosca.container.core.model.deployment.plan.PlanDeploymentInfo; -import org.opentosca.container.core.model.deployment.plan.PlanDeploymentState; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; -import org.opentosca.container.core.service.ICoreDeploymentTrackerService; -import org.opentosca.container.core.service.internal.ICoreInternalDeploymentTrackerService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This implementation currently acts as a Proxy to the Core Internal Deployment Tracker Service. It - * can in future be used to modify the incoming parameters to fit another back end interface / - * implementation. - * - * @see ICoreInternalDeploymentTrackerService - */ -public class CoreDeploymentTrackerServiceImpl implements ICoreDeploymentTrackerService { - - ICoreInternalDeploymentTrackerService deploymentTrackerService; - - final private static Logger LOG = LoggerFactory.getLogger(CoreDeploymentTrackerServiceImpl.class); - - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public boolean storeDeploymentState(final CSARID csarID, final DeploymentProcessState deploymentState) { - return this.deploymentTrackerService.storeDeploymentState(csarID, deploymentState); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public DeploymentProcessState getDeploymentState(final CSARID csarID) { - return this.deploymentTrackerService.getDeploymentState(csarID); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public boolean storeIADeploymentInfo(final IADeploymentInfo iaDeploymentInfo) { - return this.deploymentTrackerService.storeIADeploymentInfo(iaDeploymentInfo); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public IADeploymentInfo getIADeploymentInfo(final CSARID csarID, final String iaRelPath) { - return this.deploymentTrackerService.getIADeploymentInfo(csarID, iaRelPath); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public List getIADeploymentInfos(final CSARID csarID) { - return this.deploymentTrackerService.getIADeploymentInfos(csarID); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public boolean storePlanDeploymentInfo(final PlanDeploymentInfo planDeploymentInfo) { - return this.deploymentTrackerService.storePlanDeploymentInfo(planDeploymentInfo); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public PlanDeploymentInfo getPlanDeploymentInfo(final CSARID csarID, final String planRelPath) { - return this.deploymentTrackerService.getPlanDeploymentInfo(csarID, planRelPath); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public List getPlanDeploymentInfos(final CSARID csarID) { - return this.deploymentTrackerService.getPlanDeploymentInfos(csarID); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public boolean storeIADeploymentInfo(final CSARID csarID, final String iaRelPath, - final IADeploymentState iaDeploymentState) { - return this.deploymentTrackerService.storeIADeploymentInfo(csarID, iaRelPath, iaDeploymentState); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy. - */ - public boolean storePlanDeploymentInfo(final CSARID csarID, final String planRelPath, - final PlanDeploymentState planDeploymentState) { - return this.deploymentTrackerService.storePlanDeploymentInfo(csarID, planRelPath, planDeploymentState); - } - - @Override - public void deleteDeploymentState(final CSARID csarId) { - this.deploymentTrackerService.deleteDeploymentState(csarId); - } - - /** - * Binds the Core Internal Deployment Tracker. - * - * @param deploymentTrackerService to bind - */ - public void bindCoreInternalDeploymentTrackerService(final ICoreInternalDeploymentTrackerService deploymentTrackerService) { - if (deploymentTrackerService == null) { - CoreDeploymentTrackerServiceImpl.LOG.error("Can't bind Core Internal Deployment Tracker Service."); - } else { - this.deploymentTrackerService = deploymentTrackerService; - CoreDeploymentTrackerServiceImpl.LOG.debug("Core Internal Deployment Tracker Service bound."); - } - - } - - /** - * Unbinds the Core Internal Deployment Tracker. - * - * @param deploymentTrackerService to unbind - */ - public void unbindCoreInternalDeploymentTrackerService(final ICoreInternalDeploymentTrackerService deploymentTrackerService) { - this.deploymentTrackerService = null; - CoreDeploymentTrackerServiceImpl.LOG.debug("Core Internal Deployment Tracker Service unbound."); - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreEndpointServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreEndpointServiceImpl.java deleted file mode 100644 index f962760a8..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreEndpointServiceImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.net.URI; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.core.service.internal.ICoreInternalEndpointService; - -/** - * This implementation currently acts as a Proxy to the Internal Endpoint service. It can in future - * be used to modify the incoming parameters to fit another backend interface/implementation - * - * @see ICoreInternalEndpointService - */ -public class CoreEndpointServiceImpl implements ICoreEndpointService { - - // Internal Endpoint service. - private ICoreInternalEndpointService endpointService; - - - public void bind(final ICoreInternalEndpointService serv) { - this.endpointService = serv; - } - - public void unbind(final ICoreInternalEndpointService serv) { - this.endpointService = null; - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy - */ - public List getWSDLEndpoints(final QName portType, final String triggeringContainer, - final CSARID csarId) { - return this.endpointService.getWSDLEndpoints(portType, triggeringContainer, csarId); - } - - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy - */ - public void storeWSDLEndpoint(final WSDLEndpoint endpoint) { - this.endpointService.storeWSDLEndpoint(endpoint); - - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy - */ - public List getRestEndpoints(final URI anyURI, final String triggeringContainer, - final CSARID csarId) { - return this.endpointService.getRestEndpoints(anyURI, triggeringContainer, csarId); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy - */ - public void storeRESTEndpoint(final RESTEndpoint endpoint) { - this.endpointService.storeRESTEndpoint(endpoint); - } - - @Override - public void removePlanEndpoints(final String triggeringContainer, final CSARID csarId) { - this.endpointService.removePlanEndpoints(triggeringContainer, csarId); - } - - @Override - public WSDLEndpoint getWSDLEndpointForPlanId(final String triggeringContainer, final CSARID csarId, - final QName planId) { - return this.endpointService.getWSDLEndpointForPlanId(triggeringContainer, csarId, planId); - } - - @Override - public List getWSDLEndpointsForCSARID(final String triggeringContainer, final CSARID csarId) { - return this.endpointService.getWSDLEndpointsForCSARID(triggeringContainer, csarId); - } - - @Override - public List getWSDLEndpointsForSTID(final String triggeringContainer, - final Long serviceTemplateInstanceID) { - return this.endpointService.getWSDLEndpointsForSTID(triggeringContainer, serviceTemplateInstanceID); - } - - @Override - public List getWSDLEndpointsForNTImplAndIAName(final String triggeringContainer, - final String managingContainer, - final QName nodeTypeImpl, final String iaName) { - return this.endpointService.getWSDLEndpointsForNTImplAndIAName(triggeringContainer, managingContainer, - nodeTypeImpl, iaName); - } - - @Override - public List getWSDLEndpoints() { - return this.endpointService.getWSDLEndpoints(); - } - - @Override - public void printPlanEndpoints() { - this.endpointService.printPlanEndpoints(); - } - - @Override - /** - * {@inheritDoc} - * - * This currently acts as a proxy - */ - public boolean removeWSDLEndpoint(final WSDLEndpoint endpoint) { - return this.endpointService.removeWSDLEndpoint(endpoint); - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreFileServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreFileServiceImpl.java deleted file mode 100644 index 0a0dea3e4..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreFileServiceImpl.java +++ /dev/null @@ -1,231 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.nio.file.Path; -import java.util.Set; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.ICoreFileService; -import org.opentosca.container.core.service.internal.ICoreInternalFileService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This implementation currently acts as a Proxy to the Core Internal File Service. It can in future - * be used to modify the incoming parameters to fit another back end interface / implementation. - */ -public class CoreFileServiceImpl implements ICoreFileService { - - private final static Logger LOG = LoggerFactory.getLogger(CoreFileServiceImpl.class); - - private ICoreInternalFileService internalFileService; - - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public Set getReadyStorageProviders() { - return this.internalFileService.getReadyStorageProviders(); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public boolean isReadyStorageProvider(final String storageProviderID) { - return this.internalFileService.isReadyStorageProvider(storageProviderID); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public Set getStorageProviders() { - return this.internalFileService.getStorageProviders(); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public String getActiveStorageProvider() { - return this.internalFileService.getActiveStorageProvider(); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public void setActiveStorageProvider(final String storageProviderID) throws UserException { - this.internalFileService.setActiveStorageProvider(storageProviderID); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public String getDefaultStorageProvider() { - return this.internalFileService.getDefaultStorageProvider(); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public String getStorageProviderName(final String storageProviderID) { - return this.internalFileService.getStorageProviderName(storageProviderID); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public CSARID storeCSAR(final Path csarFile) throws UserException, SystemException { - return this.internalFileService.storeCSAR(csarFile); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public CSARContent getCSAR(final CSARID csarID) throws UserException { - return this.internalFileService.getCSAR(csarID); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public Path exportCSAR(final CSARID csarID) throws UserException, SystemException { - return this.internalFileService.exportCSAR(csarID); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public Set getCSARIDs() { - return this.internalFileService.getCSARIDs(); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public void moveCSAR(final CSARID csarID) throws UserException, SystemException { - this.internalFileService.moveCSAR(csarID); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public void moveFileOrDirectoryOfCSAR(final CSARID csarID, final Path fileOrDirRelToCSARRoot) throws UserException, - SystemException { - this.internalFileService.moveFileOrDirectoryOfCSAR(csarID, fileOrDirRelToCSARRoot); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public void deleteCSAR(final CSARID csarID) throws SystemException, UserException { - this.internalFileService.deleteCSAR(csarID); - } - - /** - * {@inheritDoc} - * - *
    - *
    - * This currently acts as a proxy. - */ - @Override - public void deleteCSARs() throws SystemException { - this.internalFileService.deleteCSARs(); - } - - /** - * Binds the Core Internal File Service. - * - * @param fileService to bind - */ - public void bindCoreInternalFileService(final ICoreInternalFileService internalFileService) { - if (internalFileService == null) { - CoreFileServiceImpl.LOG.error("Can't bind Core Internal File Service."); - } else { - this.internalFileService = internalFileService; - CoreFileServiceImpl.LOG.debug("Core Internal File Service bound."); - } - } - - /** - * Unbinds the Core Internal File Service. - * - * @param fileService to unbind - */ - public void unbindCoreInternalFileService(final ICoreInternalFileService internalFileService) { - this.internalFileService = null; - CoreFileServiceImpl.LOG.debug("Core Internal File Service unbound."); - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreModelRepositoryServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreModelRepositoryServiceImpl.java deleted file mode 100644 index 4f47e5e1c..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/CoreModelRepositoryServiceImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.ICoreModelRepositoryService; -import org.opentosca.container.core.service.internal.ICoreInternalModelRepositoryService; -import org.opentosca.container.core.tosca.model.TDefinitions; - -/** - * This implementation currently acts as a Proxy to the Internal Core Model Repository service. It - * can in future be used to modify the incoming parameters to fit another backend - * interface/implementation - * - * @see ICoreInternalModelRepositoryService - */ -public class CoreModelRepositoryServiceImpl implements ICoreModelRepositoryService { - - private ICoreInternalModelRepositoryService modelServ = null; - - // @Override - // /** - // * {@inheritDoc} - // * - // * This currently acts as a proxy - // */ - // public QName storeTOSCA(File toscaFile) { - // return this.modelServ.storeTOSCA(toscaFile); - // } - - // @Override - // /** - // * {@inheritDoc} - // * - // * This currently acts as a proxy - // */ - // public List getServiceTemplateIDs(CSARID csarID, QName - // definitionsID) { - // return this.modelServ.getServiceTemplateIDs(csarID, definitionsID); - // } - - // @Override - // /** - // * {@inheritDoc} - // * - // * This currently acts as a proxy - // */ - // public int deleteAllDefinitions() { - // return this.modelServ.deleteAllDefinitions(); - // } - - - // @Override - // /** - // * {@inheritDoc} - // * - // * This currently acts as a proxy - // */ - // public boolean deleteDefinitions(QName definitionsID) { - // return this.modelServ.deleteDefinitions(definitionsID); - // } - - /** - * {@inheritDoc} - * - * This currently acts as a proxy - */ - @Override - public List getAllDefinitionsIDs(final CSARID csarID) { - return this.modelServ.getAllDefinitionsIDs(csarID); - } - - /** - * {@inheritDoc} - * - * This currently acts as a proxy - */ - @Override - public TDefinitions getDefinitions(final CSARID csarID, final QName definitionsID) { - return this.modelServ.getDefinitions(csarID, definitionsID); - } - - public void bind(final ICoreInternalModelRepositoryService serv) { - this.modelServ = serv; - } - - public void unbind(final ICoreInternalModelRepositoryService serv) { - this.modelServ = null; - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/FileAccessServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/FileAccessServiceImpl.java deleted file mode 100644 index 846ec7d30..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/FileAccessServiceImpl.java +++ /dev/null @@ -1,394 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; - -import org.eclipse.core.runtime.FileLocator; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.service.IFileAccessService; -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Store for files that are needed by the Container and its tests. Every file can be accessed by a - * separate method. - */ -public class FileAccessServiceImpl implements IFileAccessService { - - final private static Logger LOG = LoggerFactory.getLogger(FileAccessServiceImpl.class); - - private final Bundle BUNDLE = FrameworkUtil.getBundle(FileAccessServiceImpl.class); - - - /** - * @param relFilePath - * @return the file at the file path relFilePath (relative to META-INF/res - * in this bundle) - * - */ - private File getResource(final String relFilePath) { - - URL bundleResURL = null; - URL fileResURL = null; - File fileRes = null; - - try { - bundleResURL = this.BUNDLE.getEntry("/META-INF/resources/" + relFilePath); - // convert bundle resource URL to file URL - fileResURL = FileLocator.toFileURL(bundleResURL); - fileRes = new File(fileResURL.toURI()); - } - catch (final Exception e) { - FileAccessServiceImpl.LOG.error("", e); - } - - if (fileRes == null) { - FileAccessServiceImpl.LOG.error("Can't get file at relative path {}.", relFilePath); - } else { - FileAccessServiceImpl.LOG.debug("Absolute File path: {}", fileRes.getAbsolutePath()); - } - - return fileRes; - } - - @Override - /** - * {@inheritDoc} - */ - public File getNotebookAppBuildPlan() { - FileAccessServiceImpl.LOG.debug("Retrieving NotebookApp build plan"); - return this.getResource("test/notebookbuildPlan.zip"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getOpenToscaSchemaFile() { - FileAccessServiceImpl.LOG.debug("Get the TOSCA XML schema"); - return this.getResource("TOSCA-v1.0.xsd"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getXMLSchemaDatatypesSchema() { - FileAccessServiceImpl.LOG.debug("Get the XML schema data types schema file."); - return this.getResource("xsds/XMLSchemaDatatypes.xsd"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getDeploymentArtifactXMLSchemaFile() { - FileAccessServiceImpl.LOG.debug("Get the Deployment Artifact XML schema file."); - return this.getResource("xsds/DeploymentArtifactXMLSchema.xsd"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getToscaTestXMLFileA() { - FileAccessServiceImpl.LOG.debug("Get the TOSCA test A XML file."); - return this.getResource("test/TOSCA-TestXML-A.xml"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getToscaTestXMLFileB() { - FileAccessServiceImpl.LOG.debug("Get the TOSCA test B XML file."); - return this.getResource("test/TOSCA-TestXML-B.xml"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getToscaTestXMLFileMergeURI() { - FileAccessServiceImpl.LOG.debug("Get the TOSCA test merge XML file."); - return this.getResource("test/TOSCA-TestXML-Merge.xml"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getTHORSuperApplicationToscaFile() { - FileAccessServiceImpl.LOG.debug("Get the Super Application TOSCA file."); - return this.getResource("test/SuperApplicationTOSCAFile.xml"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getTestWarImplementationArtifact() { - FileAccessServiceImpl.LOG.debug("Get the WAR test Implementation Artifact."); - return this.getResource("test/TestImplementationArtifact.war"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getAWSDeployer() { - FileAccessServiceImpl.LOG.debug("Get the IA WAR-File AWSDeployer."); - return this.getResource("test/AWSDeployer.war"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getDBCreator() { - FileAccessServiceImpl.LOG.debug("Get the IA WAR-File DBCreator."); - return this.getResource("test/AmazonDBCreator.war"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getTestAarImplementationArtifact() { - FileAccessServiceImpl.LOG.debug("Get the AAR test Implementation Artifact."); - return this.getResource("test/TestImplementationArtifact.aar"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getTestWSDLFile() { - FileAccessServiceImpl.LOG.debug("Get the test WSDL file."); - return this.getResource("test/wsdl/Deploy.wsdl"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getResolverTest_MainTOSCA() { - FileAccessServiceImpl.LOG.debug("Get the Service Template Resolver test main TOSCA file."); - return this.getResource("test/ResolverTest_MainTOSCAFile.xml"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getResolverTest_ImportTOSCA() { - FileAccessServiceImpl.LOG.debug("Get the Service Template Resolver test import TOSCA file."); - return this.getResource("test/ResolverTest_ImportTOSCA.xml"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getResolverTest_ImportWSDL() { - FileAccessServiceImpl.LOG.debug("Get the Service Template Resolver test import WSDL file."); - return this.getResource("test/ResolverTest_ImportWSDL.wsdl"); - } - - @Override - /** - * {@inheritDoc} - */ - public File getResolverThorFile() { - FileAccessServiceImpl.LOG.debug("Getting the Service Templatr Resolver test THOR file."); - return this.getResource("test/ResolverExampleThorFile.thor"); - } - - @Override - public File getCSARSugarCRM3() { - FileAccessServiceImpl.LOG.debug("Get the SugarCRM3 CSAR file."); - return this.getResource("test/SugarCRM3.csar"); - } - - @Override - public File getCSARSuperApplicationNotebook() { - FileAccessServiceImpl.LOG.debug("Get the SuperApplicationNotebook CSAR file."); - return this.getResource("test/SuperApplicationNotebook.csar"); - } - - @Override - public File getCSARWithInvalidFileExtension() { - FileAccessServiceImpl.LOG.debug("Get a CSAR with invalid file extension."); - return this.getResource("test/CSARWithInvalidFileExtension.csar1"); - } - - @Override - public File getCSARMoodle() { - FileAccessServiceImpl.LOG.debug("Get the Moodle CSAR file."); - return this.getResource("test/Moodle.csar"); - } - - @Override - public File getTOSCAMetaFileInvalid1() { - FileAccessServiceImpl.LOG.debug("Get the invalid TOSCA meta file 1."); - return this.getResource("test/TOSCAMetaFileInvalid1.meta"); - } - - @Override - public File getTOSCAMetaFileInvalid2() { - FileAccessServiceImpl.LOG.debug("Get the invalid TOSCA meta file 2."); - return this.getResource("test/TOSCAMetaFileInvalid2.meta"); - } - - @Override - public File getTOSCAMetaFileInvalid3() { - FileAccessServiceImpl.LOG.debug("Get the invalid TOSCA meta file 3."); - return this.getResource("test/TOSCAMetaFileInvalid3.meta"); - } - - @Override - public File getTOSCAMetaFileInvalid4() { - FileAccessServiceImpl.LOG.debug("Get the invalid TOSCA meta file 4."); - return this.getResource("test/TOSCAMetaFileInvalid4.meta"); - } - - @Override - public File getTOSCAMetaFileInvalid5() { - FileAccessServiceImpl.LOG.debug("Get the invalid TOSCA meta file 5."); - return this.getResource("test/TOSCAMetaFileInvalid5.meta"); - } - - @Override - public File getTOSCAMetaFileInvalid6() { - FileAccessServiceImpl.LOG.debug("Get the invalid TOSCA meta file 6."); - return this.getResource("test/TOSCAMetaFileInvalid6.meta"); - } - - @Override - public File getTOSCAMetaFileInvalid7() { - FileAccessServiceImpl.LOG.debug("Get the invalid TOSCA meta file 7."); - return this.getResource("test/TOSCAMetaFileInvalid7.meta"); - } - - @Override - public File getTOSCAMetaFileInvalid8() { - FileAccessServiceImpl.LOG.debug("Get the invalid TOSCA meta file 8."); - return this.getResource("test/TOSCAMetaFileInvalid8.meta"); - } - - @Override - public File getTOSCAMetaFileValid1() { - FileAccessServiceImpl.LOG.debug("Get the valid TOSCA meta file 1."); - return this.getResource("test/TOSCAMetaFileValid1.meta"); - } - - @Override - public File getTOSCAMetaFileValid2() { - FileAccessServiceImpl.LOG.debug("Get the valid TOSCA meta file 2."); - return this.getResource("test/TOSCAMetaFileValid2.meta"); - } - - @Override - public File getTOSCAMetaFileValid3() { - FileAccessServiceImpl.LOG.debug("Get the valid TOSCA meta file 3."); - return this.getResource("test/TOSCAMetaFileValid3.meta"); - } - - @Override - public File getTestCSAR() { - FileAccessServiceImpl.LOG.debug("Get the Test CSAR for Core File Service test cases."); - return this.getResource("test/TestCSAR.csar"); - } - - @Override - public File getTestCSAR2() { - FileAccessServiceImpl.LOG.debug("Get the Test CSAR 2 for Core File Service test cases (invalid, contains no Definitions files)."); - return this.getResource("test/TestCSAR2.csar"); - } - - @Override - public File getStorageProviderTestFile1() { - FileAccessServiceImpl.LOG.debug("Get a test file for storage provider test cases."); - return this.getResource("test/Storage Provider Test File.txt"); - } - - @Override - public File getStorageProviderTestFile2() { - FileAccessServiceImpl.LOG.debug("Get a empty test file for storage provider test cases."); - return this.getResource("test/StorageProviderTestFile2.war"); - } - - /** - * ----------------------------------------------------------------- - */ - - @Override - /** - * {@inheritDoc} - */ - public File getTemp() { - - Path tempDir; - - do { - tempDir = Paths.get(Settings.getSetting("temp") + File.separator + System.nanoTime()); - } while (Files.exists(tempDir)); - - try { - Files.createDirectories(tempDir); - } - catch (final IOException exc) { - FileAccessServiceImpl.LOG.warn("An IO Exception occured.", exc); - return null; - } - - return tempDir.toFile(); - - // Path opentoscaTemp = Paths.get(Settings.getSetting("temp")); - // - // try { - // Files.createDirectories(opentoscaTemp); - // Path tempDir = Files.createTempDirectory(opentoscaTemp, null); - // return tempDir.toFile(); - // } catch (IOException exc) { - // FileAccessServiceImpl.LOG.warn("An IO Exception occured.", exc); - // } - // - // return null; - - } - - @Override - /** - * {@inheritDoc} - */ - public File unpackToTemp(final File zipFile) { - final File tempDir = this.getTemp(); - ZipManager.getInstance().unzip(zipFile, tempDir); - return tempDir; - } - - @Override - /** - * {@inheritDoc} - */ - public File zip(final File directory, final File archive) { - return ZipManager.getInstance().zip(directory, archive); - } - - @Override - /** - * {@inheritDoc} - */ - public List unzip(final File file, final File toTarget) { - return ZipManager.getInstance().unzip(file, toTarget); - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/HttpServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/HttpServiceImpl.java deleted file mode 100644 index 66368cd0e..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/HttpServiceImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.auth.AuthScope; -import org.apache.http.auth.UsernamePasswordCredentials; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpHead; -import org.apache.http.client.methods.HttpOptions; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.client.methods.HttpTrace; -import org.apache.http.cookie.Cookie; -import org.apache.http.impl.client.AbstractHttpClient; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.impl.client.LaxRedirectStrategy; -import org.opentosca.container.core.service.IHTTPService; - -/** - * This is an implementation of the {@link org.opentosca.util.http.service.IHTTPService} interface. - * A lot of methods currently offer only very basic functionality which could be extended in the - * future if the need arises. All methods make use of the Apache HttpComponents. - */ -public class HttpServiceImpl implements IHTTPService { - - DefaultHttpClient client; - - - @Override - public HttpResponse Get(final String uri, final List cookies) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpGet get = new HttpGet(uri); - - if (cookies != null) { - for (final Cookie c : cookies) { - ((AbstractHttpClient) this.client).getCookieStore().addCookie(c); - - } - } - - final HttpResponse response = this.client.execute(get); - - return response; - // TODO Return something useful maybe... like an InputStream - } - - @Override - public HttpResponse Get(final String uri, final Map headers) throws ClientProtocolException, - IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpGet get = new HttpGet(uri); - - for (final String header : headers.keySet()) { - get.addHeader(header, headers.get(header)); - } - - final HttpResponse response = this.client.execute(get); - - return response; - // TODO Return something useful maybe... like an InputStream - } - - - @Override - public HttpResponse Get(final String uri) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpGet get = new HttpGet(uri); - final HttpResponse response = this.client.execute(get); - - return response; - // TODO Return something useful maybe... like an InputStream - } - - @Override - public HttpResponse Get(final String uri, final String username, - final String password) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.getCredentialsProvider().setCredentials(AuthScope.ANY, - new UsernamePasswordCredentials(username, password)); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpGet get = new HttpGet(uri); - final HttpResponse response = this.client.execute(get); - - return response; - // TODO Return something useful maybe... like an InputStream - } - - @Override - public HttpResponse Head(final String uri) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpHead head = new HttpHead(uri); - final HttpResponse response = this.client.execute(head); - return response; - } - - @Override - public HttpResponse Post(final String uri, final HttpEntity httpEntity) throws ClientProtocolException, - IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpPost post = new HttpPost(uri); - post.setEntity(httpEntity); - final HttpResponse response = this.client.execute(post); - return response; - } - - @Override - public HttpResponse Post(final String uri, final HttpEntity httpEntity, - final Header... header) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpPost post = new HttpPost(uri); - post.setEntity(httpEntity); - post.setHeaders(header); - final HttpResponse response = this.client.execute(post); - return response; - } - - @Override - public HttpResponse Post(final String uri, final HttpEntity httpEntity, - final List cookies) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpPost post = new HttpPost(uri); - post.setEntity(httpEntity); - if (cookies != null) { - for (final Cookie c : cookies) { - ((AbstractHttpClient) this.client).getCookieStore().addCookie(c); - - } - } - final HttpResponse response = this.client.execute(post); - return response; - } - - @Override - public List PostCookies(final String uri, final HttpEntity httpEntity) throws ClientProtocolException, - IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpPost post = new HttpPost(uri); - post.setEntity(httpEntity); - this.client.execute(post); - final List cookies = ((AbstractHttpClient) this.client).getCookieStore().getCookies(); - // this.client.getConnectionManager().shutdown(); - return cookies; - } - - @Override - public HttpResponse Put(final String uri, final HttpEntity httpEntity) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpPut put = new HttpPut(uri); - put.setEntity(httpEntity); - final HttpResponse response = this.client.execute(put); - return response; - } - - @Override - public HttpResponse Put(final String uri, final HttpEntity httpEntity, final String username, - final String password) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - this.client.getCredentialsProvider().setCredentials(AuthScope.ANY, - new UsernamePasswordCredentials(username, password)); - final HttpPut put = new HttpPut(uri); - put.setEntity(httpEntity); - final HttpResponse response = this.client.execute(put); - return response; - } - - @Override - public HttpResponse Delete(final String uri) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpDelete del = new HttpDelete(uri); - final HttpResponse response = this.client.execute(del); - return response; - } - - @Override - public HttpResponse Trace(final String uri) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpTrace trace = new HttpTrace(uri); - final HttpResponse response = this.client.execute(trace); - return response; - } - - @Override - public HttpResponse Options(final String uri) throws ClientProtocolException, IOException { - this.client = new DefaultHttpClient(); - this.client.setRedirectStrategy(new LaxRedirectStrategy()); - final HttpOptions options = new HttpOptions(uri); - final HttpResponse response = this.client.execute(options); - return response; - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/InstanceDataServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/InstanceDataServiceImpl.java deleted file mode 100644 index 8f7dcf25a..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/InstanceDataServiceImpl.java +++ /dev/null @@ -1,1248 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.opentosca.container.core.common.ReferenceNotFoundException; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.NodeTemplateInstanceCounts; -import org.opentosca.container.core.impl.persistence.Converters; -import org.opentosca.container.core.impl.persistence.DaoUtil; -import org.opentosca.container.core.impl.persistence.NodeInstanceDAO; -import org.opentosca.container.core.impl.persistence.RelationInstanceDAO; -import org.opentosca.container.core.impl.persistence.ServiceInstanceDAO; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.instance.IdConverter; -import org.opentosca.container.core.model.instance.NodeInstance; -import org.opentosca.container.core.model.instance.RelationInstance; -import org.opentosca.container.core.model.instance.ServiceInstance; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; -import org.opentosca.container.core.next.repository.RelationshipTemplateInstanceRepository; -import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; -import org.opentosca.container.core.service.IInstanceDataService; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TPropertyMapping; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - -/** - * The InstanceDataService.
    - * The Engine offers a service to manage InstanceData for existing ServiceTemplates inside the - * CSARs. It relies on the ToscaEngine to get its information about existence of those and for - * values for the default properties of created instances. - */ -@Deprecated -@WebService(name = "InstanceDataService") -@SOAPBinding(style = SOAPBinding.Style.RPC) -public class InstanceDataServiceImpl implements IInstanceDataService { - - final private static Logger logger = LoggerFactory.getLogger(InstanceDataServiceImpl.class); - - public static IToscaEngineService toscaEngineService; - - private final ServiceTemplateInstanceRepository serviceRepository = new ServiceTemplateInstanceRepository(); - private final NodeTemplateInstanceRepository nodeRepository = new NodeTemplateInstanceRepository(); - private final RelationshipTemplateInstanceRepository relationshipRepository = - new RelationshipTemplateInstanceRepository(); - - // used for persistence - private final ServiceInstanceDAO siDAO = new ServiceInstanceDAO(); - private final NodeInstanceDAO niDAO = new NodeInstanceDAO(); - private final RelationInstanceDAO riDAO = new RelationInstanceDAO(); - - - @Override - @WebMethod(exclude = true) - public List getServiceInstances(final URI serviceInstanceID, final String serviceTemplateName, - final QName serviceTemplateId) { - - logger.info("getServiceInstances(): {}", serviceInstanceID); - logger.info("getServiceInstances(): {}", serviceTemplateName); - logger.info("getServiceInstances(): {}", serviceTemplateId); - - if (serviceInstanceID != null) { - Integer id = IdConverter.serviceInstanceUriToID(serviceInstanceID); - if (id == null) { - final String[] segments = serviceInstanceID.getPath().split("/"); - id = Integer.valueOf(segments[segments.length - 1]); - } - logger.info("Using ServiceTemplate Instance ID: {}", id); - final Optional sti = this.serviceRepository.find(DaoUtil.toLong(id)); - if (sti.isPresent()) { - logger.info("Single Result: {}", sti); - return Lists.newArrayList(Converters.convert(sti.get())); - } else { - logger.info("NOT FOUND"); - } - } - - if (serviceTemplateId != null) { - logger.info("Using serviceTemplateId: {}", serviceTemplateId); - final Collection result = - this.serviceRepository.findByTemplateId(serviceTemplateId); - if (result != null) { - logger.info("Result: {}", result.size()); - return result.stream().map(sti -> Converters.convert(sti)).collect(Collectors.toList()); - } - } - - return this.siDAO.getServiceInstances(serviceInstanceID, serviceTemplateName, serviceTemplateId); - } - - @Override - @WebMethod(exclude = true) - public List getServiceInstancesWithDetails(final CSARID csarId, final QName serviceTemplateId, - final Integer serviceTemplateInstanceID) { - - logger.info("getServiceInstancesWithDetails(): {}", csarId); - logger.info("getServiceInstancesWithDetails(): {}", serviceTemplateId); - logger.info("getServiceInstancesWithDetails(): {}", serviceTemplateInstanceID); - - if (serviceTemplateInstanceID != null) { - final Optional sti = - this.serviceRepository.find(DaoUtil.toLong(serviceTemplateInstanceID)); - if (sti.isPresent()) { - logger.info("Single Result: {}", sti); - return Lists.newArrayList(Converters.convert(sti.get())); - } else { - logger.info("NOT FOUND"); - } - } - - if (serviceTemplateId != null) { - final Collection result = - this.serviceRepository.findByTemplateId(serviceTemplateId); - if (result != null) { - logger.info("Result: {}", result.size()); - return result.stream().map(sti -> Converters.convert(sti)).collect(Collectors.toList()); - } - } - - return this.siDAO.getServiceInstances(csarId, serviceTemplateId, serviceTemplateInstanceID); - } - - @Override - @WebMethod(exclude = true) - public ServiceInstance createServiceInstance(final CSARID csarID, - final QName serviceTemplateID) throws ReferenceNotFoundException { - - logger.info("createServiceInstance(): {}", csarID); - logger.info("createServiceInstance(): {}", serviceTemplateID); - - InstanceDataServiceImpl.logger.debug("Starting creating ServiceInstance for " + serviceTemplateID + " in " - + csarID); - // TODO: boolean flag for cascading creation? cool or not? - // check if serviceTemplate doesn't exist - if (!ToscaEngineProxy.doesServiceTemplateExist(InstanceDataServiceImpl.toscaEngineService, csarID, - serviceTemplateID)) { - InstanceDataServiceImpl.logger.warn(String.format("Failed to create ServiceInstance for CSAR-ID: %s / serviceTemplateID: %s - was not found!", - csarID, serviceTemplateID)); - throw new ReferenceNotFoundException("ServiceTemplate doesn't exist in the specified CSAR"); - } - // retrieve serviceTemplateName - final String serviceTemplateName = - InstanceDataServiceImpl.toscaEngineService.getNameOfReference(csarID, serviceTemplateID); - // get all min and maxCounts from the ServiceTemplate and construct - // nodeInstances from it automatically - final NodeTemplateInstanceCounts instanceCounts = - InstanceDataServiceImpl.toscaEngineService.getInstanceCountsOfNodeTemplatesByServiceTemplateID(csarID, - serviceTemplateID); - - // creation of real objects - ServiceInstance serviceInstance = new ServiceInstance(csarID, serviceTemplateID, serviceTemplateName); - - // construct initial properties of serviceTemplate - final Document properties = createServiceInstancePropertiesFromServiceTemplate(csarID, serviceTemplateID); - - serviceInstance.setProperties(properties); - - serviceInstance = this.siDAO.storeServiceInstance(serviceInstance); - // store serviceInstance so we can use nodeInstanceDAO to create - // nodeInstances (they need an existing object because its working in - // another transaction) - // TODO: or is it better to get the alternative route? to do it in one - // transaction? and have duplicate code? need to fetch nodeTemplateName - // from toscaEngine f.ex.? - - // this creates required Node Templates of a Service Template, but this - // functionality is out dated - // HashMap occurenceInformationMap = - // instanceCounts.getOccurenceInformationMap(); - // Set qNamesOfNodeTemplates = occurenceInformationMap.keySet(); - // // create for each nodeTemplate the minimum amount of instances - // // specified - // for (QName qName : qNamesOfNodeTemplates) { - // InstanceCount instanceCount = occurenceInformationMap.get(qName); - // // create "instanceCount".min instances - // for (int i = 0; i < instanceCount.min; i++) { - // // new nodeInstance - // createNodeInstance(qName, serviceInstance.getServiceInstanceID()); - // } - // } - // create associated nodeInstances - - return serviceInstance; - } - - @Override - @WebMethod(exclude = true) - public void deleteServiceInstance(final URI serviceInstanceID) { - - logger.info("deleteServiceInstance(): {}", serviceInstanceID); - - final List serviceInstances = getServiceInstances(serviceInstanceID, null, null); - - if (serviceInstances == null || serviceInstances.size() != 1) { - InstanceDataServiceImpl.logger.warn(String.format("Failed to delete ServiceInstance: '%s' - could not be retrieved", - serviceInstanceID)); - return; - } - this.siDAO.deleteServiceInstance(serviceInstances.get(0)); - } - - @Override - @WebMethod(exclude = true) - public List getNodeInstances(final URI nodeInstanceID, final QName nodeTemplateID, - final String nodeTemplateName, final URI serviceInstanceID) { - - logger.info("getNodeInstances(): {}", nodeInstanceID); - logger.info("getNodeInstances(): {}", nodeTemplateID); - logger.info("getNodeInstances(): {}", nodeTemplateName); - logger.info("getNodeInstances(): {}", serviceInstanceID); - - if (nodeInstanceID != null) { - Integer id = IdConverter.nodeInstanceUriToID(nodeInstanceID); - if (id == null) { - final String[] segments = serviceInstanceID.getPath().split("/"); - id = Integer.valueOf(segments[segments.length - 1]); - } - logger.info("Using NodeTemplate Instance ID: {}", id); - final Optional nti = this.nodeRepository.find(DaoUtil.toLong(id)); - if (nti.isPresent()) { - logger.info("Single Result: {}", nti); - return Lists.newArrayList(Converters.convert(nti.get())); - } else { - logger.info("NOT FOUND"); - } - } - - if (nodeTemplateID != null) { - final Collection result = this.nodeRepository.findByTemplateId(nodeTemplateID); - if (result != null) { - logger.info("Result: {}", result.size()); - return result.stream().map(nti -> Converters.convert(nti)).collect(Collectors.toList()); - } - } - - if (serviceInstanceID != null) { - Integer id = IdConverter.serviceInstanceUriToID(serviceInstanceID); - if (id == null) { - final String[] segments = serviceInstanceID.getPath().split("/"); - id = Integer.valueOf(segments[segments.length - 1]); - } - logger.info("Using ServiceTemplate Instance ID: {}", id); - final Optional sti = this.serviceRepository.find(DaoUtil.toLong(id)); - if (sti.isPresent()) { - final ServiceTemplateInstance i = sti.get(); - final Collection result = i.getNodeTemplateInstances(); - if (result != null) { - logger.info("Result: {}", result.size()); - return result.stream().map(nti -> Converters.convert(nti)).collect(Collectors.toList()); - } - } else { - logger.info("NOT FOUND"); - } - } - - return this.niDAO.getNodeInstances(serviceInstanceID, nodeTemplateID, nodeTemplateName, nodeInstanceID); - } - - @Override - public List getRelationInstances(final URI relationInstanceID, final QName relationshipTemplateID, - final String relationshipTemplateName, - final URI serviceInstanceID) { - - logger.info("getRelationInstances(): {}", relationInstanceID); - logger.info("getRelationInstances(): {}", relationshipTemplateID); - logger.info("getRelationInstances(): {}", relationshipTemplateName); - logger.info("getRelationInstances(): {}", serviceInstanceID); - - if (relationInstanceID != null) { - Integer id = IdConverter.relationInstanceUriToID(relationInstanceID); - if (id == null) { - final String[] segments = relationInstanceID.getPath().split("/"); - id = Integer.valueOf(segments[segments.length - 1]); - } - logger.info("Using RelationshipTemplate Instance ID: {}", id); - final Optional nti = this.relationshipRepository.find(DaoUtil.toLong(id)); - if (nti.isPresent()) { - logger.info("Single Result: {}", nti); - return Lists.newArrayList(Converters.convert(nti.get())); - } else { - logger.info("NOT FOUND"); - } - } - - if (relationshipTemplateID != null) { - final Collection result = - this.relationshipRepository.findByTemplateId(relationshipTemplateID); - if (result != null) { - logger.info("Result: {}", result.size()); - return result.stream().map(nti -> Converters.convert(nti)).collect(Collectors.toList()); - } - } - - if (serviceInstanceID != null) { - final Set rels = Sets.newHashSet(); - Integer id = IdConverter.serviceInstanceUriToID(serviceInstanceID); - if (id == null) { - final String[] segments = serviceInstanceID.getPath().split("/"); - id = Integer.valueOf(segments[segments.length - 1]); - } - logger.info("Using ServiceTemplate Instance ID: {}", id); - final Optional sti = this.serviceRepository.find(DaoUtil.toLong(id)); - if (sti.isPresent()) { - final ServiceTemplateInstance i = sti.get(); - final Collection result = i.getNodeTemplateInstances(); - if (result != null) { - for (final NodeTemplateInstance nti : result) { - rels.addAll(nti.getIncomingRelations()); - rels.addAll(nti.getOutgoingRelations()); - } - logger.info("Result: {}", rels.size()); - return rels.stream().map(nti -> Converters.convert(nti)).collect(Collectors.toList()); - } - } else { - logger.info("NOT FOUND"); - } - } - - return this.riDAO.getRelationInstances(serviceInstanceID, relationshipTemplateID, relationshipTemplateName, - relationInstanceID); - } - - @Override - @WebMethod(exclude = true) - public NodeInstance createNodeInstance(final CSARID csarId, final QName serviceTemplateId, - final int serviceTemplateInstanceID, - final QName nodeTemplateID) throws ReferenceNotFoundException { - - logger.info("createNodeInstance(): {}", csarId); - logger.info("createNodeInstance(): {}", serviceTemplateId); - logger.info("createNodeInstance(): {}", serviceTemplateInstanceID); - logger.info("createNodeInstance(): {}", nodeTemplateID); - - logger.debug("Retrieve Node Template \"{{}}\":\"{}\" for csar \"{}\", Service Template \"{}\" instance \"{}\"", - nodeTemplateID.getNamespaceURI(), nodeTemplateID.getLocalPart(), csarId, serviceTemplateId, - serviceTemplateInstanceID); - - final List serviceInstances = - getServiceInstancesWithDetails(csarId, serviceTemplateId, serviceTemplateInstanceID); - if (serviceInstances == null || serviceInstances.size() != 1) { - final String msg = - String.format("Failed to create NodeInstance: ServiceInstance: '%s' - could not be retrieved", - serviceTemplateInstanceID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - final ServiceInstance serviceInstance = serviceInstances.get(0); - - // check if nodeTemplate exists - if (!InstanceDataServiceImpl.toscaEngineService.doesNodeTemplateExist(csarId, serviceTemplateId, - nodeTemplateID.getLocalPart())) { - final String msg = - String.format("Failed to create NodeInstance: NodeTemplate: csar: %s serviceTemplateID: %s , nodeTemplateID: '%s' - could not be retrieved / does not exists", - serviceInstance.getCSAR_ID(), serviceInstance.getServiceTemplateID(), nodeTemplateID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - - final String nodeTemplateName = - InstanceDataServiceImpl.toscaEngineService.getNameOfReference(csarId, nodeTemplateID); - - // use localparts because serviceInstance QName namespace HAS to be the - // same as the namespace of the nodeInstance - final QName nodeTypeOfNodeTemplate = - InstanceDataServiceImpl.toscaEngineService.getNodeTypeOfNodeTemplate(csarId, serviceTemplateId, - nodeTemplateID.getLocalPart()); - - // use localparts because serviceInstance QName namespace HAS to be the - // same as the namespace of the nodeInstance - final Document propertiesOfNodeTemplate = - InstanceDataServiceImpl.toscaEngineService.getPropertiesOfTemplate(csarId, serviceTemplateId, - nodeTemplateID.getLocalPart() - .toString()); - - NodeInstance nodeInstance = - new NodeInstance(nodeTemplateID, nodeTemplateName, nodeTypeOfNodeTemplate, serviceInstance); - // set default properties - nodeInstance.setProperties(propertiesOfNodeTemplate); - nodeInstance = this.niDAO.saveNodeInstance(nodeInstance); - return nodeInstance; - } - - @Override - @WebMethod(exclude = true) - public RelationInstance createRelationInstance(final CSARID csarId, final QName serviceTemplateId, - final int serviceTemplateInstanceID, - final QName relationshipTemplateID, final String sourceInstanceId, - final String targetInstanceId) { - - logger.info("createRelationInstance(): {}", csarId); - logger.info("createRelationInstance(): {}", serviceTemplateId); - logger.info("createRelationInstance(): {}", serviceTemplateInstanceID); - logger.info("createRelationInstance(): {}", relationshipTemplateID); - logger.info("createRelationInstance(): {}", sourceInstanceId); - logger.info("createRelationInstance(): {}", targetInstanceId); - - final String relationshipTemplateName = - InstanceDataServiceImpl.toscaEngineService.getNameOfReference(csarId, relationshipTemplateID); - - // use localparts because serviceInstance QName namespace HAS to be the - // same as the namespace of the nodeInstance - final QName nodeTypeOfNodeTemplate = - InstanceDataServiceImpl.toscaEngineService.getRelationshipTypeOfRelationshipTemplate(csarId, - serviceTemplateId, relationshipTemplateID.getLocalPart()); - - // use localparts because serviceInstance QName namespace HAS to be the - // same as the namespace of the nodeInstance - final Document propertiesOfRelationshipTemplate = - InstanceDataServiceImpl.toscaEngineService.getPropertiesOfTemplate(csarId, serviceTemplateId, - relationshipTemplateID.getLocalPart() - .toString()); - - final NodeInstance sourceInstance = getNodeInstances(URI.create(sourceInstanceId), null, null, null).get(0); - final NodeInstance targetInstance = getNodeInstances(URI.create(targetInstanceId), null, null, null).get(0); - - RelationInstance relationInstance = new RelationInstance(relationshipTemplateID, relationshipTemplateName, - nodeTypeOfNodeTemplate, null, sourceInstance, targetInstance); - - // set default properties - relationInstance.setProperties(propertiesOfRelationshipTemplate); - relationInstance = this.riDAO.saveRelationInstance(relationInstance); - - return relationInstance; - } - - /** - * Yes, this method throws always an exception. Why? Do not use the method! - */ - @Deprecated - @Override - public NodeInstance createNodeInstance(final QName nodeTemplateIDQName, - final URI serviceInstanceIdURI) throws ReferenceNotFoundException { - throw new ReferenceNotFoundException("DO NOT USE THIS METHOD!!!"); - // return null; - } - - @Override - @WebMethod(exclude = true) - public void deleteNodeInstance(final URI nodeInstanceID) { - - logger.info("deleteNodeInstance(): {}", nodeInstanceID); - - final List nodeInstances = getNodeInstances(nodeInstanceID, null, null, null); - - if (nodeInstances == null || nodeInstances.size() != 1) { - InstanceDataServiceImpl.logger.warn(String.format("Failed to delete NodeInstance: '%s' - could not be retrieved", - nodeInstanceID)); - return; - } - this.niDAO.deleteNodeInstance(nodeInstances.get(0)); - - } - - @Override - public void deleteRelationInstance(final URI relationInstanceID) { - - logger.info("deleteRelationInstance(): {}", relationInstanceID); - - final List relationInstances = getRelationInstances(relationInstanceID, null, null, null); - - if (relationInstances == null || relationInstances.size() != 1) { - InstanceDataServiceImpl.logger.warn(String.format("Failed to delete RelatioknInstance: '%s' - could not be retrieved", - relationInstanceID)); - return; - } - this.riDAO.deleteRelationInstance(relationInstances.get(0)); - - } - - @Override - @WebMethod(exclude = true) - public QName getRelationInstanceState(final URI relationInstanceID) throws ReferenceNotFoundException { - - logger.info("getRelationInstanceState(): {}", relationInstanceID); - - final List relationInstances = getRelationInstances(relationInstanceID, null, null, null); - if (relationInstances == null || relationInstances.size() != 1) { - final String msg = - String.format("Failed to get State of RelationInstance: '%s' - does it exist?", relationInstanceID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - return QName.valueOf(relationInstances.get(0).getState().toString()); - } - - @Override - @WebMethod(exclude = true) - public void setRelationInstanceState(final URI relationInstanceID, - final String state) throws ReferenceNotFoundException { - - logger.info("setRelationInstanceState(): {}", relationInstanceID); - logger.info("setRelationInstanceState(): {}", state); - - final List relationInstances = - this.riDAO.getRelationInstances(null, null, null, relationInstanceID); - - if (relationInstances == null || relationInstances.size() != 1) { - final String msg = - String.format("Failed to set State of RelationInstance: '%s' - does it exist?", relationInstanceID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - this.riDAO.setState(relationInstances.get(0), state); - } - - @Override - @WebMethod(exclude = true) - public QName getNodeInstanceState(final URI nodeInstanceID) throws ReferenceNotFoundException { - - logger.info("getNodeInstanceState(): {}", nodeInstanceID); - - final List nodeInstances = getNodeInstances(nodeInstanceID, null, null, null); - if (nodeInstances == null || nodeInstances.size() != 1) { - final String msg = - String.format("Failed to get State of NodeInstance: '%s' - does it exist?", nodeInstanceID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - return QName.valueOf(nodeInstances.get(0).getState().toString()); - } - - @Override - public void setNodeInstanceState(final URI nodeInstanceID, final String state) throws ReferenceNotFoundException { - - logger.info("setNodeInstanceState(): {}", nodeInstanceID); - logger.info("setNodeInstanceState(): {}", state); - - final List nodeInstances = getNodeInstances(nodeInstanceID, null, null, null); - - if (nodeInstances == null || nodeInstances.size() != 1) { - final String msg = - String.format("Failed to set State of NodeInstance: '%s' - does it exist?", nodeInstanceID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - this.niDAO.setState(nodeInstances.get(0), state); - } - - @Override - @WebMethod(exclude = true) - public Document getServiceInstanceProperties(final URI serviceInstanceID, - final List propertiesList) throws ReferenceNotFoundException { - - logger.info("getServiceInstanceProperties(): {}", serviceInstanceID); - logger.info("getServiceInstanceProperties(): {}", propertiesList); - - final List serviceInstances = getServiceInstances(serviceInstanceID, null, null); - - if (serviceInstances == null || serviceInstances.size() != 1) { - final String msg = String.format("Failed to retrieve ServiceInstance: '%s'", serviceInstanceID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - - final ServiceInstance serviceInstance = serviceInstances.get(0); - - updateServiceInstanceProperties(serviceInstance); - - return serviceInstance.getProperties(); - } - - @Override - public Document getRelationInstanceProperties(final URI relationInstanceID, - final List propertiesList) throws ReferenceNotFoundException { - - logger.info("getRelationInstanceProperties(): {}", relationInstanceID); - logger.info("getRelationInstanceProperties(): {}", propertiesList); - - final List relationInstances = getRelationInstances(relationInstanceID, null, null, null); - - if (relationInstances == null || relationInstances.size() != 1) { - final String msg = String.format("Failed to retrieve NodeInstance: '%s'", relationInstanceID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - final RelationInstance relationInstance = relationInstances.get(0); - final Document retrievedProperties = relationInstance.getProperties(); - - // start extracting relevant properties - // if propertiesList == null return NO PROPERTIES - // if propertiesList.isEmpty() return ALL PROPERTIES - // if it contains values => filter and return them - if (propertiesList == null) { - return null; - } - if (propertiesList.isEmpty()) { - return retrievedProperties; - } - - final Element docElement = retrievedProperties.getDocumentElement(); - if (docElement == null) { - return null; - } - - // create new DOM-Document with new RootElement named like the old one - final Document resultingProperties = InstanceDataServiceImpl.emptyDocument(); - final Element createElementNS = resultingProperties.createElement("Properties"); - resultingProperties.appendChild(createElementNS); - - // filter elements from the properties - final NodeList childNodes = docElement.getChildNodes(); - - for (int i = 0; i < childNodes.getLength(); i++) { - final Node currentItem = childNodes.item(i); - - // this is a fix for empty text values due to a bug in the - // toscaReferenceMapper - if (currentItem.getLocalName() == null) { - // if QName can't be build skip this childNode (entry inside xml - // document) - continue; - } - - // calculate qName of the currentItem - final QName currentItemQName = new QName(currentItem.getNamespaceURI(), currentItem.getLocalName()); - - // match the item against the filters - for (final QName qName : propertiesList) { - if (qName.equals(currentItemQName)) { - // match was found, add it to result (first deep clone the - // element => then adopt to document and finally append to - // the documentElement - final Node cloneNode = currentItem.cloneNode(true); - resultingProperties.adoptNode(cloneNode); - resultingProperties.getDocumentElement().appendChild(cloneNode); - } - } - } - - return resultingProperties; - } - - @Override - @WebMethod(exclude = true) - // TODO: should it return a empty document when there aren't any properties - // for the nodeinstance? - public Document getNodeInstanceProperties(final URI nodeInstanceID, - final List propertiesList) throws ReferenceNotFoundException { - - logger.info("getNodeInstanceProperties(): {}", nodeInstanceID); - logger.info("getNodeInstanceProperties(): {}", propertiesList); - - final List nodeInstances = getNodeInstances(nodeInstanceID, null, null, null); - - if (nodeInstances == null || nodeInstances.size() != 1) { - final String msg = String.format("Failed to retrieve NodeInstance: '%s'", nodeInstanceID); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - final NodeInstance nodeInstance = nodeInstances.get(0); - final Document retrievedProperties = nodeInstance.getProperties(); - - // start extracting relevant properties - // if propertiesList == null return NO PROPERTIES - // if propertiesList.isEmpty() return ALL PROPERTIES - // if it contains values => filter and return them - if (propertiesList == null) { - return null; - } - if (propertiesList.isEmpty()) { - return retrievedProperties; - } - - final Element docElement = retrievedProperties.getDocumentElement(); - if (docElement == null) { - return null; - } - - // create new DOM-Document with new RootElement named like the old one - final Document resultingProperties = InstanceDataServiceImpl.emptyDocument(); - final Element createElementNS = resultingProperties.createElement("Properties"); - resultingProperties.appendChild(createElementNS); - - // filter elements from the properties - final NodeList childNodes = docElement.getChildNodes(); - - for (int i = 0; i < childNodes.getLength(); i++) { - final Node currentItem = childNodes.item(i); - - // this is a fix for empty text values due to a bug in the - // toscaReferenceMapper - if (currentItem.getLocalName() == null) { - // if QName can't be build skip this childNode (entry inside xml - // document) - continue; - } - - // calculate qName of the currentItem - final QName currentItemQName = new QName(currentItem.getNamespaceURI(), currentItem.getLocalName()); - - // match the item against the filters - for (final QName qName : propertiesList) { - if (qName.equals(currentItemQName)) { - // match was found, add it to result (first deep clone the - // element => then adopt to document and finally append to - // the documentElement - final Node cloneNode = currentItem.cloneNode(true); - resultingProperties.adoptNode(cloneNode); - resultingProperties.getDocumentElement().appendChild(cloneNode); - } - } - } - - return resultingProperties; - } - - /** - * Creates an empty DOM document. - * - * @return An empty DOM document. - */ - private static Document emptyDocument() { - final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - try { - final DocumentBuilder db = dbf.newDocumentBuilder(); - final Document doc = db.newDocument(); - return doc; - } - catch (final ParserConfigurationException e) { - InstanceDataServiceImpl.logger.error(e.getMessage()); - } - return null; - } - - @Override - public void setRelationInstanceProperties(final URI relationInstanceID, - final Document properties) throws ReferenceNotFoundException { - - logger.info("setRelationInstanceProperties(): {}", relationInstanceID); - - final List relationInstances = - this.riDAO.getRelationInstances(null, null, null, relationInstanceID); - - if (relationInstances == null || relationInstances.size() != 1) { - InstanceDataServiceImpl.logger.warn(String.format("Failed to set Properties of NodeInstance: '%s' - does it exist?", - relationInstanceID)); - return; - } - - this.riDAO.setProperties(relationInstances.get(0), properties); - - updateServiceInstanceProperties(relationInstances.get(0).getServiceInstance()); - return; - - } - - @Override - @WebMethod(exclude = true) - public void setNodeInstanceProperties(final URI nodeInstanceID, - final Document properties) throws ReferenceNotFoundException { - - logger.info("setNodeInstanceProperties(): {}", nodeInstanceID); - - final List nodeInstances = getNodeInstances(nodeInstanceID, null, null, null); - - if (nodeInstances == null || nodeInstances.size() != 1) { - InstanceDataServiceImpl.logger.warn(String.format("Failed to set Properties of NodeInstance: '%s' - does it exist?", - nodeInstanceID)); - return; - } - - this.niDAO.setProperties(nodeInstances.get(0), properties); - - - updateServiceInstanceProperties(nodeInstances.get(0).getServiceInstance()); - return; - - } - - @WebMethod(exclude = true) - public void bindToscaEngineService(final IToscaEngineService toscaEngineService) { - if (toscaEngineService == null) { - InstanceDataServiceImpl.logger.error("Can't bind ToscaEngine Service."); - } else { - InstanceDataServiceImpl.toscaEngineService = toscaEngineService; - InstanceDataServiceImpl.logger.debug("ToscaEngine-Service bound."); - } - } - - @WebMethod(exclude = true) - public void unbindToscaEngineService(final IToscaEngineService toscaEngineService) { - InstanceDataServiceImpl.toscaEngineService = null; - InstanceDataServiceImpl.logger.debug("ToscaEngine-Service unbound."); - - } - - - // TODO: remove this when deprecated methods are removed - static HashMap instanceData = new HashMap<>(); - - - @Override - @WebMethod - public void setProperty(@WebParam(name = "key") final String key, @WebParam(name = "value") final String value) { - System.out.println("Setting key: " + key + " with value: " + value); - InstanceDataServiceImpl.instanceData.put(key, value); - } - - @Override - @WebMethod - public String getProperty(@WebParam(name = "key") final String key) { - System.out.println("Getting value for key: " + key); - - return InstanceDataServiceImpl.instanceData.get(key); - } - - @Override - public HashMap getProperties(final String keyPrefix) { - System.out.println("Getting values for key beginning with: " + keyPrefix); - - final HashMap properties = new HashMap<>(); - - for (final Map.Entry entry : InstanceDataServiceImpl.instanceData.entrySet()) { - - final String key = entry.getKey(); - if (key.startsWith(keyPrefix)) { - final String value = entry.getValue(); - properties.put(key, value); - } - } - - return properties; - } - - @WebMethod(exclude = true) - private void updateServiceInstanceProperties(final ServiceInstance serviceInstance) { - // check if the serviceInstance has properties - if (serviceInstance.getProperties() == null) { - return; - } - - // check if the serviceTemplate has propertyMappings - final TBoundaryDefinitions boundaryDefs = - InstanceDataServiceImpl.toscaEngineService.getBoundaryDefinitionsOfServiceTemplate(serviceInstance.getCSAR_ID(), - serviceInstance.getServiceTemplateID()); - - if (boundaryDefs == null || boundaryDefs.getProperties() == null - || boundaryDefs.getProperties().getPropertyMappings() == null) { - // if there are no property mappings there is no need to update. The - // properties can only be updated be external clients via setting - // properties by hand - return; - } - - final Element properties = (Element) serviceInstance.getProperties().getFirstChild(); - - // cycle through mappings and update accordingly - for (final TPropertyMapping mapping : boundaryDefs.getProperties().getPropertyMappings().getPropertyMapping()) { - final String serviceTemplatePropertyQuery = mapping.getServiceTemplatePropertyRef(); - final List serviceTemplatePropertyElements = - queryElementList(properties, serviceTemplatePropertyQuery); - - // fetch element from serviceTemplateProperties - - if (serviceTemplatePropertyElements.size() != 1) { - // skip this property, we expect only one - continue; - } - - // check whether the targetRef is concat query - if (isConcatQuery(mapping.getTargetPropertyRef())) { - // this query needs possibly multiple properties from different - // nodeInstances - - final String propertyValue = - generatePropertyValueFromConcatQuery(mapping.getTargetPropertyRef(), - getNodeInstances(null, null, null, - serviceInstance.getServiceInstanceID())); - serviceTemplatePropertyElements.get(0).setTextContent(propertyValue); - - } else { - // this query only fetches a SINGLE element on the properties of - // the referenced entity - - final NodeInstance nodeInstance = - getNodeInstanceFromMappingObject(serviceInstance, mapping.getTargetObjectRef()); - - if (nodeInstance == null) { - continue; - } - - final Document nodeProperties = nodeInstance.getProperties(); - if (nodeProperties == null) { - // skip it, the mapping is invalid - continue; - } - final Element nodePropertiesRoot = (Element) nodeProperties.getFirstChild(); - final String nodeTemplatePropertyQuery = mapping.getTargetPropertyRef(); - - final List nodePropertyElements = - queryElementList(nodePropertiesRoot, nodeTemplatePropertyQuery); - - if (nodePropertyElements.size() != 1) { - // skip this property, we expect only one - continue; - } - - // change the serviceTemplateProperty - serviceTemplatePropertyElements.get(0).setTextContent(nodePropertyElements.get(0).getTextContent()); - - } - } - - serviceInstance.setProperties(properties.getOwnerDocument()); - this.siDAO.storeServiceInstance(serviceInstance); - } - - private String generatePropertyValueFromConcatQuery(final String targetPropertyRef, - final List nodeInstance) { - final String testQuery = targetPropertyRef.trim(); - - if (!testQuery.endsWith(")")) { - return null; - } - - final int functionOpeningBracket = testQuery.indexOf("("); - - final String functionString = testQuery.substring(0, functionOpeningBracket); - - // simple validity check as we only want to be able to concat strings, - // but maybe more later - if (!functionString.equals("concat")) { - return null; - } - - final String functionContent = - testQuery.substring(functionOpeningBracket + 1, testQuery.lastIndexOf(")")).trim(); - - final String[] functionParts = functionContent.split(","); - - final List augmentedFunctionParts = new ArrayList<>(); - - for (final String functionPart : functionParts) { - if (functionPart.trim().startsWith("'")) { - // string function part, just add to list - augmentedFunctionParts.add(functionPart.trim()); - } else if (functionPart.trim().split("\\.").length == 3) { - // "DSL" Query - final String[] queryParts = functionPart.trim().split("\\."); - // fast check for validity - if (!queryParts[1].equals("Properties")) { - return null; - } - - final String nodeTemplateName = queryParts[0]; - final String propertyName = queryParts[2]; - - if (getNodeInstanceWithName(nodeInstance, nodeTemplateName) != null) { - - final String propValue = - fetchPropertyValueFromNodeInstance(getNodeInstanceWithName(nodeInstance, nodeTemplateName), - propertyName); - - augmentedFunctionParts.add("'" + propValue + "'"); - } - } - } - - // now we have a string of the form: - // concat('someString','somePropertyValue','someString',..) - // just make the concat itself instead of running an XPath query - - String resultString = ""; - for (final String functionPart : augmentedFunctionParts) { - resultString += functionPart.replace("'", ""); - } - - return resultString; - } - - private NodeInstance getNodeInstanceWithName(final List nodeInstances, final String nodeTemplateId) { - - for (final NodeInstance nodeInstance : nodeInstances) { - if (nodeInstance.getNodeTemplateID().getLocalPart().equals(nodeTemplateId)) { - return nodeInstance; - } - } - - return null; - } - - private String fetchPropertyValueFromNodeInstance(final NodeInstance nodeInstance, final String propertyLocalName) { - - if (nodeInstance.getProperties() == null) { - return null; - } - - final NodeList childNodes = nodeInstance.getProperties().getFirstChild().getChildNodes(); - - for (int index = 0; index < childNodes.getLength(); index++) { - final Node childNode = childNodes.item(index); - if (childNode.getNodeType() == Node.ELEMENT_NODE && childNode.getLocalName().equals(propertyLocalName)) { - return childNode.getTextContent(); - } - - } - - return null; - } - - private List queryElementList(final Element node, final String xpathQuery) { - final List elements = new ArrayList<>(); - try { - final XPath xPath = XPathFactory.newInstance().newXPath(); - - final NodeList nodes = (NodeList) xPath.evaluate(xpathQuery, node, XPathConstants.NODESET); - - for (int index = 0; index < nodes.getLength(); index++) { - if (nodes.item(index).getNodeType() == Node.ELEMENT_NODE) { - elements.add((Element) nodes.item(index)); - } - - } - - } - catch (final XPathExpressionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return elements; - } - - private NodeInstance getNodeInstanceFromMappingObject(final ServiceInstance serviceInstance, final Object obj) { - if (obj instanceof TNodeTemplate) { - - final TNodeTemplate template = (TNodeTemplate) obj; - - // service.getNodeInstances(null, null, null, - // serviceInstanceIDtoURI); - - final List nodeInstances = - getNodeInstances(null, null, null, serviceInstance.getServiceInstanceID()); - - if (nodeInstances == null) { - return null; - } - - for (final NodeInstance nodeInstance : nodeInstances) { - if (nodeInstance.getNodeTemplateID().getLocalPart().equals(template.getId())) { - return nodeInstance; - } - } - } - return null; - } - - private boolean isConcatQuery(final String xPathQuery) { - final String testString = xPathQuery.trim(); - - if (!testString.startsWith("concat(")) { - return false; - } - - String functionContent = testString.substring("concat(".length()); - functionContent = functionContent.substring(0, functionContent.length() - 1); - - final String[] functionParts = functionContent.split(","); - - for (final String functionPart : functionParts) { - if (functionPart.startsWith("'") && !functionPart.endsWith("'")) { - return false; - } - } - - return true; - } - - /** - * Creates a DOM Document containing only the properties of the given ServiceTemplate which are - * declared. NodeInstance data is not considered as this method should be used to initialize the - * properties - * - * @param csarId the Id of the CSAR the serviceTemplate belongs to - * @param serviceTemplateId the Id of the serviceTemplate - * @return a DOM document containing elements representing properties of the serviceTemplate - */ - private Document createServiceInstancePropertiesFromServiceTemplate(final CSARID csarId, - final QName serviceTemplateId) { - - InstanceDataServiceImpl.logger.debug("Creating initial ServiceInstance Properties for " + serviceTemplateId - + " in " + csarId); - final TBoundaryDefinitions boundaryDefs = - InstanceDataServiceImpl.toscaEngineService.getBoundaryDefinitionsOfServiceTemplate(csarId, - serviceTemplateId); - - Element propertiesElement = null; - - if (boundaryDefs != null && boundaryDefs.getProperties() != null) { - - logger.debug("Properties found in Bounds for ST {}", serviceTemplateId); - - // Document emptyDoc = InstanceDataServiceImpl.emptyDocument(); - // - // Element createElementNS = - // emptyDoc.createElementNS("http://docs.oasis-open.org/tosca/ns/2011/12","Properties"); - // createElementNS.setAttribute("xmlns:tosca", - // "http://docs.oasis-open.org/tosca/ns/2011/12"); - // createElementNS.setPrefix("tosca"); - // - // emptyDoc.appendChild(createElementNS); - // - // Element properties = (Element) - // boundaryDefs.getProperties().getAny(); - // - // if(properties.getNamespaceURI() == null){ - // // set tosca namespace - // Node clonedNode = properties.cloneNode(true); - // Node renamedNode = - // properties.getOwnerDocument().renameNode(clonedNode, - // "http://docs.oasis-open.org/tosca/ns/2011/12", - // properties.getLocalName()); - // - // properties = (Element)renamedNode; - // properties.setAttribute("xmlns:tosca", - // "http://docs.oasis-open.org/tosca/ns/2011/12"); - // properties.setPrefix("tosca"); - // } - // - // properties = (Element) emptyDoc.importNode(properties, true); - // - // createElementNS.appendChild(properties); - // - // propertiesElement = (Element) emptyDoc.getFirstChild(); - propertiesElement = (Element) boundaryDefs.getProperties().getAny(); - - if (null == propertiesElement || null == propertiesElement.getOwnerDocument()) { - - logger.debug("null pointer ahead!"); - - // LOG.debug("No Properties found in Bounds for ST {} thus - // create blank ones", serviceTemplateId); - // Document emptyDoc = InstanceDataServiceImpl.emptyDocument(); - // Element createElementNS = - // emptyDoc.createElementNS("http://docs.oasis-open.org/tosca/ns/2011/12", - // "Properties"); - // createElementNS.setAttribute("xmlns:tosca", - // "http://docs.oasis-open.org/tosca/ns/2011/12"); - // createElementNS.setPrefix("tosca"); - // emptyDoc.appendChild(createElementNS); - // propertiesElement = (Element) emptyDoc.getFirstChild(); - } - } else { - - logger.debug("No Properties found in Bounds for ST {} thus create blank ones", serviceTemplateId); - final Document emptyDoc = InstanceDataServiceImpl.emptyDocument(); - final Element createElementNS = - emptyDoc.createElementNS("http://docs.oasis-open.org/tosca/ns/2011/12", "Properties"); - createElementNS.setAttribute("xmlns:tosca", "http://docs.oasis-open.org/tosca/ns/2011/12"); - createElementNS.setPrefix("tosca"); - emptyDoc.appendChild(createElementNS); - propertiesElement = (Element) emptyDoc.getFirstChild(); - - } - - return propertiesElement.getOwnerDocument(); - } - - @Override - @WebMethod(exclude = true) - public void setServiceInstanceProperties(final URI serviceInstanceID, - final Document properties) throws ReferenceNotFoundException { - - logger.info("setServiceInstanceProperties(): {}", serviceInstanceID); - - final List serviceInstances = getServiceInstances(serviceInstanceID, null, null); - - if (serviceInstances.size() != 1) { - throw new ReferenceNotFoundException("Couldn't find serviceInstance"); - } - - final ServiceInstance serviceInstance = serviceInstances.get(0); - - serviceInstance.setProperties(properties); - - this.siDAO.storeServiceInstance(serviceInstance); - - updateServiceInstanceProperties(serviceInstance); - } - - @Override - public String getServiceInstanceState(final URI serviceInstanceID) throws ReferenceNotFoundException { - - logger.info("getServiceInstanceState(): {}", serviceInstanceID); - - final List serviceInstances = getServiceInstances(serviceInstanceID, null, null); - - if (serviceInstances == null || serviceInstances.size() != 1) { - final String msg = - String.format("Failed to get State of ServiceInstance: '%s' - does it exist?", serviceInstances); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - return serviceInstances.get(0).getState().toString(); - } - - @Override - public void setServiceInstanceState(final URI serviceInstanceIDtoURI, - final String state) throws ReferenceNotFoundException { - - logger.info("setServiceInstanceState(): {}", serviceInstanceIDtoURI); - logger.info("setServiceInstanceState(): {}", state); - - final List serviceInstances = getServiceInstances(serviceInstanceIDtoURI, null, null); - - if (serviceInstances == null || serviceInstances.size() != 1) { - final String msg = - String.format("Failed to set State of NodeInstance: '%s' - does it exist?", serviceInstanceIDtoURI); - InstanceDataServiceImpl.logger.warn(msg); - throw new ReferenceNotFoundException(msg); - } - - this.siDAO.setState(serviceInstances.get(0), state); - - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/ToscaEngineProxy.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/ToscaEngineProxy.java deleted file mode 100644 index 545b10144..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/ToscaEngineProxy.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.csar.id.CSARID; - -/** - * This class is a proxy to the toscaEngineService In a later refactoring (after some discussions) - * some methods of this Proxy maybe directly ported to the ToscaEngine / ReferenceMapper - */ -// TODO: remove when no real logic is there anymore -public class ToscaEngineProxy { - - /** - * This method uses the toscaReferenceMapper of the given toscaEngineService to determine if the - * given csarID contains the serviceTemplate specified by serviceTemplateID - * - * @param toscaEngineService - * @param csarID - * @param serviceTemplateID - * - * @return true, if the given ServiceTemplate exists in the CSAR specified by the input parameter - */ - public static boolean doesServiceTemplateExist(final IToscaEngineService toscaEngineService, final CSARID csarID, - final QName serviceTemplateID) { - final List serviceTemplateIDsContainedInCSAR = - toscaEngineService.getToscaReferenceMapper().getServiceTemplateIDsContainedInCSAR(csarID); - - if (serviceTemplateIDsContainedInCSAR == null) { - return false; - } - - for (final QName serviceTemplateId : serviceTemplateIDsContainedInCSAR) { - if (serviceTemplateID.equals(serviceTemplateId)) { - return true; - } - } - - return serviceTemplateIDsContainedInCSAR.contains(serviceTemplateID); - - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/ZipManager.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/ZipManager.java deleted file mode 100644 index 33b509d4a..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/ZipManager.java +++ /dev/null @@ -1,291 +0,0 @@ -package org.opentosca.container.core.impl.service; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipFile; -import java.util.zip.ZipInputStream; -import java.util.zip.ZipOutputStream; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ZipManager { - - // Singleton Pattern - private static final ZipManager INSTANCE = new ZipManager(); - - - private ZipManager() {} - - public static ZipManager getInstance() { - return ZipManager.INSTANCE; - } - - private List getUnzippedFiles(final List files) { - - return files; - } - - - // Buffer for zipping/unzipping - private final static int BUFFER = 16384; - - private final static Logger LOG = LoggerFactory.getLogger(ZipManager.class); - - - /** - * Creates a new ZIP archive containing the contents of the specified directory.
    - * Existing archives with the same name will be overwritten automatically. - * - * @param directory - Absolute path to the folder which contents should be zipped, including sub - * folders. - * @param archive - Absolute path to ZIP archive. - */ - public File zip(final File directory, final File archive) { - - try { - ZipManager.LOG.info("Zipping {} ...", directory.getPath()); - final FileOutputStream dest = new FileOutputStream(archive); - final ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(dest)); - - ZipManager.zipDir(directory.getAbsolutePath(), directory, zos, archive.getAbsolutePath()); - - zos.flush(); - zos.close(); - ZipManager.LOG.info("Zipping completed."); - - } - catch (final FileNotFoundException e) { - ZipManager.LOG.error("Error", e); - return null; - } - catch (final IOException e) { - ZipManager.LOG.error("Error", e); - return null; - } - return archive; - - } - - /** - * Private helper class to recursively zip a folder and its contents. - * - * @param currentDir Current working directory. - * @param dirToZip Root directory that should be zipped. - * @param zos Already opened Output Stream. - * @param bCompress Whether to use ZipOutputStream.DEFLATED or ZipOutputStream.STORED. - */ - private static void zipDir(final String currentDir, final File dirToZip, final ZipOutputStream zos, - final String archive) throws FileNotFoundException, IOException { - - zos.setMethod(ZipOutputStream.DEFLATED); - - final byte data[] = new byte[ZipManager.BUFFER]; - final File archiveFile = new File(archive); - - // Switch to current directory and fetch its entries - final File cDir = new File(currentDir); - final String[] dirList = cDir.list(); - - final int length = dirList.length; - - if (length == 0) { - ZipManager.LOG.debug("ZIP: - It's a empty directory. Adding..."); - final String relPath = cDir.getCanonicalPath().substring(dirToZip.getCanonicalPath().length() + 1, - cDir.getCanonicalPath().length()); - final ZipEntry entry = new ZipEntry(relPath + "/"); - zos.putNextEntry(entry); - } - - // Loop through entries - for (int i = 0; i < length; i++) { - - ZipManager.LOG.debug("ZIP: Processing entry: '" + dirList[i] + "'"); - final File f = new File(cDir, dirList[i]); - - // Skip created archive if it's in the same directory - if (archiveFile.getAbsolutePath().equals(f.getAbsolutePath())) { - ZipManager.LOG.debug("ZIP: - Created archive found. Skipping..."); - continue; - } - - // Go through a sub directory recursively with new cDir - if (f.isDirectory()) { - ZipManager.LOG.debug("ZIP: - Directory found. Going into directory..."); - ZipManager.zipDir(f.getCanonicalPath(), dirToZip, zos, archive); - continue; - } - - // Generate relative path - final String relPath = - f.getCanonicalPath().substring(dirToZip.getCanonicalPath().length() + 1, f.getCanonicalPath().length()); - final ZipEntry entry = new ZipEntry(relPath); - - // Open input streams and write entry to zip - final FileInputStream fis = new FileInputStream(f.getCanonicalPath()); - final BufferedInputStream origin = new BufferedInputStream(fis, ZipManager.BUFFER); - zos.putNextEntry(entry); - ZipManager.LOG.debug("ZIP: - Adding file... "); - int count; - - while ((count = origin.read(data, 0, ZipManager.BUFFER)) != -1) { - zos.write(data, 0, count); - } - - ZipManager.LOG.debug("ZIP: File added!"); - origin.close(); - - } - } - - /** - * Unzips an archive to specified location. - * - * @param file Location of ZIP archive. - * @param toTarget Directory where contents of ZIP archive should be placed. - * @return - */ - public List unzip(final File file, final File toTarget) { - - final List contents = new ArrayList<>(); - FileInputStream fis = null; - BufferedInputStream bis = null; - ZipInputStream zis = null; - ZipFile zipFile = null; - - try { - ZipManager.LOG.info("Unzipping {} ...", file.getPath()); - // Open input streams - fis = new FileInputStream(file); - bis = new BufferedInputStream(fis); - zis = new ZipInputStream(bis); - - ZipEntry entry = zis.getNextEntry(); - - String entryTarget = ""; - // ZipFile zipFile; - int zipSize; - int entryIndex = 0; - - zipFile = new ZipFile(file); - zipSize = zipFile.size(); - - ZipManager.LOG.debug("UNZIP: Initialization complete."); - - // If targetDirectory doesn't exist, create it now. - if (!toTarget.exists()) { - toTarget.mkdirs(); - ZipManager.LOG.debug("UNZIP: Directory created: {}", toTarget.getName()); - } - - // Go through the archive entry by entry - while (entry != null) { - entryIndex++; - final String name = entry.getName(); - entryTarget = toTarget.getPath() + File.separator + name; - ZipManager.LOG.debug("UNZIP: Processing entry " + entryIndex + File.separator + zipSize + ": " + name); - - if (entry.isDirectory()) { - ZipManager.LOG.debug("UNZIP: - Creating directory... "); - new File(entryTarget).mkdirs(); - ZipManager.LOG.debug("UNZIP: - Directory created!"); - - } else { - - int count; - final byte data[] = new byte[ZipManager.BUFFER]; - - final File entryTargetFile = new File(entryTarget); - - contents.add(entryTargetFile); - - final File parent = entryTargetFile.getParentFile(); - if (parent != null) { - parent.mkdirs(); - } - - final FileOutputStream fos = new FileOutputStream(entryTargetFile); - final BufferedOutputStream dest = new BufferedOutputStream(fos, ZipManager.BUFFER); - // ZipManager.LOG.debug("UNZIP: - Decompressing file... "); - - while ((count = zis.read(data, 0, ZipManager.BUFFER)) != -1) { - dest.write(data, 0, count); - } - // dest.flush(); - dest.close(); - fos.close(); - - // ZipManager.LOG.debug("UNZIP: - File decompressed!"); - entryTarget = ""; - } - - entry = zis.getNextEntry(); - - } - - // zis.close(); - // zipFile.close(); - ZipManager.LOG.info("Unzipping completed!"); - - } - catch (final FileNotFoundException e) { - ZipManager.LOG.error("Error", e); - return null; - } - catch (final ZipException e) { - ZipManager.LOG.error("Error", e); - return null; - } - catch (final IOException e) { - ZipManager.LOG.error("Error", e); - return null; - } - finally { - if (zipFile != null) { - try { - zipFile.close(); - } - catch (final IOException e) { - ZipManager.LOG.error("", e); - } - } - - if (zis != null) { - try { - zis.close(); - } - catch (final IOException e) { - ZipManager.LOG.error("", e); - } - } - if (bis != null) { - try { - bis.close(); - } - catch (final IOException e) { - ZipManager.LOG.error("", e); - } - } - if (fis != null) { - try { - fis.close(); - } - catch (final IOException e) { - ZipManager.LOG.error("", e); - } - } - - } - - return this.getUnzippedFiles(contents); - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalCapabilityServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalCapabilityServiceImpl.java deleted file mode 100644 index 47db71c3b..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalCapabilityServiceImpl.java +++ /dev/null @@ -1,264 +0,0 @@ -package org.opentosca.container.core.impl.service.internal; - -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.persistence.EntityManager; - -import org.opentosca.container.core.model.capability.provider.ProviderType; -import org.opentosca.container.core.next.jpa.EntityManagerProvider; -import org.opentosca.container.core.service.internal.ICoreInternalCapabilityService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class stores, gets and deletes capabilities of different provider and provider types in/from - * a SQL database. The IAEngine needs this capabilities to decide if a Implementation Artifact - * should be deployed or not. - * - * @see ProviderType - * - * @TODO This is a first, prototypical implementation of ICoreInternalCapabilityService. In future, - * this implementation maybe also should be realized with Eclipse-JPA, like it is done in e.g. - * CoreInternalEndpointServiceImpl. - */ -public class CoreInternalCapabilityServiceImpl implements ICoreInternalCapabilityService { - - private final static Logger LOG = LoggerFactory.getLogger(CoreInternalCapabilityServiceImpl.class); - - private final String CapabilitiesTable = "CAPABILITIES"; - - private final EntityManager em; - - /** - * SQL queries for CapabilitiesTable: Creating the CapabilitiesTable, storing capabilities, getting - * already stored capabilities and deleting capabilities. - */ - private final String createCapabilitiesTable = "CREATE TABLE " + this.CapabilitiesTable - + " (Capability VARCHAR(1000) NOT NULL, ProviderName VARCHAR(1000) NOT NULL, ProviderType VARCHAR(1000) NOT NULL)"; - private final String storeCapabilities = - "INSERT INTO " + this.CapabilitiesTable + " (Capability, ProviderName, ProviderType) VALUES (?, ?, ?)"; - private final String getCapabilitiesByType = - "SELECT Capability, ProviderName FROM " + this.CapabilitiesTable + " WHERE ProviderType = ?"; - private final String getCapabilitiesByName = - "SELECT Capability FROM " + this.CapabilitiesTable + " WHERE ProviderName = ? AND ProviderType = ?"; - private final String deleteCapabilities = "DELETE FROM " + this.CapabilitiesTable + " WHERE ProviderName = ?"; - - - /** - * Creates database connection and CapabilitiesTable. - */ - public CoreInternalCapabilityServiceImpl() { - this.em = EntityManagerProvider.createEntityManager(); - this.createCapabilitiesTable(); - } - - /** - * Creates CapabilitiesTable if it not already exists. - */ - private void createCapabilitiesTable() { - - Statement stmt = null; - - try { - CoreInternalCapabilityServiceImpl.LOG.debug("Checking if table \"{}\" already exists...", - this.CapabilitiesTable); - - this.em.getTransaction().begin(); - final Connection conn = this.em.unwrap(Connection.class); - - final DatabaseMetaData metaData = conn.getMetaData(); - final ResultSet rs = metaData.getTables(null, null, this.CapabilitiesTable, null); - - if (!rs.next()) { - CoreInternalCapabilityServiceImpl.LOG.debug("Table \"{}\" did not exist. Creating...", - this.CapabilitiesTable); - stmt = conn.createStatement(); - stmt.executeUpdate(this.createCapabilitiesTable); - stmt.close(); - CoreInternalCapabilityServiceImpl.LOG.debug("Table \"{}\" successfully created.", - this.CapabilitiesTable); - } - - this.em.getTransaction().commit(); - - } - catch (final SQLException exc) { - CoreInternalCapabilityServiceImpl.LOG.error("Database error - can't create CapabilitiesTable.", exc); - } - - } - - @Override - /** - * {@inheritDoc} - */ - public void storeCapabilities(final List capabilities, final String providerName, - final ProviderType providerType) { - - PreparedStatement pstmt = null; - - try { - - CoreInternalCapabilityServiceImpl.LOG.debug("Storing \"{}\" capabilities of \"{}\" ...", providerType, - providerName); - - this.em.getTransaction().begin(); - final Connection conn = this.em.unwrap(Connection.class); - - pstmt = conn.prepareStatement(this.storeCapabilities); - - for (final String capability : capabilities) { - - pstmt.setString(1, capability); - pstmt.setString(2, providerName); - pstmt.setString(3, providerType.name()); - pstmt.executeUpdate(); - } - - pstmt.close(); - - this.em.getTransaction().commit(); - - } - catch (final SQLException e) { - CoreInternalCapabilityServiceImpl.LOG.error("Database error - can't store \"{}\" capabilities in database.", - providerType, e); - } - } - - @Override - /** - * {@inheritDoc} - */ - public Map> getCapabilities(final ProviderType providerType) { - - PreparedStatement pstmt = null; - ResultSet queryRes = null; - - CoreInternalCapabilityServiceImpl.LOG.debug("Getting \"{}\" capabilities...", providerType); - - try { - - this.em.getTransaction().begin(); - final Connection conn = this.em.unwrap(Connection.class); - - pstmt = conn.prepareStatement(this.getCapabilitiesByType); - pstmt.setString(1, providerType.name()); - queryRes = pstmt.executeQuery(); - - final Map> capsMap = new HashMap<>(); - - // Fill map with Providers and their capabilities - while (queryRes.next()) { - - if (capsMap.containsKey(queryRes.getString(2))) { - capsMap.get(queryRes.getString(2)).add(queryRes.getString(1)); - } else { - capsMap.put(queryRes.getString(2), new ArrayList()); - capsMap.get(queryRes.getString(2)).add(queryRes.getString(1)); - } - } - - queryRes.close(); - pstmt.close(); - - CoreInternalCapabilityServiceImpl.LOG.debug("Getting \"{}\" capabilities successfully completed.", - providerType); - - this.em.getTransaction().commit(); - - return capsMap; - - } - catch (final SQLException e) { - CoreInternalCapabilityServiceImpl.LOG.error("Database error - can't get \"{}\" capabilities from database.", - providerType, e); - return null; - } - } - - @Override - /** - * {@inheritDoc} - */ - public List getCapabilities(final String providerName, final ProviderType providerType) { - - PreparedStatement pstmt = null; - ResultSet queryRes = null; - - CoreInternalCapabilityServiceImpl.LOG.debug("Getting \"{}\" capabilities of \"{}\"...", providerType, - providerName); - - try { - - this.em.getTransaction().begin(); - final Connection conn = this.em.unwrap(Connection.class); - - pstmt = conn.prepareStatement(this.getCapabilitiesByName); - pstmt.setString(1, providerName); - pstmt.setString(2, providerType.name()); - queryRes = pstmt.executeQuery(); - - final List capabilities = new ArrayList<>(); - - // Fill List with capabilities - while (queryRes.next()) { - capabilities.add(queryRes.getString(1)); - } - - queryRes.close(); - pstmt.close(); - - CoreInternalCapabilityServiceImpl.LOG.debug("Getting \"{}\" capabilities of \"{}\" successfully completed.", - providerType, providerName); - - this.em.getTransaction().commit(); - - return capabilities; - - } - catch (final SQLException e) { - CoreInternalCapabilityServiceImpl.LOG.error("Database error - can't get capabilities of \"{}\" from database.", - providerName, e); - return null; - } - } - - @Override - /** - * {@inheritDoc} - */ - public void deleteCapabilities(final String providerName) { - - PreparedStatement pstmt = null; - - try { - - CoreInternalCapabilityServiceImpl.LOG.debug("Deleting capabilities of \"{}\" ...", providerName); - - this.em.getTransaction().begin(); - final Connection conn = this.em.unwrap(Connection.class); - - pstmt = conn.prepareStatement(this.deleteCapabilities); - pstmt.setString(1, providerName); - pstmt.executeUpdate(); - pstmt.close(); - - this.em.getTransaction().commit(); - - } - catch (final SQLException e) { - CoreInternalCapabilityServiceImpl.LOG.error("Database error - can't delete capabilities of \"{}\" from database.", - providerName, e); - } - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalCredentialsServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalCredentialsServiceImpl.java deleted file mode 100644 index 91b0da46f..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalCredentialsServiceImpl.java +++ /dev/null @@ -1,499 +0,0 @@ -package org.opentosca.container.core.impl.service.internal; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.impl.service.internal.credentials.CredentialsJPAStore; -import org.opentosca.container.core.model.credentials.Credentials; -import org.opentosca.container.core.service.internal.ICoreInternalCredentialsService; -import org.opentosca.container.core.service.internal.ICoreInternalFileStorageProviderService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Provides a store and management functionalities for the credentials of the storage providers. - * - * Also has a connection to the storage providers: Credentials can be set / injected in a available - * storage provider. If some conditions are fulfilled (see {@link #storeCredentials(Credentials)} a - * stored credentials will be automatically set in the appropriate storage provider. Otherwise it - * can be done manually by using {@link #setCredentialsInStorageProvider(String, String)}. - * Credentials can be also stored if the appropriate storage provider is not available. Currently a - * credentials consists of an identity and a key. You can get the name of the identity and key of a - * certain storage provider by using {@link #getCredentialsIdentityName(String)} and - * {@link #getCredentialsKeyName(String)}. For example, for AWS S3 the identity is the Access Key - * and key is the Secret Access Key. - * - * Most of the methods of the credentials service are also accessible via OSGi console commands. - * - * @see ICoreInternalFileStorageProviderService - * - * @todo In future maybe other components needs also a store for credentials. Then we should extend - * the Credentials Service (and its model) to a central Credentials Service of OpenTOSCA. - */ -public class CoreInternalCredentialsServiceImpl implements ICoreInternalCredentialsService { - - private final static Logger LOG = LoggerFactory.getLogger(CoreInternalCredentialsServiceImpl.class); - - /** - * Bound / available file storage providers. - */ - private static final Map STORAGE_PROVIDERS = - Collections.synchronizedMap(new HashMap()); - - private final CredentialsJPAStore JPA_STORE = new CredentialsJPAStore(); - - - @Override - public long storeCredentials(final Credentials credentials) throws UserException { - - final boolean isValid = this.checkCredentials(credentials); - - if (!isValid) { - throw new UserException( - "Storing credentials not possible, because some required data are missing in credentials."); - } - - final String storageProviderID = credentials.getStorageProviderID(); - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - // we can only check if storage provider needs credentials if it is - // available - if (storageProvider != null) { - - final boolean needsCredentials = storageProvider.needsCredentials(); - - if (!needsCredentials) { - throw new UserException("Credentials can't be stored, because available storage provider \"" - + storageProviderID + "\" needs no credentials."); - } - - } - - final long credentialsID = this.JPA_STORE.storeCredentials(credentials); - - if (storageProvider != null) { - - if (storageProvider.getCredentialsID() != null) { - CoreInternalCredentialsServiceImpl.LOG.debug("Credentials \"{}\" will not be set in storage provider \"{}\", because it has already credentials.", - credentialsID, storageProviderID); - } else { - - try { - this.setCredentialsInStorageProvider(credentials); - } - catch (final SystemException exc) { - CoreInternalCredentialsServiceImpl.LOG.warn("A System Exception occured.", exc); - } - - } - - } else { - - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" is not available, so credentials \"{}\" can't be set.", - storageProviderID, credentialsID); - - } - - return credentialsID; - - } - - /** - * Checks the {@code credentials} for missing required data.
    - * In a credentials the storage provider ID, the identity and the key must be set. A description is - * optional. - * - * @param credentials to check. - * @return {@true} if {@code credentials} are valid, otherwise {@code false} . - */ - private boolean checkCredentials(final Credentials credentials) { - CoreInternalCredentialsServiceImpl.LOG.debug("Checking for missing data in given credentials...", - credentials.getStorageProviderID()); - - final String storageProviderID = credentials.getStorageProviderID(); - final String identity = credentials.getIdentity(); - final String key = credentials.getKey(); - - boolean noErrorsOccured = true; - - if (storageProviderID == null) { - CoreInternalCredentialsServiceImpl.LOG.warn("Storage Provider ID is missing in credentials."); - noErrorsOccured = false; - } - - if (identity == null) { - CoreInternalCredentialsServiceImpl.LOG.warn("Identity is missing in credentials."); - noErrorsOccured = false; - } - - if (key == null) { - CoreInternalCredentialsServiceImpl.LOG.warn("Key is missing in credentials."); - noErrorsOccured = false; - } - - if (noErrorsOccured) { - CoreInternalCredentialsServiceImpl.LOG.debug("Credentials have no missing data."); - } else { - CoreInternalCredentialsServiceImpl.LOG.warn("Credentials have missing data."); - } - - return noErrorsOccured; - - } - - @Override - public Credentials getCredentials(final long credentialsID) throws UserException { - final Credentials credentials = this.JPA_STORE.getCredentials(credentialsID); - return credentials; - } - - @Override - public Set getAllCredentialsOfStorageProvider(final String storageProviderID) { - - final Set allCredentialsOfStorageProvider = - this.JPA_STORE.getAllCredentialsOfStorageProvider(storageProviderID); - return allCredentialsOfStorageProvider; - - } - - @Override - public Set getCredentialsIDs() { - - final Set credentialsIDs = this.JPA_STORE.getCredentialsIDs(); - - return credentialsIDs; - - } - - @Override - public Set getAllCredentials() { - - final Set allCredentials = this.JPA_STORE.getAllCredentials(); - - return allCredentials; - - } - - @Override - public void deleteCredentials(final long credentialsID) throws UserException { - - final Credentials credentials = this.JPA_STORE.getCredentials(credentialsID); - - final String storageProviderID = credentials.getStorageProviderID(); - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider != null) { - if (storageProvider.getCredentialsID() != null - && storageProvider.getCredentialsID().equals(credentialsID)) { - storageProvider.deleteCredentials(); - CoreInternalCredentialsServiceImpl.LOG.debug("Credentials were deleted in storage provider \"{}\".", - storageProviderID); - } else { - CoreInternalCredentialsServiceImpl.LOG.debug("No credentials have to be deleted in storage provider \"{}\".", - storageProviderID); - } - } else { - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" is not available, so no credentials have to be deleted.", - storageProviderID); - } - - this.JPA_STORE.deleteCredentials(credentialsID); - - } - - @Override - public void deleteAllCredentials() { - - CoreInternalCredentialsServiceImpl.LOG.debug("Deleting credentials in storage providers..."); - - synchronized (this.JPA_STORE) { - for (final ICoreInternalFileStorageProviderService storageProvider : CoreInternalCredentialsServiceImpl.STORAGE_PROVIDERS.values()) { - storageProvider.deleteCredentials(); - } - } - - CoreInternalCredentialsServiceImpl.LOG.debug("Deleting credentials in storage providers completed."); - - this.JPA_STORE.deleteAllCredentials(); - - } - - @Override - public void setCredentialsInStorageProvider(final long credentialsID) throws UserException, SystemException { - final Credentials credentials = this.getCredentials(credentialsID); - this.setCredentialsInStorageProvider(credentials); - } - - /** - * Sets / injects {@code credentials} in appropriate storage provider. - * - * @throws SystemException if storage provider to set is not available. - * @throws UserException if storage provider to set needs no credentials. - * - */ - private void setCredentialsInStorageProvider(final Credentials credentials) throws SystemException, UserException { - - final String storageProviderID = credentials.getStorageProviderID(); - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider == null) { - throw new SystemException( - "Can set credentials in storage provider \"" + storageProviderID + "\", because it is not available."); - } - - if (!storageProvider.needsCredentials()) { - throw new UserException("Credentials were not set in storage provider \"" + storageProviderID - + "\", because it needs no credentials."); - } - - CoreInternalCredentialsServiceImpl.LOG.debug("Setting credentials in storage provider \"{}\"...", - storageProviderID); - - storageProvider.setCredentials(credentials); - - CoreInternalCredentialsServiceImpl.LOG.debug("Setting credentials in storage provider \"{}\" completed.", - storageProviderID); - - } - - @Override - public void deleteCredentialsInStorageProvider(final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider == null) { - throw new SystemException("No credentials can be deleted, because storage provider \"" + storageProviderID - + "\" is not available."); - } - - if (storageProvider.getCredentialsID() != null) { - CoreInternalCredentialsServiceImpl.LOG.debug("Deleting credentials in storage provider \"{}\"...", - storageProviderID); - storageProvider.deleteCredentials(); - CoreInternalCredentialsServiceImpl.LOG.debug("Deleting credentials in storage provider \"{}\" completed.", - storageProviderID); - } else { - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" has currently no credentials.", - storageProviderID); - } - - } - - @Override - public boolean hasStorageProviderCredentials(final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider == null) { - throw new SystemException("Can't check if storage provider \"" + storageProviderID - + "\" has credentials, because storage provider is not available."); - } - - CoreInternalCredentialsServiceImpl.LOG.debug("Checking if storage provider \"{}\" has credentials...", - storageProviderID); - - if (storageProvider.getCredentialsID() != null) { - - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" has credentials.", storageProviderID); - return true; - - } - - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" has no credentials.", storageProviderID); - return false; - } - - @Override - public boolean hasStorageProviderCredentials(final long credentialsID) throws UserException { - - final Credentials credentials = this.getCredentials(credentialsID); - final String storageProviderID = credentials.getStorageProviderID(); - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider == null) { - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" is not available, so credentials \"{}\" are not set.", - storageProviderID, credentialsID); - return false; - } - - CoreInternalCredentialsServiceImpl.LOG.debug("Checking if credentials \"{}\" are set in storage provider \"{}\"...", - credentialsID, storageProviderID); - - final Long storageProviderCredentialsID = storageProvider.getCredentialsID(); - - if (storageProviderCredentialsID != null && storageProviderCredentialsID.equals(credentialsID)) { - CoreInternalCredentialsServiceImpl.LOG.debug("Credentials \"{}\" are set in storage provider \"{}\".", - credentialsID, storageProviderID); - return true; - } - - CoreInternalCredentialsServiceImpl.LOG.debug("Credentials \"{}\" are not set in storage provider \"{}\".", - credentialsID, storageProviderID); - - return false; - - } - - @Override - public boolean needsStorageProviderCredentials(final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider == null) { - throw new SystemException("Can't check if storage provider \"" + storageProviderID - + "\" needs credentials, because it is not available."); - } - - final boolean needsCredentials = storageProvider.needsCredentials(); - - if (needsCredentials) { - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" needs credentials.", - storageProviderID); - } else { - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" needs no credentials.", - storageProviderID); - } - - return needsCredentials; - - } - - @Override - public String getCredentialsIdentityName(final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider == null) { - throw new SystemException("Can't get credentials identity name of storage provider \"" + storageProviderID - + "\", because it is not available."); - } - - final String identityName = storageProvider.getCredentialsIdentityName(); - - return identityName; - - } - - @Override - public String getCredentialsKeyName(final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider == null) { - throw new SystemException("Can't get credentials key name of storage provider \"" + storageProviderID - + "\", because it is not available."); - } - - final String keyName = storageProvider.getCredentialsKeyName(); - - return keyName; - - } - - @Override - public Set getStorageProviders() { - - Set storageProviderIDs = null; - - synchronized (CoreInternalCredentialsServiceImpl.STORAGE_PROVIDERS) { - storageProviderIDs = CoreInternalCredentialsServiceImpl.STORAGE_PROVIDERS.keySet(); - } - return storageProviderIDs; - - } - - /** - * @param storageProviderID of storage provider. - * @return Storage provider {@code storageProviderID}. If it's not available {@code null}. - */ - private ICoreInternalFileStorageProviderService getStorageProvider(final String storageProviderID) { - - ICoreInternalFileStorageProviderService storageProvider; - - synchronized (CoreInternalCredentialsServiceImpl.STORAGE_PROVIDERS) { - storageProvider = CoreInternalCredentialsServiceImpl.STORAGE_PROVIDERS.get(storageProviderID); - } - - if (storageProvider != null) { - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" is available.", storageProviderID); - } else { - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" is not available.", - storageProviderID); - } - - return storageProvider; - - } - - /** - * Binds a storage provider.
    - * If exactly one credentials for a storage provider is stored these credentials will be directly - * set in the storage provider after binding. - * - * @param storageProvider to bind - */ - protected void bindCoreInternalFileStorageProviderService(final ICoreInternalFileStorageProviderService storageProvider) { - if (storageProvider != null) { - - CoreInternalCredentialsServiceImpl.STORAGE_PROVIDERS.put(storageProvider.getStorageProviderID(), - storageProvider); - - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" ({}) bound.", - storageProvider.getStorageProviderID(), - storageProvider.getStorageProviderName()); - - final String storageProviderID = storageProvider.getStorageProviderID(); - - final Set credentialsOfStorageProvider = - this.getAllCredentialsOfStorageProvider(storageProviderID); - - if (credentialsOfStorageProvider.size() == 1) { - CoreInternalCredentialsServiceImpl.LOG.debug("One credentials is stored for storage provider \"{}\". Thus, we will set it now in storage provider.", - storageProviderID); - // always one loop iteration - for (final Credentials credentials : credentialsOfStorageProvider) { - try { - this.setCredentialsInStorageProvider(credentials); - } - catch (final SystemException exc) { - CoreInternalCredentialsServiceImpl.LOG.warn("A System Exception occured.", exc); - } - catch (final UserException exc) { - CoreInternalCredentialsServiceImpl.LOG.warn("An User Exception occured.", exc); - } - } - } - - } else { - CoreInternalCredentialsServiceImpl.LOG.warn("Binding a storage provider failed."); - } - } - - /** - * Unbinds a storage provider.
    - * Deleting credentials in storage provider is not necessary on unbinding, because a unbound storage - * provider has automatically lost is set / injected credentials. - * - * @param storageProvider to unbind - */ - protected void unbindCoreInternalFileStorageProviderService(final ICoreInternalFileStorageProviderService storageProvider) { - if (storageProvider != null) { - final String storageProviderID = storageProvider.getStorageProviderID(); - CoreInternalCredentialsServiceImpl.STORAGE_PROVIDERS.remove(storageProviderID); - CoreInternalCredentialsServiceImpl.LOG.debug("Storage provider \"{}\" ({}) unbound.", - storageProvider.getStorageProviderID(), - storageProvider.getStorageProviderName()); - } else { - CoreInternalCredentialsServiceImpl.LOG.warn("Unbinding a storage provider failed."); - } - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalDeploymentTrackerServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalDeploymentTrackerServiceImpl.java deleted file mode 100644 index 5ad1347be..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalDeploymentTrackerServiceImpl.java +++ /dev/null @@ -1,408 +0,0 @@ -package org.opentosca.container.core.impl.service.internal; - -import java.util.ArrayList; -import java.util.List; - -import javax.persistence.EntityManager; -import javax.persistence.Query; - -import org.eclipse.osgi.framework.console.CommandProvider; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.deployment.ia.IADeploymentInfo; -import org.opentosca.container.core.model.deployment.ia.IADeploymentState; -import org.opentosca.container.core.model.deployment.plan.PlanDeploymentInfo; -import org.opentosca.container.core.model.deployment.plan.PlanDeploymentState; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessInfo; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; -import org.opentosca.container.core.next.jpa.EntityManagerProvider; -import org.opentosca.container.core.service.internal.ICoreInternalDeploymentTrackerService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Tracks the deployment process of CSAR files, Implementations Artifacts and Plans by providing - * methods for storing and getting it deployment states. It is used by OpenTOSCA Control to allowing - * only a subset of all provided operations in a certain deployment state of a CSAR file. - */ -public class CoreInternalDeploymentTrackerServiceImpl implements ICoreInternalDeploymentTrackerService, - CommandProvider { - - private final static Logger LOG = LoggerFactory.getLogger(CoreInternalDeploymentTrackerServiceImpl.class); - - private EntityManager em; - - - public CoreInternalDeploymentTrackerServiceImpl() {} - - /** - * Initializes JPA. - */ - private void init() { - if (this.em == null) { - this.em = EntityManagerProvider.createEntityManager(); - } - } - - /** - * This method is called when the garbage collector destroys the class. We will then manually close - * the EntityManager / Factory and pass control back. - */ - @Override - protected void finalize() throws Throwable { - this.em.close(); - super.finalize(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean storeDeploymentState(final CSARID csarID, final DeploymentProcessState deploymentState) { - this.init(); - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Storing deployment state {} for CSAR \"{}\"...", - deploymentState, csarID); - this.em.getTransaction().begin(); - // check if deployment state for this CSAR already exists - final DeploymentProcessInfo deploymentInfo = this.getDeploymentProcessInfo(csarID); - if (deploymentInfo != null) { - // CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Deployment - // state for CSAR \"{}\" already exists. Existent state will be - // overwritten!", csarID); - deploymentInfo.setDeploymentProcessState(deploymentState); - this.em.persist(deploymentInfo); - } else { - // CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Deployment - // state for CSAR \"{}\" did not already exist.", csarID); - this.em.persist(new DeploymentProcessInfo(csarID, deploymentState)); - } - this.em.getTransaction().commit(); - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Storing deployment state {} for CSAR \"{}\" completed.", - deploymentState, csarID); - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public DeploymentProcessState getDeploymentState(final CSARID csarID) { - - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Retrieving deployment state for CSAR \"{}\"...", csarID); - this.init(); - final DeploymentProcessInfo info = this.getDeploymentProcessInfo(csarID); - - DeploymentProcessState deploymentState = null; - - if (info == null) { - CoreInternalDeploymentTrackerServiceImpl.LOG.error("No deployment state for CSAR \"{}\" stored!", csarID); - } else { - deploymentState = info.getDeploymentProcessState(); - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Deployment state of CSAR \"{}\": {}.", csarID, - deploymentState); - } - - return deploymentState; - - } - - @Override - public void deleteDeploymentState(final CSARID csarID) { - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Retrieving DeploymentProcessInfo for {}", csarID); - final DeploymentProcessInfo info = this.getDeploymentProcessInfo(csarID); - if (info != null) { - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Beginning Transaction for removing DeploymentProcessInfo {}", - csarID); - this.em.getTransaction().begin(); - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Removing DeploymentProcessInfo {}", csarID); - - final Query queryRestEndpoints = - this.em.createQuery("DELETE FROM DeploymentProcessInfo e where e.csarID = :csarID"); - queryRestEndpoints.setParameter("csarID", csarID); - - // this.em.remove(info); - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Commiting Transaction"); - this.em.getTransaction().commit(); - } - } - - /** - * Gets the deployment process information of a CSAR file. - * - * @param csarID that uniquely identifies a CSAR file - * @return the deployment process information, if the CSAR with csarID exists, - * otherwise null - */ - private DeploymentProcessInfo getDeploymentProcessInfo(final CSARID csarID) { - - this.init(); - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Retrieving deployment process info for CSAR \"{}\"...", - csarID); - final Query getDeploymentProcessInfo = - this.em.createNamedQuery(DeploymentProcessInfo.getDeploymentProcessInfoByCSARID).setParameter("csarID", - csarID); - - @SuppressWarnings("unchecked") - final List results = getDeploymentProcessInfo.getResultList(); - - if (results.isEmpty()) { - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("No deployment process info for CSAR \"{}\" stored.", - csarID); - return null; - } else { - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Deployment process info for CSAR \"{}\" exists.", - csarID); - return results.get(0); - } - - } - - /** - * {@inheritDoc} - */ - @Override - public boolean storeIADeploymentInfo(IADeploymentInfo iaDeploymentInfo) { - - this.init(); - - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Storing deployment state {} for IA \"{}\" of CSAR \"{}\"...", - new Object[] {iaDeploymentInfo.getDeploymentState(), - iaDeploymentInfo.getRelPath(), - iaDeploymentInfo.getCSARID()}); - this.em.getTransaction().begin(); - - // check if deployment info for this IA already exists - final IADeploymentInfo storedIA = - this.getIADeploymentInfo(iaDeploymentInfo.getCSARID(), iaDeploymentInfo.getRelPath()); - - // deployment info already exists - if (storedIA != null) { - - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("IA deployment info for IA \"{}\" of CSAR \"{}\" already exists. Existent deployment info will be overwritten!", - iaDeploymentInfo.getRelPath(), - iaDeploymentInfo.getCSARID()); - - final IADeploymentState storedIADeployState = storedIA.getDeploymentState(); - final IADeploymentState newIADeployState = iaDeploymentInfo.getDeploymentState(); - - // if IA is deployed and will be now undeployed (deployment state - // change to IA_UNDEPLOYING) reset the attempt counter to 0 - if (storedIADeployState.equals(IADeploymentState.IA_DEPLOYED) - && newIADeployState.equals(IADeploymentState.IA_UNDEPLOYING)) { - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Deployed IA \"{}\" of CSAR \"{}\" is now undeploying. Attempt count will be reseted.", - iaDeploymentInfo.getRelPath(), - iaDeploymentInfo.getCSARID()); - storedIA.setAttempt(0); - } - - storedIA.setDeploymentState(newIADeployState); - iaDeploymentInfo = storedIA; - - } - - // if IA is now deploying or undeploying (deployment state change to - // IA_DEPLOYING / IA_UNDEPLOYING) increment attempt counter - if (iaDeploymentInfo.getDeploymentState().equals(IADeploymentState.IA_DEPLOYING) - || iaDeploymentInfo.getDeploymentState().equals(IADeploymentState.IA_UNDEPLOYING)) { - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("IA \"{}\" of CSAR \"{}\" is now deploying / undeploying. Increase attempt count.", - iaDeploymentInfo.getRelPath(), - iaDeploymentInfo.getCSARID()); - iaDeploymentInfo.setAttempt(iaDeploymentInfo.getAttempt() + 1); - } - - this.em.persist(iaDeploymentInfo); - this.em.getTransaction().commit(); - - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Storing deployment state {} for IA \"{}\" of CSAR \"{}\" completed.", - new Object[] {iaDeploymentInfo.getDeploymentState(), - iaDeploymentInfo.getRelPath(), - iaDeploymentInfo.getCSARID()}); - - return true; - - } - - /** - * {@inheritDoc} - */ - @Override - public IADeploymentInfo getIADeploymentInfo(final CSARID csarID, final String iaRelPath) { - this.init(); - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Retrieving IA deployment info for IA \"{}\" of CSAR \"{}\"...", - iaRelPath, csarID); - final Query getIADeploymentInfo = - this.em.createNamedQuery(IADeploymentInfo.getIADeploymentInfoByCSARIDAndRelPath) - .setParameter("iaRelPath", iaRelPath).setParameter("csarID", csarID); - @SuppressWarnings("unchecked") - final List results = getIADeploymentInfo.getResultList(); - if (results.isEmpty()) { - CoreInternalDeploymentTrackerServiceImpl.LOG.error("No IA deployment info for IA \"{}\" of CSAR \"{}\" stored.", - iaRelPath, csarID); - return null; - } else { - CoreInternalDeploymentTrackerServiceImpl.LOG.info("IA deployment info for IA \"{}\" of CSAR \"{}\" exists.", - iaRelPath, csarID); - return results.get(0); - } - - } - - /** - * {@inheritDoc} - */ - @Override - public List getIADeploymentInfos(final CSARID csarID) { - this.init(); - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Retrieving all IA deployment infos of CSAR \"{}\"...", - csarID); - final ArrayList results = new ArrayList<>(); - final Query getIADeploymentInfo = - this.em.createNamedQuery(IADeploymentInfo.getIADeploymentInfoByCSARID).setParameter("csarID", csarID); - @SuppressWarnings("unchecked") - final List queryResults = getIADeploymentInfo.getResultList(); - for (final IADeploymentInfo ia : queryResults) { - results.add(ia); - } - CoreInternalDeploymentTrackerServiceImpl.LOG.info("IA deployment infos of {} IA(s) of CSAR \"{}\" stored.", - results.size(), csarID); - return results; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean storePlanDeploymentInfo(PlanDeploymentInfo planDeploymentInfo) { - this.init(); - - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Storing deployment state {} for Plan \"{}\" of CSAR \"{}\"...", - new Object[] {planDeploymentInfo.getDeploymentState(), - planDeploymentInfo.getRelPath(), - planDeploymentInfo.getCSARID()}); - - this.em.getTransaction().begin(); - - // check if deployment info for this Plan already exists - final PlanDeploymentInfo storedPlan = - this.getPlanDeploymentInfo(planDeploymentInfo.getCSARID(), planDeploymentInfo.getRelPath()); - - // deployment info already exists - if (storedPlan != null) { - - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Plan deployment info for Plan \"{}\" of CSAR \"{}\" already exists. Existent deployment info will be overwritten!", - planDeploymentInfo.getRelPath(), - planDeploymentInfo.getCSARID()); - - final PlanDeploymentState storedPlanDeployState = storedPlan.getDeploymentState(); - final PlanDeploymentState newPlanDeployState = planDeploymentInfo.getDeploymentState(); - - // if Plan is deployed and will be now undeployed (deployment state - // change to PLAN_UNDEPLOYING) reset the attempt counter to 0 - if (storedPlanDeployState.equals(PlanDeploymentState.PLAN_DEPLOYED) - && newPlanDeployState.equals(PlanDeploymentState.PLAN_UNDEPLOYING)) { - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Deployed Plan \"{}\" of CSAR \"{}\" is now undeploying. Attempt count will be reseted.", - planDeploymentInfo.getRelPath(), - planDeploymentInfo.getCSARID()); - storedPlan.setAttempt(0); - } - - storedPlan.setDeploymentState(newPlanDeployState); - planDeploymentInfo = storedPlan; - } - - // if Plan is now deploying or undeploying (deployment state change to - // PLAN_DEPLOYING / PLAN_UNDEPLOYING) increment attempt counter - if (planDeploymentInfo.getDeploymentState().equals(PlanDeploymentState.PLAN_DEPLOYING) - || planDeploymentInfo.getDeploymentState().equals(PlanDeploymentState.PLAN_UNDEPLOYING)) { - CoreInternalDeploymentTrackerServiceImpl.LOG.debug("Plan \"{}\" of CSAR \"{}\" is now deploying / undeploying. Increase attempt count.", - planDeploymentInfo.getRelPath(), - planDeploymentInfo.getCSARID()); - planDeploymentInfo.setAttempt(planDeploymentInfo.getAttempt() + 1); - } - - this.em.persist(planDeploymentInfo); - this.em.getTransaction().commit(); - - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Storing deployment state {} for Plan \"{}\" of CSAR \"{}\" completed.", - new Object[] {planDeploymentInfo.getDeploymentState(), - planDeploymentInfo.getRelPath(), - planDeploymentInfo.getCSARID()}); - - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public PlanDeploymentInfo getPlanDeploymentInfo(final CSARID csarID, final String planRelPath) { - this.init(); - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Retrieving Plan deployment info for Plan \"{}\" of CSAR \"{}\"...", - planRelPath, csarID); - final Query getPlanDeploymentInfo = - this.em.createNamedQuery(PlanDeploymentInfo.getPlanDeploymentInfoByCSARIDAndRelPath) - .setParameter("csarID", csarID).setParameter("planRelPath", planRelPath); - @SuppressWarnings("unchecked") - final List results = getPlanDeploymentInfo.getResultList(); - if (results.isEmpty()) { - CoreInternalDeploymentTrackerServiceImpl.LOG.error("No Plan deployment info for Plan \"{}\" of CSAR \"{}\" stored.", - planRelPath, csarID); - return null; - } else { - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Plan deployment info for Plan \"{}\" of CSAR \"{}\" exists.", - planRelPath, csarID); - return results.get(0); - } - } - - /** - * {@inheritDoc} - */ - @Override - public List getPlanDeploymentInfos(final CSARID csarID) { - this.init(); - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Retrieving all Plan deployment infos of CSAR \"{}\"...", - csarID); - final ArrayList results = new ArrayList<>(); - final Query getIADeploymentInfo = - this.em.createNamedQuery(PlanDeploymentInfo.getPlanDeploymentInfoByCSARID).setParameter("csarID", csarID); - @SuppressWarnings("unchecked") - final List queryResults = getIADeploymentInfo.getResultList(); - for (final PlanDeploymentInfo ia : queryResults) { - results.add(ia); - } - CoreInternalDeploymentTrackerServiceImpl.LOG.info("Plan deployment infos of {} Plan(s) of CSAR \"{}\" stored.", - results.size(), csarID); - return results; - } - - /** - * Prints the available OSGi commands. - */ - @Override - public String getHelp() { - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean storeIADeploymentInfo(final CSARID csarID, final String iaRelPath, - final IADeploymentState iaDeploymentState) { - final IADeploymentInfo iaDeploymentInfo = new IADeploymentInfo(csarID, iaRelPath, iaDeploymentState); - this.storeIADeploymentInfo(iaDeploymentInfo); - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean storePlanDeploymentInfo(final CSARID csarID, final String planRelPath, - final PlanDeploymentState planDeploymentState) { - final PlanDeploymentInfo planDeploymentInfo = new PlanDeploymentInfo(csarID, planRelPath, planDeploymentState); - this.storePlanDeploymentInfo(planDeploymentInfo); - return true; - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalEndpointServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalEndpointServiceImpl.java deleted file mode 100644 index 16243b40a..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalEndpointServiceImpl.java +++ /dev/null @@ -1,455 +0,0 @@ -package org.opentosca.container.core.impl.service.internal; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; - -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.Query; -import javax.xml.namespace.QName; - -import org.eclipse.osgi.framework.console.CommandInterpreter; -import org.eclipse.osgi.framework.console.CommandProvider; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint; -import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint.restMethod; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.next.jpa.EntityManagerProvider; -import org.opentosca.container.core.service.internal.ICoreInternalEndpointService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This Class stores and retrieves Endpoint-Objects in the Database, using Eclipse-JPA. - * - * For the JPA-Queries refer to: {@link RESTEndpoint}, {@link WSDLEndpoint} - */ -public class CoreInternalEndpointServiceImpl implements ICoreInternalEndpointService, CommandProvider { - - private final static Logger LOG = LoggerFactory.getLogger(CoreInternalEndpointServiceImpl.class); - - private EntityManager em; - - public CoreInternalEndpointServiceImpl() { - init(); - } - - @Override - /** - * This method is called when the garbage collector destroys the class. We will then manually - * close the EntityManager/Factory, and pass control back. - */ - protected void finalize() throws Throwable { - this.em.close(); - super.finalize(); - } - - /** - * This method initializes the EntityManager/Factory in case it is not connected/setup yet. It - * is called by each method, to ensure that a connection exists. (Robustness!) - */ - private void init() { - if (this.em == null) { - this.em = EntityManagerProvider.createEntityManager(); - } - } - - @Override - /** - * {@Inheritdoc} - */ - public List getWSDLEndpoints(final QName portType, final String triggeringContainer, - final CSARID csarId) { - - final ArrayList results = new ArrayList<>(); - - final Query getWSDLEndpointsQuery = - this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.csarId = :csarId and e.PortType = :portType"); - - // Set Parameters for the Query - getWSDLEndpointsQuery.setParameter("portType", portType); - getWSDLEndpointsQuery.setParameter("triggeringContainer", triggeringContainer); - getWSDLEndpointsQuery.setParameter("csarId", csarId); - - // Get Query-Results (WSDLEndpoints) and add them to the result list. - @SuppressWarnings("unchecked") - final - // Result can only be a WSDLEndpoint - List queryResults = getWSDLEndpointsQuery.getResultList(); - for (final WSDLEndpoint endpoint : queryResults) { - results.add(endpoint); - } - - // Hack, to get endpoints stored from the container e.g. the SI-Invoker - // endpoint. - getWSDLEndpointsQuery.setParameter("csarId", new CSARID("***")); - - // Get Query-Results (WSDLEndpoints) and add them to the result list. - @SuppressWarnings("unchecked") - final - // Result can only be a WSDLEndpoint - List queryResults2 = getWSDLEndpointsQuery.getResultList(); - for (final WSDLEndpoint endpoint : queryResults2) { - results.add(endpoint); - } - - return results; - } - - @Override - /** - * {@Inheritdoc} - */ - public void storeWSDLEndpoint(final WSDLEndpoint endpoint) { - CoreInternalEndpointServiceImpl.LOG.debug("Storing WSDL Endpoint with CSARID: \"" + endpoint.getCSARId() - + "\", portType: \"" + endpoint.getPortType() + "\", IAName: \"" + endpoint.getIaName() - + "\", TypeImplementation: \"" + endpoint.getTypeImplementation() + "\", URI: \"" - + endpoint.getURI().toString() + "\""); - - // TODO this check is a hack because of the problem with deploying of - // multiple deployment artifacts - if (!existsWSDLEndpoint(endpoint)) { - if (!this.em.getTransaction().isActive()) { - this.em.getTransaction().begin(); - } - CoreInternalEndpointServiceImpl.LOG.debug("The endpoint for \"{}\" is not stored. Thus store it.", - endpoint.getPortType()); - this.em.persist(endpoint); - this.em.getTransaction().commit(); - } else { - CoreInternalEndpointServiceImpl.LOG.debug("The endpoint for \"{}\" is stored already.", - endpoint.getPortType()); - } - } - - /** - * Helper method to check if a given WSDLEndpoint is already stored in the database - * - * @param endpoint to look for - * @return true, if the Endpoint already exists. - */ - private boolean existsWSDLEndpoint(final WSDLEndpoint endpoint) { - // get all available WSDL endpoints - final List endpoints = - getWSDLEndpointsForCSARID(endpoint.getTriggeringContainer(), endpoint.getCSARId()); - - // search for an equivalent endpoint - return endpoints.stream().filter(wsdlEndpoint -> Objects.equals(endpoint.getCSARId(), wsdlEndpoint.getCSARId())) - .filter(wsdlEndpoint -> Objects.equals(endpoint.getTriggeringContainer(), - wsdlEndpoint.getTriggeringContainer())) - .filter(wsdlEndpoint -> Objects.equals(endpoint.getManagingContainer(), - wsdlEndpoint.getManagingContainer())) - .filter(wsdlEndpoint -> Objects.equals(endpoint.getURI(), wsdlEndpoint.getURI())) - .filter(wsdlEndpoint -> Objects.equals(endpoint.getPortType(), wsdlEndpoint.getPortType())) - .filter(wsdlEndpoint -> Objects.equals(endpoint.getServiceTemplateInstanceID(), - wsdlEndpoint.getServiceTemplateInstanceID())) - .filter(wsdlEndpoint -> Objects.equals(endpoint.getTypeImplementation(), - wsdlEndpoint.getTypeImplementation())) - .filter(wsdlEndpoint -> Objects.equals(endpoint.getIaName(), wsdlEndpoint.getIaName())) - .filter(wsdlEndpoint -> Objects.equals(endpoint.getPlanId(), wsdlEndpoint.getPlanId())) - .findFirst().isPresent(); - } - - @Override - /** - * {@Inheritdoc} - */ - public List getRestEndpoints(final URI anyURI, final String triggeringContainer, - final CSARID csarId) { - final ArrayList results = new ArrayList<>(); - - /** - * Create Query to retrieve RESTEndpoints identified by a URI and thorID - * - * @see RESTEndpoint#getEndpointForPath - **/ - final Query getRestEndpointsQuery = this.em.createNamedQuery(RESTEndpoint.getEndpointForPath); - - // Set Parameters - getRestEndpointsQuery.setParameter("path", anyURI.getPath()); - getRestEndpointsQuery.setParameter("csarId", csarId); - - // Get Query-Results and add them to the result list - @SuppressWarnings("unchecked") - final - // Result can only be a RESTEndpoint - List queryResults = getRestEndpointsQuery.getResultList(); - for (final RESTEndpoint endpoint : queryResults) { - results.add(endpoint); - } - return results; - } - - @Override - /** - * {@Inheritdoc} - */ - public void storeRESTEndpoint(final RESTEndpoint endpoint) { - CoreInternalEndpointServiceImpl.LOG.debug("Storing REST Endpoint with Path : \"{}\", STID: \"{}\"", - endpoint.getPath(), endpoint.getCSARId().getFileName()); - if (!this.em.getTransaction().isActive()) { - this.em.getTransaction().begin(); - } - this.em.persist(endpoint); - this.em.getTransaction().commit(); - } - - /** - * The following methods provide OSGi-Console commands. - */ - - @Override - public String getHelp() { - final StringBuffer buf = new StringBuffer(); - buf.append("---OpenTOSCA Endpoint Management---\n"); - buf.append("\tendpoint_clear - Clears both endpoint Dbs\n"); - buf.append("\tendpoint_clear_wsdl - Clear wsdl endpoint db\n"); - buf.append("\tendpoint_clear_rest - Clear rest endpoint db\n"); - buf.append("\tendpoint_show_wsdl - Shows all WSDL-Endpoints\n"); - buf.append("\tendpoint_show_rest - Shows all REST-Endpoints\n"); - buf.append("\tendpoint_add_dummy_rest - Add dummy rest endpoint db\n"); - buf.append("\tendpoint_add_dummy_wsdl - Add dummy wsdl endpoint db\n"); - return buf.toString(); - } - - public void _endpoint_clear(final CommandInterpreter commandInterpreter) { - _endpoint_clear_rest(commandInterpreter); - _endpoint_clear_wsdl(commandInterpreter); - } - - public void _endpoint_clear_wsdl(final CommandInterpreter commandInterpreter) { - if (!this.em.getTransaction().isActive()) { - this.em.getTransaction().begin(); - } - final Query query = this.em.createQuery("DELETE FROM WSDLEndpoint"); - final int deletedWSDL = query.executeUpdate(); - commandInterpreter.println("Deleted " + deletedWSDL + " WSDLEndpoints."); - this.em.getTransaction().commit(); - } - - public void _endpoint_clear_rest(final CommandInterpreter commandInterpreter) { - if (!this.em.getTransaction().isActive()) { - this.em.getTransaction().begin(); - } - final Query query = this.em.createQuery("DELETE FROM RESTEndpoint"); - final int deletedREST = query.executeUpdate(); - commandInterpreter.println("Deleted " + deletedREST + " RESTEndpoints."); - this.em.getTransaction().commit(); - } - - public void _endpoint_add_dummy_rest(final CommandInterpreter commandInterpreter) { - try { - final RESTEndpoint endpoint = new RESTEndpoint(new URI("http://www.balbla.com/xyz"), restMethod.GET, "test", - "test", new CSARID("mockup.example.test"), 5L, new HashMap()); - storeRESTEndpoint(endpoint); - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - - } - - public void _endpoint_add_dummy_wsdl(final CommandInterpreter commandInterpreter) { - try { - - // URI uri, QName portType, CSARID csarId, URI serviceInstanceID, String planid, QName - // nodeTypeImplementation, String iaName - final WSDLEndpoint endpoint = new WSDLEndpoint(new URI("http://blabla/"), new QName("somePort"), "test", - "test", new CSARID("mockup.example.test"), 5L, new QName("{someNamespace}someplanid"), - new QName("{someNamespace}someNodeTypeImplId"), "some ia name", new HashMap()); - storeWSDLEndpoint(endpoint); - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - - } - - public void _endpoint_show_rest(final CommandInterpreter commandInterpreter) { - - final Query query = this.em.createQuery("SELECT e FROM RESTEndpoint e"); - @SuppressWarnings("unchecked") - final List queryResults = query.getResultList(); - for (final RESTEndpoint e : queryResults) { - commandInterpreter.println("SeriviceTemplateID: " + e.getCSARId().getFileName() + " URI: " + e.getURI()); - } - - } - - public void _endpoint_show_wsdl(final CommandInterpreter commandInterpreter) { - final Query query = this.em.createQuery("SELECT e FROM WSDLEndpoint e"); - @SuppressWarnings("unchecked") - final List queryResults = query.getResultList(); - for (final WSDLEndpoint e : queryResults) { - commandInterpreter.println("Triggering Container: " + e.getTriggeringContainer()); - commandInterpreter.println("Managing Container: " + e.getManagingContainer()); - commandInterpreter.println("CSARId: " + e.getCSARId()); - commandInterpreter.println("PortType: " + (e.getPortType() == null ? "" : e.getPortType().toString())); - commandInterpreter.println("ServiceTemplateInstanceID: " - + (e.getServiceTemplateInstanceID() == null ? "" : e.getServiceTemplateInstanceID().toString())); - commandInterpreter.println("PlanId: " + (e.getPlanId() == null ? "" : e.getPlanId().toString())); - commandInterpreter.println("TypeImpl: " - + (e.getTypeImplementation() == null ? "" : e.getTypeImplementation().toString())); - commandInterpreter.println("IaName: " + (e.getIaName() == null ? "" : e.getIaName())); - commandInterpreter.println("URI: " + e.getURI().toString()); - commandInterpreter.println("Metadata: " + e.getMetadata()); - commandInterpreter.println(""); - } - - } - - @Override - public void removePlanEndpoints(final String triggeringContainer, final CSARID csarId) { - if (!this.em.getTransaction().isActive()) { - this.em.getTransaction().begin(); - } - - // get all plan endpoints (plan ID set) for the given csarid - final Query queryWsdlEndpoints = - this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.csarId = :csarId and e.PlanId is not null"); - queryWsdlEndpoints.setParameter("triggeringContainer", triggeringContainer); - queryWsdlEndpoints.setParameter("csarId", csarId); - @SuppressWarnings("unchecked") - final List wsdlEndpoints = queryWsdlEndpoints.getResultList(); - - // remove all found plan endpoints one by one - for (final WSDLEndpoint wsdlEndpoint : wsdlEndpoints) { - this.em.remove(wsdlEndpoint); - } - - this.em.getTransaction().commit(); - } - - @Override - public WSDLEndpoint getWSDLEndpointForPlanId(final String triggeringContainer, final CSARID csarId, - final QName planId) { - WSDLEndpoint endpoint = null; - final Query queryWSDLEndpoint = - this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.csarId= :csarId and e.PlanId = :planId"); - queryWSDLEndpoint.setParameter("triggeringContainer", triggeringContainer); - queryWSDLEndpoint.setParameter("csarId", csarId); - queryWSDLEndpoint.setParameter("planId", planId); - - try { - endpoint = (WSDLEndpoint) queryWSDLEndpoint.getSingleResult(); - } - catch (final NoResultException e) { - LOG.error("Query in database didn't return a result", e); - return null; - } - - return endpoint; - } - - @Override - public List getWSDLEndpointsForCSARID(final String triggeringContainer, final CSARID csarId) { - final ArrayList endpoints = new ArrayList<>(); - final Query queryWSDLEndpoint = - this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.csarId= :csarId"); - queryWSDLEndpoint.setParameter("triggeringContainer", triggeringContainer); - queryWSDLEndpoint.setParameter("csarId", csarId); - - @SuppressWarnings("unchecked") - final List queryResults = queryWSDLEndpoint.getResultList(); - for (final WSDLEndpoint endpoint : queryResults) { - endpoints.add(endpoint); - } - - return endpoints; - } - - @Override - public List getWSDLEndpointsForSTID(final String triggeringContainer, - final Long serviceTemplateInstanceID) { - final ArrayList endpoints = new ArrayList<>(); - final Query queryWSDLEndpoint = - this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.serviceTemplateInstanceID= :serviceTemplateInstanceID"); - queryWSDLEndpoint.setParameter("triggeringContainer", triggeringContainer); - queryWSDLEndpoint.setParameter("serviceTemplateInstanceID", serviceTemplateInstanceID); - - @SuppressWarnings("unchecked") - final List queryResults = queryWSDLEndpoint.getResultList(); - for (final WSDLEndpoint endpoint : queryResults) { - endpoints.add(endpoint); - } - - return endpoints; - } - - @Override - public List getWSDLEndpointsForNTImplAndIAName(final String triggeringContainer, - final String managingContainer, final QName typeImpl, - final String iaName) { - final ArrayList endpoints = new ArrayList<>(); - final Query queryWSDLEndpoint = - this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.managingContainer = :managingContainer and e.IaName = :IaName and e.TypeImplementation = :typeImpl"); - queryWSDLEndpoint.setParameter("triggeringContainer", triggeringContainer); - queryWSDLEndpoint.setParameter("managingContainer", managingContainer); - queryWSDLEndpoint.setParameter("IaName", iaName); - queryWSDLEndpoint.setParameter("typeImpl", typeImpl); - - @SuppressWarnings("unchecked") - final List queryResults = queryWSDLEndpoint.getResultList(); - for (final WSDLEndpoint endpoint : queryResults) { - endpoints.add(endpoint); - } - - return endpoints; - } - - @Override - public List getWSDLEndpoints() { - final ArrayList endpoints = new ArrayList<>(); - final Query queryWSDLEndpoint = this.em.createQuery("SELECT e FROM WSDLEndpoint e"); - - @SuppressWarnings("unchecked") - final List queryResults = queryWSDLEndpoint.getResultList(); - for (final WSDLEndpoint endpoint : queryResults) { - endpoints.add(endpoint); - } - - return endpoints; - } - - @Override - public void printPlanEndpoints() { - final Query queryWSDLEndpoint = this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.PlanId is not null"); - - @SuppressWarnings("unchecked") - final List endpoints = queryWSDLEndpoint.getResultList(); - - final StringBuilder builder = new StringBuilder(); - final String ls = System.getProperty("line.separator"); - builder.append("debug output for stored endpoints of management plans, flags: csarid, managingContainer, planid, ianame, porttype " - + ls); - for (final WSDLEndpoint endpoint : endpoints) { - builder.append("endpoint: " + endpoint.getCSARId() + " " + endpoint.getManagingContainer() + " " - + endpoint.getPlanId() + " " + endpoint.getIaName() + " " + endpoint.getPortType() + ls); - } - CoreInternalEndpointServiceImpl.LOG.debug(builder.toString()); - } - - @Override - public boolean removeWSDLEndpoint(final WSDLEndpoint endpoint) { - // get all wsdl endpoints with related properties - final List endpoints = - getWSDLEndpointsForCSARID(endpoint.getTriggeringContainer(), endpoint.getCSARId()); - - if (!this.em.getTransaction().isActive()) { - this.em.getTransaction().begin(); - } - boolean check = false; - - // check if given endpoint is in the list and remove - if (endpoints.contains(endpoint)) { - this.em.remove(endpoint); - check = true; - } - this.em.getTransaction().commit(); - return check; - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalFileServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalFileServiceImpl.java deleted file mode 100644 index fd774157a..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalFileServiceImpl.java +++ /dev/null @@ -1,590 +0,0 @@ -package org.opentosca.container.core.impl.service.internal; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.opentosca.container.core.common.EntityExistsException; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.impl.service.internal.file.StorageProviderManager; -import org.opentosca.container.core.impl.service.internal.file.csar.CSARMetaDataJPAStore; -import org.opentosca.container.core.impl.service.internal.file.csar.CSARUnpacker; -import org.opentosca.container.core.impl.service.internal.file.csar.CSARValidator; -import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryDeleteVisitor; -import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryVisitor; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.csar.toscametafile.TOSCAMetaFile; -import org.opentosca.container.core.model.csar.toscametafile.TOSCAMetaFileParser; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.container.core.service.internal.ICoreInternalFileService; -import org.opentosca.container.core.service.internal.ICoreInternalFileStorageProviderService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Provides a store and management functionalities for CSAR files. - * - * Files and directories in a CSAR can be stored with any of the available storage providers - * (plug-ins). For using a certain storage provider it must be defined as the active storage - * provider with {@link #setActiveStorageProvider(String)}. Only available storage providers can be - * set as active. By default (e.g. after the start of the container), no active storage provider is - * set. In this case or if the active storage provider is not ready (e.g. has no credentials) the - * default storage provider will be used instead, if it's available and ready. Otherwise the - * operation fails. The default one is hard-coded and can be get with - * {@link #getDefaultStorageProvider()}. - * - * A stored CSAR file or only a file / directory of it can be moved to another storage provider. The - * target storage provider for the move is analogous the active storage provider respectively the - * default one. If an active storage provider goes unavailable no active storage provider is set - * (setting will be cleared). - * - * Meta data (file and directory paths, TOSCA meta file content and CSAR ID) of a CSAR will be - * stored locally in the database. This makes it possible to browse in a CSAR and get the TOSCA meta - * file data without network access. - * - * @see ICoreInternalFileStorageProviderService - * @see CSARContent - */ -public class CoreInternalFileServiceImpl implements ICoreInternalFileService { - - private final static Logger LOG = LoggerFactory.getLogger(CoreInternalFileServiceImpl.class); - - private final StorageProviderManager STORAGE_PROVIDER_MANAGER = new StorageProviderManager(); - private final CSARMetaDataJPAStore JPA_STORE = new CSARMetaDataJPAStore(); - - private static IFileAccessService fileAccessService = null; - - /** - * Relative path to CSAR root of the TOSCA meta file. - * - * @see org.opentosca.settings.Settings - */ - private final String TOSCA_META_FILE_REL_PATH = Settings.getSetting("toscaMetaFileRelPath"); - - - // /** - // * File extension of a CSAR. - // * - // * @see org.opentosca.settings.Settings - // */ - // private final String CSAR_EXTENSION = - // Settings.getSetting("csarExtension"); - - @Override - public CSARID storeCSAR(final Path csarFile) throws UserException, SystemException { - - CoreInternalFileServiceImpl.LOG.debug("Given file to store: {}", csarFile); - - CSARUnpacker csarUnpacker = null; - Path csarUnpackDir = null; - DirectoryVisitor csarVisitor = null; - - try { - - if (!Files.isRegularFile(csarFile)) { - throw new UserException( - "\"" + csarFile.toString() + "\" to store is not an absolute path to an existent file."); - } - - // if (!PathUtils.hasFileExtension(csarFile, this.CSAR_EXTENSION)) { - // throw new UserException("File \"" + csarFile.toString() + - // "\" to store has not correct file extension \"" + - // this.CSAR_EXTENSION + "\"."); - // } - - final CSARID csarID = new CSARID(csarFile.getFileName().toString()); - - if (this.JPA_STORE.isCSARMetaDataStored(csarID)) { - throw new EntityExistsException( - "CSAR \"" + csarID.toString() + "\" is already stored. Overwriting a CSAR is not allowed."); - } - - final String storageProviderID = this.STORAGE_PROVIDER_MANAGER.chooseStorageProvider(); - - csarUnpacker = new CSARUnpacker(csarFile); - csarUnpacker.unpackAndVisitUnpackDir(); - - csarUnpackDir = csarUnpacker.getUnpackDirectory(); - csarVisitor = csarUnpacker.getFilesAndDirectories(); - - final CSARValidator csarValidator = new CSARValidator(csarID, csarUnpackDir, csarVisitor); - - if (!csarValidator.isValid()) { - throw new UserException(csarValidator.getErrorMessage()); - } - - final Path toscaMetaFileAbsPath = csarUnpackDir.resolve(this.TOSCA_META_FILE_REL_PATH); - - final TOSCAMetaFile toscaMetaFile = new TOSCAMetaFileParser().parse(toscaMetaFileAbsPath); - - if (toscaMetaFile == null) { - throw new UserException("TOSCA meta file is invalid."); - } - - final Set filesInCSARUnpackDir = csarVisitor.getVisitedFiles(); - final Set directoriesInCSARUnpackDir = csarVisitor.getVisitedDirectories(); - - final Map fileToStorageProviderIDMap = new HashMap<>(); - final Set directories = new HashSet<>(); - - for (final Path fileInCSARUnpackDir : filesInCSARUnpackDir) { - final Path fileRelToCSARRoot = csarUnpackDir.relativize(fileInCSARUnpackDir); - this.STORAGE_PROVIDER_MANAGER.storeFileOfCSAR(fileInCSARUnpackDir, csarID, fileRelToCSARRoot, - storageProviderID); - fileToStorageProviderIDMap.put(fileRelToCSARRoot, storageProviderID); - } - - for (final Path directoryInCSARUnpackDir : directoriesInCSARUnpackDir) { - final Path directoryRelToCSARRoot = csarUnpackDir.relativize(directoryInCSARUnpackDir); - directories.add(directoryRelToCSARRoot); - } - - this.JPA_STORE.storeCSARMetaData(csarID, directories, fileToStorageProviderIDMap, toscaMetaFile); - - CoreInternalFileServiceImpl.LOG.debug("Storing CSAR \"{}\" located at \"{}\" successfully completed.", - csarID, csarFile); - - return csarID; - } - finally { - // At the end or if an exception occurred we should delete the - // unpack directory, if necessary. - if (csarUnpackDir != null) { - csarUnpacker.deleteUnpackDir(); - } - } - } - - @Override - public CSARContent getCSAR(final CSARID csarID) throws UserException { - - final CSARContent csarContent = this.JPA_STORE.getCSARMetaData(csarID); - return csarContent; - - } - - @Override - public Set getCSARIDs() { - - final Set csarIDs = this.JPA_STORE.getCSARIDsMetaData(); - return csarIDs; - - } - - @Override - public Path exportCSAR(final CSARID csarID) throws UserException, SystemException { - - CoreInternalFileServiceImpl.LOG.debug("Exporting CSAR \"{}\"...", csarID); - - Map fileToStorageProviderIDMapOfCSAR; - - fileToStorageProviderIDMapOfCSAR = this.JPA_STORE.getFileToStorageProviderIDMap(csarID); - - // create new Set to remove duplicates - final Set storageProviderIDsOfCSAR = new HashSet<>(fileToStorageProviderIDMapOfCSAR.values()); - - Set idsOfNotReadyStorageProviders = new HashSet<>(); - - idsOfNotReadyStorageProviders = - this.STORAGE_PROVIDER_MANAGER.areStorageProvidersReady(storageProviderIDsOfCSAR); - - if (!idsOfNotReadyStorageProviders.isEmpty()) { - throw new SystemException("Can't export CSAR \"" + csarID - + "\", because the following storage provider(s) is / are not available and ready: " - + idsOfNotReadyStorageProviders); - } - - final Set directoriesOfCSAR = this.JPA_STORE.getDirectories(csarID); - - final Path tempDirectory = CoreInternalFileServiceImpl.fileAccessService.getTemp().toPath(); - final Path csarDownloadDirectory = tempDirectory.resolve("content"); - - try { - - Files.createDirectory(csarDownloadDirectory); - - for (final Path directoryOfCSAR : directoriesOfCSAR) { - final Path directoryOfCSARAbsPath = csarDownloadDirectory.resolve(directoryOfCSAR); - Files.createDirectories(directoryOfCSARAbsPath); - } - - for (final Map.Entry fileToStorageProviderIDOfCSAREntry : fileToStorageProviderIDMapOfCSAR.entrySet()) { - - final Path fileRelToCSARRoot = fileToStorageProviderIDOfCSAREntry.getKey(); - final String fileStorageProviderID = fileToStorageProviderIDOfCSAREntry.getValue(); - - final Path fileOfCSARDownloadAbsPath = csarDownloadDirectory.resolve(fileRelToCSARRoot); - - this.STORAGE_PROVIDER_MANAGER.getFileOfCSAR(csarID, fileRelToCSARRoot, fileStorageProviderID, - fileOfCSARDownloadAbsPath); - - } - - final Path csarFile = tempDirectory.resolve(csarID.getFileName()); - - CoreInternalFileServiceImpl.fileAccessService.zip(csarDownloadDirectory.toFile(), csarFile.toFile()); - - CoreInternalFileServiceImpl.LOG.debug("CSAR \"{}\" was successfully exported to \"{}\".", csarID, csarFile); - - return csarFile; - - } - catch (final IOException exc) { - throw new SystemException("An IO Exception occured.", exc); - } - finally { - final DirectoryDeleteVisitor csarDeleteVisitor = new DirectoryDeleteVisitor(); - try { - CoreInternalFileServiceImpl.LOG.debug("Deleting CSAR download directory \"{}\"...", - csarDownloadDirectory); - Files.walkFileTree(csarDownloadDirectory, csarDeleteVisitor); - CoreInternalFileServiceImpl.LOG.debug("Deleting CSAR download directory \"{}\" completed.", - csarDownloadDirectory); - } - catch (final IOException exc) { - throw new SystemException("An IO Exception occured. Deleting CSAR download directory \"" - + csarDownloadDirectory + "\" failed.", exc); - } - } - - } - - @Override - public void moveCSAR(final CSARID csarID) throws UserException, SystemException { - - CoreInternalFileServiceImpl.LOG.debug("CSAR to move: \"{}\"", csarID); - - final String targetStorageProviderID = this.STORAGE_PROVIDER_MANAGER.chooseStorageProvider(); - - CoreInternalFileServiceImpl.LOG.debug("CSAR \"{}\" will be moved to storage provider \"{}\".", csarID, - targetStorageProviderID); - - final Map fileToStorageProviderIDMap = this.JPA_STORE.getFileToStorageProviderIDMap(csarID); - - final Map fileToMoveToStorageProviderIDMap = - findFilesToMove(null, fileToStorageProviderIDMap, targetStorageProviderID); - - if (fileToMoveToStorageProviderIDMap.isEmpty()) { - CoreInternalFileServiceImpl.LOG.debug("CSAR \"{}\" is already completely stored on storage provider \"{}\".", - csarID, targetStorageProviderID); - } else { - - for (final Map.Entry fileToMoveToStorageProviderIDEntry : fileToMoveToStorageProviderIDMap.entrySet()) { - - final Path fileRelToCSARRoot = fileToMoveToStorageProviderIDEntry.getKey(); - final String fileStorageProviderID = fileToMoveToStorageProviderIDEntry.getValue(); - - moveFileToStorageProvider(csarID, fileRelToCSARRoot, fileStorageProviderID, targetStorageProviderID); - - } - - } - - CoreInternalFileServiceImpl.LOG.debug("Moving CSAR \"{}\" to storage provider \"{}\" completed.", csarID, - targetStorageProviderID); - - } - - /** - * Moves the file {@code fileRelToCSARRoot} of CSAR {@code csarID} from its current storage provider - * {@code fileStorageProviderID} to the storage provider {@code targetStorageProviderID}.
    - *
    - * A file will be moved in the following way:
    - * 1. Getting input stream and size of file from the source storage provider.
    - * 2. Storing file on target storage provider {@code targetStorageProviderID} using the input stream - * and size.
    - * 3. Updating meta data of file.
    - * 4. Deleting file on source storage provider. - * - * @param csarID of CSAR - * @param fileRelToCSARRoot - file relative to CSAR root. - * @param fileStorageProviderID of storage provider - * @param targetStorageProviderID of storage provider. - * @throws UserException if CSAR {@code csarID} or it's file {@code fileRelToCSARRoot} was not - * found. - * - * @throws SystemException if source or target storage provider is not available and ready, the file - * to move was not found on source storage provider or an error occurred during getting from - * source storage provider, storing on target storage provider or deleting from source - * storage provider. - * @return {@code true} if moving file was successful, otherwise {@code false}. - */ - private void moveFileToStorageProvider(final CSARID csarID, final Path fileRelToCSARRoot, - final String fileStorageProviderID, - final String targetStorageProviderID) throws UserException, SystemException { - - CoreInternalFileServiceImpl.LOG.debug("Moving file \"{}\" of CSAR \"{}\" from source storage provider \"{}\" to target storage provider \"{}\"...", - fileRelToCSARRoot, csarID, fileStorageProviderID, - targetStorageProviderID); - - final InputStream fileInputStream = - this.STORAGE_PROVIDER_MANAGER.getFileOfCSARAsInputStream(csarID, fileRelToCSARRoot, fileStorageProviderID); - - final long fileSize = - this.STORAGE_PROVIDER_MANAGER.getFileOfCSARSize(csarID, fileRelToCSARRoot, fileStorageProviderID); - - this.STORAGE_PROVIDER_MANAGER.storeFileOfCSAR(csarID, fileInputStream, fileSize, fileRelToCSARRoot, - targetStorageProviderID); - - try { - fileInputStream.close(); - } - catch (final IOException exc) { - throw new SystemException("An IOException occured.", exc); - } - - this.JPA_STORE.storeFileStorageProviderIDOfCSAR(csarID, fileRelToCSARRoot, targetStorageProviderID); - - this.STORAGE_PROVIDER_MANAGER.deleteFileOfCSAR(csarID, fileRelToCSARRoot, fileStorageProviderID); - - CoreInternalFileServiceImpl.LOG.debug("Moving file \"{}\" of CSAR \"{}\" from storage provider \"{}\" to target storage provider \"{}\" completed.", - fileRelToCSARRoot, csarID, fileStorageProviderID, - targetStorageProviderID); - - } - - @Override - public void moveFileOrDirectoryOfCSAR(final CSARID csarID, final Path relPathToCSARRoot) throws SystemException, - UserException { - - CoreInternalFileServiceImpl.LOG.debug("CSAR: \"{}\", file / directory of CSAR to move: \"{}\"", csarID, - relPathToCSARRoot); - - final String targetStorageProviderID = this.STORAGE_PROVIDER_MANAGER.chooseStorageProvider(); - - CoreInternalFileServiceImpl.LOG.debug("File / directory \"{}\" of CSAR \"{}\" will be moved to storage provider \"{}\".", - relPathToCSARRoot, csarID, targetStorageProviderID); - - final Map fileToStorageProviderIDMap = this.JPA_STORE.getFileToStorageProviderIDMap(csarID); - - final Set directories = this.JPA_STORE.getDirectories(csarID); - - if (fileToStorageProviderIDMap.containsKey(relPathToCSARRoot)) { - - CoreInternalFileServiceImpl.LOG.debug("\"{}\" to move is a file of CSAR \"{}\".", relPathToCSARRoot, - csarID); - final String fileStorageProviderID = fileToStorageProviderIDMap.get(relPathToCSARRoot); - - if (fileStorageProviderID.equals(targetStorageProviderID)) { - - CoreInternalFileServiceImpl.LOG.debug("File \"{}\" is already stored on target storage provider \"{}\".", - relPathToCSARRoot, targetStorageProviderID); - - } else { - - moveFileToStorageProvider(csarID, relPathToCSARRoot, fileStorageProviderID, targetStorageProviderID); - - } - - } else if (directories.contains(relPathToCSARRoot)) { - - CoreInternalFileServiceImpl.LOG.debug("\"{}\" to move is a directory of CSAR \"{}\".", relPathToCSARRoot, - csarID); - final Map fileToMoveToStorageProviderIDMap = - findFilesToMove(relPathToCSARRoot, fileToStorageProviderIDMap, targetStorageProviderID); - - if (fileToMoveToStorageProviderIDMap.isEmpty()) { - - CoreInternalFileServiceImpl.LOG.debug("Files in directory \"{}\" of CSAR \"{}\" are already stored on target storage provider \"{}\" or directory \"{}\" contains no files.", - relPathToCSARRoot, csarID, targetStorageProviderID, - relPathToCSARRoot); - - } else { - - for (final Map.Entry fileToMoveToStorageProviderIDEntry : fileToMoveToStorageProviderIDMap.entrySet()) { - final Path fileRelToCSARRoot = fileToMoveToStorageProviderIDEntry.getKey(); - final String fileStorageProviderID = fileToMoveToStorageProviderIDEntry.getValue(); - moveFileToStorageProvider(csarID, fileRelToCSARRoot, fileStorageProviderID, - targetStorageProviderID); - } - - } - - CoreInternalFileServiceImpl.LOG.debug("Moving directory \"{}\" of CSAR \"{}\" to target storage provider \"{}\" completed.", - relPathToCSARRoot, csarID, targetStorageProviderID); - - } else { - throw new UserException( - "File or directory \"" + relPathToCSARRoot + "\" to move was not found in CSAR \"" + csarID + "\"."); - } - - } - - /** - * Finds all files that must be moved to the storage provider {@code targetStorageProviderID}. If a - * file is already on {@code targetStorageProviderID}, it must be not moved. - * - * @param searchDirRelToCSARRoot - directory relative to CSAR root where to search for files that - * must be moved. {@code null} means it should be searched in the complete CSAR. - * @param fileToStorageProviderIDMap - file to storage provider ID mapping of all files of the CSAR. - * Each file path must be given relative to the CSAR root. - * @param targetStorageProviderID of storage provider. - * @return Mapping of relative path to CSAR root of file to its storage provider ID of all files - * that must be moved. - */ - private Map findFilesToMove(final Path searchDirRelToCSARRoot, - final Map fileToStorageProviderIDMap, - final String targetStorageProviderID) { - - CoreInternalFileServiceImpl.LOG.debug("Searching for files that must be moved to target storage provider \"{}\"...", - targetStorageProviderID); - - final Map fileToMoveToStorageProviderIDMap = new HashMap<>(); - - for (final Map.Entry fileToStorageProviderIDEntry : fileToStorageProviderIDMap.entrySet()) { - final Path file = fileToStorageProviderIDEntry.getKey(); - if (searchDirRelToCSARRoot == null || file.startsWith(searchDirRelToCSARRoot)) { - final String fileStorageProviderID = fileToStorageProviderIDEntry.getValue(); - final boolean isAlreadyOnTargetStorageProvider = fileStorageProviderID.equals(targetStorageProviderID); - if (!isAlreadyOnTargetStorageProvider) { - // found file that must be moved to target storage provider - fileToMoveToStorageProviderIDMap.put(file, fileStorageProviderID); - } - } - } - - CoreInternalFileServiceImpl.LOG.debug("Found {} file(s) that must be moved to target storage provider \"{}\".", - fileToMoveToStorageProviderIDMap.size(), targetStorageProviderID); - - return fileToMoveToStorageProviderIDMap; - - } - - @Override - public void deleteCSAR(final CSARID csarID) throws SystemException, UserException { - - CoreInternalFileServiceImpl.LOG.debug("Deleting CSAR \"{}\"...", csarID); - - final Map fileToStorageProviderIDMap = this.JPA_STORE.getFileToStorageProviderIDMap(csarID); - - // create new Set to remove duplicates - final Set storageProviderIDsOfCSAR = new HashSet<>(fileToStorageProviderIDMap.values()); - - Set idsOfNotReadyStorageProviders = new HashSet<>(); - - idsOfNotReadyStorageProviders = - this.STORAGE_PROVIDER_MANAGER.areStorageProvidersReady(storageProviderIDsOfCSAR); - - if (!idsOfNotReadyStorageProviders.isEmpty()) { - throw new SystemException("Can't delete CSAR \"" + csarID - + "\", because the following storage provider(s) is / are not available and ready: " - + idsOfNotReadyStorageProviders); - } - - CoreInternalFileServiceImpl.LOG.debug("Deleting CSAR \"{}\" on storage provider(s) {}...", csarID, - storageProviderIDsOfCSAR); - - for (final Map.Entry fileToStorageProviderIDEntry : fileToStorageProviderIDMap.entrySet()) { - - final Path fileRelToCSARRoot = fileToStorageProviderIDEntry.getKey(); - final String fileStorageProviderID = fileToStorageProviderIDEntry.getValue(); - - this.STORAGE_PROVIDER_MANAGER.deleteFileOfCSAR(csarID, fileRelToCSARRoot, fileStorageProviderID); - - } - - CoreInternalFileServiceImpl.LOG.debug("Deleting CSAR \"{}\" on storage provider(s) completed.", csarID); - - this.JPA_STORE.deleteCSARMetaData(csarID); - - CoreInternalFileServiceImpl.LOG.debug("Deleting CSAR \"{}\" completed.", csarID); - - } - - @Override - public void deleteCSARs() throws SystemException { - - CoreInternalFileServiceImpl.LOG.debug("Deleting all CSARs..."); - - final Set csarIDs = this.JPA_STORE.getCSARIDsMetaData(); - - if (!csarIDs.isEmpty()) { - - CoreInternalFileServiceImpl.LOG.debug("{} CSAR(s) is / are currently stored and will be deleted now.", - csarIDs.size()); - - for (final CSARID csarID : csarIDs) { - try { - deleteCSAR(csarID); - } - catch (final UserException exc) { - throw new SystemException("An System Exception occured.", exc); - } - } - - CoreInternalFileServiceImpl.LOG.debug("Deleting all CSARs completed."); - - } else { - CoreInternalFileServiceImpl.LOG.debug("No CSARs are currently stored."); - } - - } - - @Override - public Set getReadyStorageProviders() { - return this.STORAGE_PROVIDER_MANAGER.getReadyStorageProviders(); - } - - @Override - public boolean isReadyStorageProvider(final String storageProviderID) { - return this.STORAGE_PROVIDER_MANAGER.isStorageProviderReady(storageProviderID); - } - - @Override - public Set getStorageProviders() { - return this.STORAGE_PROVIDER_MANAGER.getStorageProviders(); - } - - @Override - public String getActiveStorageProvider() { - return this.STORAGE_PROVIDER_MANAGER.getActiveStorageProvider(); - } - - @Override - public void setActiveStorageProvider(final String storageProviderID) throws UserException { - this.STORAGE_PROVIDER_MANAGER.setActiveStorageProvider(storageProviderID); - } - - @Override - public String getDefaultStorageProvider() { - return this.STORAGE_PROVIDER_MANAGER.getDefaultStorageProvider(); - } - - @Override - public String getStorageProviderName(final String storageProviderID) { - return this.STORAGE_PROVIDER_MANAGER.getStorageProviderName(storageProviderID); - } - - /** - * Binds the File Access Service. - * - * @param fileAccessService to bind - */ - protected void bindFileAccessService(final IFileAccessService fileAccessService) { - if (fileAccessService == null) { - CoreInternalFileServiceImpl.LOG.warn("Can't bind File Access Service."); - } else { - CoreInternalFileServiceImpl.fileAccessService = fileAccessService; - CoreInternalFileServiceImpl.LOG.debug("File Access Service bound."); - } - } - - /** - * Unbinds the File Access Service. - * - * @param fileAccessService to unbind - */ - protected void unbindFileAccessService(final IFileAccessService fileAccessService) { - CoreInternalFileServiceImpl.fileAccessService = null; - CoreInternalFileServiceImpl.LOG.debug("File Access Service unbound."); - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalFileStorageProviderFileSystemServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalFileStorageProviderFileSystemServiceImpl.java deleted file mode 100644 index 9b87b29f6..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalFileStorageProviderFileSystemServiceImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.opentosca.container.core.impl.service.internal; - -import java.util.Properties; - -import org.eclipse.osgi.framework.console.CommandInterpreter; -import org.eclipse.osgi.framework.console.CommandProvider; -import org.jclouds.filesystem.reference.FilesystemConstants; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.service.internal.AbstractJCloudsFileStorageProvider; -import org.opentosca.container.core.service.internal.ICoreInternalFileStorageProviderService; - -/** - * File system storage provider. It's implemented by extending from - * {@link AbstractJCloudsFileStorageProvider}, so it uses jclouds to access the file system. This - * class primarily contains meta data of the storage provider and some necessary jclouds - * configuration like the location of the file system-based blobstore. - * - * A CSAR file will be stored at the following path: - * {@code ///} - * - * The blobstore path is defined in {@link #CSAR_STORE_PATH}. By default, the container name is - * {@code org.opentosca.csars}. Setting a new container name or getting the current one is possible - * via OSGi console commands. - * - * Note: If you have stored files on this storage provider and changes the container name (creates - * new container) these files can't be found anymore, because the storage provider searches for the - * files in the new container. Thus, for retrieving the files again you must switch back to the - * previous container. - */ -public class CoreInternalFileStorageProviderFileSystemServiceImpl extends AbstractJCloudsFileStorageProvider - implements ICoreInternalFileStorageProviderService, - CommandProvider { - - /** - * Storage provider ID.
    - * It's a storage provider based on jclouds, so the ID must be equal to the jclouds file system API - * ID. - */ - private final String STORAGE_PROVIDER_ID = "filesystem"; - - /** - * Storage provider Name. - */ - private final String STORAGE_PROVIDER_NAME = "Filesystem-based BlobStore"; - - /** - * Absolute path where the file system-based blobstore should be located. - * - * @see org.opentosca.settings.Settings - */ - private final String CSAR_STORE_PATH = Settings.getSetting("csarStorePath"); - - - @Override - public String getStorageProviderID() { - return this.STORAGE_PROVIDER_ID; - } - - @Override - public String getStorageProviderName() { - return this.STORAGE_PROVIDER_NAME; - } - - @Override - protected Properties overwriteJCloudsProperties() { - final Properties props = super.overwriteJCloudsProperties(); - // location of blobstore must be set as a jclouds property. - props.setProperty(FilesystemConstants.PROPERTY_BASEDIR, this.CSAR_STORE_PATH); - return props; - } - - @Override - public boolean needsCredentials() { - return false; - } - - @Override - public String getCredentialsIdentityName() { - return null; - } - - @Override - public String getCredentialsKeyName() { - return null; - } - - /** - * Prints the available OSGi commands. - */ - @Override - public String getHelp() { - final StringBuilder help = new StringBuilder(); - help.append("--- File System Storage Provider Management ---\n"); - help.append("\tsetFilesystemContainerName - Sets a new name for the container in that the files will be stored / retrieved from.\n"); - help.append("\tprintFilesystemContainerName - Prints the name of the container in that the files will be stored / retrieved from.\n"); - return help.toString(); - } - - /** - * OSGi commands. - */ - - public void _setFilesystemContainerName(final CommandInterpreter ci) { - - final String containerName = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (containerName == null) { - ci.println("Container name not given."); - inputInvalid = true; - } - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - this.setContainerName(containerName); - ci.println("Container name \"" + containerName + "\" was set in storage provider \"" - + this.getStorageProviderID() + "\"."); - } - - } - - public void _printFilesystemContainerName(final CommandInterpreter ci) { - final String containerName = this.getContainerName(); - ci.println("Container name of storage provider \"" + this.getStorageProviderID() + "\": " + containerName); - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalModelRepositoryServiceImpl.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalModelRepositoryServiceImpl.java deleted file mode 100644 index c711e63ad..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/CoreInternalModelRepositoryServiceImpl.java +++ /dev/null @@ -1,596 +0,0 @@ -package org.opentosca.container.core.impl.service.internal; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.eclipse.osgi.framework.console.CommandProvider; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.internal.ICoreInternalModelRepositoryService; -import org.opentosca.container.core.tosca.model.TDefinitions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/* - * TODO: Completely remove Model Repository - needed Definitions should be directly fetched from the - * TOSCA Reference Mapper in the TOSCA Engine. - */ -public class CoreInternalModelRepositoryServiceImpl implements ICoreInternalModelRepositoryService, CommandProvider { - - // private final IXMLSerializerService xmlSerializerService = null; - - // JDBC-Database-URL to store the Database to - // private final String databaseURL = "jdbc:derby:" + - // Settings.getSetting("databaseLocation") + ";create=true"; - // private final String tableName = "toscaFiles".toUpperCase(); - // private final Connection conn = null; - // private final Statement stmt = null; - // private PreparedStatement pstmt = null; - - private IToscaEngineService toscaEngineService; - - // /** - // * SQL-Queries - // */ - // private final String createTable = "CREATE TABLE " + this.tableName + - // " (DefinitionsID VARCHAR(1000) NOT NULL, DefinitionsXML BLOB NOT NULL, - // PRIMARY KEY (DefinitionsID))"; - // private final String storeDefinitions = "INSERT INTO " + this.tableName + - // " (DefinitionsID, DefinitionsXML) VALUES (?, ?)"; - // private final String getDefinitionsByID = "SELECT DefinitionsXML FROM " + - // this.tableName + " WHERE DefinitionsID = ?"; - // private final String getAllDefinitionsIDs = "SELECT DefinitionsID FROM " - // + this.tableName; - // private final String deleteAllDefinitions = "DELETE FROM " + - // this.tableName; - // private final String deleteDefinitionsByID = "DELETE FROM " + - // this.tableName + " WHERE DefinitionsID = ?"; - // private final String dropTable = "DROP TABLE " + this.tableName; - - /** - * Logging - */ - private final static Logger LOG = LoggerFactory.getLogger(CoreInternalModelRepositoryServiceImpl.class); - - // public CoreInternalModelRepositoryServiceImpl() { - // this.connectDatabase(); - // this.prepareDatabase(); - // } - - // /** - // * This method connects to the Derby-Database - // */ - // private void connectDatabase() { - // try { - // new org.apache.derby.jdbc.EmbeddedDriver(); - // this.conn = DriverManager.getConnection(this.databaseURL); - // } catch (SQLException e) { - // e.printStackTrace(); - // } - // } - - // /** - // * This method prepares the Database. It creates the tables if they're not - // * already existing. - // */ - // private void prepareDatabase() { - // try { - // CoreInternalModelRepositoryServiceImpl.LOG.info("Checking if Tables - // already exist..."); - // ArrayList tables = new ArrayList(); - // - // this.stmt = this.conn.createStatement(); - // - // DatabaseMetaData metadata = null; - // metadata = this.conn.getMetaData(); - // String[] names = {"TABLE"}; - // - // // Get table Names, and add add them to a list. - // ResultSet tableNames = metadata.getTables(null, null, null, names); - // while (tableNames.next()) { - // tables.add(tableNames.getString("TABLE_NAME")); - // } - // - // // Check if our table already exists. If not, create it - // if (!tables.contains(this.tableName)) { - // CoreInternalModelRepositoryServiceImpl.LOG.info("Table did not exist. - // Creating..."); - // this.stmt.execute(this.createTable); - // } - // this.stmt.close(); - // } catch (SQLException e) { - // e.printStackTrace(); - // } - // } - - // @Override - // /** - // * {@inheritDoc} - // */ - // public QName storeTOSCA(File toscaFile) { - // - // FileInputStream fileInputStream = null; - // BufferedInputStream bufferedInputStream = null; - // - // try { - // - // IXMLSerializer serializer = this.xmlSerializerService.getXmlSerializer(); - // - // Definitions definitions = serializer.unmarshal(toscaFile); - // - // // unmarshalling failed - // if (definitions == null) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("Unmarshalling TOSCA - // file {} failed!", - // toscaFile.getName()); - // return null; - // } - // - // String definitionsID = definitions.getId(); - // String definitionsNS = definitions.getTargetNamespace(); - // QName definitionsIDQName = new QName(definitionsNS, definitionsID); - // - // CoreInternalModelRepositoryServiceImpl.LOG.info("Storing TOSCA file {} - // with Definitions ID \"{}\"...", - // toscaFile.getName(), definitionsIDQName.toString()); - // - // this.pstmt = this.conn.prepareStatement(this.storeDefinitions); - // this.pstmt.setString(1, definitionsIDQName.toString()); - // - // fileInputStream = new FileInputStream(toscaFile); - // bufferedInputStream = new BufferedInputStream(fileInputStream); - // // this.pstmt.setString(2, this.fileToString(file)); - // // storing TOSCA XML file as BLOB - // this.pstmt.setBinaryStream(2, bufferedInputStream); - // this.pstmt.execute(); - // CoreInternalModelRepositoryServiceImpl.LOG.info("Storing TOSCA file {} - // with Definitions ID \"{}\" completed.", - // toscaFile.getName(), definitionsIDQName.toString()); - // return definitionsIDQName; - // - // } catch (SQLException e) { - // if - // (e.getLocalizedMessage().contains("duplicate key value in a unique or - // primary key constraint or unique index")) - // { - // CoreInternalModelRepositoryServiceImpl.LOG.warn("Error while writing - // TOSCA / Definitions to database. It already exists!", - // e); - // } else { - // CoreInternalModelRepositoryServiceImpl.LOG.error("Error while writing - // TOSCA / Definitions to database.", - // e); - // } - // } catch (FileNotFoundException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // - // } finally { - // if (this.pstmt != null) { - // try { - // this.pstmt.close(); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // if (bufferedInputStream != null) { - // try { - // bufferedInputStream.close(); - // } catch (IOException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // if (fileInputStream != null) { - // try { - // fileInputStream.close(); - // } catch (IOException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // } - // - // return null; - // - // } - - - // /** - // * Reads a file to String - // * - // * @param filePath : Absolute path, pointing to the file, which needs to - // be - // * read - // * @return String containing file contents - // */ - // public String fileToString(File file) { - // CoreInternalModelRepositoryServiceImpl.LOG.info("Reading file {} to - // String", - // file.getAbsolutePath()); - // StringBuilder contents = new StringBuilder(); - // try { - // BufferedReader input = new BufferedReader(new FileReader(file)); - // try { - // String line = null; - // while ((line = input.readLine()) != null) { - // contents.append(line); - // contents.append(System.getProperty("line.separator")); - // } - // } finally { - // input.close(); - // } - // } catch (IOException ex) { - // ex.printStackTrace(); - // } - // return contents.toString(); - // } - - @Override - /** - * {@inheritDoc} - */ - public List getAllDefinitionsIDs(final CSARID csarID) { - CoreInternalModelRepositoryServiceImpl.LOG.info("Getting IDs of all Definitions in CSAR \"{}\"...", csarID); - - if (this.toscaEngineService != null) { - return this.toscaEngineService.getToscaReferenceMapper().getDefinitionIDsOfCSAR(csarID); - } - - CoreInternalModelRepositoryServiceImpl.LOG.error("TOSCA Engine Service is not available! Can't get Definitions IDs of CSAR \"{}\"", - csarID); - return null; - - // ArrayList definitionIDs = new ArrayList(); - // try { - // this.pstmt = this.conn.prepareStatement(this.getAllDefinitionsIDs); - // ResultSet result = this.pstmt.executeQuery(); - // while (result.next()) { - // String definitionID = result.getString(1); - // definitionIDs.add(QName.valueOf(definitionID)); - // } - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("Getting IDs of all - // stored Definitions failed!", - // e); - // } finally { - // if (this.pstmt != null) { - // try { - // this.pstmt.close(); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // } - // return definitionIDs; - } - - @Override - /** - * {@inheritDoc} - */ - public TDefinitions getDefinitions(final CSARID csarID, final QName definitionsID) { - - // Definitions definitions = null; - // InputStream inputStream = null; - CoreInternalModelRepositoryServiceImpl.LOG.info("Getting Definitions with ID \"{}\" in CSAR \"{}\"...", - definitionsID.toString(), csarID.toString()); - - if (this.toscaEngineService != null) { - final Object definitions = - this.toscaEngineService.getToscaReferenceMapper().getJAXBReference(csarID, definitionsID); - - if (definitions instanceof TDefinitions) { - return (TDefinitions) definitions; - } else { - CoreInternalModelRepositoryServiceImpl.LOG.error("Definitions with ID \"{}\" was not found in CSAR \"{}\"!", - definitionsID.toString(), csarID.toString()); - return null; - } - - } - - CoreInternalModelRepositoryServiceImpl.LOG.error("TOSCA Engine Service is not available! Can't get Definitions with ID \"{}\" of CSAR \"{}\"", - definitionsID.toString(), csarID.toString()); - return null; - - // try { - // - // this.pstmt = this.conn.prepareStatement(this.getDefinitionsByID); - // this.pstmt.setString(1, definitionsID.toString()); - // ResultSet result = this.pstmt.executeQuery(); - // // String ToscaXML = null; - // // Reader reader; - // // Iterate over the results. This should only be
    one
    - // // iteration. - // // while (result.next()) { - // // ToscaXML = result.getString(1); - // if (result.next()) { - // inputStream = result.getBinaryStream(1); - // } else { - // CoreInternalModelRepositoryServiceImpl.LOG.error("Definitions with ID - // \"{}\" is not stored!", - // definitionsID.toString()); - // return null; - // } - // // } - // - // // if (ToscaXML == null) { - // // return null; - // // } - // - // // Read bytes to inputstream, and unmarshall - // // InputStream in = new ByteArrayInputStream(ToscaXML.getBytes()); - // IXMLSerializer serializer = - // this.xmlSerializerService.getXmlSerializer(); - // definitions = serializer.unmarshal(inputStream); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("Getting Definitions - // with ID \"{}\" failed!", - // definitionsID.toString(), e); - // } finally { - // - // if (inputStream != null) { - // try { - // inputStream.close(); - // } catch (IOException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // - // if (this.pstmt != null) { - // try { - // this.pstmt.close(); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // - // } - // - // return definitions; - - } - - // @Override - // public List getServiceTemplateIDs(CSARID csarID, QName - // definitionsID) { - // - // CoreInternalModelRepositoryServiceImpl.LOG.info("Getting service template - // IDs of Definitions with ID \"{}\"...", - // definitionsID.toString()); - // - // List serviceTemplateIDs = new ArrayList(); - // - // TDefinitions definitions = this.getDefinitions(csarID, definitionsID); - // - // if (definitions != null) { - // for (TExtensibleElements extElements : - // definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - // if (extElements instanceof TServiceTemplate) { - // TServiceTemplate serviceTemplate = (TServiceTemplate) extElements; - // String serviceTemplateNS = serviceTemplate.getTargetNamespace(); - // String serviceTemplateID = serviceTemplate.getId(); - // QName serviceTemplateIDQName = new QName(serviceTemplateNS, - // serviceTemplateID); - // serviceTemplateIDs.add(serviceTemplateIDQName); - // } - // } - // - // CoreInternalModelRepositoryServiceImpl.LOG.info("Definitions with ID - // \"{}\" consists of {} service templates.", - // definitionsID.toString(), serviceTemplateIDs.size()); - // - // return serviceTemplateIDs; - // } - // - // return null; - // - // } - - // @Override - // /** - // * {@inheritDoc} - // */ - // public int deleteAllDefinitions() { - // - // int num = 0; - // CoreInternalModelRepositoryServiceImpl.LOG.info("Deleting all Definitions - // stored in Core Model Repository..."); - // try { - // this.pstmt = this.conn.prepareStatement(this.deleteAllDefinitions); - // num = this.pstmt.executeUpdate(); - // CoreInternalModelRepositoryServiceImpl.LOG.info(num + - // " Definitions were deleted in Core Model Repository."); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("Deleting Definitions in - // Core Model Repository failed!", - // e); - // } finally { - // - // if (this.pstmt != null) { - // try { - // this.pstmt.close(); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // - // } - // - // return num; - // - // } - - // /** - // * {@inheritDoc} - // */ - // @Override - // public boolean deleteDefinitions(QName definitionsID) { - // - // CoreInternalModelRepositoryServiceImpl.LOG.info("Deleting Definitions - // with ID \"{}\"...", - // definitionsID.toString()); - // try { - // this.pstmt = this.conn.prepareStatement(this.deleteDefinitionsByID); - // this.pstmt.setString(1, definitionsID.toString()); - // if (this.pstmt.executeUpdate() > 0) { - // CoreInternalModelRepositoryServiceImpl.LOG.info("Deleting Definitions - // with ID \"{}\" completed.", - // definitionsID.toString()); - // return true; - // } else { - // CoreInternalModelRepositoryServiceImpl.LOG.error("Definitions with ID - // \"{}\" doesn't exist.", - // definitionsID.toString()); - // } - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.info("Deleting Definitions - // with ID \"{}\" failed.", - // definitionsID.toString(), e); - // } finally { - // if (this.pstmt != null) { - // try { - // this.pstmt.close(); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // } - // - // return false; - // - // } - - // public void bindIXMLSerializerService(IXMLSerializerService - // xmlSerializerService) { - // - // this.xmlSerializerService = xmlSerializerService; - // CoreInternalModelRepositoryServiceImpl.LOG.info("Binding XML Serializer - // Service bound."); - // } - // - // public void unbindIXMLSerializerService(IXMLSerializerService - // xmlSerializerService) { - // - // this.xmlSerializerService = xmlSerializerService; - // CoreInternalModelRepositoryServiceImpl.LOG.info("XML Serializer Service - // unbound."); - // } - - public void bindToscaEngineService(final IToscaEngineService toscaEngineService) { - - this.toscaEngineService = toscaEngineService; - CoreInternalModelRepositoryServiceImpl.LOG.debug("Tosca Engine Service bound."); - } - - public void unbindToscaEngineService(final IToscaEngineService toscaEngineService) { - - this.toscaEngineService = toscaEngineService; - CoreInternalModelRepositoryServiceImpl.LOG.debug("Tosca Engine Service unbound."); - } - - /** - * The following methods are OSGi-Console-Commands - */ - @Override - public String getHelp() { - final StringBuilder help = new StringBuilder(); - help.append("--- OpenTOSCA Core Model Repository Management ---\n"); - // help.append("\tstoreTOSCA - Stores the TOSCA / Definitions at the - // given file path.\n"); - help.append("\tgetAllDefinitionsIDs - Gets the IDs of all stored Definitions.\n"); - // help.append("\tgetServiceTemplateIDs - Gets the IDs of all service - // templates contained in the Definitions with the given ID.\n"); - // help.append("\tdeleteAllDefinitions - Deletes ALL stored - // Definitions.\n"); - // help.append("\tdeleteDefinitions - Deletes the Definitions with the - // given ID.\n"); - // help.append("\treset - Drops and recreates database table that stores - // the Definitions. Everything will be deleted!\n"); - return help.toString(); - } - - // public void _storeTOSCA(CommandInterpreter ci) { - // String arg = ci.nextArgument(); - // - // this.storeTOSCA(new File(arg)); - - // if (this.storeToscaXML(new File(arg)) != null) { - // ci.println("TOSCA-File " + arg + - // " stored in Core Model Repository."); - // } else { - // ci.println("Storing TOSCA-File " + arg + - // " in Core Model Repository failed!"); - // } - // } - - // public void _getAllDefinitionsIDs(CommandInterpreter ci) { - // - // List definitionsIDs = this.getAllDefinitionsIDs(); - // - // if (definitionsIDs.isEmpty()) { - // ci.println("No Definitions / TOSCAs stored in Core Model Repository."); - // } else { - // ci.println("ID(s) of stored Definitions:"); - // for (QName definitionID : definitionsIDs) { - // ci.println(definitionID.toString()); - // } - // } - // - // } - - // public void _getServiceTemplateIDs(CommandInterpreter ci) { - // - // String arg = ci.nextArgument(); - // - // if (arg == null) { - // arg = ""; - // } - // - // List serviceTemplateIDs = - // this.getServiceTemplateIDs(QName.valueOf(arg)); - // - // if ((serviceTemplateIDs != null) && !serviceTemplateIDs.isEmpty()) { - // ci.println("ID(s) of service template(s):"); - // for (QName serviceTemplateID : serviceTemplateIDs) { - // ci.println(serviceTemplateID.toString()); - // } - // } - // - // } - - // public void _deleteAllDefinitions(CommandInterpreter ci) { - // ci.println("Deleted " + this.deleteAllDefinitions() + - // " Definitions / TOSCA(s) from Core Model Repository."); - // } - - // public void _deleteDefinitions(CommandInterpreter ci) { - // - // String arg = ci.nextArgument(); - // - // if (arg == null) { - // arg = ""; - // } - // - // this.deleteDefinitions(QName.valueOf(arg)); - // - // } - - // public void _reset(CommandInterpreter ci) { - // try { - // this.pstmt = this.conn.prepareStatement(this.dropTable); - // this.prepareDatabase(); - // ci.println("Dropped and recreated Core Model Repository Table."); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } finally { - // if (this.pstmt != null) { - // try { - // this.pstmt.close(); - // } catch (SQLException e) { - // CoreInternalModelRepositoryServiceImpl.LOG.error("", e); - // } - // } - // } - // } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/credentials/CredentialsCommands.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/credentials/CredentialsCommands.java deleted file mode 100644 index 6ab37f17e..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/credentials/CredentialsCommands.java +++ /dev/null @@ -1,320 +0,0 @@ -package org.opentosca.container.core.impl.service.internal.credentials; - -import java.util.Set; - -import org.eclipse.osgi.framework.console.CommandInterpreter; -import org.eclipse.osgi.framework.console.CommandProvider; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.impl.service.internal.CoreInternalCredentialsServiceImpl; -import org.opentosca.container.core.model.credentials.Credentials; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Provides OSGi console commands of the Core Internal Credentials Service. - * - * @see CoreInternalCredentialsServiceImpl - */ -public class CredentialsCommands implements CommandProvider { - - private final static Logger LOG = LoggerFactory.getLogger(CredentialsCommands.class); - - private final CoreInternalCredentialsServiceImpl INTERNAL_CREDENTIALS_SERVICE = - new CoreInternalCredentialsServiceImpl(); - - - /** - * Prints the available OSGi commands. - */ - @Override - public String getHelp() { - final StringBuilder help = new StringBuilder(); - help.append("--- Core Credentials Service Management ---\n"); - help.append("\tstoreCredentials - Stores credentials for a storage provider.\n"); - help.append("\tprintCredentialsIDs - Prints IDs of all stored credentials.\n"); - help.append("\tprintAllCredentials - Prints all stored credentials.\n"); - help.append("\tprintAllCredentialsIdentityAndKeyNames - Prints the credentials identity and key names of all available storage providers.\n"); - help.append("\tdeleteCredentials - Deletes credentials for a storage provider.\n"); - help.append("\tdeleteAllCredentials - Deletes all stored credentials.\n"); - help.append("\tsetCredentialsInStorageProvider - Sets already stored credentials in the associated storage provider.\n"); - help.append("\tdeleteCredentialsInStorageProvider - Deletes credentials in the storage provider.\n"); - return help.toString(); - } - - /** - * OSGi commands. - */ - - public void _storeCredentials(final CommandInterpreter ci) { - - final String storageProviderID = ci.nextArgument(); - final String identity = ci.nextArgument(); - final String key = ci.nextArgument(); - String description = ci.nextArgument(); - - if (description != null) { - - final StringBuilder descriptionStringBuilder = new StringBuilder(description); - - // If description consists of more than one word (arguments) we must - // separate them by spaces. - while ((description = ci.nextArgument()) != null) { - descriptionStringBuilder.append(" " + description); - } - - description = descriptionStringBuilder.toString(); - - } - - boolean inputInvalid = false; - - if (storageProviderID == null) { - ci.println("Storage provider ID not given."); - inputInvalid = true; - } - if (identity == null) { - ci.println("Identity not given."); - inputInvalid = true; - } - if (key == null) { - ci.println("Key not given."); - inputInvalid = true; - } - - if (!inputInvalid) { - final Credentials credentials = new Credentials(storageProviderID, identity, key, description); - try { - this.INTERNAL_CREDENTIALS_SERVICE.storeCredentials(credentials); - ci.println("Storing credentials for storage provider \"" + storageProviderID + "\" was successfull."); - } - catch (final UserException exc) { - CredentialsCommands.LOG.warn("An User Exception occured.", exc); - ci.println("Storing credentials for storage provider \"" + storageProviderID + "\" failed."); - } - } - - } - - public void _printCredentialsIDs(final CommandInterpreter ci) { - - final Set credentialsIDs = this.INTERNAL_CREDENTIALS_SERVICE.getCredentialsIDs(); - - if (credentialsIDs.isEmpty()) { - - ci.print("No credentials are stored."); - - } else { - - for (final Long credentialsID : credentialsIDs) { - ci.println("ID: " + credentialsID); - } - - } - - } - - public void _printAllCredentials(final CommandInterpreter ci) { - - final Set allCredentials = this.INTERNAL_CREDENTIALS_SERVICE.getAllCredentials(); - - if (allCredentials.isEmpty()) { - - ci.print("No credentials are stored."); - - } else { - - for (final Credentials credentials : allCredentials) { - - final long credentialsID = credentials.getID(); - final String storageProviderID = credentials.getStorageProviderID(); - final String identity = credentials.getIdentity(); - final String key = credentials.getKey(); - final String description = credentials.getDescription(); - - boolean injected = false; - - try { - injected = this.INTERNAL_CREDENTIALS_SERVICE.hasStorageProviderCredentials(credentialsID); - } - catch (final UserException exc) { - CredentialsCommands.LOG.warn("An User Exception occured.", exc); - } - - ci.println("-------------------------------------"); - ci.println("ID: " + credentialsID); - ci.println("Storage Provider ID: " + storageProviderID); - ci.println("Identity: " + identity); - ci.println("Key: " + key); - if (description != null && !description.trim().isEmpty()) { - ci.println("Description: " + credentials.getDescription()); - } - - ci.println("Injected in storage provider: " + injected); - - } - - } - - } - - public void _printAllCredentialsIdentityAndKeyNames(final CommandInterpreter ci) { - - final Set storageProviders = this.INTERNAL_CREDENTIALS_SERVICE.getStorageProviders(); - - if (storageProviders.isEmpty()) { - - ci.print("No storage providers are available."); - - } else { - - ci.println("Credentials identity and key names of all available storage providers:"); - for (final String storageProviderID : storageProviders) { - ci.println("----- " + storageProviderID + " -----"); - - try { - - if (this.INTERNAL_CREDENTIALS_SERVICE.needsStorageProviderCredentials(storageProviderID)) { - - ci.println("Identity name: " - + this.INTERNAL_CREDENTIALS_SERVICE.getCredentialsIdentityName(storageProviderID)); - ci.println("Key name: " - + this.INTERNAL_CREDENTIALS_SERVICE.getCredentialsKeyName(storageProviderID)); - - } else { - - ci.println("Needs no credentials."); - - } - - } - catch (final SystemException exc) { - CredentialsCommands.LOG.warn("A System Exception occured.", exc); - } - - } - - } - - } - - public void _deleteCredentials(final CommandInterpreter ci) { - - final String credentialsIDAsString = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (credentialsIDAsString == null) { - ci.println("Credentials ID not given."); - inputInvalid = true; - } - - long credentialsID = 0; - - try { - credentialsID = Long.parseLong(credentialsIDAsString); - } - catch (final NumberFormatException exc) { - CredentialsCommands.LOG.warn("Credentials ID must be a whole number.", exc); - inputInvalid = true; - } - - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - try { - this.INTERNAL_CREDENTIALS_SERVICE.deleteCredentials(credentialsID); - ci.println("Deleting credentials \"" + credentialsID + "\" was successfull."); - } - catch (final UserException exc) { - CredentialsCommands.LOG.warn("An User Exception occured.", exc); - ci.println("Deleting credentials \"" + credentialsID + "\" failed."); - } - } - - } - - public void _deleteAllCredentials(final CommandInterpreter ci) { - this.INTERNAL_CREDENTIALS_SERVICE.deleteAllCredentials(); - ci.println("Deleting all credentials was successfull."); - } - - public void _setCredentialsInStorageProvider(final CommandInterpreter ci) { - - final String credentialsIDAsString = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (credentialsIDAsString == null) { - ci.println("Credentials ID not given."); - inputInvalid = true; - } - - long credentialsID = 0; - - try { - credentialsID = Long.parseLong(credentialsIDAsString); - } - catch (final NumberFormatException exc) { - CredentialsCommands.LOG.warn("Credentials ID must be a whole number.", exc); - inputInvalid = true; - } - - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - try { - this.INTERNAL_CREDENTIALS_SERVICE.setCredentialsInStorageProvider(credentialsID); - ci.println("Setting / injecting credentials \"" + credentialsID + "\" was successfull."); - return; - } - catch (final SystemException exc) { - CredentialsCommands.LOG.warn("A System Exception occured.", exc); - } - catch (final UserException exc) { - CredentialsCommands.LOG.warn("An User Exception occured.", exc); - } - - ci.println("Setting / injecting credentials \"" + credentialsID + "\" failed."); - } - - } - - public void _deleteCredentialsInStorageProvider(final CommandInterpreter ci) { - - final String storageProviderID = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (storageProviderID == null) { - ci.println("Storage provider ID not given."); - inputInvalid = true; - } - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - try { - this.INTERNAL_CREDENTIALS_SERVICE.deleteCredentialsInStorageProvider(storageProviderID); - ci.println("Deleting credentials in storage provider \"" + storageProviderID + "\" was successfull."); - } - catch (final SystemException exc) { - CredentialsCommands.LOG.warn("A System Exception occured.", exc); - ci.println("Deleting credentials in storage provider \"" + storageProviderID + "\" failed."); - } - } - - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/credentials/CredentialsJPAStore.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/credentials/CredentialsJPAStore.java deleted file mode 100644 index 9609370e9..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/credentials/CredentialsJPAStore.java +++ /dev/null @@ -1,225 +0,0 @@ -package org.opentosca.container.core.impl.service.internal.credentials; - -import java.sql.SQLIntegrityConstraintViolationException; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.Query; - -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.impl.service.internal.CoreInternalCredentialsServiceImpl; -import org.opentosca.container.core.model.credentials.Credentials; -import org.opentosca.container.core.next.jpa.EntityManagerProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Manages credentials in the database by using Eclipse Link (JPA). - */ -public class CredentialsJPAStore { - - private final static Logger LOG = LoggerFactory.getLogger(CredentialsJPAStore.class); - - private EntityManager em; - - - /** - * Initializes JPA. - */ - private void initJPA() { - if (this.em == null) { - this.em = EntityManagerProvider.createEntityManager(); - } - } - - /** - * Destructor. This method is called when the garbage collector destroys the class. We will then - * manually close the EntityManager / Factory and pass control back. - */ - @Override - protected void finalize() throws Throwable { - this.em.close(); - super.finalize(); - } - - /** - * Persists the credentials {@code credentials}. - * - * @param credentials - * - * @return Generated ID of credentials. - * @throws UserException if {@code credentials} are already stored according to unique constraints - * defined in {@link Credentials}. - */ - public long storeCredentials(final Credentials credentials) throws UserException { - - final String storageProviderID = credentials.getStorageProviderID(); - - CredentialsJPAStore.LOG.debug("Storing credentials for storage provider \"{}\"...", storageProviderID); - - initJPA(); - - try { - - this.em.getTransaction().begin(); - this.em.persist(credentials); - this.em.getTransaction().commit(); - - } - catch (final Exception exc) { - // check if exception chain contains exception that indicates a - // constraint violation - for (Throwable excCause = exc.getCause(); excCause != null; excCause = excCause.getCause()) { - if (excCause instanceof SQLIntegrityConstraintViolationException) { - throw new UserException( - "Credentials for storage provider \"" + storageProviderID + "\" are already stored."); - } - } - } - - final long credentialsID = credentials.getID(); - - CredentialsJPAStore.LOG.debug("Storing credentials for storage provider \"{}\" completed. Generated ID of credentials: \"{}\"", - storageProviderID, credentialsID); - - return credentialsID; - } - - /** - * @see CoreInternalCredentialsServiceImpl#getCredentials(String, String) - */ - public Credentials getCredentials(final Long credentialsID) throws UserException { - - CredentialsJPAStore.LOG.debug("Retrieving credentials \"{}\"...", credentialsID); - - Credentials credentials = null; - - initJPA(); - - final Query getCredentialsQuery = this.em.createNamedQuery(Credentials.getCredentialsByID); - getCredentialsQuery.setParameter("id", credentialsID); - - try { - credentials = (Credentials) getCredentialsQuery.getSingleResult(); - CredentialsJPAStore.LOG.debug("Credentials \"{}\" were found.", credentialsID); - return credentials; - } - catch (final NoResultException exc) { - throw new UserException("Credentials \"" + credentialsID + "\" were not found."); - } - - } - - /** - * @see CoreInternalCredentialsServiceImpl#getAllCredentialsOfStorageProvider(String) - */ - public Set getAllCredentialsOfStorageProvider(final String storageProviderID) { - - CredentialsJPAStore.LOG.debug("Retrieving all credentials for storage provider \"{}\"...", storageProviderID); - - initJPA(); - - final Query getAllCredentialsByStorageProviderIDQuery = - this.em.createNamedQuery(Credentials.getAllCredentialsByStorageProviderID); - getAllCredentialsByStorageProviderIDQuery.setParameter("storageProviderID", storageProviderID); - - @SuppressWarnings("unchecked") - final List allCredentialsOfStorageProvider = - getAllCredentialsByStorageProviderIDQuery.getResultList(); - - CredentialsJPAStore.LOG.debug("{} credentials for storage provider \"{}\" were found.", - allCredentialsOfStorageProvider.size(), storageProviderID); - - return new HashSet<>(allCredentialsOfStorageProvider); - - } - - /** - * @see CoreInternalCredentialsServiceImpl#getCredentialsIDs() - */ - public Set getCredentialsIDs() { - - CredentialsJPAStore.LOG.debug("Retrieving IDs of all stored credentials..."); - - initJPA(); - - final Query getCredentialsIDsQuery = this.em.createNamedQuery(Credentials.getCredentialsIDs); - - @SuppressWarnings("unchecked") - final List credentialsIDs = getCredentialsIDsQuery.getResultList(); - - CredentialsJPAStore.LOG.debug("{} credentials ID(s) were found.", credentialsIDs.size()); - - return new HashSet<>(credentialsIDs); - - } - - /** - * @see CoreInternalCredentialsServiceImpl#getAllCredentials() - */ - public Set getAllCredentials() { - - CredentialsJPAStore.LOG.debug("Retrieving all credentials..."); - - initJPA(); - - final Query getAllCredentialsQuery = this.em.createNamedQuery(Credentials.getAllCredentials); - - @SuppressWarnings("unchecked") - final List allCredentials = getAllCredentialsQuery.getResultList(); - - CredentialsJPAStore.LOG.debug("{} credentials were found.", allCredentials.size()); - - return new HashSet<>(allCredentials); - - } - - /** - * Deletes credentials {@code credentialsID}. - * - * @param credentialsID of credentials. - * - * @throws UserException if credentials to delete were not found. - */ - public void deleteCredentials(final long credentialsID) throws UserException { - - CredentialsJPAStore.LOG.debug("Deleting credentials \"{}\"...", credentialsID); - - initJPA(); - - this.em.getTransaction().begin(); - final Query removeCredentialsQuery = this.em.createNamedQuery(Credentials.removeCredentialsByID); - removeCredentialsQuery.setParameter("id", credentialsID); - final int numDeletedCredentials = removeCredentialsQuery.executeUpdate(); - this.em.getTransaction().commit(); - - if (numDeletedCredentials > 0) { - CredentialsJPAStore.LOG.debug("Deleting credentials \"{}\" completed.", credentialsID); - } else { - throw new UserException("Credentials \"" + credentialsID + "\" to delete were not found."); - } - - } - - /** - * Deletes all stored credentials. - */ - public void deleteAllCredentials() { - - CredentialsJPAStore.LOG.debug("Deleting all credentials..."); - - initJPA(); - - this.em.getTransaction().begin(); - final Query removeAllCredentialsQuery = this.em.createNamedQuery(Credentials.removeAllCredentials); - final int numDeletedCredentials = removeAllCredentialsQuery.executeUpdate(); - this.em.getTransaction().commit(); - - CredentialsJPAStore.LOG.debug("Deleted {} credentials.", numDeletedCredentials); - - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/FileServiceCommands.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/FileServiceCommands.java deleted file mode 100644 index b8f23c23a..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/FileServiceCommands.java +++ /dev/null @@ -1,353 +0,0 @@ -package org.opentosca.container.core.impl.service.internal.file; - -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Set; - -import org.eclipse.osgi.framework.console.CommandInterpreter; -import org.eclipse.osgi.framework.console.CommandProvider; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.impl.service.internal.CoreInternalFileServiceImpl; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Provides OSGi console commands of the Core Internal File Service. - * - * @see CoreInternalFileServiceImpl - */ -public class FileServiceCommands implements CommandProvider { - - private final static Logger LOG = LoggerFactory.getLogger(FileServiceCommands.class); - - private final CoreInternalFileServiceImpl INTERNAL_FILE_SERVICE = new CoreInternalFileServiceImpl(); - - - /** - * Prints the available OSGi commands. - */ - @Override - public String getHelp() { - final StringBuilder help = new StringBuilder(); - help.append("--- Core File Service Management ---\n"); - help.append("\tstoreCSAR - Stores a CSAR. All files will be stored at the active storage provider respectively default storage provider.\n"); - help.append("\texportCSAR - Exports a CSAR to a Temp directory.\n"); - help.append("\tmoveCSAR - Moves a stored CSAR to the active storage provider respectively default storage provider.\n"); - help.append("\tmoveFileOrDirectoryOfCSAR - Moves a file or directory of a stored CSAR to the active storage provider respectively default storage provider.\n"); - help.append("\tdeleteCSAR - Deletes a CSAR.\n"); - help.append("\tdeleteCSARs - Deletes all CSARs.\n"); - help.append("\tprintCSARIDs - Prints the IDs of all stored CSARs.\n"); - help.append("\tprintStorageProviders - Prints the IDs of all available storage providers.\n"); - help.append("\tprintReadyStorageProviders - Prints the IDs of all available storage providers with satisfied requirements.\n"); - help.append("\tprintDefaultStorageProvider - Prints the ID of the default storage provider.\n"); - help.append("\tprintActiveStorageProvider - Prints the active storage provider.\n"); - help.append("\tsetActiveStorageProvider - Sets a available storage provider as the active one.\n"); - return help.toString(); - } - - /** - * OSGi commands. - */ - - public void _storeCSAR(final CommandInterpreter ci) { - - final String csarFile = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (csarFile == null) { - ci.println("Absolute path to a CSAR file not given."); - inputInvalid = true; - } - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - try { - this.INTERNAL_FILE_SERVICE.storeCSAR(Paths.get(csarFile)); - ci.println("Storing CSAR located at \"" + csarFile + "\" was succesfull."); - return; - } - catch (final UserException exc) { - FileServiceCommands.LOG.warn("An User Exception occured.", exc); - } - catch (final SystemException exc) { - FileServiceCommands.LOG.warn("An System Exception occured.", exc); - } - - ci.println("Storing CSAR located at \"" + csarFile + "\" failed."); - - } - - } - - public void _exportCSAR(final CommandInterpreter ci) { - - final String csarID = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (csarID == null) { - ci.println("CSAR ID of CSAR not given."); - inputInvalid = true; - } - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - try { - final Path exportedCSAR = this.INTERNAL_FILE_SERVICE.exportCSAR(new CSARID(csarID)); - ci.println("CSAR \"" + csarID + "\" was successfully exported to \"" + exportedCSAR + "\"."); - return; - } - catch (final SystemException exc) { - FileServiceCommands.LOG.warn("An System Exception occured.", exc); - } - catch (final UserException exc) { - FileServiceCommands.LOG.warn("An User Exception occured.", exc); - } - - ci.println("Exporting CSAR \"" + csarID + "\" failed."); - - } - - } - - public void _printCSARIDs(final CommandInterpreter ci) { - - final Set csarIDs = this.INTERNAL_FILE_SERVICE.getCSARIDs(); - - if (csarIDs.isEmpty()) { - ci.println("No CSARs are currently stored."); - } else { - ci.println("CSAR ID(s) of stored CSAR(s):"); - for (final CSARID csarID : csarIDs) { - ci.println(csarID.toString()); - } - } - - } - - public void _printReadyStorageProviders(final CommandInterpreter ci) { - - final Set readyStorageProviders = this.INTERNAL_FILE_SERVICE.getReadyStorageProviders(); - - if (readyStorageProviders.isEmpty()) { - ci.println("No storage provider is currently ready."); - } else { - ci.println("IDs of ready storage providers:"); - for (final String readyStorageProvider : readyStorageProviders) { - ci.println(readyStorageProvider); - } - } - - } - - public void _printStorageProviders(final CommandInterpreter ci) { - - final Set storageProviderIDs = this.INTERNAL_FILE_SERVICE.getStorageProviders(); - - if (storageProviderIDs.isEmpty()) { - ci.println("No storage provider is currently available."); - } else { - ci.println("Available storage providers:"); - ci.println("-------------------------------------"); - for (final String storageProviderID : storageProviderIDs) { - ci.println("ID: " + storageProviderID); - ci.println("Name: " + this.INTERNAL_FILE_SERVICE.getStorageProviderName(storageProviderID)); - ci.println("-------------------------------------"); - } - } - - } - - public void _printDefaultStorageProvider(final CommandInterpreter ci) { - - final String defaultStorageProvider = this.INTERNAL_FILE_SERVICE.getDefaultStorageProvider(); - - ci.print("ID of default storage provider: " + defaultStorageProvider); - - } - - public void _moveCSAR(final CommandInterpreter ci) { - - final String csarID = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (csarID == null) { - ci.println("CSAR ID of CSAR not given."); - inputInvalid = true; - } - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - try { - this.INTERNAL_FILE_SERVICE.moveCSAR(new CSARID(csarID)); - ci.println("Moving CSAR \"" + csarID + "\" was successfull."); - return; - } - catch (final SystemException exc) { - FileServiceCommands.LOG.warn("An System Exception occured.", exc); - } - catch (final UserException exc) { - FileServiceCommands.LOG.warn("An User Exception occured.", exc); - } - - ci.println("Moving CSAR \"" + csarID + "\" failed."); - - } - - } - - public void _moveFileOrDirectoryOfCSAR(final CommandInterpreter ci) { - - final String csarID = ci.nextArgument(); - final String fileOrDirectory = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (csarID == null) { - ci.println("CSAR ID of CSAR not given."); - inputInvalid = true; - } - - if (fileOrDirectory == null) { - ci.println("Directory / file to move not given."); - inputInvalid = true; - } - - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly two."); - inputInvalid = true; - } - - if (!inputInvalid) { - - try { - this.INTERNAL_FILE_SERVICE.moveFileOrDirectoryOfCSAR(new CSARID(csarID), Paths.get(fileOrDirectory)); - ci.println("Moving directory / file \"" + fileOrDirectory + "\" of CSAR \"" + csarID - + "\" was successfull."); - return; - } - catch (final SystemException exc) { - FileServiceCommands.LOG.warn("An System Exception occured.", exc); - } - catch (final UserException exc) { - FileServiceCommands.LOG.warn("An User Exception occured.", exc); - } - - ci.println("Moving directory / file \"" + fileOrDirectory + "\" of CSAR \"" + csarID + "\" failed."); - - } - - } - - public void _printActiveStorageProvider(final CommandInterpreter ci) { - - final String activeStorageProviderID = this.INTERNAL_FILE_SERVICE.getActiveStorageProvider(); - - if (activeStorageProviderID != null) { - ci.println("ID of active storage provider: " + activeStorageProviderID); - } else { - ci.println("No active storage provider is currently set."); - } - - } - - public void _setActiveStorageProvider(final CommandInterpreter ci) { - - final String activeStorageProviderID = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (activeStorageProviderID == null) { - ci.println("ID of storage provider to set as active not given."); - inputInvalid = true; - } - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - try { - this.INTERNAL_FILE_SERVICE.setActiveStorageProvider(activeStorageProviderID); - ci.println("Setting \"" + activeStorageProviderID + "\" as active storage provider was successfull."); - return; - } - catch (final UserException exc) { - FileServiceCommands.LOG.warn("An User Exception occured.", exc); - } - - ci.println("Setting \"" + activeStorageProviderID + "\" as active storage provider failed."); - - } - - } - - public void _deleteCSAR(final CommandInterpreter ci) { - - final String csarID = ci.nextArgument(); - final String tooManyArguments = ci.nextArgument(); - - boolean inputInvalid = false; - - if (csarID == null) { - ci.println("CSAR ID of CSAR not given."); - inputInvalid = true; - } - if (tooManyArguments != null) { - ci.println("Too many arguments were given. Arguments must be exactly one."); - inputInvalid = true; - } - - if (!inputInvalid) { - try { - this.INTERNAL_FILE_SERVICE.deleteCSAR(new CSARID(csarID)); - ci.println("Deleting CSAR \"" + csarID + "\" was successfull."); - return; - } - catch (final SystemException exc) { - FileServiceCommands.LOG.warn("An System Exception occured.", exc); - } - catch (final UserException exc) { - FileServiceCommands.LOG.warn("An User Exception occured.", exc); - } - - ci.println("Deleting CSAR \"" + csarID + "\" failed."); - - } - - } - - public void _deleteCSARs(final CommandInterpreter ci) { - - try { - this.INTERNAL_FILE_SERVICE.deleteCSARs(); - ci.println("Deleting all CSARs was successfull."); - return; - } - catch (final SystemException exc) { - FileServiceCommands.LOG.warn("An System Exception occured.", exc); - } - - ci.println("Deleting all CSARs failed."); - - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/PathUtils.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/PathUtils.java deleted file mode 100644 index 5e9714be2..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/PathUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.opentosca.container.core.impl.service.internal.file; - -import java.nio.file.Path; - -/** - * File name and file path utilities. - */ -public class PathUtils { - - public final static char FILE_EXTENSION_SEPARATOR = '.'; - - - /** - * @param file - * @param extensions of a file. - * @return {@code true}, if {@code file} has any of the file extensions {@code extensions}, - * otherwise {@code false}. - */ - public static boolean hasFileExtension(final Path file, final String... extensions) { - for (final String extension : extensions) { - if (file.toString().toLowerCase().endsWith(PathUtils.FILE_EXTENSION_SEPARATOR + extension)) { - return true; - } - } - return false; - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/StorageProviderManager.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/StorageProviderManager.java deleted file mode 100644 index 2e9768b2d..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/StorageProviderManager.java +++ /dev/null @@ -1,541 +0,0 @@ -package org.opentosca.container.core.impl.service.internal.file; - -import java.io.InputStream; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.impl.service.internal.CoreInternalFileServiceImpl; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.internal.ICoreInternalFileStorageProviderService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Manages the storage providers of the Core Internal File Service and makes them available. - * - * It provides CSAR specific methods for using a storage provider. This means, for e.g. storing a - * file of a CSAR the CSAR ID, the relative file path to CSAR root and the storage provider ID must - * be passed. With CSAR ID and path the store path on storage provider will be built by using - * {@link #buildFileOfCSARStorageProviderPath(CSARID, Path)}. - * - * Additionally, it provides methods for choosing the storage provider for a operation, getting all - * available and ready storage providers, getting the default storage provider and a getter and - * setter for the active storage provider. - */ -public class StorageProviderManager { - - private final static Logger LOG = LoggerFactory.getLogger(StorageProviderManager.class); - - /** - * Bound, available storage providers.
    - *
    - * Note: Must be {@code static}, because otherwise, if we instantiate this class manually with - * {@code new} and not (automatically) by the OSGi framework, this variable would be not set. - */ - private static final Map STORAGE_PROVIDERS = - Collections.synchronizedMap(new HashMap()); - - /** - * Active storage provider.
    - * After the start of OpenTOSCA, no active storage provider is set. - * - * @see #getActiveStorageProvider() - * @see #setActiveStorageProvider(String) - * - */ - private static String activeStorageProviderID = null; - - /** - * Default storage provider is hard-coded and will be used as a last attempt if the active storage - * provider is not available and ready or not set. - * - * @see #getDefaultStorageProvider() - * - */ - private final String DEFAULT_STORAGE_PROVIDER_ID = "filesystem"; - - - /** - * Chooses a storage provider for an operation.
    - * First, it checks if a active storage provider is set and if it's ready. If this is the case, it's - * ID will be returned. Otherwise it will be checked if the default storage provider is available - * and ready and if so, it's ID will be returned. - * - * @return ID of the active storage provider respectively default storage provider. - * @throws SystemException if active storage provider is not set or not ready and default storage - * provider also can't be used, because it's not available and ready. - */ - public String chooseStorageProvider() throws SystemException { - - StorageProviderManager.LOG.debug("Choosing storage provider..."); - - final String activeStorageProviderID = this.getActiveStorageProvider(); - - if (activeStorageProviderID != null) { - - if (this.isStorageProviderReady(activeStorageProviderID)) { - StorageProviderManager.LOG.debug("Active storage provider \"{}\" will be used.", - activeStorageProviderID); - return activeStorageProviderID; - } - StorageProviderManager.LOG.debug("Active storage provider \"{}\" can't be used.", activeStorageProviderID); - - } else { - - StorageProviderManager.LOG.debug("No active storage provider is set."); - - } - - final String defaultStorageProviderID = this.getDefaultStorageProvider(); - - StorageProviderManager.LOG.debug("Switching to the default storage provider \"{}\".", defaultStorageProviderID); - - if (this.isStorageProviderReady(defaultStorageProviderID)) { - StorageProviderManager.LOG.debug("Default storage provider \"{}\" will be used.", defaultStorageProviderID); - return defaultStorageProviderID; - } - - throw new SystemException( - "Active storage provider is not set / ready and default storage provider is also not available and ready."); - - } - - /** - * @see CoreInternalFileServiceImpl#getStorageProviders() - */ - public Set getStorageProviders() { - - Set storageProviderIDs = null; - - synchronized (StorageProviderManager.STORAGE_PROVIDERS) { - storageProviderIDs = StorageProviderManager.STORAGE_PROVIDERS.keySet(); - } - - return storageProviderIDs; - - } - - /** - * @see CoreInternalFileServiceImpl#setActiveStorageProvider(String) - */ - public void setActiveStorageProvider(final String storageProviderID) throws UserException { - if (storageProviderID == null) { - StorageProviderManager.activeStorageProviderID = null; - StorageProviderManager.LOG.debug("No active storage provider is set now."); - } else if (this.getStorageProvider(storageProviderID) != null) { - StorageProviderManager.activeStorageProviderID = storageProviderID; - StorageProviderManager.LOG.debug("\"{}\" was set as active storage provider.", storageProviderID); - } else { - throw new UserException("Storage provider \"" + storageProviderID - + "\" is not available. Only available storage providers can be set as active storage provider."); - } - } - - /** - * @see CoreInternalFileServiceImpl#getActiveStorageProvider() - */ - public String getActiveStorageProvider() { - if (StorageProviderManager.activeStorageProviderID == null) { - StorageProviderManager.LOG.debug("No active storage provider is set."); - } else { - StorageProviderManager.LOG.debug("Active storage provider: {}", - StorageProviderManager.activeStorageProviderID); - } - return StorageProviderManager.activeStorageProviderID; - } - - /** - * @see CoreInternalFileServiceImpl#getDefaultStorageProvider() - */ - public String getDefaultStorageProvider() { - StorageProviderManager.LOG.debug("Default storage provider: {}", this.DEFAULT_STORAGE_PROVIDER_ID); - return this.DEFAULT_STORAGE_PROVIDER_ID; - } - - /** - * @see CoreInternalFileServiceImpl#getReadyStorageProviders() - */ - public Set getReadyStorageProviders() { - StorageProviderManager.LOG.debug("Retrieving all ready storage providers..."); - final Set readyStorageProviders = new HashSet<>(); - for (final String storageProviderID : this.getStorageProviders()) { - if (this.isStorageProviderReady(storageProviderID)) { - readyStorageProviders.add(storageProviderID); - } - } - return readyStorageProviders; - } - - /** - * @see CoreInternalFileServiceImpl#getStorageProviderName(String) - */ - public String getStorageProviderName(final String storageProviderID) { - String storageProviderName = null; - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - if (storageProvider != null) { - storageProviderName = storageProvider.getStorageProviderName(); - } - return storageProviderName; - } - - /** - * - * @see CoreInternalFileServiceImpl#isReadyStorageProvider(String) - */ - public boolean isStorageProviderReady(final String storageProviderID) { - - if (this.getReadyStorageProvider(storageProviderID) != null) { - return true; - } - - return false; - - } - - /** - * Checks if storage providers with {@code storageProviderIDs} are available and have no unsatisfied - * requirements. - * - * @param storageProviderIDs of storage providers - * @return IDs of storage providers that are not ready. - * - * @see #isStorageProviderReady(String) - * - */ - public Set areStorageProvidersReady(final Set storageProviderIDs) { - - final Set idsOfNotReadyStorageProviders = new HashSet<>(); - - for (final String storageProviderID : storageProviderIDs) { - if (!this.isStorageProviderReady(storageProviderID)) { - idsOfNotReadyStorageProviders.add(storageProviderID); - } - } - - return idsOfNotReadyStorageProviders; - - } - - /** - * Retrieves file {@code fileRelToCSARRoot} of CSAR {@code csarID} on storage provider - * {@code storageProviderID} to file {@code targetAbsPath}. - * - * @param csarID of CSAR - * @param fileRelToCSARRoot - relative path to CSAR root of file - * @param storageProviderID of storage provider - * @param targetAbsPath - local absolute path - * @throws SystemException if storage provider {@code storageProviderID} is not available and ready, - * file {@code fileRelToCSARRoot} of CSAR {@code csarID} was not found on storage provider, - * creating or writing to file {@code targetAbsPath} failed or an error occurred during - * getting. - */ - public void getFileOfCSAR(final CSARID csarID, final Path fileRelToCSARRoot, final String storageProviderID, - final Path targetAbsPath) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getReadyStorageProvider(storageProviderID); - - if (storageProvider != null) { - - final String relFilePathOnStorageProvider = - this.buildFileOfCSARStorageProviderPath(csarID, fileRelToCSARRoot); - - storageProvider.getFile(relFilePathOnStorageProvider, targetAbsPath); - - } else { - - throw new SystemException("Can't get file \"" + fileRelToCSARRoot + "\" of CSAR \"" + csarID - + "\", because storage provider \"" + storageProviderID + "\" is not available and ready."); - - } - - } - - /** - * - * @param csarID of CSAR - * @param fileRelToCSARRoot - relative path to CSAR root of file - * @param storageProviderID of storage provider - * @return File {@code fileRelToCSARRoot} of CSAR {@code csarID} on storage provider - * {@code storageProviderID} as input stream. - * @throws SystemException if storage provider {@code storageProviderID} is not available and ready, - * file {@code fileRelToCSARRoot} of CSAR {@code csarID} was not found on storage provider - * or an error occurred during getting. - */ - public InputStream getFileOfCSARAsInputStream(final CSARID csarID, final Path fileRelToCSARRoot, - final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getReadyStorageProvider(storageProviderID); - - if (storageProvider != null) { - - final String relFilePathOnStorageProvider = - this.buildFileOfCSARStorageProviderPath(csarID, fileRelToCSARRoot); - - final InputStream fileInputStream = storageProvider.getFileAsInputStream(relFilePathOnStorageProvider); - - return fileInputStream; - - } else { - - throw new SystemException("Can't get file \"" + fileRelToCSARRoot + "\" of CSAR \"" + csarID - + "\" as input stream, because storage provider \"" + storageProviderID - + "\" is not available and ready."); - - } - - } - - /** - * @param csarID of CSAR - * @param fileRelToCSARRoot - relative path to CSAR root of file - * @param storageProviderID of storage provider - * @return Size of file {@code fileRelToCSARRoot} of CSAR {@code csarID} on storage provider - * {@code storageProviderID} in bytes. - * @throws SystemException if storage provider {@code storageProviderID} is not available and ready, - * file {@code fileRelToCSARRoot} of CSAR {@code csarID} was not found on storage provider - * or an error occurred during getting size. - */ - public long getFileOfCSARSize(final CSARID csarID, final Path fileRelToCSARRoot, - final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getReadyStorageProvider(storageProviderID); - - if (storageProvider != null) { - - final String relFilePathOnStorageProvider = - this.buildFileOfCSARStorageProviderPath(csarID, fileRelToCSARRoot); - - final long fileSize = storageProvider.getFileSize(relFilePathOnStorageProvider); - - return fileSize; - - } else { - - throw new SystemException("Can't get file \"" + fileRelToCSARRoot + "\" of CSAR \"" + csarID - + "\" as input stream, because storage provider \"" + storageProviderID - + "\" is not available and ready."); - - } - - } - - /** - * Stores the file {@code absFilePath} as file {@code fileRelToCSARRoot} of CSAR {@code csarID} on - * storage provider {@code storageProviderID}. - * - * @param absFilePath - absolute path of file - * @param csarID of CSAR - * @param fileRelToCSARRoot - relative path to CSAR root of file - * @param storageProviderID of storage provider - * @throws SystemException if storage provider {@code storageProviderID} is not available and ready - * or an error occurred during storing. - */ - public void storeFileOfCSAR(final Path absFilePath, final CSARID csarID, final Path fileRelToCSARRoot, - final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getReadyStorageProvider(storageProviderID); - - if (storageProvider != null) { - - final String relFilePathOnStorageProvider = - this.buildFileOfCSARStorageProviderPath(csarID, fileRelToCSARRoot); - - storageProvider.storeFile(absFilePath, relFilePathOnStorageProvider); - - } else { - - throw new SystemException("Can't store file \"" + absFilePath.toString() + "\" as file \"" - + fileRelToCSARRoot.toString() + "\" of CSAR \"" + csarID.toString() + "\", because storage provider \"" - + storageProviderID + "\" is not available and ready."); - - } - - } - - /** - * Deletes the file {@code fileRelToCSARRoot} of CSAR {@code csarID} on storage provider - * {@code storageProviderID}, if it exists. - * - * @param csarID of CSAR - * @param fileRelToCSARRoot - relative path to CSAR root of file - * @param storageProviderID of storage provider - * @throws SystemException if storage provider {@code storageProviderID} is not available and ready - * or an error occurred during deleting. - */ - public void deleteFileOfCSAR(final CSARID csarID, final Path fileRelToCSARRoot, - final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getReadyStorageProvider(storageProviderID); - - if (storageProvider != null) { - - final String relFilePathOnStorageProvider = - this.buildFileOfCSARStorageProviderPath(csarID, fileRelToCSARRoot); - - storageProvider.deleteFile(relFilePathOnStorageProvider); - - } else { - - throw new SystemException("Can't delete file \"" + fileRelToCSARRoot + "\" of CSAR \"" + csarID.toString() - + "\", because storage provider \"" + storageProviderID + "\" is not available and ready."); - - } - - } - - /** - * Stores the file input stream {@code fileInputStream} as file {@code fileRelToCSARRoot} of CSAR - * {@code csarID} on storage provider {@code storageProviderID}. - * - * @param csarID of CSAR - * @param fileInputStream of file - * @param fileSize - size of file - * @param fileRelToCSARRoot - relative path to CSAR root of file - * @param storageProviderID of storage provider - * @throws SystemException if storage provider {@code storageProviderID} is not available and ready - * or an error occurred during storing. - */ - public void storeFileOfCSAR(final CSARID csarID, final InputStream fileInputStream, final long fileSize, - final Path fileRelToCSARRoot, final String storageProviderID) throws SystemException { - - final ICoreInternalFileStorageProviderService storageProvider = this.getReadyStorageProvider(storageProviderID); - - if (storageProvider != null) { - - final String relFilePathOnStorageProvider = - this.buildFileOfCSARStorageProviderPath(csarID, fileRelToCSARRoot); - - storageProvider.storeFile(fileInputStream, fileSize, relFilePathOnStorageProvider); - } else { - - throw new SystemException( - "Can't store file input stream as file \"" + fileRelToCSARRoot + "\" of CSAR \"" + csarID.toString() - + "\", because storage provider \"" + storageProviderID + "\" is not available and ready."); - - } - - } - - /** - * @param storageProviderID of storage provider. - * @return Storage provider {@code storageProvider} if it's ready, otherwise {@code null}. - */ - private ICoreInternalFileStorageProviderService getReadyStorageProvider(final String storageProviderID) { - - StorageProviderManager.LOG.debug("Checking if storage provider \"{}\" is ready...", storageProviderID); - - final ICoreInternalFileStorageProviderService storageProvider = this.getStorageProvider(storageProviderID); - - if (storageProvider != null) { - - if (storageProvider.isStorageProviderReady()) { - StorageProviderManager.LOG.debug("Storage provider \"{}\" is ready.", storageProviderID); - return storageProvider; - } - - StorageProviderManager.LOG.warn("Storage provider \"{}\" is not ready.", storageProviderID); - - } - - return null; - - } - - /** - * @param storageProviderID of storage provider. - * @return Storage provider {@code storageProviderID} if it's available, otherwise {@code null}. - */ - private ICoreInternalFileStorageProviderService getStorageProvider(final String storageProviderID) { - - ICoreInternalFileStorageProviderService storageProvider; - - synchronized (StorageProviderManager.STORAGE_PROVIDERS) { - storageProvider = StorageProviderManager.STORAGE_PROVIDERS.get(storageProviderID); - } - - if (storageProvider != null) { - StorageProviderManager.LOG.debug("Storage provider \"{}\" is available.", storageProviderID); - } else { - StorageProviderManager.LOG.debug("Storage provider \"{}\" is not available.", storageProviderID); - } - - return storageProvider; - - } - - /** - * Builds the relative path where file {@code relFilePathToCSARRoot} of CSAR {@code csarID} should - * be stored / is located on a storage provider.
    - *
    - * Location of a file of a CSAR on a storage provider:
    - * {@code /}
    - *
    - * Note: On a blob store usually this path will be created in a container. Name of the container is - * defined by the storage provider. - * - * @param csarID of CSAR - * @param relFilePathToCSARRoot - relative path to CSAR root of file - * @return Relative path where the CSAR file should be stored / is located. - */ - private String buildFileOfCSARStorageProviderPath(final CSARID csarID, final Path relFilePathToCSARRoot) { - final String relFilePathToStore = Paths.get(csarID.toString()).resolve(relFilePathToCSARRoot).toString(); - return relFilePathToStore; - } - - /** - * Binds a storage provider. - * - * @param storageProvider to bind - */ - protected void bindCoreInternalFileStorageProviderService(final ICoreInternalFileStorageProviderService storageProvider) { - if (storageProvider != null) { - - final String storageProviderID = storageProvider.getStorageProviderID(); - - StorageProviderManager.STORAGE_PROVIDERS.put(storageProviderID, storageProvider); - StorageProviderManager.LOG.debug("Storage provider \"{}\" ({}) bound.", storageProviderID, - storageProvider.getStorageProviderName()); - } else { - StorageProviderManager.LOG.warn("Binding a storage provider failed."); - } - } - - /** - * Unbinds a storage provider.
    - * If the active storage provider will be unbound, no active storage provider is set (setting will - * be cleared). - * - * @param storageProvider to unbind - * @see CoreInternalFileServiceImpl#setActiveStorageProvider(String) - */ - protected void unbindCoreInternalFileStorageProviderService(final ICoreInternalFileStorageProviderService storageProvider) { - - if (storageProvider != null) { - - final String storageProviderID = storageProvider.getStorageProviderID(); - - StorageProviderManager.STORAGE_PROVIDERS.remove(storageProviderID); - StorageProviderManager.LOG.debug("Storage provider \"{}\" ({}) unbound.", storageProviderID, - storageProvider.getStorageProviderName()); - - // if active storage provider was unbound clear active storage - // provider setting - if (this.getActiveStorageProvider() != null && this.getActiveStorageProvider().equals(storageProviderID)) { - StorageProviderManager.activeStorageProviderID = null; - StorageProviderManager.LOG.debug("Active storage provider \"{}\" is not more available. Thus, active storage provider was unset.", - storageProviderID); - } - - } else { - StorageProviderManager.LOG.warn("Unbinding a storage provider failed."); - } - - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARMetaDataJPAStore.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARMetaDataJPAStore.java deleted file mode 100644 index cd044a855..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARMetaDataJPAStore.java +++ /dev/null @@ -1,279 +0,0 @@ -package org.opentosca.container.core.impl.service.internal.file.csar; - -import java.nio.file.Path; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.persistence.EntityManager; -import javax.persistence.Query; -import javax.persistence.TypedQuery; - -import org.opentosca.container.core.common.NotFoundException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.csar.toscametafile.TOSCAMetaFile; -import org.opentosca.container.core.next.jpa.EntityManagerProvider; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Manages CSAR meta data in the database by using Eclipse Link (JPA). - */ -public class CSARMetaDataJPAStore { - - private final static Logger LOG = LoggerFactory.getLogger(CSARMetaDataJPAStore.class); - - private EntityManager em; - - - /** - * Initializes JPA. - */ - private void initJPA() { - if (this.em == null) { - this.em = EntityManagerProvider.createEntityManager(); - } - } - - /** - * This method is called when the garbage collector destroys the class. We will then manually close - * the EntityManager / Factory and pass control back. - */ - @Override - protected void finalize() throws Throwable { - this.em.close(); - super.finalize(); - } - - /** - * Persists the meta data of CSAR {@code csarID}. - * - * @param csarID of the CSAR. - * @param directories - all directories of the CSAR relative to CSAR root. - * @param fileToStorageProviderIDMap - file to storage provider ID mapping of all files of the CSAR. - * Each file path must be given relative to the CSAR root. - * @param toscaMetaFile - represents the content of the TOSCA meta file of the CSAR. - */ - public void storeCSARMetaData(final CSARID csarID, final Set directories, - final Map fileToStorageProviderIDMap, - final TOSCAMetaFile toscaMetaFile) { - - CSARMetaDataJPAStore.LOG.debug("Storing meta data of CSAR \"{}\"...", csarID); - - final CSARContent csar = new CSARContent(csarID, directories, fileToStorageProviderIDMap, toscaMetaFile); - - initJPA(); - - this.em.getTransaction().begin(); - this.em.persist(csar); - this.em.getTransaction().commit(); - - // clear the JPA 1st level cache - this.em.clear(); - - CSARMetaDataJPAStore.LOG.debug("Storing meta data of CSAR \"{}\" completed.", csarID); - - } - - /** - * @param csarID of CSAR - * @return {@code true} if meta data of CSAR {@code csarID} were found, otherwise {@code false}. - */ - public boolean isCSARMetaDataStored(final CSARID csarID) { - - CSARMetaDataJPAStore.LOG.debug("Checking if meta data of CSAR \"{}\" are stored...", csarID); - initJPA(); - - final CSARContent csar = this.em.find(CSARContent.class, csarID); - - if (csar == null) { - CSARMetaDataJPAStore.LOG.debug("Meta data of CSAR \"{}\" were not found.", csarID); - return false; - } - - CSARMetaDataJPAStore.LOG.debug("Meta data of CSAR \"{}\" were found.", csarID); - return true; - - } - - /** - * Retrieves the meta data of CSAR {@code csarID}. - * - * @param csarID of CSAR. - * @return {@link CSARContent} that gives access to all files and directories and the TOSCA meta - * file of the CSAR. - * @throws UserException if meta data of CSAR {@code csarID} were not found. - */ - public CSARContent getCSARMetaData(final CSARID csarID) throws UserException { - - initJPA(); - - CSARMetaDataJPAStore.LOG.debug("Retrieving meta data of CSAR \"{}\"...", csarID); - - final CSARContent csar = this.em.find(CSARContent.class, csarID); - - if (csar == null) { - CSARMetaDataJPAStore.LOG.debug("Meta data of CSAR \"{}\" were not found.", csarID); - throw new NotFoundException(); - } - - CSARMetaDataJPAStore.LOG.debug("Meta data of CSAR \"{}\" were retrieved.", csarID); - - return csar; - } - - /** - * @return CSAR IDs of all stored CSAR files. - */ - public Set getCSARIDsMetaData() { - - CSARMetaDataJPAStore.LOG.trace("Retrieving CSAR IDs of all stored CSARs..."); - initJPA(); - final Query getCSARIDsQuery = this.em.createNamedQuery(CSARContent.getCSARIDs); - - @SuppressWarnings("unchecked") - final List csarIDs = getCSARIDsQuery.getResultList(); - CSARMetaDataJPAStore.LOG.trace("{} CSAR ID(s) was / were found.", csarIDs.size()); - return new HashSet<>(csarIDs); - - } - - /** - * Deletes the meta data of CSAR {@code csarID}. - * - * @param csarID of CSAR. - * @throws UserException if meta data of CSAR {@code csarID} were not found. - */ - public void deleteCSARMetaData(final CSARID csarID) throws UserException { - - initJPA(); - - CSARMetaDataJPAStore.LOG.debug("Deleting meta data of CSAR \"{}\"...", csarID); - - final CSARContent csarContent = getCSARMetaData(csarID); - - this.em.getTransaction().begin(); - this.em.remove(csarContent); - this.em.getTransaction().commit(); - - CSARMetaDataJPAStore.LOG.debug("Deleting meta data of CSAR \"{}\" completed.", csarID); - - } - - /** - * Persists / updates the storage provider ID of file {@code fileRelToCSARRoot} in CSAR - * {@code csarID} to {@code storageProviderID}. - * - * @param csarID of CSAR. - * @param fileRelToCSARRoot - file relative to CSAR root. - * @param storageProviderID of storage provider to set for file {@code fileRelToCSARRoot}. - * @throws UserException if meta data of file {@code fileRelToCSARRoot} in CSAR {@code CSARID} were - * not found. - */ - public void storeFileStorageProviderIDOfCSAR(final CSARID csarID, final Path fileRelToCSARRoot, - final String storageProviderID) throws UserException { - - CSARMetaDataJPAStore.LOG.debug("Setting storage provider \"{}\" in meta data of file \"{}\" in CSAR \"{}\"...", - storageProviderID, fileRelToCSARRoot, csarID); - - initJPA(); - - final Query storeStorageProviderIDByFileAndCSARIDQuery = - this.em.createNamedQuery(CSARContent.storeStorageProviderIDByFileAndCSARID); - - storeStorageProviderIDByFileAndCSARIDQuery.setParameter(1, storageProviderID); - storeStorageProviderIDByFileAndCSARIDQuery.setParameter(2, fileRelToCSARRoot.toString()); - storeStorageProviderIDByFileAndCSARIDQuery.setParameter(3, csarID.toString()); - - this.em.getTransaction().begin(); - final int updatedFiles = storeStorageProviderIDByFileAndCSARIDQuery.executeUpdate(); - this.em.getTransaction().commit(); - - if (updatedFiles > 0) { - - // After the execution of the native query we must manually - // synchronize the persistence context with the database context. - // For this will clear the 1st level cache and invalidate the - // CSARContent entity in the 2nd level cache. - this.em.clear(); - // emf.getCache().evict(CSARContent.class, csarID); - - CSARMetaDataJPAStore.LOG.debug("Setting storage provider \"{}\" in meta data of file \"{}\" in CSAR \"{}\" completed.", - storageProviderID, fileRelToCSARRoot, csarID); - - } else { - throw new UserException( - "Meta data of file \"" + fileRelToCSARRoot + "\" of CSAR \"" + csarID + "\" were not found."); - } - - } - - /** - * @param csarID of CSAR. - * @return Each file of CSAR {@code csarID} relative to CSAR root mapped to the ID of the storage - * provider the file is stored on. - * @throws UserException if file to storage provider ID mapping meta data of CSAR {@code csarID} - * were not found. - */ - public Map getFileToStorageProviderIDMap(final CSARID csarID) throws UserException { - CSARMetaDataJPAStore.LOG.debug("Retrieving file to storage provider mapping meta data of CSAR \"{}\"...", - csarID); - initJPA(); - final Query getFileToStorageProviderIDMapQuery = - this.em.createNamedQuery(CSARContent.getFileToStorageProviderIDMapByCSARID); - getFileToStorageProviderIDMapQuery.setParameter("csarID", csarID); - - @SuppressWarnings("unchecked") - final List fileToStorageProviderIDEntries = getFileToStorageProviderIDMapQuery.getResultList(); - - if (fileToStorageProviderIDEntries.isEmpty()) { - throw new UserException("Meta data of CSAR \"" + csarID + "\" were not found."); - } - - final Map fileToStorageProviderIDMap = new HashMap<>(); - - for (final Object[] fileToStorageProviderIDEntry : fileToStorageProviderIDEntries) { - final Path file = (Path) fileToStorageProviderIDEntry[0]; - final String storageProviderID = (String) fileToStorageProviderIDEntry[1]; - fileToStorageProviderIDMap.put(file, storageProviderID); - } - - CSARMetaDataJPAStore.LOG.debug("Retrieving file to storage provider mapping meta data of CSAR \"{}\" completed.", - csarID); - - return fileToStorageProviderIDMap; - - } - - /** - * @param csarID of CSAR. - * @return Directories meta data of CSAR {@code csarID}. - * @throws UserException if directories meta data of CSAR {@code csarID} were not found. - */ - public Set getDirectories(final CSARID csarID) throws UserException { - - CSARMetaDataJPAStore.LOG.debug("Retrieving directories meta data of CSAR \"{}\"...", csarID); - - initJPA(); - - final TypedQuery getDirectoriesQuery = - this.em.createNamedQuery(CSARContent.getDirectoriesByCSARID, CSARContent.class); - getDirectoriesQuery.setParameter("csarID", csarID); - - final CSARContent result = getDirectoriesQuery.getSingleResult(); - - if (result == null) { - throw new UserException("Meta data of CSAR \"" + csarID + "\" were not found."); - } - - final Set directories = result.getDirectoriesJpa(); - - LOG.debug("Directories: {}", directories.size()); - CSARMetaDataJPAStore.LOG.debug("Retrieving directories meta data of CSAR \"{}\" completed.", csarID); - return directories; - } -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARUnpacker.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARUnpacker.java deleted file mode 100644 index 49b240643..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARUnpacker.java +++ /dev/null @@ -1,194 +0,0 @@ -package org.opentosca.container.core.impl.service.internal.file.csar; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryDeleteVisitor; -import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryVisitor; -import org.opentosca.container.core.service.IFileAccessService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Unpacks a CSAR file and gets its files and directories. - */ -public class CSARUnpacker { - - private static IFileAccessService fileAccessService; - - private final static Logger LOG = LoggerFactory.getLogger(CSARUnpacker.class); - - private final Path CSAR_FILE; - - private Path csarUnpackDirectory; - private DirectoryVisitor csarVisitor; - - - /** - * Default constructor needed by OSGi to instantiate this class. - */ - public CSARUnpacker() { - this.CSAR_FILE = null; - } - - /** - * Creates a {@code CSARUnpacker}. - * - * @param csarFile to process. - */ - public CSARUnpacker(final Path csarFile) { - this.CSAR_FILE = csarFile; - } - - /** - * Unpacks the CSAR file to a Temp directory from {@link IFileAccessService#getTemp()} and gets all - * files and directories in the unpack directory.
    - *
    - * Note: If unpacking or getting files and directories in unpacking directory failed, deleting - * unpack directory will be tried. - * - * - * @throws SystemException if unpacking or getting files and directories in unpack directory failed. - */ - public void unpackAndVisitUnpackDir() throws UserException, SystemException { - - CSARUnpacker.LOG.debug("Unpacking CSAR located at \"{}\"...", this.CSAR_FILE); - - final File tempDirectory = CSARUnpacker.fileAccessService.getTemp(); - - CSARUnpacker.LOG.debug("Unpacking directory: {}", tempDirectory); - - try { - - this.csarUnpackDirectory = tempDirectory.toPath(); - - final List unpackedFiles = - CSARUnpacker.fileAccessService.unzip(this.CSAR_FILE.toFile(), tempDirectory); - - if (unpackedFiles == null) { - throw new UserException("Unpacking file located at \"" + this.CSAR_FILE.toString() + "\" failed."); - } - - this.visitUnpackDir(); - - CSARUnpacker.LOG.debug("Unpacking CSAR located at \"{}\" and getting its files and directories completed.", - this.CSAR_FILE); - - } - catch (UserException | SystemException exc) { - this.deleteUnpackDir(); - throw exc; - } - - } - - /** - * @return Directory where the CSAR was unpacked. If {@link #unpackAndVisitUnpackDir()} was not - * executed yet or failed {@code null}. - */ - public Path getUnpackDirectory() { - return this.csarUnpackDirectory; - } - - /** - * - * @return Files and directories in CSAR unpack directory as {@link DirectoryVisitor}. If - * {@link #unpackAndVisitUnpackDir()} was not executed yet or failed {@code null}. - */ - public DirectoryVisitor getFilesAndDirectories() { - return this.csarVisitor; - } - - /** - * Getting recursively all files and directories in the unpack directory. - * - * @throws SystemException if access to an directory denied that must be visited - */ - private void visitUnpackDir() throws SystemException { - - CSARUnpacker.LOG.debug("Getting files and directories in CSAR unpack directory \"{}\"...", - this.csarUnpackDirectory); - - final DirectoryVisitor directoryVisitor = new DirectoryVisitor(); - - try { - - Files.walkFileTree(this.csarUnpackDirectory, directoryVisitor); - - // removes the unpack directory (only the directory content is - // necessary) - directoryVisitor.getVisitedDirectories().remove(this.csarUnpackDirectory); - - CSARUnpacker.LOG.debug("Getting files and directories in CSAR unpack directory \"{}\" completed.", - this.csarUnpackDirectory); - - this.csarVisitor = directoryVisitor; - - } - catch (final IOException exc) { - throw new SystemException( - "An IO Exception occurred. Getting files and directorties in CSAR unpack directory \"" - + this.csarUnpackDirectory.toString() + "\" failed.", - exc); - } - - } - - /** - * Deletes the unpack directory. - * - * @throws SystemException if access to an directory denied that must be deleted. - */ - public void deleteUnpackDir() throws SystemException { - - CSARUnpacker.LOG.debug("Deleting CSAR unpack dir \"{}\"...", this.csarUnpackDirectory); - - final DirectoryDeleteVisitor csarDeleteVisitor = new DirectoryDeleteVisitor(); - - try { - Files.walkFileTree(this.csarUnpackDirectory, csarDeleteVisitor); - CSARUnpacker.LOG.debug("Deleting CSAR unpack dir \"{}\" completed.", this.csarUnpackDirectory); - } - catch (final IOException exc) { - throw new SystemException( - "An IO Exception occurred. Deleting files and directories in CSAR unpack directory \"" - + this.csarUnpackDirectory.toString() + "\" failed.", - exc); - } - finally { - this.csarUnpackDirectory = null; - this.csarVisitor = null; - } - - } - - /** - * Binds the File Access Service. - * - * @param fileAccessService to bind - */ - protected void bindFileAccessService(final IFileAccessService fileAccessService) { - if (fileAccessService == null) { - CSARUnpacker.LOG.warn("Can't bind File Access Service."); - } else { - CSARUnpacker.fileAccessService = fileAccessService; - CSARUnpacker.LOG.debug("File Access Service bound."); - } - } - - /** - * Unbinds the File Access Service. - * - * @param fileAccessService to unbind - */ - protected void unbindFileAccessService(final IFileAccessService fileAccessService) { - CSARUnpacker.fileAccessService = null; - CSARUnpacker.LOG.debug("File Access Service unbound."); - } - -} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARValidator.java b/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARValidator.java deleted file mode 100644 index 45bc0bedb..000000000 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/csar/CSARValidator.java +++ /dev/null @@ -1,175 +0,0 @@ -package org.opentosca.container.core.impl.service.internal.file.csar; - -import java.nio.file.Path; -import java.util.Set; - -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryVisitor; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Validates the content of a CSAR. - */ -public class CSARValidator { - - private final static Logger LOG = LoggerFactory.getLogger(CSARValidator.class); - - /** - * Relative path to CSAR root of the {@code Definitions} directory. - * - * @see org.opentosca.settings.Settings - */ - private final String CSAR_DEFINITIONS_DIR_REL_PATH = Settings.getSetting("csarDefinitionsRelPath"); - - /** - * Relative path to CSAR root of the TOSCA meta file. - * - * @see org.opentosca.settings.Settings - */ - private final String TOSCA_META_FILE_REL_PATH = Settings.getSetting("toscaMetaFileRelPath"); - - // /** - // * Possible file extensions of a TOSCA file. - // * - // * @see org.opentosca.settings.Settings - // */ - // private final String[] TOSCA_FILE_EXTENSIONS = - // Settings.getSetting("toscaFileExtensions").split(";"); - - /** - * CSAR ID of the CSAR to validate. - */ - private final CSARID CSAR_ID; - - /** - * Absolute path to unpack directory of the CSAR to validate. - */ - private final Path CSAR_UNPACK_DIR; - - /** - * Contains all directories and files in the unpack directory of the CSAR to validate. - */ - private final DirectoryVisitor CSAR_VISITOR; - - /** - * Error message that can fetched if any errors occurred during validation. - */ - private final StringBuilder errorMessage = new StringBuilder(); - - private boolean isValidCSAR = true; - - - /** - * Creates a {@link CSARValidator}.
    - * After creation {@link #isValid()} should be called to validate the CSAR content. - * - * @param csarID of CSAR - * @param csarUnpackDir - absolute path of CSAR unpack directory - * @param csarVisitor - must contain all files and directories in {@code csarUnpackDir}. - */ - public CSARValidator(final CSARID csarID, final Path csarUnpackDir, final DirectoryVisitor csarVisitor) { - this.CSAR_ID = csarID; - this.CSAR_UNPACK_DIR = csarUnpackDir; - this.CSAR_VISITOR = csarVisitor; - } - - /** - * Basic validation of the content of the CSAR. - * - * @return {@code true} if content of CSAR is valid, otherwise {@code false} . - */ - public boolean isValid() { - - CSARValidator.LOG.debug("Validating content of CSAR \"{}\"...", this.CSAR_ID); - - final Set csarFiles = this.CSAR_VISITOR.getVisitedFiles(); - - if (!this.containsTOSCAs(this.CSAR_ID, this.CSAR_UNPACK_DIR, csarFiles)) { - this.isValidCSAR = false; - } - - if (!this.existsTOSCAMetaFile(this.CSAR_ID, this.CSAR_UNPACK_DIR, csarFiles)) { - this.isValidCSAR = false; - } - - if (this.isValidCSAR) { - CSARValidator.LOG.debug("Validation of CSAR \"{}\" completed. CSAR is valid.", this.CSAR_ID); - } else { - CSARValidator.LOG.warn("Validation of CSAR \"{}\" completed. CSAR is invalid!", this.CSAR_ID); - } - - return this.isValidCSAR; - } - - /** - * - * @return Occurred errors during validation of CSAR. If CSAR was not validated yet using - * {@link CSARValidator#isValid()} or no errors occurred {@code null}. - */ - public String getErrorMessage() { - if (this.isValidCSAR) { - return null; - } else { - // add beginning to error message - this.errorMessage.insert(0, "Content of CSAR \"" + this.CSAR_ID + "\" is invalid. Found errors:"); - return this.errorMessage.toString(); - } - } - - /** - * @param csarID of CSAR. - * @param csarUnpackDir - absolute path of CSAR unpack directory - * @param csarFiles - all files in {@code csarUnpackDir}. - * @return {@code true} if {@code Definitions} directory of CSAR {@code csarID} contains at least - * one TOSCA file, otherwise {@code false}. - */ - private boolean containsTOSCAs(final CSARID csarID, final Path csarUnpackDir, final Set csarFiles) { - - final Path csarDefinitionsDirAbsPath = csarUnpackDir.resolve(this.CSAR_DEFINITIONS_DIR_REL_PATH); - - for (final Path csarFile : csarFiles) { - if (csarFile.startsWith(csarDefinitionsDirAbsPath) /* - * && PathUtils. hasFileExtension (csarFile, this. - * TOSCA_FILE_EXTENSIONS ) - */) { - CSARValidator.LOG.debug("At least one file was found in directory \"{}\" of CSAR \"{}\".", - this.CSAR_DEFINITIONS_DIR_REL_PATH, this.CSAR_ID); - return true; - } - } - - this.errorMessage.append("\n"); - this.errorMessage.append("No files were found in directory \"" + this.CSAR_DEFINITIONS_DIR_REL_PATH - + "\" of CSAR \"" + this.CSAR_ID + "\". There must be at least one!"); - - return false; - - } - - /** - * @param csarID of CSAR. - * @param csarUnpackDir - absolute path of CSAR unpack directory - * @param csarFiles - all files in {@code csarUnpackDir}. - * @return {@code true} if TOSCA meta file exists in CSAR {@code csarID}, otherwise {@code false}. - */ - private boolean existsTOSCAMetaFile(final CSARID csarID, final Path csarUnpackDir, final Set csarFiles) { - - final Path toscaMetaFileAbsPath = csarUnpackDir.resolve(this.TOSCA_META_FILE_REL_PATH); - - if (csarFiles.contains(toscaMetaFileAbsPath)) { - CSARValidator.LOG.debug("TOSCA meta file exists at \"{}\" in CSAR \"{}\".", this.TOSCA_META_FILE_REL_PATH, - this.CSAR_ID); - return true; - } - - this.errorMessage.append("\n"); - this.errorMessage.append("TOSCA meta file does not exist at \"" + this.TOSCA_META_FILE_REL_PATH - + "\" in CSAR \"" + this.CSAR_ID + "\"."); - - return false; - - } - -} diff --git a/org.opentosca.container.core.tosca/META-INF/MANIFEST.MF b/org.opentosca.container.core.tosca/META-INF/MANIFEST.MF deleted file mode 100644 index 768a7cbbb..000000000 --- a/org.opentosca.container.core.tosca/META-INF/MANIFEST.MF +++ /dev/null @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container TOSCA Model -Bundle-SymbolicName: org.opentosca.container.core.tosca -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Import-Package: org.osgi.framework;version="1.8.0", - org.slf4j;version="1.7.2" -Export-Package: org.opentosca.container.core.tosca, - org.opentosca.container.core.tosca.convention, - org.opentosca.container.core.tosca.extension, - org.opentosca.container.core.tosca.model -Bundle-Activator: org.opentosca.container.core.tosca.Activator diff --git a/org.opentosca.container.core.tosca/build.properties b/org.opentosca.container.core.tosca/build.properties deleted file mode 100644 index b107977f4..000000000 --- a/org.opentosca.container.core.tosca/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.container.core.tosca/pom.xml b/org.opentosca.container.core.tosca/pom.xml index 97a2ae7c6..0cb9c1cd0 100644 --- a/org.opentosca.container.core.tosca/pom.xml +++ b/org.opentosca.container.core.tosca/pom.xml @@ -1,6 +1,6 @@ + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 @@ -10,6 +10,12 @@ org.opentosca.container.core.tosca - eclipse-plugin + + + + com.github.opentosca.winery + org.eclipse.winery.model.tosca + + diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Interfaces.java b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Interfaces.java similarity index 91% rename from org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Interfaces.java rename to org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Interfaces.java index 61a44b60d..232bd0272 100644 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Interfaces.java +++ b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Interfaces.java @@ -20,8 +20,7 @@ public class Interfaces { public static final String OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER = "removeContainer"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER = "ContainerManagementInterface"; - public static final String OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_Backup = - "http://opentosca.org/interfaces/backup"; + public static final String OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_Backup = "http://opentosca.org/interfaces/backup"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_RUNSCRIPT = "runScript"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_TRANSFERFILE = "transferFile"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_Freeze = "freeze"; @@ -29,8 +28,7 @@ public class Interfaces { public static final String OPENTOSCA_DECLARATIVE_INTERFACE_STATE = "http://opentosca.org/interfaces/state"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE = "freeze"; - public static final String OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT = - "StoreStateServiceEndpoint"; + public static final String OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT = "StoreStateServiceEndpoint"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_STATE_DEFREEZE = "defrost"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_PACKAGENAMES = "PackageNames"; @@ -40,30 +38,27 @@ public class Interfaces { public static final String OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_PARAMETER_SOURCEURLORLOCALPATH = "SourceURLorLocalPath"; - public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE = - "http://www.example.com/interfaces/lifecycle"; + public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE = "http://www.example.com/interfaces/lifecycle"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE2 = "http://opentosca.org/interfaces/lifecycle"; - public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE3 = "http://opentosca.org/interfaces/pattern/lifecycle"; + public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE3 = "http://opentosca.org/interfaces/pattern/lifecycle"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_INSTALL = "install"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_CONFIGURE = "configure"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START = "start"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP = "stop"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_UNINSTALL = "uninstall"; - public static final String OPENTOSCA_DECLARATIVE_INTERFACE_CONTAINERPATTERN = - "http://opentosca.org/interfaces/pattern/container"; + public static final String OPENTOSCA_DECLARATIVE_INTERFACE_CONTAINERPATTERN = "http://opentosca.org/interfaces/pattern/container"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_CONTAINERPATTERN_CREATE = "create"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_CONTAINERPATTERN_TERMINATE = "terminate"; - + public static final String OPENTOSCA_DECLARATIVE_INTERFACE_REMOTEMANAGERPATTERN = "http://opentosca.org/interfaces/pattern/remotemanager"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_REMOTEMANAGERPATTERN_INSTALL = "install"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_REMOTEMANAGERPATTERN_UNINSTALL = "uninstall"; - public static final String OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE = "http://opentosca.org/interfaces/connections/nonInterruptive"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_CONNECTTO = "connectTo"; public static final String OPENTOSCA_DECLARATIVE_INTERFACE_TEST = "http://opentosca.org/interfaces/test"; -} \ No newline at end of file +} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Properties.java b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Properties.java similarity index 100% rename from org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Properties.java rename to org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Properties.java diff --git a/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Types.java b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Types.java new file mode 100644 index 000000000..ff4c77256 --- /dev/null +++ b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Types.java @@ -0,0 +1,109 @@ +package org.opentosca.container.core.tosca.convention; + +import javax.xml.namespace.QName; + +public class Types { + + // TODO refactor this class into some kind of configuration file to make it much more flexible ? + + // TODO Remove the old stuff + // cloud provider nodeTypes (old) + public final static QName ec2NodeType = new QName("http://opentosca.org/types/declarative", "EC2"); + public final static QName openStackNodeType = new QName("http://opentosca.org/types/declarative", "OpenStack"); + + // virtual machine nodeTypes (old) + public final static QName vmNodeType = new QName("http://opentosca.org/types/declarative", "VM"); + public final static QName ubuntuNodeType = new QName("http://opentosca.org/types/declarative", "Ubuntu"); + public final static QName ubuntu1310ServerNodeType = + new QName("http://opentosca.org/types/declarative", "Ubuntu-13.10-Server"); + public final static QName ubuntu1310ServerVmNodeType = + new QName("http://opentosca.org/types/declarative", "Ubuntu-13.10-Server-VM"); + + // cloud provider nodeTypes + public final static QName openStackLiberty12NodeType = + new QName("http://opentosca.org/nodetypes", "OpenStack-Liberty-12"); + public final static QName openStackTrainNodeType = + new QName("http://opentosca.org/nodetypes", "OpenStack_Train-w1"); + public final static QName vmWareVsphere55NodeType = new QName("http://opentosca.org/nodetypes", "VSphere_5.5"); + + public final static QName amazonEc2NodeType = new QName("http://opentosca.org/NodeTypes", "AmazonEC2"); + + // docker nodeTypes + public final static QName dockerEngineNodeType = new QName("http://opentosca.org/nodetypes", "DockerEngine"); + + public final static QName dockerContainerNodeType = new QName("http://opentosca.org/nodetypes", "DockerContainer"); + + // docker nodeTypes (old) + public final static QName dockerEngineNodeTypeAlt = new QName("http://opentosca.org/NodeTypes", "DockerEngine"); + + // abstract operating system node type + public final static QName abstractOperatingSystemNodeType = + new QName("http://opentosca.org/nodetypes", "OperatingSystem"); + + // virtual machine nodeTypes + public final static QName ubuntu1404ServerVmNodeType = + new QName("http://opentosca.org/nodetypes", "Ubuntu-14.04-VM"); + + public final static QName ubuntu1404ServerVmNodeType2 = + new QName("http://opentosca.org/NodeTypes", "Ubuntu-14.04-VM"); + + public final static QName ubuntu1404ServerVmNodeType3 = + new QName("http://opentosca.org/nodetypes", "Ubuntu-VM_14.04-w1"); + + public final static QName ubuntu1604ServerVmNodeType = + new QName("http://opentosca.org/nodetypes", "Ubuntu-VM_16.04-w1"); + + public final static QName ubuntu1804ServerVmNodeType = + new QName("http://opentosca.org/nodetypes", "Ubuntu-VM_18.04-w1"); + + // FIXME: find a better way to support generated NodeTypes + public final static QName ubuntu1804ServerVmNodeTypeGenerated = + new QName("http://opentosca.org/nodetypes/generated", "Ubuntu-VM_18.04"); + public final static QName openStackLiberty12NodeTypeGenerated = + new QName("http://opentosca.org/nodetypes/generated", "OpenStack-Liberty-12"); + + // OS + // raspbian OS nodeType + public final static QName raspbianJessieOSNodeType = new QName("http://opentosca.org/nodetypes", "RaspbianJessie"); + + // remote host nodeType for nodes not managed by opentosca + public final static QName remoteHostNodeType = new QName("http://opentosca.org/nodetypes", "RemoteHost"); + + // local linux hypervisor nodeType + public final static QName localHypervisor = new QName("http://opentosca.org/nodetypes", "Libvirt-Qemu-KVM"); + // relationship types + public final static QName connectsToRelationType = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ConnectsTo"); + public final static QName dependsOnRelationType = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "DependsOn"); + public final static QName deployedOnRelationType = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "DeployedOn"); + public final static QName hostedOnRelationType = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "HostedOn"); + + public final static QName KVM_QEMU_VM_TYPE = new QName("http://opentosca.org/nodetypes", "KVM_QEMU_VM"); + public final static QName KVM_QEMU_HYPERVISOR_TYPE = + new QName("http://opentosca.org/nodetypes", "KVM_QEMU_Hypervisor"); + + public static final QName TOSCABASETYPE_SERVER = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "Server"); + + public static final QName TOSCABASETYPE_OS = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "OperatingSystem"); + + // ArtifactTypes + public static final QName scriptArtifactType = new QName( + "http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ScriptArtifact"); + + // hardware, such as sensors, actuators and devices + public static final QName raspberryPi3 = new QName("http://opentosca.org/nodetypes", "RaspberryPI3"); + public static final QName fs20Adapater = new QName("http://opentosca.org/nodetypes", "FS20_USBDongle"); + public static final QName lineFollowerSensor = new QName("http://opentosca.org/nodetypes", "LineFollowerSensor_1-w1-wip1"); + public static final QName mCore = new QName("http://opentosca.org/nodetypes", "mCore_1-w1-wip1"); + public static final QName mBot = new QName("http://opentosca.org/nodetypes", "mBot_1-w1-wip1"); + public static final QName ultrasonicSensor = new QName("http://opentosca.org/nodetypes", "UltrasonicSensor_1-w1-wip1"); + public static final QName motor = new QName("http://opentosca.org/nodetypes", "Motor_1-w1-wip1"); + + // Policy Types + public static final QName situationPolicyType = new QName("http://opentosca.org/servicetemplates/policytypes", "SituationPolicy_w1-wip1"); +} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Utils.java b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Utils.java similarity index 83% rename from org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Utils.java rename to org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Utils.java index 163124234..32ca53763 100644 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Utils.java +++ b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/convention/Utils.java @@ -31,7 +31,6 @@ public class Utils { Utils.loginPasswordPropertyNames.add(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_RASPBIANPASSWD); } - public static List getSupportedVirtualMachineIPPropertyNames() { return Utils.ipPropertyNames; } @@ -57,8 +56,7 @@ public static boolean isSupportedSSHKeyProperty(final String name) { } /** - * Checks whether the given property name represents a special case property: the ip property of an - * virtual machine + * Checks whether the given property name represents a special case property: the ip property of an virtual machine * * @param name a String containing some property name * @return true iff the given name equals to the predefined IP property names of the plugins @@ -71,8 +69,8 @@ public static boolean isSupportedVirtualMachineIPProperty(final String name) { } /** - * Checks whether the given property name represents a special case property: the instanceId - * property of an virtual machine + * Checks whether the given property name represents a special case property: the instanceId property of an virtual + * machine * * @param name a String containing some property name * @return true iff the given name equals to the predefined InstanceId property names of the plugins @@ -83,37 +81,28 @@ public static boolean isSupportedVirtualMachineInstanceIdProperty(final String n } /** - * Checks whether the given NodeType is a cloud provider nodeType that can be handled by the set of - * plugins used by the PlanBuilder. + * Checks whether the given NodeType is a cloud provider nodeType that can be handled by the set of plugins used by + * the PlanBuilder. * * @param nodeType a QName denoting some nodeType * @return a boolean. True if the given nodeType is a cloud provider nodeType */ public static boolean isSupportedCloudProviderNodeType(final QName nodeType) { - return nodeType.equals(Types.amazonEc2NodeType) || nodeType.equals(Types.openStackNodeType) - || nodeType.equals(Types.openStackLiberty12NodeType) || nodeType.equals(Types.vmWareVsphere55NodeType) - || nodeType.equals(Types.localHypervisor) || nodeType.equals(Types.KVM_QEMU_HYPERVISOR_TYPE) + return nodeType.equals(Types.amazonEc2NodeType) + || nodeType.equals(Types.openStackNodeType) + || nodeType.equals(Types.openStackLiberty12NodeType) + || nodeType.equals(Types.vmWareVsphere55NodeType) + || nodeType.equals(Types.localHypervisor) + || nodeType.equals(Types.KVM_QEMU_HYPERVISOR_TYPE) || nodeType.equals(Types.openStackTrainNodeType) || nodeType.getNamespaceURI().equals(Types.openStackLiberty12NodeTypeGenerated.getNamespaceURI()) - && (nodeType.getLocalPart().startsWith(Types.openStackLiberty12NodeTypeGenerated.getLocalPart()) - || nodeType.getLocalPart() - .startsWith(Types.openStackTrainNodeType.getLocalPart())); - } - - /** - * Checks whether the given QName denotes a nodeType which can't/won't be managed by OpenTOSCA, such - * as remote entites - * - * @param nodeType a QName denoting a NodeType - * @return true if the nodeType is supported - */ - public static boolean isSupportedUnmanagedNodeType(final QName nodeType) { - return nodeType.equals(Types.remoteHostNodeType); + && (nodeType.getLocalPart().startsWith(Types.openStackLiberty12NodeTypeGenerated.getLocalPart()) + || nodeType.getLocalPart().startsWith(Types.openStackTrainNodeType.getLocalPart())); } /** - * Checks whether the given Node is an infrastructure nodeType that can be handled by the set of - * plugins used by the PlanBuilder. + * Checks whether the given Node is an infrastructure nodeType that can be handled by the set of plugins used by the + * PlanBuilder. * * @param nodeType a QName denoting some nodeType * @return a boolean. True if the given nodeType is an infrastructure nodeType @@ -152,12 +141,11 @@ public static boolean isSupportedInfrastructureNodeType(final QName nodeType) { if (nodeType.equals(Types.KVM_QEMU_VM_TYPE)) { return true; } - - if(nodeType.equals(Types.raspbianJessieOSNodeType)) { + + if (nodeType.equals(Types.raspbianJessieOSNodeType)) { return true; } - return false; } @@ -184,8 +172,7 @@ private static boolean isProperUbuntuLocalName(final String localName) { try { Integer.parseInt(leftDashSplit[1]); - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return false; } @@ -195,8 +182,7 @@ private static boolean isProperUbuntuLocalName(final String localName) { try { Integer.parseInt(rightDashSplit[0]); - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return false; } @@ -204,8 +190,8 @@ private static boolean isProperUbuntuLocalName(final String localName) { } /** - * Checks whether the given Node is a virtual machine nodeType that can by handled by the set of - * plugins used by the PlanBuilder + * Checks whether the given Node is a virtual machine nodeType that can by handled by the set of plugins used by the + * PlanBuilder * * @param nodeType a QName denoting some nodeType * @return a boolean. True if given nodeType is a virtual machine nodeType @@ -215,7 +201,7 @@ public static boolean isSupportedVMNodeType(final QName nodeType) { || nodeType.equals(Types.ubuntu1404ServerVmNodeType3) || nodeType.equals(Types.ubuntu1604ServerVmNodeType) || nodeType.equals(Types.ubuntu1804ServerVmNodeType) || nodeType.getNamespaceURI().equals(Types.ubuntu1804ServerVmNodeTypeGenerated.getNamespaceURI()) - && nodeType.getLocalPart().startsWith(Types.ubuntu1804ServerVmNodeTypeGenerated.getLocalPart()); + && nodeType.getLocalPart().startsWith(Types.ubuntu1804ServerVmNodeTypeGenerated.getLocalPart()); } public static boolean isSupportedOSNodeType(final QName nodeType) { @@ -231,8 +217,8 @@ public static boolean isSupportedHardwareNodeType(final QName nodeType) { } /** - * Checks whether the given NodeType is a docker engine nodeType that can be handled by the set of - * plugins used by the PlanBuilder. + * Checks whether the given NodeType is a docker engine nodeType that can be handled by the set of plugins used by + * the PlanBuilder. * * @param nodeType a QName denoting some nodeType * @return a boolean. True if the given nodeType is a docker engine nodeType diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/PlanInvocationEvent.java b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/PlanInvocationEvent.java similarity index 93% rename from org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/PlanInvocationEvent.java rename to org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/PlanInvocationEvent.java index 2f7dc3577..923deabe6 100644 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/PlanInvocationEvent.java +++ b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/PlanInvocationEvent.java @@ -55,7 +55,8 @@ public class PlanInvocationEvent { @XmlAttribute(name = "hasFailed", required = true) protected boolean hasFailed; - public PlanInvocationEvent() {} + public PlanInvocationEvent() { + } public PlanInvocationEvent(final String csarID, final TPlanDTO dto, final String correlationID, final int csarInstanceID, final String ifaceName, final String opName, @@ -85,9 +86,9 @@ public PlanInvocationEvent(final String csarID, final TPlanDTO dto, final String * Gets the value of the inputParameter property. * *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the inputParameter property. + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the inputParameter property. * *

    * For example, to add a new item, do as follows: @@ -99,8 +100,6 @@ public PlanInvocationEvent(final String csarID, final TPlanDTO dto, final String * *

    * Objects of the following type(s) are allowed in the list {@link Parameter } - * - * */ public List getInputParameter() { if (this.inputParameter == null) { @@ -113,9 +112,9 @@ public List getInputParameter() { * Gets the value of the outputParameter property. * *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the outputParameter property. + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the outputParameter property. * *

    * For example, to add a new item, do as follows: @@ -127,8 +126,6 @@ public List getInputParameter() { * *

    * Objects of the following type(s) are allowed in the list {@link Parameter } - * - * */ public List getOutputParameter() { if (this.outputParameter == null) { @@ -141,7 +138,6 @@ public List getOutputParameter() { * Gets the value of the csarid property. * * @return possible object is {@link String } - * */ public String getCSARID() { return this.csarid; @@ -151,7 +147,6 @@ public String getCSARID() { * Sets the value of the csarid property. * * @param value allowed object is {@link String } - * */ public void setCSARID(final String value) { this.csarid = value; @@ -161,7 +156,6 @@ public void setCSARID(final String value) { * Gets the value of the planType property. * * @return possible object is {@link String } - * */ public String getPlanType() { return this.planType; @@ -171,7 +165,6 @@ public String getPlanType() { * Sets the value of the planType property. * * @param value allowed object is {@link String } - * */ public void setPlanType(final String value) { this.planType = value; @@ -179,7 +172,6 @@ public void setPlanType(final String value) { /** * Gets the value of the internalPlanID property. - * */ public String getPlanCorrelationID() { return this.planCorrelationID; @@ -187,7 +179,6 @@ public String getPlanCorrelationID() { /** * Sets the value of the internalPlanID property. - * */ public void setPlanCorrelationID(final String value) { this.planCorrelationID = value; @@ -197,7 +188,6 @@ public void setPlanCorrelationID(final String value) { * Gets the value of the planID property. * * @return possible object is {@link QName } - * */ public QName getPlanID() { return this.planID; @@ -207,7 +197,6 @@ public QName getPlanID() { * Sets the value of the planID property. * * @param value allowed object is {@link QName } - * */ public void setPlanID(final QName value) { this.planID = value; @@ -215,7 +204,6 @@ public void setPlanID(final QName value) { /** * Gets the value of the internalInstanceInternalID property. - * */ public int getCSARInstanceID() { return this.csarInstanceID; @@ -223,7 +211,6 @@ public int getCSARInstanceID() { /** * Sets the value of the internalInstanceInternalID property. - * */ public void setCSARInstanceID(final int value) { this.csarInstanceID = value; @@ -233,7 +220,6 @@ public void setCSARInstanceID(final int value) { * Gets the value of the interfaceName property. * * @return possible object is {@link String } - * */ public String getInterfaceName() { return this.interfaceName; @@ -243,7 +229,6 @@ public String getInterfaceName() { * Sets the value of the interfaceName property. * * @param value allowed object is {@link String } - * */ public void setInterfaceName(final String value) { this.interfaceName = value; @@ -253,7 +238,6 @@ public void setInterfaceName(final String value) { * Gets the value of the operationName property. * * @return possible object is {@link String } - * */ public String getOperationName() { return this.operationName; @@ -263,7 +247,6 @@ public String getOperationName() { * Sets the value of the operationName property. * * @param value allowed object is {@link String } - * */ public void setOperationName(final String value) { this.operationName = value; @@ -273,7 +256,6 @@ public void setOperationName(final String value) { * Gets the value of the inputMessageID property. * * @return possible object is {@link QName } - * */ public QName getInputMessageID() { return this.inputMessageID; @@ -283,7 +265,6 @@ public QName getInputMessageID() { * Sets the value of the inputMessageID property. * * @param value allowed object is {@link QName } - * */ public void setInputMessageID(final QName value) { this.inputMessageID = value; @@ -293,7 +274,6 @@ public void setInputMessageID(final QName value) { * Gets the value of the outputMessageID property. * * @return possible object is {@link QName } - * */ public QName getOutputMessageID() { return this.outputMessageID; @@ -303,7 +283,6 @@ public QName getOutputMessageID() { * Sets the value of the outputMessageID property. * * @param value allowed object is {@link QName } - * */ public void setOutputMessageID(final QName value) { this.outputMessageID = value; @@ -313,13 +292,11 @@ public void setOutputMessageID(final QName value) { * Gets the value of the planLanguage property. * * @return possible object is {@link String } - * */ public String getPlanLanguage() { return this.planLanguage; } - public long getCalculatedWCET() { return this.calculatedWCET; } @@ -332,7 +309,6 @@ public void setCalculatedWCET(final long calculatedWCET) { * Sets the value of the planLanguage property. * * @param value allowed object is {@link String } - * */ public void setPlanLanguage(final String value) { this.planLanguage = value; @@ -340,7 +316,6 @@ public void setPlanLanguage(final String value) { /** * Gets the value of the isActive property. - * */ public boolean isIsActive() { return this.isActive; @@ -348,7 +323,6 @@ public boolean isIsActive() { /** * Sets the value of the isActive property. - * */ public void setIsActive(final boolean value) { this.isActive = value; @@ -356,7 +330,6 @@ public void setIsActive(final boolean value) { /** * Gets the value of the hasFailed property. - * */ public boolean isHasFailed() { return this.hasFailed; @@ -364,7 +337,6 @@ public boolean isHasFailed() { /** * Sets the value of the hasFailed property. - * */ public void setHasFailed(final boolean value) { this.hasFailed = value; diff --git a/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TParameter.java b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TParameter.java new file mode 100644 index 000000000..5538feef8 --- /dev/null +++ b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TParameter.java @@ -0,0 +1,75 @@ +package org.opentosca.container.core.tosca.extension; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlValue; + +import org.eclipse.winery.model.tosca.TBoolean; + +@XmlRootElement(name = "Parameter") +@XmlAccessorType(XmlAccessType.FIELD) +public class TParameter { + + @XmlAttribute(name = "name") + protected String name; + + @XmlAttribute(name = "type") + protected String type; + + @XmlAttribute(name = "required") + protected TBoolean required; + + @XmlValue + protected String value; + + public TParameter() { + + } + + public TParameter(final org.eclipse.winery.model.tosca.TParameter p) { + this.name = p.getName(); + this.required = p.getRequired(); + this.type = p.getType(); + } + + public TParameter(final TParameterDTO p) { + this.name = p.getName(); + this.required = p.getRequired(); + this.type = p.getType(); + this.value = p.getValue(); + } + + public String getName() { + return this.name; + } + + public void setName(final String name) { + this.name = name; + } + + public String getType() { + return this.type; + } + + public void setType(final String type) { + this.type = type; + } + + public TBoolean getRequired() { + return this.required; + } + + public void setRequired(final TBoolean required) { + this.required = required; + } + + public String getValue() { + return this.value; + } + + public void setValue(final String value) { + this.value = value; + } +} diff --git a/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TParameterDTO.java b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TParameterDTO.java new file mode 100644 index 000000000..5afa792e0 --- /dev/null +++ b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TParameterDTO.java @@ -0,0 +1,125 @@ +package org.opentosca.container.core.tosca.extension; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; + +import org.eclipse.winery.model.tosca.TBoolean; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tParameterDTO") +public class TParameterDTO { + + @XmlValue + protected String value; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "type", required = true) + protected String type; + @XmlAttribute(name = "required") + protected TBoolean required; + + public TParameterDTO() { + + } + + public TParameterDTO(final org.eclipse.winery.model.tosca.TParameter param) { + this.name = param.getName(); + this.type = param.getType(); + this.required = param.getRequired(); + } + + public TParameterDTO(final org.opentosca.container.core.tosca.extension.TParameter param) { + this.name = param.getName(); + this.type = param.getType(); + this.required = param.getRequired(); + this.value = param.getValue(); + } + + public String getValue() { + return this.value; + } + + public void setValue(final String value) { + this.value = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link String } + */ + public String getType() { + return this.type; + } + + /** + * Sets the value of the type property. + * + * @param value allowed object is {@link String } + */ + public void setType(final String value) { + this.type = value; + } + + /** + * Gets the value of the required property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getRequired() { + if (this.required == null) { + return TBoolean.YES; + } else { + return this.required; + } + } + + /** + * Sets the value of the required property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setRequired(final TBoolean value) { + this.required = value; + } + + public static class Converter { + public static org.eclipse.winery.model.tosca.TParameter toToscaElement(TParameterDTO dto) { + org.eclipse.winery.model.tosca.TParameter element = new org.eclipse.winery.model.tosca.TParameter(); + element.setName(dto.name); + element.setRequired(dto.required); + element.setType(dto.type); + return element; + } + + public static org.opentosca.container.core.tosca.extension.TParameter toEntity(TParameterDTO dto) { + org.opentosca.container.core.tosca.extension.TParameter entity = new org.opentosca.container.core.tosca.extension.TParameter(); + entity.setName(dto.name); + entity.setRequired(dto.required); + entity.setType(dto.type); + entity.setValue(dto.value); + return entity; + } + } +} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TPlanDTO.java b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TPlanDTO.java similarity index 89% rename from org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TPlanDTO.java rename to org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TPlanDTO.java index e3a82aef2..31393d1ae 100644 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TPlanDTO.java +++ b/org.opentosca.container.core.tosca/src/main/java/org/opentosca/container/core/tosca/extension/TPlanDTO.java @@ -13,8 +13,10 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; -import org.opentosca.container.core.tosca.model.TParameter; -import org.opentosca.container.core.tosca.model.TPlan; +import org.eclipse.winery.model.tosca.TParameter; +import org.eclipse.winery.model.tosca.TPlan; + +import org.eclipse.jdt.annotation.Nullable; import org.w3c.dom.Element; @XmlRootElement(name = "Plan") @@ -43,34 +45,33 @@ public class TPlanDTO { @XmlSchemaType(name = "anyURI") protected long calculatedWCET; - @XmlAttribute(name = "timeAvailable") - @XmlSchemaType(name = "anyURI") - protected long timeAvailable; - public TPlanDTO(final TPlan plan, final String namespace) { this.id = new QName(namespace, plan.getId()); this.name = plan.getName(); this.planType = plan.getPlanType(); this.planLanguage = plan.getPlanLanguage(); - this.calculatedWCET = plan.getCalculatedWCET(); - this.timeAvailable = plan.getTimeAvailable(); - if (null != plan.getInputParameters()) { + this.calculatedWCET = Long.valueOf(plan.getOtherAttributes().getOrDefault(new QName("http://opentosca.org", "WCET"), String.valueOf(0))); + + final org.eclipse.winery.model.tosca.TPlan.InputParameters serializedInputParams = plan.getInputParameters(); + if (null != serializedInputParams) { this.inputParameters = new InputParameters(); - for (final TParameter param : plan.getInputParameters().getInputParameter()) { + for (final TParameter param : serializedInputParams.getInputParameter()) { this.inputParameters.getInputParameter().add(new TParameterDTO(param)); } } - if (null != plan.getOutputParameters()) { + final org.eclipse.winery.model.tosca.TPlan.OutputParameters serializedOutputParams = plan.getOutputParameters(); + if (null != serializedOutputParams) { this.outputParameters = new OutputParameters(); - for (final TParameter param : plan.getOutputParameters().getOutputParameter()) { + for (final TParameter param : serializedOutputParams.getOutputParameter()) { this.outputParameters.getOutputParameter().add(new TParameterDTO(param)); } } } - public TPlanDTO() {} + public TPlanDTO() { + } public QName getId() { return this.id; @@ -84,9 +85,8 @@ public void setId(final QName id) { * Gets the value of the inputParameters property. * * @return possible object is {@link TPlanDTO.InputParameters } - * */ - public TPlanDTO.InputParameters getInputParameters() { + public TPlanDTO.@Nullable InputParameters getInputParameters() { if (null == this.inputParameters) { this.inputParameters = new TPlanDTO.InputParameters(); } @@ -97,7 +97,6 @@ public TPlanDTO.InputParameters getInputParameters() { * Sets the value of the inputParameters property. * * @param value allowed object is {@link TPlanDTO.InputParameters } - * */ public void setInputParameters(final TPlanDTO.InputParameters value) { this.inputParameters = value; @@ -107,7 +106,6 @@ public void setInputParameters(final TPlanDTO.InputParameters value) { * Sets the value of the outputParameters property with the origin OutputParameters element. * * @param value allowed object is {@link TPlanDTO.OutputParameters } - * */ public void setInputParameters(final TPlan.InputParameters value) { if (null != value) { @@ -122,7 +120,6 @@ public void setInputParameters(final TPlan.InputParameters value) { * Gets the value of the outputParameters property. * * @return possible object is {@link TPlanDTO.OutputParameters } - * */ public TPlanDTO.OutputParameters getOutputParameters() { if (null == this.outputParameters) { @@ -135,7 +132,6 @@ public TPlanDTO.OutputParameters getOutputParameters() { * Sets the value of the outputParameters property. * * @param value allowed object is {@link TPlanDTO.OutputParameters } - * */ public void setOutputParameters(final TPlanDTO.OutputParameters value) { this.outputParameters = value; @@ -145,7 +141,6 @@ public void setOutputParameters(final TPlanDTO.OutputParameters value) { * Sets the value of the outputParameters property with the origin OutputParameters element. * * @param value allowed object is {@link TPlanDTO.OutputParameters } - * */ public void setOutputParameters(final TPlan.OutputParameters value) { if (null != value) { @@ -160,7 +155,6 @@ public void setOutputParameters(final TPlan.OutputParameters value) { * Gets the value of the name property. * * @return possible object is {@link String } - * */ public String getName() { return this.name; @@ -170,7 +164,6 @@ public String getName() { * Sets the value of the name property. * * @param value allowed object is {@link String } - * */ public void setName(final String value) { this.name = value; @@ -180,7 +173,6 @@ public void setName(final String value) { * Gets the value of the planType property. * * @return possible object is {@link String } - * */ public String getPlanType() { return this.planType; @@ -190,7 +182,6 @@ public String getPlanType() { * Sets the value of the planType property. * * @param value allowed object is {@link String } - * */ public void setPlanType(final String value) { this.planType = value; @@ -200,7 +191,6 @@ public void setPlanType(final String value) { * Gets the value of the planLanguage property. * * @return possible object is {@link String } - * */ public String getPlanLanguage() { return this.planLanguage; @@ -210,7 +200,6 @@ public String getPlanLanguage() { * Sets the value of the planLanguage property. * * @param value allowed object is {@link String } - * */ public void setPlanLanguage(final String value) { this.planLanguage = value; @@ -224,7 +213,21 @@ public void setCalculatedWCET(final long calculatedWCET) { this.calculatedWCET = calculatedWCET; } - + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(); + builder.append("Plan with ID \"" + this.id + "\", name \"" + this.name + "\", of type \"" + this.planType + + "\", language \"" + this.planLanguage + "\" and input ["); + for (final TParameterDTO param : this.inputParameters.getInputParameter()) { + builder.append("\"" + param.getName() + "\", "); + } + builder.append("]"); + for (final TParameterDTO param : this.outputParameters.getOutputParameter()) { + builder.append("\"" + param.getName() + "\", "); + } + builder.append("]"); + return builder.toString(); + } /** *

    @@ -244,8 +247,6 @@ public void setCalculatedWCET(final long calculatedWCET) { * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {"inputParameter"}) @@ -254,14 +255,13 @@ public static class InputParameters { @XmlElement(name = "InputParameter", required = true) protected List inputParameter; - /** * Gets the value of the inputParameter property. * *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the inputParameter property. + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the inputParameter property. * *

    * For example, to add a new item, do as follows: @@ -273,8 +273,6 @@ public static class InputParameters { * *

    * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * */ public List getInputParameter() { if (this.inputParameter == null) { @@ -282,7 +280,6 @@ public List getInputParameter() { } return this.inputParameter; } - } /** @@ -303,8 +300,6 @@ public List getInputParameter() { * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {"outputParameter"}) @@ -313,14 +308,13 @@ public static class OutputParameters { @XmlElement(name = "OutputParameter", required = true) protected List outputParameter; - /** * Gets the value of the outputParameter property. * *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the outputParameter property. + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the outputParameter property. * *

    * For example, to add a new item, do as follows: @@ -332,8 +326,6 @@ public static class OutputParameters { * *

    * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * */ public List getOutputParameter() { if (this.outputParameter == null) { @@ -341,7 +333,6 @@ public List getOutputParameter() { } return this.outputParameter; } - } /** @@ -362,8 +353,6 @@ public List getOutputParameter() { * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {"any"}) @@ -372,12 +361,10 @@ public static class PlanModel { @XmlAnyElement(lax = true) protected Object any; - /** * Gets the value of the any property. * * @return possible object is {@link Object } {@link Element } - * */ public Object getAny() { return this.any; @@ -387,12 +374,10 @@ public Object getAny() { * Sets the value of the any property. * * @param value allowed object is {@link Object } {@link Element } - * */ public void setAny(final Object value) { this.any = value; } - } /** @@ -411,8 +396,6 @@ public void setAny(final Object value) { * </complexContent> * </complexType> * - * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @@ -422,12 +405,10 @@ public static class PlanModelReference { @XmlSchemaType(name = "anyURI") protected String reference; - /** * Gets the value of the reference property. * * @return possible object is {@link String } - * */ public String getReference() { return this.reference; @@ -437,28 +418,9 @@ public String getReference() { * Sets the value of the reference property. * * @param value allowed object is {@link String } - * */ public void setReference(final String value) { this.reference = value; } - - } - - - @Override - public String toString() { - final StringBuilder builder = new StringBuilder(); - builder.append("Plan with ID \"" + this.id + "\", name \"" + this.name + "\", of type \"" + this.planType - + "\", language \"" + this.planLanguage + "\" and input ["); - for (final TParameterDTO param : this.inputParameters.getInputParameter()) { - builder.append("\"" + param.getName() + "\", "); - } - builder.append("]"); - for (final TParameterDTO param : this.outputParameters.getOutputParameter()) { - builder.append("\"" + param.getName() + "\", "); - } - builder.append("]"); - return builder.toString(); } } diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/Activator.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/Activator.java deleted file mode 100644 index 2305e3e2f..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.core.tosca; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/StaticTOSCANamespaces.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/StaticTOSCANamespaces.java deleted file mode 100644 index 38762dff9..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/StaticTOSCANamespaces.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.opentosca.container.core.tosca; - -public class StaticTOSCANamespaces { - - public static final String nsToscaExtension = "http://www.opentosca.org/extensions/tosca/2013/07/11"; - public static final String nameIANameExtension = "_OpenTOSCA_IA_"; -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Types.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Types.java deleted file mode 100644 index 3febf383f..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/convention/Types.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.opentosca.container.core.tosca.convention; - -import javax.xml.namespace.QName; - -public class Types { - - // TODO refactor this class into some kind of configuration file to make it much more flexible ? - - // TODO Remove the old stuff - // cloud provider nodeTypes (old) - public final static QName ec2NodeType = new QName("http://opentosca.org/types/declarative", "EC2"); - public final static QName openStackNodeType = new QName("http://opentosca.org/types/declarative", "OpenStack"); - - // virtual machine nodeTypes (old) - public final static QName vmNodeType = new QName("http://opentosca.org/types/declarative", "VM"); - public final static QName ubuntuNodeType = new QName("http://opentosca.org/types/declarative", "Ubuntu"); - public final static QName ubuntu1310ServerNodeType = - new QName("http://opentosca.org/types/declarative", "Ubuntu-13.10-Server"); - public final static QName ubuntu1310ServerVmNodeType = - new QName("http://opentosca.org/types/declarative", "Ubuntu-13.10-Server-VM"); - - // cloud provider nodeTypes - public final static QName openStackLiberty12NodeType = - new QName("http://opentosca.org/nodetypes", "OpenStack-Liberty-12"); - public final static QName openStackTrainNodeType = - new QName("http://opentosca.org/nodetypes", "OpenStack_Train-w1"); - public final static QName vmWareVsphere55NodeType = new QName("http://opentosca.org/nodetypes", "VSphere_5.5"); - - public final static QName amazonEc2NodeType = new QName("http://opentosca.org/NodeTypes", "AmazonEC2"); - - // docker nodeTypes - public final static QName dockerEngineNodeType = new QName("http://opentosca.org/nodetypes", "DockerEngine"); - - public final static QName dockerContainerNodeType = new QName("http://opentosca.org/nodetypes", "DockerContainer"); - - // docker nodeTypes (old) - public final static QName dockerEngineNodeTypeAlt = new QName("http://opentosca.org/NodeTypes", "DockerEngine"); - - // abstract operating system node type - public final static QName abstractOperatingSystemNodeType = - new QName("http://opentosca.org/nodetypes", "OperatingSystem"); - - // virtual machine nodeTypes - public final static QName ubuntu1404ServerVmNodeType = - new QName("http://opentosca.org/nodetypes", "Ubuntu-14.04-VM"); - - public final static QName ubuntu1404ServerVmNodeType2 = - new QName("http://opentosca.org/NodeTypes", "Ubuntu-14.04-VM"); - - public final static QName ubuntu1404ServerVmNodeType3 = - new QName("http://opentosca.org/nodetypes", "Ubuntu-VM_14.04-w1"); - - public final static QName ubuntu1604ServerVmNodeType = - new QName("http://opentosca.org/nodetypes", "Ubuntu-VM_16.04-w1"); - - public final static QName ubuntu1804ServerVmNodeType = - new QName("http://opentosca.org/nodetypes", "Ubuntu-VM_18.04-w1"); - - // FIXME: find a better way to support generated NodeTypes - public final static QName ubuntu1804ServerVmNodeTypeGenerated = - new QName("http://opentosca.org/nodetypes/generated", "Ubuntu-VM_18.04"); - public final static QName openStackLiberty12NodeTypeGenerated = - new QName("http://opentosca.org/nodetypes/generated", "OpenStack-Liberty-12"); - - // OS - // raspbian OS nodeType - public final static QName raspbianJessieOSNodeType = new QName("http://opentosca.org/nodetypes", "RaspbianJessie"); - - // remote host nodeType for nodes not managed by opentosca - public final static QName remoteHostNodeType = new QName("http://opentosca.org/nodetypes", "RemoteHost"); - - // local linux hypervisor nodeType - public final static QName localHypervisor = new QName("http://opentosca.org/nodetypes", "Libvirt-Qemu-KVM"); - // relationship types - public final static QName connectsToRelationType = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ConnectsTo"); - public final static QName dependsOnRelationType = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "DependsOn"); - public final static QName deployedOnRelationType = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "DeployedOn"); - public final static QName hostedOnRelationType = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "HostedOn"); - - public final static QName KVM_QEMU_VM_TYPE = new QName("http://opentosca.org/nodetypes", "KVM_QEMU_VM"); - public final static QName KVM_QEMU_HYPERVISOR_TYPE = - new QName("http://opentosca.org/nodetypes", "KVM_QEMU_Hypervisor"); - - public static final QName TOSCABASETYPE_SERVER = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "Server"); - - public static final QName TOSCABASETYPE_OS = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "OperatingSystem"); - - - // ArtifactTypes - public static final QName scriptArtifactType = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ScriptArtifact"); - - // hardware, such as sensors, actuators and devices - public static final QName raspberryPi3 = new QName("http://opentosca.org/nodetypes", "RaspberryPI3"); - public static final QName fs20Adapater = new QName("http://opentosca.org/nodetypes", "FS20_USBDongle"); - public static final QName lineFollowerSensor = new QName("http://opentosca.org/nodetypes","LineFollowerSensor_1-w1-wip1"); - public static final QName mCore = new QName("http://opentosca.org/nodetypes","mCore_1-w1-wip1"); - public static final QName mBot = new QName("http://opentosca.org/nodetypes","mBot_1-w1-wip1"); - public static final QName ultrasonicSensor = new QName("http://opentosca.org/nodetypes","UltrasonicSensor_1-w1-wip1"); - public static final QName motor = new QName("http://opentosca.org/nodetypes","Motor_1-w1-wip1"); - - // Policy Types - public static final QName situationPolicyType = - new QName("http://opentosca.org/servicetemplates/policytypes", "SituationPolicy_w1-wip1"); - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/PlanTypes.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/PlanTypes.java deleted file mode 100644 index 58ffd917d..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/PlanTypes.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.opentosca.container.core.tosca.extension; - -import java.io.Serializable; - -public enum PlanTypes implements Comparable, Serializable { - - BUILD("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan"), OTHERMANAGEMENT("undefined or custom management plan"), APPLICATION("http://www.opentosca.org"), TERMINATION("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/TerminationPlan"); - - private String type; - - PlanTypes(final String type) { - this.type = type; - } - - @Override - public String toString() { - return this.type; - } - - /** - * This method returns the String representation of the type. For example:
    - * The enum BUILD has the URI http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan. This - * method returns for BUILD the String "BUILD". - * - * @return String representation - */ - public String toEnumRepresentation() { - if (this.type.startsWith(PlanTypes.BUILD.toString())) { - return "BUILD"; - } else if (this.type.startsWith(PlanTypes.TERMINATION.toString())) { - return "TERMINATION"; - } else if (this.type.startsWith(PlanTypes.APPLICATION.toString())) { - return "APPLICATION"; - } else { - return "OTHERMANAGEMENT"; - } - } - - /** - * Checks if the given String is one of the URIs defined of TOSCA (build and termination plan). If - * not, the Type is of OTHERMANAGEMENT. - *

    - * For example: The given parameter contains the URI - * http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan. This URI is mapped to the enum - * BUILD. - * - * @param planType String - * @return PlanTypes plan type. - */ - public static PlanTypes isPlanTypeURI(final String planType) { - if (planType.startsWith(PlanTypes.BUILD.toString())) { - return BUILD; - } else if (planType.startsWith(PlanTypes.TERMINATION.toString())) { - return TERMINATION; - } else if (planType.startsWith(PlanTypes.APPLICATION.toString())) { - return PlanTypes.APPLICATION; - } else { - return OTHERMANAGEMENT; - } - } - - /** - * Checks the given String if it is one of the ENUM Strings defined in this ENUM (BUILD and - * TERMINATION). If not, the Type is of OTHERMANAGEMENT. - *

    - * For example: The given parameter contains the String "BUILD". This String is mapped to the enum - * BUILD. - * - * @param planType String - * @return PlanTypes plan type. - */ - public static PlanTypes isPlanTypeEnumRepresentation(final String planType) { - if (planType.equals("BUILD")) { - return BUILD; - } else if (planType.equals("TERMINATION")) { - return TERMINATION; - } else if (planType.equals("APPLICATION")) { - return APPLICATION; - } else { - return OTHERMANAGEMENT; - } - } - - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TParameter.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TParameter.java deleted file mode 100644 index 5d6be017d..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TParameter.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.opentosca.container.core.tosca.extension; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlValue; - -import org.opentosca.container.core.tosca.model.TBoolean; -import org.opentosca.container.core.tosca.model.TExtensibleElements; - -@XmlRootElement(name = "Parameter") -@XmlAccessorType(XmlAccessType.FIELD) -public class TParameter extends TExtensibleElements { - - @XmlAttribute(name = "name") - protected String name; - - @XmlAttribute(name = "type") - protected String type; - - @XmlAttribute(name = "required") - protected TBoolean required; - - @XmlValue - protected String value; - - - public TParameter() { - - } - - public TParameter(final org.opentosca.container.core.tosca.model.TParameter p) { - this.name = p.getName(); - this.required = p.getRequired(); - this.type = p.getType(); - } - - public TParameter(final TParameterDTO p) { - this.name = p.getName(); - this.required = p.getRequired(); - this.type = p.getType(); - this.value = p.getValue(); - } - - public String getName() { - return this.name; - } - - public void setName(final String name) { - this.name = name; - } - - public String getType() { - return this.type; - } - - public void setType(final String type) { - this.type = type; - } - - public TBoolean getRequired() { - return this.required; - } - - public void setRequired(final TBoolean required) { - this.required = required; - } - - public String getValue() { - return this.value; - } - - public void setValue(final String value) { - this.value = value; - } -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TParameterDTO.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TParameterDTO.java deleted file mode 100644 index 749d08394..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/extension/TParameterDTO.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.opentosca.container.core.tosca.extension; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; - -import org.opentosca.container.core.tosca.model.TBoolean; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tParameterDTO") -public class TParameterDTO { - - @XmlValue - protected String value; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "type", required = true) - protected String type; - @XmlAttribute(name = "required") - protected TBoolean required; - - - public TParameterDTO() { - - } - - public TParameterDTO(final org.opentosca.container.core.tosca.model.TParameter param) { - this.name = param.getName(); - this.type = param.getType(); - this.required = param.getRequired(); - } - - public TParameterDTO(final org.opentosca.container.core.tosca.extension.TParameter param) { - this.name = param.getName(); - this.type = param.getType(); - this.required = param.getRequired(); - this.value = param.getValue(); - } - - public String getValue() { - return this.value; - } - - public void setValue(final String value) { - this.value = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link String } - * - */ - public String getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link String } - * - */ - public void setType(final String value) { - this.type = value; - } - - /** - * Gets the value of the required property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getRequired() { - if (this.required == null) { - return TBoolean.YES; - } else { - return this.required; - } - } - - /** - * Sets the value of the required property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setRequired(final TBoolean value) { - this.required = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/Definitions.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/Definitions.java deleted file mode 100644 index ca9199a84..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/Definitions.java +++ /dev/null @@ -1,43 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType>
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tDefinitions">
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "Definitions") -public class Definitions extends TDefinitions { - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/IToscaModelFactory.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/IToscaModelFactory.java deleted file mode 100644 index 125d63785..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/IToscaModelFactory.java +++ /dev/null @@ -1,592 +0,0 @@ -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -public interface IToscaModelFactory { - - /** - * Create an instance of {@link TDefinitions } - * - */ - public TDefinitions createTDefinitions(); - - /** - * Create an instance of {@link TRelationshipTemplate } - * - */ - public TRelationshipTemplate createTRelationshipTemplate(); - - /** - * Create an instance of {@link TRelationshipTemplate.RelationshipConstraints } - * - */ - public TRelationshipTemplate.RelationshipConstraints createTRelationshipTemplateRelationshipConstraints(); - - /** - * Create an instance of {@link TRequirementDefinition } - * - */ - public TRequirementDefinition createTRequirementDefinition(); - - /** - * Create an instance of {@link TNodeTemplate } - * - */ - public TNodeTemplate createTNodeTemplate(); - - /** - * Create an instance of {@link TTopologyElementInstanceStates } - * - */ - public TTopologyElementInstanceStates createTTopologyElementInstanceStates(); - - /** - * Create an instance of {@link TAppliesTo } - * - */ - public TAppliesTo createTAppliesTo(); - - /** - * Create an instance of {@link TImplementationArtifacts } - * - */ - public TImplementationArtifacts createTImplementationArtifacts(); - - /** - * Create an instance of {@link TArtifactReference } - * - */ - public TArtifactReference createTArtifactReference(); - - /** - * Create an instance of {@link TBoundaryDefinitions } - * - */ - public TBoundaryDefinitions createTBoundaryDefinitions(); - - /** - * Create an instance of {@link TBoundaryDefinitions.Properties } - * - */ - public TBoundaryDefinitions.Properties createTBoundaryDefinitionsProperties(); - - /** - * Create an instance of {@link TExportedOperation } - * - */ - public TExportedOperation createTExportedOperation(); - - /** - * Create an instance of {@link TPlan } - * - */ - public TPlan createTPlan(); - - /** - * Create an instance of {@link TCapabilityDefinition } - * - */ - public TCapabilityDefinition createTCapabilityDefinition(); - - /** - * Create an instance of {@link TOperation } - * - */ - public TOperation createTOperation(); - - /** - * Create an instance of {@link TArtifactTemplate } - * - */ - public TArtifactTemplate createTArtifactTemplate(); - - /** - * Create an instance of {@link TRelationshipTypeImplementation } - * - */ - public TRelationshipTypeImplementation createTRelationshipTypeImplementation(); - - /** - * Create an instance of {@link TRelationshipType } - * - */ - public TRelationshipType createTRelationshipType(); - - /** - * Create an instance of {@link TNodeTypeImplementation } - * - */ - public TNodeTypeImplementation createTNodeTypeImplementation(); - - /** - * Create an instance of {@link TNodeType } - * - */ - public TNodeType createTNodeType(); - - /** - * Create an instance of {@link TDocumentation } - * - */ - public TDocumentation createTDocumentation(); - - /** - * Create an instance of {@link Definitions } - * - */ - public Definitions createDefinitions(); - - /** - * Create an instance of {@link TExtensibleElements } - * - */ - public TExtensibleElements createTExtensibleElements(); - - /** - * Create an instance of {@link TDefinitions.Extensions } - * - */ - public TDefinitions.Extensions createTDefinitionsExtensions(); - - /** - * Create an instance of {@link TImport } - * - */ - public TImport createTImport(); - - /** - * Create an instance of {@link TDefinitions.Types } - * - */ - public TDefinitions.Types createTDefinitionsTypes(); - - /** - * Create an instance of {@link TServiceTemplate } - * - */ - public TServiceTemplate createTServiceTemplate(); - - /** - * Create an instance of {@link TRequirementType } - * - */ - public TRequirementType createTRequirementType(); - - /** - * Create an instance of {@link TCapabilityType } - * - */ - public TCapabilityType createTCapabilityType(); - - /** - * Create an instance of {@link TArtifactType } - * - */ - public TArtifactType createTArtifactType(); - - /** - * Create an instance of {@link TPolicyType } - * - */ - public TPolicyType createTPolicyType(); - - /** - * Create an instance of {@link TPolicyTemplate } - * - */ - public TPolicyTemplate createTPolicyTemplate(); - - /** - * Create an instance of {@link TRequirementRef } - * - */ - public TRequirementRef createTRequirementRef(); - - /** - * Create an instance of {@link TImplementationArtifact } - * - */ - public TImplementationArtifact createTImplementationArtifact(); - - /** - * Create an instance of {@link TParameter } - * - */ - public TParameter createTParameter(); - - /** - * Create an instance of {@link TExtension } - * - */ - public TExtension createTExtension(); - - /** - * Create an instance of {@link TDeploymentArtifact } - * - */ - public TDeploymentArtifact createTDeploymentArtifact(); - - /** - * Create an instance of {@link TRequiredContainerFeatures } - * - */ - public TRequiredContainerFeatures createTRequiredContainerFeatures(); - - /** - * Create an instance of {@link TExportedInterface } - * - */ - public TExportedInterface createTExportedInterface(); - - /** - * Create an instance of {@link TConstraint } - * - */ - public TConstraint createTConstraint(); - - /** - * Create an instance of {@link TPlans } - * - */ - public TPlans createTPlans(); - - /** - * Create an instance of {@link TPropertyMapping } - * - */ - public TPropertyMapping createTPropertyMapping(); - - /** - * Create an instance of {@link TCondition } - * - */ - public TCondition createTCondition(); - - /** - * Create an instance of {@link TExtensions } - * - */ - public TExtensions createTExtensions(); - - /** - * Create an instance of {@link TTopologyTemplate } - * - */ - public TTopologyTemplate createTTopologyTemplate(); - - /** - * Create an instance of {@link TTags } - * - */ - public TTags createTTags(); - - /** - * Create an instance of {@link TPolicy } - * - */ - public TPolicy createTPolicy(); - - /** - * Create an instance of {@link TRequiredContainerFeature } - * - */ - public TRequiredContainerFeature createTRequiredContainerFeature(); - - /** - * Create an instance of {@link TDeploymentArtifacts } - * - */ - public TDeploymentArtifacts createTDeploymentArtifacts(); - - /** - * Create an instance of {@link TCapability } - * - */ - public TCapability createTCapability(); - - /** - * Create an instance of {@link TPropertyConstraint } - * - */ - public TPropertyConstraint createTPropertyConstraint(); - - /** - * Create an instance of {@link TTag } - * - */ - public TTag createTTag(); - - /** - * Create an instance of {@link TInterface } - * - */ - public TInterface createTInterface(); - - /** - * Create an instance of {@link TRequirement } - * - */ - public TRequirement createTRequirement(); - - /** - * Create an instance of {@link TCapabilityRef } - * - */ - public TCapabilityRef createTCapabilityRef(); - - /** - * Create an instance of {@link model.TEntityTemplate.Properties } - * - */ - public TEntityTemplate.Properties createTEntityTemplateProperties(); - - /** - * Create an instance of {@link model.TEntityTemplate.PropertyConstraints } - * - */ - public TEntityTemplate.PropertyConstraints createTEntityTemplatePropertyConstraints(); - - /** - * Create an instance of {@link TRelationshipTemplate.SourceElement } - * - */ - public TRelationshipTemplate.SourceElement createTRelationshipTemplateSourceElement(); - - /** - * Create an instance of {@link TRelationshipTemplate.TargetElement } - * - */ - public TRelationshipTemplate.TargetElement createTRelationshipTemplateTargetElement(); - - /** - * Create an instance of - * {@link TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint } - * - */ - public TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint createTRelationshipTemplateRelationshipConstraintsRelationshipConstraint(); - - /** - * Create an instance of {@link TRequirementDefinition.Constraints } - * - */ - public TRequirementDefinition.Constraints createTRequirementDefinitionConstraints(); - - /** - * Create an instance of {@link TNodeTemplate.Requirements } - * - */ - public TNodeTemplate.Requirements createTNodeTemplateRequirements(); - - /** - * Create an instance of {@link TNodeTemplate.Capabilities } - * - */ - public TNodeTemplate.Capabilities createTNodeTemplateCapabilities(); - - /** - * Create an instance of {@link TNodeTemplate.Policies } - * - */ - public TNodeTemplate.Policies createTNodeTemplatePolicies(); - - /** - * Create an instance of {@link TTopologyElementInstanceStates.InstanceState } - * - */ - public TTopologyElementInstanceStates.InstanceState createTTopologyElementInstanceStatesInstanceState(); - - /** - * Create an instance of {@link TAppliesTo.NodeTypeReference } - * - */ - public TAppliesTo.NodeTypeReference createTAppliesToNodeTypeReference(); - - /** - * Create an instance of {@link TImplementationArtifacts.ImplementationArtifact } - * - */ - public TImplementationArtifacts.ImplementationArtifact createTImplementationArtifactsImplementationArtifact(); - - /** - * Create an instance of {@link TArtifactReference.Include } - * - */ - public TArtifactReference.Include createTArtifactReferenceInclude(); - - /** - * Create an instance of {@link TArtifactReference.Exclude } - * - */ - public TArtifactReference.Exclude createTArtifactReferenceExclude(); - - /** - * Create an instance of {@link model.TEntityType.DerivedFrom } - * - */ - public TEntityType.DerivedFrom createTEntityTypeDerivedFrom(); - - /** - * Create an instance of {@link model.TEntityType.PropertiesDefinition } - * - */ - public TEntityType.PropertiesDefinition createTEntityTypePropertiesDefinition(); - - /** - * Create an instance of {@link TBoundaryDefinitions.PropertyConstraints } - * - */ - public TBoundaryDefinitions.PropertyConstraints createTBoundaryDefinitionsPropertyConstraints(); - - /** - * Create an instance of {@link TBoundaryDefinitions.Requirements } - * - */ - public TBoundaryDefinitions.Requirements createTBoundaryDefinitionsRequirements(); - - /** - * Create an instance of {@link TBoundaryDefinitions.Capabilities } - * - */ - public TBoundaryDefinitions.Capabilities createTBoundaryDefinitionsCapabilities(); - - /** - * Create an instance of {@link TBoundaryDefinitions.Policies } - * - */ - public TBoundaryDefinitions.Policies createTBoundaryDefinitionsPolicies(); - - /** - * Create an instance of {@link TBoundaryDefinitions.Interfaces } - * - */ - public TBoundaryDefinitions.Interfaces createTBoundaryDefinitionsInterfaces(); - - /** - * Create an instance of {@link TBoundaryDefinitions.Properties.PropertyMappings } - * - */ - public TBoundaryDefinitions.Properties.PropertyMappings createTBoundaryDefinitionsPropertiesPropertyMappings(); - - /** - * Create an instance of {@link TExportedOperation.NodeOperation } - * - */ - public TExportedOperation.NodeOperation createTExportedOperationNodeOperation(); - - /** - * Create an instance of {@link TExportedOperation.RelationshipOperation } - * - */ - public TExportedOperation.RelationshipOperation createTExportedOperationRelationshipOperation(); - - /** - * Create an instance of {@link TExportedOperation.Plan } - * - */ - public TExportedOperation.Plan createTExportedOperationPlan(); - - /** - * Create an instance of {@link TPlan.InputParameters } - * - */ - public TPlan.InputParameters createTPlanInputParameters(); - - /** - * Create an instance of {@link TPlan.OutputParameters } - * - */ - public TPlan.OutputParameters createTPlanOutputParameters(); - - /** - * Create an instance of {@link TPlan.PlanModel } - * - */ - public TPlan.PlanModel createTPlanPlanModel(); - - /** - * Create an instance of {@link TPlan.PlanModelReference } - * - */ - public TPlan.PlanModelReference createTPlanPlanModelReference(); - - /** - * Create an instance of {@link TCapabilityDefinition.Constraints } - * - */ - public TCapabilityDefinition.Constraints createTCapabilityDefinitionConstraints(); - - /** - * Create an instance of {@link TOperation.InputParameters } - * - */ - public TOperation.InputParameters createTOperationInputParameters(); - - /** - * Create an instance of {@link TOperation.OutputParameters } - * - */ - public TOperation.OutputParameters createTOperationOutputParameters(); - - /** - * Create an instance of {@link TArtifactTemplate.ArtifactReferences } - * - */ - public TArtifactTemplate.ArtifactReferences createTArtifactTemplateArtifactReferences(); - - /** - * Create an instance of {@link TRelationshipTypeImplementation.DerivedFrom } - * - */ - public TRelationshipTypeImplementation.DerivedFrom createTRelationshipTypeImplementationDerivedFrom(); - - /** - * Create an instance of {@link TRelationshipType.SourceInterfaces } - * - */ - public TRelationshipType.SourceInterfaces createTRelationshipTypeSourceInterfaces(); - - /** - * Create an instance of {@link TRelationshipType.TargetInterfaces } - * - */ - public TRelationshipType.TargetInterfaces createTRelationshipTypeTargetInterfaces(); - - /** - * Create an instance of {@link TRelationshipType.ValidSource } - * - */ - public TRelationshipType.ValidSource createTRelationshipTypeValidSource(); - - /** - * Create an instance of {@link TRelationshipType.ValidTarget } - * - */ - public TRelationshipType.ValidTarget createTRelationshipTypeValidTarget(); - - /** - * Create an instance of {@link TNodeTypeImplementation.DerivedFrom } - * - */ - public TNodeTypeImplementation.DerivedFrom createTNodeTypeImplementationDerivedFrom(); - - /** - * Create an instance of {@link TNodeType.RequirementDefinitions } - * - */ - public TNodeType.RequirementDefinitions createTNodeTypeRequirementDefinitions(); - - /** - * Create an instance of {@link TNodeType.CapabilityDefinitions } - * - */ - public TNodeType.CapabilityDefinitions createTNodeTypeCapabilityDefinitions(); - - /** - * Create an instance of {@link TNodeType.Interfaces } - * - */ - public TNodeType.Interfaces createTNodeTypeInterfaces(); - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/ObjectFactory.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/ObjectFactory.java deleted file mode 100644 index d77454ed0..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/ObjectFactory.java +++ /dev/null @@ -1,929 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.opentosca.model.tosca package. - *

    - * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory implements IToscaModelFactory { - - private final static QName _Documentation_QNAME = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12", "documentation"); - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.opentosca.model.tosca - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link TDefinitions } - * - */ - @Override - public TDefinitions createTDefinitions() { - return new TDefinitions(); - } - - /** - * Create an instance of {@link TRelationshipTemplate } - * - */ - @Override - public TRelationshipTemplate createTRelationshipTemplate() { - return new TRelationshipTemplate(); - } - - /** - * Create an instance of {@link TRelationshipTemplate.RelationshipConstraints } - * - */ - @Override - public TRelationshipTemplate.RelationshipConstraints createTRelationshipTemplateRelationshipConstraints() { - return new TRelationshipTemplate.RelationshipConstraints(); - } - - /** - * Create an instance of {@link TRequirementDefinition } - * - */ - @Override - public TRequirementDefinition createTRequirementDefinition() { - return new TRequirementDefinition(); - } - - /** - * Create an instance of {@link TNodeTemplate } - * - */ - @Override - public TNodeTemplate createTNodeTemplate() { - return new TNodeTemplate(); - } - - /** - * Create an instance of {@link TTopologyElementInstanceStates } - * - */ - @Override - public TTopologyElementInstanceStates createTTopologyElementInstanceStates() { - return new TTopologyElementInstanceStates(); - } - - /** - * Create an instance of {@link TAppliesTo } - * - */ - @Override - public TAppliesTo createTAppliesTo() { - return new TAppliesTo(); - } - - /** - * Create an instance of {@link TImplementationArtifacts } - * - */ - @Override - public TImplementationArtifacts createTImplementationArtifacts() { - return new TImplementationArtifacts(); - } - - /** - * Create an instance of {@link TArtifactReference } - * - */ - @Override - public TArtifactReference createTArtifactReference() { - return new TArtifactReference(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions } - * - */ - @Override - public TBoundaryDefinitions createTBoundaryDefinitions() { - return new TBoundaryDefinitions(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Properties } - * - */ - @Override - public TBoundaryDefinitions.Properties createTBoundaryDefinitionsProperties() { - return new TBoundaryDefinitions.Properties(); - } - - /** - * Create an instance of {@link TExportedOperation } - * - */ - @Override - public TExportedOperation createTExportedOperation() { - return new TExportedOperation(); - } - - /** - * Create an instance of {@link TPlan } - * - */ - @Override - public TPlan createTPlan() { - return new TPlan(); - } - - /** - * Create an instance of {@link TCapabilityDefinition } - * - */ - @Override - public TCapabilityDefinition createTCapabilityDefinition() { - return new TCapabilityDefinition(); - } - - /** - * Create an instance of {@link TOperation } - * - */ - @Override - public TOperation createTOperation() { - return new TOperation(); - } - - /** - * Create an instance of {@link TArtifactTemplate } - * - */ - @Override - public TArtifactTemplate createTArtifactTemplate() { - return new TArtifactTemplate(); - } - - /** - * Create an instance of {@link TRelationshipTypeImplementation } - * - */ - @Override - public TRelationshipTypeImplementation createTRelationshipTypeImplementation() { - return new TRelationshipTypeImplementation(); - } - - /** - * Create an instance of {@link TRelationshipType } - * - */ - @Override - public TRelationshipType createTRelationshipType() { - return new TRelationshipType(); - } - - /** - * Create an instance of {@link TNodeTypeImplementation } - * - */ - @Override - public TNodeTypeImplementation createTNodeTypeImplementation() { - return new TNodeTypeImplementation(); - } - - /** - * Create an instance of {@link TNodeType } - * - */ - @Override - public TNodeType createTNodeType() { - return new TNodeType(); - } - - /** - * Create an instance of {@link TDocumentation } - * - */ - @Override - public TDocumentation createTDocumentation() { - return new TDocumentation(); - } - - /** - * Create an instance of {@link Definitions } - * - */ - @Override - public Definitions createDefinitions() { - return new Definitions(); - } - - /** - * Create an instance of {@link TExtensibleElements } - * - */ - @Override - public TExtensibleElements createTExtensibleElements() { - return new TExtensibleElements(); - } - - /** - * Create an instance of {@link TDefinitions.Extensions } - * - */ - @Override - public TDefinitions.Extensions createTDefinitionsExtensions() { - return new TDefinitions.Extensions(); - } - - /** - * Create an instance of {@link TImport } - * - */ - @Override - public TImport createTImport() { - return new TImport(); - } - - /** - * Create an instance of {@link TDefinitions.Types } - * - */ - @Override - public TDefinitions.Types createTDefinitionsTypes() { - return new TDefinitions.Types(); - } - - /** - * Create an instance of {@link TServiceTemplate } - * - */ - @Override - public TServiceTemplate createTServiceTemplate() { - return new TServiceTemplate(); - } - - /** - * Create an instance of {@link TRequirementType } - * - */ - @Override - public TRequirementType createTRequirementType() { - return new TRequirementType(); - } - - /** - * Create an instance of {@link TCapabilityType } - * - */ - @Override - public TCapabilityType createTCapabilityType() { - return new TCapabilityType(); - } - - /** - * Create an instance of {@link TArtifactType } - * - */ - @Override - public TArtifactType createTArtifactType() { - return new TArtifactType(); - } - - /** - * Create an instance of {@link TPolicyType } - * - */ - @Override - public TPolicyType createTPolicyType() { - return new TPolicyType(); - } - - /** - * Create an instance of {@link TPolicyTemplate } - * - */ - @Override - public TPolicyTemplate createTPolicyTemplate() { - return new TPolicyTemplate(); - } - - /** - * Create an instance of {@link TRequirementRef } - * - */ - @Override - public TRequirementRef createTRequirementRef() { - return new TRequirementRef(); - } - - /** - * Create an instance of {@link TImplementationArtifact } - * - */ - @Override - public TImplementationArtifact createTImplementationArtifact() { - return new TImplementationArtifact(); - } - - /** - * Create an instance of {@link TParameter } - * - */ - @Override - public TParameter createTParameter() { - return new TParameter(); - } - - /** - * Create an instance of {@link TExtension } - * - */ - @Override - public TExtension createTExtension() { - return new TExtension(); - } - - /** - * Create an instance of {@link TDeploymentArtifact } - * - */ - @Override - public TDeploymentArtifact createTDeploymentArtifact() { - return new TDeploymentArtifact(); - } - - /** - * Create an instance of {@link TRequiredContainerFeatures } - * - */ - @Override - public TRequiredContainerFeatures createTRequiredContainerFeatures() { - return new TRequiredContainerFeatures(); - } - - /** - * Create an instance of {@link TExportedInterface } - * - */ - @Override - public TExportedInterface createTExportedInterface() { - return new TExportedInterface(); - } - - /** - * Create an instance of {@link TConstraint } - * - */ - @Override - public TConstraint createTConstraint() { - return new TConstraint(); - } - - /** - * Create an instance of {@link TPlans } - * - */ - @Override - public TPlans createTPlans() { - return new TPlans(); - } - - /** - * Create an instance of {@link TPropertyMapping } - * - */ - @Override - public TPropertyMapping createTPropertyMapping() { - return new TPropertyMapping(); - } - - /** - * Create an instance of {@link TCondition } - * - */ - @Override - public TCondition createTCondition() { - return new TCondition(); - } - - /** - * Create an instance of {@link TExtensions } - * - */ - @Override - public TExtensions createTExtensions() { - return new TExtensions(); - } - - /** - * Create an instance of {@link TTopologyTemplate } - * - */ - @Override - public TTopologyTemplate createTTopologyTemplate() { - return new TTopologyTemplate(); - } - - /** - * Create an instance of {@link TTags } - * - */ - @Override - public TTags createTTags() { - return new TTags(); - } - - /** - * Create an instance of {@link TPolicy } - * - */ - @Override - public TPolicy createTPolicy() { - return new TPolicy(); - } - - /** - * Create an instance of {@link TRequiredContainerFeature } - * - */ - @Override - public TRequiredContainerFeature createTRequiredContainerFeature() { - return new TRequiredContainerFeature(); - } - - /** - * Create an instance of {@link TDeploymentArtifacts } - * - */ - @Override - public TDeploymentArtifacts createTDeploymentArtifacts() { - return new TDeploymentArtifacts(); - } - - /** - * Create an instance of {@link TCapability } - * - */ - @Override - public TCapability createTCapability() { - return new TCapability(); - } - - /** - * Create an instance of {@link TPropertyConstraint } - * - */ - @Override - public TPropertyConstraint createTPropertyConstraint() { - return new TPropertyConstraint(); - } - - /** - * Create an instance of {@link TTag } - * - */ - @Override - public TTag createTTag() { - return new TTag(); - } - - /** - * Create an instance of {@link TInterface } - * - */ - @Override - public TInterface createTInterface() { - return new TInterface(); - } - - /** - * Create an instance of {@link TRequirement } - * - */ - @Override - public TRequirement createTRequirement() { - return new TRequirement(); - } - - /** - * Create an instance of {@link TCapabilityRef } - * - */ - @Override - public TCapabilityRef createTCapabilityRef() { - return new TCapabilityRef(); - } - - /** - * Create an instance of - * {@link org.opentosca.container.core.tosca.model.TEntityTemplate.Properties } - * - */ - @Override - public org.opentosca.container.core.tosca.model.TEntityTemplate.Properties createTEntityTemplateProperties() { - return new org.opentosca.container.core.tosca.model.TEntityTemplate.Properties(); - } - - /** - * Create an instance of - * {@link org.opentosca.container.core.tosca.model.TEntityTemplate.PropertyConstraints } - * - */ - @Override - public org.opentosca.container.core.tosca.model.TEntityTemplate.PropertyConstraints createTEntityTemplatePropertyConstraints() { - return new org.opentosca.container.core.tosca.model.TEntityTemplate.PropertyConstraints(); - } - - /** - * Create an instance of {@link TRelationshipTemplate.SourceElement } - * - */ - @Override - public TRelationshipTemplate.SourceElement createTRelationshipTemplateSourceElement() { - return new TRelationshipTemplate.SourceElement(); - } - - /** - * Create an instance of {@link TRelationshipTemplate.TargetElement } - * - */ - @Override - public TRelationshipTemplate.TargetElement createTRelationshipTemplateTargetElement() { - return new TRelationshipTemplate.TargetElement(); - } - - /** - * Create an instance of - * {@link TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint } - * - */ - @Override - public TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint createTRelationshipTemplateRelationshipConstraintsRelationshipConstraint() { - return new TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint(); - } - - /** - * Create an instance of {@link TRequirementDefinition.Constraints } - * - */ - @Override - public TRequirementDefinition.Constraints createTRequirementDefinitionConstraints() { - return new TRequirementDefinition.Constraints(); - } - - /** - * Create an instance of {@link TNodeTemplate.Requirements } - * - */ - @Override - public TNodeTemplate.Requirements createTNodeTemplateRequirements() { - return new TNodeTemplate.Requirements(); - } - - /** - * Create an instance of {@link TNodeTemplate.Capabilities } - * - */ - @Override - public TNodeTemplate.Capabilities createTNodeTemplateCapabilities() { - return new TNodeTemplate.Capabilities(); - } - - /** - * Create an instance of {@link TNodeTemplate.Policies } - * - */ - @Override - public TNodeTemplate.Policies createTNodeTemplatePolicies() { - return new TNodeTemplate.Policies(); - } - - /** - * Create an instance of {@link TTopologyElementInstanceStates.InstanceState } - * - */ - @Override - public TTopologyElementInstanceStates.InstanceState createTTopologyElementInstanceStatesInstanceState() { - return new TTopologyElementInstanceStates.InstanceState(); - } - - /** - * Create an instance of {@link TAppliesTo.NodeTypeReference } - * - */ - @Override - public TAppliesTo.NodeTypeReference createTAppliesToNodeTypeReference() { - return new TAppliesTo.NodeTypeReference(); - } - - /** - * Create an instance of {@link TImplementationArtifacts.ImplementationArtifact } - * - */ - @Override - public TImplementationArtifacts.ImplementationArtifact createTImplementationArtifactsImplementationArtifact() { - return new TImplementationArtifacts.ImplementationArtifact(); - } - - /** - * Create an instance of {@link TArtifactReference.Include } - * - */ - @Override - public TArtifactReference.Include createTArtifactReferenceInclude() { - return new TArtifactReference.Include(); - } - - /** - * Create an instance of {@link TArtifactReference.Exclude } - * - */ - @Override - public TArtifactReference.Exclude createTArtifactReferenceExclude() { - return new TArtifactReference.Exclude(); - } - - /** - * Create an instance of {@link org.opentosca.container.core.tosca.model.TEntityType.DerivedFrom } - * - */ - @Override - public org.opentosca.container.core.tosca.model.TEntityType.DerivedFrom createTEntityTypeDerivedFrom() { - return new org.opentosca.container.core.tosca.model.TEntityType.DerivedFrom(); - } - - /** - * Create an instance of - * {@link org.opentosca.container.core.tosca.model.TEntityType.PropertiesDefinition } - * - */ - @Override - public org.opentosca.container.core.tosca.model.TEntityType.PropertiesDefinition createTEntityTypePropertiesDefinition() { - return new org.opentosca.container.core.tosca.model.TEntityType.PropertiesDefinition(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.PropertyConstraints } - * - */ - @Override - public TBoundaryDefinitions.PropertyConstraints createTBoundaryDefinitionsPropertyConstraints() { - return new TBoundaryDefinitions.PropertyConstraints(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Requirements } - * - */ - @Override - public TBoundaryDefinitions.Requirements createTBoundaryDefinitionsRequirements() { - return new TBoundaryDefinitions.Requirements(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Capabilities } - * - */ - @Override - public TBoundaryDefinitions.Capabilities createTBoundaryDefinitionsCapabilities() { - return new TBoundaryDefinitions.Capabilities(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Policies } - * - */ - @Override - public TBoundaryDefinitions.Policies createTBoundaryDefinitionsPolicies() { - return new TBoundaryDefinitions.Policies(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Interfaces } - * - */ - @Override - public TBoundaryDefinitions.Interfaces createTBoundaryDefinitionsInterfaces() { - return new TBoundaryDefinitions.Interfaces(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Properties.PropertyMappings } - * - */ - @Override - public TBoundaryDefinitions.Properties.PropertyMappings createTBoundaryDefinitionsPropertiesPropertyMappings() { - return new TBoundaryDefinitions.Properties.PropertyMappings(); - } - - /** - * Create an instance of {@link TExportedOperation.NodeOperation } - * - */ - @Override - public TExportedOperation.NodeOperation createTExportedOperationNodeOperation() { - return new TExportedOperation.NodeOperation(); - } - - /** - * Create an instance of {@link TExportedOperation.RelationshipOperation } - * - */ - @Override - public TExportedOperation.RelationshipOperation createTExportedOperationRelationshipOperation() { - return new TExportedOperation.RelationshipOperation(); - } - - /** - * Create an instance of {@link TExportedOperation.Plan } - * - */ - @Override - public TExportedOperation.Plan createTExportedOperationPlan() { - return new TExportedOperation.Plan(); - } - - /** - * Create an instance of {@link TPlan.InputParameters } - * - */ - @Override - public TPlan.InputParameters createTPlanInputParameters() { - return new TPlan.InputParameters(); - } - - /** - * Create an instance of {@link TPlan.OutputParameters } - * - */ - @Override - public TPlan.OutputParameters createTPlanOutputParameters() { - return new TPlan.OutputParameters(); - } - - /** - * Create an instance of {@link TPlan.PlanModel } - * - */ - @Override - public TPlan.PlanModel createTPlanPlanModel() { - return new TPlan.PlanModel(); - } - - /** - * Create an instance of {@link TPlan.PlanModelReference } - * - */ - @Override - public TPlan.PlanModelReference createTPlanPlanModelReference() { - return new TPlan.PlanModelReference(); - } - - /** - * Create an instance of {@link TCapabilityDefinition.Constraints } - * - */ - @Override - public TCapabilityDefinition.Constraints createTCapabilityDefinitionConstraints() { - return new TCapabilityDefinition.Constraints(); - } - - /** - * Create an instance of {@link TOperation.InputParameters } - * - */ - @Override - public TOperation.InputParameters createTOperationInputParameters() { - return new TOperation.InputParameters(); - } - - /** - * Create an instance of {@link TOperation.OutputParameters } - * - */ - @Override - public TOperation.OutputParameters createTOperationOutputParameters() { - return new TOperation.OutputParameters(); - } - - /** - * Create an instance of {@link TArtifactTemplate.ArtifactReferences } - * - */ - @Override - public TArtifactTemplate.ArtifactReferences createTArtifactTemplateArtifactReferences() { - return new TArtifactTemplate.ArtifactReferences(); - } - - /** - * Create an instance of {@link TRelationshipTypeImplementation.DerivedFrom } - * - */ - @Override - public TRelationshipTypeImplementation.DerivedFrom createTRelationshipTypeImplementationDerivedFrom() { - return new TRelationshipTypeImplementation.DerivedFrom(); - } - - /** - * Create an instance of {@link TRelationshipType.SourceInterfaces } - * - */ - @Override - public TRelationshipType.SourceInterfaces createTRelationshipTypeSourceInterfaces() { - return new TRelationshipType.SourceInterfaces(); - } - - /** - * Create an instance of {@link TRelationshipType.TargetInterfaces } - * - */ - @Override - public TRelationshipType.TargetInterfaces createTRelationshipTypeTargetInterfaces() { - return new TRelationshipType.TargetInterfaces(); - } - - /** - * Create an instance of {@link TRelationshipType.ValidSource } - * - */ - @Override - public TRelationshipType.ValidSource createTRelationshipTypeValidSource() { - return new TRelationshipType.ValidSource(); - } - - /** - * Create an instance of {@link TRelationshipType.ValidTarget } - * - */ - @Override - public TRelationshipType.ValidTarget createTRelationshipTypeValidTarget() { - return new TRelationshipType.ValidTarget(); - } - - /** - * Create an instance of {@link TNodeTypeImplementation.DerivedFrom } - * - */ - @Override - public TNodeTypeImplementation.DerivedFrom createTNodeTypeImplementationDerivedFrom() { - return new TNodeTypeImplementation.DerivedFrom(); - } - - /** - * Create an instance of {@link TNodeType.RequirementDefinitions } - * - */ - @Override - public TNodeType.RequirementDefinitions createTNodeTypeRequirementDefinitions() { - return new TNodeType.RequirementDefinitions(); - } - - /** - * Create an instance of {@link TNodeType.CapabilityDefinitions } - * - */ - @Override - public TNodeType.CapabilityDefinitions createTNodeTypeCapabilityDefinitions() { - return new TNodeType.CapabilityDefinitions(); - } - - /** - * Create an instance of {@link TNodeType.Interfaces } - * - */ - @Override - public TNodeType.Interfaces createTNodeTypeInterfaces() { - return new TNodeType.Interfaces(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link TDocumentation } {@code >} - * - */ - @XmlElementDecl(namespace = "http://docs.oasis-open.org/tosca/ns/2011/12", name = "documentation") - public JAXBElement createDocumentation(final TDocumentation value) { - return new JAXBElement<>(ObjectFactory._Documentation_QNAME, TDocumentation.class, null, value); - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TAppliesTo.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TAppliesTo.java deleted file mode 100644 index 85f2b6043..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TAppliesTo.java +++ /dev/null @@ -1,139 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tAppliesTo complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tAppliesTo">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="NodeTypeReference" maxOccurs="unbounded">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tAppliesTo", propOrder = {"nodeTypeReference"}) -public class TAppliesTo { - - @XmlElement(name = "NodeTypeReference", required = true) - protected List nodeTypeReference; - - - /** - * Gets the value of the nodeTypeReference property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the nodeTypeReference property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getNodeTypeReference().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TAppliesTo.NodeTypeReference } - * - * - */ - public List getNodeTypeReference() { - if (this.nodeTypeReference == null) { - this.nodeTypeReference = new ArrayList<>(); - } - return this.nodeTypeReference; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class NodeTypeReference { - - @XmlAttribute(name = "typeRef", required = true) - protected QName typeRef; - - - /** - * Gets the value of the typeRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getTypeRef() { - return this.typeRef; - } - - /** - * Sets the value of the typeRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setTypeRef(final QName value) { - this.typeRef = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactReference.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactReference.java deleted file mode 100644 index 8960ac510..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactReference.java +++ /dev/null @@ -1,224 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tArtifactReference complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tArtifactReference">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <choice maxOccurs="unbounded" minOccurs="0">
    - *         <element name="Include">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Exclude">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </choice>
    - *       <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tArtifactReference", propOrder = {"includeOrExclude"}) -public class TArtifactReference { - - @XmlElements({@XmlElement(name = "Include", type = TArtifactReference.Include.class), - @XmlElement(name = "Exclude", type = TArtifactReference.Exclude.class)}) - protected List includeOrExclude; - @XmlAttribute(name = "reference", required = true) - @XmlSchemaType(name = "anyURI") - protected String reference; - - - /** - * Gets the value of the includeOrExclude property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the includeOrExclude property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getIncludeOrExclude().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TArtifactReference.Include } - * {@link TArtifactReference.Exclude } - * - * - */ - public List getIncludeOrExclude() { - if (this.includeOrExclude == null) { - this.includeOrExclude = new ArrayList<>(); - } - return this.includeOrExclude; - } - - /** - * Gets the value of the reference property. - * - * @return possible object is {@link String } - * - */ - public String getReference() { - return this.reference; - } - - /** - * Sets the value of the reference property. - * - * @param value allowed object is {@link String } - * - */ - public void setReference(final String value) { - this.reference = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Exclude { - - @XmlAttribute(name = "pattern", required = true) - protected String pattern; - - - /** - * Gets the value of the pattern property. - * - * @return possible object is {@link String } - * - */ - public String getPattern() { - return this.pattern; - } - - /** - * Sets the value of the pattern property. - * - * @param value allowed object is {@link String } - * - */ - public void setPattern(final String value) { - this.pattern = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Include { - - @XmlAttribute(name = "pattern", required = true) - protected String pattern; - - - /** - * Gets the value of the pattern property. - * - * @return possible object is {@link String } - * - */ - public String getPattern() { - return this.pattern; - } - - /** - * Sets the value of the pattern property. - * - * @param value allowed object is {@link String } - * - */ - public void setPattern(final String value) { - this.pattern = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactTemplate.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactTemplate.java deleted file mode 100644 index d2834a57d..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactTemplate.java +++ /dev/null @@ -1,166 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tArtifactTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tArtifactTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <sequence>
    - *         <element name="ArtifactReferences" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="ArtifactReference" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactReference" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tArtifactTemplate", propOrder = {"artifactReferences"}) -public class TArtifactTemplate extends TEntityTemplate { - - @XmlElement(name = "ArtifactReferences") - protected TArtifactTemplate.ArtifactReferences artifactReferences; - @XmlAttribute(name = "name") - protected String name; - - - /** - * Gets the value of the artifactReferences property. - * - * @return possible object is {@link TArtifactTemplate.ArtifactReferences } - * - */ - public TArtifactTemplate.ArtifactReferences getArtifactReferences() { - return this.artifactReferences; - } - - /** - * Sets the value of the artifactReferences property. - * - * @param value allowed object is {@link TArtifactTemplate.ArtifactReferences } - * - */ - public void setArtifactReferences(final TArtifactTemplate.ArtifactReferences value) { - this.artifactReferences = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="ArtifactReference" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactReference" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"artifactReference"}) - public static class ArtifactReferences { - - @XmlElement(name = "ArtifactReference", required = true) - protected List artifactReference; - - - /** - * Gets the value of the artifactReference property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the artifactReference property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getArtifactReference().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TArtifactReference } - * - * - */ - public List getArtifactReference() { - if (this.artifactReference == null) { - this.artifactReference = new ArrayList<>(); - } - return this.artifactReference; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactType.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactType.java deleted file mode 100644 index 08729da34..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TArtifactType.java +++ /dev/null @@ -1,41 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tArtifactType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tArtifactType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tArtifactType") -public class TArtifactType extends TEntityType { - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TBoolean.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TBoolean.java deleted file mode 100644 index 5f87e197c..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TBoolean.java +++ /dev/null @@ -1,64 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tBoolean. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - *

    - * - *

    - * <simpleType name="tBoolean">
    - *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *     <enumeration value="yes"/>
    - *     <enumeration value="no"/>
    - *   </restriction>
    - * </simpleType>
    - * 
    - * - */ -@XmlType(name = "tBoolean") -@XmlEnum -public enum TBoolean { - - @XmlEnumValue("yes") - YES("yes"), @XmlEnumValue("no") - NO("no"); - - private final String value; - - - TBoolean(final String v) { - this.value = v; - } - - public String value() { - return this.value; - } - - public static TBoolean fromValue(final String v) { - for (final TBoolean c : TBoolean.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TBoundaryDefinitions.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TBoundaryDefinitions.java deleted file mode 100644 index 999f41e6c..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TBoundaryDefinitions.java +++ /dev/null @@ -1,699 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tBoundaryDefinitions complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tBoundaryDefinitions">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Properties" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <any namespace='##other'/>
    - *                   <element name="PropertyMappings" minOccurs="0">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    - *                           </sequence>
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="PropertyConstraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Requirements" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementRef" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Capabilities" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityRef" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Policies" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Interfaces" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedInterface" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tBoundaryDefinitions", - propOrder = {"properties", "propertyConstraints", "requirements", "capabilities", "policies", "interfaces"}) -public class TBoundaryDefinitions { - - @XmlElement(name = "Properties") - protected TBoundaryDefinitions.Properties properties; - @XmlElement(name = "PropertyConstraints") - protected TBoundaryDefinitions.PropertyConstraints propertyConstraints; - @XmlElement(name = "Requirements") - protected TBoundaryDefinitions.Requirements requirements; - @XmlElement(name = "Capabilities") - protected TBoundaryDefinitions.Capabilities capabilities; - @XmlElement(name = "Policies") - protected TBoundaryDefinitions.Policies policies; - @XmlElement(name = "Interfaces") - protected TBoundaryDefinitions.Interfaces interfaces; - - - /** - * Gets the value of the properties property. - * - * @return possible object is {@link TBoundaryDefinitions.Properties } - * - */ - public TBoundaryDefinitions.Properties getProperties() { - return this.properties; - } - - /** - * Sets the value of the properties property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Properties } - * - */ - public void setProperties(final TBoundaryDefinitions.Properties value) { - this.properties = value; - } - - /** - * Gets the value of the propertyConstraints property. - * - * @return possible object is {@link TBoundaryDefinitions.PropertyConstraints } - * - */ - public TBoundaryDefinitions.PropertyConstraints getPropertyConstraints() { - return this.propertyConstraints; - } - - /** - * Sets the value of the propertyConstraints property. - * - * @param value allowed object is {@link TBoundaryDefinitions.PropertyConstraints } - * - */ - public void setPropertyConstraints(final TBoundaryDefinitions.PropertyConstraints value) { - this.propertyConstraints = value; - } - - /** - * Gets the value of the requirements property. - * - * @return possible object is {@link TBoundaryDefinitions.Requirements } - * - */ - public TBoundaryDefinitions.Requirements getRequirements() { - return this.requirements; - } - - /** - * Sets the value of the requirements property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Requirements } - * - */ - public void setRequirements(final TBoundaryDefinitions.Requirements value) { - this.requirements = value; - } - - /** - * Gets the value of the capabilities property. - * - * @return possible object is {@link TBoundaryDefinitions.Capabilities } - * - */ - public TBoundaryDefinitions.Capabilities getCapabilities() { - return this.capabilities; - } - - /** - * Sets the value of the capabilities property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Capabilities } - * - */ - public void setCapabilities(final TBoundaryDefinitions.Capabilities value) { - this.capabilities = value; - } - - /** - * Gets the value of the policies property. - * - * @return possible object is {@link TBoundaryDefinitions.Policies } - * - */ - public TBoundaryDefinitions.Policies getPolicies() { - return this.policies; - } - - /** - * Sets the value of the policies property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Policies } - * - */ - public void setPolicies(final TBoundaryDefinitions.Policies value) { - this.policies = value; - } - - /** - * Gets the value of the interfaces property. - * - * @return possible object is {@link TBoundaryDefinitions.Interfaces } - * - */ - public TBoundaryDefinitions.Interfaces getInterfaces() { - return this.interfaces; - } - - /** - * Sets the value of the interfaces property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Interfaces } - * - */ - public void setInterfaces(final TBoundaryDefinitions.Interfaces value) { - this.interfaces = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityRef" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"capability"}) - public static class Capabilities { - - @XmlElement(name = "Capability", required = true) - protected List capability; - - - /** - * Gets the value of the capability property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the capability property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getCapability().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCapabilityRef } - * - * - */ - public List getCapability() { - if (this.capability == null) { - this.capability = new ArrayList<>(); - } - return this.capability; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedInterface" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"_interface"}) - public static class Interfaces { - - @XmlElement(name = "Interface", required = true) - protected List _interface; - - - /** - * Gets the value of the interface property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the interface property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInterface().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TExportedInterface } - * - * - */ - public List getInterface() { - if (this._interface == null) { - this._interface = new ArrayList<>(); - } - return this._interface; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"policy"}) - public static class Policies { - - @XmlElement(name = "Policy", required = true) - protected List policy; - - - /** - * Gets the value of the policy property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the policy property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getPolicy().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPolicy } - * - * - */ - public List getPolicy() { - if (this.policy == null) { - this.policy = new ArrayList<>(); - } - return this.policy; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <any namespace='##other'/>
    -     *         <element name="PropertyMappings" minOccurs="0">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    -     *                 </sequence>
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any", "propertyMappings"}) - public static class Properties { - - @XmlAnyElement(lax = true) - protected Object any; - @XmlElement(name = "PropertyMappings") - protected TBoundaryDefinitions.Properties.PropertyMappings propertyMappings; - - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - /** - * Gets the value of the propertyMappings property. - * - * @return possible object is {@link TBoundaryDefinitions.Properties.PropertyMappings } - * - */ - public TBoundaryDefinitions.Properties.PropertyMappings getPropertyMappings() { - return this.propertyMappings; - } - - /** - * Sets the value of the propertyMappings property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Properties.PropertyMappings } - * - */ - public void setPropertyMappings(final TBoundaryDefinitions.Properties.PropertyMappings value) { - this.propertyMappings = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    -         *       </sequence>
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"propertyMapping"}) - public static class PropertyMappings { - - @XmlElement(name = "PropertyMapping", required = true) - protected List propertyMapping; - - - /** - * Gets the value of the propertyMapping property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the propertyMapping property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -             * getPropertyMapping().add(newItem);
    -             * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPropertyMapping } - * - * - */ - public List getPropertyMapping() { - if (this.propertyMapping == null) { - this.propertyMapping = new ArrayList<>(); - } - return this.propertyMapping; - } - - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"propertyConstraint"}) - public static class PropertyConstraints { - - @XmlElement(name = "PropertyConstraint", required = true) - protected List propertyConstraint; - - - /** - * Gets the value of the propertyConstraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the propertyConstraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getPropertyConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPropertyConstraint } - * - * - */ - public List getPropertyConstraint() { - if (this.propertyConstraint == null) { - this.propertyConstraint = new ArrayList<>(); - } - return this.propertyConstraint; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementRef" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"requirement"}) - public static class Requirements { - - @XmlElement(name = "Requirement", required = true) - protected List requirement; - - - /** - * Gets the value of the requirement property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the requirement property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getRequirement().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRequirementRef } - * - * - */ - public List getRequirement() { - if (this.requirement == null) { - this.requirement = new ArrayList<>(); - } - return this.requirement; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapability.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapability.java deleted file mode 100644 index 41cee3a4d..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapability.java +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tCapability complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCapability">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCapability") -public class TCapability extends TEntityTemplate { - - @XmlAttribute(name = "name", required = true) - protected String name; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityDefinition.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityDefinition.java deleted file mode 100644 index 246bff8ed..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityDefinition.java +++ /dev/null @@ -1,259 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tCapabilityDefinition complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCapabilityDefinition">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Constraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="capabilityType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="lowerBound" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    - *       <attribute name="upperBound" default="1">
    - *         <simpleType>
    - *           <union>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    - *                 <pattern value="([1-9]+[0-9]*)"/>
    - *               </restriction>
    - *             </simpleType>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *                 <enumeration value="unbounded"/>
    - *               </restriction>
    - *             </simpleType>
    - *           </union>
    - *         </simpleType>
    - *       </attribute>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCapabilityDefinition", propOrder = {"constraints"}) -public class TCapabilityDefinition extends TExtensibleElements { - - @XmlElement(name = "Constraints") - protected TCapabilityDefinition.Constraints constraints; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "capabilityType", required = true) - protected QName capabilityType; - @XmlAttribute(name = "lowerBound") - protected Integer lowerBound; - @XmlAttribute(name = "upperBound") - protected String upperBound; - - - /** - * Gets the value of the constraints property. - * - * @return possible object is {@link TCapabilityDefinition.Constraints } - * - */ - public TCapabilityDefinition.Constraints getConstraints() { - return this.constraints; - } - - /** - * Sets the value of the constraints property. - * - * @param value allowed object is {@link TCapabilityDefinition.Constraints } - * - */ - public void setConstraints(final TCapabilityDefinition.Constraints value) { - this.constraints = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the capabilityType property. - * - * @return possible object is {@link QName } - * - */ - public QName getCapabilityType() { - return this.capabilityType; - } - - /** - * Sets the value of the capabilityType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setCapabilityType(final QName value) { - this.capabilityType = value; - } - - /** - * Gets the value of the lowerBound property. - * - * @return possible object is {@link Integer } - * - */ - public int getLowerBound() { - if (this.lowerBound == null) { - return 1; - } else { - return this.lowerBound; - } - } - - /** - * Sets the value of the lowerBound property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setLowerBound(final Integer value) { - this.lowerBound = value; - } - - /** - * Gets the value of the upperBound property. - * - * @return possible object is {@link String } - * - */ - public String getUpperBound() { - if (this.upperBound == null) { - return "1"; - } else { - return this.upperBound; - } - } - - /** - * Sets the value of the upperBound property. - * - * @param value allowed object is {@link String } - * - */ - public void setUpperBound(final String value) { - this.upperBound = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"constraint"}) - public static class Constraints { - - @XmlElement(name = "Constraint", required = true) - protected List constraint; - - - /** - * Gets the value of the constraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the constraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TConstraint } - * - * - */ - public List getConstraint() { - if (this.constraint == null) { - this.constraint = new ArrayList<>(); - } - return this.constraint; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityRef.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityRef.java deleted file mode 100644 index 9d6e11cfa..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityRef.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tCapabilityRef complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCapabilityRef">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCapabilityRef") -public class TCapabilityRef { - - @XmlAttribute(name = "name") - protected String name; - @XmlAttribute(name = "ref", required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object ref; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the ref property. - * - * @return possible object is {@link Object } - * - */ - public Object getRef() { - return this.ref; - } - - /** - * Sets the value of the ref property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRef(final Object value) { - this.ref = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityType.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityType.java deleted file mode 100644 index a29e1d6ba..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCapabilityType.java +++ /dev/null @@ -1,41 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tCapabilityType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCapabilityType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCapabilityType") -public class TCapabilityType extends TEntityType { - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCondition.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCondition.java deleted file mode 100644 index 37439a0bd..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TCondition.java +++ /dev/null @@ -1,107 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - -/** - *

    - * Java class for tCondition complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCondition">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="expressionLanguage" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCondition", propOrder = {"any"}) -public class TCondition { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(name = "expressionLanguage", required = true) - @XmlSchemaType(name = "anyURI") - protected String expressionLanguage; - - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getAny().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - /** - * Gets the value of the expressionLanguage property. - * - * @return possible object is {@link String } - * - */ - public String getExpressionLanguage() { - return this.expressionLanguage; - } - - /** - * Sets the value of the expressionLanguage property. - * - * @param value allowed object is {@link String } - * - */ - public void setExpressionLanguage(final String value) { - this.expressionLanguage = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TConstraint.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TConstraint.java deleted file mode 100644 index 9879df861..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TConstraint.java +++ /dev/null @@ -1,98 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - -/** - *

    - * Java class for tConstraint complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tConstraint">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' namespace='##other'/>
    - *       </sequence>
    - *       <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tConstraint", propOrder = {"any"}) -@XmlSeeAlso({TPropertyConstraint.class}) -public class TConstraint { - - @XmlAnyElement(lax = true) - protected Object any; - @XmlAttribute(name = "constraintType", required = true) - @XmlSchemaType(name = "anyURI") - protected String constraintType; - - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } {@link Element } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } {@link Element } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - /** - * Gets the value of the constraintType property. - * - * @return possible object is {@link String } - * - */ - public String getConstraintType() { - return this.constraintType; - } - - /** - * Sets the value of the constraintType property. - * - * @param value allowed object is {@link String } - * - */ - public void setConstraintType(final String value) { - this.constraintType = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDefinitions.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDefinitions.java deleted file mode 100644 index 3f0f345ec..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDefinitions.java +++ /dev/null @@ -1,407 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.w3c.dom.Element; - -/** - *

    - * Java class for tDefinitions complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDefinitions">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Extensions" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Import" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImport" maxOccurs="unbounded" minOccurs="0"/>
    - *         <element name="Types" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <choice maxOccurs="unbounded">
    - *           <element name="ServiceTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tServiceTemplate"/>
    - *           <element name="NodeType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeType"/>
    - *           <element name="NodeTypeImplementation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeTypeImplementation"/>
    - *           <element name="RelationshipType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipType"/>
    - *           <element name="RelationshipTypeImplementation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipTypeImplementation"/>
    - *           <element name="RequirementType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementType"/>
    - *           <element name="CapabilityType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityType"/>
    - *           <element name="ArtifactType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactType"/>
    - *           <element name="ArtifactTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactTemplate"/>
    - *           <element name="PolicyType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicyType"/>
    - *           <element name="PolicyTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicyTemplate"/>
    - *         </choice>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="targetNamespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDefinitions", - propOrder = {"extensions", "_import", "types", "serviceTemplateOrNodeTypeOrNodeTypeImplementation"}) -@XmlSeeAlso({Definitions.class}) -public class TDefinitions extends TExtensibleElements { - - @XmlElement(name = "Extensions") - protected TDefinitions.Extensions extensions; - @XmlElement(name = "Import") - protected List _import; - @XmlElement(name = "Types") - protected TDefinitions.Types types; - @XmlElements({@XmlElement(name = "ServiceTemplate", type = TServiceTemplate.class), - @XmlElement(name = "NodeType", type = TNodeType.class), - @XmlElement(name = "NodeTypeImplementation", type = TNodeTypeImplementation.class), - @XmlElement(name = "RelationshipType", type = TRelationshipType.class), - @XmlElement(name = "RelationshipTypeImplementation", type = TRelationshipTypeImplementation.class), - @XmlElement(name = "RequirementType", type = TRequirementType.class), - @XmlElement(name = "CapabilityType", type = TCapabilityType.class), - @XmlElement(name = "ArtifactType", type = TArtifactType.class), - @XmlElement(name = "ArtifactTemplate", type = TArtifactTemplate.class), - @XmlElement(name = "PolicyType", type = TPolicyType.class), - @XmlElement(name = "PolicyTemplate", type = TPolicyTemplate.class)}) - protected List serviceTemplateOrNodeTypeOrNodeTypeImplementation; - @XmlAttribute(name = "id", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute(name = "name") - protected String name; - @XmlAttribute(name = "targetNamespace", required = true) - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - - - /** - * Gets the value of the extensions property. - * - * @return possible object is {@link TDefinitions.Extensions } - * - */ - public TDefinitions.Extensions getExtensions() { - return this.extensions; - } - - /** - * Sets the value of the extensions property. - * - * @param value allowed object is {@link TDefinitions.Extensions } - * - */ - public void setExtensions(final TDefinitions.Extensions value) { - this.extensions = value; - } - - /** - * Gets the value of the import property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the import property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getImport().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TImport } - * - * - */ - public List getImport() { - if (this._import == null) { - this._import = new ArrayList<>(); - } - return this._import; - } - - /** - * Gets the value of the types property. - * - * @return possible object is {@link TDefinitions.Types } - * - */ - public TDefinitions.Types getTypes() { - return this.types; - } - - /** - * Sets the value of the types property. - * - * @param value allowed object is {@link TDefinitions.Types } - * - */ - public void setTypes(final TDefinitions.Types value) { - this.types = value; - } - - /** - * Gets the value of the serviceTemplateOrNodeTypeOrNodeTypeImplementation property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the serviceTemplateOrNodeTypeOrNodeTypeImplementation - * property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getServiceTemplateOrNodeTypeOrNodeTypeImplementation().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TServiceTemplate } - * {@link TNodeType } {@link TNodeTypeImplementation } {@link TRelationshipType } - * {@link TRelationshipTypeImplementation } {@link TRequirementType } {@link TCapabilityType } - * {@link TArtifactType } {@link TArtifactTemplate } {@link TPolicyType } {@link TPolicyTemplate } - * - * - */ - public List getServiceTemplateOrNodeTypeOrNodeTypeImplementation() { - if (this.serviceTemplateOrNodeTypeOrNodeTypeImplementation == null) { - this.serviceTemplateOrNodeTypeOrNodeTypeImplementation = new ArrayList<>(); - } - return this.serviceTemplateOrNodeTypeOrNodeTypeImplementation; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"extension"}) - public static class Extensions { - - @XmlElement(name = "Extension", required = true) - protected List extension; - - - /** - * Gets the value of the extension property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the extension property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getExtension().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TExtension } - * - * - */ - public List getExtension() { - if (this.extension == null) { - this.extension = new ArrayList<>(); - } - return this.extension; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class Types { - - @XmlAnyElement(lax = true) - protected List any; - - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getAny().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDeploymentArtifact.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDeploymentArtifact.java deleted file mode 100644 index 8d435672c..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDeploymentArtifact.java +++ /dev/null @@ -1,114 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tDeploymentArtifact complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDeploymentArtifact">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="artifactType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="artifactRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDeploymentArtifact") -public class TDeploymentArtifact extends TExtensibleElements { - - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "artifactType", required = true) - protected QName artifactType; - @XmlAttribute(name = "artifactRef") - protected QName artifactRef; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the artifactType property. - * - * @return possible object is {@link QName } - * - */ - public QName getArtifactType() { - return this.artifactType; - } - - /** - * Sets the value of the artifactType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setArtifactType(final QName value) { - this.artifactType = value; - } - - /** - * Gets the value of the artifactRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getArtifactRef() { - return this.artifactRef; - } - - /** - * Sets the value of the artifactRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setArtifactRef(final QName value) { - this.artifactRef = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDeploymentArtifacts.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDeploymentArtifacts.java deleted file mode 100644 index 537b4157a..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDeploymentArtifacts.java +++ /dev/null @@ -1,79 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tDeploymentArtifacts complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDeploymentArtifacts">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="DeploymentArtifact" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifact" maxOccurs="unbounded"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDeploymentArtifacts", propOrder = {"deploymentArtifact"}) -public class TDeploymentArtifacts { - - @XmlElement(name = "DeploymentArtifact", required = true) - protected List deploymentArtifact; - - - /** - * Gets the value of the deploymentArtifact property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the deploymentArtifact property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getDeploymentArtifact().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TDeploymentArtifact } - * - * - */ - public List getDeploymentArtifact() { - if (this.deploymentArtifact == null) { - this.deploymentArtifact = new ArrayList<>(); - } - return this.deploymentArtifact; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDocumentation.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDocumentation.java deleted file mode 100644 index 97c7bf093..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TDocumentation.java +++ /dev/null @@ -1,131 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// - - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlMixed; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tDocumentation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDocumentation">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="source" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDocumentation", propOrder = {"content"}) -public class TDocumentation { - - @XmlMixed - @XmlAnyElement(lax = true) - protected List content; - @XmlAttribute(name = "source") - @XmlSchemaType(name = "anyURI") - protected String source; - @XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace") - protected String lang; - - /** - * Gets the value of the content property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the content property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getContent().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } {@link Element } - * {@link Object } - * - * - */ - public List getContent() { - if (this.content == null) { - this.content = new ArrayList<>(); - } - return this.content; - } - - /** - * Gets the value of the source property. - * - * @return possible object is {@link String } - * - */ - public String getSource() { - return this.source; - } - - /** - * Sets the value of the source property. - * - * @param value allowed object is {@link String } - * - */ - public void setSource(final String value) { - this.source = value; - } - - /** - * Gets the value of the lang property. - * - * @return possible object is {@link String } - * - */ - public String getLang() { - return this.lang; - } - - /** - * Sets the value of the lang property. - * - * @param value allowed object is {@link String } - * - */ - public void setLang(final String value) { - this.lang = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TEntityTemplate.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TEntityTemplate.java deleted file mode 100644 index 97eb00cb6..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TEntityTemplate.java +++ /dev/null @@ -1,287 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - -/** - *

    - * Java class for tEntityTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEntityTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Properties" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <any processContents='lax' namespace='##other'/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="PropertyConstraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    - *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEntityTemplate", propOrder = {"properties", "propertyConstraints"}) -@XmlSeeAlso({TArtifactTemplate.class, TPolicyTemplate.class, TNodeTemplate.class, TCapability.class, - TRelationshipTemplate.class, TRequirement.class}) -public abstract class TEntityTemplate extends TExtensibleElements { - - @XmlElement(name = "Properties") - protected TEntityTemplate.Properties properties; - @XmlElement(name = "PropertyConstraints") - protected TEntityTemplate.PropertyConstraints propertyConstraints; - @XmlAttribute(name = "id", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute(name = "type", required = true) - protected QName type; - - - /** - * Gets the value of the properties property. - * - * @return possible object is {@link TEntityTemplate.Properties } - * - */ - public TEntityTemplate.Properties getProperties() { - return this.properties; - } - - /** - * Sets the value of the properties property. - * - * @param value allowed object is {@link TEntityTemplate.Properties } - * - */ - public void setProperties(final TEntityTemplate.Properties value) { - this.properties = value; - } - - /** - * Gets the value of the propertyConstraints property. - * - * @return possible object is {@link TEntityTemplate.PropertyConstraints } - * - */ - public TEntityTemplate.PropertyConstraints getPropertyConstraints() { - return this.propertyConstraints; - } - - /** - * Sets the value of the propertyConstraints property. - * - * @param value allowed object is {@link TEntityTemplate.PropertyConstraints } - * - */ - public void setPropertyConstraints(final TEntityTemplate.PropertyConstraints value) { - this.propertyConstraints = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link QName } - * - */ - public QName getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link QName } - * - */ - public void setType(final QName value) { - this.type = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <any processContents='lax' namespace='##other'/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class Properties { - - @XmlAnyElement(lax = true) - protected Object any; - - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } {@link Element } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } {@link Element } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"propertyConstraint"}) - public static class PropertyConstraints { - - @XmlElement(name = "PropertyConstraint", required = true) - protected List propertyConstraint; - - - /** - * Gets the value of the propertyConstraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the propertyConstraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getPropertyConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPropertyConstraint } - * - * - */ - public List getPropertyConstraint() { - if (this.propertyConstraint == null) { - this.propertyConstraint = new ArrayList<>(); - } - return this.propertyConstraint; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TEntityType.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TEntityType.java deleted file mode 100644 index f0ac492bd..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TEntityType.java +++ /dev/null @@ -1,365 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tEntityType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEntityType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    - *         <element name="DerivedFrom" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="PropertiesDefinition" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="element" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *                 <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEntityType", propOrder = {"tags", "derivedFrom", "propertiesDefinition"}) -@XmlSeeAlso({TNodeType.class, TRelationshipType.class, TRequirementType.class, TCapabilityType.class, - TArtifactType.class, TPolicyType.class}) -public abstract class TEntityType extends TExtensibleElements { - - @XmlElement(name = "Tags") - protected TTags tags; - @XmlElement(name = "DerivedFrom") - protected TEntityType.DerivedFrom derivedFrom; - @XmlElement(name = "PropertiesDefinition") - protected TEntityType.PropertiesDefinition propertiesDefinition; - @XmlAttribute(name = "name", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - @XmlAttribute(name = "abstract") - protected TBoolean _abstract; - @XmlAttribute(name = "final") - protected TBoolean _final; - @XmlAttribute(name = "targetNamespace") - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - - - /** - * Gets the value of the tags property. - * - * @return possible object is {@link TTags } - * - */ - public TTags getTags() { - return this.tags; - } - - /** - * Sets the value of the tags property. - * - * @param value allowed object is {@link TTags } - * - */ - public void setTags(final TTags value) { - this.tags = value; - } - - /** - * Gets the value of the derivedFrom property. - * - * @return possible object is {@link TEntityType.DerivedFrom } - * - */ - public TEntityType.DerivedFrom getDerivedFrom() { - return this.derivedFrom; - } - - /** - * Sets the value of the derivedFrom property. - * - * @param value allowed object is {@link TEntityType.DerivedFrom } - * - */ - public void setDerivedFrom(final TEntityType.DerivedFrom value) { - this.derivedFrom = value; - } - - /** - * Gets the value of the propertiesDefinition property. - * - * @return possible object is {@link TEntityType.PropertiesDefinition } - * - */ - public TEntityType.PropertiesDefinition getPropertiesDefinition() { - return this.propertiesDefinition; - } - - /** - * Sets the value of the propertiesDefinition property. - * - * @param value allowed object is {@link TEntityType.PropertiesDefinition } - * - */ - public void setPropertiesDefinition(final TEntityType.PropertiesDefinition value) { - this.propertiesDefinition = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the abstract property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getAbstract() { - if (this._abstract == null) { - return TBoolean.NO; - } else { - return this._abstract; - } - } - - /** - * Sets the value of the abstract property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setAbstract(final TBoolean value) { - this._abstract = value; - } - - /** - * Gets the value of the final property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getFinal() { - if (this._final == null) { - return TBoolean.NO; - } else { - return this._final; - } - } - - /** - * Sets the value of the final property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setFinal(final TBoolean value) { - this._final = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class DerivedFrom { - - @XmlAttribute(name = "typeRef", required = true) - protected QName typeRef; - - - /** - * Gets the value of the typeRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getTypeRef() { - return this.typeRef; - } - - /** - * Sets the value of the typeRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setTypeRef(final QName value) { - this.typeRef = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="element" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class PropertiesDefinition { - - @XmlAttribute(name = "element") - protected QName element; - @XmlAttribute(name = "type") - protected QName type; - - - /** - * Gets the value of the element property. - * - * @return possible object is {@link QName } - * - */ - public QName getElement() { - return this.element; - } - - /** - * Sets the value of the element property. - * - * @param value allowed object is {@link QName } - * - */ - public void setElement(final QName value) { - this.element = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link QName } - * - */ - public QName getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link QName } - * - */ - public void setType(final QName value) { - this.type = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExportedInterface.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExportedInterface.java deleted file mode 100644 index 3091dede1..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExportedInterface.java +++ /dev/null @@ -1,105 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tExportedInterface complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExportedInterface">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Operation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedOperation" maxOccurs="unbounded"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExportedInterface", propOrder = {"operation"}) -public class TExportedInterface { - - @XmlElement(name = "Operation", required = true) - protected List operation; - @XmlAttribute(name = "name", required = true) - @XmlSchemaType(name = "anyURI") - protected String name; - - - /** - * Gets the value of the operation property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the operation property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getOperation().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TExportedOperation } - * - * - */ - public List getOperation() { - if (this.operation == null) { - this.operation = new ArrayList<>(); - } - return this.operation; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExportedOperation.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExportedOperation.java deleted file mode 100644 index 37d64ed7a..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExportedOperation.java +++ /dev/null @@ -1,424 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -/** - *

    - * Java class for tExportedOperation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExportedOperation">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <choice>
    - *         <element name="NodeOperation">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="nodeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *                 <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *                 <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="RelationshipOperation">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="relationshipRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *                 <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *                 <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Plan">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="planRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </choice>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExportedOperation", propOrder = {"nodeOperation", "relationshipOperation", "plan"}) -public class TExportedOperation { - - @XmlElement(name = "NodeOperation") - protected TExportedOperation.NodeOperation nodeOperation; - @XmlElement(name = "RelationshipOperation") - protected TExportedOperation.RelationshipOperation relationshipOperation; - @XmlElement(name = "Plan") - protected TExportedOperation.Plan plan; - @XmlAttribute(name = "name", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - - - /** - * Gets the value of the nodeOperation property. - * - * @return possible object is {@link TExportedOperation.NodeOperation } - * - */ - public TExportedOperation.NodeOperation getNodeOperation() { - return this.nodeOperation; - } - - /** - * Sets the value of the nodeOperation property. - * - * @param value allowed object is {@link TExportedOperation.NodeOperation } - * - */ - public void setNodeOperation(final TExportedOperation.NodeOperation value) { - this.nodeOperation = value; - } - - /** - * Gets the value of the relationshipOperation property. - * - * @return possible object is {@link TExportedOperation.RelationshipOperation } - * - */ - public TExportedOperation.RelationshipOperation getRelationshipOperation() { - return this.relationshipOperation; - } - - /** - * Sets the value of the relationshipOperation property. - * - * @param value allowed object is {@link TExportedOperation.RelationshipOperation } - * - */ - public void setRelationshipOperation(final TExportedOperation.RelationshipOperation value) { - this.relationshipOperation = value; - } - - /** - * Gets the value of the plan property. - * - * @return possible object is {@link TExportedOperation.Plan } - * - */ - public TExportedOperation.Plan getPlan() { - return this.plan; - } - - /** - * Sets the value of the plan property. - * - * @param value allowed object is {@link TExportedOperation.Plan } - * - */ - public void setPlan(final TExportedOperation.Plan value) { - this.plan = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="nodeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *       <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *       <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class NodeOperation { - - @XmlAttribute(name = "nodeRef", required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object nodeRef; - @XmlAttribute(name = "interfaceName", required = true) - @XmlSchemaType(name = "anyURI") - protected String interfaceName; - @XmlAttribute(name = "operationName", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String operationName; - - - /** - * Gets the value of the nodeRef property. - * - * @return possible object is {@link Object } - * - */ - public Object getNodeRef() { - return this.nodeRef; - } - - /** - * Sets the value of the nodeRef property. - * - * @param value allowed object is {@link Object } - * - */ - public void setNodeRef(final Object value) { - this.nodeRef = value; - } - - /** - * Gets the value of the interfaceName property. - * - * @return possible object is {@link String } - * - */ - public String getInterfaceName() { - return this.interfaceName; - } - - /** - * Sets the value of the interfaceName property. - * - * @param value allowed object is {@link String } - * - */ - public void setInterfaceName(final String value) { - this.interfaceName = value; - } - - /** - * Gets the value of the operationName property. - * - * @return possible object is {@link String } - * - */ - public String getOperationName() { - return this.operationName; - } - - /** - * Sets the value of the operationName property. - * - * @param value allowed object is {@link String } - * - */ - public void setOperationName(final String value) { - this.operationName = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="planRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Plan { - - @XmlAttribute(name = "planRef", required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object planRef; - - - /** - * Gets the value of the planRef property. - * - * @return possible object is {@link Object } - * - */ - public Object getPlanRef() { - return this.planRef; - } - - /** - * Sets the value of the planRef property. - * - * @param value allowed object is {@link Object } - * - */ - public void setPlanRef(final Object value) { - this.planRef = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="relationshipRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *       <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *       <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class RelationshipOperation { - - @XmlAttribute(name = "relationshipRef", required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object relationshipRef; - @XmlAttribute(name = "interfaceName", required = true) - @XmlSchemaType(name = "anyURI") - protected String interfaceName; - @XmlAttribute(name = "operationName", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String operationName; - - - /** - * Gets the value of the relationshipRef property. - * - * @return possible object is {@link Object } - * - */ - public Object getRelationshipRef() { - return this.relationshipRef; - } - - /** - * Sets the value of the relationshipRef property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRelationshipRef(final Object value) { - this.relationshipRef = value; - } - - /** - * Gets the value of the interfaceName property. - * - * @return possible object is {@link String } - * - */ - public String getInterfaceName() { - return this.interfaceName; - } - - /** - * Sets the value of the interfaceName property. - * - * @param value allowed object is {@link String } - * - */ - public void setInterfaceName(final String value) { - this.interfaceName = value; - } - - /** - * Gets the value of the operationName property. - * - * @return possible object is {@link String } - * - */ - public String getOperationName() { - return this.operationName; - } - - /** - * Sets the value of the operationName property. - * - * @param value allowed object is {@link String } - * - */ - public void setOperationName(final String value) { - this.operationName = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtensibleElements.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtensibleElements.java deleted file mode 100644 index 3934754b6..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtensibleElements.java +++ /dev/null @@ -1,140 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - -/** - *

    - * Java class for tExtensibleElements complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExtensibleElements">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element ref="{http://docs.oasis-open.org/tosca/ns/2011/12}documentation" maxOccurs="unbounded" minOccurs="0"/>
    - *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExtensibleElements", propOrder = {"documentation", "any"}) -@XmlSeeAlso({TImport.class, TServiceTemplate.class, TNodeTypeImplementation.class, - TRelationshipTypeImplementation.class, TOperation.class, TCapabilityDefinition.class, TPlan.class, - TExtension.class, TDeploymentArtifact.class, TExtensions.class, TTopologyTemplate.class, TEntityType.class, - TImplementationArtifact.class, TPolicy.class, TRequirementDefinition.class, TEntityTemplate.class, - TDefinitions.class}) -public class TExtensibleElements { - - protected List documentation; - @XmlAnyElement(lax = true) - protected List any; - @XmlAnyAttribute - private final Map otherAttributes = new HashMap<>(); - - - /** - * Gets the value of the documentation property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the documentation property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getDocumentation().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TDocumentation } - * - * - */ - public List getDocumentation() { - if (this.documentation == null) { - this.documentation = new ArrayList<>(); - } - return this.documentation; - } - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getAny().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

    - * the map is keyed by the name of the attribute and the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute by updating the map - * directly. Because of this design, there's no setter. - * - * - * @return always non-null - */ - public Map getOtherAttributes() { - return this.otherAttributes; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtension.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtension.java deleted file mode 100644 index bd09f64ee..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtension.java +++ /dev/null @@ -1,96 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tExtension complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExtension">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="namespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="mustUnderstand" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="yes" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExtension") -public class TExtension extends TExtensibleElements { - - @XmlAttribute(name = "namespace", required = true) - @XmlSchemaType(name = "anyURI") - protected String namespace; - @XmlAttribute(name = "mustUnderstand") - protected TBoolean mustUnderstand; - - - /** - * Gets the value of the namespace property. - * - * @return possible object is {@link String } - * - */ - public String getNamespace() { - return this.namespace; - } - - /** - * Sets the value of the namespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setNamespace(final String value) { - this.namespace = value; - } - - /** - * Gets the value of the mustUnderstand property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getMustUnderstand() { - if (this.mustUnderstand == null) { - return TBoolean.YES; - } else { - return this.mustUnderstand; - } - } - - /** - * Sets the value of the mustUnderstand property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setMustUnderstand(final TBoolean value) { - this.mustUnderstand = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtensions.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtensions.java deleted file mode 100644 index d53c7dc89..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TExtensions.java +++ /dev/null @@ -1,80 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tExtensions complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExtensions">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    - *       </sequence>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExtensions", propOrder = {"extension"}) -public class TExtensions extends TExtensibleElements { - - @XmlElement(name = "Extension", required = true) - protected List extension; - - - /** - * Gets the value of the extension property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the extension property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getExtension().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TExtension } - * - * - */ - public List getExtension() { - if (this.extension == null) { - this.extension = new ArrayList<>(); - } - return this.extension; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImplementationArtifact.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImplementationArtifact.java deleted file mode 100644 index 2b178fc76..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImplementationArtifact.java +++ /dev/null @@ -1,246 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -import org.opentosca.container.core.tosca.StaticTOSCANamespaces; - -/** - *

    - * Java class for tImplementationArtifact complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tImplementationArtifact">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="interfaceName" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="operationName" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <attribute name="artifactType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="artifactRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tImplementationArtifact") -@XmlSeeAlso({org.opentosca.container.core.tosca.model.TImplementationArtifacts.ImplementationArtifact.class}) -public class TImplementationArtifact extends TExtensibleElements { - - @XmlTransient - protected String name; - @XmlAttribute(name = "interfaceName") - @XmlSchemaType(name = "anyURI") - protected String interfaceName; - @XmlAttribute(name = "operationName") - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String operationName; - @XmlAttribute(name = "artifactType", required = true) - protected QName artifactType; - @XmlAttribute(name = "artifactRef") - protected QName artifactRef; - - - /** - * Ruft den Wert der name-Eigenschaft ab. - * - * @return possible object is {@link String } - * - */ - public String getName() { - if (null == this.name) { - return this.getOtherAttributes().get(new QName(StaticTOSCANamespaces.nsToscaExtension, "name")); - } - - return this.name; - } - - /** - * Legt den Wert der name-Eigenschaft fest. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Legt den Wert der name-Eigenschaft fest. - * - * @param attributeQName this QName has to be in the namespace for extending TOSCA due OpenTOSCA and - * with the local part "name" - * @param the generated name should be unique and follow the rule: ownerName (name of the owning - * NodeTypeImplementation or RelationshipTypeImplementation) + _OpenTOSCA_IA_ + the number of - * the implementation artifact in the list of implementation artifacts of the owning - * *Implementation - * - */ - public void setName(final QName attributeQName, final String generatedName) { - // set the new namespace for extension - - this.getOtherAttributes().put(attributeQName, generatedName); - this.name = generatedName; - } - - /** - * Gets the value of the interfaceName property. - * - * @return possible object is {@link String } - * - */ - public String getInterfaceName() { - return this.interfaceName; - } - - /** - * Sets the value of the interfaceName property. - * - * @param value allowed object is {@link String } - * - */ - public void setInterfaceName(final String value) { - this.interfaceName = value; - } - - /** - * Gets the value of the operationName property. - * - * @return possible object is {@link String } - * - */ - public String getOperationName() { - return this.operationName; - } - - /** - * Sets the value of the operationName property. - * - * @param value allowed object is {@link String } - * - */ - public void setOperationName(final String value) { - this.operationName = value; - } - - /** - * Gets the value of the artifactType property. - * - * @return possible object is {@link QName } - * - */ - public QName getArtifactType() { - return this.artifactType; - } - - /** - * Sets the value of the artifactType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setArtifactType(final QName value) { - this.artifactType = value; - } - - /** - * Gets the value of the artifactRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getArtifactRef() { - return this.artifactRef; - } - - /** - * Sets the value of the artifactRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setArtifactRef(final QName value) { - this.artifactRef = value; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (this.artifactRef == null ? 0 : this.artifactRef.hashCode()); - result = prime * result + (this.artifactType == null ? 0 : this.artifactType.hashCode()); - result = prime * result + (this.interfaceName == null ? 0 : this.interfaceName.hashCode()); - result = prime * result + (this.operationName == null ? 0 : this.operationName.hashCode()); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (!(obj instanceof TImplementationArtifact)) { - return false; - } - final TImplementationArtifact other = (TImplementationArtifact) obj; - if (this.artifactRef == null) { - if (other.artifactRef != null) { - return false; - } - } else if (!this.artifactRef.equals(other.artifactRef)) { - return false; - } - if (this.artifactType == null) { - if (other.artifactType != null) { - return false; - } - } else if (!this.artifactType.equals(other.artifactType)) { - return false; - } - if (this.interfaceName == null) { - if (other.interfaceName != null) { - return false; - } - } else if (!this.interfaceName.equals(other.interfaceName)) { - return false; - } - if (this.operationName == null) { - if (other.operationName != null) { - return false; - } - } else if (!this.operationName.equals(other.operationName)) { - return false; - } - return true; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImplementationArtifacts.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImplementationArtifacts.java deleted file mode 100644 index 6c46c7700..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImplementationArtifacts.java +++ /dev/null @@ -1,114 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tImplementationArtifacts complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tImplementationArtifacts">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="ImplementationArtifact" maxOccurs="unbounded">
    - *           <complexType>
    - *             <complexContent>
    - *               <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifact">
    - *                 <anyAttribute processContents='lax' namespace='##other'/>
    - *               </extension>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tImplementationArtifacts", propOrder = {"implementationArtifact"}) -public class TImplementationArtifacts { - - @XmlElement(name = "ImplementationArtifact", required = true) - protected List implementationArtifact; - - - /** - * Gets the value of the implementationArtifact property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the implementationArtifact property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getImplementationArtifact().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TImplementationArtifacts.ImplementationArtifact } - * - * - */ - public List getImplementationArtifact() { - if (this.implementationArtifact == null) { - this.implementationArtifact = new ArrayList<>(); - } - return this.implementationArtifact; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifact">
    -     *       <anyAttribute processContents='lax' namespace='##other'/>
    -     *     </extension>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class ImplementationArtifact extends TImplementationArtifact { - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImport.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImport.java deleted file mode 100644 index 260257600..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TImport.java +++ /dev/null @@ -1,116 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tImport complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tImport">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="namespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="location" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="importType" use="required" type="{http://docs.oasis-open.org/tosca/ns/2011/12}importedURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tImport") -public class TImport extends TExtensibleElements { - - @XmlAttribute(name = "namespace") - @XmlSchemaType(name = "anyURI") - protected String namespace; - @XmlAttribute(name = "location") - @XmlSchemaType(name = "anyURI") - protected String location; - @XmlAttribute(name = "importType", required = true) - protected String importType; - - - /** - * Gets the value of the namespace property. - * - * @return possible object is {@link String } - * - */ - public String getNamespace() { - return this.namespace; - } - - /** - * Sets the value of the namespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setNamespace(final String value) { - this.namespace = value; - } - - /** - * Gets the value of the location property. - * - * @return possible object is {@link String } - * - */ - public String getLocation() { - return this.location; - } - - /** - * Sets the value of the location property. - * - * @param value allowed object is {@link String } - * - */ - public void setLocation(final String value) { - this.location = value; - } - - /** - * Gets the value of the importType property. - * - * @return possible object is {@link String } - * - */ - public String getImportType() { - return this.importType; - } - - /** - * Sets the value of the importType property. - * - * @param value allowed object is {@link String } - * - */ - public void setImportType(final String value) { - this.importType = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TInterface.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TInterface.java deleted file mode 100644 index 69eea0719..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TInterface.java +++ /dev/null @@ -1,105 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tInterface complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tInterface">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Operation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tOperation" maxOccurs="unbounded"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tInterface", propOrder = {"operation"}) -public class TInterface { - - @XmlElement(name = "Operation", required = true) - protected List operation; - @XmlAttribute(name = "name", required = true) - @XmlSchemaType(name = "anyURI") - protected String name; - - - /** - * Gets the value of the operation property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the operation property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getOperation().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TOperation } - * - * - */ - public List getOperation() { - if (this.operation == null) { - this.operation = new ArrayList<>(); - } - return this.operation; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeTemplate.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeTemplate.java deleted file mode 100644 index 74cc165aa..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeTemplate.java +++ /dev/null @@ -1,442 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tNodeTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tNodeTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <sequence>
    - *         <element name="Requirements" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirement" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Capabilities" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapability" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Policies" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="DeploymentArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifacts" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="minInstances" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    - *       <attribute name="maxInstances" default="1">
    - *         <simpleType>
    - *           <union>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    - *                 <pattern value="([1-9]+[0-9]*)"/>
    - *               </restriction>
    - *             </simpleType>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *                 <enumeration value="unbounded"/>
    - *               </restriction>
    - *             </simpleType>
    - *           </union>
    - *         </simpleType>
    - *       </attribute>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tNodeTemplate", propOrder = {"requirements", "capabilities", "policies", "deploymentArtifacts"}) -public class TNodeTemplate extends TEntityTemplate { - - @XmlElement(name = "Requirements") - protected TNodeTemplate.Requirements requirements; - @XmlElement(name = "Capabilities") - protected TNodeTemplate.Capabilities capabilities; - @XmlElement(name = "Policies") - protected TNodeTemplate.Policies policies; - @XmlElement(name = "DeploymentArtifacts") - protected TDeploymentArtifacts deploymentArtifacts; - @XmlAttribute(name = "name") - protected String name; - @XmlAttribute(name = "minInstances") - protected Integer minInstances; - @XmlAttribute(name = "maxInstances") - protected String maxInstances; - - - /** - * Gets the value of the requirements property. - * - * @return possible object is {@link TNodeTemplate.Requirements } - * - */ - public TNodeTemplate.Requirements getRequirements() { - return this.requirements; - } - - /** - * Sets the value of the requirements property. - * - * @param value allowed object is {@link TNodeTemplate.Requirements } - * - */ - public void setRequirements(final TNodeTemplate.Requirements value) { - this.requirements = value; - } - - /** - * Gets the value of the capabilities property. - * - * @return possible object is {@link TNodeTemplate.Capabilities } - * - */ - public TNodeTemplate.Capabilities getCapabilities() { - return this.capabilities; - } - - /** - * Sets the value of the capabilities property. - * - * @param value allowed object is {@link TNodeTemplate.Capabilities } - * - */ - public void setCapabilities(final TNodeTemplate.Capabilities value) { - this.capabilities = value; - } - - /** - * Gets the value of the policies property. - * - * @return possible object is {@link TNodeTemplate.Policies } - * - */ - public TNodeTemplate.Policies getPolicies() { - return this.policies; - } - - /** - * Sets the value of the policies property. - * - * @param value allowed object is {@link TNodeTemplate.Policies } - * - */ - public void setPolicies(final TNodeTemplate.Policies value) { - this.policies = value; - } - - /** - * Gets the value of the deploymentArtifacts property. - * - * @return possible object is {@link TDeploymentArtifacts } - * - */ - public TDeploymentArtifacts getDeploymentArtifacts() { - return this.deploymentArtifacts; - } - - /** - * Sets the value of the deploymentArtifacts property. - * - * @param value allowed object is {@link TDeploymentArtifacts } - * - */ - public void setDeploymentArtifacts(final TDeploymentArtifacts value) { - this.deploymentArtifacts = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the minInstances property. - * - * @return possible object is {@link Integer } - * - */ - public int getMinInstances() { - if (this.minInstances == null) { - return 1; - } else { - return this.minInstances; - } - } - - /** - * Sets the value of the minInstances property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setMinInstances(final Integer value) { - this.minInstances = value; - } - - /** - * Gets the value of the maxInstances property. - * - * @return possible object is {@link String } - * - */ - public String getMaxInstances() { - if (this.maxInstances == null) { - return "1"; - } else { - return this.maxInstances; - } - } - - /** - * Sets the value of the maxInstances property. - * - * @param value allowed object is {@link String } - * - */ - public void setMaxInstances(final String value) { - this.maxInstances = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapability" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"capability"}) - public static class Capabilities { - - @XmlElement(name = "Capability", required = true) - protected List capability; - - - /** - * Gets the value of the capability property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the capability property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getCapability().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCapability } - * - * - */ - public List getCapability() { - if (this.capability == null) { - this.capability = new ArrayList<>(); - } - return this.capability; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"policy"}) - public static class Policies { - - @XmlElement(name = "Policy", required = true) - protected List policy; - - - /** - * Gets the value of the policy property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the policy property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getPolicy().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPolicy } - * - * - */ - public List getPolicy() { - if (this.policy == null) { - this.policy = new ArrayList<>(); - } - return this.policy; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirement" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"requirement"}) - public static class Requirements { - - @XmlElement(name = "Requirement", required = true) - protected List requirement; - - - /** - * Gets the value of the requirement property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the requirement property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getRequirement().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRequirement } - * - * - */ - public List getRequirement() { - if (this.requirement == null) { - this.requirement = new ArrayList<>(); - } - return this.requirement; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeType.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeType.java deleted file mode 100644 index 335d5a81e..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeType.java +++ /dev/null @@ -1,350 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tNodeType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tNodeType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <sequence>
    - *         <element name="RequirementDefinitions" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="RequirementDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementDefinition" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="CapabilityDefinitions" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="CapabilityDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityDefinition" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="InstanceStates" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyElementInstanceStates" minOccurs="0"/>
    - *         <element name="Interfaces" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tNodeType", - propOrder = {"requirementDefinitions", "capabilityDefinitions", "instanceStates", "interfaces"}) -public class TNodeType extends TEntityType { - - @XmlElement(name = "RequirementDefinitions") - protected TNodeType.RequirementDefinitions requirementDefinitions; - @XmlElement(name = "CapabilityDefinitions") - protected TNodeType.CapabilityDefinitions capabilityDefinitions; - @XmlElement(name = "InstanceStates") - protected TTopologyElementInstanceStates instanceStates; - @XmlElement(name = "Interfaces") - protected TNodeType.Interfaces interfaces; - - - /** - * Gets the value of the requirementDefinitions property. - * - * @return possible object is {@link TNodeType.RequirementDefinitions } - * - */ - public TNodeType.RequirementDefinitions getRequirementDefinitions() { - return this.requirementDefinitions; - } - - /** - * Sets the value of the requirementDefinitions property. - * - * @param value allowed object is {@link TNodeType.RequirementDefinitions } - * - */ - public void setRequirementDefinitions(final TNodeType.RequirementDefinitions value) { - this.requirementDefinitions = value; - } - - /** - * Gets the value of the capabilityDefinitions property. - * - * @return possible object is {@link TNodeType.CapabilityDefinitions } - * - */ - public TNodeType.CapabilityDefinitions getCapabilityDefinitions() { - return this.capabilityDefinitions; - } - - /** - * Sets the value of the capabilityDefinitions property. - * - * @param value allowed object is {@link TNodeType.CapabilityDefinitions } - * - */ - public void setCapabilityDefinitions(final TNodeType.CapabilityDefinitions value) { - this.capabilityDefinitions = value; - } - - /** - * Gets the value of the instanceStates property. - * - * @return possible object is {@link TTopologyElementInstanceStates } - * - */ - public TTopologyElementInstanceStates getInstanceStates() { - return this.instanceStates; - } - - /** - * Sets the value of the instanceStates property. - * - * @param value allowed object is {@link TTopologyElementInstanceStates } - * - */ - public void setInstanceStates(final TTopologyElementInstanceStates value) { - this.instanceStates = value; - } - - /** - * Gets the value of the interfaces property. - * - * @return possible object is {@link TNodeType.Interfaces } - * - */ - public TNodeType.Interfaces getInterfaces() { - return this.interfaces; - } - - /** - * Sets the value of the interfaces property. - * - * @param value allowed object is {@link TNodeType.Interfaces } - * - */ - public void setInterfaces(final TNodeType.Interfaces value) { - this.interfaces = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="CapabilityDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityDefinition" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"capabilityDefinition"}) - public static class CapabilityDefinitions { - - @XmlElement(name = "CapabilityDefinition", required = true) - protected List capabilityDefinition; - - - /** - * Gets the value of the capabilityDefinition property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the capabilityDefinition property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getCapabilityDefinition().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCapabilityDefinition } - * - * - */ - public List getCapabilityDefinition() { - if (this.capabilityDefinition == null) { - this.capabilityDefinition = new ArrayList<>(); - } - return this.capabilityDefinition; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"_interface"}) - public static class Interfaces { - - @XmlElement(name = "Interface", required = true) - protected List _interface; - - - /** - * Gets the value of the interface property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the interface property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInterface().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TInterface } - * - * - */ - public List getInterface() { - if (this._interface == null) { - this._interface = new ArrayList<>(); - } - return this._interface; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="RequirementDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementDefinition" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"requirementDefinition"}) - public static class RequirementDefinitions { - - @XmlElement(name = "RequirementDefinition", required = true) - protected List requirementDefinition; - - - /** - * Gets the value of the requirementDefinition property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the requirementDefinition property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getRequirementDefinition().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRequirementDefinition } - * - * - */ - public List getRequirementDefinition() { - if (this.requirementDefinition == null) { - this.requirementDefinition = new ArrayList<>(); - } - return this.requirementDefinition; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeTypeImplementation.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeTypeImplementation.java deleted file mode 100644 index 6c6b27575..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TNodeTypeImplementation.java +++ /dev/null @@ -1,351 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tNodeTypeImplementation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tNodeTypeImplementation">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    - *         <element name="DerivedFrom" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="nodeTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="RequiredContainerFeatures" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeatures" minOccurs="0"/>
    - *         <element name="ImplementationArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifacts" minOccurs="0"/>
    - *         <element name="DeploymentArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifacts" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="nodeType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tNodeTypeImplementation", propOrder = {"tags", "derivedFrom", "requiredContainerFeatures", - "implementationArtifacts", "deploymentArtifacts"}) -public class TNodeTypeImplementation extends TExtensibleElements { - - @XmlElement(name = "Tags") - protected TTags tags; - @XmlElement(name = "DerivedFrom") - protected TNodeTypeImplementation.DerivedFrom derivedFrom; - @XmlElement(name = "RequiredContainerFeatures") - protected TRequiredContainerFeatures requiredContainerFeatures; - @XmlElement(name = "ImplementationArtifacts") - protected TImplementationArtifacts implementationArtifacts; - @XmlElement(name = "DeploymentArtifacts") - protected TDeploymentArtifacts deploymentArtifacts; - @XmlAttribute(name = "name", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - @XmlAttribute(name = "targetNamespace") - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - @XmlAttribute(name = "nodeType", required = true) - protected QName nodeType; - @XmlAttribute(name = "abstract") - protected TBoolean _abstract; - @XmlAttribute(name = "final") - protected TBoolean _final; - - - /** - * Gets the value of the tags property. - * - * @return possible object is {@link TTags } - * - */ - public TTags getTags() { - return this.tags; - } - - /** - * Sets the value of the tags property. - * - * @param value allowed object is {@link TTags } - * - */ - public void setTags(final TTags value) { - this.tags = value; - } - - /** - * Gets the value of the derivedFrom property. - * - * @return possible object is {@link TNodeTypeImplementation.DerivedFrom } - * - */ - public TNodeTypeImplementation.DerivedFrom getDerivedFrom() { - return this.derivedFrom; - } - - /** - * Sets the value of the derivedFrom property. - * - * @param value allowed object is {@link TNodeTypeImplementation.DerivedFrom } - * - */ - public void setDerivedFrom(final TNodeTypeImplementation.DerivedFrom value) { - this.derivedFrom = value; - } - - /** - * Gets the value of the requiredContainerFeatures property. - * - * @return possible object is {@link TRequiredContainerFeatures } - * - */ - public TRequiredContainerFeatures getRequiredContainerFeatures() { - return this.requiredContainerFeatures; - } - - /** - * Sets the value of the requiredContainerFeatures property. - * - * @param value allowed object is {@link TRequiredContainerFeatures } - * - */ - public void setRequiredContainerFeatures(final TRequiredContainerFeatures value) { - this.requiredContainerFeatures = value; - } - - /** - * Gets the value of the implementationArtifacts property. - * - * @return possible object is {@link TImplementationArtifacts } - * - */ - public TImplementationArtifacts getImplementationArtifacts() { - return this.implementationArtifacts; - } - - /** - * Sets the value of the implementationArtifacts property. - * - * @param value allowed object is {@link TImplementationArtifacts } - * - */ - public void setImplementationArtifacts(final TImplementationArtifacts value) { - this.implementationArtifacts = value; - } - - /** - * Gets the value of the deploymentArtifacts property. - * - * @return possible object is {@link TDeploymentArtifacts } - * - */ - public TDeploymentArtifacts getDeploymentArtifacts() { - return this.deploymentArtifacts; - } - - /** - * Sets the value of the deploymentArtifacts property. - * - * @param value allowed object is {@link TDeploymentArtifacts } - * - */ - public void setDeploymentArtifacts(final TDeploymentArtifacts value) { - this.deploymentArtifacts = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - /** - * Gets the value of the nodeType property. - * - * @return possible object is {@link QName } - * - */ - public QName getNodeType() { - return this.nodeType; - } - - /** - * Sets the value of the nodeType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setNodeType(final QName value) { - this.nodeType = value; - } - - /** - * Gets the value of the abstract property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getAbstract() { - if (this._abstract == null) { - return TBoolean.NO; - } else { - return this._abstract; - } - } - - /** - * Sets the value of the abstract property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setAbstract(final TBoolean value) { - this._abstract = value; - } - - /** - * Gets the value of the final property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getFinal() { - if (this._final == null) { - return TBoolean.NO; - } else { - return this._final; - } - } - - /** - * Sets the value of the final property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setFinal(final TBoolean value) { - this._final = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="nodeTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class DerivedFrom { - - @XmlAttribute(name = "nodeTypeImplementationRef", required = true) - protected QName nodeTypeImplementationRef; - - - /** - * Gets the value of the nodeTypeImplementationRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getNodeTypeImplementationRef() { - return this.nodeTypeImplementationRef; - } - - /** - * Sets the value of the nodeTypeImplementationRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setNodeTypeImplementationRef(final QName value) { - this.nodeTypeImplementationRef = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TOperation.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TOperation.java deleted file mode 100644 index c8d45744c..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TOperation.java +++ /dev/null @@ -1,263 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -/** - *

    - * Java class for tOperation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tOperation">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="InputParameters" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="OutputParameters" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tOperation", propOrder = {"inputParameters", "outputParameters"}) -public class TOperation extends TExtensibleElements { - - @XmlElement(name = "InputParameters") - protected TOperation.InputParameters inputParameters; - @XmlElement(name = "OutputParameters") - protected TOperation.OutputParameters outputParameters; - @XmlAttribute(name = "name", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - - - /** - * Gets the value of the inputParameters property. - * - * @return possible object is {@link TOperation.InputParameters } - * - */ - public TOperation.InputParameters getInputParameters() { - return this.inputParameters; - } - - /** - * Sets the value of the inputParameters property. - * - * @param value allowed object is {@link TOperation.InputParameters } - * - */ - public void setInputParameters(final TOperation.InputParameters value) { - this.inputParameters = value; - } - - /** - * Gets the value of the outputParameters property. - * - * @return possible object is {@link TOperation.OutputParameters } - * - */ - public TOperation.OutputParameters getOutputParameters() { - return this.outputParameters; - } - - /** - * Sets the value of the outputParameters property. - * - * @param value allowed object is {@link TOperation.OutputParameters } - * - */ - public void setOutputParameters(final TOperation.OutputParameters value) { - this.outputParameters = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"inputParameter"}) - public static class InputParameters { - - @XmlElement(name = "InputParameter", required = true) - protected List inputParameter; - - - /** - * Gets the value of the inputParameter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the inputParameter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInputParameter().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * - */ - public List getInputParameter() { - if (this.inputParameter == null) { - this.inputParameter = new ArrayList<>(); - } - return this.inputParameter; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"outputParameter"}) - public static class OutputParameters { - - @XmlElement(name = "OutputParameter", required = true) - protected List outputParameter; - - - /** - * Gets the value of the outputParameter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the outputParameter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getOutputParameter().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * - */ - public List getOutputParameter() { - if (this.outputParameter == null) { - this.outputParameter = new ArrayList<>(); - } - return this.outputParameter; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TParameter.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TParameter.java deleted file mode 100644 index d082d0176..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TParameter.java +++ /dev/null @@ -1,116 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tParameter complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tParameter">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="required" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="yes" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tParameter") -public class TParameter extends TExtensibleElements { - - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "type", required = true) - protected String type; - @XmlAttribute(name = "required") - protected TBoolean required; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link String } - * - */ - public String getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link String } - * - */ - public void setType(final String value) { - this.type = value; - } - - /** - * Gets the value of the required property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getRequired() { - if (this.required == null) { - return TBoolean.YES; - } else { - return this.required; - } - } - - /** - * Sets the value of the required property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setRequired(final TBoolean value) { - this.required = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPlan.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPlan.java deleted file mode 100644 index 428e9b284..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPlan.java +++ /dev/null @@ -1,553 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.w3c.dom.Element; - -/** - *

    - * Java class for tPlan complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPlan">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Precondition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCondition" minOccurs="0"/>
    - *         <element name="InputParameters" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="OutputParameters" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <choice>
    - *           <element name="PlanModel">
    - *             <complexType>
    - *               <complexContent>
    - *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                   <sequence>
    - *                     <any processContents='lax' namespace='##other'/>
    - *                   </sequence>
    - *                 </restriction>
    - *               </complexContent>
    - *             </complexType>
    - *           </element>
    - *           <element name="PlanModelReference">
    - *             <complexType>
    - *               <complexContent>
    - *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                   <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *                 </restriction>
    - *               </complexContent>
    - *             </complexType>
    - *           </element>
    - *         </choice>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="planType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="planLanguage" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPlan", - propOrder = {"precondition", "inputParameters", "outputParameters", "planModel", "planModelReference"}) -public class TPlan extends TExtensibleElements { - - @XmlElement(name = "Precondition") - protected TCondition precondition; - @XmlElement(name = "InputParameters") - protected TPlan.InputParameters inputParameters; - @XmlElement(name = "OutputParameters") - protected TPlan.OutputParameters outputParameters; - @XmlElement(name = "PlanModel") - protected TPlan.PlanModel planModel; - @XmlElement(name = "PlanModelReference") - protected TPlan.PlanModelReference planModelReference; - @XmlAttribute(name = "id", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute(name = "name") - protected String name; - @XmlAttribute(name = "planType", required = true) - @XmlSchemaType(name = "anyURI") - protected String planType; - @XmlAttribute(name = "planLanguage", required = true) - @XmlSchemaType(name = "anyURI") - protected String planLanguage; - - @XmlAttribute(name = "calculatedWCET") - @XmlSchemaType(name = "anyURI") - protected long calculatedWCET; - - @XmlAttribute(name = "timeAvailable") - @XmlSchemaType(name = "anyURI") - protected long timeAvailable; - - /** - * Gets the value of the precondition property. - * - * @return possible object is {@link TCondition } - * - */ - public TCondition getPrecondition() { - return this.precondition; - } - - /** - * Sets the value of the precondition property. - * - * @param value allowed object is {@link TCondition } - * - */ - public void setPrecondition(final TCondition value) { - this.precondition = value; - } - - /** - * Gets the value of the inputParameters property. - * - * @return possible object is {@link TPlan.InputParameters } - * - */ - public TPlan.InputParameters getInputParameters() { - return this.inputParameters; - } - - /** - * Sets the value of the inputParameters property. - * - * @param value allowed object is {@link TPlan.InputParameters } - * - */ - public void setInputParameters(final TPlan.InputParameters value) { - this.inputParameters = value; - } - - /** - * Gets the value of the outputParameters property. - * - * @return possible object is {@link TPlan.OutputParameters } - * - */ - public TPlan.OutputParameters getOutputParameters() { - return this.outputParameters; - } - - /** - * Sets the value of the outputParameters property. - * - * @param value allowed object is {@link TPlan.OutputParameters } - * - */ - public void setOutputParameters(final TPlan.OutputParameters value) { - this.outputParameters = value; - } - - /** - * Gets the value of the planModel property. - * - * @return possible object is {@link TPlan.PlanModel } - * - */ - public TPlan.PlanModel getPlanModel() { - return this.planModel; - } - - /** - * Sets the value of the planModel property. - * - * @param value allowed object is {@link TPlan.PlanModel } - * - */ - public void setPlanModel(final TPlan.PlanModel value) { - this.planModel = value; - } - - /** - * Gets the value of the planModelReference property. - * - * @return possible object is {@link TPlan.PlanModelReference } - * - */ - public TPlan.PlanModelReference getPlanModelReference() { - return this.planModelReference; - } - - /** - * Sets the value of the planModelReference property. - * - * @param value allowed object is {@link TPlan.PlanModelReference } - * - */ - public void setPlanModelReference(final TPlan.PlanModelReference value) { - this.planModelReference = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the planType property. - * - * @return possible object is {@link String } - * - */ - public String getPlanType() { - return this.planType; - } - - /** - * Sets the value of the planType property. - * - * @param value allowed object is {@link String } - * - */ - public void setPlanType(final String value) { - this.planType = value; - } - - /** - * Gets the value of the planLanguage property. - * - * @return possible object is {@link String } - * - */ - public String getPlanLanguage() { - return this.planLanguage; - } - - /** - * Sets the value of the planLanguage property. - * - * @param value allowed object is {@link String } - * - */ - public void setPlanLanguage(final String value) { - this.planLanguage = value; - } - - public long getCalculatedWCET() { - return this.calculatedWCET; - } - - public void setCalculatedWCET(final long calulatedWCET) { - this.calculatedWCET = calulatedWCET; - } - - public long getTimeAvailable() { - return this.timeAvailable; - } - - public void setTimeAvailable(final long timeAvailable) { - this.timeAvailable = timeAvailable; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"inputParameter"}) - public static class InputParameters { - - @XmlElement(name = "InputParameter", required = true) - protected List inputParameter; - - - /** - * Gets the value of the inputParameter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the inputParameter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInputParameter().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * - */ - public List getInputParameter() { - if (this.inputParameter == null) { - this.inputParameter = new ArrayList<>(); - } - return this.inputParameter; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"outputParameter"}) - public static class OutputParameters { - - @XmlElement(name = "OutputParameter", required = true) - protected List outputParameter; - - - /** - * Gets the value of the outputParameter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the outputParameter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getOutputParameter().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * - */ - public List getOutputParameter() { - if (this.outputParameter == null) { - this.outputParameter = new ArrayList<>(); - } - return this.outputParameter; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <any processContents='lax' namespace='##other'/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class PlanModel { - - @XmlAnyElement(lax = true) - protected Object any; - - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } {@link Element } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } {@link Element } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class PlanModelReference { - - @XmlAttribute(name = "reference", required = true) - @XmlSchemaType(name = "anyURI") - protected String reference; - - - /** - * Gets the value of the reference property. - * - * @return possible object is {@link String } - * - */ - public String getReference() { - return this.reference; - } - - /** - * Sets the value of the reference property. - * - * @param value allowed object is {@link String } - * - */ - public void setReference(final String value) { - this.reference = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPlans.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPlans.java deleted file mode 100644 index b5077e8d1..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPlans.java +++ /dev/null @@ -1,105 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tPlans complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPlans">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Plan" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPlan" maxOccurs="unbounded"/>
    - *       </sequence>
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPlans", propOrder = {"plan"}) -public class TPlans { - - @XmlElement(name = "Plan", required = true) - protected List plan; - @XmlAttribute(name = "targetNamespace") - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - - - /** - * Gets the value of the plan property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the plan property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getPlan().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPlan } - * - * - */ - public List getPlan() { - if (this.plan == null) { - this.plan = new ArrayList<>(); - } - return this.plan; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicy.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicy.java deleted file mode 100644 index f9fe489df..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicy.java +++ /dev/null @@ -1,116 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tPolicy complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPolicy">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="policyType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="policyRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPolicy") -@XmlRootElement -public class TPolicy extends TExtensibleElements { - - @XmlAttribute(name = "name") - protected String name; - @XmlAttribute(name = "policyType", required = true) - protected QName policyType; - @XmlAttribute(name = "policyRef") - protected QName policyRef; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the policyType property. - * - * @return possible object is {@link QName } - * - */ - public QName getPolicyType() { - return this.policyType; - } - - /** - * Sets the value of the policyType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setPolicyType(final QName value) { - this.policyType = value; - } - - /** - * Gets the value of the policyRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getPolicyRef() { - return this.policyRef; - } - - /** - * Sets the value of the policyRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setPolicyRef(final QName value) { - this.policyRef = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicyTemplate.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicyTemplate.java deleted file mode 100644 index 10636d95e..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicyTemplate.java +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tPolicyTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPolicyTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPolicyTemplate") -public class TPolicyTemplate extends TEntityTemplate { - - @XmlAttribute(name = "name") - protected String name; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicyType.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicyType.java deleted file mode 100644 index 946133fd1..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPolicyType.java +++ /dev/null @@ -1,95 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tPolicyType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPolicyType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <sequence>
    - *         <element name="AppliesTo" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tAppliesTo" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="policyLanguage" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPolicyType", propOrder = {"appliesTo"}) -public class TPolicyType extends TEntityType { - - @XmlElement(name = "AppliesTo") - protected TAppliesTo appliesTo; - @XmlAttribute(name = "policyLanguage") - @XmlSchemaType(name = "anyURI") - protected String policyLanguage; - - - /** - * Gets the value of the appliesTo property. - * - * @return possible object is {@link TAppliesTo } - * - */ - public TAppliesTo getAppliesTo() { - return this.appliesTo; - } - - /** - * Sets the value of the appliesTo property. - * - * @param value allowed object is {@link TAppliesTo } - * - */ - public void setAppliesTo(final TAppliesTo value) { - this.appliesTo = value; - } - - /** - * Gets the value of the policyLanguage property. - * - * @return possible object is {@link String } - * - */ - public String getPolicyLanguage() { - return this.policyLanguage; - } - - /** - * Sets the value of the policyLanguage property. - * - * @param value allowed object is {@link String } - * - */ - public void setPolicyLanguage(final String value) { - this.policyLanguage = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPropertyConstraint.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPropertyConstraint.java deleted file mode 100644 index d1d0f4fe4..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPropertyConstraint.java +++ /dev/null @@ -1,66 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tPropertyConstraint complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPropertyConstraint">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint">
    - *       <attribute name="property" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPropertyConstraint") -public class TPropertyConstraint extends TConstraint { - - @XmlAttribute(name = "property", required = true) - protected String property; - - - /** - * Gets the value of the property property. - * - * @return possible object is {@link String } - * - */ - public String getProperty() { - return this.property; - } - - /** - * Sets the value of the property property. - * - * @param value allowed object is {@link String } - * - */ - public void setProperty(final String value) { - this.property = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPropertyMapping.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPropertyMapping.java deleted file mode 100644 index f6f077342..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TPropertyMapping.java +++ /dev/null @@ -1,116 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tPropertyMapping complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPropertyMapping">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="serviceTemplatePropertyRef" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="targetObjectRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *       <attribute name="targetPropertyRef" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPropertyMapping") -public class TPropertyMapping { - - @XmlAttribute(name = "serviceTemplatePropertyRef", required = true) - protected String serviceTemplatePropertyRef; - @XmlAttribute(name = "targetObjectRef", required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object targetObjectRef; - @XmlAttribute(name = "targetPropertyRef", required = true) - protected String targetPropertyRef; - - - /** - * Gets the value of the serviceTemplatePropertyRef property. - * - * @return possible object is {@link String } - * - */ - public String getServiceTemplatePropertyRef() { - return this.serviceTemplatePropertyRef; - } - - /** - * Sets the value of the serviceTemplatePropertyRef property. - * - * @param value allowed object is {@link String } - * - */ - public void setServiceTemplatePropertyRef(final String value) { - this.serviceTemplatePropertyRef = value; - } - - /** - * Gets the value of the targetObjectRef property. - * - * @return possible object is {@link Object } - * - */ - public Object getTargetObjectRef() { - return this.targetObjectRef; - } - - /** - * Sets the value of the targetObjectRef property. - * - * @param value allowed object is {@link Object } - * - */ - public void setTargetObjectRef(final Object value) { - this.targetObjectRef = value; - } - - /** - * Gets the value of the targetPropertyRef property. - * - * @return possible object is {@link String } - * - */ - public String getTargetPropertyRef() { - return this.targetPropertyRef; - } - - /** - * Sets the value of the targetPropertyRef property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetPropertyRef(final String value) { - this.targetPropertyRef = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipTemplate.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipTemplate.java deleted file mode 100644 index 0f88ff365..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipTemplate.java +++ /dev/null @@ -1,434 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - -/** - *

    - * Java class for tRelationshipTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRelationshipTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <sequence>
    - *         <element name="SourceElement">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="TargetElement">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="RelationshipConstraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="RelationshipConstraint" maxOccurs="unbounded">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <any processContents='lax' namespace='##other' minOccurs="0"/>
    - *                           </sequence>
    - *                           <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRelationshipTemplate", propOrder = {"sourceElement", "targetElement", "relationshipConstraints"}) -public class TRelationshipTemplate extends TEntityTemplate { - - @XmlElement(name = "SourceElement", required = true) - protected TRelationshipTemplate.SourceElement sourceElement; - @XmlElement(name = "TargetElement", required = true) - protected TRelationshipTemplate.TargetElement targetElement; - @XmlElement(name = "RelationshipConstraints") - protected TRelationshipTemplate.RelationshipConstraints relationshipConstraints; - @XmlAttribute(name = "name") - protected String name; - - - /** - * Gets the value of the sourceElement property. - * - * @return possible object is {@link TRelationshipTemplate.SourceElement } - * - */ - public TRelationshipTemplate.SourceElement getSourceElement() { - return this.sourceElement; - } - - /** - * Sets the value of the sourceElement property. - * - * @param value allowed object is {@link TRelationshipTemplate.SourceElement } - * - */ - public void setSourceElement(final TRelationshipTemplate.SourceElement value) { - this.sourceElement = value; - } - - /** - * Gets the value of the targetElement property. - * - * @return possible object is {@link TRelationshipTemplate.TargetElement } - * - */ - public TRelationshipTemplate.TargetElement getTargetElement() { - return this.targetElement; - } - - /** - * Sets the value of the targetElement property. - * - * @param value allowed object is {@link TRelationshipTemplate.TargetElement } - * - */ - public void setTargetElement(final TRelationshipTemplate.TargetElement value) { - this.targetElement = value; - } - - /** - * Gets the value of the relationshipConstraints property. - * - * @return possible object is {@link TRelationshipTemplate.RelationshipConstraints } - * - */ - public TRelationshipTemplate.RelationshipConstraints getRelationshipConstraints() { - return this.relationshipConstraints; - } - - /** - * Sets the value of the relationshipConstraints property. - * - * @param value allowed object is {@link TRelationshipTemplate.RelationshipConstraints } - * - */ - public void setRelationshipConstraints(final TRelationshipTemplate.RelationshipConstraints value) { - this.relationshipConstraints = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="RelationshipConstraint" maxOccurs="unbounded">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <any processContents='lax' namespace='##other' minOccurs="0"/>
    -     *                 </sequence>
    -     *                 <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"relationshipConstraint"}) - public static class RelationshipConstraints { - - @XmlElement(name = "RelationshipConstraint", required = true) - protected List relationshipConstraint; - - - /** - * Gets the value of the relationshipConstraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the relationshipConstraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getRelationshipConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint } - * - * - */ - public List getRelationshipConstraint() { - if (this.relationshipConstraint == null) { - this.relationshipConstraint = new ArrayList<>(); - } - return this.relationshipConstraint; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <any processContents='lax' namespace='##other' minOccurs="0"/>
    -         *       </sequence>
    -         *       <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class RelationshipConstraint { - - @XmlAnyElement(lax = true) - protected Object any; - @XmlAttribute(name = "constraintType", required = true) - @XmlSchemaType(name = "anyURI") - protected String constraintType; - - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } {@link Element } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } {@link Element } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - /** - * Gets the value of the constraintType property. - * - * @return possible object is {@link String } - * - */ - public String getConstraintType() { - return this.constraintType; - } - - /** - * Sets the value of the constraintType property. - * - * @param value allowed object is {@link String } - * - */ - public void setConstraintType(final String value) { - this.constraintType = value; - } - - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class SourceElement { - - @XmlAttribute(name = "ref", required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object ref; - - - /** - * Gets the value of the ref property. - * - * @return possible object is {@link Object } - * - */ - public Object getRef() { - return this.ref; - } - - /** - * Sets the value of the ref property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRef(final Object value) { - this.ref = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class TargetElement { - - @XmlAttribute(name = "ref", required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object ref; - - - /** - * Gets the value of the ref property. - * - * @return possible object is {@link Object } - * - */ - public Object getRef() { - return this.ref; - } - - /** - * Sets the value of the ref property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRef(final Object value) { - this.ref = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipType.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipType.java deleted file mode 100644 index 8557435ad..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipType.java +++ /dev/null @@ -1,420 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tRelationshipType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRelationshipType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <sequence>
    - *         <element name="InstanceStates" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyElementInstanceStates" minOccurs="0"/>
    - *         <element name="SourceInterfaces" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="TargetInterfaces" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="ValidSource" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="ValidTarget" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRelationshipType", - propOrder = {"instanceStates", "sourceInterfaces", "targetInterfaces", "validSource", "validTarget"}) -public class TRelationshipType extends TEntityType { - - @XmlElement(name = "InstanceStates") - protected TTopologyElementInstanceStates instanceStates; - @XmlElement(name = "SourceInterfaces") - protected TRelationshipType.SourceInterfaces sourceInterfaces; - @XmlElement(name = "TargetInterfaces") - protected TRelationshipType.TargetInterfaces targetInterfaces; - @XmlElement(name = "ValidSource") - protected TRelationshipType.ValidSource validSource; - @XmlElement(name = "ValidTarget") - protected TRelationshipType.ValidTarget validTarget; - - - /** - * Gets the value of the instanceStates property. - * - * @return possible object is {@link TTopologyElementInstanceStates } - * - */ - public TTopologyElementInstanceStates getInstanceStates() { - return this.instanceStates; - } - - /** - * Sets the value of the instanceStates property. - * - * @param value allowed object is {@link TTopologyElementInstanceStates } - * - */ - public void setInstanceStates(final TTopologyElementInstanceStates value) { - this.instanceStates = value; - } - - /** - * Gets the value of the sourceInterfaces property. - * - * @return possible object is {@link TRelationshipType.SourceInterfaces } - * - */ - public TRelationshipType.SourceInterfaces getSourceInterfaces() { - return this.sourceInterfaces; - } - - /** - * Sets the value of the sourceInterfaces property. - * - * @param value allowed object is {@link TRelationshipType.SourceInterfaces } - * - */ - public void setSourceInterfaces(final TRelationshipType.SourceInterfaces value) { - this.sourceInterfaces = value; - } - - /** - * Gets the value of the targetInterfaces property. - * - * @return possible object is {@link TRelationshipType.TargetInterfaces } - * - */ - public TRelationshipType.TargetInterfaces getTargetInterfaces() { - return this.targetInterfaces; - } - - /** - * Sets the value of the targetInterfaces property. - * - * @param value allowed object is {@link TRelationshipType.TargetInterfaces } - * - */ - public void setTargetInterfaces(final TRelationshipType.TargetInterfaces value) { - this.targetInterfaces = value; - } - - /** - * Gets the value of the validSource property. - * - * @return possible object is {@link TRelationshipType.ValidSource } - * - */ - public TRelationshipType.ValidSource getValidSource() { - return this.validSource; - } - - /** - * Sets the value of the validSource property. - * - * @param value allowed object is {@link TRelationshipType.ValidSource } - * - */ - public void setValidSource(final TRelationshipType.ValidSource value) { - this.validSource = value; - } - - /** - * Gets the value of the validTarget property. - * - * @return possible object is {@link TRelationshipType.ValidTarget } - * - */ - public TRelationshipType.ValidTarget getValidTarget() { - return this.validTarget; - } - - /** - * Sets the value of the validTarget property. - * - * @param value allowed object is {@link TRelationshipType.ValidTarget } - * - */ - public void setValidTarget(final TRelationshipType.ValidTarget value) { - this.validTarget = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"_interface"}) - public static class SourceInterfaces { - - @XmlElement(name = "Interface", required = true) - protected List _interface; - - - /** - * Gets the value of the interface property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the interface property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInterface().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TInterface } - * - * - */ - public List getInterface() { - if (this._interface == null) { - this._interface = new ArrayList<>(); - } - return this._interface; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"_interface"}) - public static class TargetInterfaces { - - @XmlElement(name = "Interface", required = true) - protected List _interface; - - - /** - * Gets the value of the interface property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the interface property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInterface().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TInterface } - * - * - */ - public List getInterface() { - if (this._interface == null) { - this._interface = new ArrayList<>(); - } - return this._interface; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class ValidSource { - - @XmlAttribute(name = "typeRef", required = true) - protected QName typeRef; - - - /** - * Gets the value of the typeRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getTypeRef() { - return this.typeRef; - } - - /** - * Sets the value of the typeRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setTypeRef(final QName value) { - this.typeRef = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class ValidTarget { - - @XmlAttribute(name = "typeRef", required = true) - protected QName typeRef; - - - /** - * Gets the value of the typeRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getTypeRef() { - return this.typeRef; - } - - /** - * Sets the value of the typeRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setTypeRef(final QName value) { - this.typeRef = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipTypeImplementation.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipTypeImplementation.java deleted file mode 100644 index 2c01f1e13..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRelationshipTypeImplementation.java +++ /dev/null @@ -1,328 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tRelationshipTypeImplementation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRelationshipTypeImplementation">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    - *         <element name="DerivedFrom" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="relationshipTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="RequiredContainerFeatures" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeatures" minOccurs="0"/>
    - *         <element name="ImplementationArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifacts" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="relationshipType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRelationshipTypeImplementation", - propOrder = {"tags", "derivedFrom", "requiredContainerFeatures", "implementationArtifacts"}) -public class TRelationshipTypeImplementation extends TExtensibleElements { - - @XmlElement(name = "Tags") - protected TTags tags; - @XmlElement(name = "DerivedFrom") - protected TRelationshipTypeImplementation.DerivedFrom derivedFrom; - @XmlElement(name = "RequiredContainerFeatures") - protected TRequiredContainerFeatures requiredContainerFeatures; - @XmlElement(name = "ImplementationArtifacts") - protected TImplementationArtifacts implementationArtifacts; - @XmlAttribute(name = "name", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - @XmlAttribute(name = "targetNamespace") - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - @XmlAttribute(name = "relationshipType", required = true) - protected QName relationshipType; - @XmlAttribute(name = "abstract") - protected TBoolean _abstract; - @XmlAttribute(name = "final") - protected TBoolean _final; - - - /** - * Gets the value of the tags property. - * - * @return possible object is {@link TTags } - * - */ - public TTags getTags() { - return this.tags; - } - - /** - * Sets the value of the tags property. - * - * @param value allowed object is {@link TTags } - * - */ - public void setTags(final TTags value) { - this.tags = value; - } - - /** - * Gets the value of the derivedFrom property. - * - * @return possible object is {@link TRelationshipTypeImplementation.DerivedFrom } - * - */ - public TRelationshipTypeImplementation.DerivedFrom getDerivedFrom() { - return this.derivedFrom; - } - - /** - * Sets the value of the derivedFrom property. - * - * @param value allowed object is {@link TRelationshipTypeImplementation.DerivedFrom } - * - */ - public void setDerivedFrom(final TRelationshipTypeImplementation.DerivedFrom value) { - this.derivedFrom = value; - } - - /** - * Gets the value of the requiredContainerFeatures property. - * - * @return possible object is {@link TRequiredContainerFeatures } - * - */ - public TRequiredContainerFeatures getRequiredContainerFeatures() { - return this.requiredContainerFeatures; - } - - /** - * Sets the value of the requiredContainerFeatures property. - * - * @param value allowed object is {@link TRequiredContainerFeatures } - * - */ - public void setRequiredContainerFeatures(final TRequiredContainerFeatures value) { - this.requiredContainerFeatures = value; - } - - /** - * Gets the value of the implementationArtifacts property. - * - * @return possible object is {@link TImplementationArtifacts } - * - */ - public TImplementationArtifacts getImplementationArtifacts() { - return this.implementationArtifacts; - } - - /** - * Sets the value of the implementationArtifacts property. - * - * @param value allowed object is {@link TImplementationArtifacts } - * - */ - public void setImplementationArtifacts(final TImplementationArtifacts value) { - this.implementationArtifacts = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - /** - * Gets the value of the relationshipType property. - * - * @return possible object is {@link QName } - * - */ - public QName getRelationshipType() { - return this.relationshipType; - } - - /** - * Sets the value of the relationshipType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setRelationshipType(final QName value) { - this.relationshipType = value; - } - - /** - * Gets the value of the abstract property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getAbstract() { - if (this._abstract == null) { - return TBoolean.NO; - } else { - return this._abstract; - } - } - - /** - * Sets the value of the abstract property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setAbstract(final TBoolean value) { - this._abstract = value; - } - - /** - * Gets the value of the final property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getFinal() { - if (this._final == null) { - return TBoolean.NO; - } else { - return this._final; - } - } - - /** - * Sets the value of the final property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setFinal(final TBoolean value) { - this._final = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="relationshipTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class DerivedFrom { - - @XmlAttribute(name = "relationshipTypeImplementationRef", required = true) - protected QName relationshipTypeImplementationRef; - - - /** - * Gets the value of the relationshipTypeImplementationRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getRelationshipTypeImplementationRef() { - return this.relationshipTypeImplementationRef; - } - - /** - * Sets the value of the relationshipTypeImplementationRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setRelationshipTypeImplementationRef(final QName value) { - this.relationshipTypeImplementationRef = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequiredContainerFeature.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequiredContainerFeature.java deleted file mode 100644 index 75ffbeb72..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequiredContainerFeature.java +++ /dev/null @@ -1,68 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tRequiredContainerFeature complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequiredContainerFeature">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="feature" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequiredContainerFeature") -public class TRequiredContainerFeature { - - @XmlAttribute(name = "feature", required = true) - @XmlSchemaType(name = "anyURI") - protected String feature; - - - /** - * Gets the value of the feature property. - * - * @return possible object is {@link String } - * - */ - public String getFeature() { - return this.feature; - } - - /** - * Sets the value of the feature property. - * - * @param value allowed object is {@link String } - * - */ - public void setFeature(final String value) { - this.feature = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequiredContainerFeatures.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequiredContainerFeatures.java deleted file mode 100644 index 412458a03..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequiredContainerFeatures.java +++ /dev/null @@ -1,79 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tRequiredContainerFeatures complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequiredContainerFeatures">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="RequiredContainerFeature" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeature" maxOccurs="unbounded"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequiredContainerFeatures", propOrder = {"requiredContainerFeature"}) -public class TRequiredContainerFeatures { - - @XmlElement(name = "RequiredContainerFeature", required = true) - protected List requiredContainerFeature; - - - /** - * Gets the value of the requiredContainerFeature property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the requiredContainerFeature property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getRequiredContainerFeature().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRequiredContainerFeature } - * - * - */ - public List getRequiredContainerFeature() { - if (this.requiredContainerFeature == null) { - this.requiredContainerFeature = new ArrayList<>(); - } - return this.requiredContainerFeature; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirement.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirement.java deleted file mode 100644 index 8db10cd55..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirement.java +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tRequirement complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequirement">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequirement") -public class TRequirement extends TEntityTemplate { - - @XmlAttribute(name = "name", required = true) - protected String name; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementDefinition.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementDefinition.java deleted file mode 100644 index e00966e55..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementDefinition.java +++ /dev/null @@ -1,259 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tRequirementDefinition complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequirementDefinition">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Constraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="requirementType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="lowerBound" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    - *       <attribute name="upperBound" default="1">
    - *         <simpleType>
    - *           <union>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    - *                 <pattern value="([1-9]+[0-9]*)"/>
    - *               </restriction>
    - *             </simpleType>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *                 <enumeration value="unbounded"/>
    - *               </restriction>
    - *             </simpleType>
    - *           </union>
    - *         </simpleType>
    - *       </attribute>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequirementDefinition", propOrder = {"constraints"}) -public class TRequirementDefinition extends TExtensibleElements { - - @XmlElement(name = "Constraints") - protected TRequirementDefinition.Constraints constraints; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "requirementType", required = true) - protected QName requirementType; - @XmlAttribute(name = "lowerBound") - protected Integer lowerBound; - @XmlAttribute(name = "upperBound") - protected String upperBound; - - - /** - * Gets the value of the constraints property. - * - * @return possible object is {@link TRequirementDefinition.Constraints } - * - */ - public TRequirementDefinition.Constraints getConstraints() { - return this.constraints; - } - - /** - * Sets the value of the constraints property. - * - * @param value allowed object is {@link TRequirementDefinition.Constraints } - * - */ - public void setConstraints(final TRequirementDefinition.Constraints value) { - this.constraints = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the requirementType property. - * - * @return possible object is {@link QName } - * - */ - public QName getRequirementType() { - return this.requirementType; - } - - /** - * Sets the value of the requirementType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setRequirementType(final QName value) { - this.requirementType = value; - } - - /** - * Gets the value of the lowerBound property. - * - * @return possible object is {@link Integer } - * - */ - public int getLowerBound() { - if (this.lowerBound == null) { - return 1; - } else { - return this.lowerBound; - } - } - - /** - * Sets the value of the lowerBound property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setLowerBound(final Integer value) { - this.lowerBound = value; - } - - /** - * Gets the value of the upperBound property. - * - * @return possible object is {@link String } - * - */ - public String getUpperBound() { - if (this.upperBound == null) { - return "1"; - } else { - return this.upperBound; - } - } - - /** - * Sets the value of the upperBound property. - * - * @param value allowed object is {@link String } - * - */ - public void setUpperBound(final String value) { - this.upperBound = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"constraint"}) - public static class Constraints { - - @XmlElement(name = "Constraint", required = true) - protected List constraint; - - - /** - * Gets the value of the constraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the constraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TConstraint } - * - * - */ - public List getConstraint() { - if (this.constraint == null) { - this.constraint = new ArrayList<>(); - } - return this.constraint; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementRef.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementRef.java deleted file mode 100644 index e1d171232..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementRef.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tRequirementRef complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequirementRef">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequirementRef") -public class TRequirementRef { - - @XmlAttribute(name = "name") - protected String name; - @XmlAttribute(name = "ref", required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object ref; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the ref property. - * - * @return possible object is {@link Object } - * - */ - public Object getRef() { - return this.ref; - } - - /** - * Sets the value of the ref property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRef(final Object value) { - this.ref = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementType.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementType.java deleted file mode 100644 index 91c7c0cb9..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TRequirementType.java +++ /dev/null @@ -1,68 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tRequirementType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequirementType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <attribute name="requiredCapabilityType" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequirementType") -public class TRequirementType extends TEntityType { - - @XmlAttribute(name = "requiredCapabilityType") - protected QName requiredCapabilityType; - - - /** - * Gets the value of the requiredCapabilityType property. - * - * @return possible object is {@link QName } - * - */ - public QName getRequiredCapabilityType() { - return this.requiredCapabilityType; - } - - /** - * Sets the value of the requiredCapabilityType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setRequiredCapabilityType(final QName value) { - this.requiredCapabilityType = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TServiceTemplate.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TServiceTemplate.java deleted file mode 100644 index bec7a5878..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TServiceTemplate.java +++ /dev/null @@ -1,240 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -/** - *

    - * Java class for tServiceTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tServiceTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    - *         <element name="BoundaryDefinitions" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoundaryDefinitions" minOccurs="0"/>
    - *         <element name="TopologyTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyTemplate"/>
    - *         <element name="Plans" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPlans" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="substitutableNodeType" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tServiceTemplate", propOrder = {"tags", "boundaryDefinitions", "topologyTemplate", "plans"}) -public class TServiceTemplate extends TExtensibleElements { - - @XmlElement(name = "Tags") - protected TTags tags; - @XmlElement(name = "BoundaryDefinitions") - protected TBoundaryDefinitions boundaryDefinitions; - @XmlElement(name = "TopologyTemplate", required = true) - protected TTopologyTemplate topologyTemplate; - @XmlElement(name = "Plans") - protected TPlans plans; - @XmlAttribute(name = "id", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute(name = "name") - protected String name; - @XmlAttribute(name = "targetNamespace") - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - @XmlAttribute(name = "substitutableNodeType") - protected QName substitutableNodeType; - - - /** - * Gets the value of the tags property. - * - * @return possible object is {@link TTags } - * - */ - public TTags getTags() { - return this.tags; - } - - /** - * Sets the value of the tags property. - * - * @param value allowed object is {@link TTags } - * - */ - public void setTags(final TTags value) { - this.tags = value; - } - - /** - * Gets the value of the boundaryDefinitions property. - * - * @return possible object is {@link TBoundaryDefinitions } - * - */ - public TBoundaryDefinitions getBoundaryDefinitions() { - return this.boundaryDefinitions; - } - - /** - * Sets the value of the boundaryDefinitions property. - * - * @param value allowed object is {@link TBoundaryDefinitions } - * - */ - public void setBoundaryDefinitions(final TBoundaryDefinitions value) { - this.boundaryDefinitions = value; - } - - /** - * Gets the value of the topologyTemplate property. - * - * @return possible object is {@link TTopologyTemplate } - * - */ - public TTopologyTemplate getTopologyTemplate() { - return this.topologyTemplate; - } - - /** - * Sets the value of the topologyTemplate property. - * - * @param value allowed object is {@link TTopologyTemplate } - * - */ - public void setTopologyTemplate(final TTopologyTemplate value) { - this.topologyTemplate = value; - } - - /** - * Gets the value of the plans property. - * - * @return possible object is {@link TPlans } - * - */ - public TPlans getPlans() { - return this.plans; - } - - /** - * Sets the value of the plans property. - * - * @param value allowed object is {@link TPlans } - * - */ - public void setPlans(final TPlans value) { - this.plans = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - /** - * Gets the value of the substitutableNodeType property. - * - * @return possible object is {@link QName } - * - */ - public QName getSubstitutableNodeType() { - return this.substitutableNodeType; - } - - /** - * Sets the value of the substitutableNodeType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setSubstitutableNodeType(final QName value) { - this.substitutableNodeType = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTag.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTag.java deleted file mode 100644 index 5bac8a004..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTag.java +++ /dev/null @@ -1,89 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tTag complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tTag">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tTag") -public class TTag { - - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "value", required = true) - protected String value; - - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return this.value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(final String value) { - this.value = value; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTags.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTags.java deleted file mode 100644 index 705c44d20..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTags.java +++ /dev/null @@ -1,79 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tTags complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tTags">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Tag" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTag" maxOccurs="unbounded"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tTags", propOrder = {"tag"}) -public class TTags { - - @XmlElement(name = "Tag", required = true) - protected List tag; - - - /** - * Gets the value of the tag property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the tag property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getTag().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TTag } - * - * - */ - public List getTag() { - if (this.tag == null) { - this.tag = new ArrayList<>(); - } - return this.tag; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTopologyElementInstanceStates.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTopologyElementInstanceStates.java deleted file mode 100644 index c778a83c8..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTopologyElementInstanceStates.java +++ /dev/null @@ -1,141 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tTopologyElementInstanceStates complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tTopologyElementInstanceStates">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="InstanceState" maxOccurs="unbounded">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="state" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tTopologyElementInstanceStates", propOrder = {"instanceState"}) -public class TTopologyElementInstanceStates { - - @XmlElement(name = "InstanceState", required = true) - protected List instanceState; - - - /** - * Gets the value of the instanceState property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the instanceState property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getInstanceState().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TTopologyElementInstanceStates.InstanceState } - * - * - */ - public List getInstanceState() { - if (this.instanceState == null) { - this.instanceState = new ArrayList<>(); - } - return this.instanceState; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="state" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class InstanceState { - - @XmlAttribute(name = "state", required = true) - @XmlSchemaType(name = "anyURI") - protected String state; - - - /** - * Gets the value of the state property. - * - * @return possible object is {@link String } - * - */ - public String getState() { - return this.state; - } - - /** - * Sets the value of the state property. - * - * @param value allowed object is {@link String } - * - */ - public void setState(final String value) { - this.state = value; - } - - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTopologyTemplate.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTopologyTemplate.java deleted file mode 100644 index d4c2a1a72..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/TTopologyTemplate.java +++ /dev/null @@ -1,84 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -package org.opentosca.container.core.tosca.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tTopologyTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tTopologyTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <choice maxOccurs="unbounded">
    - *         <element name="NodeTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeTemplate"/>
    - *         <element name="RelationshipTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipTemplate"/>
    - *       </choice>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tTopologyTemplate", propOrder = {"nodeTemplateOrRelationshipTemplate"}) -public class TTopologyTemplate extends TExtensibleElements { - - @XmlElements({@XmlElement(name = "NodeTemplate", type = TNodeTemplate.class), - @XmlElement(name = "RelationshipTemplate", type = TRelationshipTemplate.class)}) - protected List nodeTemplateOrRelationshipTemplate; - - - /** - * Gets the value of the nodeTemplateOrRelationshipTemplate property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the nodeTemplateOrRelationshipTemplate property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getNodeTemplateOrRelationshipTemplate().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TNodeTemplate } - * {@link TRelationshipTemplate } - * - * - */ - public List getNodeTemplateOrRelationshipTemplate() { - if (this.nodeTemplateOrRelationshipTemplate == null) { - this.nodeTemplateOrRelationshipTemplate = new ArrayList<>(); - } - return this.nodeTemplateOrRelationshipTemplate; - } - -} diff --git a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/package-info.java b/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/package-info.java deleted file mode 100644 index 751d2b17c..000000000 --- a/org.opentosca.container.core.tosca/src/org/opentosca/container/core/tosca/model/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.4-2 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.07.10 at 12:45:26 PM CEST -// -// TOSCA version: TOSCA-v1.0-cs02.xsd -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://docs.oasis-open.org/tosca/ns/2011/12", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.opentosca.container.core.tosca.model; - diff --git a/org.opentosca.container.core/META-INF/MANIFEST.MF b/org.opentosca.container.core/META-INF/MANIFEST.MF deleted file mode 100644 index bab09caaa..000000000 --- a/org.opentosca.container.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,75 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container Core -Bundle-SymbolicName: org.opentosca.container.core -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.container.core.Activator -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.fasterxml.jackson.annotation;version="2.6.2", - com.fasterxml.jackson.core;version="2.4.5", - com.google.common.base;version="15.0.0", - com.google.common.collect;version="[15.0.0,16.0.0)", - com.google.gson;version="2.2.4", - com.google.inject;version="1.3.0", - com.springsource.util.parser.manifest;version="2.0.0.RELEASE", - org.apache.commons.lang3;version="3.1.0", - org.apache.http;version="4.3.3", - org.apache.http.client;version="4.3.6", - org.apache.http.cookie;version="4.3.6", - org.eclipse.persistence.annotations;version="2.6.3", - org.eclipse.persistence.mappings;version="2.6.3", - org.eclipse.persistence.mappings.converters;version="2.6.3", - org.eclipse.persistence.sessions;version="2.6.3", - org.glassfish.jersey.uri;version="2.22.2", - org.jclouds;version="1.7.3", - org.jclouds.apis;version="1.7.3", - org.jclouds.blobstore;version="1.7.3", - org.jclouds.blobstore.domain;version="1.7.3", - org.jclouds.domain;version="1.7.3", - org.jclouds.io;version="1.7.3", - org.jclouds.logging.slf4j.config;version="1.7.3", - org.jclouds.osgi;version="1.7.3", - org.jclouds.providers;version="1.7.3", - org.jclouds.rest;version="1.7.3", - org.osgi.framework;version="1.8.0", - org.osgi.service.event;version="1.3.1", - org.slf4j;version="1.7.2" -Require-Bundle: javax.persistence;bundle-version="2.1.1", - org.eclipse.persistence.core;bundle-version="2.6.3", - org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.h2;bundle-version="1.3.168" -Export-Package: org.opentosca.container.core, - org.opentosca.container.core.common, - org.opentosca.container.core.common.jpa, - org.opentosca.container.core.engine, - org.opentosca.container.core.engine.impl, - org.opentosca.container.core.engine.impl.consolidation, - org.opentosca.container.core.engine.impl.resolver, - org.opentosca.container.core.engine.impl.resolver.data, - org.opentosca.container.core.engine.xml, - org.opentosca.container.core.engine.xml.impl, - org.opentosca.container.core.mapping, - org.opentosca.container.core.model, - org.opentosca.container.core.model.capability.provider, - org.opentosca.container.core.model.credentials, - org.opentosca.container.core.model.csar, - org.opentosca.container.core.model.csar.id, - org.opentosca.container.core.model.csar.toscametafile, - org.opentosca.container.core.model.deployment, - org.opentosca.container.core.model.deployment.ia, - org.opentosca.container.core.model.deployment.plan, - org.opentosca.container.core.model.deployment.process, - org.opentosca.container.core.model.endpoint, - org.opentosca.container.core.model.endpoint.rest, - org.opentosca.container.core.model.endpoint.wsdl, - org.opentosca.container.core.model.instance, - org.opentosca.container.core.next.jpa, - org.opentosca.container.core.next.model, - org.opentosca.container.core.next.trigger, - org.opentosca.container.core.next.repository, - org.opentosca.container.core.next.utils, - org.opentosca.container.core.next.xml, - org.opentosca.container.core.service, - org.opentosca.container.core.service.internal -Meta-Persistence: META-INF/persistence.xml diff --git a/org.opentosca.container.core/META-INF/persistence.xml b/org.opentosca.container.core/META-INF/persistence.xml deleted file mode 100644 index 8f6034d42..000000000 --- a/org.opentosca.container.core/META-INF/persistence.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - org.eclipse.persistence.jpa.PersistenceProvider - - org.opentosca.container.core.next.model.PersistenceObject - org.opentosca.container.core.next.model.Property - org.opentosca.container.core.next.model.ServiceTemplateInstance - org.opentosca.container.core.next.model.ServiceTemplateInstanceProperty - org.opentosca.container.core.next.model.NodeTemplateInstance - org.opentosca.container.core.next.model.NodeTemplateInstanceProperty - org.opentosca.container.core.next.model.RelationshipTemplateInstance - org.opentosca.container.core.next.model.RelationshipTemplateInstanceProperty - org.opentosca.container.core.next.model.PlanInstance - org.opentosca.container.core.next.model.PlanInstanceEvent - org.opentosca.container.core.next.model.PlanInstanceOutput - org.opentosca.container.core.next.model.PlanInstanceInput - - org.opentosca.container.core.next.model.DeploymentTest - org.opentosca.container.core.next.model.DeploymentTestResult - - org.opentosca.container.core.next.model.Situation - org.opentosca.container.core.next.model.SituationTrigger - org.opentosca.container.core.next.model.SituationTriggerProperty - org.opentosca.container.core.next.model.SituationTriggerInstance - org.opentosca.container.core.next.model.SituationTriggerInstanceProperty - org.opentosca.container.core.next.model.SituationsMonitor - - org.opentosca.container.core.model.credentials.Credentials - org.opentosca.container.core.model.csar.CSARContent - org.opentosca.container.core.model.deployment.ia.IADeploymentInfo - org.opentosca.container.core.model.deployment.plan.PlanDeploymentInfo - org.opentosca.container.core.model.deployment.process.DeploymentProcessInfo - org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint - org.opentosca.container.core.model.endpoint.rest.RESTEndpoint - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.container.core/build.properties b/org.opentosca.container.core/build.properties deleted file mode 100644 index 0cd800d81..000000000 --- a/org.opentosca.container.core/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - ., diff --git a/org.opentosca.container.core/pom.xml b/org.opentosca.container.core/pom.xml index 77f5f4349..b52f16678 100644 --- a/org.opentosca.container.core/pom.xml +++ b/org.opentosca.container.core/pom.xml @@ -1,6 +1,6 @@ + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 @@ -10,6 +10,69 @@ org.opentosca.container.core - eclipse-plugin + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + com.github.opentosca.winery + org.eclipse.winery.model.tosca + + + com.github.opentosca.winery + org.eclipse.winery.accountability + + + com.github.opentosca.winery + org.eclipse.winery.repository + + + com.google.guava + guava + + + + + org.hibernate + hibernate-core + 5.4.1.Final + + + javax.persistence + javax.persistence-api + 2.2 + + + + com.google.code.gson + gson + 2.8.0 + + + + org.springframework + spring-context + ${spring.version} + + + org.springframework + spring-web + ${spring.version} + compile + + + + org.glassfish.jersey.core + jersey-common + ${jersey.version} + + + org.apache.httpcomponents + httpclient + 4.5.4 + + diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/EntityExistsException.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/EntityExistsException.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/common/EntityExistsException.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/EntityExistsException.java diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/NotFoundException.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/NotFoundException.java new file mode 100644 index 000000000..c1f1b6fdc --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/NotFoundException.java @@ -0,0 +1,10 @@ +package org.opentosca.container.core.common; + +public class NotFoundException extends UserException { + + private static final long serialVersionUID = -115094386403129666L; + + public NotFoundException(String message) { + super(message); + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/ReferenceNotFoundException.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/ReferenceNotFoundException.java similarity index 95% rename from org.opentosca.container.core/src/org/opentosca/container/core/common/ReferenceNotFoundException.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/ReferenceNotFoundException.java index 6d358a076..d6b780b09 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/ReferenceNotFoundException.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/ReferenceNotFoundException.java @@ -4,9 +4,7 @@ * Exception which can be thrown if a reference was not found * * @author Marcus Eisele - marcus.eisele@gmail.com - * */ -@SuppressWarnings("serial") public class ReferenceNotFoundException extends Exception { /** diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/Settings.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/Settings.java new file mode 100644 index 000000000..f16a6a0bf --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/Settings.java @@ -0,0 +1,102 @@ +package org.opentosca.container.core.common; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Properties; + +import org.slf4j.LoggerFactory; + +/** + * Global OpenTOSCA Settings. + */ +public class Settings { + + // TODO: Use public static final variables instead, as in StaticTOSCANamespaces. + // The problems with the current approach is: + // (i) Full-text search to find usage instead of Java Reference Search. + // (ii) It is possible to references non-existing settings, which is not possible with static variables which are checked on compile time. + + private static Properties settings = new Properties(); + + static { + // Initialize settings with defaults we know + try { + settings.load(Settings.class.getClassLoader().getResourceAsStream("application.properties")); + } catch (IOException e) { + LoggerFactory.getLogger(Settings.class).error("Could not load defaults shipped with the application", e); + } + } + + public final static String OPENTOSCA_CONTAINER_HOSTNAME = settings.getProperty("org.opentosca.container.hostname", "localhost"); + public final static String OPENTOSCA_CONTAINER_PORT = settings.getProperty("org.opentosca.container.port", "1337"); + + @Deprecated + public final static String CONTAINER_API_LEGACY = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_CONTAINER_PORT + "/containerapi"; + public final static String CONTAINER_API = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_CONTAINER_PORT; + public final static String CONTAINER_INSTANCEDATA_LEGACY_API = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_CONTAINER_PORT + "/containerapi/CSARs/{csarid}/ServiceTemplates/{servicetemplateid}/Instances/"; + public final static String CONTAINER_INSTANCEDATA_API = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_CONTAINER_PORT + "/csars/{csarid}/servicetemplates/{servicetemplateid}/instances"; + public final static String OPENTOSCA_CONTAINER_CONTENT_API = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_CONTAINER_PORT + "/csars/{csarid}/content/{artifactreference}"; + + public final static String ENGINE_PLAN_BPMN_ENGINE = settings.getProperty("org.opentosca.container.engine.plan.plugin.bpmn.engine", "Camunda"); + public final static String ENGINE_PLAN_BPMN_URL = settings.getProperty("org.opentosca.container.engine.plan.plugin.bpmn.url", "http://localhost:808/engine-rest"); + public final static String ENGINE_PLAN_BPMN_USERNAME = settings.getProperty("org.opentosca.container.engine.plan.plugin.bpmn.username", "admin"); + public final static String ENGINE_PLAN_BPMN_PASSWORD = settings.getProperty("org.opentosca.container.engine.plan.plugin.bpmn.password", "admin"); + + public final static String ENGINE_IA_TOMCAT_URL = settings.getProperty("org.opentosca.container.engine.ia.plugin.tomcat.url", "http://localhost:8090"); + public final static String ENGINE_IA_TOMCAT_USERNAME = settings.getProperty("org.opentosca.container.engine.ia.plugin.tomcat.username", "admin"); + public final static String ENGINE_IA_TOMCAT_PASSWORD = settings.getProperty("org.opentosca.container.engine.ia.plugin.tomcat.password", "admin"); + public final static String OPENTOSCA_ENGINE_IA_KEEPFILES = settings.getProperty("org.opentosca.engine.ia.keepfiles", "false"); + + public final static String PERSISTENCE_UNIT_NAME = "OpenTOSCA"; + + public final static String OPENTOSCA_DEPLOYMENT_TESTS = settings.getProperty("org.opentosca.deployment.checks", "false"); + public final static String OPENTOSCA_BUS_MANAGEMENT_MOCK = settings.getProperty("org.opentosca.bus.management.mocking", "false"); + public final static Path CONTAINER_STORAGE_BASEPATH = Paths.get(System.getProperty("java.io.tmpdir"), "opentosca", "container", "csar-storage"); + + /** + * OpenTOSCA Container database location + */ + public static final Path DBDIR = Paths.get(System.getProperty("java.io.tmpdir"), "opentosca", "db"); + + public final static String OPENTOSCA_COLLABORATION_MODE = settings.getProperty("org.opentosca.container.collaboration.mode", "false"); + public final static String OPENTOSCA_COLLABORATION_HOSTNAMES = settings.getProperty("org.opentosca.container.collaboration.hostnames"); + public final static String OPENTOSCA_COLLABORATION_PORTS = settings.getProperty("org.opentosca.container.collaboration.ports"); + + public final static String OPENTOSCA_BROKER_MQTT_PORT = settings.getProperty("org.opentosca.container.broker.mqtt.port", "1883"); + public final static String OPENTOSCA_BROKER_MQTT_USERNAME = settings.getProperty("org.opentosca.container.broker.mqtt.username", "admin"); + public final static String OPENTOSCA_BROKER_MQTT_PASSWORD = settings.getProperty("org.opentosca.container.broker.mqtt.password", "admin"); + // Container Capabilities + public final static String containerCapabilities = "http://opentosca/planportabilityapi/rest, http://opentosca/containerapi"; + public static final String TOSCA_META_FILE_REL_PATH = "TOSCA-Metadata" + File.separator + "TOSCA.meta"; + + /** + * @param setting - name of the setting + * @return the value of setting with name setting + */ + public static String getSetting(final String setting) { + return settings.getProperty(setting); + } + + /** + * Retrieves a setting value, or a supplied default value if the setting is unknown + * + * @param setting Name of the setting + * @param defaultValue A default value to use if the setting has not been set. + * @return The value of the setting with name setting or the default value if the setting was unknown. + */ + public static String getSetting(final String setting, final String defaultValue) { + return settings.getProperty(setting, defaultValue); + } + + /** + * Stores a setting. + * + * @param setting - name of the setting + * @param value - value of the setting + */ + public static void setSetting(final String setting, final String value) { + settings.setProperty(setting, value); + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/SystemException.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/SystemException.java similarity index 99% rename from org.opentosca.container.core/src/org/opentosca/container/core/common/SystemException.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/SystemException.java index 776a14ef5..5b1024a3b 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/SystemException.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/SystemException.java @@ -8,7 +8,6 @@ public class SystemException extends Exception { private static final long serialVersionUID = 8660020602966311086L; - public SystemException() { super(); } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/UserException.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/UserException.java similarity index 99% rename from org.opentosca.container.core/src/org/opentosca/container/core/common/UserException.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/UserException.java index d4cce4445..8621c2451 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/UserException.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/UserException.java @@ -8,7 +8,6 @@ public class UserException extends Exception { private static final long serialVersionUID = 3247334536178572202L; - public UserException() { super(); } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/file/ResourceAccess.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/file/ResourceAccess.java new file mode 100644 index 000000000..a8b0e2ba2 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/file/ResourceAccess.java @@ -0,0 +1,61 @@ +package org.opentosca.container.core.common.file; + +import java.io.IOException; +import java.net.URI; +import java.net.URL; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +public class ResourceAccess { + + private static final Set knownJarfiles = new HashSet<>(); + + private final Path path; + + /** + * Allows accessing resources retrieved from the classpath through a classloader as {@link Path Paths} with all the + * benefits that entails. Note that {@link Path} instances returned from {@link #resolvedPath()} are not necessarily + * compatible to the old {@link java.io.File} API. + * + * @param resource The URL of a resource returned by the classloader. + * @throws IOException If a filesystem needed to be constructed for proper access to the resource and + * construction or retrieval of a cached instance failed. + * @throws IllegalArgumentException If the URL could not be converted to a URI + */ + public ResourceAccess(URL resource) throws IOException, IllegalArgumentException { + if (resource.getProtocol().startsWith("jar")) { + // split resolved jar-URL into jarfile and entry path + String[] parts = resource.toString().split("!"); + assert (parts.length == 2); + + final URI jarURI = URI.create(parts[0]); + // abusing add returning false if the element already exists + FileSystem resourceFileSystem = knownJarfiles.add(jarURI) + ? FileSystems.newFileSystem(jarURI, Collections.emptyMap()) + : FileSystems.getFileSystem(jarURI); + + path = resourceFileSystem.getPath(parts[1]); + } else { + path = Paths.get(URI.create(resource.toString())); + } + } + + public Path resolvedPath() { + return path; + } + + public static Path resolveUrl(URL resource) throws IOException, IllegalArgumentException { + return new ResourceAccess(resource).resolvedPath(); + } + + public static String readResourceAsString(URL resource) throws IOException, IllegalArgumentException { + final Path resolved = resolveUrl(resource); + return new String(Files.readAllBytes(resolved)); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/CsarIdConverter.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/CsarIdConverter.java new file mode 100644 index 000000000..ec3759abe --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/CsarIdConverter.java @@ -0,0 +1,23 @@ +package org.opentosca.container.core.common.jpa; + +import javax.persistence.AttributeConverter; +import javax.persistence.Converter; + +import org.opentosca.container.core.model.csar.CsarId; + +@Converter +public class CsarIdConverter implements AttributeConverter { + + public static final String name = "CsarIdConverter"; + private static final long serialVersionUID = -2552365749611257786L; + + @Override + public String convertToDatabaseColumn(CsarId csarId) { + return csarId == null ? null : csarId.csarName(); + } + + @Override + public CsarId convertToEntityAttribute(String s) { + return s == null ? null : new CsarId(s); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/DocumentConverter.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/DocumentConverter.java new file mode 100644 index 000000000..5d6fc443f --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/DocumentConverter.java @@ -0,0 +1,111 @@ +package org.opentosca.container.core.common.jpa; + +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; + +import javax.persistence.AttributeConverter; +import javax.persistence.Converter; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +@Converter +public class DocumentConverter implements AttributeConverter { + + private static final long serialVersionUID = -1227963218864722385L; + + /** + * Converts a given String to a XML document + * + * @return Document - converted xml Document + */ + private static Document getDocument(final String documentString) { + if (documentString.isEmpty()) { + return emptyDocument(); + } + // start conversion + final InputSource iSource = new InputSource(new StringReader(documentString)); + Document doc = null; + try { + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setIgnoringComments(true); + final DocumentBuilder db = dbf.newDocumentBuilder(); + + // parse + doc = db.parse(iSource); + doc.getDocumentElement().normalize(); + } catch (final ParserConfigurationException | SAXException | IOException e) { + e.printStackTrace(); + } + return doc; + } + + /** + * returns an empty document + * + * @return empty document + */ + public static Document emptyDocument() { + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + + try { + final DocumentBuilder db = dbf.newDocumentBuilder(); + final Document doc = db.newDocument(); + return doc; + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + return null; + } + + /** + * Converts a given node to a String + * + * @return String - String representation of the given Node + */ + private static String getString(final Node node) { + String result = null; + if (node != null) { + try { + // prepare + final Source source = new DOMSource(node); + final StringWriter stringWriter = new StringWriter(); + final Result streamResult = new StreamResult(stringWriter); + final TransformerFactory factory = TransformerFactory.newInstance(); + final Transformer transformer = factory.newTransformer(); + // serialize + transformer.transform(source, streamResult); + result = stringWriter.getBuffer().toString(); + } catch (final TransformerFactoryConfigurationError | TransformerException e) { + e.printStackTrace(); + } + } + return result; + } + + @Override + public String convertToDatabaseColumn(Document document) { + return document == null ? null : getString(document); + } + + @Override + public Document convertToEntityAttribute(String s) { + return s == null ? null : getDocument(s); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/PathConverter.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/PathConverter.java new file mode 100644 index 000000000..9c556f5a0 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/PathConverter.java @@ -0,0 +1,28 @@ +package org.opentosca.container.core.common.jpa; + +import java.nio.file.Path; +import java.nio.file.Paths; + +import javax.persistence.AttributeConverter; + +/** + * This class is used to convert {@link Path} to String, and {@link String} back to {@link Path} when persisting {@link + * Path} fields with JPA. The conversion needs to be done, as we cannot directly query for {@link Path} in JPQL. + */ +@javax.persistence.Converter +public class PathConverter implements AttributeConverter { + + public static final String name = "PathConverter"; + + private static final long serialVersionUID = 3747978557147488965L; + + @Override + public String convertToDatabaseColumn(Path path) { + return path == null ? null : path.toString(); + } + + @Override + public Path convertToEntityAttribute(String s) { + return s == null ? null : Paths.get(s); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/QNameConverter.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/QNameConverter.java new file mode 100644 index 000000000..761e59d00 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/QNameConverter.java @@ -0,0 +1,27 @@ +package org.opentosca.container.core.common.jpa; + +import javax.persistence.AttributeConverter; +import javax.persistence.Converter; +import javax.xml.namespace.QName; + +/** + * This class is used to convert QNames to String, and Strings back to QNames when persisting QName fields with JPA. The + * conversion needs to be done, as we cannot directly query for QNames in JPQL. + */ +@Converter +public class QNameConverter implements AttributeConverter { + + public static final String name = "QNameConverter"; + + private static final long serialVersionUID = 5695923859083900495L; + + @Override + public String convertToDatabaseColumn(QName qName) { + return qName == null ? null : qName.toString(); + } + + @Override + public QName convertToEntityAttribute(String s) { + return s == null ? null : QName.valueOf(s); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/UriConverter.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/UriConverter.java new file mode 100644 index 000000000..7474110a0 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/jpa/UriConverter.java @@ -0,0 +1,32 @@ +package org.opentosca.container.core.common.jpa; + +import java.net.URI; +import java.net.URISyntaxException; + +import javax.persistence.AttributeConverter; +import javax.persistence.Converter; + +/** + * This class is used to convert URIs to String, and Strings back to URIs when persisting URI fields with JPA. The + * conversion needs to be done, as we cannot directly query for URI in JPQL. + */ +@Converter +public class UriConverter implements AttributeConverter { + + public static final String name = "URIConverter"; + private static final long serialVersionUID = 5695923859083900495L; + + @Override + public String convertToDatabaseColumn(URI uri) { + return uri == null ? null : uri.toString(); + } + + @Override + public URI convertToEntityAttribute(String s) { + try { + return s == null ? null : new URI(s); + } catch (URISyntaxException e) { + return null; + } + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/uri/UriUtil.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/uri/UriUtil.java new file mode 100644 index 000000000..786f1435f --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/uri/UriUtil.java @@ -0,0 +1,82 @@ +package org.opentosca.container.core.common.uri; + +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.util.List; + +import javax.ws.rs.core.Link; +import javax.ws.rs.core.PathSegment; +import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.core.UriInfo; +import javax.ws.rs.ext.RuntimeDelegate; + +import org.glassfish.jersey.uri.UriComponent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class UriUtil { + + private static Logger logger = LoggerFactory.getLogger(UriUtil.class); + + public static URI encode(final URI uri) { + final List pathSegments = UriComponent.decodePath(uri, false); + final UriBuilder uriBuilder = RuntimeDelegate.getInstance().createUriBuilder(); + // Build base URL + uriBuilder.scheme(uri.getScheme()).host(uri.getHost()).port(uri.getPort()); + // Iterate over path segments and encode it if necessary + for (final PathSegment ps : pathSegments) { + uriBuilder.path(UriComponent.encode(ps.toString(), UriComponent.Type.PATH_SEGMENT)); + } + logger.debug("URL before encoding: {}", uri.toString()); + URI result = uriBuilder.build(); + logger.debug("URL after encoding: {}", result.toString()); + return result; + } + + public static String encodePathSegment(final String pathSegment) { + try { + return URLEncoder.encode(pathSegment, "UTF-8"); + } catch (final UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + public static String decodePathSegment(final String pathSegment) { + try { + return URLDecoder.decode(pathSegment, "UTF-8"); + } catch (final UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + public static Link generateSelfLink(final UriInfo uriInfo) { + return Link.fromUri(uriInfo.getAbsolutePath()).rel("self").build(); + } + + public static Link generateSubResourceLink(final UriInfo uriInfo, final String subResource, + final boolean encodeSubResourcePathSegment, final String rel) { + final URI finalUri = UriUtil.generateSubResourceURI(uriInfo, subResource, encodeSubResourcePathSegment); + + return Link.fromUri(finalUri).rel(rel).build(); + } + + public static URI generateSubResourceURI(final UriInfo uriInfo, final String subResource, + final boolean encodeSubResourcePathSegment) { + logger.debug("Generating sub resource URI for sub resource: {} with encoding flag: {}", subResource, encodeSubResourcePathSegment); + final UriBuilder uriBuilder = RuntimeDelegate.getInstance().createUriBuilder(); + uriBuilder.path(uriInfo.getAbsolutePath().toString()); + uriBuilder.path("{resourceId}"); + URI finalUri; + + if (encodeSubResourcePathSegment) { + finalUri = uriBuilder.build(subResource); + } else { + finalUri = uriBuilder.buildFromEncoded(subResource); + } + logger.debug("Final URI: {}", finalUri); + + return finalUri; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/xml/XMLHelper.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/xml/XMLHelper.java new file mode 100644 index 000000000..8a3e20a7c --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/common/xml/XMLHelper.java @@ -0,0 +1,86 @@ +package org.opentosca.container.core.common.xml; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collection; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +public final class XMLHelper { + + public static Document fromPath(Path path) throws IOException { + return fromInputStream(Files.newInputStream(path)); + } + + public static Document fromInputStream(InputStream input) throws IOException { + if (input == null) { + return null; + } + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder; + try { + builder = dbf.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + // YA we dun fucked up... + // LOGGER.error(e); + return null; + } + Document result = null; + try { + result = builder.parse(input); + } catch (SAXException e) { + // wrapping SAXException into IOException to allow enforcing handling + throw new IOException(e); + } + return result; + } + + public static Document fromRootNode(Node node) { + if (node == null) { + return null; + } + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder; + try { + builder = dbf.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + // YA we dun fucked up... + // LOGGER.error(e); + return null; + } + Document result = builder.newDocument(); + Node imported = result.importNode(node, true); + result.appendChild(imported); + return result; + } + + public static Document withRootNode(Collection any, String string) { + if (any == null) { + return null; + } + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder; + try { + builder = dbf.newDocumentBuilder(); + } catch (ParserConfigurationException e) { + // YA we dun fucked up... + // LOGGER.error(e); + return null; + } + Document result = builder.newDocument(); + Node root = result.createElement(string); + any.forEach(root::appendChild); + Node imported = result.importNode(root, true); + result.appendChild(imported); + return result; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/NodeTemplateInstanceCounts.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/NodeTemplateInstanceCounts.java similarity index 81% rename from org.opentosca.container.core/src/org/opentosca/container/core/engine/NodeTemplateInstanceCounts.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/NodeTemplateInstanceCounts.java index 86043e465..ebf92f580 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/NodeTemplateInstanceCounts.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/NodeTemplateInstanceCounts.java @@ -5,16 +5,13 @@ import javax.xml.namespace.QName; /** - * This class holds data for a NodeTemplate and it's min and maxOccurence This information is stored - * in a Hashmap. There the QName of the NodeTemplate is mapped to the Occurences of this - * NodeTemplate specified in the NodeTemplate + * This class holds data for a NodeTemplate and it's min and maxOccurence This information is stored in a Hashmap. There + * the QName of the NodeTemplate is mapped to the Occurences of this NodeTemplate specified in the NodeTemplate */ public class NodeTemplateInstanceCounts { /** - * @author Marcus Eisele - marcus.eisele@gmail.com This class encapsulates the minInstances and - * maxInstances value - * + * @author Marcus Eisele - marcus.eisele@gmail.com This class encapsulates the minInstances and maxInstances value */ public class InstanceCount { @@ -23,7 +20,6 @@ public class InstanceCount { public final int UNBOUNDED = -1; - public InstanceCount(final int minInstances, final String maxInstances) { this.min = minInstances; // need to construct the integer from this string @@ -35,25 +31,21 @@ public InstanceCount(final int minInstances, final String maxInstances) { } this.max = maxValue; } - } - private final HashMap nodeTemplateToOccurencesMap = new HashMap<>(); - public HashMap getOccurenceInformationMap() { return this.nodeTemplateToOccurencesMap; } /** - * Add an additional entry for the given QName to the Hashmap (all previous entries for QNAME will - * be overwritten + * Add an additional entry for the given QName to the Hashmap (all previous entries for QNAME will be + * overwritten * - * @param qnameOfNodeTemplate * @param minInstances - number of minimalInstances of this specific NodeTemplate - * @param maxInstances - number of maximalInstances of this specific NodeTemplate. unbounded is - * modelled as -1 + * @param maxInstances - number of maximalInstances of this specific NodeTemplate. unbounded is modelled as + * -1 */ public void addInstanceCount(final QName qnameOfNodeTemplate, final int minInstances, final String maxInstances) { @@ -66,5 +58,4 @@ public void addInstanceCount(final QName qnameOfNodeTemplate, final int minInsta this.nodeTemplateToOccurencesMap.put(qnameOfNodeTemplate, iCount); } - } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/ResolvedArtifacts.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/ResolvedArtifacts.java similarity index 83% rename from org.opentosca.container.core/src/org/opentosca/container/core/engine/ResolvedArtifacts.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/ResolvedArtifacts.java index e8c31d75d..ef462d7df 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/ResolvedArtifacts.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/ResolvedArtifacts.java @@ -1,6 +1,7 @@ package org.opentosca.container.core.engine; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import javax.xml.namespace.QName; @@ -8,15 +9,16 @@ import org.w3c.dom.Document; /** - * This class holds data for an resolved Artifact (Implementation or DeploymentArtifact) therefore - * it contains name, type and artifactSpecificContent + * This class holds data for an resolved Artifact (Implementation or DeploymentArtifact) therefore it contains name, + * type and artifactSpecificContent */ +// FIXME enforce business logic constraints by using basic constructors to fill fields with values public class ResolvedArtifacts { /** - * Class to hold all fields used by implementation and deploymentArtifacts This is a generic class - * so therefore there wont be an object of this (abstract!) Use a child class instead (see - * ResolvedDeploymentArtifact and ResolvedImplementationArtifact) + * Class to hold all fields used by implementation and deploymentArtifacts This is a generic class so therefore + * there wont be an object of this (abstract!) Use a child class instead (see ResolvedDeploymentArtifact and + * ResolvedImplementationArtifact) */ private abstract static class ResolvedArtifact { @@ -26,7 +28,6 @@ private abstract static class ResolvedArtifact { private List references; - public QName getType() { return this.type; } @@ -44,13 +45,15 @@ public void setArtifactSpecificContent(final Document artifactSpecificContent) { } public List getReferences() { + if (this.references == null) { + this.references = Collections.emptyList(); + } return this.references; } public void setReferences(final List references) { this.references = references; } - } /** @@ -60,7 +63,6 @@ public static class ResolvedDeploymentArtifact extends ResolvedArtifact { private String name; - public String getName() { return this.name; } @@ -71,8 +73,7 @@ public void setName(final String name) { } /** - * extends ResolvedArtifact by the ImplementationArtifact-specific fields operationName and - * interfaceName + * extends ResolvedArtifact by the ImplementationArtifact-specific fields operationName and interfaceName */ public static class ResolvedImplementationArtifact extends ResolvedArtifact { @@ -80,7 +81,6 @@ public static class ResolvedImplementationArtifact extends ResolvedArtifact { private String interfaceName; - public String getOperationName() { return this.operationName; } @@ -98,11 +98,9 @@ public void setInterfaceName(final String interfaceName) { } } - private List deploymentArtifacts = new ArrayList<>(); private List implementationArtifacts = new ArrayList<>(); - public List getDeploymentArtifacts() { return this.deploymentArtifacts; } @@ -117,6 +115,5 @@ public List getImplementationArtifacts() { public void setImplementationArtifacts(final List implementationArtifacts) { this.implementationArtifacts = implementationArtifacts; - }; - + } } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/ToscaEngine.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/ToscaEngine.java new file mode 100644 index 000000000..a5ac0f66b --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/ToscaEngine.java @@ -0,0 +1,553 @@ +package org.opentosca.container.core.engine; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.common.ids.definitions.ArtifactTemplateId; +import org.eclipse.winery.common.ids.definitions.ArtifactTypeId; +import org.eclipse.winery.common.ids.definitions.NodeTypeId; +import org.eclipse.winery.common.ids.definitions.NodeTypeImplementationId; +import org.eclipse.winery.common.ids.definitions.RelationshipTypeId; +import org.eclipse.winery.common.ids.definitions.RelationshipTypeImplementationId; +import org.eclipse.winery.common.ids.definitions.ServiceTemplateId; +import org.eclipse.winery.model.tosca.TArtifactTemplate; +import org.eclipse.winery.model.tosca.TArtifactType; +import org.eclipse.winery.model.tosca.TBoundaryDefinitions; +import org.eclipse.winery.model.tosca.TEntityTemplate; +import org.eclipse.winery.model.tosca.TEntityType; +import org.eclipse.winery.model.tosca.TEntityTypeImplementation; +import org.eclipse.winery.model.tosca.TExportedInterface; +import org.eclipse.winery.model.tosca.TExportedOperation; +import org.eclipse.winery.model.tosca.TImplementationArtifacts; +import org.eclipse.winery.model.tosca.TInterface; +import org.eclipse.winery.model.tosca.TInterfaces; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TNodeType; +import org.eclipse.winery.model.tosca.TNodeTypeImplementation; +import org.eclipse.winery.model.tosca.TOperation; +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPlans; +import org.eclipse.winery.model.tosca.TRelationshipTemplate; +import org.eclipse.winery.model.tosca.TRelationshipType; +import org.eclipse.winery.model.tosca.TRelationshipTypeImplementation; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.common.xml.XMLHelper; +import org.opentosca.container.core.model.csar.Csar; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + *

    + * This class exposes a multitude of operations that one might want to perform with elements of a Csar. All arguments + * passed to it are assumed to be set to a valid reference. + *

    + * As a convention, methods beginning with get are not guaranteed to return a result. They default to + * returning null or an empty {@link Optional}, if the request is not fulfillable. If a Collection type is + * expected as result, an empty Collection is returned. + *

    + * Likewise, methods beginning with resolve are guaranteed to return a result and throw a {@link + * NotFoundException} in case the request is not fulfillable. + *

    + * Methods that return some kind of {@link Collection} will return an empty collection as the default. They may throw + * {@link NotFoundException} if a component prerequisite is not met. + *

    + */ +//@NonNullByDefault +public final class ToscaEngine { + + private static final Logger LOG = LoggerFactory.getLogger(ToscaEngine.class); + + /** + * Gets a serviceTemplate from a csar by it's QName. + * + * @return null, if the service template could not be found, the {@link TServiceTemplate} otherwise. + */ + @Nullable + public static TServiceTemplate getServiceTemplate(Csar csar, QName serviceTemplateId) { + return (TServiceTemplate) csar.queryRepository(new ServiceTemplateId(serviceTemplateId)); + } + + /** + * Resolves a serviceTemplate from a csar by it's fully qualified QName. If no matching serviceTemplate can be + * found, an Exception is thrown. + * + * @return A {@link TServiceTemplate} instance matching the passed QName as it's id. Guaranteed to not be + * null. + */ + public static TServiceTemplate resolveServiceTemplate(Csar csar, QName serviceTemplateId) throws NotFoundException { + TServiceTemplate serviceTemplate = getServiceTemplate(csar, serviceTemplateId); + if (serviceTemplate == null) { + throw new NotFoundException("Service template \"" + serviceTemplate + "\" could not be found"); + } + return serviceTemplate; + } + + /** + * Resolves a ServiceTemplate from a csar by it's local id. If no matching serviceTemplate can be found, an + * Exception is thrown. + * + * @param csar The csar to query for the service template with the given id + * @param serviceTemplateId The local id of the service template + * @return A {@link TServiceTemplate} instance from within the given CSAR where the local id matches the search + * parameter given to this method. + */ + public static TServiceTemplate resolveServiceTemplate(Csar csar, String serviceTemplateId) throws NotFoundException { + // Iterate service templates here to allow resolving service templates by name without knowing their fully qualified Id + return csar.serviceTemplates() + .stream() + .filter(st -> serviceTemplateId.equals(st.getIdFromIdOrNameField())) + .findFirst() + .orElseThrow(() -> new NotFoundException(String.format("Csar %s does not contain a service template with the name %s", csar.id(), serviceTemplateId))); + } + + public static TNodeTemplate resolveNodeTemplate(Csar csar, QName serviceTemplateId, String nodeTemplate) throws NotFoundException { + return resolveNodeTemplate(resolveServiceTemplate(csar, serviceTemplateId), nodeTemplate); + } + + public static TNodeTemplate resolveNodeTemplate(TServiceTemplate serviceTemplate, String nodeTemplate) throws NotFoundException { + return getNodeTemplate(serviceTemplate, nodeTemplate) + .orElseThrow(() -> new NotFoundException("Node template \"" + nodeTemplate + "\" could not be found")); + } + + public static Optional getNodeTemplate(Csar csar, QName serviceTemplateId, String nodeTemplate) { + TServiceTemplate serviceTemplate = getServiceTemplate(csar, serviceTemplateId); + if (serviceTemplate == null) { + return Optional.empty(); + } + return getNodeTemplate(serviceTemplate, nodeTemplate); + } + + public static Optional getNodeTemplate(TServiceTemplate serviceTemplate, String nodeTemplate) { + return Optional.ofNullable(serviceTemplate.getTopologyTemplate()) + .map(tt -> tt.getNodeTemplate(nodeTemplate)); + } + + public static boolean isOperationBoundToSourceNode(final TRelationshipType relationshipType, final String interfaceName, final String operationName) { + return Optional.ofNullable(relationshipType.getSourceInterfaces()).map(TInterfaces::getInterface) + .orElse(Collections.emptyList()).stream() + .filter(iface -> interfaceName == null || iface.getName().equals(interfaceName)) + .flatMap(iface -> iface.getOperation().stream()) + .anyMatch(op -> op.getName().equals(operationName)); + } + + @Nullable + public static TNodeTemplate getRelatedNodeTemplate(TServiceTemplate serviceTemplate, TNodeTemplate template, QName... relationshipType) { + return getRelatedNodeTemplates(serviceTemplate, template, relationshipType) + .findFirst() + .orElse(null); + } + + public static Stream getRelatedNodeTemplates(TServiceTemplate serviceTemplate, TNodeTemplate template, QName... relationshipType) { + return serviceTemplate.getTopologyTemplate().getNodeTemplateOrRelationshipTemplate().stream() + .filter(candidate -> candidate instanceof TRelationshipTemplate) + .map(relation -> (TRelationshipTemplate) relation) + .filter(relation -> Arrays.stream(relationshipType).anyMatch(Predicate.isEqual(relation.getType()))) + .filter(relation -> { + final Object source = relation.getSourceElement().getRef(); + return source instanceof TNodeTemplate && source.equals(template); + }) + .map(relation -> relation.getTargetElement().getRef()) + .filter((target) -> target instanceof TNodeTemplate) + .map(TNodeTemplate.class::cast); + } + + public static List getInterfaces(TNodeTemplate nodeTemplate, Csar csar) { + TNodeType nodeType = resolveNodeType(csar, nodeTemplate); + TInterfaces nullable = nodeType.getInterfaces(); + return nullable == null ? Collections.emptyList() : nullable.getInterface(); + } + + public static TEntityType resolveEntityTypeReference(Csar csar, QName typeId) throws NotFoundException { + // prefer nodetypes for no particular reason + try { + return resolveNodeTypeReference(csar, typeId); + } catch (NotFoundException e) { + try { + return resolveRelationshipTypeReference(csar, typeId); + } catch (NotFoundException inner) { + inner.addSuppressed(e); + throw inner; + } + } + } + + public static TNodeType resolveNodeType(Csar csar, TNodeTemplate nodeTemplate) { + try { + return resolveNodeTypeReference(csar, nodeTemplate.getType()); + } catch (NotFoundException e) { + throw new RuntimeException("Could not resolve NodeType of an existing NodeTemplate, something went badly wrong", e); + } + } + + public static TNodeType resolveNodeTypeReference(Csar csar, QName nodeTypeId) throws NotFoundException { + TNodeType nodeType = (TNodeType) csar.queryRepository(new NodeTypeId(nodeTypeId)); + if (nodeType == null) { + throw new NotFoundException(String.format("Could not find NodeType [%s] in Csar [%s]", nodeTypeId, csar.id())); + } + return nodeType; + } + + public static TRelationshipType resolveRelationshipTypeReference(Csar csar, QName relationshipTypeId) throws NotFoundException { + TRelationshipType relationshipType = (TRelationshipType) csar.queryRepository(new RelationshipTypeId(relationshipTypeId)); + if (relationshipType == null) { + throw new NotFoundException(String.format("Could not find RelationshipType [%s] in Csar [%s]", relationshipTypeId, csar.id())); + } + return relationshipType; + } + + public static List resolveNodeTypeHierarchy(Csar csar, TNodeTemplate nodeTypeId) throws NotFoundException { + TNodeType target = resolveNodeType(csar, nodeTypeId); + return resolveNodeTypeHierarchy(csar, target); + } + + public static List resolveNodeTypeHierarchy(Csar csar, TNodeType target) throws NotFoundException { + List typeRefs = new ArrayList<>(); + typeRefs.add(target); + while (target.getDerivedFrom() != null) { + target = resolveNodeTypeReference(csar, target.getDerivedFrom().getTypeRef()); + typeRefs.add(target); + } + return typeRefs; + } + + public static TInterface resolveInterfaceAbstract(TEntityType type, String interfaceName) throws NotFoundException { + if (type instanceof TRelationshipType) { + return resolveInterface((TRelationshipType) type, interfaceName); + } else if (type instanceof TNodeType) { + return resolveInterface((TNodeType) type, interfaceName); + } else { + throw new NotFoundException("The given EntityType was not a RelationshipType or NodeType"); + } + } + + public static TInterface resolveInterface(TRelationshipType relationshipType, String interfaceName) throws NotFoundException { + return resolveInterface(relationshipType.getInterfaces(), interfaceName); + } + + public static TInterface resolveInterface(TNodeType nodeType, String interfaceName) throws NotFoundException { + return resolveInterface(nodeType.getInterfaces(), interfaceName); + } + + private static TInterface resolveInterface(TInterfaces interfaces, String interfaceName) throws NotFoundException { + return Stream.of(Optional.ofNullable(interfaces)) + .flatMap(opt -> opt.map(TInterfaces::getInterface).orElse(Collections.emptyList()).stream()) + .filter(iface -> iface.getName().equals(interfaceName)) + .findFirst() + .orElseThrow(() -> new NotFoundException("Interface [" + interfaceName + "] was not found in the given EntityType")); + } + + public static TOperation resolveOperation(TInterface iface, String operationName) throws NotFoundException { + return iface.getOperation().stream() + .filter(op -> op.getName().equals(operationName)) + .findFirst() + .orElseThrow(() -> new NotFoundException("Operation [" + operationName + "] was not found on the given Interface")); + } + + public static TOperation resolveOperation(TNodeType nodeType, String interfaceName, String operationName) throws NotFoundException { + return resolveOperation(resolveInterface(nodeType, interfaceName), operationName); + } + + public static TOperation resolveOperation(TRelationshipType relationshipType, String interfaceName, String operationName) throws NotFoundException { + return resolveOperation(resolveInterface(relationshipType, interfaceName), operationName); + } + + public static boolean operationHasInputParams(TNodeType nodeType, String interfaceName, String operationName) throws NotFoundException { + return hasInputParameters(resolveOperation(nodeType, interfaceName, operationName)); + } + + public static boolean operationHasInputParams(TRelationshipType relationshipType, String interfaceName, String operationName) throws NotFoundException { + return hasInputParameters(resolveOperation(relationshipType, interfaceName, operationName)); + } + + private static boolean hasInputParameters(TOperation operation) { + TOperation.InputParameters inputParams = operation.getInputParameters(); + return inputParams != null && !inputParams.getInputParameter().isEmpty(); + } + + public static boolean operationHasOutputParams(TNodeType nodeType, String interfaceName, String operationName) throws NotFoundException { + return hasOutputParameters(resolveOperation(nodeType, interfaceName, operationName)); + } + + public static boolean operationHasOutputParams(TRelationshipType relationshipType, String interfaceName, String operationName) throws NotFoundException { + return hasOutputParameters(resolveOperation(relationshipType, interfaceName, operationName)); + } + + private static boolean hasOutputParameters(TOperation operation) { + TOperation.OutputParameters outputParams = operation.getOutputParameters(); + return outputParams != null && !outputParams.getOutputParameter().isEmpty(); + } + + public static Optional getRelationshipTemplate(TServiceTemplate serviceTemplate, String localTemplateId) { + return Objects.isNull(localTemplateId) || Objects.isNull(serviceTemplate) || Objects.isNull(serviceTemplate.getTopologyTemplate()) + ? Optional.empty() + : Optional.ofNullable(serviceTemplate.getTopologyTemplate().getRelationshipTemplate(localTemplateId)); + } + + public static List getTypeImplementations(Csar csar, TEntityType type) { + if (type instanceof TNodeType) { + return getNodeTypeImplementations(csar, (TNodeType) type); + } else if (type instanceof TRelationshipType) { + return getRelationshipTypeImplementations(csar, (TRelationshipType) type); + } else { + LOG.warn("Attempted to get TypeImplementations for EntityType other than NodeType or RelationshipType"); + return Collections.emptyList(); + } + } + + public static List getRelationshipTypeImplementations(Csar csar, TRelationshipType type) { + return csar.relationshipTypeImplementations().stream() + .filter(impl -> impl.getRelationshipType().equals(type.getQName())) + .collect(Collectors.toList()); + } + + public static List getNodeTypeImplementations(Csar csar, TNodeType type) { + final List hierarchy; + try { + hierarchy = resolveNodeTypeHierarchy(csar, type); + } catch (NotFoundException e) { + LOG.warn("Could not resolve type hierarchy for known NodeType"); + return Collections.emptyList(); + } + // FIXME this is a bit weird, because it resolves the implementations of the whole type hierarchy, + // but that matches the previous implementation, soo ... + return csar.nodeTypeImplementations().stream() + .filter(impl -> { + try { + TNodeType implementationNodeType = resolveNodeTypeReference(csar, impl.getNodeType()); + return hierarchy.contains(implementationNodeType); + } catch (NotFoundException e) { + LOG.warn("Could not find NodeType of a known NodeTypeImplementation"); + return false; + } + }) + .collect(Collectors.toList()); + } + + public static List implementationArtifacts(TEntityTypeImplementation impl) { + TImplementationArtifacts nullable = impl.getImplementationArtifacts(); + return nullable == null ? Collections.emptyList() : nullable.getImplementationArtifact(); + } + + public static TImplementationArtifacts.ImplementationArtifact resolveImplementationArtifact(TEntityTypeImplementation impl, String iaName) throws NotFoundException { + return implementationArtifacts(impl).stream() + .filter(ia -> ia.getName().equals(iaName)) + .findFirst() + .orElseThrow(() -> new NotFoundException("No implementation Artifact matching " + iaName + "found in EntityTypeImplementation " + impl.getIdFromIdOrNameField())); + } + + public static List nodeTypeImplementations(Csar csar, TNodeType superType) { + QName typeRef = QName.valueOf(superType.getIdFromIdOrNameField()); + return csar.nodeTypeImplementations().stream() + .filter(nti -> nti.getDerivedFrom().getType().equals(typeRef)) + .collect(Collectors.toList()); + } + + @NonNull + public static TPlan resolvePlanReference(Csar csar, QName planId) throws NotFoundException { + // can't reformulate using queryRepository because PlanId requires a PlansId as parent for resolution + TPlan plan = csar.serviceTemplates().stream() + .flatMap(st -> { + TPlans plans = st.getPlans(); + return plans == null ? Stream.empty() : plans.getPlan().stream(); + }) + .filter(tplan -> tplan.getId().equals(planId.getLocalPart())) + .findFirst() + .orElseThrow(() -> new NotFoundException("No plan matching " + planId + " was found in csar" + csar.id().csarName())); + return plan; + } + + @NonNull + public static TArtifactTemplate resolveArtifactTemplate(Csar csar, QName artifactTemplateId) throws NotFoundException { + TArtifactTemplate artifactTemplate = (TArtifactTemplate) csar.queryRepository(new ArtifactTemplateId(artifactTemplateId)); + if (artifactTemplate == null) { + throw new NotFoundException("No artifactTemplate matching " + artifactTemplateId + " was found in csar " + csar.id().csarName()); + } + return artifactTemplate; + } + + public static TArtifactType resolveArtifactType(Csar csar, QName artifactTypeId) throws NotFoundException { + TArtifactType result = (TArtifactType) csar.queryRepository(new ArtifactTypeId(artifactTypeId)); + if (result == null) { + throw new NotFoundException(String.format("Csar [{}] does not contain the ArtifacType [{}]", csar.id().csarName(), artifactTypeId)); + } + return result; + } + + @Nullable + public static TServiceTemplate getContainingServiceTemplate(Csar csar, TPlan toscaPlan) { + // can't obtain serviceTemplateId from the plan, therefore iterate all service templates + return csar.serviceTemplates().stream() + .filter(st -> { + TPlans plans = st.getPlans(); + return plans != null && plans.getPlan().stream().anyMatch(toscaPlan::equals); + }) + .findFirst() + .orElse(null); + } + + public static TEntityTypeImplementation resolveTypeImplementation(Csar csar, QName typeImplementationQName) throws NotFoundException { + TEntityTypeImplementation result = (TEntityTypeImplementation) csar.queryRepository(new NodeTypeImplementationId(typeImplementationQName)); + if (result == null) { + result = (TEntityTypeImplementation) csar.queryRepository(new RelationshipTypeImplementationId(typeImplementationQName)); + } + if (result == null) { + throw new NotFoundException(String.format("No NodeTypeImplementation or RelationshipTypeImplementation found for id [%s] in Csar %s", typeImplementationQName, csar.id())); + } + return result; + } + + @Nullable + public static Document getArtifactTemplateProperties(Csar csar, QName artifactTemplateId) { + try { + return getEntityTemplateProperties(resolveArtifactTemplate(csar, artifactTemplateId)); + } catch (NotFoundException missing) { + return null; + } + } + + @Nullable + public static Document getNodeTemplateProperties(TNodeTemplate nodeTemplate) { + return getEntityTemplateProperties(nodeTemplate); + } + + @Nullable + public static Document getEntityTemplateProperties(TEntityTemplate template) { + return Optional.of(template) + .map(TEntityTemplate::getProperties) + // map via internal any to deal with HashMap property code in winery + .map(TEntityTemplate.Properties::getInternalAny) + .filter(p -> p instanceof Element) + .map(Element.class::cast) + .map(XMLHelper::fromRootNode) + .orElse(null); + } + + private static Stream listOperations(TServiceTemplate serviceTemplate) { + return Optional.of(serviceTemplate) + .map(TServiceTemplate::getBoundaryDefinitions) + .map(TBoundaryDefinitions::getInterfaces) + .map(TBoundaryDefinitions.Interfaces::getInterface) + .orElse(Collections.emptyList()) + .stream() + .map(TExportedInterface::getOperation) + .flatMap(Collection::stream); + } + + @Nullable + public static TExportedOperation getReferencingOperationWithin(TServiceTemplate serviceTemplate, TPlan plan) { + return listOperations(serviceTemplate) + // winery automatically fills the PlanRef with the TPlan instance + .filter(operation -> operation.getPlan().getPlanRef().equals(plan)) + .findFirst() + .orElse(null); + } + + @Nullable + public static TExportedOperation getReferencingOperationWithin(TServiceTemplate serviceTemplate, String planReference) { + return listOperations(serviceTemplate) + .filter(operation -> ((TPlan) operation.getPlan().getPlanRef()).getId().equals(planReference)) + .findFirst() + .orElse(null); + } + + public static TExportedOperation resolveBoundaryDefinitionOperation(TServiceTemplate serviceTemplate, String interfaceName, String operationName) throws NotFoundException { + return Optional.of(serviceTemplate) + .map(TServiceTemplate::getBoundaryDefinitions) + .map(TBoundaryDefinitions::getInterfaces) + .map(TBoundaryDefinitions.Interfaces::getInterface) + .orElse(Collections.emptyList()) + .stream() + .filter(iface -> iface.getName().equals(interfaceName)) + .findFirst() + .map(TExportedInterface::getOperation) + .orElse(Collections.emptyList()) + .stream() + .filter(op -> op.getName().equals(operationName)) + .findFirst() + .orElseThrow(() -> new NotFoundException(String.format("Could not resolve operation [%s] in interface [%s]", operationName, interfaceName))); + } + + @Nullable + public static TExportedInterface getReferencingInterfaceWithin(TServiceTemplate serviceTemplate, TExportedOperation operation) { + return Optional.of(serviceTemplate) + .map(TServiceTemplate::getBoundaryDefinitions) + .map(TBoundaryDefinitions::getInterfaces) + .map(TBoundaryDefinitions.Interfaces::getInterface) + .orElse(Collections.emptyList()) + .stream() + .filter(iface -> iface.getOperation().contains(operation)) + .findFirst() + .orElse(null); + } + + public static boolean isOperationUniqueInType(Csar csar, TEntityType type, String providedInterface, String neededOperation) { + if (type instanceof TNodeType) { + return isOperationUniqueInType(csar, (TNodeType) type, providedInterface, neededOperation); + } else if (type instanceof TRelationshipType) { + return isOperationUniqueInType(csar, (TRelationshipType) type, providedInterface, neededOperation); + } else { + return false; + } + } + + public static boolean isOperationUniqueInType(Csar csar, TNodeType type, String providedInterface, String neededOperation) { + final List hierarchy; + try { + hierarchy = resolveNodeTypeHierarchy(csar, type); + } catch (NotFoundException e) { + LOG.warn("Could not resolve NodeTypeHierarchy for known node type"); + return false; + } + return hierarchy.stream() + .filter(t -> t.getInterfaces() != null) + .flatMap(t -> t.getInterfaces().getInterface().stream() + // iterate over the interfaces that match the provided interface + .filter(i -> i.getName().equals(providedInterface)) + ) + // filter to only those that provide the needed operation + .filter(i -> { + try { + return resolveOperation(i, neededOperation) != null; + } catch (NotFoundException e) { + return false; + } + }) + // and check whether it is only a single one + .count() == 1; + } + + public static boolean isOperationUniqueInType(Csar csar, TRelationshipType type, String providedInterface, String neededOperation) { + TInterfaces interfaces = type.getInterfaces(); + if (interfaces == null) { + return false; + } + return interfaces.getInterface().stream() + .filter(i -> i.getName().equals(providedInterface)) + // filter to only those that provide the needed operation + .filter(i -> { + try { + return resolveOperation(i, neededOperation) != null; + } catch (NotFoundException e) { + return false; + } + }) + // and check whether it is only a single one + .count() == 1; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/management/IManagementBus.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/management/IManagementBus.java new file mode 100644 index 000000000..2cfccf707 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/management/IManagementBus.java @@ -0,0 +1,27 @@ +package org.opentosca.container.core.engine.management; + +import java.util.Map; + +public interface IManagementBus { + + /** + * Invokes a plan on the management bus with the given event values + * + * @param eventValues A Map containing the event values required to invoke the plan + */ + void invokePlan(Map eventValues); + + /** + * Invokes an IA on the management bus with the given event values + * + * @param eventValues A Map containing the event values required to invoke the artifact + */ + void invokeIA(Map eventValues); + + /** + * Invokes situation adaption on the management bus with the given event values + * + * @param eventValues A Map containing the event values required to adapt the artifact + */ + void situationAdaption(Map eventValues); +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/next/ContainerEngine.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/next/ContainerEngine.java new file mode 100644 index 000000000..48a3ab1ec --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/next/ContainerEngine.java @@ -0,0 +1,170 @@ +package org.opentosca.container.core.engine.next; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.common.ids.definitions.ArtifactTemplateId; +import org.eclipse.winery.model.tosca.TArtifactReference; +import org.eclipse.winery.model.tosca.TArtifactTemplate; +import org.eclipse.winery.model.tosca.TDeploymentArtifact; +import org.eclipse.winery.model.tosca.TDeploymentArtifacts; +import org.eclipse.winery.model.tosca.TEntityTemplate; +import org.eclipse.winery.model.tosca.TInterfaces; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TRelationshipType; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.engine.NodeTemplateInstanceCounts; +import org.opentosca.container.core.engine.ResolvedArtifacts; +import org.opentosca.container.core.engine.xml.IXMLSerializerService; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * Implements Tosca-Engine-like operations for the model classes available under {@link + * org.opentosa.container.core.next.model} + */ +@Component +public final class ContainerEngine { + + private static final Logger LOG = LoggerFactory.getLogger(ContainerEngine.class); + + private final IXMLSerializerService xmlSerializerService; + + @Inject + public ContainerEngine(IXMLSerializerService xmlSerializerService) { + this.xmlSerializerService = xmlSerializerService; + } + + public ResolvedArtifacts resolvedDeploymentArtifacts(Csar context, TNodeTemplate nodeTemplate) { + final ResolvedArtifacts result = new ResolvedArtifacts(); + result.setDeploymentArtifacts(resolvedDeploymentArtifactsForNodeTemplate(context, nodeTemplate)); + return result; + } + + public List resolvedDeploymentArtifactsForNodeTemplate(Csar context, TNodeTemplate nodeTemplate) { + LOG.debug("Trying to fetch DAs of NodeTemplate {}", nodeTemplate.getName()); + if (nodeTemplate.getDeploymentArtifacts() == null + || nodeTemplate.getDeploymentArtifacts().getDeploymentArtifact().isEmpty()) { + LOG.info("NodeTemplate {} has no deployment artifacts", nodeTemplate.getName()); + return Collections.emptyList(); + } + + return nodeTemplate.getDeploymentArtifacts().getDeploymentArtifact().stream() + .map(da -> resolveDA(context, nodeTemplate, da)) + .collect(Collectors.toList()); + } + + private ResolvedArtifacts.ResolvedDeploymentArtifact resolveDA(Csar context, TNodeTemplate nodeTemplate, TDeploymentArtifact da) { + LOG.debug("Trying to fetch DA of NodeTemplate {}", nodeTemplate.getName()); + + final ResolvedArtifacts.ResolvedDeploymentArtifact result = new ResolvedArtifacts.ResolvedDeploymentArtifact(); + result.setName(da.getName()); + result.setType(da.getArtifactType()); + // assumption: there is artifactSpecificContent OR an artifactTemplateRef + if (Objects.isNull(da.getArtifactRef())) { + result.setArtifactSpecificContent(readArtifactSpecificContent(da)); + result.setReferences(Collections.emptyList()); + return result; + } + + TArtifactTemplate template = (TArtifactTemplate) context.queryRepository(new ArtifactTemplateId(da.getArtifactRef())); + final List references = new ArrayList<>(); + for (final TArtifactReference artifactReference : Optional.ofNullable(template.getArtifactReferences()).map(ars -> ars.getArtifactReference()).orElse(Collections.emptyList())) { + // if there is no include patterns, just add the reference + if (artifactReference.getIncludeOrExclude() == null + || artifactReference.getIncludeOrExclude().isEmpty()) { + references.add(artifactReference.getReference()); + continue; + } + artifactReference.getIncludeOrExclude().stream() + .filter(o -> o instanceof TArtifactReference.Include) + .map(TArtifactReference.Include.class::cast) + .forEach(includePattern -> references.add(artifactReference.getReference() + "/" + includePattern.getPattern())); + } + result.setReferences(references); + + return result; + } + + private Document getArtifactSpecificContent(final TDeploymentArtifacts artifacts, final String deploymentArtifactName) { + // if there are ImplementationArtifacts + if (artifacts == null) { + return null; + } + TDeploymentArtifact artifact = artifacts.getDeploymentArtifact(deploymentArtifactName); + if (artifact == null) { + LOG.info("Requested artifact {} was not found.", deploymentArtifactName); + return null; + } + return readArtifactSpecificContent(artifact); + } + + private Document readArtifactSpecificContent(TDeploymentArtifact artifact) { + final List listOfAnyElements = new ArrayList<>(); + for (final Object obj : artifact.getAny()) { + if (obj instanceof Element) { + listOfAnyElements.add((Element) obj); + } else { + LOG.error("There is content inside of the DeploymentArtifact [{}] which is not a processable DOM Element.", artifact.getName()); + return null; + } + } + return xmlSerializerService.getXmlSerializer().elementsIntoDocument(listOfAnyElements, "DeploymentArtifactSpecificContent"); + } + + public static NodeTemplateInstance resolveRelationshipOperationTarget(RelationshipTemplateInstance relationshipInstance, + TRelationshipType relationshipType, + String interfaceName, String operationName) { + boolean operationIsAttachedToSource = Optional.ofNullable(relationshipType.getSourceInterfaces()).map(TInterfaces::getInterface) + .orElse(Collections.emptyList()).stream() + .filter(iface -> interfaceName == null || iface.getName().equals(interfaceName)) + .flatMap(iface -> iface.getOperation().stream()) + .anyMatch(op -> op.getName().equals(operationName)); + if (operationIsAttachedToSource) { + return relationshipInstance.getSource(); + } else { + return relationshipInstance.getTarget(); + } + } + + public static NodeTemplateInstanceCounts getInstanceCounts(TServiceTemplate serviceTemplate) { + final List nodeTemplateOrRelationshipTemplate = + serviceTemplate.getTopologyTemplate().getNodeTemplateOrRelationshipTemplate(); + + // store nodeTemplates in own list so we dont alter the jaxb object + final List nodeTemplates = new ArrayList<>(); + for (final TEntityTemplate tEntityTemplate : nodeTemplateOrRelationshipTemplate) { + // only add it if its a nodeTemplate + if (tEntityTemplate instanceof TNodeTemplate) { + nodeTemplates.add((TNodeTemplate) tEntityTemplate); + } + } + + // construct result object (getMin and MaxInstance from JAXB and store + // them in result object) + final NodeTemplateInstanceCounts counts = new NodeTemplateInstanceCounts(); + for (final TNodeTemplate tNodeTemplate : nodeTemplates) { + final QName nodeTemplateQName = new QName(serviceTemplate.getTargetNamespace(), tNodeTemplate.getId()); + final int minInstances = tNodeTemplate.getMinInstances(); + // in xml the maxInstances attribute is a String because it also can + // contain "unbounded" + final String maxInstances = tNodeTemplate.getMaxInstances(); + counts.addInstanceCount(nodeTemplateQName, minInstances, maxInstances); + } + return counts; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializer.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializer.java new file mode 100644 index 000000000..0b7364a3a --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializer.java @@ -0,0 +1,136 @@ +package org.opentosca.container.core.engine.xml; + +import java.io.File; +import java.io.InputStream; +import java.util.List; + +import javax.xml.bind.JAXBElement; + +import org.eclipse.winery.model.tosca.Definitions; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +/** + * Interface of the XML Serialization for marshaling and unmarshaling objects of the TOSCA universe to the needed JAXB + * or DOM objects as well as other XML content to DOM objects. Instances of this Interface can be created with the + * SerializerFactory. + *

    + * An implementation of this interface provides functionality for processing XML data in files and JAXB objects. Further + * the Serializer can convert these data to DOM and String representations. + *

    + * The instance of this interface is used by
    - org.opentosca.containerapi
    - org.opentosca.core.model
    - + * org.opentosca.toscaengine.service
    + * + * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de + */ +public interface IXMLSerializer { + + /** + * This method marshals an object of the TOSCA model into a DOM Node representation. + * + * @param element The JAXBElement to serialize into a DOM representation. + * @return The DOM node representation of the element. + */ + public Node marshalToNode(Object objToMarshal); + + /** + * This method marshals a given ServiceTemplate into a DOM Document representation. + * + * @param objToMarshal The root element to serialize into a DOM representation. + * @return The DOM Document representation of the element. + */ + public Document marshalToDocument(Definitions definitions); + + /** + * This method marshals a passed JAXBElement into a String. + * + * @param objToMarshal The root element to serialize into a String representation. + * @return The String representation of the object. + */ + public String marshalToString(Object objToMarshal); + + /** + * This method unmarshals a ServiceTemplate of a passed XML File object.
    + * + * @param file The File object which shall be unmarshaled. + * @return ServiceTemplate The ServiceTemplate which contains the xml data of the File. The method returns null if + * the file is empty or one or more errors occurs. + */ + public abstract Definitions unmarshal(File fileToUnmarshal); + + /** + * This method unmarshals a ServiceTemplate of a passed InputStream.
    + * + * @param streamToUnmarshal The InputStream which contains the xml data. + * @return The ServiceTemplate which contains the xml data. The method returns null if the stream is empty or one or + * more errors occurs. + */ + public abstract Definitions unmarshal(InputStream streamToUnmarshal); + + /** + * This method unmarshals a ServiceTemplate of a passed DOM document.
    + * + * @param The DOM Document which contains the data. + * @return ServiceTemplate The ServiceTemplate which contains the xml data. The method returns a null if the file is + * empty or one or more errors occurs. + */ + public abstract Definitions unmarshal(Document doc); + + /** + * This method unmarshals a object of a passed DOM Node. For the mapping you need to provide the destination class + * with which a instance is generated and the data is stored. + * + * @param nodeToUnmarshal The Node which shall be unmarshalled. + * @param destinationClazz The class which represents the Node. + * @return An Object of the type of the second parameter and the data of the first. + */ + public abstract Object unmarshal(Node nodeToUnmarshal, Class destinationClazz); + + /** + * This method creates a JAXBElement object which contains the given object. + * + * @param obj The object which is needed in form of a JAXBElement. + * @return The JAXBElement of the given object or null if the given object is not in the context of the TOSCA JAXB + * classes. + */ + @SuppressWarnings("rawtypes") + public abstract JAXBElement createJAXBElement(Object obj); + + /** + * This method puts a given DOM Element into a proper DOM Document structure. The root element in the new document + * is a copy of the original one. + * + * @param Element the element which shall be the root element of a new DOM Document. + * @return a new DOM Document or null in case of an error. + */ + public Document elementIntoDocument(Element element); + + /** + * This method puts a given list of DOM Elements into a proper DOM Document structure. The original elements are + * copied and the new elements are put into a new root element with the name depending on the second parameter. + * + * @param elements list of elements which provide the content of the new document + * @param rootElementName the name of the new root element + * @return a new DOM Document or null in case of an error. + */ + // TODO change type of rootElementName to QName to support namespaces + public Document elementsIntoDocument(List elements, String rootElementName); + + /** + * This method sets the validation against the schema active or inactive. By default the validation is activated. + * + * @param bool True for activation and false for deactivation of the validation. + */ + public abstract void setValidation(Boolean bool); + + /** + * Serializes a DOM Node to a String representation. + * + * @param node A node containing the data which to serialize to a String representation. + * @param removeWhitespaces Flag for removing the whitespace. + * @return formatted String + */ + public abstract String docToString(Node node, boolean removeWhitespaces); +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializerFactory.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializerFactory.java new file mode 100644 index 000000000..e644c8b3a --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializerFactory.java @@ -0,0 +1,16 @@ +package org.opentosca.container.core.engine.xml; + +import java.net.URL; + +public interface IXMLSerializerFactory { + + /** + * Creates a new instance of the XML Serializer of the TOSCA universe for a passed class which marks the context and + * a File object which represents the TOSCA Schema. + * + * @param classContext A JAXB class which marks the context in which the Serializer is instantiated. + * @param schemaFile A File object which provides the Schema file of TOSCA. + * @return An instance of the XML Serializer of the TOSCA universe. + */ + public abstract IXMLSerializer createSerializer(Class classContext, URL schemaFile); +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializerService.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializerService.java new file mode 100644 index 000000000..5a5dcb1ec --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/IXMLSerializerService.java @@ -0,0 +1,18 @@ +package org.opentosca.container.core.engine.xml; + +/** + * This interface describes the XMLSerializerService which provides the IXMLSerializer which serializes data of the + * TOSCA universe and related data like WSDL or XML Schema. Furthermore the service provides access to the ObjectFactory + * of JAXB objects of TOSCA. + * + * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de + */ +public interface IXMLSerializerService { + + /** + * Getter for the XMLSerializer which handles data of TOSCA or is used by TOSCA. + * + * @return The xmlSerializer for data which is TOSCA or is used by TOSCA. + */ + public abstract IXMLSerializer getXmlSerializer(); +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/FormatOutputUtil.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/FormatOutputUtil.java similarity index 93% rename from org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/FormatOutputUtil.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/FormatOutputUtil.java index 7582dcf79..50d48a283 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/FormatOutputUtil.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/FormatOutputUtil.java @@ -16,13 +16,20 @@ import org.w3c.dom.Node; public class FormatOutputUtil implements IOutputFormatter { + /** + * Serializes ServiceTemplate node to String + * + * @param ServiceTemplate + * @param removeWhitespaces Remove whitespace (e.g. line breaks)? + * @return + */ + private static String stripSpaceXSL = + ""; /** * Serializes DOM node to String * - * @param node * @param removeWhitespaces Remove whitespace (e.g. line breaks)? - * @return */ @Override public String docToString(final Node node, final boolean removeWhitespaces) { @@ -42,26 +49,12 @@ public String docToString(final Node node, final boolean removeWhitespaces) { } transformer.transform(source, streamResult); result = stringWriter.getBuffer().toString(); - } - catch (final TransformerConfigurationException e) { + } catch (final TransformerConfigurationException e) { e.printStackTrace(); - } - catch (final TransformerException e) { + } catch (final TransformerException e) { e.printStackTrace(); } } return result.replace(System.getProperty("line.separator"), ""); } - - - /** - * Serializes ServiceTemplate node to String - * - * @param ServiceTemplate - * @param removeWhitespaces Remove whitespace (e.g. line breaks)? - * @return - */ - private static String stripSpaceXSL = - ""; - } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/IOutputFormatter.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/IOutputFormatter.java similarity index 85% rename from org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/IOutputFormatter.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/IOutputFormatter.java index cab9961c0..d14e34fd2 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/IOutputFormatter.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/IOutputFormatter.java @@ -12,10 +12,9 @@ public interface IOutputFormatter { /** * Serializes a passed DOM node to a String. * - * @param node A DOM Node which is needed in a String representation. + * @param node A DOM Node which is needed in a String representation. * @param removeWhitespaces Flag for removing whitespace. * @return String representation of the passed DOM Node. */ public abstract String docToString(Node node, boolean removeWhitespaces); - } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializer.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializer.java similarity index 81% rename from org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializer.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializer.java index 7ef834584..e631c948c 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializer.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializer.java @@ -3,10 +3,10 @@ import java.io.File; import java.io.InputStream; import java.io.StringWriter; +import java.net.URL; import java.util.List; import javax.xml.XMLConstants; -import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; @@ -20,8 +20,10 @@ import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; +import org.eclipse.winery.model.tosca.Definitions; +import org.eclipse.winery.repository.JAXBSupport; + import org.opentosca.container.core.engine.xml.IXMLSerializer; -import org.opentosca.container.core.tosca.model.Definitions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -30,22 +32,20 @@ import org.xml.sax.SAXException; /** - * * Serializer for marshaling and unmarshaling objects of the TOSCA universe. - * - * This class is represented by the interface - * org.opentosca.toscaengine.xmlserializer.service.IXMLSerializer. - * + *

    + * This class is represented by the interface org.opentosca.toscaengine.xmlserializer.service.IXMLSerializer. + *

    * Copyright 2012 IAAS University of Stuttgart
    *
    - * + *

    * TODO JAXBIntrospector does not what expected ... * * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de */ public class XMLSerializer extends FormatOutputUtil implements IXMLSerializer { + private static final Logger LOG = LoggerFactory.getLogger(XMLSerializer.class); - private JAXBContext jaxbContext; private SchemaFactory schemaFactory; private Schema schema = null; private ValidationEventCollector validationEventCollector; @@ -62,33 +62,25 @@ public class XMLSerializer extends FormatOutputUtil implements IXMLSerializer { private DocumentBuilderFactory documentBuilderFactory; private DocumentBuilder documentBuilder; - // logger - private final Logger LOG = LoggerFactory.getLogger(XMLSerializer.class); - - /** - * Constructor for XML serialization of TOSCA Definitions. Instances are created via the - * org.opentosca.core.xmlserializer.SerializerFactory. + * Constructor for XML serialization of TOSCA Definitions. * - * @param context The context of the JAXB classes - the package in which all related files are. + * @param context The context of the JAXB classes - the package in which all related files are. * @param schemaFile File of the Schema. If null, no validation will be instantiated. */ - public XMLSerializer(final Class context, final File schemaFile) { + public XMLSerializer(final Class context, final URL schemaFile) { - this.LOG.debug("Start the initiation of the JAXB objects for context \"" + context.getPackage().getName() + LOG.debug("Start the initiation of the JAXB objects for context \"" + context.getPackage().getName() + "\"."); try { - // setup of the Serializer - this.jaxbContext = JAXBContext.newInstance(context.getPackage().getName()); - this.validationEventCollector = new ValidationEventCollector(); - this.marshaller = this.jaxbContext.createMarshaller(); + this.marshaller = JAXBSupport.createMarshaller(true); this.marshaller.setEventHandler(this.validationEventCollector); - this.marshallerWithoutValidation = this.jaxbContext.createMarshaller(); + this.marshallerWithoutValidation = JAXBSupport.createMarshaller(false); this.marshallerWithoutValidation.setEventHandler(this.validationEventCollector); this.documentBuilderFactory = DocumentBuilderFactory.newInstance(); @@ -104,21 +96,16 @@ public XMLSerializer(final Class context, final File schemaFile) { this.LOG.debug("Activate validation for serialization to JAXB classes."); this.setValidation(true); this.documentBuilderFactory.setSchema(this.schema); - } else { this.LOG.info("Initialize without a Schema."); } this.documentBuilder = this.documentBuilderFactory.newDocumentBuilder(); - - } - catch (final JAXBException e) { + } catch (final JAXBException e) { this.LOG.error(e.getMessage()); - } - catch (final SAXException e) { + } catch (final SAXException e) { this.LOG.error(e.getMessage()); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { this.LOG.error(e.getMessage()); } @@ -147,11 +134,8 @@ public Node marshalToNode(final Object objToMarshal) { this.marshallerWithoutValidation.marshal(elementToMarshal, result); return result.getFirstChild(); - - } - catch (final JAXBException e) { - } - finally { + } catch (final JAXBException e) { + } finally { this.printErrorsWhileSerialization(); } } else { @@ -175,11 +159,8 @@ public Document marshalToDocument(final Definitions definitions) { this.marshaller.marshal(definitions, result); return result; - - } - catch (final JAXBException e) { - } - finally { + } catch (final JAXBException e) { + } finally { this.printErrorsWhileSerialization(); } return null; @@ -205,11 +186,8 @@ public String marshalToString(final Object objToMarshal) { this.marshallerWithoutValidation.marshal(elementToMarshal, writer); return writer.toString(); - - } - catch (final JAXBException e) { - } - finally { + } catch (final JAXBException e) { + } finally { this.printErrorsWhileSerialization(); } } else { @@ -228,12 +206,9 @@ public Definitions unmarshal(final File fileToUnmarshal) { this.LOG.debug("Start the unmarshalling of file \"" + fileToUnmarshal.toString() + "\"."); try { // return the unmarshaled data - return (Definitions) this.createUnmarshaller().unmarshal(fileToUnmarshal); - - } - catch (final JAXBException e) { - } - finally { + return (Definitions) JAXBSupport.createUnmarshaller().unmarshal(fileToUnmarshal); + } catch (final JAXBException e) { + } finally { this.printErrorsWhileSerialization(); } @@ -249,12 +224,9 @@ public Definitions unmarshal(final InputStream streamToUnmarshal) { this.LOG.debug("Start the unmarshalling of an InputStream."); try { // return the unmarshaled data - return (Definitions) this.createUnmarshaller().unmarshal(streamToUnmarshal); - - } - catch (final JAXBException e) { - } - finally { + return (Definitions) JAXBSupport.createUnmarshaller().unmarshal(streamToUnmarshal); + } catch (final JAXBException e) { + } finally { this.printErrorsWhileSerialization(); } @@ -270,11 +242,9 @@ public Definitions unmarshal(final Document doc) { this.LOG.debug("Start the unmarshalling of a DOM Document."); this.LOG.trace(this.docToString(doc.getFirstChild(), true)); try { - return (Definitions) this.createUnmarshaller().unmarshal(doc.getFirstChild()); - } - catch (final JAXBException e) { - } - finally { + return (Definitions) JAXBSupport.createUnmarshaller().unmarshal(doc.getFirstChild()); + } catch (final JAXBException e) { + } finally { this.printErrorsWhileSerialization(); } @@ -291,16 +261,14 @@ public Object unmarshal(final Node nodeToUnmarshal, final Class destinationCl + destinationClazz.toString()); try { - final Unmarshaller u = this.createUnmarshaller(); + final Unmarshaller u = JAXBSupport.createUnmarshaller(); final JAXBElement jaxbElement = u.unmarshal(nodeToUnmarshal, destinationClazz); if (jaxbElement != null) { return jaxbElement.getValue(); } - } - catch (final JAXBException e) { + } catch (final JAXBException e) { e.printStackTrace(); - } - finally { + } finally { this.printErrorsWhileSerialization(); } @@ -310,7 +278,7 @@ public Object unmarshal(final Node nodeToUnmarshal, final Class destinationCl /** * {@inheritDoc} */ - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings( {"rawtypes", "unchecked"}) @Override public JAXBElement createJAXBElement(final Object obj) { // Check if the given object is in the same package as the JAXB Element @@ -408,8 +376,8 @@ public void setValidation(final Boolean bool) { } /** - * Method for printing errors stored in the validationEventCollector. For each error the logger gets - * one error message. + * Method for printing errors stored in the validationEventCollector. For each error the logger gets one error + * message. */ private void printErrorsWhileSerialization() { // print the errors occurred @@ -421,22 +389,4 @@ private void printErrorsWhileSerialization() { } this.validationEventCollector.reset(); } - - private Unmarshaller createUnmarshaller() { - try { - Unmarshaller u; - u = this.jaxbContext.createUnmarshaller(); - - if (this.validationActive) { - u.setSchema(this.schema); - } - u.setEventHandler(this.validationEventCollector); - return u; - } - catch (final JAXBException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializerFactory.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializerFactory.java similarity index 78% rename from org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializerFactory.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializerFactory.java index 6f76f8415..7c507ce25 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializerFactory.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializerFactory.java @@ -1,6 +1,6 @@ package org.opentosca.container.core.engine.xml.impl; -import java.io.File; +import java.net.URL; import org.opentosca.container.core.engine.xml.IXMLSerializer; import org.opentosca.container.core.engine.xml.IXMLSerializerFactory; @@ -9,7 +9,7 @@ /** * A ObjectFactory class for creating instances of the Serializer. - * + *

    * This class is used by org.opentosca.toscaengine.service. * * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de @@ -18,22 +18,21 @@ public class XMLSerializerFactory implements IXMLSerializerFactory { final private static Logger LOG = LoggerFactory.getLogger(XMLSerializer.class); - public XMLSerializerFactory() { XMLSerializerFactory.LOG.debug("Initialize the SerializerFactory."); } /** - * Creates a new instance of the XML Serializer of the TOSCA universe for a passed class which marks - * the context and a File object which represents the TOSCA Schema. + * Creates a new instance of the XML Serializer of the TOSCA universe for a passed class which marks the context and + * a File object which represents the TOSCA Schema. * * @param classContext A JAXB class which marks the context in which the Serializer is instantiated. - * @param schemaFile A File object which provides the Schema file of TOSCA. + * @param schemaFile A File object which provides the Schema file of TOSCA. * @return An instance of the XML Serializer of the TOSCA universe. */ @Override - public IXMLSerializer createSerializer(final Class classContext, final File schemaFile) { - XMLSerializerFactory.LOG.debug("Create a new ISerializer."); + public IXMLSerializer createSerializer(final Class classContext, final URL schemaFile) { + LOG.debug("Create a new ISerializer."); return new XMLSerializer(classContext, schemaFile); } } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializerServiceImpl.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializerServiceImpl.java new file mode 100644 index 000000000..17a8eda0f --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/engine/xml/impl/XMLSerializerServiceImpl.java @@ -0,0 +1,54 @@ +package org.opentosca.container.core.engine.xml.impl; + +import java.net.URL; + +import org.eclipse.winery.model.tosca.Definitions; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.opentosca.container.core.engine.xml.IXMLSerializer; +import org.opentosca.container.core.engine.xml.IXMLSerializerService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Service; + +/** + * Implementation of the interface org.opentosca.toscaengine.xmlserializer.service.IXMLSerializerService + * + * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de + * @see org.opentosca.container.core.engine.xml.IXMLSerializerService + */ +@Service +@NonNullByDefault +class XMLSerializerServiceImpl implements IXMLSerializerService { + + private final IXMLSerializer xmlSerializer; + + private final Logger LOG = LoggerFactory.getLogger(XMLSerializerServiceImpl.class); + + public XMLSerializerServiceImpl() { + this.LOG.debug("Caching a new XMLSerializer."); + final URL schemaFile = getClass().getClassLoader().getResource("TOSCA-v1.0.xsd"); + + // this boolean is for preventing a unused warning and to get + // the Serialization working with validation easily if needed + final boolean trueForCreateValidation = false; + if (trueForCreateValidation) { + this.LOG.debug("Create TOSCA XML Serialization with schema validation."); + this.xmlSerializer = new XMLSerializerFactory().createSerializer(Definitions.class, schemaFile); + } else { + this.LOG.debug("Create TOSCA XML Serialization without schema validation."); + this.xmlSerializer = new XMLSerializerFactory().createSerializer(Definitions.class, null); + } + this.xmlSerializer.setValidation(true); + } + + /** + * {@inheritDoc} + */ + @Override + @Bean + public IXMLSerializer getXmlSerializer() { + return this.xmlSerializer; + } +} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/AbstractDAO.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/AbstractDAO.java similarity index 85% rename from org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/AbstractDAO.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/AbstractDAO.java index 029ff649a..295a82983 100644 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/AbstractDAO.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/AbstractDAO.java @@ -12,7 +12,6 @@ public abstract class AbstractDAO { protected EntityManager em; - public AbstractDAO() { super(); } @@ -24,8 +23,8 @@ protected void finalize() throws Throwable { } /** - * This method initializes the EntityManager/Factory in case it is not connected/setup yet. It is - * called by each method, to ensure that a connection exists. (Robustness!) + * This method initializes the EntityManager/Factory in case it is not connected/setup yet. It is called by each + * method, to ensure that a connection exists. (Robustness!) */ protected void init() { if (this.em == null) { diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/Converters.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/Converters.java similarity index 86% rename from org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/Converters.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/Converters.java index bb70470db..b72ffa352 100644 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/Converters.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/Converters.java @@ -25,17 +25,15 @@ import org.w3c.dom.Document; public abstract class Converters { - private static ServiceTemplateInstanceRepository stiRepository = new ServiceTemplateInstanceRepository(); + private static ServiceTemplateInstanceRepository stiRepository = new ServiceTemplateInstanceRepository(); private static NodeTemplateInstanceRepository ntiRepository = new NodeTemplateInstanceRepository(); - private static RelationshipTemplateInstanceRepository rtiRepository = new RelationshipTemplateInstanceRepository(); private static DocumentConverter xmlConverter = new DocumentConverter(); - public static ServiceInstance convert(final ServiceTemplateInstance object) { - final ServiceInstance si = new ServiceInstance(object.getCsarId(), object.getTemplateId(), ""); + final ServiceInstance si = new ServiceInstance(object.getCsarId(), object.getTemplateId()); if (object.getId() != null) { si.setId(object.getId().intValue()); } @@ -44,9 +42,9 @@ public static ServiceInstance convert(final ServiceTemplateInstance object) { si.setCreated(object.getCreatedAt()); final ServiceTemplateInstanceProperty prop = object.getProperties().stream().filter(p -> p.getName().equalsIgnoreCase("xml")) - .collect(Collectors.reducing((a, b) -> null)).get(); + .collect(Collectors.reducing((a, b) -> null)).get(); if (prop != null) { - si.setProperties((Document) xmlConverter.convertDataValueToObjectValue(prop.getValue(), null)); + si.setProperties((Document) xmlConverter.convertToEntityAttribute(prop.getValue())); } return si; } @@ -59,28 +57,27 @@ public static ServiceTemplateInstance convert(final ServiceInstance object) { sti = o.get(); } else { sti = new ServiceTemplateInstance(); - sti.setCsarId(object.getCSAR_ID()); - sti.setTemplateId(object.getServiceTemplateID()); + sti.setCsarId(object.getCsarID()); + sti.setTemplateId(object.getServiceTemplateName()); sti.setState(ServiceTemplateInstanceState.INITIAL); } final Document properties = object.getProperties(); if (properties != null) { - final String value = (String) xmlConverter.convertObjectValueToDataValue(properties, null); + final String value = (String) xmlConverter.convertToDatabaseColumn(properties); final ServiceTemplateInstanceProperty prop = new ServiceTemplateInstanceProperty(); prop.setName("xml"); prop.setType("xml"); prop.setValue(value); sti.addProperty(prop); } - } - catch (final Exception e) { + } catch (final Exception e) { e.printStackTrace(); } return sti; } public static NodeInstance convert(final NodeTemplateInstance object) { - final NodeInstance ni = new NodeInstance(object.getTemplateId(), "", object.getTemplateType(), + final NodeInstance ni = new NodeInstance(object.getTemplateId(), object.getTemplateId(), object.getTemplateType(), convert(object.getServiceTemplateInstance())); if (object.getId() != null) { ni.setId(object.getId().intValue()); @@ -90,9 +87,9 @@ public static NodeInstance convert(final NodeTemplateInstance object) { ni.setCreated(object.getCreatedAt()); final List props = object.getProperties().stream().filter(p -> p.getName().equalsIgnoreCase("xml")) - .collect(Collectors.toList()); + .collect(Collectors.toList()); if (props != null && !props.isEmpty() && props.get(0) != null) { - ni.setProperties((Document) xmlConverter.convertDataValueToObjectValue(props.get(0).getValue(), null)); + ni.setProperties((Document) xmlConverter.convertToEntityAttribute(props.get(0).getValue())); } return ni; } @@ -106,13 +103,13 @@ public static NodeTemplateInstance convert(final NodeInstance object) { } else { nti = new NodeTemplateInstance(); nti.setTemplateType(object.getNodeType()); - nti.setTemplateId(object.getNodeTemplateID()); + nti.setTemplateId(object.getNodeTemplateName()); nti.setState(NodeTemplateInstanceState.INITIAL); if (object.getProperties() != null) { final NodeTemplateInstanceProperty prop = new NodeTemplateInstanceProperty(); prop.setName("xml"); prop.setType("xml"); - prop.setValue((String) xmlConverter.convertObjectValueToDataValue(object.getProperties(), null)); + prop.setValue((String) xmlConverter.convertToDatabaseColumn(object.getProperties())); nti.addProperty(prop); } if (object.getServiceInstance() != null) { @@ -122,21 +119,19 @@ public static NodeTemplateInstance convert(final NodeInstance object) { if (so.isPresent()) { nti.setServiceTemplateInstance(so.get()); } - } - catch (final Exception ex) { + } catch (final Exception ex) { ex.printStackTrace(); } } } - } - catch (final Exception e) { + } catch (final Exception e) { e.printStackTrace(); } return nti; } public static RelationInstance convert(final RelationshipTemplateInstance object) { - final RelationInstance ri = new RelationInstance(object.getTemplateId(), object.getTemplateId().getLocalPart(), + final RelationInstance ri = new RelationInstance(object.getTemplateId(), object.getTemplateId(), object.getTemplateType(), null /* ServiceInstance */, null /* Source NodeInstance */, null /* Target NodeInstance */); if (object.getId() != null) { @@ -165,9 +160,9 @@ public static RelationInstance convert(final RelationshipTemplateInstance object ri.setCreated(object.getCreatedAt()); final List props = object.getProperties().stream().filter(p -> p.getName().equalsIgnoreCase("xml")) - .collect(Collectors.toList()); + .collect(Collectors.toList()); if (props != null && !props.isEmpty() && props.get(0) != null) { - ri.setProperties((Document) xmlConverter.convertDataValueToObjectValue(props.get(0).getValue(), null)); + ri.setProperties((Document) xmlConverter.convertToEntityAttribute(props.get(0).getValue())); } return ri; } @@ -187,7 +182,7 @@ public static RelationshipTemplateInstance convert(final RelationInstance object final RelationshipTemplateInstanceProperty prop = new RelationshipTemplateInstanceProperty(); prop.setName("xml"); prop.setType("xml"); - prop.setValue((String) xmlConverter.convertObjectValueToDataValue(object.getProperties(), null)); + prop.setValue((String) xmlConverter.convertToDatabaseColumn(object.getProperties())); rti.addProperty(prop); } if (object.getSourceInstance() != null) { @@ -197,8 +192,7 @@ public static RelationshipTemplateInstance convert(final RelationInstance object if (no.isPresent()) { rti.setSource(no.get()); } - } - catch (final Exception ex) { + } catch (final Exception ex) { ex.printStackTrace(); } } @@ -209,14 +203,12 @@ public static RelationshipTemplateInstance convert(final RelationInstance object if (no.isPresent()) { rti.setTarget(no.get()); } - } - catch (final Exception ex) { + } catch (final Exception ex) { ex.printStackTrace(); } } } - } - catch (final Exception e) { + } catch (final Exception e) { e.printStackTrace(); } return rti; diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/DaoUtil.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/DaoUtil.java similarity index 100% rename from org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/DaoUtil.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/DaoUtil.java diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/NodeInstanceDAO.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/NodeInstanceDAO.java new file mode 100644 index 000000000..6d6ab8d93 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/NodeInstanceDAO.java @@ -0,0 +1,122 @@ +package org.opentosca.container.core.impl.persistence; + +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import org.opentosca.container.core.common.jpa.DocumentConverter; +import org.opentosca.container.core.model.instance.NodeInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstanceProperty; +import org.opentosca.container.core.next.model.NodeTemplateInstanceState; +import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; +import org.opentosca.container.core.next.utils.Enums; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; + +/** + * Data Access Object for NodeInstances + */ +public class NodeInstanceDAO { + + private static Logger logger = LoggerFactory.getLogger(NodeInstanceDAO.class); + + NodeTemplateInstanceRepository repository = new NodeTemplateInstanceRepository(); + + public void deleteNodeInstance(final NodeInstance si) { + try { + logger.info("NodeInstance: {}", si.toString()); + final Optional o = this.repository.find(DaoUtil.toLong(si.getId())); + if (o.isPresent()) { + final NodeTemplateInstance nti = o.get(); + nti.setState(NodeTemplateInstanceState.DELETED); + this.repository.update(nti); + this.repository.remove(nti); + logger.debug("Deleted NodeInstance with ID: " + si.getId()); + } else { + logger.info("NOT FOUND"); + } + } catch (final Exception e) { + logger.error("Could not delete node instance: {}", e.getMessage(), e); + e.printStackTrace(); + } + } + + public NodeInstance saveNodeInstance(final NodeInstance nodeInstance) { + try { + logger.info("NodeInstance: {}", nodeInstance.toString()); + final NodeTemplateInstance nti = Converters.convert(nodeInstance); + try { + this.repository.add(nti); + } catch (final Exception ex) { + logger.info("Object already added, trying to update"); + this.repository.update(nti); + } + return Converters.convert(nti); + } catch (final Exception e) { + logger.error("Could not save node instance: {}", e.getMessage(), e); + e.printStackTrace(); + } + return nodeInstance; + } + + /** + * this method wraps the setting/saving of the properties + */ + public void setProperties(final NodeInstance nodeInstance, final Document properties) { + try { + logger.info("NodeInstance: {}", nodeInstance.toString()); + final DocumentConverter converter = new DocumentConverter(); + final Optional o = this.repository.find(DaoUtil.toLong(nodeInstance.getId())); + if (o.isPresent()) { + final NodeTemplateInstance nti = o.get(); + if (properties != null) { + final String value = (String) converter.convertToDatabaseColumn(properties); + logger.info("XML: {}", value); + final NodeTemplateInstanceProperty prop = new NodeTemplateInstanceProperty(); + prop.setName("xml"); + prop.setType("xml"); + prop.setValue(value); + nti.addProperty(prop); + } + this.repository.update(nti); + } else { + logger.info("NOT FOUND"); + } + } catch (final Exception e) { + logger.error("Could not update node instance: {}", e.getMessage(), e); + e.printStackTrace(); + } + } + + /** + * this method wraps the setting/saving of the state + * + * @param state to be set + */ + public void setState(final NodeInstance nodeInstance, final String state) { + try { + logger.info("NodeInstance: {}", nodeInstance.toString()); + final Optional o = this.repository.find(DaoUtil.toLong(nodeInstance.getId())); + if (o.isPresent()) { + final NodeTemplateInstance nti = o.get(); + nti.setState(Enums.valueOf(NodeTemplateInstanceState.class, state, NodeTemplateInstanceState.ERROR)); + this.repository.update(nti); + } else { + logger.info("NOT FOUND"); + } + } catch (final Exception e) { + logger.error("Could not update node instance: {}", e.getMessage(), e); + e.printStackTrace(); + } + } + + @Deprecated + public List getNodeInstances(final URI serviceInstanceID, final String nodeTemplateID, + final String nodeTemplateName, final URI nodeInstanceID) { + logger.info("Not Implemented: Node instances cannot be queried"); + return new ArrayList<>(); + } +} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/RelationInstanceDAO.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/RelationInstanceDAO.java similarity index 93% rename from org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/RelationInstanceDAO.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/RelationInstanceDAO.java index 0c263a683..6e441f5a3 100644 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/persistence/RelationInstanceDAO.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/RelationInstanceDAO.java @@ -37,8 +37,7 @@ public void deleteRelationInstance(final RelationInstance si) { } else { logger.info("NOT FOUND"); } - } - catch (final Exception e) { + } catch (final Exception e) { logger.error("Could not delete relation instance: {}", e.getMessage(), e); e.printStackTrace(); } @@ -51,14 +50,12 @@ public RelationInstance saveRelationInstance(final RelationInstance relationInst final RelationshipTemplateInstance nti = Converters.convert(relationInstance); try { this.repository.add(nti); - } - catch (final Exception ex) { + } catch (final Exception ex) { logger.info("Object already added, trying to update"); this.repository.update(nti); } return Converters.convert(nti); - } - catch (final Exception e) { + } catch (final Exception e) { logger.error("Could not save relation instance: {}", e.getMessage(), e); e.printStackTrace(); } @@ -74,7 +71,7 @@ public void setProperties(final RelationInstance relationInstance, final Documen if (o.isPresent()) { final RelationshipTemplateInstance nti = o.get(); if (properties != null) { - final String value = (String) converter.convertObjectValueToDataValue(properties, null); + final String value = (String) converter.convertToDatabaseColumn(properties); logger.info("XML: {}", value); final RelationshipTemplateInstanceProperty prop = new RelationshipTemplateInstanceProperty(); prop.setName("xml"); @@ -86,8 +83,7 @@ public void setProperties(final RelationInstance relationInstance, final Documen } else { logger.info("NOT FOUND"); } - } - catch (final Exception e) { + } catch (final Exception e) { logger.error("Could not update relation instance: {}", e.getMessage(), e); e.printStackTrace(); } @@ -101,13 +97,12 @@ public void setState(final RelationInstance relationInstance, final String state if (o.isPresent()) { final RelationshipTemplateInstance nti = o.get(); nti.setState(Enums.valueOf(RelationshipTemplateInstanceState.class, state, - RelationshipTemplateInstanceState.ERROR)); + RelationshipTemplateInstanceState.ERROR)); this.repository.update(nti); } else { logger.info("NOT FOUND"); } - } - catch (final Exception e) { + } catch (final Exception e) { logger.error("Could not update relation instance: {}", e.getMessage(), e); e.printStackTrace(); } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/ServiceInstanceDAO.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/ServiceInstanceDAO.java new file mode 100644 index 000000000..1d88566c2 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/persistence/ServiceInstanceDAO.java @@ -0,0 +1,96 @@ +package org.opentosca.container.core.impl.persistence; + +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import javax.xml.namespace.QName; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.instance.ServiceInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; +import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; +import org.opentosca.container.core.next.utils.Enums; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ServiceInstanceDAO { + + private static final Logger logger = LoggerFactory.getLogger(ServiceInstanceDAO.class); + + ServiceTemplateInstanceRepository repository = new ServiceTemplateInstanceRepository(); + + public void deleteServiceInstance(final ServiceInstance si) { + try { + logger.info("ServiceInstance: {}", si.toString()); + final Optional o = this.repository.find(DaoUtil.toLong(si.getId())); + if (o.isPresent()) { + final ServiceTemplateInstance sti = o.get(); + sti.setState(ServiceTemplateInstanceState.DELETED); + this.repository.update(sti); + // repository.remove(sti); + logger.debug("Deleted ServiceInstance with ID: " + si.getId()); + } else { + logger.info("NOT FOUND"); + } + } catch (final Exception e) { + logger.error("Could not delete service instance: {}", e.getMessage(), e); + e.printStackTrace(); + } + } + + public ServiceInstance storeServiceInstance(final ServiceInstance serviceInstance) { + try { + logger.info("ServiceInstance: {}", serviceInstance.toString()); + final ServiceTemplateInstance sti = Converters.convert(serviceInstance); + try { + this.repository.add(sti); + } catch (final Exception ex) { + logger.info("Object already added, trying to update"); + this.repository.update(sti); + } + return Converters.convert(sti); + } catch (final Exception e) { + logger.error("Could not save node instance: {}", e.getMessage(), e); + e.printStackTrace(); + } + return serviceInstance; + } + + public List getServiceInstances(final URI serviceInstanceID, final String serviceTemplateName, + final QName serviceTemplateID) { + logger.info("Not Implemented: Service instances cannot be queried"); + return new ArrayList<>(); + } + + public List getServiceInstances(final CsarId csarId, final String serviceTemplateId, + final Integer serviceTemplateInstanceID) { + logger.info("Not Implemented: Service instances cannot be queried"); + return new ArrayList<>(); + } + + /** + * this method wraps the setting/saving of the state + * + * @param state to be set + */ + public void setState(final ServiceInstance serviceInstance, final String state) { + try { + logger.info("ServiceInstance: {}", serviceInstance.toString()); + final Optional o = this.repository.find(DaoUtil.toLong(serviceInstance.getId())); + if (o.isPresent()) { + final ServiceTemplateInstance sti = o.get(); + sti.setState(Enums.valueOf(ServiceTemplateInstanceState.class, state, + ServiceTemplateInstanceState.ERROR)); + this.repository.update(sti); + } else { + logger.info("NOT FOUND"); + } + } catch (final Exception e) { + logger.error("Could not update service instance: {}", e.getMessage(), e); + e.printStackTrace(); + } + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CoreCapabilityServiceImpl.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CoreCapabilityServiceImpl.java new file mode 100644 index 000000000..0cea2d27a --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CoreCapabilityServiceImpl.java @@ -0,0 +1,113 @@ +package org.opentosca.container.core.impl.service; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import javax.persistence.EntityManager; +import javax.persistence.TypedQuery; + +import org.opentosca.container.core.model.capability.Capability; +import org.opentosca.container.core.model.capability.provider.ProviderType; +import org.opentosca.container.core.next.jpa.EntityManagerProvider; +import org.opentosca.container.core.service.ICoreCapabilityService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * This class stores, gets and deletes capabilities of different provider and provider types in/from a SQL database. The + * IAEngine needs this capabilities to decide if a Implementation Artifact should be deployed or not. + * + *
    + * Copyright 2012 IAAS University of Stuttgart
    + *
    + * + * @author Michael Zimmermann - zimmerml@studi.informatik.uni-stuttgart.de + * @see ProviderType + */ +@Service +public class CoreCapabilityServiceImpl implements ICoreCapabilityService { + private static final Logger LOG = LoggerFactory.getLogger(CoreCapabilityServiceImpl.class); + + private final EntityManager em; + + public CoreCapabilityServiceImpl() { + this.em = EntityManagerProvider.createEntityManager(); + // TRUNCATE capabilites table because startup will correctly register the capabilities + em.getTransaction().begin(); + em.createNativeQuery("TRUNCATE TABLE " + Capability.TABLE_NAME).executeUpdate(); + em.getTransaction().commit(); + } + + @Override + /** + * {@inheritDoc} + */ + public void storeCapabilities(final List capabilities, final String providerName, + final ProviderType providerType) { + LOG.debug("Storing \"{}\" capabilities of \"{}\" ...", providerType, providerName); + em.getTransaction().begin(); + + for (String capability : capabilities) { + Capability entity = new Capability(capability, providerName, providerType); + em.persist(entity); + } + em.getTransaction().commit(); + } + + @Override + /** + * {@inheritDoc} + */ + public Map> getCapabilities(final ProviderType providerType) { + LOG.debug("Getting \"{}\" capabilities...", providerType); + em.getTransaction().begin(); + + TypedQuery query = em.createNamedQuery(Capability.byProviderType, Capability.class); + query.setParameter("providerType", providerType); + + Map> capabilitiesMap = query.getResultList().stream() + .collect(Collectors.groupingBy(Capability::getProviderName, Collectors.mapping(Capability::getCapability, Collectors.toList()))); + + LOG.debug("Getting \"{}\" capabilities successfully completed.", providerType); + em.getTransaction().commit(); + return capabilitiesMap; + } + + @Override + /** + * {@inheritDoc} + */ + public List getCapabilities(final String providerName, final ProviderType providerType) { + LOG.debug("Getting \"{}\" capabilities of \"{}\"...", providerType, providerName); + em.getTransaction().begin(); + + TypedQuery query = em.createNamedQuery(Capability.byProvider, Capability.class); + query.setParameter("providerType", providerType); + query.setParameter("providerName", providerName); + + final List capabilities = query.getResultList().stream() + .map(Capability::getCapability).collect(Collectors.toList()); + + LOG.debug("Getting \"{}\" capabilities of \"{}\" successfully completed.", providerType, providerName); + em.getTransaction().commit(); + return capabilities; + } + + @Override + /** + * {@inheritDoc} + */ + public void deleteCapabilities(final String providerName) { + LOG.debug("Deleting capabilities of \"{}\" ...", providerName); + em.getTransaction().begin(); + TypedQuery query = em.createNamedQuery(Capability.byProvider, Capability.class); + query.setParameter("providerName", providerName); + for (ProviderType providerType : ProviderType.values()) { + query.setParameter("providerType", providerType); + query.getResultList().forEach(em::remove); + } + em.getTransaction().commit(); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CoreEndpointServiceImpl.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CoreEndpointServiceImpl.java new file mode 100644 index 000000000..8992783fc --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CoreEndpointServiceImpl.java @@ -0,0 +1,314 @@ +package org.opentosca.container.core.impl.service; + +import java.net.URI; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; +import javax.persistence.NonUniqueResultException; +import javax.persistence.TypedQuery; +import javax.xml.namespace.QName; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint; +import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint.restMethod; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; +import org.opentosca.container.core.next.jpa.EntityManagerProvider; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * This Class stores and retrieves Endpoint-Objects in the Database, using Eclipse-JPA. + *

    + * For the JPA-Queries refer to: {@link RESTEndpoint}, {@link WSDLEndpoint} + */ +@Service +public class CoreEndpointServiceImpl implements ICoreEndpointService, AutoCloseable { + private final static Logger LOG = LoggerFactory.getLogger(CoreEndpointServiceImpl.class); + + private EntityManager em; + + public CoreEndpointServiceImpl() { + em = EntityManagerProvider.createEntityManager(); + } + + @Override + /** + * {@Inheritdoc} + */ + public List getWSDLEndpoints(final QName portType, final String triggeringContainer, + final CsarId csarId) { + final ArrayList results = new ArrayList<>(); + + final TypedQuery getWSDLEndpointsQuery = em.createQuery("SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.csarId = :csarId and e.PortType = :portType", WSDLEndpoint.class); + + // Set Parameters for the Query + getWSDLEndpointsQuery.setParameter("portType", portType); + getWSDLEndpointsQuery.setParameter("triggeringContainer", triggeringContainer); + getWSDLEndpointsQuery.setParameter("csarId", csarId); + + // Get Query-Results (WSDLEndpoints) and add them to the result list. + final List queryResults = getWSDLEndpointsQuery.getResultList(); + for (final WSDLEndpoint endpoint : queryResults) { + results.add(endpoint); + } + + // Hack, to get endpoints stored from the container e.g. the SI-Invoker + // endpoint. + // Set Parameters for the Query + getWSDLEndpointsQuery.setParameter("portType", portType); + getWSDLEndpointsQuery.setParameter("csarId", new CsarId("")); + + // Get Query-Results (WSDLEndpoints) and add them to the result list. + final List queryResults2 = getWSDLEndpointsQuery.getResultList(); + for (final WSDLEndpoint endpoint : queryResults2) { + results.add(endpoint); + } + + return results; + } + + @Override + /** + * {@Inheritdoc} + */ + public void storeWSDLEndpoint(final WSDLEndpoint endpoint) { + + // TODO this check is a hack because of the problem with deploying of multiple deployment artifacts + if (!existsWSDLEndpoint(endpoint)) { + if (!this.em.getTransaction().isActive()) { + this.em.getTransaction().begin(); + } + LOG.debug("The endpoint for \"{}\" is not stored. Thus store it.", endpoint.getPortType()); + this.em.persist(endpoint); + this.em.getTransaction().commit(); + } else { + LOG.debug("The endpoint for \"{}\" is stored already.", endpoint.getPortType()); + } + } + + /** + * Helper method to check if a given WSDLEndpoint is already stored in the database + * + * @param endpoint to look for + * @return true, if the Endpoint already exists. + */ + private boolean existsWSDLEndpoint(final WSDLEndpoint endpoint) { + TypedQuery findQuery = + em.createQuery("SELECT e from WSDLEndpoint e where e.PortType = :portType " + + "and e.csarId = :csarId and e.managingContainer = :managingContainer " + + "and e.serviceTemplateInstanceID = :serviceTemplateInstanceID and e.PlanId = :planId", WSDLEndpoint.class); + findQuery.setParameter("portType", endpoint.getPortType()); + findQuery.setParameter("csarId", endpoint.getCsarId()); + findQuery.setParameter("managingContainer", endpoint.getManagingContainer()); + findQuery.setParameter("serviceTemplateInstanceID", endpoint.getServiceTemplateInstanceID()); + findQuery.setParameter("planId", endpoint.getPlanId()); + + try { + @SuppressWarnings("unused") + WSDLEndpoint dbResult = findQuery.getSingleResult(); + return true; + } catch (NoResultException | NonUniqueResultException umm) { + // maybe return true if result is not unique? + return false; + } + } + + @Override + /** + * {@Inheritdoc} + */ + public List getRestEndpoints(final URI anyURI, String triggeringContainer, final CsarId csarId) { + final ArrayList results = new ArrayList<>(); + + /** + * Create Query to retrieve RESTEndpoints identified by a URI and thorID + * + * @see RESTEndpoint#getEndpointForPath + **/ + final TypedQuery getRestEndpointsQuery = this.em.createNamedQuery(RESTEndpoint.getEndpointForPath, RESTEndpoint.class); + + // Set Parameters + getRestEndpointsQuery.setParameter("path", anyURI.getPath()); + getRestEndpointsQuery.setParameter("triggeringContainer", triggeringContainer); + getRestEndpointsQuery.setParameter("csarId", csarId); + + // Get Query-Results and add them to the result list + final + // Result can only be a RESTEndpoint + List queryResults = getRestEndpointsQuery.getResultList(); + for (final RESTEndpoint endpoint : queryResults) { + results.add(endpoint); + } + return results; + } + + @Override + /** + * {@Inheritdoc} + */ + public RESTEndpoint getRestEndpoint(final URI anyURI, final restMethod method, String triggeringContainer, final CsarId csarId) { + /** + * Create Query to retrieve a RestEndpoint + * + * @see RESTEndpoint#getEndpointForPathAndMethod + */ + final TypedQuery getRestEndpointQuery = this.em.createNamedQuery(RESTEndpoint.getEndpointForPathAndMethod, RESTEndpoint.class); + + // Set parameters + getRestEndpointQuery.setParameter("path", anyURI.getPath()); + getRestEndpointQuery.setParameter("triggeringContainer", triggeringContainer); + getRestEndpointQuery.setParameter("method", method); + getRestEndpointQuery.setParameter("csarId", csarId); + + // As a RESTEndpoint identified by URI, RestMethod and thorID + // is unique, we only return one result (there cannot be more) + return getRestEndpointQuery.getSingleResult(); + } + + @Override + /** + * {@Inheritdoc} + */ + public void storeRESTEndpoint(final RESTEndpoint endpoint) { + LOG.debug("Storing REST Endpoint with Path : \"{}\", STID: \"{}\"", endpoint.getPath(), endpoint.getCsarId()); + if (!this.em.getTransaction().isActive()) { + this.em.getTransaction().begin(); + } + this.em.persist(endpoint); + this.em.getTransaction().commit(); + } + + @Override + public WSDLEndpoint getWSDLEndpointForPlanId(String triggeringContainer, final CsarId csarId, final QName planId) { + WSDLEndpoint endpoint = null; + final TypedQuery queryWSDLEndpoint = em.createQuery("SELECT e FROM WSDLEndpoint e where e.csarId= :csarId and e.PlanId = :planId and e.triggeringContainer = :triggeringContainer", WSDLEndpoint.class); + queryWSDLEndpoint.setParameter("csarId", csarId); + queryWSDLEndpoint.setParameter("triggeringContainer", triggeringContainer); + queryWSDLEndpoint.setParameter("planId", planId); + + try { + endpoint = queryWSDLEndpoint.getSingleResult(); + } catch (final NoResultException e) { + LOG.error("Query in database didn't return a result", e); + return null; + } + + return endpoint; + } + + @Override + public WSDLEndpoint getWSDLEndpointForIa(final CsarId csarId, final QName nodeTypeImpl, final String iaName) { + WSDLEndpoint endpoint = null; + final TypedQuery queryWSDLEndpoint = em.createQuery( + "SELECT e FROM WSDLEndpoint e where e.csarId= :csarId and e.IaName = :IaName and e.TypeImplementation = :nodeTypeImpl", WSDLEndpoint.class); + queryWSDLEndpoint.setParameter("csarId", csarId); + queryWSDLEndpoint.setParameter("IaName", iaName); + queryWSDLEndpoint.setParameter("nodeTypeImpl", nodeTypeImpl); + + try { + endpoint = (WSDLEndpoint) queryWSDLEndpoint.getSingleResult(); + } catch (final NoResultException e) { + LOG.info("No endpoint stored for requested IA."); + } + return endpoint; + } + + @Override + public List getWSDLEndpointsForCsarId(String triggeringContainer, final CsarId csarId) { + final List endpoints = new ArrayList<>(); + final TypedQuery queryWSDLEndpoint = this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.csarId= :csarId and e.triggeringContainer = :triggeringContainer", WSDLEndpoint.class); + queryWSDLEndpoint.setParameter("csarId", csarId); + queryWSDLEndpoint.setParameter("triggeringContainer", triggeringContainer); + + final List queryResults = queryWSDLEndpoint.getResultList(); + for (final WSDLEndpoint endpoint : queryResults) { + endpoints.add(endpoint); + } + + return endpoints; + } + + @Override + public List getWSDLEndpointsForNTImplAndIAName(String triggeringContainer, String managingContainer, final QName nodeTypeImpl, final String iaName) { + final List endpoints = new ArrayList<>(); + final TypedQuery queryWSDLEndpoint = this.em.createQuery( + "SELECT e FROM WSDLEndpoint e where e.IaName = :IaName and e.TypeImplementation = :nodeTypeImpl and e.triggeringContainer = :triggeringContainer and e.managingContainer = :managingContainer", WSDLEndpoint.class); + queryWSDLEndpoint.setParameter("IaName", iaName); + queryWSDLEndpoint.setParameter("nodeTypeImpl", nodeTypeImpl); + queryWSDLEndpoint.setParameter("triggeringContainer", triggeringContainer); + queryWSDLEndpoint.setParameter("managingContainer", managingContainer); + + final List queryResults = queryWSDLEndpoint.getResultList(); + for (final WSDLEndpoint endpoint : queryResults) { + endpoints.add(endpoint); + } + + return endpoints; + } + + @Override + public List getWSDLEndpoints() { + final List endpoints = new ArrayList<>(); + final TypedQuery queryWSDLEndpoint = this.em.createQuery("SELECT e FROM WSDLEndpoint e", WSDLEndpoint.class); + + final List queryResults = queryWSDLEndpoint.getResultList(); + for (final WSDLEndpoint endpoint : queryResults) { + endpoints.add(endpoint); + } + + return endpoints; + } + + @Override + public void printPlanEndpoints() { + List endpoints = null; + final TypedQuery queryWSDLEndpoint = this.em.createQuery("SELECT e FROM WSDLEndpoint e", WSDLEndpoint.class); + + endpoints = queryWSDLEndpoint.getResultList(); + + final StringBuilder builder = new StringBuilder(); + final String ls = System.getProperty("line.separator"); + builder.append( + "debug output for stored endpoints of management plans, flags: csarid, planid, ianame, porttype " + ls); + for (final WSDLEndpoint endpoint : endpoints) { + builder.append("endpoint: " + endpoint.getCsarId() + " " + endpoint.getPlanId() + " " + endpoint.getIaName() + + " " + endpoint.getPortType() + ls); + } + LOG.debug(builder.toString()); + } + + @Override + public boolean removeWSDLEndpoint(final WSDLEndpoint endpoint) { + if (!this.em.getTransaction().isActive()) { + this.em.getTransaction().begin(); + } + this.em.remove(endpoint); + this.em.getTransaction().commit(); + return true; + } + + @Override + public List getWSDLEndpointsForSTID(String triggeringContainer, Long serviceTemplateInstanceID) { + final List endpoints = new ArrayList<>(); + final TypedQuery queryWSDLEndpoint = + this.em.createQuery("SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.serviceTemplateInstanceID= :serviceTemplateInstanceID", WSDLEndpoint.class); + queryWSDLEndpoint.setParameter("triggeringContainer", triggeringContainer); + queryWSDLEndpoint.setParameter("serviceTemplateInstanceID", serviceTemplateInstanceID); + + final List queryResults = queryWSDLEndpoint.getResultList(); + for (final WSDLEndpoint endpoint : queryResults) { + endpoints.add(endpoint); + } + + return endpoints; + } + + @Override + public void close() { + em.close(); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CsarStorageServiceImpl.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CsarStorageServiceImpl.java new file mode 100644 index 000000000..85bd314eb --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/CsarStorageServiceImpl.java @@ -0,0 +1,236 @@ +package org.opentosca.container.core.impl.service; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.util.HashSet; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; + +import org.eclipse.winery.accountability.exceptions.AccountabilityException; +import org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration; +import org.eclipse.winery.common.ids.definitions.ServiceTemplateId; +import org.eclipse.winery.repository.backend.RepositoryFactory; +import org.eclipse.winery.repository.backend.filebased.FileUtils; +import org.eclipse.winery.repository.importing.CsarImportOptions; +import org.eclipse.winery.repository.importing.CsarImporter; +import org.eclipse.winery.repository.importing.ImportMetaInformation; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.csar.CsarImpl; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +@Service +@NonNullByDefault +public class CsarStorageServiceImpl implements CsarStorageService { + + private static final Logger LOGGER = LoggerFactory.getLogger(CsarStorageServiceImpl.class); + + private static final Object repositoryFactoryConfigurationMutex = new Object(); + + private final Path basePath; + + public CsarStorageServiceImpl() { + try { + Files.createDirectories(Settings.CONTAINER_STORAGE_BASEPATH); + } catch (IOException e) { + LOGGER.error("Could not set up storage for Csars", e); + throw new ExceptionInInitializerError(e); + } + basePath = Settings.CONTAINER_STORAGE_BASEPATH; + } + + public CsarStorageServiceImpl(Path basePath) { + try { + Files.createDirectories(basePath); + } catch (IOException e) { + LOGGER.error("Could not set up storage for Csars", e); + throw new ExceptionInInitializerError(e); + } + this.basePath = basePath; + } + + @Override + public Set findAll() { + LOGGER.debug("Requesting all CSARs"); + final Set csars = new HashSet<>(); + try { + for (@NonNull Path csarId : Files.newDirectoryStream(basePath, Files::isDirectory)) { + // FIXME make CsarId a name and put the path somewhere else + csars.add(new CsarImpl(new CsarId(csarId.getFileName().toString()), csarId)); + } + } catch (IOException e) { + LOGGER.error("Error when traversing '{}' for CSARs", basePath); + throw new UncheckedIOException(e); + } + return csars; + } + + @Override + public Csar findById(CsarId id) throws NoSuchElementException { + Path predictedSaveLocation = basePath.resolve(id.csarName()); + if (Files.exists(predictedSaveLocation)) { + return new CsarImpl(id, predictedSaveLocation); + } + LOGGER.info("CSAR '{}' could not be found", id.csarName()); + throw new NoSuchElementException(); + } + + @Override + @Nullable + public Path storeCSARTemporarily(String filename, InputStream is) { + try { + Path tempLocation = Paths.get(System.getProperty("java.io.tmpdir"), filename); + if (Files.exists(tempLocation)) { + // well ... umm ... let's just delete it, I guess? + Files.delete(tempLocation); + } + Files.copy(is, tempLocation); + return tempLocation; + } catch (IOException e) { + LOGGER.error("Exception occured when writing temporary CSAR file: {}", e.getMessage(), e); + return null; + } + } + + @Override + public CsarId storeCSAR(Path csarLocation) throws UserException, SystemException { + LOGGER.debug("Given file to store: {}", csarLocation); + if (!Files.isRegularFile(csarLocation)) { + throw new UserException( + "\"" + csarLocation.toString() + "\" to store is not an absolute path to an existing file."); + } + + CsarId candidateId = new CsarId(csarLocation.getFileName().toString()); + Path permanentLocation = basePath.resolve(csarLocation.getFileName()); + if (Files.exists(permanentLocation)) { + throw new UserException( + "CSAR \"" + candidateId.csarName() + "\" is already stored. Overwriting a CSAR is not allowed."); + } + ImportMetaInformation importInfo = null; + try { + Files.createDirectory(permanentLocation); + synchronized (repositoryFactoryConfigurationMutex) { + // CsarImporter doesn't allow overriding the repository it imports to + // therefore we need to reconfigure the RepositoryFactory to overwrite the target location + // That configuration must not be changed in a different thread during the import process + RepositoryFactory.reconfigure(new FileBasedRepositoryConfiguration(permanentLocation)); + + CsarImporter importer = new CsarImporter(); + final CsarImportOptions importOptions = new CsarImportOptions(); + importOptions.setValidate(false); // avoid triggering accountability meddling with this + importOptions.setAsyncWPDParsing(true); + importOptions.setOverwrite(false); + importInfo = importer.readCSAR(Files.newInputStream(csarLocation), importOptions); + } + if (!importInfo.errors.isEmpty()) { + throw new UserException("Importing the csar failed with errors: " + importInfo.errors.stream().collect(Collectors.joining(System.lineSeparator()))); + } + } catch (IOException e) { + // roll back the import + FileUtils.forceDelete(permanentLocation); + throw new UserException("CSAR \"" + candidateId.csarName() + "\" could not be imported.", e); + } catch (AccountabilityException e) { + LOGGER.debug("Accountability for imported CSAR could not be checked", e); + FileUtils.forceDelete(permanentLocation); + throw new UserException("CSAR \"" + candidateId.csarName() + "\" could not be imported.", e); + } catch (ExecutionException | InterruptedException e) { + LOGGER.warn("CSAR Import was interrupted or terminated with an exception", e); + FileUtils.forceDelete(permanentLocation); + throw new UserException("CSAR \"" + candidateId.csarName() + "\" could not be imported.", e); + } catch (Throwable e) { + LOGGER.warn("CSAR Import failed with an unspecified exception", e); + FileUtils.forceDelete(permanentLocation); + if (e instanceof RuntimeException || e instanceof Error) { + throw e; + } + throw new UserException("CSAR \"" + candidateId.csarName() + "\" could not be imported.", e); + } + assert (importInfo != null); + // if (importInfo == null || !importInfo.errors.isEmpty()) { + // LOGGER.info("Import failed with information ", importInfo); + // throw new UserException("CSAR \"" + candidateId.csarName() + "\" could not be imported: "); + // } + // apparently there will always be an EntryServiceTemplate?? + ServiceTemplateId entryServiceTemplate = importInfo.entryServiceTemplate; + // we may be able to "guarantee" it's not null, since we validate CSARs on import + if (entryServiceTemplate == null) { + return candidateId; + } + // FIXME don't store this in the winery repo location. Use some database for this! + try (OutputStream os = Files.newOutputStream(permanentLocation.resolve(CsarImpl.ENTRY_SERVICE_TEMPLATE_LOCATION), StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW)) { + os.write(entryServiceTemplate.getQName().toString().getBytes(StandardCharsets.UTF_8)); + } catch (IOException e) { + // well... we failed to keep track of the entryServiceTemplate + LOGGER.warn("Could not save EntryServiceTemplate for Csar [{}] due to {}", candidateId.csarName(), e); + throw new UserException("CSAR \"" + candidateId.csarName() + "\" could not be imported."); + } + LOGGER.info("Successfully stored Csar as {}", candidateId.csarName()); + return candidateId; + } + + @Override + public void deleteCSAR(CsarId csarId) throws SystemException, UserException { + LOGGER.debug("Deleting CSAR \"{}\"...", csarId.csarName()); + FileUtils.forceDelete(basePath.resolve(csarId.csarName())); + } + + @Override + public void purgeCsars() throws SystemException { + LOGGER.debug("Deleting all CSARs..."); + try { + for (Path csarRepoContent : Files.newDirectoryStream(basePath)) { + LOGGER.debug("Deleting CSAR at [{}]", csarRepoContent); + if (Files.isDirectory(csarRepoContent)) { + // delete csar here + FileUtils.forceDelete(csarRepoContent); + } + } + LOGGER.debug("Deleting all CSARs completed"); + } catch (IOException e) { + throw new SystemException("Could not delete all CSARs.", e); + } + } + + @Override + public Path exportCSAR(final CsarId csarId) throws UserException, SystemException { + LOGGER.debug("Exporting CSAR \"{}\"...", csarId.csarName()); + Csar csar = findById(csarId); + + final Path csarDownloadDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "content"); + try { + // only create temp directory if it doesn't exist + if (!Files.exists(csarDownloadDirectory)) { + Files.createDirectory(csarDownloadDirectory); + } + final Path csarTarget = csarDownloadDirectory.resolve(csarId.csarName()); + if (Files.exists(csarTarget)) { + // remove previous export result + FileUtils.forceDelete(csarTarget); + } + csar.exportTo(csarTarget); + LOGGER.info("Successfully exported CSAR to {}", csarTarget); + return csarTarget; + } catch (final IOException e) { + throw new SystemException("An IO Exception occured.", e); + } + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/DeploymentTrackerImpl.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/DeploymentTrackerImpl.java new file mode 100644 index 000000000..14fff03fc --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/DeploymentTrackerImpl.java @@ -0,0 +1,247 @@ +package org.opentosca.container.core.impl.service; + +import java.util.Collection; + +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; +import javax.persistence.NonUniqueResultException; +import javax.persistence.TypedQuery; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.deployment.ia.IADeploymentInfo; +import org.opentosca.container.core.model.deployment.ia.IADeploymentState; +import org.opentosca.container.core.model.deployment.plan.PlanDeploymentInfo; +import org.opentosca.container.core.model.deployment.plan.PlanDeploymentState; +import org.opentosca.container.core.model.deployment.process.DeploymentProcessInfo; +import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; +import org.opentosca.container.core.next.jpa.EntityManagerProvider; +import org.opentosca.container.core.service.DeploymentTracker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +@Service +public class DeploymentTrackerImpl implements DeploymentTracker, AutoCloseable { + + private static final Logger LOGGER = LoggerFactory.getLogger(DeploymentTrackerImpl.class); + + private final EntityManager em = EntityManagerProvider.createEntityManager(); + + public DeploymentTrackerImpl() { + } + + @Override + public synchronized void storeDeploymentState(CsarId csar, DeploymentProcessState state) { + LOGGER.trace("Storing deployment state {} for Csar {}.", state, csar.csarName()); + em.getTransaction().begin(); + + final DeploymentProcessInfo currentInformation = getDeploymentInfo(csar); + if (currentInformation == null) { + em.persist(new DeploymentProcessInfo(csar, state)); + } else { + currentInformation.setDeploymentProcessState(state); + em.persist(currentInformation); + } + em.getTransaction().commit(); + LOGGER.debug("Completed storing deployment state {} for Csar {}", state, csar.csarName()); + } + + @Override + public synchronized DeploymentProcessState getDeploymentState(CsarId csar) { + final DeploymentProcessInfo info = getDeploymentInfo(csar); + if (info == null) { + LOGGER.warn("No deployment state for Csar {} found", csar.csarName()); + return null; + } + LOGGER.trace("Deployment state of Csar {} is {}", csar.csarName(), info.getDeploymentProcessState()); + return info.getDeploymentProcessState(); + } + + private synchronized DeploymentProcessInfo getDeploymentInfo(CsarId csar) { + LOGGER.trace("Retrieving deployment information for Csar {} from database", csar.csarName()); + final TypedQuery select = em.createNamedQuery(DeploymentProcessInfo.getDeploymentProcessInfoByCSARID, DeploymentProcessInfo.class); + select.setParameter("csarID", csar); + try { + return select.getSingleResult(); + } catch (NoResultException e) { + LOGGER.debug("No deployment information associated with Csar {} found", csar.csarName()); + return null; + } catch (NonUniqueResultException e) { + LOGGER.warn("Multiple deployment information results found for Csar {}", csar.csarName()); + return null; + } + } + + @Override + public synchronized void storeIADeploymentInfo(IADeploymentInfo info) { + LOGGER.trace("Storing deployment state {} for IA \"{}\" of CSAR \"{}\"...", + info.getDeploymentState(), info.getRelPath(), info.getCsarID().csarName()); + em.getTransaction().begin(); + + // check if deployment info for this IA already exists + final IADeploymentInfo storedIA = getIADeploymentInfo(info.getCsarID(), info.getRelPath()); + + // deployment info already exists + if (storedIA != null) { + LOGGER.info("Updating IA deployment info for IA [{}] of CSAR [{}].", info.getRelPath(), info.getCsarID().csarName()); + + final IADeploymentState storedIADeployState = storedIA.getDeploymentState(); + final IADeploymentState newIADeployState = info.getDeploymentState(); + + // if IA is deployed and will be now undeployed, reset the attempt counter to 0 + if (storedIADeployState.equals(IADeploymentState.IA_DEPLOYED) + && newIADeployState.equals(IADeploymentState.IA_UNDEPLOYING)) { + LOGGER.trace("Deployed IA [{}] of CSAR [{}] is now undeploying. Resetting attempt count.", info.getRelPath(), info.getCsarID().csarName()); + storedIA.setAttempt(0); + } + storedIA.setDeploymentState(newIADeployState); + info = storedIA; + } + + // if IA is now deploying or undeploying, increment attempt counter + if (info.getDeploymentState().equals(IADeploymentState.IA_DEPLOYING) + || info.getDeploymentState().equals(IADeploymentState.IA_UNDEPLOYING)) { + LOGGER.trace("IA [{}] of CSAR [{}] is now deploying / undeploying. Incrementing attempt count.", info.getRelPath(), info.getCsarID()); + info.setAttempt(info.getAttempt() + 1); + } + + this.em.persist(info); + this.em.getTransaction().commit(); + LOGGER.debug("Stored deployment state {} for IA [{}] of CSAR [{}].", info.getDeploymentState(), info.getRelPath(), info.getCsarID().csarName()); + } + + @Override + public synchronized void storeIADeploymentInfo(CsarId csar, String iaRelPath, IADeploymentState deploymentState) { + storeIADeploymentInfo(new IADeploymentInfo(csar, iaRelPath, deploymentState)); + } + + // FIXME do not return IADeploymentInfo. Attempts are only used internally. + // Instead return the DeploymentState of a compound key encapsulating CsarId and RelPath + @Override + public synchronized IADeploymentInfo getIADeploymentInfo(CsarId csar, String iaRelPath) { + LOGGER.trace("Retrieving IA Deployment info for IA [{}] in Csar {}", iaRelPath, csar.csarName()); + final TypedQuery select = em.createNamedQuery(IADeploymentInfo.getIADeploymentInfoByCSARIDAndRelPath, IADeploymentInfo.class); + select.setParameter("iaRelPath", iaRelPath); + select.setParameter("csarID", csar); + try { + return select.getSingleResult(); + } catch (NoResultException e) { + return null; + } catch (NonUniqueResultException e) { + LOGGER.warn("More than one IA deployment information stored for IA [{}] of Csar {}", iaRelPath, csar.csarName()); + return null; + } + } + + @Override + public synchronized Collection getIADeployments(CsarId csar) { + LOGGER.trace("Retrieving IA Deployment info for all IAs in Csar {}", csar.csarName()); + final TypedQuery select = em.createNamedQuery(IADeploymentInfo.getIADeploymentInfoByCSARID, IADeploymentInfo.class); + select.setParameter("csarID", csar); + return select.getResultList(); + } + + @Override + public synchronized void storePlanDeploymentInfo(PlanDeploymentInfo info) { + LOGGER.trace("Storing deployment state {} for Plan [{}] of Csar {}", info.getDeploymentState(), info.getRelPath(), info.getCsarID().csarName()); + this.em.getTransaction().begin(); + + // check if deployment info for this Plan already exists + final PlanDeploymentInfo storedPlan = this.getPlanDeploymentInfo(info.getCsarID(), info.getRelPath()); + // deployment info already exists + if (storedPlan != null) { + LOGGER.debug("Overwriting Plan deployment info for Plan [{}] of Csar [{}].", info.getRelPath(), info.getCsarID().csarName()); + + final PlanDeploymentState storedPlanDeployState = storedPlan.getDeploymentState(); + final PlanDeploymentState newPlanDeployState = info.getDeploymentState(); + + // if Plan is deployed and will be now undeployed, reset the attempt counter to 0 + if (storedPlanDeployState.equals(PlanDeploymentState.PLAN_DEPLOYED) + && newPlanDeployState.equals(PlanDeploymentState.PLAN_UNDEPLOYING)) { + LOGGER.debug("Deployed Plan [{}] of Csar [{}] is now undeploying. Resetting attempt count.", info.getRelPath(), info.getCsarID().csarName()); + storedPlan.setAttempt(0); + } + + storedPlan.setDeploymentState(newPlanDeployState); + info = storedPlan; + } + + // if Plan is now deploying or undeploying, increment attempt counter + if (info.getDeploymentState().equals(PlanDeploymentState.PLAN_DEPLOYING) + || info.getDeploymentState().equals(PlanDeploymentState.PLAN_UNDEPLOYING)) { + LOGGER.debug("Plan [{}] of CSAR [{}] is now deploying / undeploying. Increase attempt count.", info.getRelPath(), info.getCsarID().csarName()); + info.setAttempt(info.getAttempt() + 1); + } + + this.em.persist(info); + this.em.getTransaction().commit(); + + LOGGER.info("Stored deployment state {} for Plan [{}] of Csar [{}].", info.getDeploymentState(), info.getRelPath(), info.getCsarID().csarName()); + } + + @Override + public synchronized void storePlanDeploymentInfo(CsarId csar, String planRelPath, PlanDeploymentState deploymentState) { + storePlanDeploymentInfo(new PlanDeploymentInfo(csar, planRelPath, deploymentState)); + } + + @Override + public synchronized PlanDeploymentInfo getPlanDeploymentInfo(CsarId csar, String planRelPath) { + LOGGER.trace("Retrieving plan deployment information for plan [{}] in Csar {}", planRelPath, csar.csarName()); + final TypedQuery select = em.createNamedQuery(PlanDeploymentInfo.getPlanDeploymentInfoByCSARIDAndRelPath, PlanDeploymentInfo.class); + select.setParameter("csarID", csar); + select.setParameter("planRelPath", planRelPath); + try { + return select.getSingleResult(); + } catch (NoResultException e) { + return null; + } catch (NonUniqueResultException e) { + LOGGER.warn("More than one plan deployment information stored for Plan [{}] in Csar {}", planRelPath, csar.csarName()); + return null; + } + } + + @Override + public synchronized Collection getPlanDeployments(CsarId csar) { + LOGGER.trace("Retrieving plan deployment information for all plans in Csar {}", csar.csarName()); + final TypedQuery select = em.createNamedQuery(PlanDeploymentInfo.getPlanDeploymentInfoByCSARID, PlanDeploymentInfo.class); + select.setParameter("csarID", csar); + return select.getResultList(); + } + + @Override + public synchronized void deleteDeploymentState(CsarId csar) { + LOGGER.info("Deleting all deployment state associated with Csar {}", csar.csarName()); + em.getTransaction().begin(); + try { + final Collection iaDeployments = getIADeployments(csar); + LOGGER.trace("Marking {} IA deployments for removal", iaDeployments.size()); + for (IADeploymentInfo iaInfo : iaDeployments) { + em.remove(iaInfo); + } + final Collection planDeployments = getPlanDeployments(csar); + LOGGER.trace("Marking {} Plan deployments for removal", planDeployments.size()); + for (PlanDeploymentInfo planInfo : planDeployments) { + em.remove(planInfo); + } + final DeploymentProcessInfo csarInfo = getDeploymentInfo(csar); + LOGGER.trace("Marking Csar for removal"); + if (csarInfo != null) { + em.remove(csarInfo); + } + em.getTransaction().commit(); + } catch (Exception e) { + em.getTransaction().setRollbackOnly(); + throw e; + } finally { + if (em.getTransaction().getRollbackOnly()) { + em.getTransaction().rollback(); + } + } + LOGGER.trace("Marked changes have been persisted"); + } + + @Override + public void close() throws Exception { + em.close(); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/FileSystem.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/FileSystem.java new file mode 100644 index 000000000..1fb8fce47 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/FileSystem.java @@ -0,0 +1,167 @@ +package org.opentosca.container.core.impl.service; + +import java.io.IOException; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.FileSystems; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardOpenOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static java.nio.file.FileVisitResult.CONTINUE; + +@NonNullByDefault +public class FileSystem { + + private static final Path FS_TEMP = Paths.get(System.getProperty("java.io.tmpdir")); + private static final Logger LOG = LoggerFactory.getLogger(FileSystem.class); + + /** + * Creates a ready-to-use directory that previously did not exist. + * + * @return A {@link Path} pointing towards a folder within the system-designated temporary directory as indicated by + * the {@literal java.io.tmpdir} system property. + */ + // synchronized to avoid race-conditions, TODO investigate an internal mutex? + public static synchronized Path getTemporaryFolder() { + Path candidate = FS_TEMP.resolve(String.valueOf(System.nanoTime())); + while (Files.exists(candidate)) { + candidate = FS_TEMP.resolve(String.valueOf(System.nanoTime())); + } + // create the directory + while (true) { + try { + Files.createDirectories(candidate); + } catch (IOException e) { + LOG.warn("Could not create temporary directory {}", candidate, e); + continue; + } + return candidate; + } + } + + public static Path unpackToTemp(Path zipFile) throws IOException { + Path targetDir = getTemporaryFolder(); + unzip(zipFile, targetDir); + return targetDir; + } + + public static void zip(Path targetFile, Path... inputFiles) throws IOException { + if (inputFiles.length == 0) { + return; + } + // recurse into a single base-directory + if (inputFiles.length == 1 && Files.isDirectory(inputFiles[0])) { + final Path[] inputs; + try (Stream search = Files.find(inputFiles[0], Integer.MAX_VALUE, (p, a) -> true)) { + inputs = search.toArray(Path[]::new); + } catch (IOException inner) { + throw inner; + } + zip(targetFile, inputs); + return; + } + // the root to relativize paths against for the name-resolution of the Zip entries + final Path root = Files.isDirectory(inputFiles[0]) ? inputFiles[0] : inputFiles[0].getParent(); + // ensure parent directory exists + Files.createDirectories(targetFile.getParent()); + + try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(targetFile, + StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING))) { + for (Path externalFile : inputFiles) { + // skip root + if (externalFile.equals(root) + // skip the target file if it's within the resolved input files + || externalFile.endsWith(targetFile) || targetFile.endsWith(externalFile)) { + continue; + } + // only copy the content of regular files + if (!Files.isRegularFile(externalFile)) { + continue; + } + final Path relative = root.relativize(externalFile); + ZipEntry entry = new ZipEntry(relative.toString()); + zos.putNextEntry(entry); + Files.copy(externalFile, zos); + zos.closeEntry(); + } + zos.finish(); + } + } + + public static List unzip(Path zipFile, Path targetDirectory) throws IOException { + // ensure target directory exists + Files.createDirectories(targetDirectory); + // take note of all the files stored in this zipFile + final List zipStoredNames = new ArrayList<>(); + try (ZipInputStream zis = new ZipInputStream(Files.newInputStream(zipFile, StandardOpenOption.READ))) { + ZipEntry currentEntry = zis.getNextEntry(); + while (currentEntry != null) { + if (!currentEntry.isDirectory()) { + zipStoredNames.add(currentEntry.getName()); + } + currentEntry = zis.getNextEntry(); + } + } + + // create a filesystem for the zipfile + java.nio.file.FileSystem zipFs = FileSystems.newFileSystem(zipFile, FileSystem.class.getClassLoader()); + try { + return zipStoredNames.stream() + .map(zipName -> { + // SIDE-EFFECTING MAP TO TRANSFER THE FILES + Path targetFile = targetDirectory.resolve(zipName); + Path zipInternalFile = zipFs.getPath(zipName); + try { + Files.createDirectories(targetFile.getParent()); + Files.copy(zipInternalFile, targetFile); + return targetFile; + } catch (IOException e) { + LOG.warn("Failed to extract {} from zipFile {} to {}", zipInternalFile, zipFile, targetFile, e); + return null; + } + }) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + } finally { + zipFs.close(); + } + } + + public static void copyDirectory(Path source, Path target) throws IOException { + Files.walkFileTree(source, new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes basicFileAttributes) throws IOException { + Path targetdir = target.resolve(source.relativize(dir)); + try { + Files.copy(dir, targetdir); + } catch (FileAlreadyExistsException e) { + if (!Files.isDirectory(targetdir)) + throw e; + } + return CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes basicFileAttributes) throws IOException { + Files.copy(file, target.resolve(source.relativize(file))); + return CONTINUE; + } + }); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/HttpServiceImpl.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/HttpServiceImpl.java new file mode 100644 index 000000000..5d9cd9e03 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/HttpServiceImpl.java @@ -0,0 +1,196 @@ +package org.opentosca.container.core.impl.service; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.apache.http.Header; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.auth.AuthScope; +import org.apache.http.auth.UsernamePasswordCredentials; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpHead; +import org.apache.http.client.methods.HttpOptions; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpTrace; +import org.apache.http.cookie.Cookie; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.client.LaxRedirectStrategy; +import org.opentosca.container.core.service.IHTTPService; +import org.springframework.stereotype.Service; + +/** + * This is an implementation of the {@link IHTTPService} interface. A lot of methods currently offer only very basic + * functionality which could be extended in the future if the need arises. All methods make use of the Apache + * HttpComponents. + */ +@Service +public class HttpServiceImpl implements IHTTPService { + + @Override + public HttpResponse Get(final String uri, final List cookies) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpGet get = new HttpGet(uri); + + if (cookies != null) { + for (final Cookie c : cookies) { + client.getCookieStore().addCookie(c); + } + } + + final HttpResponse response = client.execute(get); + + return response; + // TODO Return something useful maybe... like an InputStream + } + + @Override + public HttpResponse Get(final String uri, final Map headers) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpGet get = new HttpGet(uri); + + for (final String header : headers.keySet()) { + get.addHeader(header, headers.get(header)); + } + + final HttpResponse response = client.execute(get); + + return response; + // TODO Return something useful maybe... like an InputStream + } + + @Override + public HttpResponse Get(final String uri) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpGet get = new HttpGet(uri); + final HttpResponse response = client.execute(get); + + return response; + // TODO Return something useful maybe... like an InputStream + } + + @Override + public HttpResponse Get(final String uri, final String username, final String password) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.getCredentialsProvider().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password)); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpGet get = new HttpGet(uri); + final HttpResponse response = client.execute(get); + + return response; + // TODO Return something useful maybe... like an InputStream + } + + @Override + public HttpResponse Head(final String uri) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpHead head = new HttpHead(uri); + final HttpResponse response = client.execute(head); + return response; + } + + @Override + public HttpResponse Post(final String uri, final HttpEntity httpEntity) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpPost post = new HttpPost(uri); + post.setEntity(httpEntity); + final HttpResponse response = client.execute(post); + return response; + } + + @Override + public HttpResponse Post(final String uri, final HttpEntity httpEntity, final Header... header) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpPost post = new HttpPost(uri); + post.setEntity(httpEntity); + post.setHeaders(header); + final HttpResponse response = client.execute(post); + return response; + } + + @Override + public HttpResponse Post(final String uri, final HttpEntity httpEntity, + final List cookies) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpPost post = new HttpPost(uri); + post.setEntity(httpEntity); + if (cookies != null) { + for (final Cookie c : cookies) { + client.getCookieStore().addCookie(c); + } + } + final HttpResponse response = client.execute(post); + return response; + } + + @Override + public List PostCookies(final String uri, final HttpEntity httpEntity) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpPost post = new HttpPost(uri); + post.setEntity(httpEntity); + client.execute(post); + final List cookies = client.getCookieStore().getCookies(); + // client.getConnectionManager().shutdown(); + return cookies; + } + + @Override + public HttpResponse Put(final String uri, final HttpEntity httpEntity) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpPut put = new HttpPut(uri); + put.setEntity(httpEntity); + final HttpResponse response = client.execute(put); + return response; + } + + @Override + public HttpResponse Put(final String uri, final HttpEntity httpEntity, final String username, + final String password) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + client.getCredentialsProvider().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password)); + final HttpPut put = new HttpPut(uri); + put.setEntity(httpEntity); + final HttpResponse response = client.execute(put); + return response; + } + + @Override + public HttpResponse Delete(final String uri) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpDelete del = new HttpDelete(uri); + final HttpResponse response = client.execute(del); + return response; + } + + @Override + public HttpResponse Trace(final String uri) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpTrace trace = new HttpTrace(uri); + final HttpResponse response = client.execute(trace); + return response; + } + + @Override + public HttpResponse Options(final String uri) throws IOException { + DefaultHttpClient client = new DefaultHttpClient(); + client.setRedirectStrategy(new LaxRedirectStrategy()); + final HttpOptions options = new HttpOptions(uri); + final HttpResponse response = client.execute(options); + return response; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/ZipManager.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/ZipManager.java new file mode 100644 index 000000000..9843d061a --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/ZipManager.java @@ -0,0 +1,190 @@ +package org.opentosca.container.core.impl.service; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ZipManager { + + // Singleton Pattern + private static final ZipManager INSTANCE = new ZipManager(); + + // Buffer for zipping/unzipping + private final static int BUFFER = 16384; + + private final static Logger LOG = LoggerFactory.getLogger(ZipManager.class); + + private ZipManager() { + } + + public static ZipManager getInstance() { + return ZipManager.INSTANCE; + } + + /** + * Creates a new ZIP archive containing the contents of the specified directory.
    Existing archives with the same + * name will be overwritten automatically. + * + * @param directory - Absolute path to the folder which contents should be zipped, including sub folders. + * @param archive - Absolute path to ZIP archive. + */ + public File zip(final File directory, final File archive) { + LOG.info("Zipping {} ...", directory.getPath()); + + try (final FileOutputStream destination = new FileOutputStream(archive); + final ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(destination))) { + + ZipManager.zipDir(directory.getAbsolutePath(), directory, zos, archive.getAbsolutePath()); + zos.flush(); + } catch (final IOException e) { + LOG.error("Error", e); + return null; + } + LOG.info("Zipping completed."); + return archive; + } + + /** + * Private helper class to recursively zip a folder and its contents. + * + * @param currentDir Current working directory. + * @param dirToZip Root directory that should be zipped. + * @param zos Already opened Output Stream. + */ + private static void zipDir(final String currentDir, final File dirToZip, final ZipOutputStream zos, + final String archive) throws IOException { + + zos.setMethod(ZipOutputStream.DEFLATED); + + final byte[] data = new byte[ZipManager.BUFFER]; + final File archiveFile = new File(archive); + + // Switch to current directory and fetch its entries + final File cDir = new File(currentDir); + final String[] dirList = cDir.list(); + if (dirList == null) { + throw new FileNotFoundException("Given Directory " + currentDir + " was not a directory or an IOException occurred"); + } + + final int length = dirList.length; + + if (length == 0) { + LOG.trace("ZIP: - It's a empty directory. Adding..."); + final String relPath = cDir.getCanonicalPath().substring(dirToZip.getCanonicalPath().length() + 1); + final ZipEntry entry = new ZipEntry(relPath + "/"); + zos.putNextEntry(entry); + } + + // Loop through entries + for (String s : dirList) { + LOG.trace("ZIP: Processing entry: '" + s + "'"); + final File f = new File(cDir, s); + + // Skip created archive if it's in the same directory + if (archiveFile.getAbsolutePath().equals(f.getAbsolutePath())) { + LOG.trace("ZIP: - Created archive found. Skipping..."); + continue; + } + + // Go through a sub directory recursively with new cDir + if (f.isDirectory()) { + LOG.trace("ZIP: - Directory found. Going into directory..."); + ZipManager.zipDir(f.getCanonicalPath(), dirToZip, zos, archive); + continue; + } + + // Generate relative path + final String relPath = f.getCanonicalPath().substring(dirToZip.getCanonicalPath().length() + 1); + final ZipEntry entry = new ZipEntry(relPath); + + // Open input streams and write entry to zip + final FileInputStream fis = new FileInputStream(f.getCanonicalPath()); + final BufferedInputStream origin = new BufferedInputStream(fis, ZipManager.BUFFER); + zos.putNextEntry(entry); + LOG.trace("ZIP: - Adding file... "); + int count; + + while ((count = origin.read(data, 0, ZipManager.BUFFER)) != -1) { + zos.write(data, 0, count); + } + + LOG.trace("ZIP: File added!"); + origin.close(); + } + } + + /** + * Unzips an archive to specified location. + * + * @param file Location of ZIP archive. + * @param toTarget Directory where contents of ZIP archive should be placed. + */ + public List unzip(final File file, final File toTarget) { + + LOG.info("Unzipping {} ...", file.getPath()); + + final List contents = new ArrayList<>(); + try (final FileInputStream fis = new FileInputStream(file); + final BufferedInputStream bis = new BufferedInputStream(fis); + final ZipInputStream zis = new ZipInputStream(bis); + final ZipFile zipFile = new ZipFile(file)) { + LOG.trace("UNZIP: Initialization complete."); + + if (!toTarget.exists()) { + toTarget.mkdirs(); + LOG.trace("UNZIP: Directory created: {}", toTarget.getName()); + } + + int entryIndex = 0; + // Go through the archive entry by entry + ZipEntry entry; + while ((entry = zis.getNextEntry()) != null) { + entryIndex++; + final String name = entry.getName(); + String entryTarget = toTarget.getPath() + File.separator + name; + LOG.trace("UNZIP: Processing entry " + entryIndex + "/" + zipFile.size() + ": " + name); + + if (entry.isDirectory()) { + LOG.trace("UNZIP: - Creating directory... "); + new File(entryTarget).mkdirs(); + LOG.trace("UNZIP: - Directory created!"); + } else { + final File entryTargetFile = new File(entryTarget); + contents.add(entryTargetFile); + + final File parent = entryTargetFile.getParentFile(); + if (parent != null) { + parent.mkdirs(); + } + + try (final FileOutputStream fos = new FileOutputStream(entryTargetFile); + final BufferedOutputStream dest = new BufferedOutputStream(fos, ZipManager.BUFFER)) { + int count; + final byte[] buffer = new byte[ZipManager.BUFFER]; + while ((count = zis.read(buffer, 0, ZipManager.BUFFER)) != -1) { + dest.write(buffer, 0, count); + } + } + } + } + } catch (final IOException e) { + LOG.error("Error", e); + return null; + } + LOG.info("Unzipping completed!"); + return contents; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/PathUtils.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/PathUtils.java new file mode 100644 index 000000000..b1d174932 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/PathUtils.java @@ -0,0 +1,24 @@ +package org.opentosca.container.core.impl.service.internal.file; + +import java.nio.file.Path; + +/** + * File name and file path utilities. + */ +public class PathUtils { + + public final static char FILE_EXTENSION_SEPARATOR = '.'; + + /** + * @param extensions of a file. + * @return {@code true}, if {@code file} has any of the file extensions {@code extensions}, otherwise {@code false}. + */ + public static boolean hasFileExtension(final Path file, final String... extensions) { + for (final String extension : extensions) { + if (file.toString().toLowerCase().endsWith(PathUtils.FILE_EXTENSION_SEPARATOR + extension)) { + return true; + } + } + return false; + } +} diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryDeleteVisitor.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryDeleteVisitor.java similarity index 93% rename from org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryDeleteVisitor.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryDeleteVisitor.java index b80d27e73..9c5c511e3 100644 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryDeleteVisitor.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryDeleteVisitor.java @@ -22,13 +22,12 @@ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attr } /** - * Called for a directory after all files and directories in the directory have been visited. It - * deletes the directory. + * Called for a directory after all files and directories in the directory have been visited. It deletes the + * directory. */ @Override public FileVisitResult postVisitDirectory(final Path dir, final IOException exc) throws IOException { Files.delete(dir); return super.postVisitDirectory(dir, exc); } - } diff --git a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryVisitor.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryVisitor.java similarity index 94% rename from org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryVisitor.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryVisitor.java index 116351580..c97afa7df 100644 --- a/org.opentosca.container.core.impl/src/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryVisitor.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/impl/service/internal/file/visitors/DirectoryVisitor.java @@ -20,7 +20,6 @@ public class DirectoryVisitor extends SimpleFileVisitor { private final Set VISITED_FILES = new HashSet<>(); private final Set VISITED_DIRECTORIES = new HashSet<>(); - /** * Called for a file. The file path be saved in a {@code Set}. */ @@ -31,8 +30,8 @@ public FileVisitResult visitFile(final Path file, final BasicFileAttributes attr } /** - * Called for a directory after all files and directories in the directory have been visited. The - * directory path be saved in a {@code Set}. + * Called for a directory after all files and directories in the directory have been visited. The directory path be + * saved in a {@code Set}. */ @Override public FileVisitResult postVisitDirectory(final Path dir, final IOException exc) throws IOException { @@ -53,5 +52,4 @@ public Set getVisitedFiles() { public Set getVisitedDirectories() { return this.VISITED_DIRECTORIES; } - } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractArtifact.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractArtifact.java new file mode 100644 index 000000000..9d997c5d1 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractArtifact.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors + * SPDX-License-Identifier: Apache-2.0 + *******************************************************************************/ +package org.opentosca.container.core.model; + +import java.util.Set; + +import org.opentosca.container.core.common.UserException; + +/** + * Abstract class of an artifact that consists of files and directories.
    Each class that extends this class + * represents an certain type of artifact respectively artifact reference, e.g. an HTTP artifact (reference begins with + * http). + *

    + * Provides methods for getting the passed artifact reference and include and/or exclude patterns, check if an artifact + * reference belongs to this type of artifact, and browsing the artifact content (this is the artifact root). + */ +@Deprecated +// FIXME remove the abomination that is IBrowseable +public abstract class AbstractArtifact implements IBrowseable { + + /** + * Reference that points to this artifact. + */ + private final String ARTIFACT_REFERENCE; + + private final Set INCLUDE_PATTERNS; + private final Set EXCLUDE_PATTERNS; + + /** + * Creates an artifact. + * + * @param artifactReference that points to this artifact. + * @param includePatterns to include only certain files in this artifact. + * @param excludePatterns to exclude certain files from this artifact. + * @throws UserException if artifact reference points a non-existent file / directory. + */ + public AbstractArtifact(final String artifactReference, final Set includePatterns, + final Set excludePatterns) { + + this.ARTIFACT_REFERENCE = artifactReference; + this.INCLUDE_PATTERNS = includePatterns; + this.EXCLUDE_PATTERNS = excludePatterns; + } + + /** + * @return {@link AbstractDirectory} that represents the root of the artifact.
    Note: The browsing methods in + * this class redirecting to the same methods of this {@link AbstractDirectory} by delegation. + */ + protected abstract AbstractDirectory getArtifactRoot(); + + /** + * @return {@inheritDoc}
    Also {@code null} if {@code relPathOfFile} not matches patterns (if any were + * given).
    If this artifact represents an file artifact (artifact reference points to a file) the file of the + * artifact can be returned by passing an arbitrary string. + */ + @Override + public AbstractFile getFile(final String relPathOfFile) { + return this.getArtifactRoot().getFile(relPathOfFile); + } + + /** + * @return {@inheritDoc}
    If any patterns were given only files will be returned that matches these + * patterns.
    In case this artifact represents a file artifact (artifact reference points to a file) a {@code + * Set} with one element will be returned that contains the file of the artifact (patterns will be ignored). + */ + @Override + public Set getFiles() { + return this.getArtifactRoot().getFiles(); + } + + /** + * @return {@inheritDoc}
    If patterns were given only files will be returned that matches these patterns.
    + * In case this artifact represents a file artifact (artifact reference points to a file) a {@code Set} with one + * element will be returned that contains the file of the artifact (patterns will be ignored). + */ + @Override + public Set getFilesRecursively() { + return this.getArtifactRoot().getFilesRecursively(); + } + + /** + * @return {@inheritDoc}
    If any patterns were given only files will be returned that matches these patterns. + */ + @Override + public AbstractDirectory getDirectory(final String relPathOfDirectory) { + return this.getArtifactRoot().getDirectory(relPathOfDirectory); + } + + @Override + public Set getDirectories() { + return this.getArtifactRoot().getDirectories(); + } + + /** + * @return {@code true} if reference of this artifact points to a file, otherwise {@code false}. + */ + public abstract boolean isFileArtifact(); + + /** + * Checks if {@code artifactReference} fits to this type of artifact.
    It only performs syntax checks which not + * need network access. + * + * @param artifactReference to check + * @return {@code true} if {@code artifactReference} fits, otherwise {@code false} + */ + public static boolean fitsArtifactReference(final String artifactReference) { + throw new UnsupportedOperationException("Not yet implemented"); + } + + /** + * @return Artifact reference. + */ + public String getArtifactReference() { + return this.ARTIFACT_REFERENCE; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractDirectory.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractDirectory.java new file mode 100644 index 000000000..acdb537ad --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractDirectory.java @@ -0,0 +1,157 @@ +package org.opentosca.container.core.model; + +import java.util.HashSet; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Abstract class of a directory. Provides methods for browsing the directory and getting their meta data. + */ +@Deprecated +public abstract class AbstractDirectory implements IBrowseable { + + private final static Logger LOG = LoggerFactory.getLogger(AbstractDirectory.class); + + /** + * Reference that points to this directory. + */ + private final String DIRECTORY_REFERENCE; + + private final Set INCLUDE_PATTERNS; + private final Set EXCLUDE_PATTERNS; + + /** + * Creates a directory. + * + * @param directoryReference that points to this directory. + * @param includePatterns to include only certain files in this directory. + * @param excludePatterns to exclude certain files from this directory. + * @param fileArtifact - {@code true} if this directory represents a file artifact (directory contains only + * the file at the artifact reference), otherwise {@code false}. + */ + public AbstractDirectory(final String directoryReference, final Set includePatterns, + final Set excludePatterns, final boolean fileArtifact) { + this.DIRECTORY_REFERENCE = directoryReference; + this.INCLUDE_PATTERNS = includePatterns; + this.EXCLUDE_PATTERNS = excludePatterns; + } + + /** + * @return {@inheritDoc}
    Also {@code null} if {@code relPathOfFile} not matches patterns (if any were given). + */ + @Override + public AbstractFile getFile(final String relPathOfFile) { + + final AbstractFile file = this.getFileNotConsiderPatterns(relPathOfFile); + + if (file != null) { + + // no patterns were given => we not doing pattern matching + if (this.getIncludePatterns().isEmpty() && this.getExcludePatterns().isEmpty()) { + AbstractDirectory.LOG.debug("File \"{}\" relative to \"{}\" was found.", relPathOfFile, this.getPath()); + return file; + } else { + + final boolean matchesPatterns = + PatternMatcher.isFileMatchesPatterns(file, this.getIncludePatterns(), this.getExcludePatterns()); + + if (matchesPatterns) { + AbstractDirectory.LOG.debug("File \"{}\" relative to \"{}\" was found and matches pattern(s).", + relPathOfFile, this.getPath()); + return file; + } + } + } + + AbstractDirectory.LOG.warn("File \"{}\" relative to \"{}\" was not found.", relPathOfFile, this.getPath()); + + return null; + } + + /** + * This method should not consider any given patterns. + * + * @see AbstractDirectory#getFile(String) + */ + protected abstract AbstractFile getFileNotConsiderPatterns(String relPathOfFile); + + /** + * @return {@inheritDoc}
    If patterns were given only files will be returned that matches these patterns. + */ + @Override + public Set getFiles() { + + Set files; + + // no patterns were given => we not doing pattern matching + if (this.getIncludePatterns().isEmpty() && this.getExcludePatterns().isEmpty()) { + files = this.getFilesNotConsiderPatterns(); + } else { + files = PatternMatcher.findFilesMatchesPatterns(this.getFilesNotConsiderPatterns(), + this.getIncludePatterns(), this.getExcludePatterns()); + } + return files; + } + + /** + * This method should not consider any given patterns. + * + * @see AbstractDirectory#getFiles() + */ + protected abstract Set getFilesNotConsiderPatterns(); + + /** + * @return {@inheritDoc}
    If patterns were given only files will be returned that matches these patterns. + */ + @Override + public Set getFilesRecursively() { + final Set files = new HashSet<>(); + this.walkFileTree(this, files); + return files; + } + + /** + * Recursively adds all files in {@code directory} and it's sub directories to {@code files}. + */ + private void walkFileTree(final AbstractDirectory directory, final Set files) { + + files.addAll(directory.getFiles()); + + final Set subDirectories = directory.getDirectories(); + + for (final AbstractDirectory subDirectory : subDirectories) { + this.walkFileTree(subDirectory, files); + } + } + + @Override + public abstract AbstractDirectory getDirectory(String relPathOfDirectory); + + /** + * @return Name of this directory. + */ + public abstract String getName(); + + /** + * @return Reference that points to this directory. + */ + public String getPath() { + return this.DIRECTORY_REFERENCE; + } + + /** + * @return Patterns to include only certain files in this directory. + */ + protected Set getIncludePatterns() { + return this.INCLUDE_PATTERNS; + } + + /** + * @return Patterns to exclude certain files from this directory. + */ + protected Set getExcludePatterns() { + return this.EXCLUDE_PATTERNS; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractFile.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractFile.java similarity index 89% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractFile.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractFile.java index a1b832fd1..1ce89f205 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractFile.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/AbstractFile.java @@ -4,16 +4,15 @@ import java.nio.file.Path; import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.service.IFileAccessService; /** * Abstract class of a file. Provides methods to fetch the file and get it's meta data. */ +@Deprecated public abstract class AbstractFile { private final String FILE_REFERENCE; - /** * Creates a {@link AbstractFile}. * @@ -24,18 +23,16 @@ public AbstractFile(final String fileReference) { } /** - * Retrieves this file to a Temp directory from {@link IFileAccessService#getTemp()}. - * - * @throws SystemException if an error occurred during retrieving. + * Retrieves this file to a temporary directory. * * @return {@link Path} of this file. + * @throws SystemException if an error occurred during retrieving. */ public abstract Path getFile() throws SystemException; /** - * @throws SystemException if an error occurred during getting. - * * @return {@link InputStream} of this file. + * @throws SystemException if an error occurred during getting. */ public abstract InputStream getFileAsInputStream() throws SystemException; @@ -59,5 +56,4 @@ public String getPath() { @Override public abstract boolean equals(Object file); - } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/IBrowseable.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/IBrowseable.java similarity index 86% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/IBrowseable.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/IBrowseable.java index 6225fa7c5..66cfe0dd0 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/IBrowseable.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/IBrowseable.java @@ -9,12 +9,12 @@ /** * Provides methods for getting the directories and files in a directory respectively root. */ +@Deprecated public interface IBrowseable { /** * @param relPathOfDirectory - directory path relative to this directory / root. - * @return {@link AbstractDirectory} of directory {@code relPathOfDirectory} . If it not exists - * {@code null}. + * @return {@link AbstractDirectory} of directory {@code relPathOfDirectory} . If it not exists {@code null}. */ public AbstractDirectory getDirectory(String relPathOfDirectory); @@ -25,8 +25,7 @@ public interface IBrowseable { public AbstractFile getFile(String relPathOfFile); /** - * @return {@code Set} containing {@link AbstractDirectory} of directories in this directory (not - * recursively). + * @return {@code Set} containing {@link AbstractDirectory} of directories in this directory (not recursively). */ public Set getDirectories(); @@ -36,8 +35,8 @@ public interface IBrowseable { public Set getFiles(); /** - * @return {@code Set} containing {@link AbstractFile} of files in this directory and it's sub - * directories (recursively). + * @return {@code Set} containing {@link AbstractFile} of files in this directory and it's sub directories + * (recursively). */ public Set getFilesRecursively(); } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/PatternMatcher.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/PatternMatcher.java similarity index 78% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/PatternMatcher.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/PatternMatcher.java index 6230f3586..4b68e8147 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/PatternMatcher.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/PatternMatcher.java @@ -13,25 +13,23 @@ import org.slf4j.LoggerFactory; /** - * Matches files at an artifact reference against include and exclude patterns. An include pattern - * includes certain files at a reference in the artifact. By analogy, an exclude pattern excludes - * files from the artifact. A pattern must be given as a regular expression (RegExp). + * Matches files at an artifact reference against include and exclude patterns. An include pattern includes certain + * files at a reference in the artifact. By analogy, an exclude pattern excludes files from the artifact. A pattern must + * be given as a regular expression (RegExp). */ public class PatternMatcher { private static final Logger LOG = LoggerFactory.getLogger(PatternMatcher.class); - /** - * Matches {@code file} against {@code includePatterns} and {@code excludePatterns} using - * {@link #findFilesMatchesPatterns(Set, Set, Set)}. + * Matches {@code file} against {@code includePatterns} and {@code excludePatterns} using {@link + * #findFilesMatchesPatterns(Set, Set, Set)}. * - * @param file that should be matched against the patterns. + * @param file that should be matched against the patterns. * @param includePatterns to include {@code file} * @param excludePatterns to exclude {@code file} - * @return {@code true} if {@code file} matches against the include and exclude patterns, otherwise - * {@code false}. If no patterns were given, {@code true} will be returned. - * + * @return {@code true} if {@code file} matches against the include and exclude patterns, otherwise {@code false}. + * If no patterns were given, {@code true} will be returned. * @see #findFilesMatchesPatterns(Set, Set, Set) */ public static boolean isFileMatchesPatterns(final AbstractFile file, final Set includePatterns, @@ -48,25 +46,20 @@ public static boolean isFileMatchesPatterns(final AbstractFile file, final Set - *
    - * 1. Matches {@code files} against the include patterns. A matched file will be added to a Set X. - * If no include patterns were given, all files will be added to X.
    - * 2. Files in X will be matched against the exclude patterns. If a file matches, it will be removed - * from X.
    - *
    - * Finally Set X contains the files that matches the include and exclude patterns. + * Matches {@code files} against {@code includePatterns} and {@code excludePatterns} in the following way:

    1. Matches {@code files} against the include patterns. A matched file will be added to a Set X. If no include + * patterns were given, all files will be added to X.
    2. Files in X will be matched against the exclude + * patterns. If a file matches, it will be removed from X.

    Finally Set X contains the files that + * matches the include and exclude patterns. * - * @param files that should be matched against the patterns. + * @param files that should be matched against the patterns. * @param includePatterns to include certain files. * @param excludePatterns to exclude certain files. - * @return Files that matches the include and exclude patterns. If no patterns were given, all given - * files will be returned. + * @return Files that matches the include and exclude patterns. If no patterns were given, all given files will be + * returned. */ public static Set findFilesMatchesPatterns(final Set files, final Set includePatterns, @@ -100,7 +93,7 @@ public static Set findFilesMatchesPatterns(final Set for (final String excludePattern : excludePatterns) { PatternMatcher.LOG.debug("Matching file(s) against exclude pattern \"{}\"...", excludePattern); filesMatchingPatterns.removeAll(PatternMatcher.getSubsetMatchesPattern(filesMatchingPatterns, - excludePattern)); + excludePattern)); PatternMatcher.LOG.debug("Matching file(s) against exclude pattern \"{}\" completed.", excludePattern); } } else { @@ -108,16 +101,15 @@ public static Set findFilesMatchesPatterns(final Set } PatternMatcher.LOG.debug("Matching file(s) completed - {} of {} file(s) match pattern(s).", - filesMatchingPatterns.size(), files.size()); + filesMatchingPatterns.size(), files.size()); return filesMatchingPatterns; - } /** * Matches {@code files} against {@code pattern}. * - * @param files to match against {@code pattern}. + * @param files to match against {@code pattern}. * @param pattern - regular expression * @return Files that matches {@code pattern}. */ @@ -142,7 +134,5 @@ private static Set getSubsetMatchesPattern(final Set } return filesMatches; - } - } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/capability/Capability.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/capability/Capability.java new file mode 100644 index 000000000..7be1fee21 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/capability/Capability.java @@ -0,0 +1,93 @@ +package org.opentosca.container.core.model.capability; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +import org.opentosca.container.core.model.capability.provider.ProviderType; + +@Entity +@Table(name = Capability.TABLE_NAME) +@NamedQueries( { + @NamedQuery(name = Capability.byProviderType, query = Capability.byProviderTypeQuery), + @NamedQuery(name = Capability.byProvider, query = Capability.byProviderQuery) +}) +public class Capability implements Serializable { + public static final String TABLE_NAME = "CAPABILITIES"; + + public static final String byProviderType = "Capability.ByProviderType"; + public static final String byProvider = "Capability.ByProvider"; + + static final String byProviderTypeQuery = "SELECT c FROM Capability c WHERE c.providerType = :providerType"; + static final String byProviderQuery = "SELECT c FROM Capability c WHERE c.providerType = :providerType AND c.providerName = :providerName"; + + private static final long serialVersionUid = 684635434L; + + @Column(name = "Capability") + @Id + private String capability; + @Column(name = "ProviderName") + @Id + private String providerName; + @Enumerated(EnumType.STRING) + @Column(name = "ProviderType") + @Id + private ProviderType providerType; + + // required for JPA + public Capability() { + } + + public Capability(String capability, String providerName, ProviderType providerType) { + this.capability = capability; + this.providerName = providerName; + this.providerType = providerType; + } + + public String getCapability() { + return capability; + } + + public void setCapability(String capability) { + this.capability = capability; + } + + public String getProviderName() { + return providerName; + } + + public void setProviderName(String providerName) { + this.providerName = providerName; + } + + public ProviderType getProviderType() { + return providerType; + } + + public void setProviderType(ProviderType providerType) { + this.providerType = providerType; + } + + @Override + public int hashCode() { + return capability.hashCode() ^ providerName.hashCode(); + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof Capability)) { + return false; + } + Capability other = (Capability) o; + return capability.equals(other.capability) + && providerName.equals(other.providerName) + && providerType.equals(other.providerType); + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/capability/provider/ProviderType.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/capability/provider/ProviderType.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/capability/provider/ProviderType.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/capability/provider/ProviderType.java diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/credentials/Credentials.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/credentials/Credentials.java similarity index 76% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/credentials/Credentials.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/credentials/Credentials.java index 2e5c03ec8..5969567bb 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/credentials/Credentials.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/credentials/Credentials.java @@ -4,12 +4,9 @@ import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; -import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.UniqueConstraint; import javax.xml.bind.annotation.XmlAccessType; @@ -19,23 +16,21 @@ import javax.xml.bind.annotation.XmlRootElement; /** - * Credentials for a storage provider. A credentials consists of an identity and a key. Used by the - * Credentials Service, a storage provider and in the Container API for a Credentials JAXB model - * (thus it has JAXB annotations). + * Credentials for a storage provider. A credentials consists of an identity and a key. Used by the Credentials Service, + * a storage provider and in the Container API for a Credentials JAXB model (thus it has JAXB annotations). */ @XmlRootElement(name = "Credentials") @XmlAccessorType(XmlAccessType.FIELD) @Entity(name = Credentials.tableName) @Table(name = Credentials.tableName, - uniqueConstraints = @UniqueConstraint(name = "credentialsUniqueConstraints", - columnNames = {"\"storageProviderID\"", "\"identity\""})) -@NamedQueries({@NamedQuery(name = Credentials.getCredentialsByID, query = Credentials.getCredentialsByIDQuery), - @NamedQuery(name = Credentials.getCredentialsIDs, query = Credentials.getCredentialsIDsQuery), - @NamedQuery(name = Credentials.getAllCredentials, query = Credentials.getAllCredentialsQuery), - @NamedQuery(name = Credentials.removeCredentialsByID, query = Credentials.removeCredentialsByIDQuery), - @NamedQuery(name = Credentials.removeAllCredentials, query = Credentials.removeAllCredentialsQuery), - @NamedQuery(name = Credentials.getAllCredentialsByStorageProviderID, - query = Credentials.getAllCredentialsByStorageProviderIDQuery)}) + uniqueConstraints = @UniqueConstraint(name = "credentialsUniqueConstraints", + columnNames = {"storageProviderID", "\"identity\""})) +@NamedQueries( {@NamedQuery(name = Credentials.getCredentialsByID, query = Credentials.getCredentialsByIDQuery), + @NamedQuery(name = Credentials.getCredentialsIDs, query = Credentials.getCredentialsIDsQuery), + @NamedQuery(name = Credentials.getAllCredentials, query = Credentials.getAllCredentialsQuery), + @NamedQuery(name = Credentials.removeCredentialsByID, query = Credentials.removeCredentialsByIDQuery), + @NamedQuery(name = Credentials.removeAllCredentials, query = Credentials.removeAllCredentialsQuery), + @NamedQuery(name = Credentials.getAllCredentialsByStorageProviderID, query = Credentials.getAllCredentialsByStorageProviderIDQuery)}) public class Credentials { protected static final String tableName = "Credentials"; @@ -66,14 +61,12 @@ public class Credentials { "SELECT t FROM " + Credentials.tableName + " t WHERE t.storageProviderID = :storageProviderID"; /** - * Identifies these credentials.
    - * Will be automatically generated if an object of this class is persisted using Eclipse Link. + * Identifies these credentials.
    Will be automatically generated if an object of this class is persisted using + * Eclipse Link. */ @XmlAttribute(name = "id") @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "credentialsSequence") - @SequenceGenerator(name = "credentialsSequence", sequenceName = "credentialsSequence") + @Column(name = "id", nullable = false, unique = true) private Long id; /** @@ -84,17 +77,14 @@ public class Credentials { private String storageProviderID; /** - * Identity of these credentials.
    - * E.g. on Amazon S3 it's the Access Key ID. - * + * Identity of these credentials.
    E.g. on Amazon S3 it's the Access Key ID. */ @XmlElement(name = "Identity") @Column(name = "\"identity\"") private String identity; /** - * Key of these credentials.
    - * E.g. on Amazon S3 it's the Secret Access Key. + * Key of these credentials.
    E.g. on Amazon S3 it's the Secret Access Key. */ @XmlElement(name = "Key") @Column(name = "\"key\"") @@ -107,19 +97,19 @@ public class Credentials { @Column(name = "description") private String description; - /** * Needed by Eclipse Link. */ - protected Credentials() {} + protected Credentials() { + } /** * Creates {@link Credentials}. * * @param storageProviderID of the storage provider for that the credentials are indented for. - * @param identity of the credentials. - * @param key of the credentials. - * @param description of the credentials (optional) + * @param identity of the credentials. + * @param key of the credentials. + * @param description of the credentials (optional) */ public Credentials(final String storageProviderID, final String identity, final String key, final String description) { @@ -146,7 +136,6 @@ protected void setID(final long id) { } /** - * * @return ID of the storage provider for that these credentials are intended for. */ public String getStorageProviderID() { @@ -195,8 +184,7 @@ public void setKey(final String key) { } /** - * @return Description of these credentials.
    - * It's optional. If no description exists {@code null}. + * @return Description of these credentials.
    It's optional. If no description exists {@code null}. */ public String getDescription() { return this.description; @@ -242,7 +230,6 @@ public boolean equals(final Object obj) { } return true; - } @Override diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/Csar.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/Csar.java new file mode 100644 index 000000000..15f73655b --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/Csar.java @@ -0,0 +1,70 @@ +package org.opentosca.container.core.model.csar; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.List; + +import org.eclipse.winery.common.ids.definitions.DefinitionsChildId; +import org.eclipse.winery.model.selfservice.Application; +import org.eclipse.winery.model.tosca.TArtifactTemplate; +import org.eclipse.winery.model.tosca.TDefinitions; +import org.eclipse.winery.model.tosca.TExportedOperation; +import org.eclipse.winery.model.tosca.TExtensibleElements; +import org.eclipse.winery.model.tosca.TNodeType; +import org.eclipse.winery.model.tosca.TNodeTypeImplementation; +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPolicyTemplate; +import org.eclipse.winery.model.tosca.TRelationshipTypeImplementation; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.container.core.model.AbstractFile; +import org.opentosca.container.core.model.csar.backwards.ToscaMetaFileReplacement; + +@NonNullByDefault +public interface Csar { + + public CsarId id(); + + public List artifactTemplates(); + + public List serviceTemplates(); + + public List policyTemplates(); + + @Nullable + public TServiceTemplate entryServiceTemplate(); + + public List definitions(); + + public List exportedOperations(); + + public List plans(); + + public List nodeTypes(); + + public List nodeTypeImplementations(); + + public List relationshipTypeImplementations(); + + public String description(); + + // FIXME decide on Path / File / Binary Representation / ?? + public AbstractFile topologyPicture(); + + public Application selfserviceMetadata(); + + @Nullable + public TExtensibleElements queryRepository(DefinitionsChildId definitionId); + + void exportTo(Path targetPath) throws IOException; + + @Deprecated + ToscaMetaFileReplacement metafileReplacement(); + + @Deprecated + Path getSaveLocation(); + + String toString(); +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/CsarId.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/CsarId.java new file mode 100644 index 000000000..b2e37e68b --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/CsarId.java @@ -0,0 +1,48 @@ +package org.opentosca.container.core.model.csar; + +import org.opentosca.container.core.model.csar.id.CSARID; + +public class CsarId implements Comparable { + + private String name; + + public CsarId(String name) { + this.name = name; + } + + // TODO FOR LEGACY ADAPTERING!! GET THIS REMOVED! + @Deprecated + public CsarId(CSARID storeCSAR) { + name = storeCSAR.getFileName(); + } + + public String csarName() { + return name; + } + + @Override + public int compareTo(CsarId other) { + return name.compareTo(other.name); + } + + @Deprecated + public CSARID toOldCsarId() { + return new CSARID(name); + } + + @Override + public String toString() { + return csarName(); + } + + @Override + public int hashCode() { + return name.hashCode(); + } + + @Override + public boolean equals(Object o) { + return o instanceof CsarId && + name.equals(((CsarId) o).name); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/CsarImpl.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/CsarImpl.java new file mode 100644 index 000000000..72443a0cd --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/CsarImpl.java @@ -0,0 +1,233 @@ +package org.opentosca.container.core.model.csar; + +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.accountability.exceptions.AccountabilityException; +import org.eclipse.winery.common.ids.definitions.ArtifactTemplateId; +import org.eclipse.winery.common.ids.definitions.DefinitionsChildId; +import org.eclipse.winery.common.ids.definitions.NodeTypeId; +import org.eclipse.winery.common.ids.definitions.NodeTypeImplementationId; +import org.eclipse.winery.common.ids.definitions.PolicyTemplateId; +import org.eclipse.winery.common.ids.definitions.RelationshipTypeImplementationId; +import org.eclipse.winery.common.ids.definitions.ServiceTemplateId; +import org.eclipse.winery.model.selfservice.Application; +import org.eclipse.winery.model.tosca.TArtifactTemplate; +import org.eclipse.winery.model.tosca.TBoundaryDefinitions; +import org.eclipse.winery.model.tosca.TDefinitions; +import org.eclipse.winery.model.tosca.TExportedInterface; +import org.eclipse.winery.model.tosca.TExportedOperation; +import org.eclipse.winery.model.tosca.TExtensibleElements; +import org.eclipse.winery.model.tosca.TNodeType; +import org.eclipse.winery.model.tosca.TNodeTypeImplementation; +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPlans; +import org.eclipse.winery.model.tosca.TPolicyTemplate; +import org.eclipse.winery.model.tosca.TRelationshipTypeImplementation; +import org.eclipse.winery.model.tosca.TServiceTemplate; +import org.eclipse.winery.repository.backend.IRepository; +import org.eclipse.winery.repository.backend.RepositoryFactory; +import org.eclipse.winery.repository.backend.SelfServiceMetaDataUtils; +import org.eclipse.winery.repository.datatypes.ids.elements.SelfServiceMetaDataId; +import org.eclipse.winery.repository.exceptions.RepositoryCorruptException; +import org.eclipse.winery.repository.export.CsarExporter; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.container.core.model.AbstractFile; +import org.opentosca.container.core.model.csar.backwards.FileSystemFile; +import org.opentosca.container.core.model.csar.backwards.ToscaMetaFileReplacement; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class CsarImpl implements Csar { + + public static final String ENTRY_SERVICE_TEMPLATE_LOCATION = "EntryServiceTemplate"; + private static final Logger LOGGER = LoggerFactory.getLogger(CsarImpl.class); + + @NonNull + private final CsarId id; + private final Optional entryServiceTemplate; + // TODO evaluate putting the savelocation into an additional field here! + private final IRepository wineryRepo; + + // this is just for bridging purposes + @Deprecated + private @NonNull Path saveLocation; + + public CsarImpl(@NonNull CsarId id, @NonNull Path location) { + this.id = id; + this.saveLocation = location; + wineryRepo = RepositoryFactory.getRepository(location); + entryServiceTemplate = readEntryServiceTemplate(location); + } + + private Optional readEntryServiceTemplate(Path csarLocation) { + String qname = null; + try { + qname = new String(Files.readAllBytes(csarLocation.resolve(ENTRY_SERVICE_TEMPLATE_LOCATION)), StandardCharsets.UTF_8); + } catch (IOException e) { + // Swallow, no helping this + } + return qname == null ? Optional.empty() + : Optional.ofNullable(new ServiceTemplateId(QName.valueOf(qname))); + } + + @Override + public CsarId id() { + return id; + } + + @Override + public List artifactTemplates() { + return wineryRepo.getAllDefinitionsChildIds(ArtifactTemplateId.class).stream() + .map(wineryRepo::getElement) + .collect(Collectors.toList()); + } + + @Override + public List serviceTemplates() { + return wineryRepo.getAllDefinitionsChildIds(ServiceTemplateId.class).stream() + .map(wineryRepo::getElement) + .collect(Collectors.toList()); + } + + @Override + public List policyTemplates() { + return wineryRepo.getAllDefinitionsChildIds(PolicyTemplateId.class).stream() + .map(wineryRepo::getElement) + .collect(Collectors.toList()); + } + + @Override + public TServiceTemplate entryServiceTemplate() { + // FIXME stop mapping between Optional and nullable. + if (entryServiceTemplate.isPresent()) { + return wineryRepo.getElement(entryServiceTemplate.get()); + } + return null; + } + + @Override + public List definitions() { + return wineryRepo.getAllDefinitionsChildIds().stream() + .map(wineryRepo::getDefinitions) + .collect(Collectors.toList()); + } + + @Override + public List exportedOperations() { + return serviceTemplates().stream() + .map(TServiceTemplate::getBoundaryDefinitions) + .map(TBoundaryDefinitions::getInterfaces) + .map(TBoundaryDefinitions.Interfaces::getInterface) + .flatMap(Collection::stream) + .map(TExportedInterface::getOperation) + .flatMap(Collection::stream) + .collect(Collectors.toList()); + } + + @Override + public List plans() { + @SuppressWarnings("null") + List plans = Optional.ofNullable(entryServiceTemplate()) + .map(TServiceTemplate::getPlans) + .map(TPlans::getPlan) + .orElse(Collections.emptyList()); + return plans; + } + + @Override + @Nullable + public Application selfserviceMetadata() { + // FIXME stop bridging optional to null + if (!entryServiceTemplate.isPresent()) { + return null; + } + SelfServiceMetaDataId metadata = new SelfServiceMetaDataId(entryServiceTemplate.get()); + return SelfServiceMetaDataUtils.getApplication(metadata); + } + + @Override + public List nodeTypes() { + return wineryRepo.getAllDefinitionsChildIds(NodeTypeId.class).stream() + .map(wineryRepo::getElement) + .collect(Collectors.toList()); + } + + @Override + public List nodeTypeImplementations() { + return wineryRepo.getAllDefinitionsChildIds(NodeTypeImplementationId.class).stream() + .map(wineryRepo::getElement) + .collect(Collectors.toList()); + } + + @Override + public List relationshipTypeImplementations() { + return wineryRepo.getAllDefinitionsChildIds(RelationshipTypeImplementationId.class).stream() + .map(wineryRepo::getElement) + .collect(Collectors.toList()); + } + + @Override + public TExtensibleElements queryRepository(DefinitionsChildId id) { + return wineryRepo.getElement(id); + } + + @Override + public String description() { + Application metadata = selfserviceMetadata(); + return metadata == null ? "" : metadata.getDescription(); + } + + @Override + public AbstractFile topologyPicture() { + final String imageUrl = selfserviceMetadata().getImageUrl(); + return new FileSystemFile(Paths.get(imageUrl)); + } + + @Override + public void exportTo(Path targetPath) throws IOException { + CsarExporter exporter = new CsarExporter(); + Map exportConfiguration = new HashMap<>(); + // Do not check hashes and do not store immutably => don't put anything into the export configuration + try (OutputStream out = Files.newOutputStream(targetPath, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE)) { + try { + exporter.writeCsar(wineryRepo, entryServiceTemplate.get(), out, exportConfiguration); + } catch (RepositoryCorruptException | InterruptedException | AccountabilityException | ExecutionException e) { + LOGGER.warn("Exporting the csar failed with an exception", e); + throw new IOException("Failed to export CSAR", e); + } + } + } + + @Override + public ToscaMetaFileReplacement metafileReplacement() { + return new ToscaMetaFileReplacement(this); + } + + @Override + public @NonNull Path getSaveLocation() { + return this.saveLocation; + } + + @Override + public String toString() { + return id().csarName(); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/ArtifactResolver.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/ArtifactResolver.java new file mode 100644 index 000000000..af45fdeb6 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/ArtifactResolver.java @@ -0,0 +1,68 @@ +package org.opentosca.container.core.model.csar.backwards; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.function.BiFunction; +import java.util.function.Function; + +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.common.uri.UriUtil; +import org.opentosca.container.core.model.AbstractArtifact; +import org.opentosca.container.core.model.AbstractDirectory; +import org.opentosca.container.core.model.AbstractFile; +import org.opentosca.container.core.model.csar.Csar; + +public class ArtifactResolver { + + public static Function resolveServiceTemplate = (st) -> Paths.get("servicetemplates", UriUtil.encodePathSegment(st.getTargetNamespace()), st.getIdFromIdOrNameField()); + public static BiFunction resolvePlan = (st, plan) -> resolveServiceTemplate.apply(st).resolve("plans").resolve(plan.getId()); + + public static AbstractArtifact resolveArtifact(Csar csar, Path... pathFragments) { + // FIXME do not rely on save-location + Path location = csar.getSaveLocation(); + for (final Path step : pathFragments) { + location = location.resolve(step); + } + return new PathArtifact(location.toAbsolutePath()); + } + + private static class PathArtifact extends AbstractArtifact { + + private final Path path; + + public PathArtifact(Path path) { + super(path.toString(), Collections.emptySet(), Collections.emptySet()); + this.path = path; + } + + private Path artifactRoot() { + return isFileArtifact() ? path.getParent() : path; + } + + @Override + protected AbstractDirectory getArtifactRoot() { + return new FileSystemDirectory(artifactRoot()); + } + + @Override + public boolean isFileArtifact() { + return Files.isRegularFile(path); + } + + @Override + public AbstractFile getFile(String name) { + if (isFileArtifact()) { + return new FileSystemFile(path); + } + if (name.isEmpty()) { + // no way to resolve an empty name + return null; + } + return new FileSystemFile(artifactRoot().resolve(name)); + } + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemDirectory.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemDirectory.java new file mode 100644 index 000000000..ced6a151c --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemDirectory.java @@ -0,0 +1,126 @@ +package org.opentosca.container.core.model.csar.backwards; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.DirectoryIteratorException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +import org.opentosca.container.core.model.AbstractDirectory; +import org.opentosca.container.core.model.AbstractFile; + +// we want to remove the idea of directories +@Deprecated +public class FileSystemDirectory extends AbstractDirectory { + + private final Path representedPath; + + public FileSystemDirectory(Path dirPath) { + super(dirPath.toAbsolutePath().toString(), Collections.emptySet(), Collections.emptySet(), false); + if (Files.exists(dirPath) && !Files.isDirectory(dirPath)) { + throw new IllegalArgumentException("Given path " + dirPath + " was not a directory"); + } + representedPath = dirPath; + } + + @Override + public AbstractFile getFile(String relPathOfFile) { + Path resolved = representedPath.resolve(relPathOfFile); + if (Files.exists(resolved) && Files.isRegularFile(resolved)) { + return new FileSystemFile(resolved); + } + return null; + } + + @Override + public Set getFilesRecursively() { + try { + return Files.walk(representedPath) + .filter(Files::isRegularFile) + .map(FileSystemFile::new) + .collect(Collectors.toSet()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + @Override + public String getPath() { + return representedPath.toAbsolutePath().toString(); + } + + @Override + public Set getDirectories() { + Set result = new HashSet<>(); + try (DirectoryStream stream = Files.newDirectoryStream(representedPath)) { + for (Path entry : stream) { + if (Files.isDirectory(entry)) { + result.add(entry); + } + } + } catch (DirectoryIteratorException ex) { + // I/O error encounted during the iteration, the cause is an IOException + throw new UncheckedIOException((IOException) ex.getCause()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + return result.stream().map(FileSystemDirectory::new).collect(Collectors.toSet()); + } + + @Override + protected AbstractFile getFileNotConsiderPatterns(String relPathOfFile) { + return new FileSystemFile(representedPath.resolve(relPathOfFile)); + } + + @Override + protected Set getFilesNotConsiderPatterns() { + Set result = new HashSet<>(); + try (DirectoryStream stream = Files.newDirectoryStream(representedPath)) { + for (Path entry : stream) { + if (Files.isRegularFile(entry)) { + result.add(entry); + } + } + } catch (DirectoryIteratorException ex) { + // I/O error encounted during the iteration, the cause is an IOException + throw new UncheckedIOException((IOException) ex.getCause()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + return result.stream().map(FileSystemFile::new).collect(Collectors.toSet()); + } + + @Override + public AbstractDirectory getDirectory(String relPathOfDirectory) { + Path resolved = representedPath.resolve(relPathOfDirectory); + if (Files.exists(resolved) && Files.isDirectory(resolved)) { + return new FileSystemDirectory(resolved); + } + return null; + } + + @Override + public String getName() { + // getFileName just returns the last path fragment + return representedPath.getFileName().toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FileSystemDirectory that = (FileSystemDirectory) o; + return Objects.equals(representedPath, that.representedPath); + } + + @Override + public int hashCode() { + return Objects.hash(representedPath); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemDirectoryArtifact.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemDirectoryArtifact.java new file mode 100644 index 000000000..f38065c1b --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemDirectoryArtifact.java @@ -0,0 +1,27 @@ +package org.opentosca.container.core.model.csar.backwards; + +import java.util.Collections; + +import org.opentosca.container.core.model.AbstractArtifact; +import org.opentosca.container.core.model.AbstractDirectory; + +@Deprecated +public class FileSystemDirectoryArtifact extends AbstractArtifact { + + private final FileSystemDirectory artifactRoot; + + public FileSystemDirectoryArtifact(final FileSystemDirectory artifactRoot) { + super(artifactRoot.getPath(), Collections.emptySet(), Collections.emptySet()); + this.artifactRoot = artifactRoot; + } + + @Override + protected AbstractDirectory getArtifactRoot() { + return artifactRoot; + } + + @Override + public boolean isFileArtifact() { + return false; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemFile.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemFile.java new file mode 100644 index 000000000..7dd22badf --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/FileSystemFile.java @@ -0,0 +1,56 @@ +package org.opentosca.container.core.model.csar.backwards; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; + +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.model.AbstractFile; + +@Deprecated +public class FileSystemFile extends AbstractFile { + + private final Path actualPath; + + public FileSystemFile(Path actualPath) { + super(actualPath.toString()); + if (!Files.isRegularFile(actualPath)) { + throw new IllegalArgumentException(); + } + this.actualPath = actualPath; + } + + @Override + public Path getFile() throws SystemException { + return actualPath; + } + + @Override + public InputStream getFileAsInputStream() throws SystemException { + try { + return Files.newInputStream(actualPath, StandardOpenOption.READ); + } catch (IOException e) { + throw new SystemException("Could not create input stream", e); + } + } + + @Override + public String getName() { + return actualPath.getFileName().toString(); + } + + @Override + public String toString() { + return actualPath.toString(); + } + + @Override + public boolean equals(Object other) { + if (other instanceof FileSystemFile) { + return this.actualPath.equals(((FileSystemFile) other).actualPath); + } + return false; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/ToscaMetaFileReplacement.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/ToscaMetaFileReplacement.java new file mode 100644 index 000000000..2a47389cf --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/backwards/ToscaMetaFileReplacement.java @@ -0,0 +1,43 @@ +package org.opentosca.container.core.model.csar.backwards; + +import java.io.File; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.file.Paths; + +import org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFile; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.model.csar.Csar; + +@SuppressWarnings("serial") +public class ToscaMetaFileReplacement extends TOSCAMetaFile { + + private final Csar wrappedCsar; + + public ToscaMetaFileReplacement(Csar wrappedCsar) { + this.wrappedCsar = wrappedCsar; + } + + @Override + public String getEntryDefinitions() { + final TServiceTemplate entryServiceTemplate = wrappedCsar.entryServiceTemplate(); + try { + return "servicetemplates" + File.separator + + URLEncoder.encode(entryServiceTemplate.getTargetNamespace(), "UTF-8") + + File.separator + entryServiceTemplate.getId() + + File.separator + "ServiceTemplate.tosca"; + } catch (UnsupportedEncodingException e) { + // yea you deserve that one. + throw new RuntimeException(e); + } + } + + @Override + public String getTopology() { + return Paths.get(wrappedCsar.topologyPicture() + .getPath()) + .relativize(wrappedCsar.getSaveLocation()) + .toString(); + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/id/CSARID.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/id/CSARID.java similarity index 95% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/csar/id/CSARID.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/id/CSARID.java index 52ddf84a7..912ca100c 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/id/CSARID.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/csar/id/CSARID.java @@ -5,16 +5,15 @@ /** * Identification of a CSAR file in OpenTOSCA. */ -// TODO: Rename to CsarId +// TODO: 195 references work with this. +@Deprecated public class CSARID implements Comparable, Serializable { private static final long serialVersionUID = 1889149925607823116L; protected String fileName; - protected CSARID() { - } public CSARID(final String fileName) { diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/AbstractDeploymentInfo.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/AbstractDeploymentInfo.java new file mode 100644 index 000000000..f5b54df4e --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/AbstractDeploymentInfo.java @@ -0,0 +1,46 @@ +package org.opentosca.container.core.model.deployment; + +import javax.persistence.Column; +import javax.persistence.Convert; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; + +import org.opentosca.container.core.common.jpa.CsarIdConverter; +import org.opentosca.container.core.model.csar.CsarId; + +/** + * Abstract class for deployment information that belongs to a CSAR file. + */ +@MappedSuperclass +public abstract class AbstractDeploymentInfo { + + // because we cannot convert CsarId when it's marked as Id, we use a surrogate Id here + @Id + @GeneratedValue + private long id; + + // must not be annotated as @Id because converters do not apply to Ids + @Column(name = "csarID", unique = true, nullable = false) + @Convert(converter = CsarIdConverter.class) + private CsarId csarID; + + // 0-args ctor for JPA + protected AbstractDeploymentInfo() { + } + + /** + * @param csarID that uniquely identifies a CSAR file + */ + public AbstractDeploymentInfo(final CsarId csarID) { + this.csarID = csarID; + } + + public CsarId getCsarID() { + return this.csarID; + } + + public void setCsarID(final CsarId csarID) { + this.csarID = csarID; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/AbstractFileDeploymentInfo.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/AbstractFileDeploymentInfo.java similarity index 77% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/AbstractFileDeploymentInfo.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/AbstractFileDeploymentInfo.java index b16079e6d..16df65ed6 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/AbstractFileDeploymentInfo.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/AbstractFileDeploymentInfo.java @@ -3,7 +3,7 @@ import javax.persistence.Column; import javax.persistence.MappedSuperclass; -import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.core.model.csar.CsarId; /** * Abstract class for the deployment information of a file inside a CSAR file. @@ -18,19 +18,17 @@ public abstract class AbstractFileDeploymentInfo extends AbstractDeploymentInfo private String relPath; /** - * Counts the number of deployment / undeployment attempts. It will be incremented by one on every - * deployment / undeployment attempt. If a file is deployed and will be now undeployed it will be - * reseted to 0. + * Counts the number of deployment / undeployment attempts. It will be incremented by one on every deployment / + * undeployment attempt. If a file is deployed and will be now undeployed it will be reseted to 0. */ @Column(name = "Attempt") private int attempt = 0; - + // 0-args ctor for JPA protected AbstractFileDeploymentInfo() { - } - public AbstractFileDeploymentInfo(final CSARID csarID, final String relPath) { + public AbstractFileDeploymentInfo(final CsarId csarID, final String relPath) { super(csarID); this.relPath = relPath; } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/ia/IADeploymentInfo.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/ia/IADeploymentInfo.java new file mode 100644 index 000000000..db8fe66c8 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/ia/IADeploymentInfo.java @@ -0,0 +1,68 @@ +package org.opentosca.container.core.model.deployment.ia; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.deployment.AbstractFileDeploymentInfo; + +/** + * Deployment information of a Implementation Artifact inside a CSAR file. It is used for tracking its deploy progress. + */ +@Entity +@Inheritance(strategy = InheritanceType.JOINED) +@NamedQueries( { + @NamedQuery(name = IADeploymentInfo.getIADeploymentInfoByCSARIDAndRelPath, + query = IADeploymentInfo.getIADeploymentInfoByCSARIDAndRelPathQuery), + @NamedQuery(name = IADeploymentInfo.getIADeploymentInfoByCSARID, + query = IADeploymentInfo.getIADeploymentInfoByCSARIDQuery) +}) +@Table(name = IADeploymentInfo.tableName, + uniqueConstraints = @UniqueConstraint(columnNames = {"csarID", "RelPath"})) +public class IADeploymentInfo extends AbstractFileDeploymentInfo { + + public static final String getIADeploymentInfoByCSARIDAndRelPath = "IADeploymentInfo.ByCSARIDAndRelPath"; + public static final String getIADeploymentInfoByCSARID = "IADeploymentInfo.ByCSARID"; + + protected static final String tableName = "IADeploymentInfo"; + + /* + * JPQL Queries + */ + protected static final String getIADeploymentInfoByCSARIDAndRelPathQuery = + "select t from " + IADeploymentInfo.tableName + " t where t.relPath = :iaRelPath and t.csarID = :csarID"; + protected static final String getIADeploymentInfoByCSARIDQuery = + "select t from " + IADeploymentInfo.tableName + " t where t.csarID = :csarID"; + + /** + * Deployment state of this IA. + */ + @Enumerated(EnumType.STRING) + @Column(name = "DeploymentState") + private IADeploymentState deploymentState; + + protected IADeploymentInfo() { + + } + + public IADeploymentInfo(final CsarId csarID, final String relPath, final IADeploymentState deploymentState) { + super(csarID, relPath); + this.deploymentState = deploymentState; + } + + public IADeploymentState getDeploymentState() { + return this.deploymentState; + } + + public void setDeploymentState(final IADeploymentState deploymentState) { + this.deploymentState = deploymentState; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/ia/IADeploymentState.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/ia/IADeploymentState.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/ia/IADeploymentState.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/ia/IADeploymentState.java diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/plan/PlanDeploymentInfo.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/plan/PlanDeploymentInfo.java new file mode 100644 index 000000000..3f49fe502 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/plan/PlanDeploymentInfo.java @@ -0,0 +1,69 @@ +package org.opentosca.container.core.model.deployment.plan; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.deployment.AbstractFileDeploymentInfo; + +/** + * Deployment information of a Plan inside a CSAR file. It is used for tracking its deploy progress. + */ +@Entity +@Inheritance(strategy = InheritanceType.JOINED) +@NamedQueries( { + @NamedQuery(name = PlanDeploymentInfo.getPlanDeploymentInfoByCSARIDAndRelPath, + query = PlanDeploymentInfo.getPlanDeploymentInfoByCSARIDAndRelPathQuery), + @NamedQuery(name = PlanDeploymentInfo.getPlanDeploymentInfoByCSARID, + query = PlanDeploymentInfo.getPlanDeploymentInfoByCSARIDQuery) +}) +@Table(name = PlanDeploymentInfo.tableName, + uniqueConstraints = @UniqueConstraint(columnNames = {"csarID", "RelPath"}) +) +public class PlanDeploymentInfo extends AbstractFileDeploymentInfo { + + public static final String getPlanDeploymentInfoByCSARID = "PlanDeploymentInfo.ByCSARID"; + public static final String getPlanDeploymentInfoByCSARIDAndRelPath = "PlanDeploymentInfo.ByCSARIDAndRelPath"; + + protected final static String tableName = "PlanDeploymentInfo"; + + /* + * JPQL Queries + */ + protected static final String getPlanDeploymentInfoByCSARIDAndRelPathQuery = + "select t from " + PlanDeploymentInfo.tableName + " t where t.relPath = :planRelPath and t.csarID = :csarID"; + protected static final String getPlanDeploymentInfoByCSARIDQuery = + "select t from " + PlanDeploymentInfo.tableName + " t where t.csarID = :csarID"; + + /** + * Deployment state of this Plan. + */ + @Enumerated(EnumType.STRING) + @Column(name = "DeploymentState") + private PlanDeploymentState deploymentState; + + protected PlanDeploymentInfo() { + + } + + public PlanDeploymentInfo(final CsarId csarID, final String relPath, final PlanDeploymentState deploymentState) { + super(csarID, relPath); + this.deploymentState = deploymentState; + } + + public PlanDeploymentState getDeploymentState() { + return this.deploymentState; + } + + public void setDeploymentState(final PlanDeploymentState deploymentState) { + this.deploymentState = deploymentState; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/plan/PlanDeploymentState.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/plan/PlanDeploymentState.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/plan/PlanDeploymentState.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/plan/PlanDeploymentState.java diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/process/DeploymentProcessInfo.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/process/DeploymentProcessInfo.java similarity index 77% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/process/DeploymentProcessInfo.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/process/DeploymentProcessInfo.java index f1694fd9a..c6c1af65b 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/process/DeploymentProcessInfo.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/process/DeploymentProcessInfo.java @@ -10,24 +10,22 @@ import javax.persistence.NamedQuery; import javax.persistence.Table; -import org.eclipse.persistence.annotations.PrimaryKey; -import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.core.model.csar.CsarId; import org.opentosca.container.core.model.deployment.AbstractDeploymentInfo; /** - * Deployment information of a CSAR file. It is used for tracking its deploy progress. + * Deployment information of a Csar file. It is used for tracking its deploy progress. */ @Entity @Inheritance(strategy = InheritanceType.JOINED) -@NamedQueries({@NamedQuery(name = DeploymentProcessInfo.getDeploymentProcessInfoByCSARID, - query = DeploymentProcessInfo.getDeploymentProcessInfoByCSARIDQuery)}) +@NamedQueries( {@NamedQuery(name = DeploymentProcessInfo.getDeploymentProcessInfoByCSARID, + query = DeploymentProcessInfo.getDeploymentProcessInfoByCSARIDQuery)}) @Table(name = DeploymentProcessInfo.tableName) -@PrimaryKey(columns = {@Column(name = "csarID")}) public class DeploymentProcessInfo extends AbstractDeploymentInfo { - protected static final String tableName = "DeploymentProcessInfo"; - public static final String getDeploymentProcessInfoByCSARID = "DeploymentProcessInfo.ByCSARID"; + + protected static final String tableName = "DeploymentProcessInfo"; protected static final String getDeploymentProcessInfoByCSARIDQuery = "select t from " + DeploymentProcessInfo.tableName + " t where t.csarID = :csarID"; @@ -35,12 +33,11 @@ public class DeploymentProcessInfo extends AbstractDeploymentInfo { @Column(name = "DeploymentProcessState") private DeploymentProcessState deploymentProcessState; - + // 0-args ctor for JPA protected DeploymentProcessInfo() { - } - public DeploymentProcessInfo(final CSARID csarID, final DeploymentProcessState deploymentProcessState) { + public DeploymentProcessInfo(final CsarId csarID, final DeploymentProcessState deploymentProcessState) { super(csarID); this.deploymentProcessState = deploymentProcessState; } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/process/DeploymentProcessOperation.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/process/DeploymentProcessOperation.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/process/DeploymentProcessOperation.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/process/DeploymentProcessOperation.java diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/process/DeploymentProcessState.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/process/DeploymentProcessState.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/process/DeploymentProcessState.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/deployment/process/DeploymentProcessState.java diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/AbstractEndpoint.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/AbstractEndpoint.java new file mode 100644 index 000000000..4c6fc4eda --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/AbstractEndpoint.java @@ -0,0 +1,149 @@ +package org.opentosca.container.core.model.endpoint; + +import java.net.URI; +import java.util.Map; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Convert; +import javax.persistence.ElementCollection; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; + +import org.opentosca.container.core.common.jpa.CsarIdConverter; +import org.opentosca.container.core.common.jpa.UriConverter; +import org.opentosca.container.core.model.csar.CsarId; + +/** + * This abstract class is used as a super-class for WSDL and REST Endpoints. + */ +@MappedSuperclass +public abstract class AbstractEndpoint { + + @Id + @GeneratedValue + protected Long id; + + /** + * The URI which can be used to access the endpoint that is represented by this class. + */ + @Convert(converter = UriConverter.class) + @Column(name = "uri", nullable = false) + private URI uri; + + /** + * The host name of the OpenTOSCA Container where the CSAR identified by {@link GenericEndpoint#csarId} is deployed. + * This attribute is needed to clearly identify CSARs and service instances for collaboration, because otherwise + * different OpenTOSCA Containers could use the same IDs for different instances. When no collaboration is used, + * this attribute is always the host name of the local Container. + */ + @Basic + @Column(name = "triggeringContainer", nullable = false) + private String triggeringContainer; + + /** + * The host name of the OpenTOSCA Container which manages this endpoint. If the endpoint is deployed by the local + * Container, the field equals the value of {@link org.opentosca.container.core.common.Settings#OPENTOSCA_CONTAINER_HOSTNAME}. + * If the endpoint was created by collaboration between different OpenTOSCA Container instances, the field + * identifies the Container that is responsible for access to and the undeployment of the endpoint. This might be + * necessary if the endpoint is protected by a firewall and can not be accessed directly by this Container. + */ + @Basic + @Column(name = "managingContainer", nullable = false) + private String managingContainer; + + /** + * Identifies the CSAR to which this endpoint belongs. The ID has to be set for all endpoints, except the Management + * Bus endpoint as this endpoint is CSAR independent. To avoid null values "***" is set for this endpoint. + */ + @Convert(converter = CsarIdConverter.class) + @Column(name = "csarID") + private CsarId csarId; + + /** + * Identifies a service instance of the CSAR defined by {@link GenericEndpoint#csarId} where this endpoint belongs + * to. Some endpoints belong to a certain service instance of a CSAR (IA endpoints) whereas others only belong to a + * CSAR (Plan endpoints). Therefore, this field is set for IA endpoints and it is null for Plan endpoints. + */ + @Basic + @Column(name = "serviceTemplateInstanceID") + private Long serviceTemplateInstanceID; + + @ElementCollection + @Column(name = "metadata") + private Map metadata; + + public AbstractEndpoint() { + super(); + } + + /** + * Constructor + */ + public AbstractEndpoint(final URI uri, final String triggeringContainer, final String managingContainer, + final CsarId csarId, final Long serviceTemplateInstanceID, final Map metadata) { + setURI(uri); + setTriggeringContainer(triggeringContainer); + setManagingContainer(managingContainer); + setCsarId(csarId); + setServiceTemplateInstanceID(serviceTemplateInstanceID); + setMetadata(metadata); + } + + public void setCsarId(final CsarId csarId) { + this.csarId = csarId; + } + + public Long getId() { + return this.id; + } + + public void setId(final Long id) { + this.id = id; + } + + public URI getURI() { + return this.uri; + } + + public void setURI(final URI uri) { + this.uri = uri; + } + + public CsarId getCsarId() { + return this.csarId; + } + + public Long getServiceTemplateInstanceID() { + return this.serviceTemplateInstanceID; + } + + public void setServiceTemplateInstanceID(final Long serviceTemplateInstanceID) { + this.serviceTemplateInstanceID = serviceTemplateInstanceID; + } + + public String getManagingContainer() { + return this.managingContainer; + } + + public void setManagingContainer(final String managingContainer) { + this.managingContainer = managingContainer; + } + + public String getTriggeringContainer() { + return this.triggeringContainer; + } + + public void setTriggeringContainer(final String triggeringContainer) { + this.triggeringContainer = triggeringContainer; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/Parameter.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/Parameter.java similarity index 81% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/Parameter.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/Parameter.java index a94668f4d..57f01077a 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/Parameter.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/Parameter.java @@ -1,11 +1,15 @@ package org.opentosca.container.core.model.endpoint.rest; +import javax.persistence.Column; +import javax.persistence.Embeddable; + +@Embeddable public class Parameter { + @Column(unique = true) private String parameter; private boolean required; - public boolean isRequired() { return this.required; } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/RESTEndpoint.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/RESTEndpoint.java new file mode 100644 index 000000000..cf07ec5d8 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/RESTEndpoint.java @@ -0,0 +1,147 @@ +package org.opentosca.container.core.model.endpoint.rest; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Convert; +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; +import javax.xml.namespace.QName; + +import org.opentosca.container.core.common.jpa.QNameConverter; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.AbstractEndpoint; + +/** + * This class Represents a REST-Endpoint (an endpoint with a REST-Operation). For the fields of this class refer to the + * REST operation element in the TOSCA-Specification. + */ +// Named Queries for JPA +@NamedQueries( {@NamedQuery(name = RESTEndpoint.getEndpointForPath, query = RESTEndpoint.getEndpointForPathQuery), + @NamedQuery(name = RESTEndpoint.getEndpointForPathAndMethod, + query = RESTEndpoint.getEndpointForPathAndMethodQuery), + @NamedQuery(name = RESTEndpoint.getEndpointForUri, query = RESTEndpoint.getEndpointForUriQuery)}) +@Entity +@Inheritance(strategy = InheritanceType.JOINED) +@Table(name = RESTEndpoint.tableName, uniqueConstraints = @UniqueConstraint(columnNames = {"path", "method", "csarId", "triggeringContainer"})) +public class RESTEndpoint extends AbstractEndpoint { + + // Named queries: + public static final String getEndpointForPath = "RESTEndpoint.getByPath"; + public static final String getEndpointForPathAndMethod = "RESTEndpoint.getByPathAndMethod"; + public static final String getEndpointForUri = "RESTEndpoint.getByUri"; + + protected static final String tableName = "RESTEndpoint"; + // Query to retrieve RESTEndpoints by Path. + protected static final String getEndpointForPathQuery = + "select t from " + RESTEndpoint.tableName + " t where t.path = :path and t.csarId = :csarId and t.triggeringContainer = :triggeringContainer"; + // Query to retrieve a RESTEndpoint by Path and Method + protected static final String getEndpointForPathAndMethodQuery = "select t from " + RESTEndpoint.tableName + + " t where t.path = :path and t.method = :method and t.csarId = :csarId and t.triggeringContainer = :triggeringContainer"; + // Query to check if an Endpoint with given URI exists. + protected static final String getEndpointForUriQuery = + "select t from " + RESTEndpoint.tableName + " t where t.uri = :uri and t.csarId = :csarId and t.triggeringContainer = :triggeringContainer"; + + public enum restMethod { + GET, PUT, POST, DELETE + } + + // Converter to Convert QNames to String, and back from String to QName. + // Used when persisting, so we can Query for QName-Objects. + @Basic + @Convert(converter = QNameConverter.class) + @Column(name = "method") + private restMethod method; + + @Column(name = "path") + private String path; + + @Convert(converter = QNameConverter.class) + private QName requestPayload; + + @Convert(converter = QNameConverter.class) + private QName responsePayload; + + @Column(name = "RequestHeaders") + @ElementCollection + private final List headers = new ArrayList<>(); + + @Column(name = "Parameters") + @ElementCollection + private final List params = new ArrayList<>(); + + public RESTEndpoint() { + super(); + } + + public RESTEndpoint(final URI uri, final restMethod method, final String triggeringContainer, + final String managingContainer, final CsarId csarId, final Long serviceInstanceID, + final Map metadata) { + super(uri, triggeringContainer, managingContainer, csarId, serviceInstanceID, metadata); + this.method = method; + this.path = uri.getPath(); + } + + public RESTEndpoint(final String host, final String path, final restMethod method, final String managingContainer, + final String triggeringContainer, final CsarId csarId, + final Long serviceInstanceID, final Map metadata) throws URISyntaxException { + // Check if the path starts with a "/", if not we prepend a "/". + this(new URI(host + (path.charAt(0) == '/' ? path : '/' + path)), method, triggeringContainer, + managingContainer, csarId, serviceInstanceID, metadata); + } + + public RESTEndpoint(final URI uri, final restMethod method, final QName requestPayload, final QName responsePayload, + final String triggeringContainer, final String managingContainer, final CsarId csarId, + final Long serviceInstanceID, Map metadata) { + this(uri, method, triggeringContainer, managingContainer, csarId, serviceInstanceID, metadata); + this.requestPayload = requestPayload; + this.responsePayload = responsePayload; + } + + public QName getRequestPayload() { + return this.requestPayload; + } + + public QName getResponsePayload() { + return this.responsePayload; + } + + public restMethod getRequestMethod() { + return this.method; + } + + public String getPath() { + return this.path; + } + + public void setPath(final String path) { + this.path = path; + } + + public void addParameter(final Parameter p) { + this.params.add(p); + } + + public void addRequestHeader(final RequestHeader h) { + this.headers.add(h); + } + + public List getRequestHeaders() { + return this.headers; + } + + public List getParameters() { + return this.params; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/RequestHeader.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/RequestHeader.java similarity index 81% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/RequestHeader.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/RequestHeader.java index 56089a171..74f9b0d36 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/RequestHeader.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/rest/RequestHeader.java @@ -1,11 +1,15 @@ package org.opentosca.container.core.model.endpoint.rest; +import javax.persistence.Column; +import javax.persistence.Embeddable; + +@Embeddable public class RequestHeader { + @Column(unique = true) private String header; private boolean required; - public boolean isRequired() { return this.required; } @@ -21,5 +25,4 @@ public String getHeader() { public void setHeader(final String header) { this.header = header; } - } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/wsdl/WSDLEndpoint.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/wsdl/WSDLEndpoint.java new file mode 100644 index 000000000..4bf11f009 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/endpoint/wsdl/WSDLEndpoint.java @@ -0,0 +1,131 @@ +package org.opentosca.container.core.model.endpoint.wsdl; + +import java.net.URI; +import java.util.Map; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Convert; +import javax.persistence.Entity; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; +import javax.xml.namespace.QName; + +import org.opentosca.container.core.common.jpa.QNameConverter; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.AbstractEndpoint; + +/** + * This class Represents a WSDL-Endpoint (an endpoint which points to a SOAP-Operation of a WSDL). For the fields of + * this class refer to the WSDL operation element in the TOSCA-Specification. + */ +@Entity +@Inheritance(strategy = InheritanceType.JOINED) +@Table(name = WSDLEndpoint.tableName, + uniqueConstraints = @UniqueConstraint(columnNames = {"portType", "csarId", "managingContainer", + "serviceTemplateInstanceID"})) +@NamedQueries( { + @NamedQuery(name = WSDLEndpoint.getWSDLEndpointByPortType, query = WSDLEndpoint.queryByPortType) +}) +public class WSDLEndpoint extends AbstractEndpoint { + + public static final String getWSDLEndpointByPortType = "wsdlEndpointByPortType"; + // Table Name + protected final static String tableName = "WSDLEndpoint"; + + // NamedQuery names and queries + protected final static String queryByPortType = "SELECT e FROM WSDLEndpoint e where e.triggeringContainer = :triggeringContainer and e.csarId = :csarId and e.PortType = :portType"; + + // Converter to Convert QNames to String, and back from String to QName. + // Used when persisting, so we can Query for QName-Objects. + @Basic + @Convert(converter = QNameConverter.class) + @Column(name = "PortType") + private QName PortType; + + // NodeTypeImplementation/RelationshipTypeImplementation and IA name are there to identify + // specific IAs + @Basic + @Convert(converter = QNameConverter.class) + @Column(name = "TypeImplementation") + private QName TypeImplementation; + + @Basic + @Column(name = "IaName") + private String IaName; + + // only the planid is used for plan endpoints, cause in tosca the id for a + // plan must be unique in the targetnamespace + @Basic + @Convert(converter = QNameConverter.class) + @Column(name = "PlanId") + private QName PlanId; + + public WSDLEndpoint() { + super(); + } + + // if planid is set serviceInstanceID, nodeTypeimpl and iaName must be "null" + public WSDLEndpoint(final URI uri, final QName portType, final String triggeringContainer, + final String managingContainer, final CsarId csarId, final Long serviceInstanceID, + final QName planid, final QName nodeTypeImplementation, final String iaName, final + Map metadata) { + super(uri, triggeringContainer, managingContainer, csarId, serviceInstanceID, metadata); + setPortType(portType); + setIaName(iaName); + setPlanId(planid); + setTypeImplementation(nodeTypeImplementation); + } + + public QName getPortType() { + return this.PortType; + } + + public void setPortType(final QName portType) { + this.PortType = portType; + } + + public QName getTypeImplementation() { + return this.TypeImplementation; + } + + public void setTypeImplementation(final QName nodeTypeImplementation) { + this.TypeImplementation = nodeTypeImplementation; + } + + public QName getPlanId() { + return this.PlanId; + } + + public void setPlanId(final QName planId) { + this.PlanId = planId; + } + + public String getIaName() { + return this.IaName; + } + + public void setIaName(final String iaName) { + this.IaName = iaName; + } + + @Override + public boolean equals(final Object o) { + if (!(o instanceof WSDLEndpoint)) { + return false; + } + + final WSDLEndpoint compareEndpoint = (WSDLEndpoint) o; + if (compareEndpoint.getId() != getId()) { + return false; + } + if (!compareEndpoint.getCsarId().equals(getCsarId())) { + return false; + } + return true; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/IdConverter.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/IdConverter.java similarity index 88% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/instance/IdConverter.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/IdConverter.java index e3f82cc2a..955b93b8d 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/IdConverter.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/IdConverter.java @@ -3,8 +3,8 @@ import java.net.URI; /** - * Converts internal service and nodeInstanceIDS (the int values inside the DB) to external URIs - * which can be used by external services and vice-versa + * Converts internal service and nodeInstanceIDS (the int values inside the DB) to external URIs which can be used by + * external services and vice-versa */ @Deprecated public class IdConverter { @@ -16,7 +16,6 @@ public class IdConverter { public final static String relationInstancePath = "/instancedata/relationInstances/"; public final static String serviceInstancePath = "/instancedata/serviceInstances/"; - public static Integer nodeInstanceUriToID(final URI nodeInstanceID) { String path = nodeInstanceID.getPath(); @@ -27,8 +26,7 @@ public static Integer nodeInstanceUriToID(final URI nodeInstanceID) { try { return Integer.parseInt(path); - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return nodeInstanceUriToID(path); } } @@ -47,12 +45,10 @@ private static Integer nodeInstanceUriToID(final String nodeInstanceIDPath) { if (paths[paths.length - 2].equals("Instances") & paths[paths.length - 4].equals("NodeTemplates")) { try { return Integer.parseInt(paths[paths.length - 1]); - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return null; } } - return null; } @@ -66,8 +62,7 @@ public static Integer relationInstanceUriToID(final URI relationInstanceID) { try { return Integer.parseInt(path); - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return relationInstanceUriToID(path); } } @@ -79,12 +74,10 @@ private static Integer relationInstanceUriToID(final String relationInstanceIDPa if (paths[paths.length - 2].equals("Instances") & paths[paths.length - 4].equals("RelationshipTemplates")) { try { return Integer.parseInt(paths[paths.length - 1]); - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return null; } } - return null; } @@ -98,8 +91,7 @@ public static Integer serviceInstanceUriToID(final URI serviceInstanceID) { try { return Integer.parseInt(path); - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return null; } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/NodeInstance.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/NodeInstance.java similarity index 79% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/instance/NodeInstance.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/NodeInstance.java index cc1a28236..872f4cfd8 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/NodeInstance.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/NodeInstance.java @@ -7,6 +7,7 @@ import java.util.Date; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; @@ -24,9 +25,6 @@ import javax.persistence.Transient; import javax.xml.namespace.QName; -import org.eclipse.persistence.annotations.Convert; -import org.eclipse.persistence.annotations.Converter; -import org.eclipse.persistence.annotations.Converters; import org.opentosca.container.core.common.Settings; import org.opentosca.container.core.common.jpa.DocumentConverter; import org.opentosca.container.core.common.jpa.QNameConverter; @@ -37,9 +35,7 @@ */ @Deprecated @Entity -@Converters({@Converter(name = "QNameConverter", converterClass = QNameConverter.class), - @Converter(name = "DOMDocumentConverter", converterClass = DocumentConverter.class)}) -@NamedQueries({@NamedQuery(name = NodeInstance.getNodeInstances, query = NodeInstance.getNodeInstancesQuery)}) +@NamedQueries( {@NamedQuery(name = NodeInstance.getNodeInstances, query = NodeInstance.getNodeInstancesQuery)}) public class NodeInstance { // Query to retrieve NodeInstances identified by some parameters @@ -60,7 +56,7 @@ public class NodeInstance { @Transient private URI nodeInstanceID; - @Convert("QNameConverter") + @Convert(converter = QNameConverter.class) private QName nodeTemplateID; // the name of the corresponding NodeTemplate @@ -73,35 +69,34 @@ public class NodeInstance { // foreign key relationship to serviceInstance @ManyToOne @JoinColumn(name = "serviceInstance") - ServiceInstance serviceInstance; + private ServiceInstance serviceInstance; @Column(name = "properties", columnDefinition = "VARCHAR(8192)") - @Convert("DOMDocumentConverter") - Document properties; + @Convert(converter = DocumentConverter.class) + private Document properties; @Enumerated(EnumType.STRING) private State.Node state = State.Node.INITIAL; // nodeType of the nodeTemplate which this nodeInstance depends on - @Convert("QNameConverter") + @Convert(converter = QNameConverter.class) private QName nodeType; - // This empty constructor is required by JPA @SuppressWarnings("unused") - private NodeInstance() {} + private NodeInstance() { + } /** * Creates a new instance of a NodeTemplate. ID and creation date will be set automatically. * - * @param nodeTemplateID - the nodeTemplateID specified by the Namespace and the ID value of the - * NodeTemplate + * @param nodeTemplateID - the nodeTemplateID specified by the Namespace and the ID value of the NodeTemplate * @param nodeTemplateName - the name of the nodeTemplate */ - public NodeInstance(final QName nodeTemplateID, final String nodeTemplateName, final QName nodeTypeOfNodeTemplate, + public NodeInstance(final String nodeTemplateID, final String nodeTemplateName, final QName nodeTypeOfNodeTemplate, final ServiceInstance serviceInstance) { super(); - this.nodeTemplateID = nodeTemplateID; + this.nodeTemplateID = QName.valueOf(nodeTemplateID); this.nodeTemplateName = nodeTemplateName; this.serviceInstance = serviceInstance; this.created = new Date(); @@ -154,10 +149,9 @@ public ServiceInstance getServiceInstance() { } /** - * The ID persisted in the database is "only" an integer. To the outside, we need the ID to be an - * URI. To avoid storing two IDs in the database we generate the URI ID out of the integer ID. - * Therefore, when reading a NodeInstance object from the database we need to set the URI ID - * accordingly. + * The ID persisted in the database is "only" an integer. To the outside, we need the ID to be an URI. To avoid + * storing two IDs in the database we generate the URI ID out of the integer ID. Therefore, when reading a + * NodeInstance object from the database we need to set the URI ID accordingly. */ @PostLoad @PostPersist @@ -166,15 +160,12 @@ public void setNodeInstanceID() { this.nodeInstanceID = new URI(Settings.CONTAINER_API_LEGACY + "/CSARs/" + this.serviceInstance.getCSAR_ID() + "/ServiceTemplates/" + URLEncoder.encode(URLEncoder.encode(this.serviceInstance.getServiceTemplateID().toString(), "UTF-8"), - "UTF-8") + "UTF-8") + "/Instances/" + this.serviceInstance.getDBId() + "/NodeTemplates/" + this.nodeTemplateID.getLocalPart() + "/Instances/" + this.id); - - } - catch (final URISyntaxException e) { + } catch (final URISyntaxException e) { e.printStackTrace(); - } - catch (final UnsupportedEncodingException e) { + } catch (final UnsupportedEncodingException e) { e.printStackTrace(); } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/RelationInstance.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/RelationInstance.java similarity index 80% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/instance/RelationInstance.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/RelationInstance.java index f21ec3c7c..6db71b6f5 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/RelationInstance.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/RelationInstance.java @@ -7,6 +7,7 @@ import java.util.Date; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; @@ -26,26 +27,20 @@ import javax.persistence.Transient; import javax.xml.namespace.QName; -import org.eclipse.persistence.annotations.Convert; -import org.eclipse.persistence.annotations.Converter; -import org.eclipse.persistence.annotations.Converters; import org.opentosca.container.core.common.Settings; import org.opentosca.container.core.common.jpa.DocumentConverter; import org.opentosca.container.core.common.jpa.QNameConverter; import org.w3c.dom.Document; /** - * * Model class representing a NodeInstance * * @author Marcus Eisele - marcus.eisele@gmail.com */ @Deprecated @Entity -@Converters({@Converter(name = "QNameConverter", converterClass = QNameConverter.class), - @Converter(name = "DOMDocumentConverter", converterClass = DocumentConverter.class)}) -@NamedQueries({@NamedQuery(name = RelationInstance.getRelationInstances, - query = RelationInstance.getRelationInstancesQuery)}) +@NamedQueries( {@NamedQuery(name = RelationInstance.getRelationInstances, + query = RelationInstance.getRelationInstancesQuery)}) public class RelationInstance { // Query to retrieve NodeInstances identified by some parameters @@ -66,10 +61,10 @@ public class RelationInstance { @Transient private URI relationInstanceID; - @Convert("QNameConverter") - private QName relationshipTemplateID; + // same as the relationshipTemplate name, because backwards compat + private String relationshipTemplateID; - // the name of the corresponding NodeTemplate + // the name of the corresponding RelationshipTemplate private String relationshipTemplateName; @Temporal(TemporalType.TIMESTAMP) @@ -79,39 +74,39 @@ public class RelationInstance { // foreign key relationship to serviceInstance @ManyToOne @JoinColumn(name = "serviceInstance") - ServiceInstance serviceInstance; + private ServiceInstance serviceInstance; @OneToOne @PrimaryKeyJoinColumn(name = "id") - NodeInstance sourceInstance; + private NodeInstance sourceInstance; @OneToOne @PrimaryKeyJoinColumn(name = "id") - NodeInstance targetInstance; + private NodeInstance targetInstance; @Column(name = "properties", columnDefinition = "VARCHAR(8192)") - @Convert("DOMDocumentConverter") - Document properties; + @Convert(converter = DocumentConverter.class) + private Document properties; @Enumerated(EnumType.STRING) private State.Relationship state = State.Relationship.INITIAL; // nodeType of the nodeTemplate which this nodeInstance depends on - @Convert("QNameConverter") + @Convert(converter = QNameConverter.class) private QName relationshipType; - // This empty constructor is required by JPA - public RelationInstance() {} + public RelationInstance() { + } /** * Creates a new instance of a NodeTemplate. ID and creation date will be set automatically. * - * @param relationshipTemplateID - the relationshipTemplateID specified by the Namespace and the ID - * value of the RelationshipTemplate + * @param relationshipTemplateID - the relationshipTemplateID specified by the Namespace and the ID value of the + * RelationshipTemplate * @param relationshipTemplateName - the name of the nodeTemplate */ - public RelationInstance(final QName relationshipTemplateID, final String relationshipTemplateName, + public RelationInstance(final String relationshipTemplateID, final String relationshipTemplateName, final QName relationshipTypeOfRelationshipTemplate, final ServiceInstance serviceInstance, final NodeInstance sourceInstanceID, final NodeInstance targetInstanceID) { super(); @@ -141,7 +136,7 @@ public URI getRelationInstanceID() { return this.relationInstanceID; } - public QName getRelationshipTemplateID() { + public String getRelationshipTemplateID() { return this.relationshipTemplateID; } @@ -178,10 +173,9 @@ public NodeInstance getTargetInstance() { } /** - * The ID persisted in the database is "only" an integer. To the outside, we need the ID to be an - * URI. To avoid storing two IDs in the database we generate the URI ID out of the integer ID. - * Therefore, when reading a NodeInstance object from the database we need to set the URI ID - * accordingly. + * The ID persisted in the database is "only" an integer. To the outside, we need the ID to be an URI. To avoid + * storing two IDs in the database we generate the URI ID out of the integer ID. Therefore, when reading a + * NodeInstance object from the database we need to set the URI ID accordingly. */ @PostLoad @PostPersist @@ -190,15 +184,12 @@ public void setRelationInstanceID() { this.relationInstanceID = new URI(Settings.CONTAINER_API_LEGACY + "/CSARs/" + this.serviceInstance.getCSAR_ID() + "/ServiceTemplates/" + URLEncoder.encode(URLEncoder.encode(this.serviceInstance.getServiceTemplateID().toString(), "UTF-8"), - "UTF-8") + "UTF-8") + "/Instances/" + this.serviceInstance.getDBId() + "/RelationshipTemplates/" - + this.relationshipTemplateID.getLocalPart() + "/Instances/" + this.id); - - } - catch (final URISyntaxException e) { + + this.relationshipTemplateID + "/Instances/" + this.id); + } catch (final URISyntaxException e) { e.printStackTrace(); - } - catch (final UnsupportedEncodingException e) { + } catch (final UnsupportedEncodingException e) { e.printStackTrace(); } } @@ -224,7 +215,7 @@ public void setRelationInstanceID(final URI relationInstanceID) { this.relationInstanceID = relationInstanceID; } - public void setRelationshipTemplateID(final QName relationshipTemplateID) { + public void setRelationshipTemplateID(final String relationshipTemplateID) { this.relationshipTemplateID = relationshipTemplateID; } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceInstance.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceInstance.java similarity index 83% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceInstance.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceInstance.java index ec196748f..533257dfb 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceInstance.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceInstance.java @@ -9,6 +9,7 @@ import javax.persistence.CascadeType; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; @@ -26,28 +27,25 @@ import javax.persistence.Transient; import javax.xml.namespace.QName; -import org.eclipse.persistence.annotations.CascadeOnDelete; -import org.eclipse.persistence.annotations.Convert; -import org.eclipse.persistence.annotations.Converter; import org.opentosca.container.core.common.Settings; import org.opentosca.container.core.common.jpa.DocumentConverter; import org.opentosca.container.core.common.jpa.QNameConverter; -import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.core.model.csar.CsarId; import org.w3c.dom.Document; /** * Model class representing a ServiceInstance */ @Entity -@NamedQueries({@NamedQuery(name = ServiceInstance.getServiceInstances, - query = ServiceInstance.getServiceInstancesQuery)}) +@NamedQueries( {@NamedQuery(name = ServiceInstance.getServiceInstances, + query = ServiceInstance.getServiceInstancesQuery)}) @Deprecated public class ServiceInstance { // Query to retrieve ServiceInstances identified by a some parameters public final static String getServiceInstances = "ServiceInstance.getServiceInstancesQuery"; protected final static String getServiceInstancesQuery = - "select s from ServiceInstance s where" + " s.id = COALESCE(:id, s.id) AND" + "select s from ServiceInstance s where s.id = COALESCE(:id, s.id) AND" + " s.serviceTemplateName = COALESCE(:serviceTemplateName, s.serviceTemplateName) AND" + " s.serviceTemplateID = COALESCE(:serviceTemplateID, s.serviceTemplateID)"; @@ -61,8 +59,7 @@ public class ServiceInstance { @Transient private URI serviceInstanceID; - @Convert("QNameConverter") - @Converter(name = "QNameConverter", converterClass = QNameConverter.class) + @Convert(converter = QNameConverter.class) private QName serviceTemplateID; // the name of the corresponding ServiceTemplate @@ -73,52 +70,48 @@ public class ServiceInstance { private Date created; @Transient - private CSARID csarID; + private CsarId csarID; @Column(name = "csarID") private String csarID_DB; @Column(name = "properties", columnDefinition = "VARCHAR(4096)") - @Convert("DocumentConverter") - @Converter(name = "DocumentConverter", converterClass = DocumentConverter.class) - Document properties; + @Convert(converter = DocumentConverter.class) + private Document properties; @Enumerated(EnumType.STRING) private State.ServiceTemplate state = State.ServiceTemplate.INITIAL; - - // This empty constructor is required by JPA - @SuppressWarnings("unused") - private ServiceInstance() {} - - @OneToMany(mappedBy = "serviceInstance", cascade = CascadeType.ALL, fetch = FetchType.EAGER) // cascade on delete tells the JPA Framework to let the DB handle the // deletion (if serviceInstance is deleted => delete also all nodeInstances // who reference it!) - @CascadeOnDelete +// @CascadeOnDelete private List nodeInstances; @OneToMany(mappedBy = "serviceInstance", cascade = CascadeType.ALL, fetch = FetchType.EAGER) // cascade on delete tells the JPA Framework to let the DB handle the // deletion (if serviceInstance is deleted => delete also all nodeInstances // who reference it!) - @CascadeOnDelete +// @CascadeOnDelete private List relationInstances; + // This empty constructor is required by JPA + @SuppressWarnings("unused") + private ServiceInstance() { + } /** * Creates a new instance of a ServiceTemplate. ID and creation date will be set automatically. * - * @param serviceTemplateID - the serviceTemplateID specified by the Namespace and the ID value of - * the ServiceTemplate + * @param serviceTemplateName - the serviceTemplateName, equivalent to the local ID value of the ServiceTemplate * @param serviceTemplateName - the name of the ServiceTemplate */ - public ServiceInstance(final CSARID csarID, final QName serviceTemplateID, final String serviceTemplateName) { + public ServiceInstance(final CsarId csarID, final String serviceTemplateName) { super(); this.csarID = csarID; // needed to persist the object - this.csarID_DB = csarID.getFileName(); + this.csarID_DB = csarID.csarName(); setServiceTemplateID(serviceTemplateID); this.serviceTemplateName = serviceTemplateName; @@ -150,15 +143,14 @@ public void setServiceTemplateName(final String serviceTemplateName) { this.serviceTemplateName = serviceTemplateName; } - public CSARID getCSAR_ID() { + public CsarId getCSAR_ID() { return this.csarID; } /** - * The ID persisted in the database is "only" an integer. To the outside, we need the ID to be an - * URI. To avoid storing two IDs in the database we generate the URI ID out of the integer ID. - * Therefore, when reading a ServiceInstance object from the database we need to set the URI ID - * accordingly. + * The ID persisted in the database is "only" an integer. To the outside, we need the ID to be an URI. To avoid + * storing two IDs in the database we generate the URI ID out of the integer ID. Therefore, when reading a + * ServiceInstance object from the database we need to set the URI ID accordingly. */ @PostLoad @PostPersist @@ -171,12 +163,10 @@ public void setIDs() { new URI(Settings.CONTAINER_API_LEGACY + "/CSARs/" + this.csarID + "/ServiceTemplates/" + URLEncoder.encode(URLEncoder.encode(this.serviceTemplateID.toString(), "UTF-8"), "UTF-8") + "/Instances/" + this.id); - this.csarID = new CSARID(this.csarID_DB); - } - catch (final URISyntaxException e) { + this.csarID = new CsarId(this.csarID_DB); + } catch (final URISyntaxException e) { e.printStackTrace(); - } - catch (final UnsupportedEncodingException e) { + } catch (final UnsupportedEncodingException e) { e.printStackTrace(); } } @@ -302,11 +292,11 @@ public void setId(final int id) { this.id = id; } - public CSARID getCsarID() { + public CsarId getCsarID() { return this.csarID; } - public void setCsarID(final CSARID csarID) { + public void setCsarID(final CsarId csarID) { this.csarID = csarID; } @@ -321,5 +311,4 @@ public void setCsarID_DB(final String csarID_DB) { public void setCreated(final Date created) { this.created = created; } - } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceInstanceId.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceInstanceId.java similarity index 97% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceInstanceId.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceInstanceId.java index 456d86f5d..334465ae0 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceInstanceId.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceInstanceId.java @@ -25,8 +25,8 @@ public class ServiceInstanceId { @XmlElement(name = "ServiceTemplate") private String serviceTemplate; - - public ServiceInstanceId() {} + public ServiceInstanceId() { + } public ServiceInstanceId(final Integer id, final String csar, final String serviceTemplate) { this.id = id; diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceTemplateInstanceID.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceTemplateInstanceID.java similarity index 82% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceTemplateInstanceID.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceTemplateInstanceID.java index 7ad58453a..b2ea90e16 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/ServiceTemplateInstanceID.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/ServiceTemplateInstanceID.java @@ -2,24 +2,24 @@ import javax.xml.namespace.QName; -import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.core.model.csar.CsarId; /** - * This is an identification class for CSARInstances. The CSARInstance is identified by the CSAR it - * is an instance of and a internal ID. + * This is an identification class for CSARInstances. The CSARInstance is identified by the CSAR it is an instance of + * and a internal ID. */ @Deprecated public class ServiceTemplateInstanceID { - private CSARID csarID; + private CsarId csarID; private QName serviceTemplateId; private int serviceTemplateInstanceID = 0; - @SuppressWarnings("unused") - private ServiceTemplateInstanceID() {} + private ServiceTemplateInstanceID() { + } - public ServiceTemplateInstanceID(final CSARID csarID, final QName serviceTemplateId, + public ServiceTemplateInstanceID(final CsarId csarID, final QName serviceTemplateId, final int serviceTemplateInstanceID) { super(); this.setServiceTemplateId(serviceTemplateId); @@ -31,13 +31,13 @@ public int getInstanceID() { return this.serviceTemplateInstanceID; } - public CSARID getCsarId() { + public CsarId getCsarId() { return this.csarID; } @Override public String toString() { - return "InstanceID for CSAR \"" + this.csarID + "\" and internal ID " + this.serviceTemplateInstanceID + "."; + return "InstanceID for CSAR \"" + this.csarID.csarName() + "\" and internal ID " + this.serviceTemplateInstanceID + "."; } @Override diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/State.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/State.java similarity index 87% rename from org.opentosca.container.core/src/org/opentosca/container/core/model/instance/State.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/State.java index f4ee2eeb2..3696849e2 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/instance/State.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/model/instance/State.java @@ -19,11 +19,10 @@ public static enum Relationship { INITIAL, CREATING, CREATED, DELETING, DELETED, ERROR } - /** * A utility method for all enums for string to enum conversion * - * @param c the Enum type + * @param c the Enum type * @param value value as case insesitive string * @return The corresponding enum, or null */ @@ -34,8 +33,8 @@ public static > T valueOf(final Class c, final String value /** * A utility method for all enums for string to enum conversion * - * @param c the Enum type - * @param value value as case insesitive string + * @param c the Enum type + * @param value value as case insesitive string * @param defaultValue a default value * @return The corresponding enum, or null */ @@ -43,8 +42,7 @@ public static > T valueOf(final Class c, final String value if (c != null && value != null) { try { return Enum.valueOf(c, value.trim().toUpperCase()); - } - catch (final IllegalArgumentException e) { + } catch (final IllegalArgumentException e) { return defaultValue; } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/jpa/AutoCloseableEntityManager.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/jpa/AutoCloseableEntityManager.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/jpa/AutoCloseableEntityManager.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/jpa/AutoCloseableEntityManager.java diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/jpa/EntityManagerProvider.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/jpa/EntityManagerProvider.java new file mode 100644 index 000000000..ecb0e4dc4 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/jpa/EntityManagerProvider.java @@ -0,0 +1,46 @@ +package org.opentosca.container.core.next.jpa; + +import java.lang.reflect.Proxy; +import java.util.HashMap; +import java.util.Map; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; + +import org.opentosca.container.core.common.Settings; + +public final class EntityManagerProvider { + + private static final String DATABASE_FILE = Settings.DBDIR.resolve("opentosca").toAbsolutePath().toString(); + private static final String DATABASE_PROPERTIES = ";AUTO_SERVER=TRUE"; + private static final String JDBC_URL = "jdbc:h2:file:" + DATABASE_FILE + DATABASE_PROPERTIES; + + private static final String PERSISTENCE_UNIT = "default"; + + private static EntityManagerFactory emf; + + static { + final Map cfg = new HashMap<>(); + // We cannot reference Java's temp directory through the persistence.xml + // Therefore, we set the "javax.persistence.jdbc.url" property via code. + cfg.put("javax.persistence.jdbc.url", JDBC_URL); + emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT, cfg); + } + + public static AutoCloseableEntityManager createEntityManager() { + return createEntityManager(emf.createEntityManager()); + } + + public static AutoCloseableEntityManager createEntityManager(final EntityManager em) { + return proxyOf(em); + } + + private static AutoCloseableEntityManager proxyOf(final EntityManager em) { + return (AutoCloseableEntityManager) Proxy.newProxyInstance(EntityManagerProvider.class.getClassLoader(), + new Class[] {AutoCloseableEntityManager.class}, + (proxy, method, args) -> { + return method.invoke(em, args); + }); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/jpa/SoftDeleteCustomizer.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/jpa/SoftDeleteCustomizer.java new file mode 100644 index 000000000..c0e7fa9bb --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/jpa/SoftDeleteCustomizer.java @@ -0,0 +1,41 @@ +//package org.opentosca.container.core.next.jpa; +// +//import java.util.Date; +// +//import org.eclipse.persistence.config.DescriptorCustomizer; +//import org.eclipse.persistence.descriptors.ClassDescriptor; +//import org.eclipse.persistence.internal.sessions.AbstractRecord; +//import org.eclipse.persistence.internal.sessions.AbstractSession; +//import org.eclipse.persistence.queries.DatabaseQuery; +//import org.eclipse.persistence.queries.DeleteObjectQuery; +//import org.eclipse.persistence.queries.QueryRedirector; +//import org.eclipse.persistence.queries.UpdateObjectQuery; +//import org.eclipse.persistence.sessions.Record; +//import org.eclipse.persistence.sessions.Session; +//import org.opentosca.container.core.next.model.PersistenceObject; +// +//public class SoftDeleteCustomizer implements DescriptorCustomizer { +// +// @Override +// public void customize(final ClassDescriptor descriptor) throws Exception { +// descriptor.setDefaultDeleteObjectQueryRedirector(new SoftDeleteRedirector()); +// descriptor.getQueryManager().setAdditionalCriteria("this.deletedAt IS NULL"); +// } +// +// private static class SoftDeleteRedirector implements QueryRedirector { +// +// private static final long serialVersionUID = -5508649536294092802L; +// +// @Override +// public Object invokeQuery(final DatabaseQuery query, final Record arguments, final Session session) { +// final ClassDescriptor descriptor = session.getDescriptor(query.getReferenceClass()); +// final DeleteObjectQuery deleteObjectQuery = (DeleteObjectQuery) query; +// final PersistenceObject entity = (PersistenceObject) deleteObjectQuery.getObject(); +// entity.setDeletedAt(new Date()); +// final UpdateObjectQuery updateObjectQuery = new UpdateObjectQuery(entity); +// updateObjectQuery.setDescriptor(descriptor); +// deleteObjectQuery.setDescriptor(updateObjectQuery.getDescriptor()); +// return updateObjectQuery.execute((AbstractSession) session, (AbstractRecord) arguments); +// } +// } +//} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/DeploymentTest.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/DeploymentTest.java similarity index 93% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/DeploymentTest.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/DeploymentTest.java index 581a8d95e..7b3726764 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/DeploymentTest.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/DeploymentTest.java @@ -1,6 +1,8 @@ package org.opentosca.container.core.next.model; +import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -18,8 +20,6 @@ import javax.persistence.TemporalType; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; @Entity @Table(name = DeploymentTest.TABLE_NAME) @@ -39,19 +39,17 @@ public class DeploymentTest extends PersistenceObject { @OrderBy("createdAt DESC") @OneToMany(mappedBy = "deploymentTest", cascade = {CascadeType.ALL}) - private List deploymentTestResults = Lists.newArrayList(); + private List deploymentTestResults = new ArrayList<>(); @ManyToOne @JoinColumn(name = "SERVICE_TEMPLATE_INSTANCE_ID") @JsonIgnore private ServiceTemplateInstance serviceTemplateInstance; - public DeploymentTest() { this.timestamp = new Date(); } - @Override @JsonIgnore public Long getId() { @@ -101,7 +99,7 @@ public void setServiceTemplateInstance(final ServiceTemplateInstance serviceTemp } public Map getStatistics() { - final Map stats = Maps.newHashMap(); + final Map stats = new HashMap<>(); stats.put("total", this.deploymentTestResults.size()); stats.put("success", countJobsByState(DeploymentTestState.SUCCESS)); stats.put("failed", countJobsByState(DeploymentTestState.FAILED)); diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/DeploymentTestResult.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/DeploymentTestResult.java similarity index 93% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/DeploymentTestResult.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/DeploymentTestResult.java index f7bfdcf8f..9c2090ed1 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/DeploymentTestResult.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/DeploymentTestResult.java @@ -12,8 +12,6 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.opentosca.container.core.next.utils.Consts; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -21,10 +19,10 @@ @Table(name = DeploymentTestResult.TABLE_NAME) public class DeploymentTestResult extends PersistenceObject { - private static final long serialVersionUID = 7456157949253267729L; - public static final String TABLE_NAME = "DEPLOYMENT_TEST_RESULT"; + private static final long serialVersionUID = 7456157949253267729L; + @Column(nullable = false) private String name; @@ -49,13 +47,12 @@ public class DeploymentTestResult extends PersistenceObject { @ManyToOne @JoinColumn(name = "NODE_TEMPLATE_INSTANCE_ID") - @JsonIgnoreProperties({"state", "service_template_instance", "incoming_relations", "outgoing_relations", - "properties"}) + @JsonIgnoreProperties( {"state", "service_template_instance", "incoming_relations", "outgoing_relations", + "properties"}) private NodeTemplateInstance nodeTemplateInstance; - - public DeploymentTestResult() {} - + public DeploymentTestResult() { + } @Override @JsonIgnore @@ -133,7 +130,7 @@ public void append(final String output) { if (this.output == null) { this.output = output; } else { - this.output = new StringBuilder(this.output).append(Consts.NL).append(output).toString(); + this.output = new StringBuilder(this.output).append(System.getProperty("line.separator")).append(output).toString(); } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/DeploymentTestState.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/DeploymentTestState.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/DeploymentTestState.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/DeploymentTestState.java diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/NodeTemplateInstance.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/NodeTemplateInstance.java similarity index 86% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/NodeTemplateInstance.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/NodeTemplateInstance.java index 80d3d2aa1..d1251d817 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/NodeTemplateInstance.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/NodeTemplateInstance.java @@ -1,6 +1,8 @@ package org.opentosca.container.core.next.model; +import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -8,6 +10,7 @@ import javax.persistence.CascadeType; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; @@ -19,22 +22,19 @@ import javax.persistence.Table; import javax.xml.namespace.QName; -import org.eclipse.persistence.annotations.Convert; -import org.opentosca.container.core.next.xml.PropertyParser; - import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; +import org.opentosca.container.core.common.jpa.QNameConverter; +import org.opentosca.container.core.next.xml.PropertyParser; @Entity @Table(name = NodeTemplateInstance.TABLE_NAME) public class NodeTemplateInstance extends PersistenceObject { - private static final long serialVersionUID = 6596755785422340480L; - public static final String TABLE_NAME = "NODE_TEMPLATE_INSTANCE"; + private static final long serialVersionUID = 6596755785422340480L; + @Column(nullable = false) @Enumerated(EnumType.STRING) private NodeTemplateInstanceState state; @@ -42,38 +42,38 @@ public class NodeTemplateInstance extends PersistenceObject { @OrderBy("createdAt DESC") @OneToMany(mappedBy = "nodeTemplateInstance", cascade = {CascadeType.ALL}) @JsonIgnore - private Set properties = Sets.newHashSet(); + private Set properties = new HashSet<>(); @ManyToOne @JoinColumn(name = "SERVICE_TEMPLATE_INSTANCE_ID") private ServiceTemplateInstance serviceTemplateInstance; @OneToMany(mappedBy = "target") - private Collection incomingRelations = Lists.newArrayList(); + private Collection incomingRelations = new ArrayList<>(); @OneToMany(mappedBy = "source") - private Collection outgoingRelations = Lists.newArrayList(); + private Collection outgoingRelations = new ArrayList<>(); - @Convert("QNameConverter") @Column(name = "TEMPLATE_ID", nullable = false) - private QName templateId; + private String templateId; - @Convert("QNameConverter") + @Convert(converter = QNameConverter.class) @Column(name = "TEMPLATE_TYPE", nullable = false) private QName templateType; @OrderBy("createdAt DESC") @OneToMany(mappedBy = "nodeTemplateInstance", fetch = FetchType.EAGER) @JsonIgnore - private List deploymentTestResults = Lists.newArrayList(); + private List deploymentTestResults = new ArrayList<>(); @Column(name = "managingContainer") private String managingContainer; - public NodeTemplateInstance() {} + public NodeTemplateInstance() { + } public String getName() { - return this.templateId.getLocalPart(); + return this.templateId; } public NodeTemplateInstanceState getState() { @@ -103,15 +103,16 @@ public void addProperty(final NodeTemplateInstanceProperty property) { } /* - * Currently, the plan writes all properties as one XML document into the database. Therefore, we - * parse this XML and return a Map. + * Currently, the plan writes all properties as one XML document into the database. Therefore, + * we parse this XML and return a Map. */ @JsonProperty("properties") public Map getPropertiesAsMap() { final PropertyParser parser = new PropertyParser(); final NodeTemplateInstanceProperty prop = - getProperties().stream().filter(p -> p.getType().equalsIgnoreCase("xml")) - .collect(Collectors.reducing((a, b) -> null)).orElse(null); + getProperties().stream() + .filter(p -> p.getType().equalsIgnoreCase("xml")) + .collect(Collectors.reducing((a, b) -> null)).orElse(null); if (prop != null) { return parser.parse(prop.getValue()); } @@ -159,11 +160,11 @@ public void addOutgoingRelation(final RelationshipTemplateInstance outgoingRelat } } - public QName getTemplateId() { + public String getTemplateId() { return this.templateId; } - public void setTemplateId(final QName templateId) { + public void setTemplateId(final String templateId) { this.templateId = templateId; } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/NodeTemplateInstanceProperty.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/NodeTemplateInstanceProperty.java similarity index 99% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/NodeTemplateInstanceProperty.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/NodeTemplateInstanceProperty.java index 03c5a3d14..5d1c930e2 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/NodeTemplateInstanceProperty.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/NodeTemplateInstanceProperty.java @@ -11,16 +11,15 @@ @Table(name = NodeTemplateInstanceProperty.TABLE_NAME) public class NodeTemplateInstanceProperty extends Property { - private static final long serialVersionUID = -8847410322957873980L; - public static final String TABLE_NAME = NodeTemplateInstance.TABLE_NAME + "_" + Property.TABLE_NAME; + private static final long serialVersionUID = -8847410322957873980L; + @ManyToOne @JoinColumn(name = "NODE_TEMPLATE_INSTANCE_ID") @JsonIgnore private NodeTemplateInstance nodeTemplateInstance; - public NodeTemplateInstanceProperty() { super(); } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/NodeTemplateInstanceState.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/NodeTemplateInstanceState.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/NodeTemplateInstanceState.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/NodeTemplateInstanceState.java diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PersistenceObject.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PersistenceObject.java similarity index 92% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/PersistenceObject.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PersistenceObject.java index b70bda0b8..61de6cf94 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PersistenceObject.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PersistenceObject.java @@ -14,13 +14,14 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.eclipse.persistence.annotations.Customizer; -import org.opentosca.container.core.next.jpa.SoftDeleteCustomizer; - import com.fasterxml.jackson.annotation.JsonIgnore; +//import org.eclipse.persistence.annotations.Customizer; +//import org.opentosca.container.core.next.jpa.SoftDeleteCustomizer; + @MappedSuperclass -@Customizer(SoftDeleteCustomizer.class) +// FIXME reinstate soft-deletion behaviour +//@Customizer(SoftDeleteCustomizer.class) public class PersistenceObject implements Serializable { private static final long serialVersionUID = 7082895776724756832L; @@ -47,7 +48,6 @@ public class PersistenceObject implements Serializable { @Temporal(TemporalType.TIMESTAMP) protected Date deletedAt; - public Long getId() { return this.id; } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstance.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstance.java similarity index 91% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstance.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstance.java index 44bb5a375..37e3c0b6e 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstance.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstance.java @@ -1,11 +1,14 @@ package org.opentosca.container.core.next.model; +import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; @@ -16,20 +19,17 @@ import javax.persistence.Table; import javax.xml.namespace.QName; -import org.eclipse.persistence.annotations.Convert; - import com.fasterxml.jackson.annotation.JsonIgnore; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; +import org.opentosca.container.core.common.jpa.QNameConverter; @Entity @Table(name = PlanInstance.TABLE_NAME) public class PlanInstance extends PersistenceObject { - private static final long serialVersionUID = -1289110419946090305L; - public static final String TABLE_NAME = "PLAN_INSTANCE"; + private static final long serialVersionUID = -1289110419946090305L; + @Column(nullable = false, unique = true) private String correlationId; @@ -47,22 +47,22 @@ public class PlanInstance extends PersistenceObject { @OrderBy("createdAt DESC") @OneToMany(mappedBy = "planInstance", cascade = {CascadeType.ALL}) - private List events = Lists.newArrayList(); + private List events = new ArrayList<>(); @OrderBy("createdAt DESC") @OneToMany(mappedBy = "planInstance", cascade = {CascadeType.ALL}) - private Set outputs = Sets.newHashSet(); + private Set outputs = new HashSet<>(); @OrderBy("createdAt DESC") @OneToMany(mappedBy = "planInstance", cascade = {CascadeType.ALL}) - private Set inputs = Sets.newHashSet(); + private Set inputs = new HashSet<>(); @ManyToOne @JoinColumn(name = "SERVICE_TEMPLATE_INSTANCE_ID") @JsonIgnore private ServiceTemplateInstance serviceTemplateInstance; - @Convert("QNameConverter") + @Convert(converter = QNameConverter.class) @Column(name = "TEMPLATE_ID", nullable = false) private QName templateId; diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceEvent.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceEvent.java similarity index 90% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceEvent.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceEvent.java index c602c5d93..13bc293d4 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceEvent.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceEvent.java @@ -19,10 +19,10 @@ @JsonInclude(Include.ALWAYS) public class PlanInstanceEvent extends PersistenceObject { - private static final long serialVersionUID = -5464457144036432912L; - public static final String TABLE_NAME = "PLAN_INSTANCE_EVENT"; + private static final long serialVersionUID = -5464457144036432912L; + @Column(nullable = false) @Temporal(TemporalType.TIMESTAMP) private Date startTimestamp; @@ -86,9 +86,9 @@ public void setExecutionDuration(final long executionDuration) { @JsonIgnore private PlanInstance planInstance; - public PlanInstanceEvent() { this.startTimestamp = new Date(); + this.endTimestamp = startTimestamp; } public PlanInstanceEvent(final String status, final String type, final String message) { @@ -98,7 +98,6 @@ public PlanInstanceEvent(final String status, final String type, final String me this.message = message; } - @Override @JsonIgnore public Long getId() { @@ -109,16 +108,16 @@ public Date getStartTimestamp() { return this.startTimestamp; } - public void setStartTimestamp(final Date timestamp) { - this.startTimestamp = timestamp; + public void setStartTimestamp(final Date startTimestamp) { + this.startTimestamp = startTimestamp; } public Date getEndTimestamp() { return this.endTimestamp; } - public void setEndTimestamp(final Date timestamp) { - this.endTimestamp = timestamp; + public void setEndTimestamp(Date endTimestamp) { + this.endTimestamp = endTimestamp; } public String getStatus() { @@ -155,4 +154,9 @@ public void setPlanInstance(final PlanInstance planInstance) { planInstance.getEvents().add(this); } } + + @JsonIgnore + public long getDuration() { + return getEndTimestamp().getTime() - getStartTimestamp().getTime(); + } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceInput.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceInput.java similarity index 99% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceInput.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceInput.java index c635f6eff..8f661652d 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceInput.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceInput.java @@ -11,16 +11,15 @@ @Table(name = PlanInstanceInput.TABLE_NAME) public class PlanInstanceInput extends Property { - private static final long serialVersionUID = 2934309146421765176L; - public static final String TABLE_NAME = "PLAN_INSTANCE_INPUT"; + private static final long serialVersionUID = 2934309146421765176L; + @ManyToOne @JoinColumn(name = "PLAN_INSTANCE_ID") @JsonIgnore private PlanInstance planInstance; - public PlanInstanceInput() { super(); } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceOutput.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceOutput.java similarity index 99% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceOutput.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceOutput.java index 03497fd82..5c7ca877a 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceOutput.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceOutput.java @@ -11,16 +11,15 @@ @Table(name = PlanInstanceOutput.TABLE_NAME) public class PlanInstanceOutput extends Property { - private static final long serialVersionUID = -8847410322957873980L; - public static final String TABLE_NAME = "PLAN_INSTANCE_OUTPUT"; + private static final long serialVersionUID = -8847410322957873980L; + @ManyToOne @JoinColumn(name = "PLAN_INSTANCE_ID") @JsonIgnore private PlanInstance planInstance; - public PlanInstanceOutput() { super(); } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceState.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceState.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanInstanceState.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanInstanceState.java diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanLanguage.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanLanguage.java similarity index 99% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanLanguage.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanLanguage.java index 86444a673..c4e0ed373 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanLanguage.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanLanguage.java @@ -6,7 +6,6 @@ public enum PlanLanguage { private String name; - PlanLanguage(final String name) { this.name = name; } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanType.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanType.java new file mode 100644 index 000000000..adf64833b --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/PlanType.java @@ -0,0 +1,31 @@ +package org.opentosca.container.core.next.model; + +public enum PlanType { + + BUILD("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan"), + TERMINATION("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/TerminationPlan"), + MANAGEMENT("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/ManagementPlan"), + TRANSFORMATION("http://opentosca.org/plantypes/TransformationPlan"); + + private String name; + + PlanType(final String name) { + this.name = name; + } + + public static PlanType fromString(final String name) { + if (name != null) { + for (final PlanType o : PlanType.values()) { + if (name.equalsIgnoreCase(o.name)) { + return o; + } + } + } + throw new IllegalArgumentException("Parameter 'name' does not match an Enum type"); + } + + @Override + public String toString() { + return this.name; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/Property.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/Property.java similarity index 95% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/Property.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/Property.java index e72b65a33..96afd7935 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/Property.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/Property.java @@ -3,32 +3,32 @@ import java.util.Objects; import javax.persistence.Column; +import javax.persistence.Entity; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; -import javax.persistence.MappedSuperclass; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.google.common.base.Preconditions; -@MappedSuperclass +@Entity @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @JsonInclude(Include.ALWAYS) public class Property extends PersistenceObject { - private static final long serialVersionUID = 5476371703998806702L; - public static final String TABLE_NAME = "PROPERTY"; + private static final long serialVersionUID = 5476371703998806702L; + @Column(nullable = false) private String name; + @Column(columnDefinition = "varchar(max)") private String value; private String type; - public Property() { } @@ -40,7 +40,6 @@ public Property(final String name, final String value, final String type) { this.type = type; } - @Override @JsonIgnore public Long getId() { diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/RelationshipTemplateInstance.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/RelationshipTemplateInstance.java similarity index 87% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/RelationshipTemplateInstance.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/RelationshipTemplateInstance.java index 6b0807b4c..f63582bec 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/RelationshipTemplateInstance.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/RelationshipTemplateInstance.java @@ -1,10 +1,12 @@ package org.opentosca.container.core.next.model; import java.util.Collection; +import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; @@ -15,18 +17,16 @@ import javax.persistence.Table; import javax.xml.namespace.QName; -import org.eclipse.persistence.annotations.Convert; - -import com.google.common.collect.Sets; +import org.opentosca.container.core.common.jpa.QNameConverter; @Entity @Table(name = RelationshipTemplateInstance.TABLE_NAME) public class RelationshipTemplateInstance extends PersistenceObject { - private static final long serialVersionUID = -2035127822277983705L; - public static final String TABLE_NAME = "RELATIONSHIP_TEMPLATE_INSTANCE"; + private static final long serialVersionUID = -2035127822277983705L; + @Column(nullable = false) @Enumerated(EnumType.STRING) private RelationshipTemplateInstanceState state; @@ -34,10 +34,10 @@ public class RelationshipTemplateInstance extends PersistenceObject { @ManyToOne @JoinColumn(name = "SERVICE_TEMPLATE_INSTANCE_ID") private ServiceTemplateInstance serviceTemplateInstance; - + @OrderBy("createdAt DESC") @OneToMany(mappedBy = "relationshipTemplateInstance", cascade = {CascadeType.ALL}) - private Set properties = Sets.newHashSet(); + private Set properties = new HashSet<>(); @ManyToOne @JoinColumn(name = "SOURCE_ID") @@ -47,15 +47,15 @@ public class RelationshipTemplateInstance extends PersistenceObject { @JoinColumn(name = "TARGET_ID") private NodeTemplateInstance target; - @Convert("QNameConverter") @Column(name = "TEMPLATE_ID", nullable = false) - private QName templateId; + private String templateId; - @Convert("QNameConverter") + @Convert(converter = QNameConverter.class) @Column(name = "TEMPLATE_TYPE", nullable = false) private QName templateType; - public RelationshipTemplateInstance() {} + public RelationshipTemplateInstance() { + } public RelationshipTemplateInstanceState getState() { return this.state; @@ -82,12 +82,12 @@ public void addProperty(final RelationshipTemplateInstanceProperty property) { property.setRelationshipTemplateInstance(this); } } - + public ServiceTemplateInstance getServiceTemplateInstance() { - return this.serviceTemplateInstance; + return serviceTemplateInstance; } - public void setServiceTemplateInstance(final ServiceTemplateInstance serviceTemplateInstance) { + public void setServiceTemplateInstance(ServiceTemplateInstance serviceTemplateInstance) { this.serviceTemplateInstance = serviceTemplateInstance; if (!serviceTemplateInstance.getRelationshipTemplateInstances().contains(this)) { serviceTemplateInstance.getRelationshipTemplateInstances().add(this); @@ -116,11 +116,11 @@ public void setTarget(final NodeTemplateInstance target) { } } - public QName getTemplateId() { + public String getTemplateId() { return this.templateId; } - public void setTemplateId(final QName templateId) { + public void setTemplateId(final String templateId) { this.templateId = templateId; } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/RelationshipTemplateInstanceProperty.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/RelationshipTemplateInstanceProperty.java similarity index 99% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/RelationshipTemplateInstanceProperty.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/RelationshipTemplateInstanceProperty.java index e4c0929d5..76c50ae4a 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/RelationshipTemplateInstanceProperty.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/RelationshipTemplateInstanceProperty.java @@ -11,16 +11,15 @@ @Table(name = RelationshipTemplateInstanceProperty.TABLE_NAME) public class RelationshipTemplateInstanceProperty extends Property { - private static final long serialVersionUID = -8847410322957873980L; - public static final String TABLE_NAME = RelationshipTemplateInstance.TABLE_NAME + "_" + Property.TABLE_NAME; + private static final long serialVersionUID = -8847410322957873980L; + @ManyToOne @JoinColumn(name = "RELATIONSHIP_TEMPLATE_INSTANCE_ID") @JsonIgnore private RelationshipTemplateInstance relationshipTemplateInstance; - public RelationshipTemplateInstanceProperty() { super(); } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/RelationshipTemplateInstanceState.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/RelationshipTemplateInstanceState.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/RelationshipTemplateInstanceState.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/RelationshipTemplateInstanceState.java diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/ServiceTemplateInstance.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/ServiceTemplateInstance.java similarity index 80% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/ServiceTemplateInstance.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/ServiceTemplateInstance.java index dd2d98fb0..900cd678b 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/ServiceTemplateInstance.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/ServiceTemplateInstance.java @@ -1,6 +1,8 @@ package org.opentosca.container.core.next.model; +import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -8,53 +10,49 @@ import javax.persistence.CascadeType; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.OneToMany; import javax.persistence.OrderBy; import javax.persistence.Table; -import javax.xml.namespace.QName; -import org.eclipse.persistence.annotations.Convert; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.opentosca.container.core.common.jpa.CsarIdConverter; import org.opentosca.container.core.common.jpa.DocumentConverter; -import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.core.model.csar.CsarId; import org.opentosca.container.core.next.xml.PropertyParser; import org.w3c.dom.Document; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - @Entity @Table(name = ServiceTemplateInstance.TABLE_NAME) public class ServiceTemplateInstance extends PersistenceObject { - private static final long serialVersionUID = 6652347924001914320L; - public static final String TABLE_NAME = "SERVICE_TEMPLATE_INSTANCE"; + private static final long serialVersionUID = 6652347924001914320L; + @Column(nullable = false) @Enumerated(EnumType.STRING) private ServiceTemplateInstanceState state; @OneToMany(mappedBy = "serviceTemplateInstance") - private Collection planInstances = Lists.newArrayList(); + private Collection planInstances = new ArrayList<>(); @OneToMany(mappedBy = "serviceTemplateInstance") - private Collection nodeTemplateInstances = Lists.newArrayList(); - + private Collection nodeTemplateInstances = new ArrayList<>(); + @OneToMany(mappedBy = "serviceTemplateInstance") - private Collection relationshipTemplateInstances = Lists.newArrayList(); + private Collection relationshipTemplateInstances = new ArrayList<>(); - @Convert("CSARIDConverter") + @Convert(converter = CsarIdConverter.class) @Column(name = "CSAR_ID", nullable = false) - private CSARID csarId; + private CsarId csarId; - @Convert("QNameConverter") @Column(name = "TEMPLATE_ID", nullable = false) - private QName templateId; + private String templateId; @Column(name = "CREATION_CORRELATION_ID", nullable = true) private String creationCorrelationId; @@ -62,14 +60,16 @@ public class ServiceTemplateInstance extends PersistenceObject { @OrderBy("createdAt DESC") @OneToMany(mappedBy = "serviceTemplateInstance", cascade = {CascadeType.ALL}) @JsonIgnore - private Set properties = Sets.newHashSet(); + private Set properties = new HashSet<>(); @OrderBy("createdAt DESC") @OneToMany(mappedBy = "serviceTemplateInstance") @JsonIgnore - private List deploymentTests = Lists.newArrayList(); + private List deploymentTests = new ArrayList<>(); - public ServiceTemplateInstance() {} + // 0-args constructor for JPA + public ServiceTemplateInstance() { + } public ServiceTemplateInstanceState getState() { return this.state; @@ -88,11 +88,12 @@ public void setPlanInstances(final Collection planInstances) { } public void addPlanInstance(final PlanInstance planInstance) { - if (planInstance.getType().equals(PlanType.BUILD)) { - this.planInstances.add(planInstance); - if (planInstance.getServiceTemplateInstance() != this) { - planInstance.setServiceTemplateInstance(this); - } + if (!planInstance.getType().equals(PlanType.BUILD)) { + return; + } + this.planInstances.add(planInstance); + if (planInstance.getServiceTemplateInstance() != this) { + planInstance.setServiceTemplateInstance(this); } } @@ -110,7 +111,7 @@ public void addNodeTemplateInstance(final NodeTemplateInstance nodeTemplateInsta nodeTemplateInstance.setServiceTemplateInstance(this); } } - + public Collection getRelationshipTemplateInstances() { return this.relationshipTemplateInstances; } @@ -126,19 +127,19 @@ public void addRelationshipTemplateInstance(final RelationshipTemplateInstance r } } - public CSARID getCsarId() { + public CsarId getCsarId() { return this.csarId; } - public void setCsarId(final CSARID csarId) { + public void setCsarId(final CsarId csarId) { this.csarId = csarId; } - public QName getTemplateId() { + public String getTemplateId() { return this.templateId; } - public void setTemplateId(final QName templateId) { + public void setTemplateId(final String templateId) { this.templateId = templateId; } @@ -146,7 +147,7 @@ public String getCreationCorrelationId() { return this.creationCorrelationId; } - public void setCreationCorrelationId(final String creationCorrelationId) { + public void setCreationCorrelationId(String creationCorrelationId) { this.creationCorrelationId = creationCorrelationId; } @@ -177,7 +178,7 @@ public Map getPropertiesAsMap() { final PropertyParser parser = new PropertyParser(); final ServiceTemplateInstanceProperty prop = getProperties().stream().filter(p -> p.getType().equalsIgnoreCase("xml")) - .collect(Collectors.reducing((a, b) -> null)).orElse(null); + .collect(Collectors.reducing((a, b) -> null)).orElse(null); if (prop != null) { return parser.parse(prop.getValue()); } @@ -188,9 +189,9 @@ public Document getPropertiesAsDocument() { final DocumentConverter converter = new DocumentConverter(); final ServiceTemplateInstanceProperty prop = getProperties().stream().filter(p -> p.getType().equalsIgnoreCase("xml")) - .collect(Collectors.reducing((a, b) -> null)).orElse(null); + .collect(Collectors.reducing((a, b) -> null)).orElse(null); if (prop != null) { - return (Document) converter.convertDataValueToObjectValue(prop.getValue(), null); + return (Document) converter.convertToEntityAttribute(prop.getValue()); } return null; diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/ServiceTemplateInstanceProperty.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/ServiceTemplateInstanceProperty.java similarity index 99% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/ServiceTemplateInstanceProperty.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/ServiceTemplateInstanceProperty.java index b2a2d16aa..b4745f84b 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/ServiceTemplateInstanceProperty.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/ServiceTemplateInstanceProperty.java @@ -11,16 +11,15 @@ @Table(name = ServiceTemplateInstanceProperty.TABLE_NAME) public class ServiceTemplateInstanceProperty extends Property { - private static final long serialVersionUID = -8847410322957873980L; - public static final String TABLE_NAME = ServiceTemplateInstance.TABLE_NAME + "_" + Property.TABLE_NAME; + private static final long serialVersionUID = -8847410322957873980L; + @ManyToOne @JoinColumn(name = "SERVICE_TEMPLATE_INSTANCE_ID") @JsonIgnore private ServiceTemplateInstance serviceTemplateInstance; - public ServiceTemplateInstanceProperty() { super(); } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/ServiceTemplateInstanceState.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/ServiceTemplateInstanceState.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/ServiceTemplateInstanceState.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/ServiceTemplateInstanceState.java diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/Situation.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/Situation.java similarity index 83% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/Situation.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/Situation.java index f72f417f2..e9692e18d 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/Situation.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/Situation.java @@ -6,19 +6,18 @@ import javax.persistence.Entity; import javax.persistence.EntityListeners; import javax.persistence.Table; -import javax.xml.bind.annotation.XmlElement; import org.opentosca.container.core.next.trigger.SituationListener; @Entity @Table(name = Situation.TABLE_NAME) -@EntityListeners({SituationListener.class}) +@EntityListeners( {SituationListener.class}) public class Situation extends PersistenceObject { - private static final long serialVersionUID = 1065969908430273145L; - public static final String TABLE_NAME = "SITUATION"; + private static final long serialVersionUID = 1065969908430273145L; + @Column(nullable = false) private boolean active; @@ -26,9 +25,8 @@ public class Situation extends PersistenceObject { private String thingId; @Column(nullable = false) - private String situationTemplateId; - - + private String situationTemplateId; + @Column(nullable = true) private float eventProbability = -1.0f; @@ -38,7 +36,7 @@ public class Situation extends PersistenceObject { public boolean isActive() { return this.active; } - + public void setActive(final boolean active) { this.active = active; } @@ -58,23 +56,23 @@ public String getSituationTemplateId() { public void setSituationTemplateId(final String situationTemplateId) { this.situationTemplateId = situationTemplateId; } - + public float getEventProbability() { - return this.eventProbability; + return eventProbability; } - public void setEventProbability(final float eventProbability) { + public void setEventProbability(float eventProbability) { this.eventProbability = eventProbability; } public String getEventTime() { - return this.eventTime; + return eventTime; } - public void setEventTime(final String eventTime) { + public void setEventTime(String eventTime) { this.eventTime = eventTime; } - + @Override public boolean equals(final Object o) { if (this == o) { @@ -84,7 +82,7 @@ public boolean equals(final Object o) { return false; } final Situation entity = (Situation) o; - if(entity.getId().equals(this.id)) { + if (entity.getId().equals(this.id)) { return true; } else { return false; diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTrigger.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTrigger.java similarity index 91% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTrigger.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTrigger.java index 163363534..aaff422a1 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTrigger.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTrigger.java @@ -5,6 +5,7 @@ import javax.persistence.CascadeType; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; @@ -12,19 +13,18 @@ import javax.persistence.OrderBy; import javax.persistence.Table; -import org.eclipse.persistence.annotations.Convert; -import org.opentosca.container.core.model.csar.id.CSARID; - import com.google.common.collect.Sets; +import org.opentosca.container.core.common.jpa.CsarIdConverter; +import org.opentosca.container.core.model.csar.CsarId; @Entity @Table(name = SituationTrigger.TABLE_NAME) public class SituationTrigger extends PersistenceObject { - private static final long serialVersionUID = -6114808293357441034L; - public static final String TABLE_NAME = "SITUATION_TRIGGER"; + private static final long serialVersionUID = -6114808293357441034L; + @OneToMany() @JoinColumn(name = "SITUATION_ID") private Collection situations; @@ -34,10 +34,10 @@ public class SituationTrigger extends PersistenceObject { @Column(nullable = false) private boolean isSingleInstance; - - @Convert("CSARIDConverter") + + @Convert(converter = CsarIdConverter.class) @Column(name = "CSAR_ID", nullable = false) - private CSARID csarId; + private CsarId csarId; @OneToOne @JoinColumn(name = "SERVICE_TEMPLATE_INSTANCE_ID", nullable = true) @@ -69,8 +69,7 @@ public class SituationTrigger extends PersistenceObject { @Column(nullable = true) private String eventTime; - - + public Collection getSituations() { return this.situations; } @@ -92,18 +91,17 @@ public boolean isTriggerOnActivation() { } public void setTriggerOnActivation(final boolean triggerOnActivation) { - this.triggerOnActivation = triggerOnActivation; + this.triggerOnActivation = triggerOnActivation; } - - public CSARID getCsarId() { - return this.csarId; + + public CsarId getCsarId() { + return csarId; } - public void setCsarId(final CSARID csarId) { + public void setCsarId(CsarId csarId) { this.csarId = csarId; } - public ServiceTemplateInstance getServiceInstance() { return this.serviceInstance; } @@ -151,7 +149,7 @@ public Collection getSituationTriggerInstances() { public void setSituationTriggerInstances(final Collection situationTriggerInstances) { this.situationTriggerInstances = situationTriggerInstances; } - + public float getEventProbability() { return this.eventProbability; } @@ -167,5 +165,4 @@ public String getEventTime() { public void setEventTime(final String eventTime) { this.eventTime = eventTime; } - } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerInstance.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerInstance.java similarity index 97% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerInstance.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerInstance.java index a816e2ac7..738824b88 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerInstance.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerInstance.java @@ -7,25 +7,24 @@ import javax.persistence.Entity; import javax.persistence.EntityListeners; import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; import javax.persistence.OneToMany; -import javax.persistence.OneToOne; import javax.persistence.OrderBy; import javax.persistence.Table; -import org.opentosca.container.core.next.trigger.SituationTriggerInstanceListener; - import com.google.common.collect.Sets; +import org.opentosca.container.core.next.trigger.SituationTriggerInstanceListener; @Entity @Table(name = SituationTriggerInstance.TABLE_NAME) @EntityListeners(SituationTriggerInstanceListener.class) public class SituationTriggerInstance extends PersistenceObject { - private static final long serialVersionUID = 6063594837058853771L; - public static final String TABLE_NAME = "SITUATION_TRIGGER_INSTANCE"; - @OneToOne() + private static final long serialVersionUID = 6063594837058853771L; + + @ManyToOne @JoinColumn(name = "SITUATION_TRIGGER_ID") private SituationTrigger situationTrigger; @@ -70,5 +69,4 @@ public Set getOutputs() { public void setOutputs(final Set outputs) { this.outputs = outputs; } - } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerInstanceProperty.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerInstanceProperty.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerInstanceProperty.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerInstanceProperty.java index 26da3c0e9..b6e24b2a6 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerInstanceProperty.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerInstanceProperty.java @@ -11,10 +11,10 @@ @Table(name = SituationTriggerInstanceProperty.TABLE_NAME) public class SituationTriggerInstanceProperty extends Property { - private static final long serialVersionUID = 3294074158424599301L; - public static final String TABLE_NAME = SituationTriggerInstance.TABLE_NAME + "_" + Property.TABLE_NAME; + private static final long serialVersionUID = 3294074158424599301L; + @ManyToOne @JoinColumn(name = "SITUATION_TRIGGER_INSTANCE_ID") @JsonIgnore diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerProperty.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerProperty.java similarity index 96% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerProperty.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerProperty.java index fca1239ba..bdc012497 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationTriggerProperty.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationTriggerProperty.java @@ -3,7 +3,6 @@ import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import javax.persistence.OneToOne; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -12,10 +11,10 @@ @Table(name = SituationTriggerProperty.TABLE_NAME) public class SituationTriggerProperty extends Property { - private static final long serialVersionUID = -8812520971044865745L; - public static final String TABLE_NAME = "SITUATION_TRIGGER_PROPERTY"; + private static final long serialVersionUID = -8812520971044865745L; + @ManyToOne @JoinColumn(name = "SITUATION_TRIGGER_ID") @JsonIgnore @@ -39,7 +38,4 @@ public void setSituationTrigger(final SituationTrigger situationTrigger) { situationTrigger.getInputs().add(this); } } - - - } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationsMonitor.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationsMonitor.java new file mode 100644 index 000000000..5c2208e9a --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationsMonitor.java @@ -0,0 +1,54 @@ +package org.opentosca.container.core.next.model; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = SituationsMonitor.TABLE_NAME) +public class SituationsMonitor extends PersistenceObject { + + private static final long serialVersionUID = 6770816160173767058L; + + public static final String TABLE_NAME = "SITUATIONSMONITOR"; + + @Column(name = "NODESITUATIONMAPPING") + @OneToMany + private Set node2situations = new HashSet<>(); + + @OneToOne + @JoinColumn(name = "SERVICE_TEMPLATE_INSTANCE_ID", nullable = true) + private ServiceTemplateInstance serviceInstance; + + public Map> getNode2Situations() { + return node2situations.stream() + .collect(Collectors.toMap(SituationsMonitorIdCollection::getNodeId, SituationsMonitorIdCollection::getIds)); + } + + public void setNode2Situations(Map> node2situations) { + this.node2situations = node2situations.entrySet().stream() + .collect(Collectors.mapping(e -> { + SituationsMonitorIdCollection collection = new SituationsMonitorIdCollection(); + collection.setNodeId(e.getKey()); + collection.setIds(e.getValue()); + return collection; + }, Collectors.toSet())); + } + + public ServiceTemplateInstance getServiceInstance() { + return serviceInstance; + } + + public void setServiceInstance(ServiceTemplateInstance serviceInstance) { + this.serviceInstance = serviceInstance; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationsMonitorIdCollection.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationsMonitorIdCollection.java new file mode 100644 index 000000000..1691c5c1f --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/model/SituationsMonitorIdCollection.java @@ -0,0 +1,37 @@ +package org.opentosca.container.core.next.model; + +import java.util.ArrayList; +import java.util.Collection; + +import javax.persistence.Column; +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.Id; + +// FIXME this is a messy workaround for embedding a collection as the value type of an @ElementCollection +@Entity +public class SituationsMonitorIdCollection { + @Id + @Column + private String nodeId; + + @Column + @ElementCollection + private Collection ids = new ArrayList<>(); + + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + public Collection getIds() { + return ids; + } + + public void setIds(Collection ids) { + this.ids = ids; + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/DeploymentTestRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/DeploymentTestRepository.java new file mode 100644 index 000000000..19ede8890 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/DeploymentTestRepository.java @@ -0,0 +1,16 @@ +package org.opentosca.container.core.next.repository; + +import org.hibernate.Hibernate; +import org.opentosca.container.core.next.model.DeploymentTest; + +public class DeploymentTestRepository extends JpaRepository { + + public DeploymentTestRepository() { + super(DeploymentTest.class); + } + + @Override + protected void initializeInstance(DeploymentTest instance) { + Hibernate.initialize(instance.getDeploymentTestResults()); + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/JpaRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/JpaRepository.java similarity index 80% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/repository/JpaRepository.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/JpaRepository.java index 14554a680..6e48de917 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/JpaRepository.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/JpaRepository.java @@ -7,12 +7,14 @@ import org.opentosca.container.core.next.jpa.AutoCloseableEntityManager; import org.opentosca.container.core.next.jpa.EntityManagerProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class JpaRepository implements Repository { + protected static final Logger logger = LoggerFactory.getLogger(JpaRepository.class); protected final Class clazz; - public JpaRepository(final Class clazz) { this.clazz = clazz; } @@ -24,8 +26,7 @@ public void add(final T entity) { em.getTransaction().begin(); em.persist(entity); em.getTransaction().commit(); - } - finally { + } finally { if (em.getTransaction().isActive()) { em.getTransaction().rollback(); } @@ -40,8 +41,7 @@ public void add(final Iterable items) { em.getTransaction().begin(); items.forEach(em::persist); em.getTransaction().commit(); - } - finally { + } finally { if (em.getTransaction().isActive()) { em.getTransaction().rollback(); } @@ -56,8 +56,7 @@ public void update(final T entity) { em.getTransaction().begin(); em.merge(entity); em.getTransaction().commit(); - } - finally { + } finally { if (em.getTransaction().isActive()) { em.getTransaction().rollback(); } @@ -72,8 +71,7 @@ public void remove(final T entity) { em.getTransaction().begin(); em.remove(em.merge(entity)); em.getTransaction().commit(); - } - finally { + } finally { if (em.getTransaction().isActive()) { em.getTransaction().rollback(); } @@ -85,10 +83,14 @@ public void remove(final T entity) { public Optional find(final Long id) { try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { final T entity = em.find(this.clazz, id); + if (entity == null) { + return Optional.empty(); + } em.refresh(entity); - return Optional.ofNullable(entity); - } - catch (final Exception e) { + initializeInstance(entity); + return Optional.of(entity); + } catch (final Exception e) { + logger.info("Failed to find instance of class {} with id {} in persistence context.", clazz.getSimpleName(), id, e); return Optional.empty(); } } @@ -97,7 +99,9 @@ public Optional find(final Long id) { public Collection findAll() { try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { return em.createQuery(String.format("SELECT e FROM %s e", this.clazz.getSimpleName()), this.clazz) - .getResultList(); + .getResultList(); } } + + protected abstract void initializeInstance(final T instance); } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/NodeTemplateInstanceRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/NodeTemplateInstanceRepository.java new file mode 100644 index 000000000..139811bf1 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/NodeTemplateInstanceRepository.java @@ -0,0 +1,90 @@ +package org.opentosca.container.core.next.repository; + +import java.util.Collection; +import java.util.List; + +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.ParameterExpression; +import javax.persistence.criteria.Root; +import javax.xml.namespace.QName; + +import org.hibernate.Hibernate; +import org.opentosca.container.core.next.jpa.AutoCloseableEntityManager; +import org.opentosca.container.core.next.jpa.EntityManagerProvider; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; + +public class NodeTemplateInstanceRepository extends JpaRepository { + + public NodeTemplateInstanceRepository() { + super(NodeTemplateInstance.class); + } + + public List find(final ServiceTemplateInstance sti, String nodeTemplateId) { + try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { + final CriteriaBuilder cb = em.getCriteriaBuilder(); + + final ParameterExpression owner = cb.parameter(ServiceTemplateInstance.class, "sti"); + final ParameterExpression templateId = cb.parameter(String.class, "ntId"); + + final CriteriaQuery query = cb.createQuery(NodeTemplateInstance.class); + final Root nti = query.from(NodeTemplateInstance.class); + + query.select(nti).where( + cb.equal(nti.get("serviceTemplateInstance"), owner) + , cb.equal(nti.get("templateId"), templateId)); + + final TypedQuery q = em.createQuery(query); + q.setParameter(owner, sti); + q.setParameter(templateId, nodeTemplateId); + + final List result = q.getResultList(); + result.forEach(this::initializeInstance); + return result; + } + } + + public Collection findByTemplateId(final String templateId) { + try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { + final CriteriaBuilder cb = em.getCriteriaBuilder(); + + final ParameterExpression templateIdParameter = cb.parameter(String.class); + + final CriteriaQuery cq = cb.createQuery(NodeTemplateInstance.class); + final Root sti = cq.from(NodeTemplateInstance.class); + cq.select(sti).where(cb.equal(sti.get("templateId"), templateIdParameter)); + + final TypedQuery q = em.createQuery(cq); + q.setParameter(templateIdParameter, templateId); + + return q.getResultList(); + } + } + + public Collection findByTemplateType(final QName templateType) { + try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { + final CriteriaBuilder cb = em.getCriteriaBuilder(); + + final ParameterExpression templateTypeParameter = cb.parameter(QName.class); + + final CriteriaQuery cq = cb.createQuery(NodeTemplateInstance.class); + final Root sti = cq.from(NodeTemplateInstance.class); + cq.select(sti).where(cb.equal(sti.get("templateType"), templateTypeParameter)); + + final TypedQuery q = em.createQuery(cq); + q.setParameter(templateTypeParameter, templateType); + + return q.getResultList(); + } + } + + @Override + protected void initializeInstance(NodeTemplateInstance instance) { + Hibernate.initialize(instance.getDeploymentTestResults()); + Hibernate.initialize(instance.getProperties()); + Hibernate.initialize(instance.getOutgoingRelations()); + Hibernate.initialize(instance.getIncomingRelations()); + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/PlanInstanceRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/PlanInstanceRepository.java similarity index 79% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/repository/PlanInstanceRepository.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/PlanInstanceRepository.java index 7a38c1a24..9d88e05f2 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/PlanInstanceRepository.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/PlanInstanceRepository.java @@ -1,12 +1,12 @@ package org.opentosca.container.core.next.repository; -import javax.persistence.NoResultException; import javax.persistence.TypedQuery; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.ParameterExpression; import javax.persistence.criteria.Root; +import org.hibernate.Hibernate; import org.opentosca.container.core.next.jpa.AutoCloseableEntityManager; import org.opentosca.container.core.next.jpa.EntityManagerProvider; import org.opentosca.container.core.next.model.PlanInstance; @@ -30,10 +30,16 @@ public PlanInstance findByCorrelationId(final String correlationId) { final TypedQuery q = em.createQuery(cq); q.setParameter(correlationIdParameter, correlationId); // Execute - - return q.getSingleResult(); - } catch (NoResultException e) { - return null; + PlanInstance result = q.getSingleResult(); + initializeInstance(result); + return result; } } + + @Override + protected void initializeInstance(PlanInstance instance) { + Hibernate.initialize(instance.getEvents()); + Hibernate.initialize(instance.getInputs()); + Hibernate.initialize(instance.getOutputs()); + } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/RelationshipTemplateInstanceRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/RelationshipTemplateInstanceRepository.java similarity index 83% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/repository/RelationshipTemplateInstanceRepository.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/RelationshipTemplateInstanceRepository.java index 790cbd42c..dc198eebf 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/RelationshipTemplateInstanceRepository.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/RelationshipTemplateInstanceRepository.java @@ -7,8 +7,8 @@ import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.ParameterExpression; import javax.persistence.criteria.Root; -import javax.xml.namespace.QName; +import org.hibernate.Hibernate; import org.opentosca.container.core.next.jpa.AutoCloseableEntityManager; import org.opentosca.container.core.next.jpa.EntityManagerProvider; import org.opentosca.container.core.next.model.RelationshipTemplateInstance; @@ -19,11 +19,11 @@ public RelationshipTemplateInstanceRepository() { super(RelationshipTemplateInstance.class); } - public Collection findByTemplateId(final QName templateId) { + public Collection findByTemplateId(final String templateId) { try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { final CriteriaBuilder cb = em.getCriteriaBuilder(); // Parameters - final ParameterExpression templateIdParameter = cb.parameter(QName.class); + final ParameterExpression templateIdParameter = cb.parameter(String.class); // Build the Criteria Query final CriteriaQuery cq = cb.createQuery(RelationshipTemplateInstance.class); final Root sti = cq.from(RelationshipTemplateInstance.class); @@ -35,4 +35,9 @@ public Collection findByTemplateId(final QName tem return q.getResultList(); } } + + @Override + protected void initializeInstance(RelationshipTemplateInstance instance) { + Hibernate.initialize(instance.getProperties()); + } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/Repository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/Repository.java similarity index 100% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/repository/Repository.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/Repository.java diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/ServiceTemplateInstanceRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/ServiceTemplateInstanceRepository.java new file mode 100644 index 000000000..a5c61959a --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/ServiceTemplateInstanceRepository.java @@ -0,0 +1,76 @@ +package org.opentosca.container.core.next.repository; + +import java.util.Collection; +import java.util.List; + +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.ParameterExpression; +import javax.persistence.criteria.Root; + +import org.hibernate.Hibernate; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.next.jpa.AutoCloseableEntityManager; +import org.opentosca.container.core.next.jpa.EntityManagerProvider; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; + +public class ServiceTemplateInstanceRepository extends JpaRepository { + + public ServiceTemplateInstanceRepository() { + super(ServiceTemplateInstance.class); + } + + @Override + protected void initializeInstance(ServiceTemplateInstance instance) { + Hibernate.initialize(instance.getDeploymentTests()); + Hibernate.initialize(instance.getNodeTemplateInstances()); + Hibernate.initialize(instance.getProperties()); + Hibernate.initialize(instance.getRelationshipTemplateInstances()); + Hibernate.initialize(instance.getPlanInstances()); + instance.getPlanInstances().forEach(pi -> { + Hibernate.initialize(pi.getInputs()); + Hibernate.initialize(pi.getOutputs()); + Hibernate.initialize(pi.getEvents()); + }); + instance.getNodeTemplateInstances().forEach(nti -> Hibernate.initialize(nti.getProperties())); + } + + public Collection findByTemplateId(final String templateId) { + try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { + final CriteriaBuilder cb = em.getCriteriaBuilder(); + // Parameters + final ParameterExpression templateIdParameter = cb.parameter(String.class); + // Build the Criteria Query + final CriteriaQuery cq = cb.createQuery(ServiceTemplateInstance.class); + final Root sti = cq.from(ServiceTemplateInstance.class); + cq.select(sti).where(cb.equal(sti.get("templateId"), templateIdParameter)); + // Create a TypedQuery + final TypedQuery q = em.createQuery(cq); + q.setParameter(templateIdParameter, templateId); + // Execute + List results = q.getResultList(); + results.forEach(this::initializeInstance); + return results; + } + } + + public Collection findByCsarId(final CsarId csarId) { + try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { + final CriteriaBuilder cb = em.getCriteriaBuilder(); + // Parameters + final ParameterExpression csarIdParameter = cb.parameter(CsarId.class); + // Build the Criteria Query + final CriteriaQuery cq = cb.createQuery(ServiceTemplateInstance.class); + final Root sti = cq.from(ServiceTemplateInstance.class); + cq.select(sti).where(cb.equal(sti.get("csarId"), csarIdParameter)); + // Create a TypedQuery + final TypedQuery q = em.createQuery(cq); + q.setParameter(csarIdParameter, csarId); + // Execute + List results = q.getResultList(); + results.forEach(this::initializeInstance); + return results; + } + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationRepository.java new file mode 100644 index 000000000..1529163f9 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationRepository.java @@ -0,0 +1,15 @@ +package org.opentosca.container.core.next.repository; + +import org.opentosca.container.core.next.model.Situation; + +public class SituationRepository extends JpaRepository { + + public SituationRepository() { + super(Situation.class); + } + + @Override + protected void initializeInstance(Situation instance) { + // no dependent bags or other stuff to be fetched + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationTriggerInstanceRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationTriggerInstanceRepository.java new file mode 100644 index 000000000..a4e810527 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationTriggerInstanceRepository.java @@ -0,0 +1,29 @@ +package org.opentosca.container.core.next.repository; + +import java.util.List; + +import com.google.common.collect.Lists; +import org.hibernate.Hibernate; +import org.opentosca.container.core.next.model.SituationTriggerInstance; + +public class SituationTriggerInstanceRepository extends JpaRepository { + + public SituationTriggerInstanceRepository() { + super(SituationTriggerInstance.class); + } + + public List findBySituationTriggerId(final Long situationTriggerId) { + final List result = Lists.newArrayList(); + findAll().forEach(x -> { + if (x.getSituationTrigger().getId().equals(situationTriggerId)) { + result.add(x); + } + }); + return result; + } + + @Override + protected void initializeInstance(SituationTriggerInstance instance) { + Hibernate.initialize(instance.getOutputs()); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationTriggerRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationTriggerRepository.java new file mode 100644 index 000000000..f317df300 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationTriggerRepository.java @@ -0,0 +1,34 @@ +package org.opentosca.container.core.next.repository; + +import java.util.List; + +import com.google.common.collect.Lists; +import org.hibernate.Hibernate; +import org.opentosca.container.core.next.model.Situation; +import org.opentosca.container.core.next.model.SituationTrigger; + +public class SituationTriggerRepository extends JpaRepository { + + public SituationTriggerRepository() { + super(SituationTrigger.class); + } + + public List findSituationTriggersBySituationId(final Long situationId) { + final List result = Lists.newArrayList(); + findAll().forEach(x -> { + for (final Situation situation : x.getSituations()) { + if (situation.getId().equals(situationId)) { + result.add(x); + } + } + }); + return result; + } + + @Override + protected void initializeInstance(SituationTrigger instance) { + Hibernate.initialize(instance.getInputs()); + Hibernate.initialize(instance.getSituations()); + Hibernate.initialize(instance.getSituationTriggerInstances()); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationsMonitorRepository.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationsMonitorRepository.java new file mode 100644 index 000000000..4617e4f47 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/repository/SituationsMonitorRepository.java @@ -0,0 +1,31 @@ +package org.opentosca.container.core.next.repository; + +import java.util.Collection; + +import com.google.common.collect.Lists; +import org.hibernate.Hibernate; +import org.opentosca.container.core.next.model.SituationsMonitor; + +public class SituationsMonitorRepository extends JpaRepository { + + public SituationsMonitorRepository() { + super(SituationsMonitor.class); + } + + public Collection findSituationMonitorsBySituationId(Long situationId) { + Collection result = Lists.newArrayList(); + for (SituationsMonitor moni : this.findAll()) { + for (Collection sits : moni.getNode2Situations().values()) { + if (sits.contains(situationId)) { + result.add(moni); + } + } + } + return result; + } + + @Override + protected void initializeInstance(SituationsMonitor instance) { + Hibernate.initialize(instance.getNode2Situations()); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/trigger/SituationListener.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/trigger/SituationListener.java new file mode 100644 index 000000000..76002379a --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/trigger/SituationListener.java @@ -0,0 +1,153 @@ +package org.opentosca.container.core.next.trigger; + +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.persistence.PostUpdate; +import javax.persistence.PreUpdate; + +import com.google.common.collect.Lists; +import org.opentosca.container.core.engine.management.IManagementBus; +import org.opentosca.container.core.next.model.Situation; +import org.opentosca.container.core.next.model.SituationTrigger; +import org.opentosca.container.core.next.model.SituationTriggerInstance; +import org.opentosca.container.core.next.model.SituationsMonitor; +import org.opentosca.container.core.next.repository.SituationRepository; +import org.opentosca.container.core.next.repository.SituationTriggerInstanceRepository; +import org.opentosca.container.core.next.repository.SituationTriggerRepository; +import org.opentosca.container.core.next.repository.SituationsMonitorRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.context.support.SpringBeanAutowiringSupport; + +/** + * @author kalmankepes + */ +public class SituationListener { + + final private static Logger LOG = LoggerFactory.getLogger(SituationListener.class); + + // injection crutch to enable managementBus adaption + @Autowired + private IManagementBus managementBus; + + final SituationRepository sitRepo = new SituationRepository(); + final SituationTriggerRepository sitTrigRepo = new SituationTriggerRepository(); + final SituationTriggerInstanceRepository sitTrigInstRepo = new SituationTriggerInstanceRepository(); + final SituationsMonitorRepository sitMonRepo = new SituationsMonitorRepository(); + + @PostUpdate + void situationAfterUpdate(final Situation situation) { + Collection monis = sitMonRepo.findSituationMonitorsBySituationId(situation.getId()); + + // this SHOULD inject the managementBus dependency when we use it + SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this); + for (SituationsMonitor moni : monis) { + sendServiceInstanceAdaptionEvent(moni); + } + } + + @PreUpdate + void situationBeforeUpdate(final Situation situation) { + LOG.info("Updating situation with template " + situation.getSituationTemplateId() + " and thing " + + situation.getThingId() + " with active state " + situation.isActive()); + + final Situation sitInRepo = this.sitRepo.find(situation.getId()).get(); + + if (situation.isActive() == sitInRepo.isActive()) { + // nothing changed => do nothing + return; + } + + // handling triggers on situation changes + final List triggers = + this.sitTrigRepo.findSituationTriggersBySituationId(situation.getId()); + final List newInstances = Lists.newArrayList(); + + if (situation.isActive()) { + // fetch triggers that must be triggered on activation + triggers.forEach(x -> { + if (x.isTriggerOnActivation()) { + if (!x.isSingleInstance()) { + // if this is not a single instance we can just kick of another trigger + final SituationTriggerInstance newInstance = new SituationTriggerInstance(); + newInstance.setSituationTrigger(x); + newInstance.setStarted(false); + newInstance.setFinished(false); + newInstances.add(newInstance); + } else { + // we have to check if there is already an instance of the trigger + + final List singleInstanceTriggerInstances = + this.sitTrigInstRepo.findBySituationTriggerId(x.getId()); + + int count = 0; + + for (final SituationTriggerInstance instance : singleInstanceTriggerInstances) { + if (instance.isFinished()) { + count++; + } + } + + if (count == singleInstanceTriggerInstances.size()) { + // create new instance + final SituationTriggerInstance newInstance = new SituationTriggerInstance(); + newInstance.setSituationTrigger(x); + newInstance.setStarted(false); + newInstance.setFinished(false); + newInstances.add(newInstance); + } + } + } + }); + } else { + // fetch triggers that must kicked of on deactivation + triggers.forEach(x -> { + if (!x.isTriggerOnActivation()) { + if (!x.isSingleInstance()) { + // if this is not a single instance we can just kick of another trigger + final SituationTriggerInstance newInstance = new SituationTriggerInstance(); + newInstance.setSituationTrigger(x); + newInstance.setStarted(false); + newInstance.setFinished(false); + newInstances.add(newInstance); + } else { + // we have to check if there is already an instance of the trigger + + final List singleInstanceTriggerInstances = + this.sitTrigInstRepo.findBySituationTriggerId(x.getId()); + + int count = 0; + + for (final SituationTriggerInstance instance : singleInstanceTriggerInstances) { + if (instance.isFinished()) { + count++; + } + } + + if (count == singleInstanceTriggerInstances.size()) { + // create new instance + final SituationTriggerInstance newInstance = new SituationTriggerInstance(); + newInstance.setSituationTrigger(x); + newInstance.setStarted(false); + newInstance.setFinished(false); + newInstances.add(newInstance); + } + } + } + }); + } + this.sitTrigInstRepo.add(newInstances); + } + + private void sendServiceInstanceAdaptionEvent(SituationsMonitor monitor) { + final Map eventProperties = new HashMap<>(); + eventProperties.put("SERVICEINSTANCE", monitor.getServiceInstance()); + eventProperties.put("NODE2SITUATIONS", monitor.getNode2Situations()); + + managementBus.situationAdaption(eventProperties); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/trigger/SituationTriggerInstanceListener.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/trigger/SituationTriggerInstanceListener.java new file mode 100644 index 000000000..32a62ded9 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/trigger/SituationTriggerInstanceListener.java @@ -0,0 +1,279 @@ +package org.opentosca.container.core.next.trigger; + +import java.net.URI; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +import javax.persistence.PostPersist; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TExportedOperation; +import org.eclipse.winery.model.tosca.TPlan; + +import com.google.common.collect.Lists; +import org.glassfish.jersey.uri.UriComponent; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanInstanceEvent; +import org.opentosca.container.core.next.model.PlanInstanceState; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.model.Situation; +import org.opentosca.container.core.next.model.SituationTriggerInstance; +import org.opentosca.container.core.next.model.SituationTriggerInstanceProperty; +import org.opentosca.container.core.next.model.SituationTriggerProperty; +import org.opentosca.container.core.next.repository.PlanInstanceRepository; +import org.opentosca.container.core.next.repository.SituationTriggerInstanceRepository; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.IPlanInvocationEngine; +import org.opentosca.container.core.tosca.extension.TParameterDTO; +import org.opentosca.container.core.tosca.extension.TPlanDTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.context.support.SpringBeanAutowiringSupport; + +public class SituationTriggerInstanceListener { + + private static final List obs = Lists.newArrayList(); + + private static Map> planToOperationMap = new HashMap<>(); + + @PostPersist + public void startSituationTriggerInstanceObserver(final SituationTriggerInstance instance) { + final SituationTriggerInstanceObserver obs = new SituationTriggerInstanceObserver(instance); + // this performs service injection for us + SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(obs); + + SituationTriggerInstanceListener.obs.add(obs); + new Thread(obs).start(); + } + + private class SituationTriggerInstanceObserver implements Runnable { + + final private Logger LOG = LoggerFactory.getLogger(SituationTriggerInstanceObserver.class); + + private final SituationTriggerInstanceRepository repo = new SituationTriggerInstanceRepository(); + + @Autowired + private IPlanInvocationEngine planInvocEngine; + @Autowired + private CsarStorageService storage; + + private final PlanInstanceRepository planRepository = new PlanInstanceRepository(); + private final SituationTriggerInstance instance; + + public SituationTriggerInstanceObserver(final SituationTriggerInstance instance) { + this.instance = instance; + } + + @Override + public void run() { + this.instance.setStarted(true); + this.repo.update(this.instance); + this.LOG.debug("Started SituationTriggerInstance " + this.instance.getId()); + + final String interfaceName = this.instance.getSituationTrigger().getInterfaceName(); + final String operationName = this.instance.getSituationTrigger().getOperationName(); + final Set inputs = this.instance.getSituationTrigger().getInputs(); + + long timeAvailableInSeconds = Long.MAX_VALUE; + + for (Situation sit : this.instance.getSituationTrigger().getSituations()) { + long duration = Long.parseLong(sit.getEventTime()); + if (duration < timeAvailableInSeconds) { + timeAvailableInSeconds = duration; + } + } + + final ServiceTemplateInstance servInstance = this.instance.getSituationTrigger().getServiceInstance(); + final NodeTemplateInstance nodeInstance = this.instance.getSituationTrigger().getNodeInstance(); + + if (nodeInstance == null) { + + // plan invocation + Csar csar = storage.findById(this.instance.getSituationTrigger().getCsarId()); + + TExportedOperation op = null; + try { + op = ToscaEngine.resolveBoundaryDefinitionOperation(csar.entryServiceTemplate(), + interfaceName, operationName); + } catch (NotFoundException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + // get info about current plan + + final TPlan plan = (TPlan) op.getPlan().getPlanRef(); + + final TPlanDTO planDTO = new TPlanDTO(plan, csar.entryServiceTemplate().getTargetNamespace()); + + final long calculatedTimeFromPreviousExecutions = Long.valueOf( + plan.getOtherAttributes().getOrDefault(new QName("http://opentosca.org"), String.valueOf(0))); + + if (calculatedTimeFromPreviousExecutions > 0) { + // check if time is shorter than timeAvailable + if (calculatedTimeFromPreviousExecutions > timeAvailableInSeconds) { + this.LOG.info("Update (WCET = %d ms) not completable in timeframe of %d ms. Aborting.", + calculatedTimeFromPreviousExecutions, timeAvailableInSeconds); + return; + } else { + this.LOG.info("Update (WCET = %d ms) is completable in timeframe of %d ms. Executing.", + calculatedTimeFromPreviousExecutions, timeAvailableInSeconds); + } + } + + this.LOG.debug("Time: " + calculatedTimeFromPreviousExecutions); + + for (final TParameterDTO param : planDTO.getInputParameters().getInputParameter()) { + if (servInstance != null && param.getName().equals("OpenTOSCAContainerAPIServiceInstanceURL")) { + String url = Settings.CONTAINER_INSTANCEDATA_API + "/" + servInstance.getId(); + url = url.replace("{csarid}", csar.id().csarName()); + url = url.replace("{servicetemplateid}", UriComponent + .encode(servInstance.getTemplateId().toString(), UriComponent.Type.PATH_SEGMENT)); + + final URI uri = URI.create(UriComponent.encode(url, UriComponent.Type.PATH)); + param.setValue(uri.toString()); + } + + if (param.getValue() == null) { + for (final SituationTriggerProperty val : inputs) { + if (param.getName().equals(val.getName())) { + param.setValue(val.getValue()); + } + } + } + } + + try { + final String correlationId = planInvocEngine.createCorrelationId(); + // FIXME QName natural key migration to string leftover + if (servInstance != null) { + planInvocEngine.invokePlan(servInstance.getCsarId(), + QName.valueOf(servInstance.getTemplateId()), servInstance.getId(), planDTO, + correlationId); + } else { + planInvocEngine.invokePlan(instance.getSituationTrigger().getCsarId(), new QName(csar.entryServiceTemplate().getTargetNamespace(), csar.entryServiceTemplate().getId()), -1, + planDTO, correlationId); + } + + // now wait for finished execution + PlanInstance planInstance = planRepository.findByCorrelationId(correlationId); + while (!(planInstance.getState() == PlanInstanceState.FINISHED) + || planInstance.getState() == PlanInstanceState.FAILED) { + Thread.sleep(10000); + planInstance = planRepository.findByCorrelationId(correlationId); + } + + // plan finished, write output to trigger instance + planInstance.getOutputs().forEach(x -> instance.getOutputs() + .add(new SituationTriggerInstanceProperty(x.getName(), x.getValue(), x.getType()))); + + instance.setFinished(true); + repo.update(instance); + } catch (final InterruptedException e) { + throw new RuntimeException(e); + } + } + } + } + + private boolean isPlanExecutionFinished(final TPlanDTO plan, final String correlationId) { + + for (final TParameterDTO param : plan.getOutputParameters().getOutputParameter()) { + if (param.getName().equalsIgnoreCase("correlationid") && param.getValue() != null + && param.getValue().equals(correlationId)) { + return true; + } + } + + return false; + } + + public Map> getPlanToOperationMap() { + return SituationTriggerInstanceListener.planToOperationMap; + } + + public void setPlanToOperationMap(final Map> planToOperationMap) { + SituationTriggerInstanceListener.planToOperationMap = planToOperationMap; + } + + /** + * calculate the WCET for the given Plan by summing up operation times in plan. Does not regard parallel + * executions. + */ + public long calculateWCETForPlan(final TPlan plan) { + long calculatedTimeFromPreviousExecutions = 0; + + // contains mapping of PlanName to its contained operations + final Map> planNameToOperationsMap = getPlanToOperationMap(); + // map of longest execution times for each operation + final Map longestDurationMap = new HashMap<>(); + // find all operations contained in current plan + final List allOperationsInPlan = planNameToOperationsMap.get(plan.getId()); + + // get all previously completed PlanInstances from DB + final PlanInstanceRepository planRepo = new PlanInstanceRepository(); + final Collection allOccurences = planRepo.findAll(); + + // iterate all instances until match is found + if (allOperationsInPlan != null) { + for (final PlanInstance currInstance : allOccurences) { + if (currInstance.getTemplateId().getLocalPart().equals(plan.getId())) { + iterateInstanceEventsForExecutionTimes(longestDurationMap, allOperationsInPlan, currInstance); + } + } + } + // add up the times of longest durations found for operations in plan + for (final Long duration : longestDurationMap.values()) { + calculatedTimeFromPreviousExecutions += duration; + } + return calculatedTimeFromPreviousExecutions; + } + + /** + * iterate through all PlanInstanceEvents of a PlanInstance and compare with matching operation from current Plan + */ + private void iterateInstanceEventsForExecutionTimes(final Map longestDurationMap, + final List allOperationsInPlan, final PlanInstance currInstance) { + // iterate all operations from current plan + for (final String oneOperationFromPlan : allOperationsInPlan) { + // iterate all events from current PlanInstance + for (final PlanInstanceEvent aEvent : currInstance.getEvents()) { + if (Objects.nonNull(aEvent.getOperationName()) && Objects.nonNull(aEvent.getExecutionDuration()) + && Objects.nonNull(aEvent.getNodeTemplateID())) { + if (oneOperationFromPlan.equals(aEvent.getNodeTemplateID() + aEvent.getOperationName())) { + checkIfCurrentOperationExecutionTimeIsLonger(longestDurationMap, aEvent); + } + } + } + } + } + + /** + * if operation already contained in map, check if current execution duration is larger (replace) or smaller + * (leave) + */ + private void checkIfCurrentOperationExecutionTimeIsLonger(final Map longestDurationMap, + final PlanInstanceEvent aEvent) { + // key already exists in map + if (longestDurationMap.containsKey(aEvent.getNodeTemplateID() + aEvent.getOperationName())) { + if (longestDurationMap.get(aEvent.getNodeTemplateID() + aEvent.getOperationName()) < aEvent + .getExecutionDuration()) { + longestDurationMap.put(aEvent.getNodeTemplateID() + aEvent.getOperationName(), + aEvent.getExecutionDuration()); + } + } else { + longestDurationMap.put(aEvent.getNodeTemplateID() + aEvent.getOperationName(), + aEvent.getExecutionDuration()); + } + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Enums.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Enums.java similarity index 82% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Enums.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Enums.java index 93016ed82..ec4ec166b 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Enums.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Enums.java @@ -5,7 +5,7 @@ public abstract class Enums { /** * A utility method for all enums for string to enum conversion * - * @param c the Enum type + * @param c the Enum type * @param value value as case insesitive string * @return The corresponding enum, or null */ @@ -16,8 +16,8 @@ public static > T valueOf(final Class c, final String value /** * A utility method for all enums for string to enum conversion * - * @param c the Enum type - * @param value value as case insesitive string + * @param c the Enum type + * @param value value as case insesitive string * @param defaultValue a default value * @return The corresponding enum, or null */ @@ -25,8 +25,7 @@ public static > T valueOf(final Class c, final String value if (c != null && value != null) { try { return Enum.valueOf(c, value.trim().toUpperCase()); - } - catch (final IllegalArgumentException e) { + } catch (final IllegalArgumentException e) { return defaultValue; } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Exceptions.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Exceptions.java similarity index 83% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Exceptions.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Exceptions.java index c867c8832..44e281265 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Exceptions.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Exceptions.java @@ -28,21 +28,20 @@ public interface Runnable_WithExceptions { /** * Rethrows an exception as unchecked. - * + *

    * {@code .forEach(rethrow(name -> System.out.println(Class.forName(name)))) } - * + *

    * {@code .forEach(rethrow(ClassNameUtil::println)) } * * @param consumer The {@link Consumer_WithExceptions} consumer - * @param Object of type T to accept + * @param Object of type T to accept * @return {@link Consumer} object */ public static Consumer rethrow(final Consumer_WithExceptions consumer) { return t -> { try { consumer.accept(t); - } - catch (final Exception exception) { + } catch (final Exception exception) { throwAsUnchecked(exception); } }; @@ -50,22 +49,21 @@ public static Consumer rethrow(final Consumer_WithExceptions consumer) /** * Rethrows an exception as unchecked. - * + *

    * {@code .map(rethrow(name -> Class.forName(name))) } - * + *

    * {@code .map(rethrow(Class::forName)) } * * @param function The {@link Function_WithExceptions} function - * @param Object of type T to apply - * @param The type to return + * @param Object of type T to apply + * @param The type to return * @return {@link Function} object */ public static Function rethrow(final Function_WithExceptions function) { return t -> { try { return function.apply(t); - } - catch (final Exception exception) { + } catch (final Exception exception) { throwAsUnchecked(exception); return null; } @@ -74,19 +72,18 @@ public static Function rethrow(final Function_WithExceptions /** * Rethrows an exception as unchecked. - * + *

    * {@code rethrow(() -> new StringJoiner(new String(new byte[]{77, 97, 114, 107}, "UTF-8"))) } * * @param supplier The {@link Supplier_WithExceptions} supplier - * @param Object of type T to get + * @param Object of type T to get * @return {@link Supplier} object */ public static Supplier rethrow(final Supplier_WithExceptions supplier) { return () -> { try { return supplier.get(); - } - catch (final Exception exception) { + } catch (final Exception exception) { throwAsUnchecked(exception); return null; } @@ -95,7 +92,7 @@ public static Supplier rethrow(final Supplier_WithExceptions supplier) /** * Unchecks an expression. - * + *

    * {@code uncheck(() -> Class.forName("xxx")); } * * @param runnable The {@link Runnable_WithExceptions} runnable @@ -103,26 +100,24 @@ public static Supplier rethrow(final Supplier_WithExceptions supplier) public static void uncheck(final Runnable_WithExceptions runnable) { try { runnable.accept(); - } - catch (final Exception exception) { + } catch (final Exception exception) { throwAsUnchecked(exception); } } /** * Unchecks an expression. - * + *

    * {@code uncheck(() -> Class.forName("xxx")); } * * @param supplier The {@link Supplier_WithExceptions} supplier - * @param The type to return + * @param The type to return * @return Object of type R */ public static R uncheck(final Supplier_WithExceptions supplier) { try { return supplier.get(); - } - catch (final Exception exception) { + } catch (final Exception exception) { throwAsUnchecked(exception); return null; } @@ -130,20 +125,19 @@ public static R uncheck(final Supplier_WithExceptions supplier) { /** * Unchecks an expression. - * + *

    * {@code uncheck(Class::forName, "xxx"); } * * @param function The {@link Function_WithExceptions} function - * @param t The object of type T - * @param Object of type T to apply - * @param The type to return + * @param t The object of type T + * @param Object of type T to apply + * @param The type to return * @return Object of type R */ public static R uncheck(final Function_WithExceptions function, final T t) { try { return function.apply(t); - } - catch (final Exception exception) { + } catch (final Exception exception) { throwAsUnchecked(exception); return null; } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Types.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Types.java new file mode 100644 index 000000000..24284cb78 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/utils/Types.java @@ -0,0 +1,17 @@ +package org.opentosca.container.core.next.utils; + +public abstract class Types { + + /** + * Utility function to create a proper type definition using generics. + *

    + * Usage: Class> mapType = Types.generify(Map.class); + * + * @param clazz The type to generify + * @return The generified type + */ + @SuppressWarnings("unchecked") + public static Class generify(final Class clazz) { + return (Class) clazz; + } +} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/xml/DomUtil.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/xml/DomUtil.java similarity index 95% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/xml/DomUtil.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/xml/DomUtil.java index 917a6c97d..e8e8efdd1 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/xml/DomUtil.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/xml/DomUtil.java @@ -9,7 +9,6 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import org.opentosca.container.core.next.utils.Consts; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; @@ -46,7 +45,7 @@ public static String getNodeValue(final Node node) { return data.getNodeValue(); } } - return Consts.EMPTY; + return ""; } public static String getNodeValue(final String tagName, final NodeList nodes) { @@ -62,7 +61,7 @@ public static String getNodeValue(final String tagName, final NodeList nodes) { } } } - return Consts.EMPTY; + return ""; } public static String getNodeAttribute(final String attrName, final Node node) { @@ -73,7 +72,7 @@ public static String getNodeAttribute(final String attrName, final Node node) { return attr.getNodeValue(); } } - return Consts.EMPTY; + return ""; } public static String getNodeAttribute(final String tagName, final String attrName, final NodeList nodes) { @@ -91,7 +90,7 @@ public static String getNodeAttribute(final String tagName, final String attrNam } } } - return Consts.EMPTY; + return ""; } public static String toString(final Document document) { @@ -113,8 +112,7 @@ public static String toString(final DOMSource source) { transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.transform(source, new StreamResult(sw)); return sw.toString(); - } - catch (final Exception e) { + } catch (final Exception e) { throw new RuntimeException("Error converting XML to String: " + e.getMessage(), e); } } diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/xml/PropertyParser.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/xml/PropertyParser.java similarity index 98% rename from org.opentosca.container.core/src/org/opentosca/container/core/next/xml/PropertyParser.java rename to org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/xml/PropertyParser.java index 004750669..9333cab1d 100644 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/xml/PropertyParser.java +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/next/xml/PropertyParser.java @@ -59,8 +59,7 @@ private Document createDocument(final String xml) { factory.setNamespaceAware(true); final DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(new InputSource(new StringReader(xml))); - } - catch (final Exception e) { + } catch (final Exception e) { logger.error("Error parsing XML string", e); throw new IllegalArgumentException(e); } diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/plan/PlanInvocationEngine.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/plan/PlanInvocationEngine.java new file mode 100644 index 000000000..d181c0068 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/plan/PlanInvocationEngine.java @@ -0,0 +1,134 @@ +package org.opentosca.container.core.plan; + +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; +import java.util.Objects; + +import javax.inject.Inject; +import javax.persistence.NoResultException; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TExportedOperation; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.engine.management.IManagementBus; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.repository.PlanInstanceRepository; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.IPlanInvocationEngine; +import org.opentosca.container.core.tosca.extension.TParameterDTO; +import org.opentosca.container.core.tosca.extension.TPlanDTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * The Implementation of the Engine. Also deals with OSGI events for communication with the mock-up Servicebus. + *

    + * Copyright 2013 Christian Endres + * + * @author endrescn@fachschaft.informatik.uni-stuttgart.de + */ +@Service +@NonNullByDefault +public class PlanInvocationEngine implements IPlanInvocationEngine { + + private static final Logger LOG = LoggerFactory.getLogger(PlanInvocationEngine.class); + private static final PlanInstanceRepository planRepo = new PlanInstanceRepository(); + + private final IManagementBus managementBus; + private final CsarStorageService csarStorage; + private final RulesChecker rulesChecker; + + @Inject + public PlanInvocationEngine(IManagementBus managementBus, + CsarStorageService csarStorage, + RulesChecker rulesChecker) { + this.managementBus = managementBus; + this.csarStorage = csarStorage; + this.rulesChecker = rulesChecker; + } + + @Override + public String createCorrelationId() { + // generate CorrelationId for the plan execution + while (true) { + final String correlationId = String.valueOf(System.currentTimeMillis()); + + try { + PlanInstance instance = planRepo.findByCorrelationId(correlationId); + if (instance == null) { + return correlationId; + } + this.LOG.debug("CorrelationId {} already in use.", correlationId); + } catch (final NoResultException e) { + return correlationId; + } + } + } + + @Override + public void invokePlan(CsarId csarID, QName serviceTemplateId, long serviceTemplateInstanceID, TPlanDTO plan, String correlationID) { + final Csar csar = csarStorage.findById(csarID); + final TServiceTemplate serviceTemplate; + try { + serviceTemplate = ToscaEngine.resolveServiceTemplate(csar, serviceTemplateId); + } catch (NotFoundException e) { + LOG.warn("Could not find ServiceTemplate associated with id {} in given CSAR {}!", + serviceTemplateId, csar.id().csarName()); + // FIXME mark plan invocation as failed? + return; + } + invokePlan(csarID, serviceTemplate, serviceTemplateInstanceID, plan, correlationID); + } + + @Override + public void invokePlan(final CsarId csarID, final TServiceTemplate serviceTemplate, long serviceTemplateInstanceID, + final TPlanDTO givenPlan, String correlationId) { + + final Csar csar = csarStorage.findById(csarID); + + if (rulesChecker.areRulesContained(csar)) { + if (rulesChecker.check(csar, serviceTemplate, givenPlan.getInputParameters())) { + LOG.debug("Deployment Rules are fulfilled. Continuing the provisioning."); + } else { + LOG.debug("Deployment Rules are not fulfilled. Aborting the provisioning."); + return; + } + } + + LOG.info("Invoke the Plan {} of type {} of CSAR {}", givenPlan.getId(), givenPlan.getPlanType(), csarID); + + final HashMap input = new HashMap<>(); + for (final TParameterDTO param : givenPlan.getInputParameters().getInputParameter()) { + if (Objects.isNull(param.getValue())) { + input.put(param.getName(), ""); + } else { + input.put(param.getName(), param.getValue()); + } + } + + // send the message to the service bus + final Map eventValues = new Hashtable<>(); + eventValues.put("CSARID", csarID); + eventValues.put("SERVICETEMPLATEID", QName.valueOf(serviceTemplate.getId())); + eventValues.put("PLANID", givenPlan.getId()); + eventValues.put("PLANLANGUAGE", givenPlan.getPlanLanguage()); + eventValues.put("SERVICEINSTANCEID", serviceTemplateInstanceID); + eventValues.put("MESSAGEID", correlationId); + // the planRef is an xsd:IDREF as per Tosca-v1.0.xsd, and therefore an unqualified name + // FIXME adapt TPlanDTO to match Tosca XSD + TExportedOperation operation = ToscaEngine.getReferencingOperationWithin(serviceTemplate, givenPlan.getId().getLocalPart()); + eventValues.put("OPERATIONNAME", operation.getName()); + eventValues.put("INPUTS", input); + + // no callback, because plan output updates are handled in management bus + managementBus.invokePlan(eventValues); + } +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/plan/RulesChecker.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/plan/RulesChecker.java new file mode 100644 index 000000000..e636a31d8 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/plan/RulesChecker.java @@ -0,0 +1,314 @@ +package org.opentosca.container.core.plan; + +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.Definitions; +import org.eclipse.winery.model.tosca.TEntityTemplate; +import org.eclipse.winery.model.tosca.TEntityTemplate.Properties; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TRelationshipTemplate; +import org.eclipse.winery.model.tosca.TServiceTemplate; +import org.eclipse.winery.model.tosca.TTopologyTemplate; + +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.engine.xml.IXMLSerializer; +import org.opentosca.container.core.engine.xml.IXMLSerializerService; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.tosca.extension.TParameterDTO; +import org.opentosca.container.core.tosca.extension.TPlanDTO.InputParameters; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +@Service +public class RulesChecker { + + private final static Logger LOG = LoggerFactory.getLogger(RulesChecker.class); + + private final IXMLSerializer serializer; + + @Inject + public RulesChecker(IXMLSerializerService service) { + this.serializer = service.getXmlSerializer(); + } + + boolean check(final Csar csar, final TServiceTemplate serviceTemplate, final InputParameters inputParameters) { + LOG.debug("Checking Rules"); + List stWhiteRuleList; + List stBlackRuleList; + try { + stWhiteRuleList = getRules(csar, true); + stBlackRuleList = getRules(csar, false); + } catch (UserException | SystemException e) { + e.printStackTrace(); + return false; + } + + return checkRules(stWhiteRuleList, "white", serviceTemplate, inputParameters) + && checkRules(stBlackRuleList, "black", serviceTemplate, inputParameters); + } + + private boolean checkRules(final List stRuleList, final String ruleType, + final TServiceTemplate serviceTemplate, + final InputParameters inputParameters) { + + for (final TServiceTemplate stRule : stRuleList) { + + LOG.debug("Checking Rule: " + stRule.getName() + " RuleType: " + ruleType); + + final TTopologyTemplate rule = stRule.getTopologyTemplate(); + final List templateRuleList = rule.getNodeTemplateOrRelationshipTemplate(); + for (final TEntityTemplate templateRule : templateRuleList) { + if (!(templateRule instanceof TRelationshipTemplate)) { + continue; + } + + final TRelationshipTemplate relationshipRule = (TRelationshipTemplate) templateRule; + final TNodeTemplate sourceRuleNTemplate = (TNodeTemplate) relationshipRule.getSourceElement().getRef(); + + final TNodeTemplate targetRuleNTemplate = (TNodeTemplate) relationshipRule.getTargetElement().getRef(); + + boolean ruleCanBeApplied = false; + // check for types + if (sourceRuleNTemplate.getId().equals("*")) { + final List nodeTemplates = serviceTemplate.getTopologyTemplate().getNodeTemplates(); + + for (final TNodeTemplate nodeTemplate : nodeTemplates) { + final QName nodeType = nodeTemplate.getType(); + // found matching nodetemplate + if (nodeType.equals(sourceRuleNTemplate.getType())) { + LOG.debug("Rule " + stRule.getName() + " can be applied to Service Template: " + serviceTemplate + ". Reason: Matching Source NodeTypes."); + ruleCanBeApplied = true; + } + } + // check for identical IDs + } else { + // check source + if (ToscaEngine.getNodeTemplate(serviceTemplate, sourceRuleNTemplate.getId()).isPresent()) { + LOG.debug("Rule " + stRule.getName() + " can be applied to Service Template: " + serviceTemplate + ". Reason: Matching Source NodeTemplateIDs."); + ruleCanBeApplied = true; + } + } + + if (!ruleCanBeApplied) { + LOG.debug("Rule " + stRule.getName() + " can not be applied to Service Template: " + serviceTemplate + ".Thus, rule is ignored."); + continue; + } + if (targetRuleNTemplate.getId().equals("*")) { + targetRuleNTemplate.getType(); + + boolean found = false; + while (!found) { + TNodeTemplate targetNT = ToscaEngine.getRelatedNodeTemplate(serviceTemplate, sourceRuleNTemplate, relationshipRule.getType()); + + if (targetNT == null) { + switch (ruleType) { + case "white": + LOG.warn("Target Node Template not found. Rule not fulfilled."); + return false; + case "black": + LOG.debug("Nodes are not matching. Rule is fulfilled."); + break; + } + } else { + final QName relatedNodeType = targetNT.getType(); + if (relatedNodeType.equals(targetRuleNTemplate.getType())) { + found = true; + LOG.debug("Matching Target Node Type found. Node Template: " + targetNT); + + // comparing properties + if (arePropertiesMatching(sourceRuleNTemplate, inputParameters, targetRuleNTemplate)) { + switch (ruleType) { + case "white": + LOG.debug("Properties are matching. Rule is fulfilled."); + break; + case "black": + LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Properties are matching."); + return false; + } + } else { + switch (ruleType) { + case "white": + LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Properties are not matching."); + return false; + case "black": + LOG.debug("Properties are not matching. Rule is fulfilled."); + break; + } + } + } + } + } + + // check target nodetemplateID + } else { + Optional nodeTemplate = ToscaEngine.getNodeTemplate(serviceTemplate, targetRuleNTemplate.getId()); + if (nodeTemplate.isPresent()) { + // comparing properties + if (arePropertiesMatching(sourceRuleNTemplate, inputParameters, targetRuleNTemplate)) { + switch (ruleType) { + case "white": + LOG.debug("Properties are matching. Rule is fulfilled."); + break; + case "black": + LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Properties are matching."); + return false; + } + } else { + switch (ruleType) { + case "white": + LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Properties are not matching."); + return false; + case "black": + LOG.debug("Properties are not matching. Rule is fulfilled."); + break; + } + } + + // if source is matching but target isn't, abort + } else { + switch (ruleType) { + case "white": + LOG.warn("Rule is not fulfilled. Aborting the Provisioning. Reason: Source is matching, but target isn't."); + return false; + case "black": + LOG.debug("Nodes are not matching. Rule is fulfilled."); + break; + } + } + } + } + } + return true; + } + + boolean areRulesContained(final Csar csar) { + final Path rulesDirectory = csar.getSaveLocation().resolve("Rules"); + final Path dirWhite = rulesDirectory.resolve("Whitelisting"); + final Path dirBlack = rulesDirectory.resolve("Blacklisting"); + if (Files.exists(dirWhite) || Files.exists(dirBlack)) { + LOG.debug("Deployment Rules found."); + return true; + } + LOG.debug("No Deployment Rules are defined."); + return false; + } + + private List getRules(final Csar csar, final boolean whiteRules) throws UserException, SystemException { + + Path dir = csar.getSaveLocation().resolve(whiteRules ? "Rules/Whitelisting" : "Rules/Blacklisting"); + final List rulesList = new ArrayList<>(); + + try (DirectoryStream rulesFiles = Files.newDirectoryStream(dir, "*.tosca")) { + for (Iterator rulesFilesIt = rulesFiles.iterator(); rulesFilesIt.hasNext(); ) { + Path rulesFile = rulesFilesIt.next(); + LOG.trace("Rules File: {}", rulesFile.toAbsolutePath().toString()); + final Definitions definitions = serializer.unmarshal(Files.newInputStream(rulesFile)); + definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation() + .stream().map(TServiceTemplate.class::cast) + .forEach(rulesList::add); + } + } catch (IOException e) { + return Collections.emptyList(); + } + + return rulesList; + } + + private Map getPropertiesOfNodeTemplate(final TNodeTemplate nodeTemplate) { + + LOG.debug("Getting Properties."); + if (nodeTemplate == null) { + LOG.debug("The requested NodeTemplate was not found."); + return null; + } + final Properties properties = nodeTemplate.getProperties(); + if (properties == null) { + LOG.debug("Properties are not set."); + return null; + } + final Object any = properties.getInternalAny(); + if (!(any instanceof Element)) { + LOG.debug("Properties is not of class Element."); + return null; + } + + final Element element = (Element) any; + final Document doc = element.getOwnerDocument(); + return getPropertiesFromDoc(doc); + } + + private static Map getPropertiesFromDoc(final Document doc) { + + final Map propertiesMap = new HashMap<>(); + + final NodeList nodeList = doc.getChildNodes(); + for (int i = 0; i < nodeList.getLength(); i++) { + final Node node = nodeList.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE) { + final NodeList nodeList2 = node.getChildNodes(); + for (int i2 = 0; i2 < nodeList2.getLength(); i2++) { + final Node node2 = nodeList2.item(i2); + if (node2.getNodeType() == Node.ELEMENT_NODE) { + final String propName = node2.getNodeName(); + final String propValue = node2.getTextContent(); + LOG.debug("Property: " + propName + " has Value: " + propValue); + if (propName != null && propValue != null) { + propertiesMap.put(node2.getNodeName(), node2.getTextContent()); + } + } + } + } + } + return propertiesMap; + } + + private boolean arePropertiesMatching(final TNodeTemplate relatedNodeTemplate, + final InputParameters inputParameters, + final TNodeTemplate targetRuleNTemplate) { + final Document propsDoc = ToscaEngine.getNodeTemplateProperties(relatedNodeTemplate); + + final Map propertiesMap = getPropertiesFromDoc(propsDoc); + final Map rulesPropertiesMap = getPropertiesOfNodeTemplate(targetRuleNTemplate); + + for (final String name : rulesPropertiesMap.keySet()) { + final String value = rulesPropertiesMap.get(name); + if (!propertiesMap.containsKey(name)) { + continue; + } + if (propertiesMap.get(name) == null || propertiesMap.get(name).contains("get_input:")) { + for (final TParameterDTO para : inputParameters.getInputParameter()) { + if (para.getName().equals(name) && !para.getValue().equals(value)) { + LOG.debug("Property " + name + " not matching. " + para.getValue() + " != " + value); + return false; + } + } + } else if (!propertiesMap.get(name).equals(value)) { + LOG.debug("Property " + name + " not matching! " + propertiesMap.get(name) + " != " + value); + return false; + } + } + + return true; + } +} + diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/CsarStorageService.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/CsarStorageService.java new file mode 100644 index 000000000..dfb88e6e4 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/CsarStorageService.java @@ -0,0 +1,101 @@ +package org.opentosca.container.core.service; + +import java.io.InputStream; +import java.nio.file.Path; +import java.util.NoSuchElementException; +import java.util.Set; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; + +@NonNullByDefault +public interface CsarStorageService { + + /** + * Loads all available CSARs as {@link Csar} from storage. + * + * @return Set of {@link Csar} objects + */ + public Set findAll(); + + /** + * Loads the data of the CSAR associated with the given {@link CsarId} from storage. + * + * @param id The unique {@link CsarId} of the CSAR to retrieve. + * @return A {@link Csar} instance representing the CSAR identified by the ID. + * @throws NoSuchElementException in case the CSARID was unknown. + */ + public Csar findById(CsarId id) throws NoSuchElementException; + + /** + * Temporarily stores all information in the given {@link InputStream} as a temporary file with the given filename. + * + * @param filename The name for the temporary file. + * @param is A stream containing the data to store temporarily. + * @return The Path the CSAR has been stored to. + * @apiSpec The given inputStream is not closed by this method. + */ + public Path storeCSARTemporarily(final String filename, final InputStream is); + + /** + *

    + * Stores the given CSAR-File permanently. + *

    + * If the given CSAR is already stored, this method rejects the input. Otherwise the following steps are performed. + *

      + *
    1. Unpack the CSAR archive to a temporary location
    2. + *
    3. Validate CSAR content
    4. + *
    5. Parse TOSCA Metafile
    6. + *
    7. Store unpacked CSAR content in permanent storage
    8. + *
    9. Store Metadata about the CSAR to the database
    10. + *
    + * + * @param csarLocation The location of the CSAR file + * @return a {@link CsarId} to uniquely identify the CSAR that has been stored + * @throws SystemException if unpacking the CSAR failed, access to a directory was denied while getting files and + * directories in unpack directory or if an error occurred during storing to disk. + * @throws UserException if {@code csarFile} is not a existent file, has wrong file extension, is already stored + * or it's content is invalid, e.g. contains no TOSCA file or has an invalid TOSCA meta + * file. + */ + public CsarId storeCSAR(Path csarLocation) throws UserException, SystemException; + + /** + *

    + * Deletes the CSAR belonging to the given {@link CsarId} from storage. That includes deleting it's metadata from + * the database. + *

    + * If an error occurs during the deletion of files, the metadata stays in the database. Warning: this is a process + * that can not be compensated. As such errors can leave the CSAR in an inconsistent state. + * + * @param csarId The {@link CsarId} identifying the CSAR to delete. + * @throws UserException if the identified CSAR was not found. + * @throws SystemException if an error occurred during deleting files. + */ + public void deleteCSAR(CsarId csarId) throws UserException, SystemException; + + /** + * Deletes all CSARs in the storage, including deleting their metadata from the database. + * + * @throws SystemException if an error occured during deleting files. + */ + void purgeCsars() throws SystemException; + + /** + * Exports a stored CSAR {@code csarID}.
    First, it creates a directory structure and copies all files of the + * CSAR to a sub directory of a Temporary directory. Finally the content of this directory will be compressed as a + * CSAR file. The created CSAR file is located directly in that temporary directory.

    + *

    + * Note: At the end or if an error occurred the directory that contains the content of the CSAR file will be deleted + * (if necessary). + * + * @param csarID of CSAR + * @return CSAR {@code csarID} as {@link Path} object. + * @throws UserException if CSAR {@code csarID} was not found. + * @throws SystemException if an error occurred during retrieving files of CSAR or compression. + */ + Path exportCSAR(CsarId csarId) throws UserException, SystemException; +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/DeploymentTracker.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/DeploymentTracker.java new file mode 100644 index 000000000..d4e76d251 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/DeploymentTracker.java @@ -0,0 +1,100 @@ +package org.opentosca.container.core.service; + +import java.util.Collection; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.deployment.ia.IADeploymentInfo; +import org.opentosca.container.core.model.deployment.ia.IADeploymentState; +import org.opentosca.container.core.model.deployment.plan.PlanDeploymentInfo; +import org.opentosca.container.core.model.deployment.plan.PlanDeploymentState; +import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; + +public interface DeploymentTracker { + + /** + * Store the deployment state of a given Csar to the attached database. + * + * @param csar The csar that the deployment process state applies to. + * @param state The deployment state applying. + */ + public void storeDeploymentState(CsarId csar, DeploymentProcessState state); + + /** + * Retrieve the current deployment process state of a given Csar. + * + * @param csar The csar to retrieve deployment state for. + * @return The deployment state of the given Csar, null if no state is available for the given Csar + */ + public DeploymentProcessState getDeploymentState(CsarId csar); + + /** + * Stores the given information about the encapsulated implementation artifact into the database. Previous + * deploymentInfo will be overwritten! + * + * @param info The deployment information set to store about the implementation artifact. + */ + public void storeIADeploymentInfo(IADeploymentInfo info); + + /** + * @deprecated see {@link #storeIADeploymentInfo(IADeploymentInfo)} + */ + @Deprecated + public void storeIADeploymentInfo(CsarId csar, String iaRelPath, IADeploymentState deploymentState); + + /** + * Retrieve the stored deployment information for a specific implementation artifact identified by it's relative + * path within the Csar and it's parent Csar. + * + * @param csar The parent Csar that the implementation artifact belongs to + * @param iaRelPath The relative path of the implementation artifact within the csar + * @return The stored deployment information pertaining to the implementation artifact + */ + public IADeploymentInfo getIADeploymentInfo(CsarId csar, String iaRelPath); + + /** + * Retrieve all implementation artifact related deployment information for a given Csar. + * + * @param csar The csar to check for deployment information on artifacts. + * @return All Implementation Artifact information for the given Csar + */ + public Collection getIADeployments(CsarId csar); + + /** + * Store the given Deployment Information for a plan, overwriting any already stored information for the Plan + * encapsulated in the Deployment Information object. + * + * @param info The information to store in the database + */ + public void storePlanDeploymentInfo(PlanDeploymentInfo info); + + /** + * @deprecated see {@link #storePlanDeploymentInfo(PlanDeploymentInfo)} + */ + @Deprecated + public void storePlanDeploymentInfo(CsarId csar, String planRelPath, PlanDeploymentState deploymentState); + + /** + * Retrieves the plan deployment information stored for a given plan belonging to a given Csar. + * + * @param csar The Csar that the plan deployment belongs to. + * @param planRelPath The relative path of the Plan within the Csar. + * @return The plan deployment information associated with the given Csar and plan, null if no such plan is + * known. + */ + public PlanDeploymentInfo getPlanDeploymentInfo(CsarId csar, String planRelPath); + + /** + * Retrieves all plan deployment information stored in relation to a given csar. + * + * @param csar The csar who's plan deployments are to be found. + * @return All plan deployment information associated with the given Csar + */ + public Collection getPlanDeployments(CsarId csar); + + /** + * Deletes all deployment information associated to the given Csar. + * + * @param csar The csar to remove from deployment tracking. + */ + public void deleteDeploymentState(CsarId csar); +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/ICoreCapabilityService.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/ICoreCapabilityService.java new file mode 100644 index 000000000..0307c2b9f --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/ICoreCapabilityService.java @@ -0,0 +1,48 @@ +package org.opentosca.container.core.service; + +import java.util.List; +import java.util.Map; + +import org.opentosca.container.core.model.capability.provider.ProviderType; + +/** + * This interface provides methods to store, get and delete capabilities of different provider and provider types.
    + *

    + * The IAEngine needs this capabilities to decide if a Implementation Artifact should be deployed or not. + * + * @see ProviderType + */ +public interface ICoreCapabilityService { + + /** + * Stores capabilities. + * + * @param capabilities to store. + * @param providerName Name of the provider (e.g. a plugin) where the capabilities are from. + * @param providerType identifies if the capabilities are from the Container, a PlanEnginePlugin or a IAEnginePlugin + * (see {@link ProviderType}). + */ + public void storeCapabilities(List capabilities, String providerName, ProviderType providerType); + + /** + * @param providerType identifies if the capabilities are from the Container, a PlanEnginePlugin or a IAEnginePlugin + * (see {@link ProviderType}). + * @return Map with all providers and their capabilities. + */ + public Map> getCapabilities(ProviderType providerType); + + /** + * @param providerName Name of the provider (e.g. a plugin) where the capabilities should be fetched from. + * @param providerType identifies if the capabilities are from the Container, a PlanEnginePlugin or a IAEnginePlugin + * (see {@link ProviderType}). + * @return List with all capabilities of given provider. + */ + public List getCapabilities(String providerName, ProviderType providerType); + + /** + * Deletes all stored capabilities of a provider. + * + * @param providerName Name of the provider (e.g. a plugin) where the capabilities should be deleted from. + */ + public void deleteCapabilities(String providerName); +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/ICoreEndpointService.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/ICoreEndpointService.java new file mode 100644 index 000000000..e6db6daa4 --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/ICoreEndpointService.java @@ -0,0 +1,134 @@ +package org.opentosca.container.core.service; + +import java.net.URI; +import java.util.List; + +import javax.xml.namespace.QName; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint; +import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint.restMethod; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; + +/** + * This interface provides methods to retrieve and store endpoints. It is meant to be used by the Engines. + */ +public interface ICoreEndpointService { + + /** + * This method queries for all WSDL-Endpoints identified by the given portType and thorID. It then returns a List of + * the retrieved Endpoints. + * + * @param portType : PortType to identify the Endpoint + * @param thorID : thorID to identify the Endpoint + * @return ArrayList containing all corresponding WSDLEndpoints + * @see WSDLEndpoint + */ + public List getWSDLEndpoints(QName portType, String triggeringContainer, CsarId csarId); + + /** + * This method stores a given WSDLEndpoint object. + * + * @param endpoint : The WSDL-Endpoint to store + * @see WSDLEndpoint + */ + public void storeWSDLEndpoint(WSDLEndpoint endpoint); + + /** + * This method queries for RESTEndpoints identified by the given URI and thorID + * + * @param anyURI : Uri to identify the Endpoint + * @param thorID : thorID to identify the Endpoint + * @return ArrayList containing all endpoints matching the given parameters + * @see RESTEndpoint + */ + public List getRestEndpoints(URI anyURI, String triggeringContainer, CsarId csarId); + + /** + * This method queries for a RESTEndpoint identified by the given URI, RestMethod {GET,PUT,POST,DELETE} and thorID + * + * @param anyURI : Uri to identify the Endpoint + * @param method : RestMethod {GET, PUT, POST, DELETE} to identify the Endpoint + * @param thorID : thorID to identify the Endpoint + * @return RESTEndpoint matching the given parameters + * @see RESTEndpoint + */ + public RESTEndpoint getRestEndpoint(URI anyURI, restMethod method, String triggeringContainer, CsarId csarId); + + /** + * This method queries for a WSDLEndpoint identified by the given CSARID and PlanId + * + * @param csarId an id of type CSARID + * @param planId an id of type QName + * @return a WSDLEndpoint representing a Plan stored in the endpoint db or null if nothing was found + */ + public WSDLEndpoint getWSDLEndpointForPlanId(String triggeringContainer, CsarId csarId, QName planId); + + /** + * This method queries for a WSDLEndpoint identified by the given CSARID, NodeTypeImplementationId and + * ImplementationArtifact Name + * + * @param csarId an id of type CSARID + * @param nodeTypeImpl an id of type QName + * @param iaName an id of type String + * @return a WSDLEndpoint representing the given IA if one was found else null + */ + public WSDLEndpoint getWSDLEndpointForIa(CsarId csarId, QName nodeTypeImpl, String iaName); + + /** + * This method queries for all WSDLEndpoints identified by the given CSARID + * + * @param csarId an id of type CSARID + * @return List of WSDLEndpoints of the given CSARID if min. one was found else null + */ + public List getWSDLEndpointsForCsarId(String triggeringContainer, CsarId csarId); + + /** + * This method queries for all WSDLEndpoints identified by the given Container and ServiceTemplateInstance ID + * + * @param triggeringContainer OpenTOSCA Container host name where the ServiceTemplateInstance identified by + * serviceTemplateInstanceID resides + * @param serviceTemplateInstanceID an ID which identifies a ServiceTemplateInstance uniquely + * @return List of WSDLEndpoints of the given serviceTemplateInstanceID if min. one was found else null + */ + public List getWSDLEndpointsForSTID(String triggeringContainer, Long serviceTemplateInstanceID); + + /** + * This method queries for a WSDLEndpoint identified by NodeTypeImplementationId and ImplementationArtifact Name + * + * @param nodeTypeImpl an id of type QName + * @param iaName an id of type String + * @return a WSDLEndpoint representing the given IA if one was found else null + */ + public List getWSDLEndpointsForNTImplAndIAName(String triggeringContainer, String managingContainer, + QName nodeTypeImpl, String iaName); + + /** + * This method queries for all WSDLEndpoints + * + * @return List of WSDLEndpoints if min. one was found else null + */ + public List getWSDLEndpoints(); + + /** + * This method stores a given RESTEndpoint object. + * + * @param endpoint : RESTEndpoint to store + * @see WSDLEndpoint + */ + public void storeRESTEndpoint(RESTEndpoint endpoint); + + /** + * Removes the given WSDL Endpoint if found + * + * @param endpoint the WSDL Endpoint to remove + * @return true if removing the endpoint was successful, else false + */ + public boolean removeWSDLEndpoint(WSDLEndpoint endpoint); + + /** + * Debug print of plan endpoints. + */ + @Deprecated + public void printPlanEndpoints(); +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IHTTPService.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IHTTPService.java new file mode 100644 index 000000000..0b8fe235b --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IHTTPService.java @@ -0,0 +1,108 @@ +package org.opentosca.container.core.service; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.apache.http.Header; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.cookie.Cookie; + +/** + * This interface defines the standard HTTP commands as methods, plus some specific methods mainly created for the AAR + * plug-in of the IAEngine, that are provided by the HTTPService. + * + * @see org.opentosca.iaengine.plugins.aaraxis.service.impl + */ +public interface IHTTPService { + + public HttpResponse Get(String uri, List cookies) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP GET command. + * + * @param uri - Resource URI + * @return Response Message + */ + public HttpResponse Get(String uri) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP GET command. + * + * @param uri - Resource URI + * @param headers - map of headers and values + * @return Response Message + */ + public HttpResponse Get(String uri, Map headers) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP GET command. + */ + public HttpResponse Get(String uri, String username, String password) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP HEAD command. + * + * @param uri - Resource URI + * @return Response Message + */ + public HttpResponse Head(String uri) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP POST command. + * + * @param uri - Resource URI + * @param httpEntity - Payload + * @return Response Message + */ + public HttpResponse Post(String uri, HttpEntity httpEntity) throws ClientProtocolException, IOException; + + public HttpResponse Post(String uri, HttpEntity httpEntity, Header... header) throws ClientProtocolException, + IOException; + + public HttpResponse Post(String uri, HttpEntity httpEntity, List cookies) throws ClientProtocolException, + IOException; + + public List PostCookies(String uri, HttpEntity httpEntity) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP PUT command. + * + * @param uri - Resource URI + * @param httpEntity - Payload + * @return Response Message + */ + public HttpResponse Put(String uri, HttpEntity httpEntity) throws ClientProtocolException, IOException; + + /** + * + */ + public HttpResponse Put(String uri, HttpEntity httpEntity, String username, + String password) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP DELETE command. + * + * @param uri - Resource URI + * @return Response Message + */ + public HttpResponse Delete(String uri) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP TRACE command. + * + * @param uri - Resource URI + * @return Response Message + */ + public HttpResponse Trace(String uri) throws ClientProtocolException, IOException; + + /** + * Executes a HTTP OPTIONS command. + * + * @param uri - Resource URI + * @return Response Message + */ + public HttpResponse Options(String uri) throws ClientProtocolException, IOException; +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IInstanceDataService.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IInstanceDataService.java new file mode 100644 index 000000000..0f288250b --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IInstanceDataService.java @@ -0,0 +1,51 @@ +package org.opentosca.container.core.service; + +import java.net.URI; +import java.util.List; + +import javax.xml.namespace.QName; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.instance.NodeInstance; +import org.opentosca.container.core.model.instance.RelationInstance; +import org.opentosca.container.core.model.instance.ServiceInstance; + +/** + * Interface of the InstanceDataService. The interface specifies methods to manage instances of ServiceTemplates + * (=ServiceInstances) and NodeTemplates (NodeInstances) and properties of NodeInstances. + */ +public interface IInstanceDataService { + + /** + * Queries for all ServiceInstances identified by the given parameters. It then returns a List of the matching + * serviceInstances. + * + * @param serviceInstanceID : ID to identify the serviceInstance + * @return List containing all corresponding ServiceInstances + * @TODO: additional parameters in JDOC + */ + public List getServiceInstances(URI serviceInstanceID, String serviceTemplateName, + QName serviceTemplateID); + + /** + * returns all NodeInstances matching the given parameters the parameters are ANDed therefore a nodeInstance has to + * match all parameters to be returned + * + * @return all matching nodeInstances + */ + public List getNodeInstances(URI nodeInstanceID, String nodeTemplateID, String nodeTemplateName, + URI serviceInstanceID); + + /** + * returns all RelationInstances matching the given parameters the parameters are ANDed therefore a relationInstance + * has to match all parameters to be returned + * + * @param relationInstanceID the relationInstanceId + * @return all matching nodeInstances + */ + public List getRelationInstances(URI relationInstanceID, QName relationshipTemplateID, + String relationshipTemplateName, URI serviceInstanceID); + + public List getServiceInstancesWithDetails(CsarId csarId, String serviceTemplateId, + Integer serviceTemplateInstanceID); +} diff --git a/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IPlanInvocationEngine.java b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IPlanInvocationEngine.java new file mode 100644 index 000000000..f63531d1c --- /dev/null +++ b/org.opentosca.container.core/src/main/java/org/opentosca/container/core/service/IPlanInvocationEngine.java @@ -0,0 +1,25 @@ +package org.opentosca.container.core.service; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.tosca.extension.TPlanDTO; + +/** + * Interface of the PlanInvocationEngine. This service provides a the functionality of invoking PublicPlans, getting a + * list of CorrelationIDs of active PublicPlans and one specific PublicPlan. + */ +public interface IPlanInvocationEngine { + + String createCorrelationId(); + + /** + * Invoke a PublicPlan for a CSAR. If this PublicPlan is of Type OTHERMANAGEMENT or TERMINATION, the information + * about the CSARInstance is stored inside the PublicPlan. + */ + void invokePlan(CsarId csarID, QName serviceTemplateId, long serviceTemplateInstanceID, TPlanDTO plan, String correlationID); + + void invokePlan(CsarId csarId, TServiceTemplate serviceTemplate, long serviceTemplateInstanceId, TPlanDTO plan, String correlationId); +} diff --git a/org.opentosca.container.core.impl/META-INF/resources/TOSCA-v1.0.xsd b/org.opentosca.container.core/src/main/resources/TOSCA-v1.0.xsd similarity index 100% rename from org.opentosca.container.core.impl/META-INF/resources/TOSCA-v1.0.xsd rename to org.opentosca.container.core/src/main/resources/TOSCA-v1.0.xsd diff --git a/org.opentosca.container.core/src/main/resources/application.properties b/org.opentosca.container.core/src/main/resources/application.properties new file mode 100644 index 000000000..a1c160ee7 --- /dev/null +++ b/org.opentosca.container.core/src/main/resources/application.properties @@ -0,0 +1,42 @@ +# Container Configuration +# Your external IP adress, e.g. 129.69.214.56 +org.opentosca.container.hostname=localhost +org.opentosca.container.port=1337 + +# IA Engine Configuration (endpoint and credentials) +org.opentosca.container.engine.ia.hostname=localhost +org.opentosca.container.engine.ia.port=8090 +org.opentosca.container.engine.ia.plugin.tomcat.url=http://localhost:8090 +org.opentosca.container.engine.ia.plugin.tomcat.password=admin +org.opentosca.container.engine.ia.plugin.tomcat.username=admin + +# BPEL Plan Engine Configuration (endpoint and credentials) +org.opentosca.container.engine.plan.plugin.bpel.engine=ODE +org.opentosca.container.engine.plan.plugin.bpel.url=http://localhost:9763/ode +org.opentosca.container.engine.plan.plugin.bpel.password= +org.opentosca.container.engine.plan.plugin.bpel.username= +org.opentosca.container.engine.plan.plugin.bpel.services.url=http://localhost:9763/ode/processes + +# BPMN Plan Engine Configuration (endpoint and credentials) +org.opentosca.container.engine.plan.plugin.bpmn.engine=Camunda +org.opentosca.container.engine.plan.plugin.bpmn.url=http://localhost:8092/engine-rest +org.opentosca.container.engine.plan.plugin.bpmn.username=admin +org.opentosca.container.engine.plan.plugin.bpmn.password=admin + +# Container Mode Repository (winery) +org.opentosca.container.connector.winery.url=http://localhost:8091/winery + +# Local MQTT broker +org.opentosca.container.broker.mqtt.port=1883 +org.opentosca.container.broker.mqtt.username=admin +org.opentosca.container.broker.mqtt.password=admin + +# Distributed IA deployment +org.opentosca.container.collaboration.mode=false +org.opentosca.container.collaboration.hostnames= +org.opentosca.container.collaboration.ports= + +# Testing +org.opentosca.deployment.tests=false +org.opentosca.bus.management.mocking=false +org.opentosca.engine.ia.keepfiles=true diff --git a/org.opentosca.container.core/src/main/resources/spring/context-container-core.xml b/org.opentosca.container.core/src/main/resources/spring/context-container-core.xml new file mode 100644 index 000000000..ffba9c597 --- /dev/null +++ b/org.opentosca.container.core/src/main/resources/spring/context-container-core.xml @@ -0,0 +1,20 @@ + + + + Configuration for Spring-Bean service discovery across container.core + + + + + + + + + + diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/Activator.java b/org.opentosca.container.core/src/org/opentosca/container/core/Activator.java deleted file mode 100644 index 7b94293f5..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/Activator.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.core; - -import java.io.File; - -import org.opentosca.container.core.common.Settings; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - public static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - - - logger.info("org.opentosca.container.hostname={}", Settings.OPENTOSCA_CONTAINER_HOSTNAME); - logger.info("org.opentosca.container.port={}", Settings.OPENTOSCA_CONTAINER_PORT); - - // /////////////////// PATHS /////////////////// - - // contains data of OpenTOSCA that should be stored permanently - String openTOSCAPath = ""; - if (System.getProperty("openTOSCAPath") == null) { - openTOSCAPath = System.getProperty("java.io.tmpdir") + File.separator + "opentosca"; - } else { - openTOSCAPath = System.getProperty("openTOSCAPath") + File.separator + "opentosca"; - } - - // contains data of OpenTOSCA that should be stored temporarily - Settings.setSetting("temp", openTOSCAPath + File.separator + "Temp"); - - // Derby database location - Settings.setSetting("databaseLocation", openTOSCAPath + File.separator + "DB"); - - // relative path where CSARs will be stored locally; used by the - // Filesystem storage provider - Settings.setSetting("csarStorePath", openTOSCAPath + File.separator + "CSARs"); - - // /////////////////// URLS /////////////////// - - // URI of the ContainerAPI - Settings.setSetting("containerUri", Settings.CONTAINER_API_LEGACY); - - // URI of the DataInstanceAPI - Settings.setSetting("datainstanceUri", "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" - + Settings.OPENTOSCA_CONTAINER_PORT + "/datainstance"); - - // /////////////////// CSAR /////////////////// - - // extension of a CSAR file - Settings.setSetting("csarExtension", "csar"); - - // relative path of IMPORTS directory in a CSAR file - Settings.setSetting("csarImportsRelPath", "IMPORTS"); - - // relative path of Definitions directory in a CSAR file - Settings.setSetting("csarDefinitionsRelPath", "Definitions"); - - // relative path where the TOSCA meta file is located in a CSAR file - Settings.setSetting("toscaMetaFileRelPath", "TOSCA-Metadata" + File.separator + "TOSCA.meta"); - - // possible file extensions of a TOSCA file, separated by character ";" - Settings.setSetting("toscaFileExtensions", "xml;tosca;ste"); - - // /////////////////// OTHERS /////////////////// - - // Container Capabilities - Settings.setSetting("containerCapabilities", Settings.containerCapabilities); - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/NotFoundException.java b/org.opentosca.container.core/src/org/opentosca/container/core/common/NotFoundException.java deleted file mode 100644 index ac6a8d0b8..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/NotFoundException.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.opentosca.container.core.common; - -public class NotFoundException extends UserException { - - private static final long serialVersionUID = -115094386403129666L; - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/Settings.java b/org.opentosca.container.core/src/org/opentosca/container/core/common/Settings.java deleted file mode 100644 index 538251cc1..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/Settings.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.opentosca.container.core.common; - -import java.util.Properties; - -/** - * Global OpenTOSCA Settings. - */ -public class Settings { - - public final static String OPENTOSCA_CONTAINER_HOSTNAME = - System.getProperty("org.opentosca.container.hostname", "localhost"); - public final static String OPENTOSCA_CONTAINER_PORT = System.getProperty("org.opentosca.container.port", "1337"); - - public final static String CONTAINER_API_LEGACY = - "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_CONTAINER_PORT + "/containerapi"; - public final static String CONTAINER_API = - "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_CONTAINER_PORT; - public final static String CONTAINER_INSTANCEDATA_LEGACY_API = - "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" + Settings.OPENTOSCA_CONTAINER_PORT - + "/containerapi/CSARs/{csarid}/ServiceTemplates/{servicetemplateid}/Instances/"; - public final static String CONTAINER_INSTANCEDATA_API = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" - + Settings.OPENTOSCA_CONTAINER_PORT + "/csars/{csarid}/servicetemplates/{servicetemplateid}/instances"; - public final static String OPENTOSCA_CONTAINER_CONTENT_API = "http://" + Settings.OPENTOSCA_CONTAINER_HOSTNAME + ":" - + Settings.OPENTOSCA_CONTAINER_PORT + "/csars/{csarid}/content/{artifactreference}"; - - public final static String ENGINE_PLAN_BPMN_ENGINE = - System.getProperty("org.opentosca.container.engine.plan.plugin.bpmn.engine", "Camunda"); - public final static String ENGINE_PLAN_BPMN_URL = - System.getProperty("org.opentosca.container.engine.plan.plugin.bpmn.url", "http://localhost:8080/engine-rest"); - public final static String ENGINE_PLAN_BPMN_USERNAME = - System.getProperty("org.opentosca.container.engine.plan.plugin.bpmn.username", "admin"); - public final static String ENGINE_PLAN_BPMN_PASSWORD = - System.getProperty("org.opentosca.container.engine.plan.plugin.bpmn.password", "admin"); - - public final static String ENGINE_IA_TOMCAT_URL = - System.getProperty("org.opentosca.container.engine.ia.plugin.tomcat.url", "http://localhost:8090"); - public final static String ENGINE_IA_TOMCAT_USERNAME = - System.getProperty("org.opentosca.container.engine.ia.plugin.tomcat.username", "admin"); - public final static String ENGINE_IA_TOMCAT_PASSWORD = - System.getProperty("org.opentosca.container.engine.ia.plugin.tomcat.password", "admin"); - - public final static String PERSISTENCE_UNIT_NAME = "OpenTOSCA"; - - public final static String OPENTOSCA_DEPLOYMENT_TESTS = - System.getProperty("org.opentosca.deployment.tests", "false"); - - public final static String OPENTOSCA_BUS_MANAGEMENT_MOCK = - System.getProperty("org.opentosca.bus.management.mocking", "false"); - - public final static String OPENTOSCA_ENGINE_IA_KEEPFILES = - System.getProperty("org.opentosca.engine.ia.keepfiles", "false"); - - public final static String OPENTOSCA_COLLABORATION_MODE = - System.getProperty("org.opentosca.container.collaboration.mode", "false"); - public final static String OPENTOSCA_COLLABORATION_HOSTNAMES = - System.getProperty("org.opentosca.container.collaboration.hostnames"); - public final static String OPENTOSCA_COLLABORATION_PORTS = - System.getProperty("org.opentosca.container.collaboration.ports"); - - public final static String OPENTOSCA_BROKER_MQTT_PORT = - System.getProperty("org.opentosca.container.broker.mqtt.port", "1883"); - public final static String OPENTOSCA_BROKER_MQTT_USERNAME = - System.getProperty("org.opentosca.container.broker.mqtt.username", "admin"); - public final static String OPENTOSCA_BROKER_MQTT_PASSWORD = - System.getProperty("org.opentosca.container.broker.mqtt.password", "admin"); - - // TODO: Use public static final variables instead, as in - // StaticTOSCANamespaces. The problems with the current approach is: (i) - // Full-text search to find usage instead of Java Reference Search. (ii) It - // is possible to references non-existing settings, which is not possible - // with static variables which are checked on compile time. - - private static Properties settings = new Properties(); - - // Container Capabilities - public final static String containerCapabilities = - "http://opentosca/planportabilityapi/rest, http://opentosca/containerapi"; - - - /** - * @param setting - name of the setting - * @return the value of setting with name setting - */ - public static String getSetting(final String setting) { - return Settings.settings.getProperty(setting); - } - - /** - * Stores a setting. - * - * @param setting - name of the setting - * @param value - value of the setting - */ - public static void setSetting(final String setting, final String value) { - Settings.settings.setProperty(setting, value); - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/DocumentConverter.java b/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/DocumentConverter.java deleted file mode 100644 index 2d7a9d07f..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/DocumentConverter.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.opentosca.container.core.common.jpa; - -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.eclipse.persistence.mappings.DatabaseMapping; -import org.eclipse.persistence.mappings.converters.Converter; -import org.eclipse.persistence.sessions.Session; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -public class DocumentConverter implements Converter { - - private static final long serialVersionUID = -1227963218864722385L; - - - @Override - public Object convertDataValueToObjectValue(final Object documentString, final Session arg1) { - if (documentString != null) { - return getDocument((String) documentString); - } - return null; - } - - @Override - public Object convertObjectValueToDataValue(final Object doc, final Session arg1) { - if (doc != null && doc instanceof Document) { - return getString((Document) doc); - } - return null; - } - - @Override - public void initialize(final DatabaseMapping arg0, final Session arg1) { - // intentionally left blank - } - - @Override - public boolean isMutable() { - return false; - } - - /** - * Converts a given String to a XML document - * - * @param documentString - * @return Document - converted xml Document - */ - private static Document getDocument(final String documentString) { - if (documentString.isEmpty()) { - return emptyDocument(); - } - // start conversion - final InputSource iSource = new InputSource(new StringReader(documentString)); - Document doc = null; - try { - final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - dbf.setIgnoringComments(true); - final DocumentBuilder db = dbf.newDocumentBuilder(); - - // parse - doc = db.parse(iSource); - doc.getDocumentElement().normalize(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final IOException e) { - e.printStackTrace(); - } - return doc; - } - - /** - * returns an empty document - * - * @return empty document - */ - public static Document emptyDocument() { - final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - - try { - final DocumentBuilder db = dbf.newDocumentBuilder(); - final Document doc = db.newDocument(); - return doc; - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - return null; - } - - /** - * Converts a given node to a String - * - * @param node - * @return String - String representation of the given Node - */ - private static String getString(final Node node) { - String result = null; - if (node != null) { - try { - // prepare - final Source source = new DOMSource(node); - final StringWriter stringWriter = new StringWriter(); - final Result streamResult = new StreamResult(stringWriter); - final TransformerFactory factory = TransformerFactory.newInstance(); - final Transformer transformer = factory.newTransformer(); - // serialize - transformer.transform(source, streamResult); - result = stringWriter.getBuffer().toString(); - } - catch (final TransformerConfigurationException e) { - e.printStackTrace(); - } - catch (final TransformerFactoryConfigurationError e) { - e.printStackTrace(); - } - catch (final TransformerException e) { - e.printStackTrace(); - } - } - return result; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/PathConverter.java b/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/PathConverter.java deleted file mode 100644 index 59a066971..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/PathConverter.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.opentosca.container.core.common.jpa; - -import java.nio.file.Path; -import java.nio.file.Paths; - -import org.eclipse.persistence.mappings.DatabaseMapping; -import org.eclipse.persistence.mappings.converters.Converter; -import org.eclipse.persistence.sessions.Session; - -/** - * This class is used to convert {@link Path} to String, and {@link String} back to {@link Path} - * when persisting {@link Path} fields with JPA. The conversion needs to be done, as we cannot - * directly query for {@link Path} in JPQL. - */ -public class PathConverter implements Converter { - - private static final long serialVersionUID = 3747978557147488965L; - - - @Override - public Object convertDataValueToObjectValue(final Object arg0, final Session arg1) { - return arg0 != null ? Paths.get((String) arg0) : null; - } - - @Override - public Object convertObjectValueToDataValue(final Object arg0, final Session arg1) { - return arg0 != null ? ((Path) arg0).toString() : null; - } - - @Override - public void initialize(final DatabaseMapping arg0, final Session arg1) {} - - @Override - public boolean isMutable() { - return false; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/QNameConverter.java b/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/QNameConverter.java deleted file mode 100644 index a2134b075..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/QNameConverter.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.opentosca.container.core.common.jpa; - -import javax.xml.namespace.QName; - -import org.eclipse.persistence.mappings.DatabaseMapping; -import org.eclipse.persistence.sessions.Session; - -/** - * This class is used to convert QNames to String, and Strings back to QNames when persisting QName - * fields with JPA. The conversion needs to be done, as we cannot directly query for QNames in JPQL. - */ -public class QNameConverter implements org.eclipse.persistence.mappings.converters.Converter { - - private static final long serialVersionUID = 5695923859083900495L; - - - @Override - public Object convertDataValueToObjectValue(final Object arg0, final Session arg1) { - return arg0 != null ? QName.valueOf((String) arg0) : null; - } - - @Override - public Object convertObjectValueToDataValue(final Object arg0, final Session arg1) { - return arg0 != null ? ((QName) arg0).toString() : null; - } - - @Override - public void initialize(final DatabaseMapping arg0, final Session arg1) {} - - @Override - public boolean isMutable() { - return false; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/UriConverter.java b/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/UriConverter.java deleted file mode 100644 index 2631ecdf6..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/common/jpa/UriConverter.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.opentosca.container.core.common.jpa; - -import java.net.URI; -import java.net.URISyntaxException; - -import org.eclipse.persistence.mappings.DatabaseMapping; -import org.eclipse.persistence.mappings.converters.Converter; -import org.eclipse.persistence.sessions.Session; - -/** - * This class is used to convert URIs to String, and Strings back to URIs when persisting URI fields - * with JPA. The conversion needs to be done, as we cannot directly query for URI in JPQL. - */ -public class UriConverter implements Converter { - - private static final long serialVersionUID = 5695923859083900495L; - - - @Override - public Object convertDataValueToObjectValue(final Object arg0, final Session arg1) { - try { - return arg0 != null ? new URI((String) arg0) : null; - } - catch (final URISyntaxException e) { - return null; - } - } - - @Override - public Object convertObjectValueToDataValue(final Object arg0, final Session arg1) { - return arg0 != null ? ((URI) arg0).toString() : null; - } - - @Override - public void initialize(final DatabaseMapping arg0, final Session arg1) {} - - @Override - public boolean isMutable() { - return false; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/IToscaEngineService.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/IToscaEngineService.java deleted file mode 100644 index af13f849d..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/IToscaEngineService.java +++ /dev/null @@ -1,699 +0,0 @@ -package org.opentosca.container.core.engine; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.AbstractArtifact; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions; -import org.opentosca.container.core.tosca.model.TPropertyConstraint; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -/** - * This interface describes functionality of resolving the references inside of ServiceTemplates in - * a passed CSAR. This is needed to provide the data via the ToscaReferenceMapper with which - * components resolve references inside of TOSCA files and get the required objects. - * - * Another provided functionality is to consolidate data of NodeTemplate and NodeType objects. This - * is done for better access to the required informations of one or multiple TOSCA documents. The - * implementation is at org.opentosca.model.tosca.util. - * - * Last functionality is to provide the tool ToscaReferenceMapper. This object provides access to - * referenced informations. - * - * It is used by
    - * org.opentosca.containerapi which needs the consolidated data and tools.
    - * org.opentosca.iaengine.service needs the consolidated data.
    - * org.opentosca.opentoscacontrol.service.impl which implements the control for the OpenTosca - * Container. - */ -public interface IToscaEngineService { - - /** - * This method returns the ToscaReferenceMapper. - * - * @return the ToscaReferenceMapper - */ - public IToscaReferenceMapper getToscaReferenceMapper(); - - /** - * This method resolves the ServiceTemplates of the passed CSAR and stores the contained references - * and their counterpart inside the ToscaImportMapper. - * - * @param csarID CSAR ID in which the ServiceTemplate is stored. - * @return true for success, false for one or more errors - */ - public boolean resolveDefinitions(CSARID csarID); - - /** - * Returns all Node Types (including the given) inside the type hierarchy of the given Node Type - * - * @param csarID the CSAR to look in - * @param nodeType the QName of a Node Type - * @return a List of QNames denoting all Node Types inside the type hierarchy of the given Node Type - */ - public List getNodeTypeHierarchy(CSARID csarID, QName nodeType); - - /** - * This method searches inside of certain ServiceTemplate of a CSAR for referenced NodeTypes. It - * returns a list of QNames which point to NodeTypes referenced by NodeTemplates via derivation or - * target by RelationshipTemplates via NodeTemplates. - * - * @param csarID of the CSAR containing the ServiceTemplate. - * @param serviceTemplateID of the ServiceTemplate. - * @return List of QNames which point to NodeTypes or a empty list if no NodeType is referenced. - */ - public List getReferencedNodeTypesOfAServiceTemplate(CSARID csarID, QName serviceTemplateID); - - /** - * This method checks if input parameter are specified for a given interface and operation of a - * NodeType or RelationshipType. - * - * @param csarID of the CSAR containing the NodeType or RelationshipType. - * @param typeID of the NodeType or RelationshipType to check. - * @param interfaceName of the NodeType or RelationshipType to check. - * @param operationName of the NodeType or RelationshipType check. - * @return true if input parameter are specified. Otherwise false. - */ - boolean hasOperationOfATypeSpecifiedInputParams(CSARID csarID, QName typeID, String interfaceName, - String operationName); - - /** - * This method checks if output parameter are specified for a given interface and operation of a - * NodeType or RelationshipType. - * - * @param csarID of the CSAR containing the NodeType or RelationshipType. - * @param typeID of the NodeType or RelationshipType to check. - * @param interfaceName of the NodeType or RelationshipType to check. - * @param operationName of the NodeType or RelationshipType to check. - * @return true if output parameter are specified. Otherwise false. - */ - boolean hasOperationOfATypeSpecifiedOutputParams(CSARID csarID, QName typeID, String interfaceName, - String operationName); - - /** - * Checks if specified operations is bound to sourceNode. - * - * @param csarID of the CSAR containing the NodeType. - * @param relationshipTypeID of the RelationshipType to check. - * @param interfaceName of the RelationshipType to check. - * @param operationName of the RelationshipType to check. - * @return true if operation is bound to sourceNode. Otherwise false. - */ - boolean isOperationOfRelationshipBoundToSourceNode(CSARID csarID, QName relationshipTypeID, String interfaceName, - String operationName); - - /** - * This method checks if the specified interface of a NodeType or RelationshipType contains the - * specified operation. - * - * @param csarID of the CSAR containing the NodeType or RelationshiptType. - * @param typeID of the NodeType or RelationshiptType to check. - * @param interfaceName of the NodeType or RelationshiptType to check. - * @param operationName of the NodeType or RelationshiptType to check. - * @return true if interface contains the operation. Otherwise false. - */ - boolean doesInterfaceOfTypeContainOperation(CSARID csarID, QName typeID, String interfaceName, - String operationName); - - /** - * This method searches all NodeTypeImplementations/RelationshipTypeImplementations for a certain - * NodeType/RelationshipType inside of a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementations or - * RelationshipTypeImplementations. - * @param typeID of the NodeType or RelationshipType. - * @return List of QNames pointing to the NodeTypeImplementations/RelationshipTypeImplementations or - * empty list if nothing is found. - */ - public List getTypeImplementationsOfType(CSARID csarID, QName typeID); - - /** - * This method returns a list of the names of ImplementationArtifacts of a given - * NodeTypeImplementation or RelationshipTypeImplementation in a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the ImplementationArtifact names. - * @return List of String containing the names of the ImplementationArtifacts or empty list if there - * none. - */ - public List getImplementationArtifactNamesOfTypeImplementation(CSARID csarID, QName typeImplementationID); - - /** - * This method returns a list of Strings of the RequiredContainerFeatures of a given - * NodeTypeImplementation or RelationshipTypeImplementation a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the RequiredContainerFeatures. - * @return List of String containing the URIs of the RequiredContainerFeatures or empty list if - * there none. - */ - public List getRequiredContainerFeaturesOfATypeImplementation(CSARID csarID, QName typeImplementationID); - - /** - * This method returns the ArtifactType of a given ImplementationArtifact of a given - * NodeTypeImplementation or RelationshipTypeImplementation in a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the ImplementationArtifact. - * @param implementationArtifactName of the ImplementationArtifact - * @return QName of the ArtifactType or null in case of an error - */ - public QName getArtifactTypeOfAImplementationArtifactOfATypeImplementation(CSARID csarID, - QName typeImplementationID, - String implementationArtifactName); - - /** - * This method returns the ArtifactTemplate of a given ImplementationArtifact of a given - * NodeTypeImplementation or RelationshipTypeImplementation in a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the ImplementationArtifact. - * @param implementationArtifactName of the ImplementationArtifact - * @return QName of the ArtifactTemplate or null in case of an error - */ - public QName getArtifactTemplateOfAImplementationArtifactOfATypeImplementation(CSARID csarID, - QName typeImplementationID, - String implementationArtifactName); - - /** - * This method returns the Node of the specified reference within the specified csarID. - * - * @param csarID of the CSAR. - * @param reference of which the XML should be returned. - * @return Node of the reference. - */ - public Node getReferenceAsNode(CSARID csarID, QName reference); - - /** - * This method returns a node containing the InputParameter of Elements of the specified operation - * of the specified interface of the specified NodeType or RelationshipType within the specified - * csarID. - * - * @param csarID of the CSAR. - * @param typeID of the NodeType or RelationshipType containing the operation. - * @param interfaceName of the operation. - * @param operationName of which the parameters should be returned. - * @return Node containing the InputParameters. - */ - public Node getInputParametersOfATypeOperation(CSARID csarID, QName typeID, String interfaceName, - String operationName); - - /** - * This method returns a List of Strings containing the InputParameter of Elements of the specified - * operation of the specified interface of the specified NodeType or RelationshipType within the - * specified csarID. - * - * @param csarID of the CSAR. - * @param typeID of the NodeType or RelationshipType containing the operation. - * @param interfaceName of the operation. - * @param operationName of which the parameters should be returned. - * @return A List of String containing the InputParameters. - */ - public List getInputParametersOfTypeOperation(CSARID csarID, QName typeId, String interfaceName, - String operationName); - - /** - * This method returns a List of Strings containing the InputParameter of Elements of the specified - * operation of the specified interface of the specified NodeType or RelationshipType within the - * specified csarID. - * - * @param csarID of the CSAR. - * @param typeID of the NodeType or RelationshipType containing the operation. - * @param interfaceName of the operation. - * @param operationName of which the parameters should be returned. - * @return A List of String containing the OutputParameters. - */ - public List getOutputParametersOfTypeOperation(CSARID csarID, QName typeId, String interfaceName, - String operationName); - - /** - * This method returns a node containing the OutputParameter of Elements of the specified operation - * of the specified interface of the specified NodeType or RelationshipType within the specified - * csarID. - * - * @param csarID of the CSAR. - * @param typeID of the NodeType or RelationshipType containing the operation. - * @param interfaceName of the operation. - * @param operation name of which the parameters should be returned. - * @return Node containing the OutputParameters. - */ - public Node getOutputParametersOfATypeOperation(CSARID csarID, QName typeID, String interfaceName, - String operationName); - - /** - * This method returns the specific content of a given ImplementationArtifact of a given - * NodeTypeImplementation or RelationshipTypeImplementation in a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the ImplementationArtifact. - * @param implementationArtifactName of the ImplementationArtifact - * @return Document which represents the specific content or null in case of an error. - * A new document object is created for each method call. - */ - public Document getArtifactSpecificContentOfAImplementationArtifact(CSARID csarID, QName typeImplementationID, - String implementationArtifactName); - - /** - * This method returns the implemented interface of a given ImplementationArtifact of a given - * NodeTypeImplementation or RelationshipTypeImplementation in a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the ImplementationArtifact. - * @param implementationArtifactName of the ImplementationArtifact - * @return String which represents the implemented interface or null in case of an - * error or no interface is specified. - */ - public String getInterfaceOfAImplementationArtifactOfATypeImplementation(CSARID csarID, QName typeImplementationID, - String implementationArtifactName); - - /** - * This method returns the implemented operation of a given ImplementationArtifact of a given - * NodeTypeImplementation or RelationshipTypeImplementation in a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the ImplementationArtifact. - * @param implementationArtifactName of the ImplementationArtifact - * @return String which represents the implemented operation or null in case of an - * error or no operation is specified. - */ - public String getOperationOfAImplementationArtifactOfATypeImplementation(CSARID csarID, QName typeImplementationID, - String implementationArtifactName); - - /** - * This method returns the ArtiactSpecificContent of a deploymentArtifact of a given - * NodeTypeImplementation or NodeTemplate in a given CSAR. - * - * @param csarID of the CSAR containing the ArtifactTemplate. - * @param reference the QName reference to a NodeTemplate or NodeTypeImplementation. - * @param deploymentArtifactName the Name of the deploymentArtifact - * @return Document of the ArtifactSpecificContent. A new document object is created for each method - * call. - */ - public Document getArtifactSpecificContentOfADeploymentArtifact(CSARID csarID, QName nodeTypeImplementationID, - String deploymentArtifactName); - - /** - * This method returns the content of the Properties Element of an ArtifactTemplate. - * - * @param csarID of the CSAR containing the ArtifactTemplate. - * @param artifactTemplateID of the requested ArtifactTemplate. - * @return Document which represents the Properties content or null in case of an error. - */ - public Document getPropertiesOfAArtifactTemplate(CSARID csarID, QName artifactTemplateID); - - /** - * This method returns the List of PropertyConstraints of a ArtifactTemplate. - * - * @param csarID of the CSAR containing the ArtifactTemplate. - * @param artifactTemplateID of the requested ArtifactTemplate. - * @return Document which represents the PropertyConstraints or an empty list. - */ - public List getPropertyConstraintsOfAArtifactTemplate(CSARID csarID, QName artifactTemplateID); - - /** - * This method returns a list of artifacts of a given ArtifactTemplate. - * - * @param csarID of the CSAR containing the ArtifactTemplate. - * @param artifactTemplateID of the requested ArtifactTemplate. - * @return List of artifacts or empty list if there are no artifact references or all artifact - * references are invalid / not supported. - */ - public List getArtifactsOfAArtifactTemplate(CSARID csarID, QName artifactTemplateID); - - /** - * This method returns the QName of the NodeType which is the type of the NodeTemplate defined by - * the parameters. - * - * @param csarID of the CSAR containing the ArtifactTemplate. - * @param serviceTemplateID of the ServiceTemplate containing the NodeTemplate. - * @param nodeTemplateID the String value of the attribute ID of the NodeTemplate. - * @return of the NodeType or null in case of an error - */ - public QName getNodeTypeOfNodeTemplate(CSARID csarID, QName serviceTemplateID, String nodeTemplateID); - - - /** - * This method returns the QName of the NodeType which is the type of the NodeTemplate defined by - * the parameters. - * - * @param csarID of the CSAR containing the ArtifactTemplate. - * @param serviceTemplateID of the ServiceTemplate containing the NodeTemplate. - * @param relationshipTemplateID the String value of the attribute ID of the RelationshipTemplate. - * @return of the NodeType or null in case of an error - */ - public QName getRelationshipTypeOfRelationshipTemplate(CSARID csarID, QName serviceTemplateID, - String relationshipTemplateID); - - /** - * This method returns the Document which contains the default Properties of the NodeTemplate - * defined by the parameter - * - * @param csarID of the CSAR containing the NodeTemplate or RelationshipTemplate. - * @param serviceTemplateID of the ServiceTemplate containing the NodeTemplate or - * RelationshipTemplate. - * @param templateID the String value of the attribute ID of the NodeTemplate or - * RelationshipTemplate. - * @return Document containing the Properties (may be empty) or null in case of an - * error - */ - public Document getPropertiesOfTemplate(CSARID csarID, QName serviceTemplateID, String templateID); - - /** - * This method returns a Document which contains the PropertiesDefinition of the NodeType defined by - * the parameter - * - * @return Document containing the PropertiesDefinition (may be empty) or null in case of an error - */ - public Document getPropertiesDefinitionOfNodeType(CSARID csarID, QName nodeTypeID); - - /** - * Returns the the resolved artifacts. - * - * @param csarID of the CSAR containing the NodeTemplate. - * @param nodeTemplateID QName of the nodeTemplate (ID) - * @return Resolved Artifacts containing all resolvedArtifacts - */ - public ResolvedArtifacts getResolvedArtifactsOfNodeTemplate(CSARID csarID, QName nodeTemplateID); - - /** - * Returns the the resolved artifacts. - * - * @param csarID of the CSAR containing the NodeTypeImplementation. - * @param nodeTypeImplementationID QName of the nodeTypeImplementation (ID) - * @return Resolved Artifacts containing all resolvedArtifacts - */ - public ResolvedArtifacts getResolvedArtifactsOfNodeTypeImplementation(CSARID csarID, - QName nodeTypeImplementationID); - - /** - * Returns the the resolved artifacts. - * - * @param csarID of the CSAR containing the NodeTypeImplementation. - * @param relationshipTypeImplementationID QName of the relationshipTypeImplementation (ID) - * @return Resolved Artifacts containing all resolvedArtifacts - */ - public ResolvedArtifacts getResolvedArtifactsOfRelationshipTypeImplementation(CSARID csarID, - QName relationshipTypeImplementationID); - - /** - * This function deletes the content about a certain CSAR, identified due the CSARID given as a - * parameter. - * - * @param csarID the ID of a CSAR which stored informations shall be deleted. - * @return true for success, false for one or more errors - */ - public boolean clearCSARContent(CSARID csarID); - - /** - * This function tries to invoke the getName() method of the jaxb-class belonging to - * the reference - * - * @param csarID of the CSAR containing the reference - * @param reference the qualifiedName of the reference of which the name attribute should be - * retrieved - * @return the return value of the call to getName-Method() of the jaxb-class
    - * - * null - if any error occured (f.ex. no jaxb-implementation was found or the - * reference didnt exist) - */ - public String getNameOfReference(CSARID csarID, QName reference); - - /** - * This function retrieves the min and maxInstances of the nodeTemplates in the specified - * serviceTemplate - * - * @param csarID of the CSAR containing the nodeTemplate - * @param serviceTemplateID of the serviceTemplate - * @return minInstances and maxInstances values of the nodeTemplates in the specified - * serviceTemplate - */ - public NodeTemplateInstanceCounts getInstanceCountsOfNodeTemplatesByServiceTemplateID(CSARID csarID, - QName serviceTemplateID); - - /** - * checks if a nodeTemplate exits. - * - * @param csarID csarID of the CSAR containing the reference - * @param serviceTemplateID of the ServiceTemplate containing the NodeTemplate. - * @param nodeTemplateID the String value of the attribute ID (=local part) of the NodeTemplate. - * (Namespace is internally retrieved from serviceTemplateID) - * @return true if the nodeTemplate exists, false otherwise - */ - boolean doesNodeTemplateExist(CSARID csarID, QName serviceTemplateID, String nodeTemplateID); - - /** - * checks if a relationshipTemplate exists. - * - * @param csarId csarID of the CSAR containing the reference - * @param serviceTemplateID serviceTempalteId to look for the Relationship Template - * @param relationshipTemplateID the Id of the Relationship Template to look for - * @return true if the Relationship Template exists withing the Service Template of the referenced - * CSAR - */ - boolean doesRelationshipTemplateExist(CSARID csarId, QName serviceTemplateID, String relationshipTemplateID); - - /** - * Returns the ID of the target NodeTemplate if one exists. - * - * @param csarID - * @param serviceTemplateID - * @param relationshipTemplateID - * @return the String or null in case of error or none existence - */ - public String getTargetNodeTemplateIDOfRelationshipTemplate(CSARID csarID, QName serviceTemplateID, - String relationshipTemplateID); - - /** - * Returns the ID of the source NodeTemplate if one exists. - * - * @param csarID - * @param serviceTemplateID - * @param relationshipTemplateID - * @return the String or null in case of error or none existence - */ - public String getSourceNodeTemplateIDOfRelationshipTemplate(CSARID csarID, QName serviceTemplateID, - String relationshipTemplateID); - - /** - * Returns the ID of the related NodeTemplate if one exists. - * - * @param csarID - * @param serviceTemplateID - * @param nodeTemplateID - * @param relationshipTypeName - * @return the String or null in case of error or none existence - */ - public String getRelatedNodeTemplateID(CSARID csarID, QName serviceTemplateID, String nodeTemplateID, - QName relationshipType); - - /** - * Returns the ID of the related NodeTemplate if one exists. - * - * @param csarID - * @param serviceTemplateID - * @param nodeTemplateID - * @param relationshipTypeName - * @return a List of Strings - */ - public List getRelatedNodeTemplateIDs(CSARID csarID, QName serviceTemplateID, String nodeTemplateID, - QName relationshipType); - - /** - * This method returns the abstract artifact of a plan reference. - * - * @param csar CSAR in which the plan is - * @param planId reference to the TOSCA Plan element - * @return the abstract artifact or null in case of an error - */ - public AbstractArtifact getPlanModelReferenceAbstractArtifact(CSARContent csar, QName planId); - - /** - * Returns the name of a Plan element. - * - * @param csarID the ID of the CSAR - * @param planId the ID of the Plan element - * @return the String of the name attribute inside the Plan element - */ - public String getPlanName(CSARID csarID, QName planId); - - /** - * Returns the defined references of an ArtifacTemplate. - * - * @param csarID - * @param artifactTemplate - * - * @return list of references or empty list if ArtifacTemplate can not be found or has no specified - * references - */ - public List getArtifactReferenceWithinArtifactTemplate(CSARID csarID, QName artifactTemplate); - - /** - * - * Returns the Type of the specified ArtifactTemplate. - * - * @param csarID - * @param artifactTemplate - * @return the Type of the specified ArtifactTemplate or null if ArtifacTemplate can not be found - */ - public QName getArtifactTypeOfArtifactTemplate(CSARID csarID, QName artifactTemplate); - - /** - * This method returns a list of the names of DeploymentArtifacts of a given NodeTypeImplementation - * in a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation. - * @param nodeTypeImplementationID of the NodeTypeImplementation containing the - * ImplementationArtifact names. - * @return List of String containing the names of the DeploymentArtifacts or empty list if there - * none. - */ - public List getDeploymentArtifactNamesOfNodeTypeImplementation(CSARID csarID, - QName nodeTypeImplementationID); - - /** - * This method returns the ArtifactTemplate of a given DeploymentArtifact of a given - * NodeTypeImplementation in a given CSAR. - * - * @param csarID of the CSAR containing the NodeTypeImplementation. - * @param nodeTypeImplementationID of the NodeTypeImplementation containing the DeploymentArtifact. - * @param deploymentArtifactName of the DeploymentArtifact - * @return QName of the ArtifactType or null in case of an error - */ - public QName getArtifactTemplateOfADeploymentArtifactOfANodeTypeImplementation(CSARID csarID, - QName nodeTypeImplementationID, - String deploymentArtifactName); - - /** - * This method returns the IDs of the derived Node Type Implementation hierarchy given through the - * DerivedFrom property. - * - * @param nodeTypeImplementationId a QName of a Node Type Implementation - * @return a List of QName with at least the Node Type Implementation Id given as input - */ - public List getNodeTypeImplementationTypeHierarchy(CSARID csarID, QName nodeTypeImplementationId); - - /** - * Returns the QNames of the ServiceTemplates in a CSAR. - * - * @param csarID - * @return List of Service Template QNames - */ - public List getServiceTemplatesInCSAR(CSARID csarID); - - /** - * Returns the List of Node Template IDs in a Service Template. - * - * @param csarID the Id of the CSAR to look for the Service Template - * @param serviceTemplate the ID of the target Service Template - * @return List of Node Template IDs - */ - public List getNodeTemplatesOfServiceTemplate(CSARID csarID, QName serviceTemplate); - - /** - * Returns the List of Relationship Template IDs in a Service Template. - * - * @param csarID - * @param serviceTemplate - * @return List of Relationship Template IDs - */ - public List getRelationshipTemplatesOfServiceTemplate(CSARID csarId, QName serviceTemplate); - - /** - * Returns the BoundaryDefinitions of the referenced ServiceTemplate - * - * @param csarId the CSAR the ServiceTemplate belongs to - * @param serviceTemplateId a QName denoting a ServiceTemplate - * @return a BoundaryDefinitions - */ - public TBoundaryDefinitions getBoundaryDefinitionsOfServiceTemplate(CSARID csarId, QName serviceTemplateId); - - /** - * Returns the id's of capabilities defined within the referenced nodeTemplateId - * - * @param csarId the id of the CSAR to look in - * @param serviceTemplateId the id of the Service Template inside the CSAR - * @param nodeTemplateId the id of the Node Template to get its capabilities - * @return a List of QNames denoting Capabilities of the given Node Template - */ - public List getNodeTemplateCapabilities(CSARID csarId, QName serviceTemplateId, String nodeTemplateId); - - /** - * Returns the id's of requirements defined within the referenced nodeTemplateId - * - * @param csarId the id of the CSAR to look in - * @param serviceTemplateId the id of the Service Template inside the CSAR - * @param nodeTemplateId the id of the Node Template to get its requirements - * @return a List of QNames denoting Requirements of the given Node Template - */ - public List getNodeTemplateRequirements(CSARID csarId, QName serviceTemplateId, String nodeTemplateId); - - /** - * Returns the id of the referenced target Relationship Template - * - * @param csarId the id of the CSAR to look in - * @param serviceTemplateId the id of the Service Template inside the CSAR - * @param relationshipTemplateId the id of the Relationship Template to get its capabilities - * @return a QName denoting the entity on the target of the given Relationship Template - */ - public QName getRelationshipTemplateTarget(CSARID csarId, QName serviceTemplateId, String relationshipTemplateId); - - /** - * Returns the id of the referenced source of this Relationship l3Template - * - * @param csarId the id of the CSAR to look in - * @param serviceTemplateId the id of the Service Template inside the CSAR - * @param relationshipTemplateId the id of the Relationship Template to get its requirements - * @return a QName denoting the entity on the source of the given Relationship Template - */ - public QName getRelationshipTemplateSource(CSARID csarId, QName serviceTemplateId, String relationshipTemplateId); - - /** - * Returns a list of operation names of the referenced Node Type's interface - * - * @param csarId the CSAR to look in - * @param nodeTypeId the id of the Node Type to look in - * @param interfaceName the name of the interface to look in - * @return a List of Strings representing the operation names of the referenced Node Type interface - */ - public List getOperationNamesOfNodeTypeInterface(CSARID csarId, QName nodeTypeId, String interfaceName); - - /** - * Returns a list of interface names of the referenced Node Type - * - * @param csarId the CSAR to look in - * @param nodeTypeId the id of the Node Type to look in - * @return a List of String representing the interface names of the referenced Node Type - */ - public List getInterfaceNamesOfNodeType(CSARID csarId, QName nodeTypeId); - - /** - * Get the IDs of all transitively connected NodeTemplates - * - * @param csarID the CSAR to look in - * @param serviceTemplateID the id of the Service Template inside the CSAR - * @param nodeTemplateID the id of the NodeTemplate - * @param relationshipType the RelationshipType to use for the search - * @return a List of IDs of all NodeTemplates that are transitively connected by - * RelationshipTemplates of the given type - */ - public List getTransitiveNodeTemplateIDs(CSARID csarID, QName serviceTemplateID, String nodeTemplateID, - QName relationshipType); -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/IToscaReferenceMapper.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/IToscaReferenceMapper.java deleted file mode 100644 index f95871763..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/IToscaReferenceMapper.java +++ /dev/null @@ -1,337 +0,0 @@ -package org.opentosca.container.core.engine; - -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Policies; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Properties.PropertyMappings; -import org.opentosca.container.core.tosca.model.TDefinitions; -import org.opentosca.container.core.tosca.model.TExportedInterface; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPropertyMapping; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -/** - * This interface provides the functionality of access to resolved data. This data is dependent to a - * certain CSAR. Each data set is referenced by the QName of the CSAR nesting the data and the QName - * with which it is referenced inside of a TOSCA file. - */ -public interface IToscaReferenceMapper { - - /** - * This method stores a DOM document and its QName for a certain CSAR. - * - * @param csarID ID of the CSAR in which the document is referenced. - * @param documentID ID of the document. - * @param doc DOM document which shall be stored. - * @return true means no error, false means one or more errors - */ - public abstract void storeDocument(CSARID csarID, QName documentID, Document doc); - - /** - * This method stores a DOM node and its QName for a certain CSAR. - * - * @param csarID ID of the CSAR in which the document is referenced. - * @param nodeID ID of the node. - * @param node DOM node which shall be stored. - * @return true means no error, false means one or more errors - */ - public abstract void storeReference(CSARID csarID, QName nodeID, Node node); - - /** - * This method stores a ServiceTemplateID for a specific CSAR. - * - * @param serviceTemplateID the QName of the ID of a ServiceTemplate. - * @param csarID the CSARID of a specific CSAR. - */ - public void storeServiceTemplateIDForCSARID(QName serviceTemplateID, CSARID csarID); - - /** - * This method returns the stored list of IDs of ServiceTemplates contained in a specific CSAR. - * - * @param csarID the CSARID of the specific CSAR. - * @return a list of the IDs of ServiceTemplates which are contained in a specific CSAR. - */ - public List getServiceTemplateIDsContainedInCSAR(CSARID csarID); - - /** - * This method returns a list of Definitions contained in a specific CSAR. - * - * @param csarID the CSARID of the specific CSAR. - * @return a list of the Definitions which are contained in a specific CSAR. - */ - public List getDefinitionsOfCSAR(CSARID csarID); - - /** - * This method returns a list of IDs of Definitions contained in a specific CSAR. - * - * @param csarID the CSARID of the specific CSAR. - * @return a list of the IDs of Definitions which are contained in a specific CSAR. - */ - public List getDefinitionIDsOfCSAR(CSARID csarID); - - /** - * Returns the requested Document. The Document is identified via the QName of a CSAR and the QName - * of an element inside of it. If the object is found, it is returned as DOM Document. This method - * is used if you want to get the whole document in which a certain element is nested. - * - * @param csarID of the CSAR in which the demanded document shall be. - * @param reference to the demanded document. - * @return The DOM Document if it is found. Null if it is not found. - */ - public abstract Document getDOMDocumentForReference(CSARID csarID, QName reference); - - /** - * Returns the requested Node object. The object is identified via the QName of a CSAR and its own - * QName. If the object is found, it is returned as a DOM Node object. - * - * @param csarID ID of the CSAR in which the node is referenced. - * @param nodeID ID of the node. - * @return DOM Node object or null in case of failure - */ - public abstract Object getReferenceAsNode(CSARID csarID, QName nodeID); - - /** - * Returns the requested JAXB object. The object is identified via the QName of a CSAR and its own - * QName. If the object is found, it is serialized and returned as a JAXB object of the TOSCA model. - * - * @param csarID ID of the CSAR in which the node is referenced. - * @param nodeID ID of the node. - * @return JAXB object of the type according to org.opentosca.model.tosca or null in case of failure - */ - public abstract Object getJAXBReference(CSARID csarID, QName nodeID); - - /** - * Checks if the ToscaReferenceMapper has stored data about a certain CSAR. - * - * @param csarID to identify the certain CSAR. - * @return true if there is data stored, false if not - */ - public abstract boolean containsCSARData(CSARID csarID); - - /** - * Checks if the ToscaReferenceMapper has stored a specific reference for a CSAR. - * - * @param csarID to identify the certain CSAR. - * @param reference the specific reference - * @return true if there is data stored, false if not - */ - public boolean containsReferenceInsideCSAR(CSARID csarID, QName reference); - - /** - * Stores a Definitions for a specific CSAR. - * - * @param csarID the ID of the CSAR. - * @param definitions the Definitions. - */ - public void storeDefinitions(CSARID csarID, TDefinitions definitions); - - /** - * Stores an exported interface for a CSAR. - * - * @param csarID the ID of the CSAR. - * @param serviceTemplateID the ID of the ServiceTemplate for which the interface is - * @param iface the exported interface. - */ - public void storeExportedInterface(CSARID csarID, QName serviceTemplateID, TExportedInterface iface); - - /** - * Returns the list of exported interfaces of a CSAR. - * - * @param csarID the ID of the CSAR. - * @return a list of the exported interfaces of the given CSAR. - */ - public Map> getExportedInterfacesOfCSAR(CSARID csarID); - - /** - * Returns the persistence which maps a CSARID to a ServiceTemplateID to a PlanID. - * - * @return the map. - */ - public Map>> getMapCsarIDToServiceTemplateIDToPlanID(); - - /** - * Returns a map of PlanTypes to a map of plan ids to plan for a certain CSAR. - * - * @param csarID - * @return map - */ - public Map> getCSARIDToPlans(CSARID csarID); - - /** - * This method stores whether the plan is synchronous or asynchronous. - * - * @param csarID The CSARID which owns the plan. - * @param planID The QName pointing to the plan. - * @param checkAsynchronous false for synchronous, true for asynchronous - */ - public void storePlanAsynchronousBoolean(CSARID csarID, QName planID, boolean checkAsynchronous); - - /** - * This method shows if a plan is synchronous or asynchronous. - * - * @param csarID The CSARID which owns the plan. - * @param planID The QName pointing to the plan. - * @return false for synchronous plan, true for asynchronous plan, null if no informations are - * stored - */ - public Boolean isPlanAsynchronous(CSARID csarID, QName planID); - - /** - * Returns a PublicPlan if found. - * - * @param csarID - * @param planID - * @return the PublicPlan if found, null instead. - */ - public TPlan getPlanForCSARIDAndPlanID(CSARID csarID, QName planID); - - /** - * Debug output. - */ - public void printStoredData(); - - /** - * Returns the requested Consolidated Policies. - * - * @param csarID The CSARID. - * @param templateID The QName pointing to the template. - * @return the Consolidated Policies or null of none are found. - */ - public Policies getPolicies(CSARID csarID, QName templateID); - - /** - * Puts the Consolidated Policies of a ServiceTemplate or NodeTemplate into the storage. - * - * @param csarID the CSARID - * @param templateID the QName of a ServiceTemplate or NodeTemplate - * @param policies the ConsolidatedPolicies object - */ - public void storeConsolidatedPolicies(CSARID csarID, QName templateID, Policies policies); - - /** - * Stores the location inside of a CSAR for a Definitions file. - * - * @param defID - * @param location - */ - public void storeDefinitionsLocation(CSARID csarID, QName defID, String location); - - /** - * Returns the location of a Definitions file for a given DefinitionsID. - * - * @param defID - * @return String location or null in case of error like not found - */ - public String getDefinitionsLocation(CSARID csarID, QName defID); - - /** - * Stores the the Definitions ID for an element inside a CSAR. - * - * @param csarID which CSAR is containing the stored Definitions ID - * @param elementID which element is inside the stored Definitions ID - * @param definitionsID the Definitions ID - */ - public void storeContainingDefinitionsID(CSARID csarID, QName elementID, QName definitionsID); - - /** - * Returns the Definitions ID for a Definitions containing a element with the given elementID inside - * a CSAR. - * - * @param csarID which CSAR is containing the stored Definitions ID - * @param elementID which element is inside the stored Definitions ID - * @return the Definitions ID or null in case of error like not found - */ - public QName getContainingDefinitionsID(CSARID csarID, QName elementID); - - /** - * Stores the message element id of a plan, parsed from a WSDL. - * - * @param csarID - * @param planID - */ - public void storePlanInputMessageID(CSARID csarID, QName planID, QName messageID); - - /** - * Returns the message element id of a plan, parsed from a WSDL. - * - * @param csarID - * @param planID - * @return - */ - public QName getPlanInputMessageID(CSARID csarID, QName planID); - - // public void storeOperationNameForPlan(CSARID csarID, QName - // serviceTemplateID, QName planID, String interfaceName, String - // operationName); - - public String getIntferaceNameOfPlan(CSARID csarID, QName planID); - - public String getIntferaceNameOfPlan(CSARID csarID, QName serviceTemplateID, QName planID); - - public String getOperationNameOfPlan(CSARID csarID, QName planID); - - public List getBoundaryInterfacesOfCSAR(CSARID csarID); - - public List getBoundaryInterfacesOfServiceTemplate(CSARID csarID, QName serviceTemplateID); - - public List getBoundaryOperationsOfCSARInterface(CSARID csarID, QName serviceTemplateID, String intName); - - public QName getBoundaryPlanOfCSARInterface(CSARID csarID, String intName, String opName); - - public String getNamespaceOfPlan(CSARID csarID, String planID); - - public void storeNamespaceOfPlan(CSARID csarID, String planID, String namespace); - - public void storeNodeTemplateIDForServiceTemplateAndCSAR(CSARID csarID, QName serviceTemplateID, String id); - - - public void storeRelationshipTemplateIDForServiceTemplateAndCSAR(CSARID csarID, QName serviceTemplateId, String id); - - public Map> getServiceTemplatesAndNodeTemplatesInCSAR(CSARID csarID); - - public Map> getServiceTemplatesAndRelationshipTemplatesInCSAR(CSARID csarID); - - public void storeServiceTemplateBoundsPropertiesInformation(CSARID csarID, QName serviceTemplateID, - String propertiesContent, - PropertyMappings propertyMappings); - - public String getServiceTemplateBoundsPropertiesContent(CSARID csarID, QName serviceTemplateID); - - public Object getServiceTemplateBoundsPropertiesXMLFragment(CSARID csarID, QName serviceTemplateID); - - public PropertyMappings getServiceTemplateBoundsPropertyMappings(CSARID csarID, QName serviceTemplateID); - - public List getServiceTemplateBoundsPropertiesContent(CSARID csarID); - - public List getServiceTemplateBoundsPropertyMappings(CSARID csarID); - - void storeServiceTemplateBoundsPlan(CSARID csarID, QName serviceTemplateID, String interfaceName, String opName, - QName planID); - - - - List getPropertyMappings(CSARID id, QName serviceTemplate); - - // public void storeInterfaceNameForPlan(CSARID csarID, QName - // serviceTemplateID, QName planID, String interfaceName); - // public void setBoundaryInterfaceForCSARIDPlan(CSARID csarID, QName - // serviceTemplateID, QName planID, String ifaceName); - // public void setBoundaryOperationForCSARIDPlan(CSARID csarID, QName - // serviceTemplateID, QName planID, String opName); - - - public void storeRelationshipTemplateIDForServiceTemplateANdCSAR(final CSARID csarId, final QName serviceTemplateID, - final String id); - - - - public Map> getServiceTemplate2RelationshipTemplateMap(final CSARID csarID); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/AvailableToscaElements.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/AvailableToscaElements.java deleted file mode 100644 index 8a1855353..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/AvailableToscaElements.java +++ /dev/null @@ -1,182 +0,0 @@ -package org.opentosca.container.core.engine.impl; - -import org.opentosca.container.core.tosca.model.TArtifactTemplate; -import org.opentosca.container.core.tosca.model.TArtifactType; -import org.opentosca.container.core.tosca.model.TCapability; -import org.opentosca.container.core.tosca.model.TCapabilityDefinition; -import org.opentosca.container.core.tosca.model.TCapabilityType; -import org.opentosca.container.core.tosca.model.TDefinitions; -import org.opentosca.container.core.tosca.model.TDeploymentArtifact; -import org.opentosca.container.core.tosca.model.TImplementationArtifact; -import org.opentosca.container.core.tosca.model.TInterface; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TNodeType; -import org.opentosca.container.core.tosca.model.TNodeTypeImplementation; -import org.opentosca.container.core.tosca.model.TOperation; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPolicy; -import org.opentosca.container.core.tosca.model.TPolicyTemplate; -import org.opentosca.container.core.tosca.model.TPolicyType; -import org.opentosca.container.core.tosca.model.TRelationshipTemplate; -import org.opentosca.container.core.tosca.model.TRelationshipType; -import org.opentosca.container.core.tosca.model.TRelationshipTypeImplementation; -import org.opentosca.container.core.tosca.model.TRequirement; -import org.opentosca.container.core.tosca.model.TRequirementDefinition; -import org.opentosca.container.core.tosca.model.TRequirementType; -import org.opentosca.container.core.tosca.model.TServiceTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This enum provides a list of available JAXB classes of TOSCA which are supported by the - * ToscaReferenceMapper. It is used by the ToscaReferenceMapper for getting a class object for a - * passed name of a Node. Due this the ToscaReferenceMapper can provide the method getJAXBReference - * which serializes a DOM Node into the returned class object. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - * - */ -public enum AvailableToscaElements { - - CAPABILITY, ARTIFACTTEMPLATE, ARTIFACTTYPE, CAPABILITYDEFINITION, CAPABILITYTYPE, DEFINITIONS, DEPLOYMENTARTIFACT, IMPLEMENTATIONARTIFACT, INTERFACE, NODETEMPLATE, NODETYPE, NODETYPEIMPLEMENTATION, OPERATION, POLICY, POLICYTEMPLATE, POLICYTYPE, RELATIONSHIPTEMPLATE, RELATIONSHIPTYPE, REQUIREMENT, REQUIREMENTDEFINITION, REQUIREMENTTYPE, SERVICETEMPLATE, SOURCEELEMENT, TARGETELEMENT, RELATIONSHIPTYPEIMPLEMENTATION, PLAN; - - Logger LOG = LoggerFactory.getLogger(AvailableToscaElements.class); - - - /** - * Returns the ENUM constant for a given element name. - * - * @param name Name of the element defined by the TOSCA speficiation of OASIS. - * @return The ENUM constant or null, if nothing matches. - */ - public static AvailableToscaElements getElementName(final String name) { - - final Logger LOG = LoggerFactory.getLogger(ToscaReferenceMapper.class); - - if (name.equals("ArtifactTemplate")) { - return ARTIFACTTEMPLATE; - } else if (name.equals("ArtifactType")) { - return ARTIFACTTYPE; - } else if (name.equals("Capability")) { - return CAPABILITY; - } else if (name.equals("CapabilityDefinition")) { - return CAPABILITYDEFINITION; - } else if (name.equals("CapabilityType")) { - return CAPABILITYTYPE; - } else if (name.equals("Definitions")) { - return DEFINITIONS; - } else if (name.equals("DeploymentArtifact")) { - return DEPLOYMENTARTIFACT; - } else if (name.equals("ImplementationArtifact")) { - return IMPLEMENTATIONARTIFACT; - } else if (name.equals("Interface")) { - return INTERFACE; - } else if (name.equals("NodeTemplate")) { - return NODETEMPLATE; - } else if (name.equals("NodeType")) { - return NODETYPE; - } else if (name.equals("NodeTypeImplementation")) { - return NODETYPEIMPLEMENTATION; - } else if (name.equals("Operation")) { - return OPERATION; - } else if (name.equals("Policy")) { - return POLICY; - } else if (name.equals("PolicyTemplate")) { - return POLICYTEMPLATE; - } else if (name.equals("PolicyType")) { - return POLICYTYPE; - } else if (name.equals("RelationshipTemplate")) { - return RELATIONSHIPTEMPLATE; - } else if (name.equals("RelationshipType")) { - return RELATIONSHIPTYPE; - } else if (name.equals("RelationshipTypeImplementation")) { - return RELATIONSHIPTYPEIMPLEMENTATION; - } else if (name.equals("Requirement")) { - return REQUIREMENT; - } else if (name.equals("RequirementDefinition")) { - return REQUIREMENTDEFINITION; - } else if (name.equals("RequirementType")) { - return REQUIREMENTTYPE; - } else if (name.equals("ServiceTemplate")) { - return SERVICETEMPLATE; - } else if (name.equals("SourceElement")) { - return SOURCEELEMENT; - } else if (name.equals("TargetElement")) { - return TARGETELEMENT; - } else if (name.equals("Plan")) { - return PLAN; - } - - // nothing found - LOG.error("The constant for \"" + name + "\" was not found."); - return null; - } - - /** - * Returns the JAXB class for a ENUM constant. - * - * @return JAXB element class or null if it is none of the constants. - */ - public Class getElementClass() { - final Logger LOG = LoggerFactory.getLogger(ToscaReferenceMapper.class); - - switch (this) { - case ARTIFACTTEMPLATE: - return TArtifactTemplate.class; - case ARTIFACTTYPE: - return TArtifactType.class; - case CAPABILITY: - return TCapability.class; - case CAPABILITYDEFINITION: - return TCapabilityDefinition.class; - case CAPABILITYTYPE: - return TCapabilityType.class; - case DEFINITIONS: - return TDefinitions.class; - case DEPLOYMENTARTIFACT: - return TDeploymentArtifact.class; - case IMPLEMENTATIONARTIFACT: - return TImplementationArtifact.class; - case INTERFACE: - return TInterface.class; - case NODETEMPLATE: - return TNodeTemplate.class; - case NODETYPE: - return TNodeType.class; - case NODETYPEIMPLEMENTATION: - return TNodeTypeImplementation.class; - case OPERATION: - return TOperation.class; - case POLICY: - return TPolicy.class; - case POLICYTEMPLATE: - return TPolicyTemplate.class; - case POLICYTYPE: - return TPolicyType.class; - case RELATIONSHIPTEMPLATE: - return TRelationshipTemplate.class; - case RELATIONSHIPTYPE: - return TRelationshipType.class; - case RELATIONSHIPTYPEIMPLEMENTATION: - return TRelationshipTypeImplementation.class; - case REQUIREMENT: - return TRequirement.class; - case REQUIREMENTDEFINITION: - return TRequirementDefinition.class; - case REQUIREMENTTYPE: - return TRequirementType.class; - case SERVICETEMPLATE: - return TServiceTemplate.class; - case SOURCEELEMENT: - return TRelationshipTemplate.SourceElement.class; - case TARGETELEMENT: - return TRelationshipTemplate.TargetElement.class; - case PLAN: - return TPlan.class; - - default: - LOG.error("The class for \"" + this.toString() + "\" was not found."); - return null; - } - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/PathResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/PathResolver.java deleted file mode 100644 index 6cbe1dd89..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/PathResolver.java +++ /dev/null @@ -1,129 +0,0 @@ -package org.opentosca.container.core.engine.impl; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - -import org.opentosca.container.core.model.csar.CSARContent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PathResolver { - - private static final Logger LOG = LoggerFactory.getLogger(PathResolver.class); - - - /** - * Returns the absolute path of a absolute location path and a assumed relative path. If the - * relative path is absolute, the relative path is returned. If there is an error, null is returned. - * - * TODO to avoid legacy problems this method handles absolute pathes in the parameter relativePath. - * This is not specification compliant! - * - * @param locationPath - * @param relativePath - * @return the absolute path or in case of an error null - */ - public static String resolveRelativePath(String locationPath, String relativePath, final CSARContent csarContent) { - - // try { - // locationPath = URLDecoder.decode(locationPath, "UTF-8"); - // relativePath = URLDecoder.decode(relativePath, "UTF-8"); - // } catch (UnsupportedEncodingException e1) { - // PathResolver.LOG.error("The decoding of the location attribute of an - // import failed: {}", - // e1.getLocalizedMessage()); - // e1.printStackTrace(); - // return null; - // } - - // String fs = System.getProperty("file.separator"); - final String fs = "/"; - - locationPath = locationPath.replace("/", fs); - locationPath = locationPath.replace("\\", fs); - locationPath = locationPath.replace("//", fs); - locationPath = locationPath.replace("\\\\", fs); - - relativePath = relativePath.replace("/", fs); - relativePath = relativePath.replace("\\", fs); - relativePath = relativePath.replace("//", fs); - relativePath = relativePath.replace("\\\\", fs); - - PathResolver.LOG.trace("Resolve the relative path with " + System.getProperty("line.separator") - + "entry point: " + locationPath + System.getProperty("line.separator") + "relative path: " - + relativePath); - - String newPath = locationPath.substring(0, locationPath.lastIndexOf(fs)); - - // somewhere else - if (relativePath.startsWith(".." + fs)) { - - PathResolver.LOG.trace("somewhere else"); - - while (relativePath.startsWith(".." + fs)) { - PathResolver.LOG.trace(newPath + " " + relativePath); - if (newPath.contains(fs)) { - newPath = newPath.substring(0, locationPath.lastIndexOf(fs)); - } else { - newPath = ""; - } - relativePath = relativePath.substring(3); - PathResolver.LOG.trace(newPath + " " + relativePath); - } - - if (newPath.equals("")) { - newPath = relativePath; - } else { - newPath = newPath + fs + relativePath; - } - } - - // subdirectory - else if (relativePath.startsWith("." + fs)) { - - PathResolver.LOG.trace("subdirectory 1 with " + newPath + " " + relativePath); - - if (!newPath.endsWith(fs)) { - newPath = newPath + fs; - } - newPath = newPath + relativePath.substring(2); - } - - // absolute - else if (relativePath.startsWith(fs)) { - - PathResolver.LOG.trace("absolute"); - - newPath = relativePath.substring(1); - } - - // subdirectory again - else { - - PathResolver.LOG.trace("subdirectory 2"); - - if (!newPath.endsWith(fs)) { - newPath = newPath + fs; - } - newPath = newPath + relativePath; - - if (null == csarContent.getFile(newPath)) { - newPath = relativePath; - } - } - - try { - if (!newPath.equals("") && null != csarContent.getFile(URLDecoder.decode(newPath, "UTF-8"))) { - PathResolver.LOG.trace("New path \"" + newPath + "\" seems legit, file exists."); - return newPath; - } - } - catch (final UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - PathResolver.LOG.error("The file at the new path \"" + newPath + "\" does not exist."); - return null; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ServiceHandler.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ServiceHandler.java deleted file mode 100644 index 74d22e7cd..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ServiceHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.opentosca.container.core.engine.impl; - -import org.opentosca.container.core.engine.xml.IXMLSerializerService; -import org.opentosca.container.core.service.ICoreFileService; -import org.opentosca.container.core.service.IFileAccessService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ServiceHandler { - - public static ICoreFileService coreFileService = null; - public static IXMLSerializerService xmlSerializerService = null; - public static IFileAccessService fileAccessService = null; - - private final Logger LOG = LoggerFactory.getLogger(ServiceHandler.class); - - - protected void bindICoreFileService(final ICoreFileService service) { - if (service == null) { - this.LOG.error("Service ICoreFileService is null."); - } else { - this.LOG.debug("Bind of the ICoreFileService."); - ServiceHandler.coreFileService = service; - } - } - - protected void unbindICoreFileService(final ICoreFileService service) { - this.LOG.debug("Unbind of the ICoreFileService."); - ServiceHandler.coreFileService = null; - } - - protected void bindIXMLSerializerService(final IXMLSerializerService service) { - if (service == null) { - this.LOG.error("Service IXMLSerializerService is null."); - } else { - this.LOG.debug("Bind of the IXMLSerializerService."); - ServiceHandler.xmlSerializerService = service; - } - } - - protected void unbindIXMLSerializerService(final IXMLSerializerService service) { - this.LOG.debug("Unbind of the IXMLSerializerService."); - ServiceHandler.xmlSerializerService = null; - } - - protected void bindIFileAccessService(final IFileAccessService service) { - if (service == null) { - this.LOG.error("Service IFileAccessService is null."); - } else { - this.LOG.debug("Bind of the IFileAccessService."); - ServiceHandler.fileAccessService = service; - } - } - - protected void unbindIFileAccessService(final IFileAccessService service) { - this.LOG.debug("Unbind of the IFileAccessService."); - ServiceHandler.fileAccessService = null; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ToscaEngineServiceImpl.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ToscaEngineServiceImpl.java deleted file mode 100644 index 4e3e71121..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ToscaEngineServiceImpl.java +++ /dev/null @@ -1,2043 +0,0 @@ -package org.opentosca.container.core.engine.impl; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.function.Predicate; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.engine.NodeTemplateInstanceCounts; -import org.opentosca.container.core.engine.ResolvedArtifacts; -import org.opentosca.container.core.engine.ResolvedArtifacts.ResolvedDeploymentArtifact; -import org.opentosca.container.core.engine.ResolvedArtifacts.ResolvedImplementationArtifact; -import org.opentosca.container.core.engine.impl.consolidation.DefinitionsConsolidation; -import org.opentosca.container.core.engine.impl.resolver.DefinitionsResolver; -import org.opentosca.container.core.model.AbstractArtifact; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TArtifactReference; -import org.opentosca.container.core.tosca.model.TArtifactReference.Exclude; -import org.opentosca.container.core.tosca.model.TArtifactReference.Include; -import org.opentosca.container.core.tosca.model.TArtifactTemplate; -import org.opentosca.container.core.tosca.model.TArtifactTemplate.ArtifactReferences; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions; -import org.opentosca.container.core.tosca.model.TCapability; -import org.opentosca.container.core.tosca.model.TDefinitions; -import org.opentosca.container.core.tosca.model.TDeploymentArtifact; -import org.opentosca.container.core.tosca.model.TDeploymentArtifacts; -import org.opentosca.container.core.tosca.model.TEntityTemplate; -import org.opentosca.container.core.tosca.model.TEntityTemplate.Properties; -import org.opentosca.container.core.tosca.model.TImplementationArtifact; -import org.opentosca.container.core.tosca.model.TInterface; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TNodeType; -import org.opentosca.container.core.tosca.model.TNodeTypeImplementation; -import org.opentosca.container.core.tosca.model.TOperation; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPropertyConstraint; -import org.opentosca.container.core.tosca.model.TRelationshipTemplate; -import org.opentosca.container.core.tosca.model.TRelationshipType; -import org.opentosca.container.core.tosca.model.TRelationshipTypeImplementation; -import org.opentosca.container.core.tosca.model.TRequiredContainerFeature; -import org.opentosca.container.core.tosca.model.TRequirement; -import org.opentosca.container.core.tosca.model.TServiceTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import com.google.common.collect.Lists; - -/** - * This is the implementation of the interface - * org.opentosca.toscaengine.service.IToscaEngineService. - * - * @see org.opentosca.container.core.engine.IToscaEngineService - */ -public class ToscaEngineServiceImpl implements IToscaEngineService { - - public static ToscaReferenceMapper toscaReferenceMapper = null; - - private DefinitionsResolver definitionsResolver = null; - - private DefinitionsConsolidation definitionsConsolidation = null; - - private static final Logger LOG = LoggerFactory.getLogger(ToscaEngineServiceImpl.class); - - public ToscaEngineServiceImpl() { - toscaReferenceMapper = new ToscaReferenceMapper(); - this.definitionsResolver = new DefinitionsResolver(); - this.definitionsConsolidation = new DefinitionsConsolidation(); - } - - /** - * {@inheritDoc} - */ - @Override - public IToscaReferenceMapper getToscaReferenceMapper() { - return toscaReferenceMapper; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean resolveDefinitions(final CSARID csarID) { - - LOG.debug("Resolve a Definitions."); - boolean ret = this.definitionsResolver.resolveDefinitions(csarID); - if (ret) { - ret = this.definitionsConsolidation.consolidateCSAR(csarID); - } - toscaReferenceMapper.printStoredData(); - - return ret; - - } - - /** - * {@inheritDoc} - */ - @Override - public List getReferencedNodeTypesOfAServiceTemplate(final CSARID csarID, final QName serviceTemplateID) { - - final List nodeTypeQNames = new ArrayList<>(); - - // get the referenced ServiceTemplate - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarID, serviceTemplateID); - - // for NodeTemplates and RelationshipTemplates - for (final TEntityTemplate entity : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - - TNodeTemplate nodeTemplate = new TNodeTemplate(); - - // search inside of a NodeTemplate - if (entity instanceof TNodeTemplate) { - nodeTemplate = (TNodeTemplate) entity; - if (nodeTemplate.getType() != null) { - if (!nodeTypeQNames.contains(nodeTemplate.getType())) { - nodeTypeQNames.add(nodeTemplate.getType()); - } - } else { - LOG.error("The NodeTemplate \"" + serviceTemplate.getTargetNamespace() + ":" + nodeTemplate.getId() - + "does not specify a NodeType."); - } - } else { - - // search inside of a RelationshipTemplate - if (entity instanceof TRelationshipTemplate) { - final TRelationshipTemplate relationshipTemplate = (TRelationshipTemplate) entity; - - // SourceElement - if (relationshipTemplate.getSourceElement() != null - && relationshipTemplate.getSourceElement().getRef() != null) { - if (relationshipTemplate.getTargetElement().getRef() instanceof TNodeTemplate) { - nodeTemplate = (TNodeTemplate) relationshipTemplate.getTargetElement().getRef(); - if (nodeTemplate.getType() != null) { - if (!nodeTypeQNames.contains(nodeTemplate.getType())) { - nodeTypeQNames.add(nodeTemplate.getType()); - } - } else { - LOG.error("The NodeTemplate \"" + serviceTemplate.getTargetNamespace() + ":" - + nodeTemplate.getId() + "does not specify a NodeType."); - - } - } else { - - LOG.debug("The QName \"" + relationshipTemplate.getTargetElement().getRef() - + "\" points to a Requirement."); - } - } else { - LOG.error("The RelationshipTemplate \"" + serviceTemplate.getTargetNamespace() + ":" - + relationshipTemplate.getId() + "does not specify a SourceElement."); - } - - // TargetElement - if (relationshipTemplate.getTargetElement() != null - && relationshipTemplate.getTargetElement().getRef() != null) { - if (relationshipTemplate.getTargetElement().getRef() instanceof TNodeTemplate) { - nodeTemplate = new TNodeTemplate(); - nodeTemplate = (TNodeTemplate) relationshipTemplate.getTargetElement().getRef(); - if (nodeTemplate.getType() != null) { - if (!nodeTypeQNames.contains(nodeTemplate.getType())) { - nodeTypeQNames.add(nodeTemplate.getType()); - } - } else { - LOG.error("The NodeTemplate \"" + serviceTemplate.getTargetNamespace() + ":" - + nodeTemplate.getId() + "does not specify a NodeType."); - } - } - } else { - LOG.error("The RelationshipTemplate \"" + serviceTemplate.getTargetNamespace() + ":" - + relationshipTemplate.getId() + "does not specify a TargetElement."); - } - } - } - } - - return nodeTypeQNames; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean hasOperationOfATypeSpecifiedInputParams(final CSARID csarID, final QName typeID, - final String interfaceName, final String operationName) { - - // only look for operation which have a input parameter list defined - final Predicate inputParamListDefined = - (op) -> op.getInputParameters() != null && op.getInputParameters().getInputParameter() != null; - - // get the searched operation if available - final Optional operation = - getOperationForType(csarID, typeID, interfaceName, operationName, inputParamListDefined); - - // check if parameters are defined - return operation.map((op) -> !op.getInputParameters().getInputParameter().isEmpty()).orElse(false); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean hasOperationOfATypeSpecifiedOutputParams(final CSARID csarID, final QName typeID, - final String interfaceName, final String operationName) { - - // only look for operation which have a output parameter list defined - final Predicate outputParamListDefined = - (op) -> op.getOutputParameters() != null && op.getOutputParameters().getOutputParameter() != null; - - // get the searched operation if available - final Optional operation = - getOperationForType(csarID, typeID, interfaceName, operationName, outputParamListDefined); - - // check if parameters are defined - return operation.map((op) -> !op.getOutputParameters().getOutputParameter().isEmpty()).orElse(false); - } - - @Override - public Node getInputParametersOfATypeOperation(final CSARID csarID, final QName typeID, final String interfaceName, - final String operationName) { - - // only use operation which have a input parameter list defined - final Predicate inputParamListDefined = - (op) -> op.getInputParameters() != null && op.getInputParameters().getInputParameter() != null; - - // get the defined operation if available - final Optional operation = - getOperationForType(csarID, typeID, interfaceName, operationName, inputParamListDefined); - - // parse parameters to Node - return operation.map((op) -> ServiceHandler.xmlSerializerService.getXmlSerializer() - .marshalToNode(op.getInputParameters())) - .orElse(null); - } - - @Override - public Node getOutputParametersOfATypeOperation(final CSARID csarID, final QName typeID, final String interfaceName, - final String operationName) { - - // only use operation which have a output parameter list defined - final Predicate outputParamListDefined = - (op) -> op.getOutputParameters() != null && op.getOutputParameters().getOutputParameter() != null; - - // get the defined operation if available - final Optional operation = - getOperationForType(csarID, typeID, interfaceName, operationName, outputParamListDefined); - - // parse parameters to Node - return operation.map((op) -> ServiceHandler.xmlSerializerService.getXmlSerializer() - .marshalToNode(op.getOutputParameters())) - .orElse(null); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean doesInterfaceOfTypeContainOperation(final CSARID csarID, final QName typeID, - final String interfaceName, final String operationName) { - - // lock for all operations with the given name/interface without further filtering - return getOperationForType(csarID, typeID, interfaceName, operationName, (op) -> true).isPresent(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isOperationOfRelationshipBoundToSourceNode(final CSARID csarID, final QName relationshipTypeID, - final String interfaceName, final String operationName) { - - final TRelationshipType relationshipType = - (TRelationshipType) toscaReferenceMapper.getJAXBReference(csarID, relationshipTypeID); - - return Optional.ofNullable(relationshipType.getSourceInterfaces()).map(i -> i.getInterface()) - .orElse(Collections.emptyList()).stream() - .filter(iface -> interfaceName == null || iface.getName().equals(interfaceName)) - .flatMap(iface -> iface.getOperation().stream()) - .anyMatch(op -> op.getName().equals(operationName)); - } - - /** - * {@inheritDoc} - */ - @Override - public List getTypeImplementationsOfType(final CSARID csarID, final QName typeID) { - - final List listOfTypeImplementationQNames = new ArrayList<>(); - - final Object type = toscaReferenceMapper.getJAXBReference(csarID, typeID); - - if (type instanceof TNodeType) { - - // search in all Definitions inside a certain CSAR - for (final TDefinitions definitions : toscaReferenceMapper.getDefinitionsOfCSAR(csarID)) { - - // add all NodeTypeImpls which are part of the NodeType hierarchy - definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() - .filter((entity) -> entity instanceof TNodeTypeImplementation) - .map((entity) -> (TNodeTypeImplementation) entity).forEach((impl) -> { - for (final QName nodeTypeHierachyMember : getNodeTypeHierarchy(csarID, typeID)) { - if (impl.getNodeType().equals(nodeTypeHierachyMember)) { - - String targetNamespace; - if (impl.getTargetNamespace() != null && !impl.getTargetNamespace().equals("")) { - targetNamespace = impl.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - listOfTypeImplementationQNames.add(new QName(targetNamespace, impl.getName())); - } - } - }); - } - } else if (type instanceof TRelationshipType) { - - // search in all Definitions inside a certain CSAR - for (final TDefinitions definitions : toscaReferenceMapper.getDefinitionsOfCSAR(csarID)) { - - // add all RelationshipTypeImpl for the type to the list - definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation().stream() - .filter((entity) -> entity instanceof TRelationshipTypeImplementation) - .map((entity) -> (TRelationshipTypeImplementation) entity) - .filter((impl) -> impl.getRelationshipType().equals(typeID)).forEach((impl) -> { - String targetNamespace; - if (impl.getTargetNamespace() != null && !impl.getTargetNamespace().equals("")) { - targetNamespace = impl.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - listOfTypeImplementationQNames.add(new QName(targetNamespace, impl.getName())); - }); - } - } else { - LOG.warn("Given typeID does not identifiy a NodeType or RelationshipType: {}", typeID); - } - - return listOfTypeImplementationQNames; - } - - /** - * {@inheritDoc} - */ - @Override - public List getImplementationArtifactNamesOfTypeImplementation(final CSARID csarID, - final QName typeImplementationID) { - - return getIAsOfType(csarID, typeImplementationID).stream().map((ia) -> ia.getName()) - .collect(Collectors.toList()); - } - - @Override - public String getRelatedNodeTemplateID(final CSARID csarID, final QName serviceTemplateID, - final String nodeTemplateID, final QName relationshipType) { - return getRelatedNodeTemplateIDs(csarID, serviceTemplateID, nodeTemplateID, relationshipType).stream() - .findFirst() - .orElse(null); - } - - @Override - public List getRelatedNodeTemplateIDs(final CSARID csarID, final QName serviceTemplateID, - final String nodeTemplateID, final QName relationshipType) { - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarID, serviceTemplateID); - - return serviceTemplate.getTopologyTemplate().getNodeTemplateOrRelationshipTemplate().stream() - .filter(template -> template instanceof TRelationshipTemplate) - .map(relation -> (TRelationshipTemplate) relation) - .filter((relation) -> relation.getType().equals(relationshipType)).filter(relation -> { - final Object source = relation.getSourceElement().getRef(); - return source instanceof TNodeTemplate - && ((TNodeTemplate) source).getId().equals(nodeTemplateID); - }).map(relation -> relation.getTargetElement().getRef()) - .filter((target) -> target instanceof TNodeTemplate) - .map(target -> ((TNodeTemplate) target).getId()).collect(Collectors.toList()); - } - - @Override - public List getTransitiveNodeTemplateIDs(final CSARID csarID, final QName serviceTemplateID, - final String nodeTemplateID, final QName relationshipType) { - final List nodeTemplateIDs = - getRelatedNodeTemplateIDs(csarID, serviceTemplateID, nodeTemplateID, relationshipType); - - for (final String id : getRelatedNodeTemplateIDs(csarID, serviceTemplateID, nodeTemplateID, relationshipType)) { - nodeTemplateIDs.addAll(getTransitiveNodeTemplateIDs(csarID, serviceTemplateID, id, relationshipType)); - } - return nodeTemplateIDs; - } - - /** - * {@inheritDoc} - */ - @Override - public String getTargetNodeTemplateIDOfRelationshipTemplate(final CSARID csarID, final QName serviceTemplateID, - final String relationshipTemplateID) { - - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarID, serviceTemplateID); - - return serviceTemplate.getTopologyTemplate().getNodeTemplateOrRelationshipTemplate().stream() - .filter(template -> template instanceof TRelationshipTemplate) - .map(template -> (TRelationshipTemplate) template) - .filter(relation -> relation.getId().equals(relationshipTemplateID) - && relation.getTargetElement() != null) - .map(relation -> relation.getTargetElement().getRef()) - .filter(target -> target instanceof TNodeTemplate).findFirst() - .map(target -> ((TNodeTemplate) target).getId()).orElse(null); - } - - /** - * {@inheritDoc} - */ - @Override - - public String getSourceNodeTemplateIDOfRelationshipTemplate(final CSARID csarID, final QName serviceTemplateID, - final String relationshipTemplateID) { - - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarID, serviceTemplateID); - - return serviceTemplate.getTopologyTemplate().getNodeTemplateOrRelationshipTemplate().stream() - .filter(template -> template instanceof TRelationshipTemplate) - .map(template -> (TRelationshipTemplate) template) - .filter(relation -> relation.getId().equals(relationshipTemplateID) - && relation.getSourceElement() != null) - .map(relation -> relation.getSourceElement().getRef()) - .filter(source -> source instanceof TNodeTemplate).findFirst() - .map(source -> ((TNodeTemplate) source).getId()).orElse(null); - } - - /** - * {@inheritDoc} - */ - @Override - - public Document getArtifactSpecificContentOfADeploymentArtifact(final CSARID csarID, final QName reference, - final String deploymentArtifactName) { - - TDeploymentArtifacts artifacts = null; - - final Object referenceObj = toscaReferenceMapper.getJAXBReference(csarID, reference); - if (referenceObj instanceof TNodeTypeImplementation) { - artifacts = ((TNodeTypeImplementation) referenceObj).getDeploymentArtifacts(); - } else if (referenceObj instanceof TNodeTemplate) { - artifacts = ((TNodeTemplate) referenceObj).getDeploymentArtifacts(); - } - - // if there are ImplementationArtifacts - if (null != artifacts) { - for (final TDeploymentArtifact deployArt : artifacts.getDeploymentArtifact()) { - if (deployArt.getName().equals(deploymentArtifactName)) { - - final List listOfAnyElements = new ArrayList<>(); - for (final Object obj : deployArt.getAny()) { - if (obj instanceof Element) { - listOfAnyElements.add((Element) obj); - } else { - LOG.error("There is content inside of the DeploymentArtifact \"" + deploymentArtifactName - + "\" of the NodeTypeImplementation \"" + reference - + "\" which is not a processable DOM Element."); - return null; - } - } - - return ServiceHandler.xmlSerializerService.getXmlSerializer() - .elementsIntoDocument(listOfAnyElements, - "DeploymentArtifactSpecificContent"); - } - } - } - - LOG.error("The requested DeploymentArtifact was not found."); - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public List getRequiredContainerFeaturesOfATypeImplementation(final CSARID csarID, - final QName typeImplementationID) { - - final List requiredFeatures = new ArrayList<>(); - - final Object typeImplementation = toscaReferenceMapper.getJAXBReference(csarID, typeImplementationID); - - if (typeImplementation instanceof TNodeTypeImplementation) { - final TNodeTypeImplementation nodeTypeImplementation = (TNodeTypeImplementation) typeImplementation; - - if (nodeTypeImplementation.getRequiredContainerFeatures() != null) { - for (final TRequiredContainerFeature requiredContainerFeature : nodeTypeImplementation.getRequiredContainerFeatures() - .getRequiredContainerFeature()) { - requiredFeatures.add(requiredContainerFeature.getFeature()); - } - } - - } else if (typeImplementation instanceof TRelationshipTypeImplementation) { - final TRelationshipTypeImplementation relationshipTypeImplementation = - (TRelationshipTypeImplementation) typeImplementation; - - if (relationshipTypeImplementation.getRequiredContainerFeatures() != null) { - for (final TRequiredContainerFeature requiredContainerFeature : relationshipTypeImplementation.getRequiredContainerFeatures() - .getRequiredContainerFeature()) { - requiredFeatures.add(requiredContainerFeature.getFeature()); - } - } - } else { - LOG.warn("Given typeImplementationID does not identifiy a NodeTypeImplementation or RelationshipTypeImplementation: {}", - typeImplementationID); - } - - return requiredFeatures; - } - - /** - * {@inheritDoc} - */ - @Override - public QName getArtifactTypeOfAImplementationArtifactOfATypeImplementation(final CSARID csarID, - final QName typeImplementationID, - final String implementationArtifactName) { - - return getIAsOfType(csarID, typeImplementationID).stream() - .filter((ia) -> ia.getName() - .equals(implementationArtifactName)) - .findFirst().map((ia) -> ia.getArtifactType()).orElse(null); - } - - /** - * {@inheritDoc} - */ - @Override - public QName getArtifactTemplateOfAImplementationArtifactOfATypeImplementation(final CSARID csarID, - final QName typeImplementationID, - final String implementationArtifactName) { - - return getIAsOfType(csarID, typeImplementationID).stream() - .filter((ia) -> ia.getName() - .equals(implementationArtifactName)) - .findFirst().map((ia) -> ia.getArtifactRef()).orElse(null); - } - - /** - * {@inheritDoc} - */ - @Override - public Node getReferenceAsNode(final CSARID csarID, final QName reference) { - - // get the ArtifactTemplate - final Object artifactTemplateDoc = toscaReferenceMapper.getReferenceAsNode(csarID, reference); - - if (artifactTemplateDoc != null && artifactTemplateDoc instanceof Node) { - return (Node) artifactTemplateDoc; - } else { - LOG.error("The requested ArtifactTemplate was not found."); - return null; - } - } - - /** - * {@inheritDoc} - */ - @Override - public Document getArtifactSpecificContentOfAImplementationArtifact(final CSARID csarID, - final QName typeImplementationID, - final String implementationArtifactName) { - - final Optional opt = - getImplementationArtifactForName(csarID, typeImplementationID, implementationArtifactName); - - if (opt.isPresent()) { - final TImplementationArtifact ia = opt.get(); - - final List listOfAnyElements = new ArrayList<>(); - for (final Object obj : ia.getAny()) { - if (obj instanceof Element) { - listOfAnyElements.add((Element) obj); - } else { - LOG.error("There is content inside of the ImplementationArtifact \"" + implementationArtifactName - + "\" of the TypeImplementation \"" + typeImplementationID - + "\" which is not a processable DOM Element."); - return null; - } - } - - return ServiceHandler.xmlSerializerService.getXmlSerializer() - .elementsIntoDocument(listOfAnyElements, - "ImplementationArtifactSpecificContent"); - } else { - LOG.error("The requested ImplementationArtifact was not found."); - return null; - } - } - - /** - * {@inheritDoc} - */ - @Override - public String getInterfaceOfAImplementationArtifactOfATypeImplementation(final CSARID csarID, - final QName typeImplementationID, - final String implementationArtifactName) { - - return getImplementationArtifactForName(csarID, typeImplementationID, - implementationArtifactName).map((ia) -> ia.getInterfaceName()) - .orElse(null); - } - - /** - * {@inheritDoc} - */ - @Override - public String getOperationOfAImplementationArtifactOfATypeImplementation(final CSARID csarID, - final QName typeImplementationID, - final String implementationArtifactName) { - - return getImplementationArtifactForName(csarID, typeImplementationID, - implementationArtifactName).map((ia) -> ia.getOperationName()) - .orElse(null); - } - - /** - * {@inheritDoc} - */ - @Override - public Document getPropertiesOfAArtifactTemplate(final CSARID csarID, final QName artifactTemplateID) { - - final Object requestedObject = toscaReferenceMapper.getJAXBReference(csarID, artifactTemplateID); - - if (requestedObject instanceof TArtifactTemplate) { - // get the ArtifactTemplate - final TArtifactTemplate artifactTemplate = (TArtifactTemplate) requestedObject; - - if (artifactTemplate.getProperties() != null) { - - if (artifactTemplate.getProperties().getAny() instanceof Element) { - final Document returnDoc = - ServiceHandler.xmlSerializerService.getXmlSerializer() - .elementIntoDocument((Element) artifactTemplate.getProperties() - .getAny()); - - if (returnDoc != null) { - LOG.debug("Return the Properties of the ArtifactTemplate \"" + artifactTemplateID + "\"."); - return returnDoc; - } else { - LOG.error("The content of the Properties of the ArtifactTemplate \"" + artifactTemplateID - + "\" could not be written into a DOM Document."); - } - } else { - LOG.error("The content of the Properties of the ArtifactTemplate \"" + artifactTemplateID - + "\" is not of the type DOM Element."); - } - } - } else { - LOG.error("The requested \"" + artifactTemplateID - + "\" is not of the type ArtifactTemplate. It is of the type " - + requestedObject.getClass().getSimpleName() + "."); - } - - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public List getPropertyConstraintsOfAArtifactTemplate(final CSARID csarID, - final QName artifactTemplateID) { - - final Object requestedObject = toscaReferenceMapper.getJAXBReference(csarID, artifactTemplateID); - - if (requestedObject instanceof TArtifactTemplate) { - - // get the ArtifactTemplate - final TArtifactTemplate artifactTemplate = (TArtifactTemplate) requestedObject; - - if (artifactTemplate.getPropertyConstraints() != null) { - return artifactTemplate.getPropertyConstraints().getPropertyConstraint(); - } else { - LOG.debug("There are no PropertyConstraints inside of the ArtifactTemplate \"" + artifactTemplateID - + "\"."); - } - - } else { - LOG.error("The requested \"" + artifactTemplateID - + "\" is not of the type ArtifactTemplate. It is of the type " - + requestedObject.getClass().getSimpleName() + "."); - } - - return new ArrayList<>(); - } - - /** - * {@inheritDoc} - */ - @Override - public List getArtifactsOfAArtifactTemplate(final CSARID csarID, final QName artifactTemplateID) { - - final List artifacts = new ArrayList<>(); - - final Object requestedObject = toscaReferenceMapper.getJAXBReference(csarID, artifactTemplateID); - - if (requestedObject instanceof TArtifactTemplate) { - - // get the ArtifactTemplate - final TArtifactTemplate artifactTemplate = (TArtifactTemplate) requestedObject; - - if (artifactTemplate.getArtifactReferences() != null) { - - CSARContent csar; - - try { - csar = ServiceHandler.coreFileService.getCSAR(csarID); - } - catch (final UserException e) { - LOG.warn("An User Exception occured.", e); - return artifacts; - } - - // iterate the references - for (final TArtifactReference artifactReference : artifactTemplate.getArtifactReferences() - .getArtifactReference()) { - - final Set includePatterns = new HashSet<>(); - final Set excludePatterns = new HashSet<>(); - - for (final Object patternObj : artifactReference.getIncludeOrExclude()) { - if (patternObj instanceof Include) { - final Include include = (Include) patternObj; - includePatterns.add(include.getPattern()); - } else { - final Exclude exclude = (Exclude) patternObj; - excludePatterns.add(exclude.getPattern()); - } - } - - try { - final AbstractArtifact artifact = - csar.resolveArtifactReference(artifactReference.getReference(), includePatterns, - excludePatterns); - artifacts.add(artifact); - } - catch (final UserException exc) { - LOG.warn("An User Exception occured.", exc); - } - catch (final SystemException exc) { - LOG.warn("A System Exception occured.", exc); - - } - - // all files pointed to by the reference - // List abstractFiles = - // csarContent.resolveFileRef(artifactReference.getReference()); - - // adapt the patterns - // for (Object patternObj : - // artifactReference.getIncludeOrExclude()) { - // - // List subset = - // this.getSubsetMatchingWithPattern(abstractFiles, - // patternObj); - // - // // take new subset or remove all inside the subset - // if (patternObj instanceof Include) { - // this.LOG.debug("Use subset as new list of files - // (Include)."); - // abstractFiles = subset; - // } else { - // this.LOG.debug("Remove subset from used list of files - // (Exclude)."); - // abstractFiles.removeAll(subset); - // } - // - // } - // - // // remember the remaining files - // for (AbstractFile file : abstractFiles) { - // returnFiles.add(file.getFile()); - // } - - } - - } else { - LOG.debug("There are no ArtifactReferences in ArtifactTemplate \"" + artifactTemplateID + "\"."); - } - } else { - LOG.error("The requested \"" + artifactTemplateID - + "\" is not of the type ArtifactTemplate. It is of the type " - + requestedObject.getClass().getSimpleName() + "."); - } - - return artifacts; - } - - @Override - public QName getNodeTypeOfNodeTemplate(final CSARID csarID, final QName serviceTemplateID, - final String nodeTemplateID) { - - final QName NodeTemplateReference = new QName(serviceTemplateID.getNamespaceURI(), nodeTemplateID); - - // get the NodeTemplate - final Object obj = toscaReferenceMapper.getJAXBReference(csarID, NodeTemplateReference); - - if (obj == null) { - LOG.error("The requested NodeTemplate was not found."); - return null; - } - - if (obj instanceof TNodeTemplate) { - return ((TNodeTemplate) obj).getType(); - } else if (obj instanceof TNodeType) { - // funny case with Moodle, since {ns}ApacheWebServer denotes a - // NodeTemplate AND a NodeType, here we return the given QName - return NodeTemplateReference; - } - - LOG.error("The requested NodeTemplate was not found."); - return null; - } - - @Override - public QName getRelationshipTypeOfRelationshipTemplate(final CSARID csarID, final QName serviceTemplateID, - final String relationshipTemplateID) { - - final QName RelationshipTemplateReference = - new QName(serviceTemplateID.getNamespaceURI(), relationshipTemplateID); - - // get the RelationshipTemplate - final TRelationshipTemplate relationshipTemplate = - (TRelationshipTemplate) toscaReferenceMapper.getJAXBReference(csarID, RelationshipTemplateReference); - - if (relationshipTemplate != null) { - return relationshipTemplate.getType(); - } - - LOG.error("The requested RelationshipTemplate was not found."); - return null; - } - - @Override - public boolean doesNodeTemplateExist(final CSARID csarID, final QName serviceTemplateID, - final String nodeTemplateID) { - - final QName nodeTemplateReference = new QName(serviceTemplateID.getNamespaceURI(), nodeTemplateID); - - // get the NodeTemplate - final Object obj = toscaReferenceMapper.getJAXBReference(csarID, nodeTemplateReference); - if (null == obj) { - LOG.warn("The requested reference \"" + nodeTemplateReference + "\" was not found."); - } else if (obj instanceof TNodeTemplate) { - LOG.trace(nodeTemplateReference + " is a NodeTemplate and exists."); - return true; - } else { - LOG.error("The requested reference is not an instance of TNodeTemplate. It seems to be a valid reference but the reference is not a NodeTemplate."); - } - - return false; - - } - - @Override - public boolean doesRelationshipTemplateExist(final CSARID csarID, final QName serviceTemplateID, - final String relationshipTemplateID) { - final QName relationshipTemplateReference = - new QName(serviceTemplateID.getNamespaceURI(), relationshipTemplateID); - - // get the NodeTemplate - final Object obj = toscaReferenceMapper.getJAXBReference(csarID, relationshipTemplateReference); - if (null == obj) { - LOG.warn("The requested reference \"" + relationshipTemplateReference + "\" was not found."); - } else if (obj instanceof TRelationshipTemplate) { - LOG.trace(relationshipTemplateReference + " is a RelationshipTemplate and exists."); - return true; - } else { - LOG.error("The requested reference is not an instance of TNodeTemplate. It seems to be a valid reference but the reference is not a NodeTemplate."); - } - - return false; - } - - @Override - /** - * {@inheritDoc} - */ - public boolean clearCSARContent(final CSARID csarID) { - return toscaReferenceMapper.clearCSARContent(csarID); - } - - @Override - public Document getPropertiesOfTemplate(final CSARID csarID, final QName serviceTemplateID, - final String templateID) { - - // get the Namespace from the serviceTemplate - final QName templateReference = new QName(serviceTemplateID.getNamespaceURI(), templateID); - - final Object template = toscaReferenceMapper.getJAXBReference(csarID, templateReference); - - // retrieve the properties from the Template - Properties properties = null; - if (template instanceof TNodeTemplate) { - final TNodeTemplate nodeTemplate = (TNodeTemplate) template; - properties = nodeTemplate.getProperties(); - } else if (template instanceof TRelationshipTemplate) { - final TRelationshipTemplate relationshipTemplate = (TRelationshipTemplate) template; - properties = relationshipTemplate.getProperties(); - } else { - LOG.error("Unable to retrieve a NodeTemplate or RelationshipTemplate for templateID: {}", templateID); - } - - // return the document containing the properties if found - if (properties != null) { - final Object any = properties.getAny(); - if (any instanceof Element) { - final Element element = (Element) any; - return element.getOwnerDocument(); - } else { - LOG.warn("Properties is not of class Element."); - } - } else { - LOG.warn("Properties are not set."); - } - - return null; - } - - @Override - public Document getPropertiesDefinitionOfNodeType(final CSARID csarID, final QName nodeTypeID) { - - // get the NodeType - final TNodeType nodeType = (TNodeType) toscaReferenceMapper.getJAXBReference(csarID, nodeTypeID); - - if (nodeType != null) { - - // TODO: fix this hack to get PropertiesDefinition. Needed till - // you can get it "directly" via the model - - final Node nodeTypeNode = ServiceHandler.xmlSerializerService.getXmlSerializer().marshalToNode(nodeType); - - try { - - final NodeList list = nodeTypeNode.getChildNodes(); - - for (int i = 0; i < list.getLength(); i++) { - - final Node node = list.item(i); - - if (node.getLocalName().equals("PropertiesDefinition")) { - - final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); - doc.appendChild(doc.importNode(node, true)); - - return doc; - - } - } - - LOG.debug("No PropertiesDefinition defined."); - return null; - - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - - } - - LOG.debug("NodeType {} not found.", nodeTypeID); - return null; - } - - @Override - /** - * {@inheritDoc} - */ - public ResolvedArtifacts getResolvedArtifactsOfNodeTemplate(final CSARID csarID, final QName nodeTemplateID) { - final List resolvedDAs = getNodeTemplateResolvedDAs(csarID, nodeTemplateID); - - final ResolvedArtifacts result = new ResolvedArtifacts(); - result.setDeploymentArtifacts(resolvedDAs); - - return result; - } - - @Override - /** - * {@inheritDoc} - */ - public ResolvedArtifacts getResolvedArtifactsOfNodeTypeImplementation(final CSARID csarID, - final QName nodeTypeImplementationID) { - // TODO: add debug logger - - final List resolvedIAs = - getNodeTypeImplResolvedIAs(csarID, nodeTypeImplementationID); - final List resolvedDAs = - getNodeTypeImplResolvedDAs(csarID, nodeTypeImplementationID); - - final ResolvedArtifacts result = new ResolvedArtifacts(); - result.setDeploymentArtifacts(resolvedDAs); - result.setImplementationArtifacts(resolvedIAs); - - return result; - } - - @Override - /** - * {@inheritDoc} - */ - public ResolvedArtifacts getResolvedArtifactsOfRelationshipTypeImplementation(final CSARID csarID, - final QName nodeTypeImplementationID) { - // TODO: add debug logger - final List resolvedIAs = - getRelationshipTypeImplResolvedIAs(csarID, nodeTypeImplementationID); - final List resolvedDAs = new ArrayList<>(); - - final ResolvedArtifacts result = new ResolvedArtifacts(); - result.setDeploymentArtifacts(resolvedDAs); - result.setImplementationArtifacts(resolvedIAs); - - return result; - } - - /** - * {@inheritDoc} - */ - @Override - public String getNameOfReference(final CSARID csarID, final QName reference) { - final Object jaxbReferenceObject = toscaReferenceMapper.getJAXBReference(csarID, reference); - // check if object was found - if (jaxbReferenceObject == null) { - LOG.error("Failed to extract name attribute - could not retrieve correlating JAXB-Object. Reference " - + reference + " seems to be non-existent"); - return null; - } - - // check if class could be retrieved - final Class jaxbClass = jaxbReferenceObject.getClass(); - - if (jaxbClass == null) { - LOG.error("Failed to extract name attribute - could not retrieve correlating JAXB-Class. Reference " - + reference + " existents but is not a valid jaxb-class"); - return null; - } - - try { - // try to call .getName on the referencing jaxb class - final Method getNameMethod = jaxbClass.getMethod("getName"); - if (getNameMethod == null) { - LOG.error("Failed to extract name attribute - could not retrieve getName-Method of JAXB-Class. Reference " - + reference + " existents but is not a jaxb-class containing a getName Method"); - return null; - } - - // invoke of parameterless getName() - final String result = (String) getNameMethod.invoke(jaxbReferenceObject, (Object[]) null); - // return result or emptyString if result == null - if (result == null) { - LOG.debug("Name attribute of " + reference + " was null - returning \"\""); - return ""; - } else { - return result; - } - - } - catch (final NoSuchMethodException e) { - final String logMsg = - String.format("Failed to extract name attribute: The retrieved class %s didn't contain a getName() method. Check if the call with csarid: %s and QName %s was valid! (maybe a bug in code!!!)", - jaxbClass, csarID.toString(), reference.toString()); - - LOG.error(logMsg); - } - catch (final InvocationTargetException e) { - LOG.error("Failed to extract name attribute - an Invocation-exception occured while invoking getName()", - e.getCause()); - } - catch (final Exception e) { - LOG.error("Failed to extract name attribute - an exception occured while invoking getName()", e); - } - - return null; - - } - - /** - * Resolves the Deployment-Artifacts of a NodeTemplate - * - * @param csarID of the CSAR - * @param nodeTemplateID - * @return List of ResolvedArtifact containing artifactSpecificContent or references. If no Artifact - * was found the returned list will be empty. - */ - private List getNodeTemplateResolvedDAs(final CSARID csarID, - final QName nodeTemplateID) { - - final List resolvedDAs = new ArrayList<>(); - - LOG.debug("Trying to fetch DA of NodeTemplate " + nodeTemplateID); - - final TNodeTemplate nodeTemplate = - (TNodeTemplate) toscaReferenceMapper.getJAXBReference(csarID, nodeTemplateID); - - // check if there are implementationArtifact Entries - if (nodeTemplate.getDeploymentArtifacts() == null - || nodeTemplate.getDeploymentArtifacts().getDeploymentArtifact() == null) { - // return empty list - LOG.warn("NodeTemplate " + nodeTemplate + " has no DeploymentArtifacts"); - return new ArrayList<>(); - } - - for (final TDeploymentArtifact deployArt : nodeTemplate.getDeploymentArtifacts().getDeploymentArtifact()) { - final ResolvedDeploymentArtifact ra = new ResolvedDeploymentArtifact(); - ra.setName(deployArt.getName()); - ra.setType(deployArt.getArtifactType()); - - // we assume there is artifactSpecificContent OR a reference to - // an artifactTemplate - Document artifactSpecificContent = null; - if (deployArt.getArtifactRef() != null) { - // try to dereference artifactReference - build references - final TArtifactTemplate artTemplate = - (TArtifactTemplate) toscaReferenceMapper.getJAXBReference(csarID, deployArt.getArtifactRef()); - - // list to store results - final List references = new ArrayList<>(); - - final ArtifactReferences artifactReferences = artTemplate.getArtifactReferences(); - if (artifactReferences != null && artifactReferences.getArtifactReference() != null) { - for (final TArtifactReference artifactReference : artifactReferences.getArtifactReference()) { - // checking if artifactReference has include - // patterns - if (artifactReference.getIncludeOrExclude() != null - && !artifactReference.getIncludeOrExclude().isEmpty()) { - for (final Object patternObj : artifactReference.getIncludeOrExclude()) { - if (patternObj instanceof TArtifactReference.Include) { - final TArtifactReference.Include includePattern = - (TArtifactReference.Include) patternObj; - references.add(artifactReference.getReference() + "/" - + includePattern.getPattern()); - } - } - } else { - references.add(artifactReference.getReference()); - } - } - } - - // set resulting list in return object - ra.setReferences(references); - } else { - artifactSpecificContent = - getArtifactSpecificContentOfADeploymentArtifact(csarID, nodeTemplateID, deployArt.getName()); - ra.setArtifactSpecificContent(artifactSpecificContent); - } - - // add to collection - resolvedDAs.add(ra); - } - - return resolvedDAs; - } - - /** - * resolves the Deployment-Artifacts of the given nodeTypeImplementationID (get - * ArtifactSpecificContent OR the reference from the ArtifactTemplate) - * - * @param csarID of the CSAR - * @param nodeTypeImplementationID of the nodeTypeImplementation - * @return List of ResolvedArtifact containing artifactSpecificContent or references. If no Artifact - * was found the returned list will be empty. - */ - private List getNodeTypeImplResolvedDAs(final CSARID csarID, - final QName nodeTypeImplementationID) { - final List resolvedDAs = new ArrayList<>(); - - LOG.debug("Trying to fetch DA of NodeTypeImplementation" + nodeTypeImplementationID.toString()); - - final TNodeTypeImplementation nodeTypeImplementation = - (TNodeTypeImplementation) toscaReferenceMapper.getJAXBReference(csarID, nodeTypeImplementationID); - - // check if there are implementationArtifact Entries - if (nodeTypeImplementation.getDeploymentArtifacts() == null - || nodeTypeImplementation.getDeploymentArtifacts().getDeploymentArtifact() == null) { - // return empty list - LOG.debug("NodeTypeImplementation " + nodeTypeImplementationID.toString() + " has no DeploymentArtifacts"); - return new ArrayList<>(); - } - - if (nodeTypeImplementation.getDeploymentArtifacts() != null) { - for (final TDeploymentArtifact deployArt : nodeTypeImplementation.getDeploymentArtifacts() - .getDeploymentArtifact()) { - final ResolvedDeploymentArtifact ra = new ResolvedDeploymentArtifact(); - ra.setName(deployArt.getName()); - ra.setType(deployArt.getArtifactType()); - - // we assume there is artifactSpecificContent OR a reference to - // an artifactTemplate - Document artifactSpecificContent = null; - if (deployArt.getArtifactRef() != null) { - // try to dereference artifactReference - build references - final TArtifactTemplate artTemplate = - (TArtifactTemplate) toscaReferenceMapper.getJAXBReference(csarID, deployArt.getArtifactRef()); - - // list to store results - final List references = new ArrayList<>(); - - final ArtifactReferences artifactReferences = artTemplate.getArtifactReferences(); - if (artifactReferences != null && artifactReferences.getArtifactReference() != null) { - for (final TArtifactReference artifactReference : artifactReferences.getArtifactReference()) { - // checking if artifactReference has include - // patterns - if (artifactReference.getIncludeOrExclude() != null - && !artifactReference.getIncludeOrExclude().isEmpty()) { - for (final Object patternObj : artifactReference.getIncludeOrExclude()) { - if (patternObj instanceof TArtifactReference.Include) { - final TArtifactReference.Include includePattern = - (TArtifactReference.Include) patternObj; - references.add(artifactReference.getReference() + "/" - + includePattern.getPattern()); - } - } - } else { - references.add(artifactReference.getReference()); - } - } - } - - // set resulting list in return object - ra.setReferences(references); - } else { - artifactSpecificContent = - getArtifactSpecificContentOfADeploymentArtifact(csarID, nodeTypeImplementationID, - deployArt.getName()); - ra.setArtifactSpecificContent(artifactSpecificContent); - } - - // add to collection - resolvedDAs.add(ra); - } - } - - return resolvedDAs; - } - - /** - * resolves the Deployment-Artifacts of the given nodeTypeImplementationID (get - * ArtifactSpecificContent OR the reference from the ArtifactTemplate) - * - * @param csarID of the CSAR - * @param nodeTypeImplementationID of the nodeTypeImplementation - * @return List of ResolvedArtifact containing artifactSpecificContent or references. If no Artifact - * was found the returned list will be empty. - */ - private List getNodeTypeImplResolvedIAs(final CSARID csarID, - final QName nodeTypeImplementationID) { - - final List resolvedIAs = new ArrayList<>(); - - final TNodeTypeImplementation nodeTypeImplementation = - (TNodeTypeImplementation) toscaReferenceMapper.getJAXBReference(csarID, nodeTypeImplementationID); - - // check if there are implementationArtifact Entries - if (nodeTypeImplementation.getImplementationArtifacts() == null - || nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact() == null) { - new ArrayList(); - } - - for (final TImplementationArtifact implArt : nodeTypeImplementation.getImplementationArtifacts() - .getImplementationArtifact()) { - final ResolvedImplementationArtifact ra = new ResolvedImplementationArtifact(); - - // fill operation and interface name - ra.setOperationName(implArt.getOperationName()); - ra.setInterfaceName(implArt.getInterfaceName()); - ra.setType(implArt.getArtifactType()); - // we assume there is artifactSpecificContent OR a reference to an - // artifactTemplate - Document artifactSpecificContent = null; - if (implArt.getArtifactRef() != null) { - // try to dereference artifactReference - build references - final TArtifactTemplate artTemplate = - (TArtifactTemplate) toscaReferenceMapper.getJAXBReference(csarID, implArt.getArtifactRef()); - - // list to store results - final List references = new ArrayList<>(); - - final ArtifactReferences artifactReferences = artTemplate.getArtifactReferences(); - if (artifactReferences != null && artifactReferences.getArtifactReference() != null) { - - for (final TArtifactReference artifactReference : artifactReferences.getArtifactReference()) { - // checking if artifactReference has include patterns - if (artifactReference.getIncludeOrExclude() != null - && !artifactReference.getIncludeOrExclude().isEmpty()) { - for (final Object patternObj : artifactReference.getIncludeOrExclude()) { - if (patternObj instanceof TArtifactReference.Include) { - final TArtifactReference.Include includePattern = - (TArtifactReference.Include) patternObj; - references.add(artifactReference.getReference() + "/" - + includePattern.getPattern()); - } - } - } else { - references.add(artifactReference.getReference()); - } - } - } - - // set resulting list in return object - ra.setReferences(references); - } else { - artifactSpecificContent = - getArtifactSpecificContentOfAImplementationArtifact(csarID, nodeTypeImplementationID, - implArt.getName()); - ra.setArtifactSpecificContent(artifactSpecificContent); - } - - // add to collection - resolvedIAs.add(ra); - } - return resolvedIAs; - } - - /** - * resolves the Deployment-Artifacts of the given nodeTypeImplementationID (get - * ArtifactSpecificContent OR the reference from the ArtifactTemplate) - * - * @param csarID of the CSAR - * @param nodeTypeImplementationID of the nodeTypeImplementation - * @return List of ResolvedArtifact containing artifactSpecificContent or references. If no Artifact - * was found the returned list will be empty. - */ - private List getRelationshipTypeImplResolvedIAs(final CSARID csarID, - final QName relationshipTypeImplementationID) { - final List resolvedIAs = new ArrayList<>(); - - final TRelationshipTypeImplementation relationshipTypeImplementation = - (TRelationshipTypeImplementation) toscaReferenceMapper.getJAXBReference(csarID, - relationshipTypeImplementationID); - - // check if there are implementationArtifact Entries - if (relationshipTypeImplementation.getImplementationArtifacts() == null - || relationshipTypeImplementation.getImplementationArtifacts().getImplementationArtifact() == null) { - new ArrayList(); - } - - for (final TImplementationArtifact implArt : relationshipTypeImplementation.getImplementationArtifacts() - .getImplementationArtifact()) { - final ResolvedImplementationArtifact ra = new ResolvedImplementationArtifact(); - - ra.setOperationName(implArt.getOperationName()); - ra.setInterfaceName(implArt.getInterfaceName()); - ra.setType(implArt.getArtifactType()); - // we assume there is artifactSpecificContent OR a reference to an - // artifactTemplate - Document artifactSpecificContent = null; - if (implArt.getArtifactRef() != null) { - // try to dereference artifactReference - build references - final TArtifactTemplate artTemplate = - (TArtifactTemplate) toscaReferenceMapper.getJAXBReference(csarID, implArt.getArtifactRef()); - - // list to store results - final List references = new ArrayList<>(); - - final ArtifactReferences artifactReferences = artTemplate.getArtifactReferences(); - if (artifactReferences != null && artifactReferences.getArtifactReference() != null) { - - for (final TArtifactReference artifactReference : artifactReferences.getArtifactReference()) { - // checking if artifactReference has include patterns - if (artifactReference.getIncludeOrExclude() != null - && !artifactReference.getIncludeOrExclude().isEmpty()) { - for (final Object patternObj : artifactReference.getIncludeOrExclude()) { - if (patternObj instanceof TArtifactReference.Include) { - final TArtifactReference.Include includePattern = - (TArtifactReference.Include) patternObj; - references.add(artifactReference.getReference() + "/" - + includePattern.getPattern()); - } - } - } else { - references.add(artifactReference.getReference()); - } - } - } - - // set resulting list in return object - ra.setReferences(references); - } else { - artifactSpecificContent = - getArtifactSpecificContentOfAImplementationArtifact(csarID, relationshipTypeImplementationID, - implArt.getName()); - ra.setArtifactSpecificContent(artifactSpecificContent); - } - - // add to collection - resolvedIAs.add(ra); - } - return resolvedIAs; - } - - @Override - public NodeTemplateInstanceCounts getInstanceCountsOfNodeTemplatesByServiceTemplateID(final CSARID csarID, - final QName serviceTemplateID) { - - // get the referenced ServiceTemplate - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarID, serviceTemplateID); - final List nodeTemplateOrRelationshipTemplate = - serviceTemplate.getTopologyTemplate().getNodeTemplateOrRelationshipTemplate(); - - // store nodeTemplates in own list so we dont alter the jaxb object - final List nodeTemplates = new ArrayList<>(); - for (final TEntityTemplate tEntityTemplate : nodeTemplateOrRelationshipTemplate) { - // only add it if its a nodeTemplate - if (tEntityTemplate instanceof TNodeTemplate) { - nodeTemplates.add((TNodeTemplate) tEntityTemplate); - } - } - - // construct result object (getMin and MaxInstance from JAXB and store - // them in result object) - final NodeTemplateInstanceCounts counts = new NodeTemplateInstanceCounts(); - for (final TNodeTemplate tNodeTemplate : nodeTemplates) { - final QName nodeTemplateQName = new QName(serviceTemplateID.getNamespaceURI(), tNodeTemplate.getId()); - final int minInstances = tNodeTemplate.getMinInstances(); - // in xml the maxInstances attribute is a String because it also can - // contain "unbounded" - final String maxInstances = tNodeTemplate.getMaxInstances(); - - counts.addInstanceCount(nodeTemplateQName, minInstances, maxInstances); - } - - return counts; - } - - @Override - /** - * {@inheritDoc} - */ - public String getPlanName(final CSARID csar, final QName planId) { - - LOG.trace("Resolve the absolute path of the PlanModelReference of plan \"" + planId + "\" inside of CSAR \"" - + csar + "\"."); - - final QName containingDefinitions = toscaReferenceMapper.getContainingDefinitionsID(csar, planId); - - if (null != containingDefinitions) { - - LOG.trace("Desired path to the PlanModel is inside the Definitions \"" + containingDefinitions + "\"."); - - final String definitionsLocation = toscaReferenceMapper.getDefinitionsLocation(csar, containingDefinitions); - - if (null != definitionsLocation) { - - LOG.trace("Definitions path is \"" + definitionsLocation + "\"."); - - final TPlan plan = (TPlan) toscaReferenceMapper.getJAXBReference(csar, planId); - return plan.getName(); - - } - } - - LOG.error("Not able to retrieve to plan name of " + planId.toString() + " inside of CSAR " + csar.toString()); - return null; - } - - @Override - /** - * {@inheritDoc} - */ - public AbstractArtifact getPlanModelReferenceAbstractArtifact(final CSARContent csar, final QName planId) { - - LOG.trace("Resolve the absolute path of the PlanModelReference of plan \"" + planId + "\" inside of CSAR \"" - + csar.getCSARID() + "\"."); - - final QName containingDefinitions = toscaReferenceMapper.getContainingDefinitionsID(csar.getCSARID(), planId); - - if (null != containingDefinitions) { - - LOG.trace("Desired path to the PlanModel is inside the Definitions \"" + containingDefinitions + "\"."); - - final String definitionsLocation = - toscaReferenceMapper.getDefinitionsLocation(csar.getCSARID(), containingDefinitions); - - if (null != definitionsLocation) { - - LOG.trace("Definitions path is \"" + definitionsLocation + "\"."); - - final TPlan plan = (TPlan) toscaReferenceMapper.getJAXBReference(csar.getCSARID(), planId); - final String planModelReferenceLocation = plan.getPlanModelReference().getReference(); - LOG.trace("planModelReferenceLocation: " + planModelReferenceLocation); - final String absoluteLocation = - PathResolver.resolveRelativePath(definitionsLocation, planModelReferenceLocation, csar); - - LOG.trace("Absolute path to the PlanModel is \"" + absoluteLocation + "\"."); - - try { - - final AbstractArtifact artifact = csar.resolveArtifactReference(absoluteLocation); - if (null != artifact) { - return artifact; - } - - } - catch (final UserException e) { - LOG.error(e.getLocalizedMessage()); - e.printStackTrace(); - } - catch (final SystemException e) { - LOG.error(e.getLocalizedMessage()); - e.printStackTrace(); - } - } - } - - LOG.error("There was an error while resolving the absolute path of the PlanModelReference of plan \"" + planId - + "\" inside of CSAR \"" + csar.getCSARID() + "\"."); - return null; - } - - @Override - /** - * {@inheritDoc} - */ - public List getArtifactReferenceWithinArtifactTemplate(final CSARID csarID, final QName artifactTemplate) { - - final Object obj = toscaReferenceMapper.getJAXBReference(csarID, artifactTemplate); - - if (obj != null) { - final TArtifactTemplate artifactTemplateObject = (TArtifactTemplate) obj; - - return artifactTemplateObject.getArtifactReferences().getArtifactReference().stream() - .map(ref -> ref.getReference()).collect(Collectors.toList()); - } - - return new ArrayList<>(); - } - - @Override - /** - * {@inheritDoc} - */ - public QName getArtifactTypeOfArtifactTemplate(final CSARID csarID, final QName artifactTemplate) { - - QName artifactType = null; - - final Object obj = toscaReferenceMapper.getJAXBReference(csarID, artifactTemplate); - - if (obj != null) { - final TArtifactTemplate artifactTemplateObject = (TArtifactTemplate) obj; - - artifactType = artifactTemplateObject.getType(); - - } - return artifactType; - } - - /** - * {@inheritDoc} - */ - @Override - public List getDeploymentArtifactNamesOfNodeTypeImplementation(final CSARID csarID, - final QName nodeTypeImplementationID) { - - final TNodeTypeImplementation nodeTypeImplementation = - (TNodeTypeImplementation) toscaReferenceMapper.getJAXBReference(csarID, nodeTypeImplementationID); - - // if there are ImplementationArtifacts, get the names - if (nodeTypeImplementation != null && nodeTypeImplementation.getDeploymentArtifacts() != null) { - - return nodeTypeImplementation.getDeploymentArtifacts().getDeploymentArtifact().stream() - .map(da -> da.getName()).collect(Collectors.toList()); - } - - return new ArrayList<>(); - } - - /** - * {@inheritDoc} - */ - @Override - public QName getArtifactTemplateOfADeploymentArtifactOfANodeTypeImplementation(final CSARID csarID, - final QName nodeTypeImplementationID, - final String deploymentArtifactName) { - - final TNodeTypeImplementation nodeTypeImplementation = - (TNodeTypeImplementation) toscaReferenceMapper.getJAXBReference(csarID, nodeTypeImplementationID); - - // if there are DeploymentArtifacts - if (nodeTypeImplementation != null && nodeTypeImplementation.getDeploymentArtifacts() != null) { - - return nodeTypeImplementation.getDeploymentArtifacts().getDeploymentArtifact().stream() - .filter(da -> da.getName().equals(deploymentArtifactName)).findFirst() - .map(da -> da.getArtifactRef()).orElse(null); - } - LOG.error("The requested ArtifactTemplate was not found."); - return null; - } - - @Override - public List getServiceTemplatesInCSAR(final CSARID csarID) { - return toscaReferenceMapper.getServiceTemplateIDsContainedInCSAR(csarID); - } - - @Override - public List getNodeTemplatesOfServiceTemplate(final CSARID csarID, final QName serviceTemplate) { - final Map> map = toscaReferenceMapper.getServiceTemplatesAndNodeTemplatesInCSAR(csarID); - if (map != null) { - return map.get(serviceTemplate); - } - return new ArrayList<>(); - } - - @Override - public List getRelationshipTemplatesOfServiceTemplate(final CSARID csarID, final QName serviceTemplate) { - final Map> map = toscaReferenceMapper.getServiceTemplate2RelationshipTemplateMap(csarID); - - if (map != null) { - return map.get(serviceTemplate); - } - - return new ArrayList<>(); - } - - @Override - public TBoundaryDefinitions getBoundaryDefinitionsOfServiceTemplate(final CSARID csarId, - final QName serviceTemplateId) { - // get the referenced ServiceTemplate - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarId, serviceTemplateId); - - return serviceTemplate.getBoundaryDefinitions(); - } - - @Override - public List getNodeTypeHierarchy(final CSARID csarID, final QName nodeType) { - final List qnames = new ArrayList<>(); - final TNodeType nodeTypeElement = (TNodeType) toscaReferenceMapper.getJAXBReference(csarID, nodeType); - - qnames.add(nodeType); - - if (nodeTypeElement.getDerivedFrom() != null && nodeTypeElement.getDerivedFrom().getTypeRef() != null) { - qnames.addAll(getNodeTypeHierarchy(csarID, nodeTypeElement.getDerivedFrom().getTypeRef())); - } - - return qnames; - } - - @Override - public List getNodeTypeImplementationTypeHierarchy(final CSARID csarID, - final QName nodeTypeImplementationId) { - final List qnames = new ArrayList<>(); - final TNodeTypeImplementation nodeTypeImplElement = - (TNodeTypeImplementation) toscaReferenceMapper.getJAXBReference(csarID, nodeTypeImplementationId); - - qnames.add(nodeTypeImplementationId); - - if (nodeTypeImplElement.getDerivedFrom() != null - && nodeTypeImplElement.getDerivedFrom().getNodeTypeImplementationRef() != null) { - qnames.addAll(getNodeTypeImplementationTypeHierarchy(csarID, - nodeTypeImplElement.getDerivedFrom() - .getNodeTypeImplementationRef())); - } - - return qnames; - } - - @Override - public List getNodeTemplateCapabilities(final CSARID csarId, final QName serviceTemplateId, - final String nodeTemplateId) { - final List caps = new ArrayList<>(); - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarId, serviceTemplateId); - - for (final TEntityTemplate entity : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - if (entity instanceof TNodeTemplate && entity.getId().equals(nodeTemplateId)) { - if (((TNodeTemplate) entity).getCapabilities() != null) { - for (final TCapability cap : ((TNodeTemplate) entity).getCapabilities().getCapability()) { - caps.add(new QName(serviceTemplate.getTargetNamespace(), cap.getId())); - } - } - } - } - - return caps; - } - - @Override - public List getNodeTemplateRequirements(final CSARID csarId, final QName serviceTemplateId, - final String nodeTemplateId) { - final List reqs = new ArrayList<>(); - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarId, serviceTemplateId); - - for (final TEntityTemplate entity : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - if (entity instanceof TNodeTemplate && entity.getId().equals(nodeTemplateId)) { - if (((TNodeTemplate) entity).getRequirements() != null) { - for (final TRequirement req : ((TNodeTemplate) entity).getRequirements().getRequirement()) { - reqs.add(new QName(serviceTemplate.getTargetNamespace(), req.getId())); - } - } - } - } - - return reqs; - } - - @Override - public QName getRelationshipTemplateTarget(final CSARID csarId, final QName serviceTemplateId, - final String relationshipTemplateId) { - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarId, serviceTemplateId); - - for (final TEntityTemplate entity : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - if (entity instanceof TRelationshipTemplate && entity.getId().equals(relationshipTemplateId)) { - if (((TRelationshipTemplate) entity).getTargetElement().getRef() instanceof TNodeTemplate) { - return new QName(serviceTemplate.getTargetNamespace(), - ((TNodeTemplate) ((TRelationshipTemplate) entity).getTargetElement().getRef()).getId()); - } - if (((TRelationshipTemplate) entity).getTargetElement().getRef() instanceof TCapability) { - final TCapability cap = (TCapability) ((TRelationshipTemplate) entity).getTargetElement().getRef(); - - if (resolveNodeTemplateFromCapability(csarId, serviceTemplateId, cap.getId()) != null) { - return new QName(serviceTemplate.getTargetNamespace(), - resolveNodeTemplateFromCapability(csarId, serviceTemplateId, cap.getId()).getId()); - } - - } - } - } - - return null; - } - - @Override - public QName getRelationshipTemplateSource(final CSARID csarId, final QName serviceTemplateId, - final String relationshipTemplateId) { - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarId, serviceTemplateId); - for (final TEntityTemplate entity : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - if (entity instanceof TRelationshipTemplate && entity.getId().equals(relationshipTemplateId)) { - if (((TRelationshipTemplate) entity).getSourceElement().getRef() instanceof TNodeTemplate) { - return new QName(serviceTemplate.getTargetNamespace(), - ((TNodeTemplate) ((TRelationshipTemplate) entity).getSourceElement().getRef()).getId()); - } - if (((TRelationshipTemplate) entity).getSourceElement().getRef() instanceof TRequirement) { - final TRequirement req = - (TRequirement) ((TRelationshipTemplate) entity).getSourceElement().getRef(); - // resolve requirement to nodeTemplate - - if (resolveNodeTemplateFromRequirement(csarId, serviceTemplateId, req.getId()) != null) { - return new QName(serviceTemplate.getTargetNamespace(), - resolveNodeTemplateFromRequirement(csarId, serviceTemplateId, req.getId()).getId()); - } - } - } - } - return null; - } - - private TNodeTemplate resolveNodeTemplateFromCapability(final CSARID csarId, final QName serviceTemplateId, - final String capabilityId) { - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarId, serviceTemplateId); - - for (final TEntityTemplate entity : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - if (entity instanceof TNodeTemplate) { - final TNodeTemplate nodeTemplate = (TNodeTemplate) entity; - - if (nodeTemplate.getCapabilities() != null) { - for (final TCapability req : nodeTemplate.getCapabilities().getCapability()) { - if (req.getId().equals(capabilityId)) { - return nodeTemplate; - } - } - } - } - } - - return null; - } - - private TNodeTemplate resolveNodeTemplateFromRequirement(final CSARID csarId, final QName serviceTemplateId, - final String requirementId) { - final TServiceTemplate serviceTemplate = - (TServiceTemplate) toscaReferenceMapper.getJAXBReference(csarId, serviceTemplateId); - - for (final TEntityTemplate entity : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - if (entity instanceof TNodeTemplate) { - final TNodeTemplate nodeTemplate = (TNodeTemplate) entity; - - if (nodeTemplate.getRequirements() != null) { - for (final TRequirement req : nodeTemplate.getRequirements().getRequirement()) { - if (req.getId().equals(requirementId)) { - return nodeTemplate; - } - } - } - } - } - - - return null; - } - - @Override - public List getInterfaceNamesOfNodeType(final CSARID csarID, final QName nodeTypeID) { - - final Set interfaceNames = new HashSet<>(); - - for (final QName nodeTypeHierarchyMember : getNodeTypeHierarchy(csarID, nodeTypeID)) { - - final TNodeType nodeType = - (TNodeType) toscaReferenceMapper.getJAXBReference(csarID, nodeTypeHierarchyMember); - - if (nodeType.getInterfaces() != null) { - - for (final TInterface iface : nodeType.getInterfaces().getInterface()) { - interfaceNames.add(iface.getName()); - } - } - } - - return Lists.newArrayList(interfaceNames); - } - - @Override - public List getOperationNamesOfNodeTypeInterface(final CSARID csarId, final QName nodeTypeId, - final String interfaceName) { - final Set operationNames = new HashSet<>(); - - for (final QName nodeTypeHierarchyMember : getNodeTypeHierarchy(csarId, nodeTypeId)) { - - final TNodeType nodeType = - (TNodeType) toscaReferenceMapper.getJAXBReference(csarId, nodeTypeHierarchyMember); - - if (nodeType.getInterfaces() != null) { - - for (final TInterface iface : nodeType.getInterfaces().getInterface()) { - - if (iface.getName().equals(interfaceName)) { - for (final TOperation op : iface.getOperation()) { - operationNames.add(op.getName()); - } - } - - } - } - } - - - return Lists.newArrayList(operationNames); - } - - @Override - public List getInputParametersOfTypeOperation(final CSARID csarID, final QName typeId, - final String interfaceName, final String operationName) { - return parseParameters(getInputParametersOfATypeOperation(csarID, typeId, interfaceName, operationName)); - } - - @Override - public List getOutputParametersOfTypeOperation(final CSARID csarID, final QName typeId, - final String interfaceName, final String operationName) { - return parseParameters(getOutputParametersOfATypeOperation(csarID, typeId, interfaceName, operationName)); - } - - private List parseParameters(final Node node) { - - final List params = new ArrayList<>(); - if (node != null) { - - final NodeList definedInputParameterList = node.getChildNodes(); - - for (int i = 0; i < definedInputParameterList.getLength(); i++) { - - final Node currentNode = definedInputParameterList.item(i); - - if (currentNode.getNodeType() == Node.ELEMENT_NODE) { - - final String name = ((Element) currentNode).getAttribute("name"); - - params.add(name); - - } - } - } - - return params; - } - - /** - * Retrieve all ImplementationArtifacts for a given NodeTypeImplementation or - * RelationshipTypeImplementation and return the one that matches the given name. - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the ImplementationArtifact. - * @param implementationArtifactName of the ImplementationArtifact - * @return An Optional containing the ImplementationArtifact if found, an empty Optional otherwise. - */ - private Optional getImplementationArtifactForName(final CSARID csarID, - final QName typeImplementationID, - final String implementationArtifactName) { - - LOG.warn("Searching IA " + implementationArtifactName); - - return getIAsOfType(csarID, typeImplementationID).stream() - .filter((ia) -> ia.getName() - .equals(implementationArtifactName)) - .findFirst(); - } - - /** - * Return all ImplementationArtifacts for a given NodeTypeImplementation or - * RelationshipTypeImplementation - * - * @param csarID of the CSAR containing the NodeTypeImplementation or - * RelationshipTypeImplementation. - * @param typeImplementationID of the NodeTypeImplementation or RelationshipTypeImplementation - * containing the ImplementationArtifacts. - * @return List with all ImplementationArtifacts for the given type. - */ - private List getIAsOfType(final CSARID csarID, final QName typeImplementationID) { - - final Object typeImplementation = toscaReferenceMapper.getJAXBReference(csarID, typeImplementationID); - - if (typeImplementation instanceof TNodeTypeImplementation) { - - return getNodeTypeImplementationTypeHierarchy(csarID, - typeImplementationID).stream() - .map(qname -> (TNodeTypeImplementation) toscaReferenceMapper.getJAXBReference(csarID, - qname)) - .filter(impl -> impl != null - && impl.getImplementationArtifacts() != null - && impl.getImplementationArtifacts() - .getImplementationArtifact() != null && impl.getName() != null) - .flatMap(impl -> impl.getImplementationArtifacts() - .getImplementationArtifact() - .stream()) - .collect(Collectors.toList()); - } else if (typeImplementation instanceof TRelationshipTypeImplementation) { - - return Stream.of((TRelationshipTypeImplementation) typeImplementation) - .filter((impl) -> impl != null && impl.getImplementationArtifacts() != null - && impl.getImplementationArtifacts().getImplementationArtifact() != null) - .flatMap((impl) -> impl.getImplementationArtifacts().getImplementationArtifact().stream()) - .collect(Collectors.toList()); - } else { - LOG.warn("Given typeImplementationID does not identifiy a NodeTypeImplementation or RelationshipTypeImplementation: {}", - typeImplementationID); - return new ArrayList<>(); - } - } - - /** - * Get the TOperation object for a given interface and operation name from a list of interfaces. - * - * @param ifaces the List of interfaces - * @param interfaceName the name of the interface of the operation - * @param operationName the name of the operation - * @return An Optional containing the TOperation object if one was found with the given properties, - * an empty Optional otherwise. - */ - private Optional getOperationFromInterfaces(final List ifaces, final String interfaceName, - final String operationName) { - - return ifaces.stream().filter((iface) -> (interfaceName == null || iface.getName().equals(interfaceName))) - .flatMap((iface) -> iface.getOperation().stream()) - .filter((op) -> op.getName().equals(operationName)).findFirst(); - } - - /** - * Get a TOperation object for a NodeType or RelationshipType which has the given ID and is part of - * the given CSAR. The operation must have the given name and either a null interface or an - * interface with a matching name. The filter parameter allows to further track down a certain - * operation. It can e.g. be used to search only for operations with a defined input parameter list. - * - * @param csarID the ID of the CSAR in which the NodeType or RelationshipType is defined - * @param typeID the ID of the NodeType or RelationshipType - * @param interfaceName the name of the interface in which the operation is located. Can be - * null if the operation name is unique in the Type. - * @param operationName the name of the searched operation - * @param operationFilter a filter to limit the result - * @return An Optional containing the found operation, if one is found or an empty Optional - * otherwise. - */ - private Optional getOperationForType(final CSARID csarID, final QName typeID, - final String interfaceName, final String operationName, - final Predicate operationFilter) { - - final Object type = toscaReferenceMapper.getJAXBReference(csarID, typeID); - - if (type instanceof TNodeType) { - - return getNodeTypeHierarchy(csarID, - typeID).stream() - .map(qname -> (TNodeType) toscaReferenceMapper.getJAXBReference(csarID, - qname)) - .filter((nt) -> nt != null && nt.getInterfaces() != null) - .map((nt) -> getOperationFromInterfaces(nt.getInterfaces() - .getInterface(), - interfaceName, operationName)) - .filter(Optional::isPresent).map(Optional::get).filter(operationFilter) - .findFirst(); - - } else if (type instanceof TRelationshipType) { - - final TRelationshipType relationshipType = (TRelationshipType) type; - - return Stream.of(Optional.ofNullable(relationshipType.getSourceInterfaces()).map(i -> i.getInterface()), - Optional.ofNullable(relationshipType.getTargetInterfaces()).map(i -> i.getInterface())) - .filter(ol -> ol.isPresent()).map((ol) -> ol.get()) - .map(interfaces -> getOperationFromInterfaces(interfaces, interfaceName, operationName)) - .filter(Optional::isPresent).map(Optional::get).filter(operationFilter).findFirst(); - } else { - LOG.warn("Given typeID does not identifiy a NodeType or RelationshipType: {}", typeID); - return Optional.empty(); - } - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ToscaReferenceMapper.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ToscaReferenceMapper.java deleted file mode 100644 index 2a8dd420c..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/ToscaReferenceMapper.java +++ /dev/null @@ -1,1345 +0,0 @@ -package org.opentosca.container.core.engine.impl; - -import java.io.StringReader; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.JAXB; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.IToscaReferenceMapper; -import org.opentosca.container.core.engine.xml.IXMLSerializerService; -import org.opentosca.container.core.mapping.CSARIDToDefinitionsMap; -import org.opentosca.container.core.mapping.CSARIDToServiceTemplateIDsMap; -import org.opentosca.container.core.mapping.CsarIDToPlanTypeToPlanNameToPlan; -import org.opentosca.container.core.mapping.CsarIDToPolicies; -import org.opentosca.container.core.mapping.CsarIDToServiceTemplateIDToPlanID; -import org.opentosca.container.core.mapping.CsarIDToWSDLDocuments; -import org.opentosca.container.core.mapping.DocumentMap; -import org.opentosca.container.core.mapping.MapQNameNode; -import org.opentosca.container.core.mapping.ReferenceMap; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Policies; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Properties; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Properties.PropertyMappings; -import org.opentosca.container.core.tosca.model.TDefinitions; -import org.opentosca.container.core.tosca.model.TExportedInterface; -import org.opentosca.container.core.tosca.model.TExportedOperation; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPolicy; -import org.opentosca.container.core.tosca.model.TPropertyMapping; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -/** - * The ToscaReferenceMapper provides the functionality of a library for DOM Nodes. These Nodes are - * referenced informations of TOSCA files. They are stored as a pair of a QName and the Node itself. - * The QName is the one with which the Node is referenced inside of a TOSCA document. But not only - * TOSCA elements are stored as Node, but also elements of XML Schema or WSDL and so on. Nodes of - * TOSCA can be retrieved as JAXB objects aswell. - * - * @au Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - * - */ -public class ToscaReferenceMapper implements IToscaReferenceMapper { - - // services - private static IXMLSerializerService xmlSerializerService; - - // logger - private final Logger LOG = LoggerFactory.getLogger(ToscaReferenceMapper.class); - - // internal data structures - private ReferenceMap referenceMap; - private DocumentMap documentMap; - private CSARIDToDefinitionsMap mapCSARIDToDefinitions; - private CSARIDToServiceTemplateIDsMap mapCSARIDToServiceTemplateIDs; - private static CsarIDToPlanTypeToPlanNameToPlan csarIDToPlanTypeToIntegerToPlan; - private CsarIDToWSDLDocuments csarIDToWSDLDocuments; - private CsarIDToServiceTemplateIDToPlanID csarIDToServiceTemplateIDToPlanID; - private final Map> csarIDToPlanIDToSynchronousBoolean = new HashMap<>(); - private final Map>> csarIDToExportedInterface = new HashMap<>(); - private final CsarIDToPolicies csarIDToPolicies = new CsarIDToPolicies(); - private final Map> mapDefinitionsIDToLocationString = new HashMap<>(); - private final Map> mapElementIDToDefinitionsID = new HashMap<>(); - private final Map> mapCSARIDToPlanIDToInputMessageID = new HashMap<>(); - - private final Map>>> mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan = - new HashMap<>(); - - private final Map> mapCSARIDToPlanNameToNamespace = new HashMap<>(); - - private final Map>> mapCSARIDToServiceTemplateQNameToNodeTemplateID = - new HashMap<>(); - - private final Map>> mapCSARIDToServiceTemplateQNameToRelationshipTemplateID = - new HashMap<>(); - - private final Map> serviceTemplatePropertiesContent = new HashMap<>(); - private final Map> serviceTemplatePropertyMappings = new HashMap<>(); - - - public ToscaReferenceMapper() { - setup(); - } - - /** - * This function deletes all stored references of a certain CSAR. - * - * @param csarID - * @return true for success, false for an error - */ - public boolean clearCSARContent(final CSARID csarID) { - - this.LOG.debug("Delete the content of \"" + csarID + "\"."); - - setup(); - this.referenceMap.remove(csarID); - this.documentMap.remove(csarID); - this.mapCSARIDToDefinitions.remove(csarID); - this.mapCSARIDToServiceTemplateIDs.remove(csarID); - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.remove(csarID); - this.csarIDToWSDLDocuments.remove(csarID); - this.csarIDToServiceTemplateIDToPlanID.remove(csarID); - this.csarIDToPlanIDToSynchronousBoolean.remove(csarID); - this.csarIDToExportedInterface.remove(csarID); - this.csarIDToPolicies.remove(csarID); - this.mapDefinitionsIDToLocationString.remove(csarID); - this.mapElementIDToDefinitionsID.remove(csarID); - this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.remove(csarID); - this.mapCSARIDToServiceTemplateQNameToNodeTemplateID.remove(csarID); - this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.remove(csarID); - this.serviceTemplatePropertiesContent.remove(csarID); - this.serviceTemplatePropertyMappings.remove(csarID); - - if (containsCSARData(csarID)) { - return false; - } - return true; - - } - - /** - * {@inheritDoc} - */ - @Override - public TBoundaryDefinitions.Policies getPolicies(final CSARID csarID, final QName templateID) { - return this.csarIDToPolicies.get(csarID, templateID); - } - - /** - * {@inheritDoc} - */ - @Override - public void storeConsolidatedPolicies(final CSARID csarID, final QName templateID, final Policies policies) { - this.csarIDToPolicies.put(csarID, templateID, policies); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean containsCSARData(final CSARID csarID) { - setup(); - - boolean found = false; - - if (this.referenceMap.containsKey(csarID)) { - this.LOG.trace("Inside of the referenceMap are informations stored"); - found = true; - } - if (this.documentMap.containsKey(csarID)) { - this.LOG.trace("Inside of the documentMap are informations stored"); - found = true; - } - if (this.mapCSARIDToDefinitions.containsKey(csarID)) { - this.LOG.trace("Inside of the mapCSARIDToDefinitions are informations stored"); - found = true; - } - if (this.mapCSARIDToServiceTemplateIDs.containsKey(csarID)) { - this.LOG.trace("Inside of the mapCSARIDToServiceTemplateIDs are informations stored"); - found = true; - } - if (ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.containsKey(csarID)) { - this.LOG.trace("Inside of the csarIDToPlanTypeToIntegerToPublicPlan are informations stored"); - found = true; - } - if (this.csarIDToWSDLDocuments.containsKey(csarID)) { - this.LOG.trace("Inside of the csarIDToWSDLDocuments are informations stored"); - found = true; - } - if (this.csarIDToServiceTemplateIDToPlanID.containsKey(csarID)) { - this.LOG.trace("Inside of the csarIDToServiceTemplateIDToPlanID are informations stored"); - found = true; - } - if (this.csarIDToPlanIDToSynchronousBoolean.containsKey(csarID)) { - this.LOG.trace("Inside of the csarIDToPlanIDToSynchronousBoolean are informations stored"); - found = true; - } - if (this.csarIDToExportedInterface.containsKey(csarID)) { - this.LOG.trace("Inside of the csarIDToExportedInterface are informations stored"); - found = true; - } - if (this.csarIDToPolicies.containsKey(csarID)) { - this.LOG.trace("Inside of the csarIDToConsolidatedPolicies are informations stored"); - found = true; - } - return found; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean containsReferenceInsideCSAR(final CSARID csarID, final QName reference) { - setup(); - if (containsCSARData(csarID)) { - if (this.referenceMap.get(csarID).containsKey(reference)) { - return true; - } - } - return false; - } - - @Override - public Map> getCSARIDToPlans(final CSARID csarID) { - - if (null == ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan) { - this.LOG.error("The variable is null."); - } - if (!ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.containsKey(csarID)) { - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.put(csarID, - new HashMap>()); - } - if (!ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).containsKey(PlanTypes.BUILD)) { - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).put(PlanTypes.BUILD, - new LinkedHashMap()); - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).put(PlanTypes.TERMINATION, - new LinkedHashMap()); - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).put(PlanTypes.OTHERMANAGEMENT, - new LinkedHashMap()); - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).put(PlanTypes.APPLICATION, - new LinkedHashMap()); - } - - return ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID); - } - - /** - * {@inheritDoc} - */ - @Override - public List getDefinitionIDsOfCSAR(final CSARID csarID) { - setup(); - - final List listOfIDs = new ArrayList<>(); - - if (this.mapCSARIDToDefinitions.containsKey(csarID)) { - - for (final TDefinitions def : this.mapCSARIDToDefinitions.get(csarID)) { - - listOfIDs.add(new QName(def.getTargetNamespace(), def.getId())); - - } - - } else { - this.LOG.error("There are no Definitions stored for the CSAR \"" + csarID + "\"."); - } - - return listOfIDs; - } - - /** - * {@inheritDoc} - */ - @Override - public List getDefinitionsOfCSAR(final CSARID csarID) { - setup(); - if (this.mapCSARIDToDefinitions.containsKey(csarID)) { - return this.mapCSARIDToDefinitions.get(csarID); - } else { - this.LOG.error("There are no Definitions stored for the CSAR \"" + csarID + "\"."); - } - - return null; - } - - /** - * {@inheritDoc} - */ - @Override - @Deprecated - public Document getDOMDocumentForReference(final CSARID csarID, final QName reference) { - setup(); - if (this.documentMap.containsKey(csarID)) { - - // The passed ID of a CSAR is found. - final Map referenceToDocumentForSpecificCSAR = this.documentMap.get(csarID); - if (referenceToDocumentForSpecificCSAR.containsKey(reference)) { - // The passed reference is found. - return referenceToDocumentForSpecificCSAR.get(reference); - } else { - this.LOG.error("No stored reference for CSAR \"" + csarID + "\" and \"" + reference + "\" found."); - } - } else { - this.LOG.error("No stored document references for CSAR \"" + csarID + "\" found."); - } - - // nothing found - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public Map> getExportedInterfacesOfCSAR(final CSARID csarID) { - if (this.csarIDToExportedInterface.containsKey(csarID)) { - return this.csarIDToExportedInterface.get(csarID); - } else { - return new HashMap<>(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public Object getReferenceAsNode(final CSARID csarID, final QName nodeID) { - setup(); - - this.LOG.debug("Lookup for the node \"" + nodeID + "\" inside of the CSAR \"" + csarID + "\"."); - - if (this.referenceMap.containsKey(csarID)) { - - // The passed ID of a CSAR is found. - // this.LOG.info("References for the CSAR with the QName \"" + - // csarID.toString() + "\" found."); - if (this.referenceMap.get(csarID).containsKey(nodeID)) { - - // The passed reference is found. - // this.LOG.info("Reference with the QName \"" + - // nodeID.toString() + "\" found."); - return this.referenceMap.get(csarID).get(nodeID); - } - } - - this.LOG.error("There is no Node stored for CSAR \"" + csarID + "\" and reference \"" + nodeID + "\"."); - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public Object getJAXBReference(final CSARID csarID, final QName nodeID) { - setup(); - - this.LOG.debug("Lookup for the node \"" + nodeID + "\" inside of the CSAR \"" + csarID + "\"."); - - if (this.referenceMap.containsKey(csarID)) { - - // The passed ID of a CSAR is found. - // this.LOG.info("References for the CSAR with the QName \"" + - // csarID.toString() + "\" found."); - if (this.referenceMap.get(csarID).containsKey(nodeID)) { - - // The passed reference is found. - // this.LOG.info("Reference with the QName \"" + - // nodeID.toString() + "\" found."); - final Node node = this.referenceMap.get(csarID).get(nodeID); - - if (AvailableToscaElements.getElementName(node.getLocalName()).getElementClass() != null) { - // The name of the node implies that is marshalable into one - // of the JAXB classes of TOSCA. - return ToscaReferenceMapper.xmlSerializerService.getXmlSerializer() - .unmarshal(node, - AvailableToscaElements.getElementName(node.getLocalName()) - .getElementClass()); - } else { - this.LOG.error("The reference is not a JAXB element."); - } - - } else { - this.LOG.error("Reference with the QName \"" + nodeID.toString() + "\" was not found for the CSAR \"" - + csarID + "\"."); - } - } else { - this.LOG.error("No references for the CSAR with the QName \"" + csarID.toString() + "\" found."); - } - - return null; - } - - public List getListOfWSDLForCSAR(final CSARID csarID) { - if (this.csarIDToWSDLDocuments.containsKey(csarID)) { - return this.csarIDToWSDLDocuments.get(csarID); - } - return new ArrayList<>(); - } - - @Override - public Map>> getMapCsarIDToServiceTemplateIDToPlanID() { - return this.csarIDToServiceTemplateIDToPlanID; - } - - /** - * Returns a PublicPlan if found. - * - * @param csarID - * @param planID - * @return the PublicPlan if found, null instead. - */ - @Override - public TPlan getPlanForCSARIDAndPlanID(final CSARID csarID, final QName planID) { - - if (!ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.containsKey(csarID)) { - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.put(csarID, - new HashMap>()); - } - if (!ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).containsKey(PlanTypes.BUILD)) { - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).put(PlanTypes.BUILD, - new LinkedHashMap()); - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).put(PlanTypes.TERMINATION, - new LinkedHashMap()); - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).put(PlanTypes.OTHERMANAGEMENT, - new LinkedHashMap()); - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).put(PlanTypes.APPLICATION, - new LinkedHashMap()); - } - - for (final PlanTypes type : ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).keySet()) { - for (final QName planName : ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).get(type) - .keySet()) { - final TPlan plan = - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).get(type).get(planName); - if (plan.getId().equals(planID.getLocalPart())) { - return plan; - } - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public List getServiceTemplateIDsContainedInCSAR(final CSARID csarID) { - setup(); - return this.mapCSARIDToServiceTemplateIDs.get(csarID); - } - - @Override - public Boolean isPlanAsynchronous(final CSARID csarID, final QName planID) { - if (null == this.csarIDToPlanIDToSynchronousBoolean.get(csarID) - || null == this.csarIDToPlanIDToSynchronousBoolean.get(csarID).get(planID)) { - this.LOG.error("There is no information stored about the plan " + planID + " of CSAR " + csarID - + " is synchronous or asynchronous. Thus return null."); - return null; - } else { - return this.csarIDToPlanIDToSynchronousBoolean.get(csarID).get(planID); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void printStoredData() { - setup(); - String string = ""; - final String ls = System.getProperty("line.separator"); - - final StringBuilder builder = new StringBuilder(); - - builder.append("Debug output of the stored data of the TOSCA resolving." + ls); - - if (null == this.referenceMap.keySet() || this.referenceMap.keySet().size() == 0) { - builder.append("No data about CSARs stored yet."); - this.LOG.debug(builder.toString()); - return; - } - - for (final CSARID csarID : this.referenceMap.keySet()) { - - builder.append(ls + "Print all stored references of \"" + csarID + "\"." + ls); - for (final QName ref : this.referenceMap.get(csarID).keySet()) { - - if (this.referenceMap.get(csarID).get(ref) == null) { - builder.append("ERROR: There is no data stored for the reference \"" + ref + "\"." + ls); - } else { - string = - ToscaReferenceMapper.xmlSerializerService.getXmlSerializer() - .docToString(this.referenceMap.get(csarID).get(ref), - true); - string = string.replace(ls, ""); - builder.append(" " + ref + " --> " + string + ls); - } - } - - if (this.documentMap.containsKey(csarID)) { - builder.append(ls + "Print all stored documents of \"" + csarID + "\"." + ls); - for (final QName ref : this.documentMap.get(csarID).keySet()) { - - if (this.documentMap.get(csarID).get(ref) == null) { - builder.append("ERROR: There is no data stored for the reference \"" + ref + "\"." + ls); - } else { - string = - ToscaReferenceMapper.xmlSerializerService.getXmlSerializer() - .docToString(this.documentMap.get(csarID).get(ref), - true); - string = string.replace(ls, ""); - builder.append(" " + ref + " --> " + string + ls); - } - } - } else { - builder.append("ERROR: There is no document stored for \"" + csarID + "\"." + ls); - } - - builder.append(ls + "Print all due the BoundaryDefinitions defined PublicPlans" + ls); - for (final PlanTypes type : ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).keySet()) { - builder.append(" type: " + type + ls); - for (final QName planID : ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).get(type) - .keySet()) { - final TPlan pp = - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan.get(csarID).get(type).get(planID); - builder.append(" name: " + planID + " PublicPlan QName: " + pp.getId() + ls); - } - } - - builder.append(ls + "Print all stored plan IDs of this CSAR:" + ls); - if (null != this.csarIDToServiceTemplateIDToPlanID.get(csarID)) { - for (final QName serviceTemplateID : this.csarIDToServiceTemplateIDToPlanID.get(csarID).keySet()) { - for (final QName planID : this.csarIDToServiceTemplateIDToPlanID.get(csarID) - .get(serviceTemplateID)) { - builder.append(" Plan \"" + planID + "\" is inside of ServiceTemplate \"" - + serviceTemplateID + "\"" + ls); - } - } - } else { - builder.append(" nothing found ..." + ls); - } - - builder.append(ls - + "Print all stored informations about synchronous (false) and asynchronous (true) plans of CSAR \"" - + csarID + "\":" + ls); - if (null != this.csarIDToPlanIDToSynchronousBoolean.get(csarID)) { - for (final QName planID : this.csarIDToPlanIDToSynchronousBoolean.get(csarID).keySet()) { - builder.append(" Plan \"" + planID + "\" is asynchronous? " - + this.csarIDToPlanIDToSynchronousBoolean.get(csarID).get(planID) + ls); - } - } - - JAXBContext context; - Marshaller marshaller = null; - final StringWriter writer = new StringWriter(); - try { - context = JAXBContext.newInstance(TPolicy.class); - marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - } - catch (final JAXBException e) { - e.printStackTrace(); - } - - builder.append(ls + "Print list of the mapping of a TemplateID to Consolidated Policies" + ls); - for (final QName templateID : this.csarIDToPolicies.getTemplateIDs(csarID)) { - final TBoundaryDefinitions.Policies pols = this.csarIDToPolicies.get(csarID, templateID); - builder.append(" " + templateID + " mapps to following policies." + ls); - for (final TPolicy pol : pols.getPolicy()) { - builder.append(" policy name=\"" + pol.getName() + "\""); - try { - marshaller.marshal(pol, writer); - builder.append(" --> " + writer.toString().replaceAll("\\n|\\r", "")); - } - catch (final JAXBException e) { - e.printStackTrace(); - - // FIXME: (miwurster; 2018-03-08) Not sure if we can ignore this, but we get an exception here - // if TPolicy is tried to be - // serialized. Anyhow, such exceptions are not handled, so I assume the stack trace print is not - // necessary. - // e.printStackTrace(); - } - builder.append(ls); - // builder.append(" name=\"" + pol.getName() + - // "\" type=\"" + pol.getType() + "\" language=\"" + - // pol.getPolicyLanguage() + "\"" + ls); - // builder.append(" properties: " + - // xmlSerializerService.getXmlSerializer().docToString((Node) - // pol.getProperties().getAny(), true) + ls); - // builder.append(" specific content: todo: serialize to - // string" - // + ls); - } - } - - if (this.mapDefinitionsIDToLocationString.containsKey(csarID)) { - builder.append(ls + "Print map of TOSCA Definitions locations." + ls); - for (final QName defID : this.mapDefinitionsIDToLocationString.get(csarID).keySet()) { - builder.append(" " + defID + " is stored at \"" - + this.mapDefinitionsIDToLocationString.get(csarID).get(defID).replace("\\", "/") + "\"" + ls); - } - } - - if (this.mapElementIDToDefinitionsID.containsKey(csarID)) { - builder.append(ls + "Print map of TOSCA element IDs to Definitions ID." + ls); - for (final QName eleID : this.mapElementIDToDefinitionsID.get(csarID).keySet()) { - builder.append(" " + eleID + " is contained in Definitions \"" - + this.mapElementIDToDefinitionsID.get(csarID).get(eleID) + "\"" + ls); - } - } - - } - - this.LOG.debug(builder.toString()); - - } - - /** - * This method initializes the data structures in which the the DOM Nodes and Documents are stored - * if not done already. - */ - private void setup() { - if (this.referenceMap == null) { - this.referenceMap = new ReferenceMap(); - } - if (this.documentMap == null) { - this.documentMap = new DocumentMap(); - } - if (this.mapCSARIDToDefinitions == null) { - this.mapCSARIDToDefinitions = new CSARIDToDefinitionsMap(); - } - if (this.mapCSARIDToServiceTemplateIDs == null) { - this.mapCSARIDToServiceTemplateIDs = new CSARIDToServiceTemplateIDsMap(); - } - if (null == ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan) { - ToscaReferenceMapper.csarIDToPlanTypeToIntegerToPlan = new CsarIDToPlanTypeToPlanNameToPlan(); - } - if (null == this.csarIDToWSDLDocuments) { - this.csarIDToWSDLDocuments = new CsarIDToWSDLDocuments(); - } - if (null == this.csarIDToServiceTemplateIDToPlanID) { - this.csarIDToServiceTemplateIDToPlanID = new CsarIDToServiceTemplateIDToPlanID(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void storeDefinitions(final CSARID csarID, final TDefinitions definitions) { - setup(); - if (csarID != null && definitions != null) { - - final QName reference = new QName(definitions.getTargetNamespace(), definitions.getId()); - this.LOG.debug("Store the Definitions \"" + reference + "\"."); - - // store it in the Definitions map - if (!this.mapCSARIDToDefinitions.containsKey(csarID)) { - this.mapCSARIDToDefinitions.put(csarID, new ArrayList()); - } - this.mapCSARIDToDefinitions.get(csarID).add(definitions); - // this.mapCSARIDToDefinitions.save(); // Persist definitions. - // TDefinitions + subclasses need to be serializable - - // store it in the references map - if (!this.referenceMap.containsKey(csarID)) { - this.referenceMap.put(csarID, new MapQNameNode()); - } - this.referenceMap.get(csarID) - .put(reference, - ServiceHandler.xmlSerializerService.getXmlSerializer().marshalToNode(definitions)); - - } else { - this.LOG.error("An error has occured."); - } - - } - - /** - * This method stores a DOM document and its QName for a certain CSAR. - * - * @param csarID ID of the CSAR in which the document is referenced. - * @param documentID ID of the document. - * @param doc DOM document which shall be stored. - * @return true means no error, false means one or more errors - */ - @Override - public void storeDocument(final CSARID csarID, final QName documentID, final Document doc) { - setup(); - - if (csarID == null) { - this.LOG.error("The CSARID is null!"); - return; - } - if (documentID == null) { - this.LOG.error("The document ID is null!"); - return; - } - if (doc == null) { - this.LOG.error("The document is null!"); - return; - } - - this.LOG.debug("Store new document reference for CSAR \"" + csarID + "\" the reference \"" + documentID - + "\"."); - - if (!this.documentMap.containsKey(csarID)) { - this.documentMap.put(csarID, new HashMap()); - } - - if (this.documentMap.get(csarID).containsKey(documentID)) { - this.LOG.debug("The reference with the QName \"" + documentID.toString() - + "\" is already stored for the CSAR \"" + csarID + "\"."); - } else { - this.documentMap.get(csarID).put(documentID, doc); - this.LOG.debug("Storing of Document \"" + documentID.toString() + "\" completed."); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void storeExportedInterface(final CSARID csarID, final QName serviceTemplateID, - final TExportedInterface iface) { - if (!this.csarIDToExportedInterface.containsKey(csarID)) { - this.csarIDToExportedInterface.put(csarID, new HashMap>()); - } - if (!this.csarIDToExportedInterface.get(csarID).containsKey(serviceTemplateID)) { - this.csarIDToExportedInterface.get(csarID).put(serviceTemplateID, new ArrayList()); - } - this.csarIDToExportedInterface.get(csarID).get(serviceTemplateID).add(iface); - } - - /** - * Converts to DOM Document and stores a list of WSDL files for a certain CSAR. - * - * @param csarID - * @param listOfWSDL - * @return true for success, false for error - */ - public boolean storeListOfWSDLForCSAR(final CSARID csarID, final List listOfWSDL) { - - if (!this.csarIDToWSDLDocuments.containsKey(csarID)) { - this.csarIDToWSDLDocuments.put(csarID, new ArrayList()); - } - - for (final Document doc : listOfWSDL) { - this.csarIDToWSDLDocuments.get(csarID).add(doc); - } - - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public void storePlanAsynchronousBoolean(final CSARID csarID, final QName planID, final boolean checkAsynchronous) { - if (null == this.csarIDToPlanIDToSynchronousBoolean.get(csarID)) { - this.csarIDToPlanIDToSynchronousBoolean.put(csarID, new HashMap()); - } - if (null == this.csarIDToPlanIDToSynchronousBoolean.get(csarID).get(planID)) { - this.csarIDToPlanIDToSynchronousBoolean.get(csarID).put(planID, checkAsynchronous); - } else { - this.LOG.error("For the CSAR " + csarID + " and plan " + planID - + " is already stored wheter it is a synchronous or an asynchronous plan."); - } - } - - public void storePlanIDForCSARAndServiceTemplate(final CSARID csarID, final QName serviceTemplateID, - final QName planID) { - if (!this.csarIDToServiceTemplateIDToPlanID.containsKey(csarID)) { - this.csarIDToServiceTemplateIDToPlanID.put(csarID, new HashMap>()); - } - if (!this.csarIDToServiceTemplateIDToPlanID.get(csarID).containsKey(serviceTemplateID)) { - this.csarIDToServiceTemplateIDToPlanID.get(csarID).put(serviceTemplateID, new ArrayList()); - } - this.csarIDToServiceTemplateIDToPlanID.get(csarID).get(serviceTemplateID).add(planID); - } - - /** - * {@inheritDoc} - */ - @Override - public void storeReference(final CSARID csarID, final QName nodeID, final Node node) { - setup(); - - MapQNameNode csarMap; - - if (this.referenceMap.containsKey(csarID)) { - // CSARID is known - csarMap = this.referenceMap.get(csarID); - if (csarMap.containsKey(nodeID)) { - // node is stored already - this.LOG.debug("The reference with the QName \"" + nodeID.toString() - + "\" is already stored for the CSAR \"" + csarID + "\"."); - } else { - // store this node - csarMap.put(nodeID, node); - this.LOG.debug("Storing of Node \"" + nodeID.toString() + "\" completed."); - } - - } else { - // CSARID is not known, so store a new HashMap for this ID - csarMap = new MapQNameNode(); - csarMap.put(nodeID, node); - this.referenceMap.put(csarID, csarMap); - this.LOG.debug("Storing of \"" + nodeID.toString() + "\" completed."); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void storeServiceTemplateIDForCSARID(final QName serviceTemplateID, final CSARID csarID) { - setup(); - if (serviceTemplateID != null && csarID != null) { - if (!this.mapCSARIDToServiceTemplateIDs.containsKey(csarID)) { - this.mapCSARIDToServiceTemplateIDs.put(csarID, new ArrayList()); - } - this.mapCSARIDToServiceTemplateIDs.get(csarID).add(serviceTemplateID); - } else { - this.LOG.error("An error has occured."); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void storeDefinitionsLocation(final CSARID csarID, final QName defID, final String location) { - if (!this.mapDefinitionsIDToLocationString.containsKey(csarID)) { - this.mapDefinitionsIDToLocationString.put(csarID, new HashMap()); - } - if (this.mapDefinitionsIDToLocationString.get(csarID).containsKey(defID)) { - this.LOG.warn("Overwrite the location for the Definitions \"" + defID + "\" in the CSAR \"" + csarID - + "\"."); - } - this.mapDefinitionsIDToLocationString.get(csarID).put(defID, location); - } - - /** - * {@inheritDoc} - */ - @Override - public String getDefinitionsLocation(final CSARID csarID, final QName defID) { - if (this.mapDefinitionsIDToLocationString.containsKey(csarID)) { - if (this.mapDefinitionsIDToLocationString.get(csarID).containsKey(defID)) { - return this.mapDefinitionsIDToLocationString.get(csarID).get(defID); - } - } - this.LOG.error("No location found for the Definitions \"" + defID + "\" in CSAR \"" + csarID + "\"."); - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public void storeContainingDefinitionsID(final CSARID csarID, final QName elementID, final QName definitionsID) { - if (!this.mapElementIDToDefinitionsID.containsKey(csarID)) { - this.mapElementIDToDefinitionsID.put(csarID, new HashMap()); - } - if (this.mapElementIDToDefinitionsID.get(csarID).containsKey(elementID)) { - this.LOG.warn("Overwrite the mapping for the element \"" + elementID + "\" in the CSAR \"" + csarID - + "\"."); - } - this.mapElementIDToDefinitionsID.get(csarID).put(elementID, definitionsID); - } - - /** - * {@inheritDoc} - */ - @Override - public QName getContainingDefinitionsID(final CSARID csarID, final QName elementID) { - if (this.mapElementIDToDefinitionsID.containsKey(csarID)) { - if (this.mapElementIDToDefinitionsID.get(csarID).containsKey(elementID)) { - return this.mapElementIDToDefinitionsID.get(csarID).get(elementID); - } - } - this.LOG.error("No Definitions ID found for the element \"" + elementID + "\" in CSAR \"" + csarID + "\"."); - return null; - } - - protected void bindIXMLSerializerService(final IXMLSerializerService service) { - if (service == null) { - this.LOG.error("Service IXMLSerializerService is null."); - } else { - this.LOG.debug("Bind of the IXMLSerializerService."); - ToscaReferenceMapper.xmlSerializerService = service; - } - } - - protected void unbindIXMLSerializerService(final IXMLSerializerService service) { - this.LOG.debug("Unbind of the IXMLSerializerService."); - ToscaReferenceMapper.xmlSerializerService = null; - } - - @Override - public void storePlanInputMessageID(final CSARID csarID, final QName planID, final QName messageID) { - if (!this.mapCSARIDToPlanIDToInputMessageID.containsKey(csarID)) { - this.mapCSARIDToPlanIDToInputMessageID.put(csarID, new HashMap()); - } - if (null != this.mapCSARIDToPlanIDToInputMessageID.get(csarID).get(planID)) { - this.LOG.error("There is already a message ID stored for CSAR {} and Plan {}", csarID, planID); - } else { - this.mapCSARIDToPlanIDToInputMessageID.get(csarID).put(planID, messageID); - } - - } - - @Override - public QName getPlanInputMessageID(final CSARID csarID, final QName planID) { - try { - return this.mapCSARIDToPlanIDToInputMessageID.get(csarID).get(planID); - } - catch (final NullPointerException e) { - this.LOG.error("There is no message ID stored for CSAR {} and Plan {}", csarID, planID); - return null; - } - } - - @Override - public void storeServiceTemplateBoundsPlan(final CSARID csarID, final QName serviceTemplateID, - final String interfaceName, final String opName, final QName planID) { - - if (null == this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID)) { - this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.put(csarID, - new HashMap>>()); - } - if (null == this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(serviceTemplateID)) { - this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID) - .put(serviceTemplateID, - new HashMap>()); - } - if (null == this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(serviceTemplateID) - .get(interfaceName)) { - this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(serviceTemplateID) - .put(interfaceName, - new HashMap()); - } - this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(serviceTemplateID) - .get(interfaceName).put(opName, planID); - } - - // @Override - // public void storeInterfaceNameForPlan(CSARID csarID, QName - // serviceTemplateID, QName planID, String name) { - // if (null == - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID)) { - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.put(csarID, new - // HashMap>()); - // } - // if (null == - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).get(serviceTemplateID)) - // { - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).put(serviceTemplateID, - // new HashMap()); - // } - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).get(serviceTemplateID).put(planID, - // name); - // } - - // @Override - // public void storeOperationNameForPlan(CSARID csarID, QName - // serviceTemplateID, QName planID, String interfaceName, String - // operationName) { - // if (null == - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.get(csarID)) { - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.put(csarID, new - // HashMap>()); - // } - // if (null == - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.get(csarID).get(serviceTemplateID)) - // { - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.get(csarID).put(serviceTemplateID, - // new HashMap()); - // } - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.get(csarID).get(serviceTemplateID).put(planID, - // operationName); - // } - - @Override - public String getIntferaceNameOfPlan(final CSARID csarID, final QName planID) { - - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.containsKey(csarID)) { - return null; - } - for (final QName st : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).keySet()) { - for (final String intf : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(st) - .keySet()) { - for (final String op : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(st) - .get(intf) - .keySet()) { - if (this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(st).get(intf) - .get(op).equals(planID)) { - return intf; - } - } - } - } - - // if (null != - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID)) { - // for (QName stid : - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).keySet()) - // { - // if - // (mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).get(stid).containsKey(planID)) - // { - // return - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).get(stid).get(planID); - // } - // } - // } - return null; - } - - @Override - public String getIntferaceNameOfPlan(final CSARID csarID, final QName serviceTemplateID, final QName planID) { - - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.containsKey(csarID)) { - return null; - } - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).containsKey(serviceTemplateID)) { - return null; - } - - for (final String intf : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID) - .get(serviceTemplateID) - .keySet()) { - for (final String op : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID) - .get(serviceTemplateID) - .get(intf).keySet()) { - if (this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(serviceTemplateID) - .get(intf).get(op).equals(planID)) { - return intf; - } - } - } - return null; - } - - @Override - public String getOperationNameOfPlan(final CSARID csarID, final QName planID) { - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.containsKey(csarID)) { - return null; - } - for (final QName st : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).keySet()) { - for (final String intf : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(st) - .keySet()) { - for (final String op : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(st) - .get(intf) - .keySet()) { - if (this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(st).get(intf) - .get(op).equals(planID)) { - return op; - } - } - } - } - return null; - } - - @Override - public List getBoundaryInterfacesOfCSAR(final CSARID csarID) { - final List list = new ArrayList<>(); - - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.containsKey(csarID)) { - return null; - } - for (final QName st : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).keySet()) { - for (final String intf : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(st) - .keySet()) { - list.add(intf); - } - } - - return list; - } - - @Override - public List getBoundaryInterfacesOfServiceTemplate(final CSARID csarID, final QName serviceTemplateID) { - final List list = new ArrayList<>(); - - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.containsKey(csarID)) { - return null; - } - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).containsKey(serviceTemplateID)) { - return null; - } - - for (final String intf : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID) - .get(serviceTemplateID) - .keySet()) { - list.add(intf); - } - - return list; - } - - // @Override - // public void setBoundaryInterfaceForCSARIDPlan(CSARID csarID, QName - // serviceTemplateID, QName planID, String ifaceName) { - // if - // (!mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.containsKey(csarID)) - // { - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.put(csarID, new - // HashMap>()); - // } - // if - // (!mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).containsKey(serviceTemplateID)) - // { - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).put(serviceTemplateID, - // new HashMap()); - // } - // mapCsarIdToServiceTemplateIdToPlanIdToInterfaceName.get(csarID).get(serviceTemplateID).put(planID, - // ifaceName); - // } - - // @Override - // public void setBoundaryOperationForCSARIDPlan(CSARID csarID, QName - // serviceTemplateID, QName planName, String opName) { - // if (null == - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.get(csarID)) { - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.put(csarID, new - // HashMap>()); - // } - // if (null == - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.get(csarID).get(serviceTemplateID)) - // { - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.get(csarID).put(serviceTemplateID, - // new HashMap()); - // } - // mapCSARIDToServiceTemplateIdToPlanIDToOperationName.get(csarID).get(serviceTemplateID).put(planName, - // opName); - // } - - @Override - public List getBoundaryOperationsOfCSARInterface(final CSARID csarID, final QName serviceTemplateID, - final String intName) { - final List list = new ArrayList<>(); - - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.containsKey(csarID)) { - return list; - } - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).containsKey(serviceTemplateID)) { - return list; - } - if (!this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID).get(serviceTemplateID) - .containsKey(intName)) { - return list; - } - - for (final String op : this.mapCSARIDToServiceTemplateIdToInterfaceToOperationToPlan.get(csarID) - .get(serviceTemplateID) - .get(intName).keySet()) { - list.add(op); - } - - return list; - } - - @Override - public QName getBoundaryPlanOfCSARInterface(final CSARID csarID, final String intName, final String opName) { - - final Map> stToIntfs = this.csarIDToExportedInterface.get(csarID); - - if (null != stToIntfs) { - for (final QName serviceTemplate : stToIntfs.keySet()) { - for (final TExportedInterface intf : stToIntfs.get(serviceTemplate)) { - if (intf.getName().equals(intName)) { - for (final TExportedOperation op : intf.getOperation()) { - if (op.getName().equals(opName)) { - return new QName(serviceTemplate.getNamespaceURI(), - ((TPlan) op.getPlan().getPlanRef()).getId()); - } - } - } - } - } - } - - // Map map = - // mapCSARIDToPlanIDToOperationName.get(csarID); - // - // if (null != map) { - // for (QName plan : map.keySet()) { - // if (map.get(plan).contains(opName)) { - // return plan; - // } - // } - // } - return null; - } - - @Override - public String getNamespaceOfPlan(final CSARID csarID, final String planID) { - if (null != this.mapCSARIDToPlanNameToNamespace.get(csarID)) { - return this.mapCSARIDToPlanNameToNamespace.get(csarID).get(planID); - } - return null; - } - - @Override - public void storeNamespaceOfPlan(final CSARID csarID, final String planID, final String namespace) { - if (!this.mapCSARIDToPlanNameToNamespace.containsKey(csarID)) { - this.mapCSARIDToPlanNameToNamespace.put(csarID, new HashMap()); - } - this.mapCSARIDToPlanNameToNamespace.get(csarID).put(planID, namespace); - } - - @Override - public void storeNodeTemplateIDForServiceTemplateAndCSAR(final CSARID csarID, final QName serviceTemplateID, - final String id) { - if (!this.mapCSARIDToServiceTemplateQNameToNodeTemplateID.containsKey(csarID)) { - this.mapCSARIDToServiceTemplateQNameToNodeTemplateID.put(csarID, new HashMap>()); - } - final Map> map = this.mapCSARIDToServiceTemplateQNameToNodeTemplateID.get(csarID); - if (!map.containsKey(serviceTemplateID)) { - map.put(serviceTemplateID, new ArrayList()); - } - final List list = map.get(serviceTemplateID); - if (!list.contains(id)) { - list.add(id); - } - } - - @Override - public void storeRelationshipTemplateIDForServiceTemplateANdCSAR(final CSARID csarId, final QName serviceTemplateID, - final String id) { - if (!this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.containsKey(csarId)) { - this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.put(csarId, - new HashMap>()); - } - final Map> map = this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.get(csarId); - if (!map.containsKey(serviceTemplateID)) { - map.put(serviceTemplateID, new ArrayList()); - } - final List list = map.get(serviceTemplateID); - if (!list.contains(id)) { - list.add(id); - } - - } - - @Override - public Map> getServiceTemplatesAndNodeTemplatesInCSAR(final CSARID csarID) { - return this.mapCSARIDToServiceTemplateQNameToNodeTemplateID.get(csarID); - } - - @Override - public Map> getServiceTemplate2RelationshipTemplateMap(final CSARID csarID) { - return this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.get(csarID); - } - - @Override - public void storeServiceTemplateBoundsPropertiesInformation(final CSARID csarID, final QName serviceTemplateID, - final String propertiesContent, - final PropertyMappings propertyMappings) { - if (null == this.serviceTemplatePropertiesContent.get(csarID)) { - this.serviceTemplatePropertiesContent.put(csarID, new HashMap()); - } - this.serviceTemplatePropertiesContent.get(csarID).put(serviceTemplateID, propertiesContent); - if (null == this.serviceTemplatePropertyMappings.get(csarID)) { - this.serviceTemplatePropertyMappings.put(csarID, new HashMap()); - } - this.serviceTemplatePropertyMappings.get(csarID).put(serviceTemplateID, propertyMappings); - } - - @Override - public String getServiceTemplateBoundsPropertiesContent(final CSARID csarID, final QName serviceTemplateID) { - final Map properties = this.serviceTemplatePropertiesContent.get(csarID); - if (properties != null) { - return properties.get(serviceTemplateID); - } - return null; - } - - @Override - public Object getServiceTemplateBoundsPropertiesXMLFragment(final CSARID csarID, final QName serviceTemplateID) { - final String content = this.getServiceTemplateBoundsPropertiesContent(csarID, serviceTemplateID); - final Object result = JAXB.unmarshal(new StringReader(content), TBoundaryDefinitions.Properties.class); - final TBoundaryDefinitions.Properties properties = (Properties) result; - - return properties.getAny(); - } - - @Override - public List getServiceTemplateBoundsPropertiesContent(final CSARID csarID) { - final List ret = new ArrayList<>(); - for (final QName st : this.serviceTemplatePropertiesContent.get(csarID).keySet()) { - ret.add(this.serviceTemplatePropertiesContent.get(csarID).get(st)); - } - return ret; - } - - @Override - public PropertyMappings getServiceTemplateBoundsPropertyMappings(final CSARID csarID, - final QName serviceTemplateID) { - final Map properties = this.serviceTemplatePropertyMappings.get(csarID); - if (properties != null) { - return properties.get(serviceTemplateID); - } - return null; - } - - @Override - public List getServiceTemplateBoundsPropertyMappings(final CSARID csarID) { - final List ret = new ArrayList<>(); - for (final QName st : this.serviceTemplatePropertyMappings.get(csarID).keySet()) { - ret.add(this.serviceTemplatePropertyMappings.get(csarID).get(st)); - } - return ret; - } - - @Override - public List getPropertyMappings(final CSARID id, final QName serviceTemplate) { - final PropertyMappings propertyMappings = this.getServiceTemplateBoundsPropertyMappings(id, serviceTemplate); - if (propertyMappings == null) { - this.LOG.info("There are no Property Mappings for CSAR \"{}\"", id); - return null; - } - return propertyMappings.getPropertyMapping(); - } - - @Override - public void storeRelationshipTemplateIDForServiceTemplateAndCSAR(final CSARID csarID, final QName serviceTemplateID, - final String id) { - if (!this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.containsKey(csarID)) { - this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.put(csarID, - new HashMap>()); - } - final Map> map = this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.get(csarID); - if (!map.containsKey(serviceTemplateID)) { - map.put(serviceTemplateID, new ArrayList()); - } - final List list = map.get(serviceTemplateID); - if (!list.contains(id)) { - list.add(id); - } - - } - - @Override - public Map> getServiceTemplatesAndRelationshipTemplatesInCSAR(final CSARID csarID) { - return this.mapCSARIDToServiceTemplateQNameToRelationshipTemplateID.get(csarID); - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/DefinitionsConsolidation.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/DefinitionsConsolidation.java deleted file mode 100644 index b1710f4e8..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/DefinitionsConsolidation.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opentosca.container.core.engine.impl.consolidation; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class consolidates the processed TOSCA data. Until now only the BoundaryDefinitions and - * Plans are consolidated to PublicPlans. - * - * @author endrescn@fachschaft.informatik.uni-stuttgart.de - */ -public class DefinitionsConsolidation { - - private final Logger LOG = LoggerFactory.getLogger(ExportedInterfacesConsolidation.class); - - private final ExportedInterfacesConsolidation exportedInterfacesConsolidation = - new ExportedInterfacesConsolidation(); - private final PolicyConsolidation policyConsolidation = new PolicyConsolidation(); - - - /** - * Resolves the referenced TOSCA files inside of a CSAR and stores the mapping into the - * ToscaReferenceMapper. - * - * @param csarID The ID of the passed CSAR which shall be resolved. - * @return true means no error, false one or more errors - */ - public boolean consolidateCSAR(final CSARID csarID) { - - boolean ret = this.exportedInterfacesConsolidation.consolidate(csarID); - if (!ret) { - this.LOG.error("Consolidation of the exported interfaces of CSAR \"" + csarID - + "\" produced one or more errors."); - } - ret = ret && this.policyConsolidation.consolidate(csarID); - if (!ret) { - this.LOG.error("Consolidation of the Policies inside the CSAR \"" + csarID - + "\" produced one or more errors."); - } - - return ret; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/ExportedInterfacesConsolidation.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/ExportedInterfacesConsolidation.java deleted file mode 100644 index 456a09a7b..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/ExportedInterfacesConsolidation.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.opentosca.container.core.engine.impl.consolidation; - -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpression; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.opentosca.container.core.engine.impl.ToscaEngineServiceImpl; -import org.opentosca.container.core.engine.impl.ToscaReferenceMapper; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.model.TExportedInterface; -import org.opentosca.container.core.tosca.model.TExportedOperation; -import org.opentosca.container.core.tosca.model.TExportedOperation.Plan; -import org.opentosca.container.core.tosca.model.TPlan; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.NodeList; - -/** - * This class consolidates the BoundaryDefinitions and Plans to PublicPlans. - * - * @author endrescn@fachschaft.informatik.uni-stuttgart.de - */ -public class ExportedInterfacesConsolidation { - - ToscaReferenceMapper toscaReferenceMapper = ToscaEngineServiceImpl.toscaReferenceMapper; - - /** - * NamespaceContext - */ - XPath xpath = XPathFactory.newInstance().newXPath(); - NamespaceContext nscontext = new NamespaceContext() { - - @Override - public String getNamespaceURI(final String prefix) { - String uri; - if (prefix.equals("wsdl")) { - uri = "http://schemas.xmlsoap.org/wsdl/"; - } else if (prefix.equals("xs")) { - uri = "http://www.w3.org/2001/XMLSchema"; - } else if (prefix.equals("tosca")) { - uri = "http://docs.oasis-open.org/tosca/ns/2011/12"; - } else { - uri = null; - } - return uri; - } - - // Dummy implementation - // Suppress warnings because of this method is auto generated - // and not - // used. - @SuppressWarnings("rawtypes") - @Override - public Iterator getPrefixes(final String val) { - return null; - } - - // Dummy implemenation - not used! - @Override - public String getPrefix(final String uri) { - return null; - } - }; - - private final Logger LOG = LoggerFactory.getLogger(ExportedInterfacesConsolidation.class); - - - public ExportedInterfacesConsolidation() { - this.xpath.setNamespaceContext(this.nscontext); - } - - /** - * Consolidates the exported interfaces of a CSAR. - * - * @param csarID the ID of the CSAR. - * @return true for success, false if an error occured - */ - public boolean consolidate(final CSARID csarID) { - - this.LOG.info("Consolidate the Interfaces of the BoundaryDefinitions of CSAR \"" + csarID + "\"."); - - // return value is negated, thus inside this method a true means at - // least one error - final boolean errorOccured = false; - - final Map> mapTypeToPlan = - this.toscaReferenceMapper.getCSARIDToPlans(csarID); - - for (final QName serviceTemplateID : this.toscaReferenceMapper.getExportedInterfacesOfCSAR(csarID).keySet()) { - - this.LOG.debug("Consolidate the Interfaces of the ServiceTemplate \"" + serviceTemplateID + "\"."); - - for (final TExportedInterface iface : this.toscaReferenceMapper.getExportedInterfacesOfCSAR(csarID) - .get(serviceTemplateID)) { - - for (final TExportedOperation operation : iface.getOperation()) { - - final Plan planReference = operation.getPlan(); - if (null != planReference) { - final TPlan toscaPlan = (TPlan) planReference.getPlanRef(); - - final QName planID = new QName( - this.toscaReferenceMapper.getNamespaceOfPlan(csarID, toscaPlan.getId()), toscaPlan.getId()); - - // toscaReferenceMapper.setBoundaryInterfaceForCSARIDPlan(csarID, - // serviceTemplateID, planID, iface.getName()); - // toscaReferenceMapper.setBoundaryOperationForCSARIDPlan(csarID, - // serviceTemplateID, planID, operation.getName()); - this.toscaReferenceMapper.storeServiceTemplateBoundsPlan(csarID, serviceTemplateID, - iface.getName(), operation.getName(), - planID); - - mapTypeToPlan.get(PlanTypes.isPlanTypeURI(toscaPlan.getPlanType())).put(planID, toscaPlan); - -// this.toscaReferenceMapper.storePlanInputMessageID(csarID, planID, -// this.getInputMessageQName(csarID, -// iface.getName(), -// operation.getName(), -// toscaPlan.getId(), -// toscaPlan, -// this.toscaReferenceMapper.getListOfWSDLForCSAR(csarID))); - - } else { - // just need the plans - } - } - - } - } - - return !errorOccured; - } - - /** - * TODO implement for wsdl 2.0 TODO transitive reloading of imported stuff? TODO all informations - * have to be in one wsdl (change this?) - * - * @param planID - * - * @param boundaryPlan - * @param list - * @throws XPathExpressionException - */ - private QName getInputMessageQName(final CSARID csarID, final String wsdlInterfaceName, - final String wsdlOperationName, final String planID, final TPlan boundaryPlan, - final List list) { - - this.LOG.debug("Try to find the InputMessageID for CSAR " + csarID + " and plan " + boundaryPlan.getId()); - - this.LOG.debug("countwsdl: " + list.size() + " interfacename:" + wsdlInterfaceName + " operationname:" - + wsdlOperationName); - - // IXMLSerializer serializer = - // ServiceHandler.xmlSerializerService.getXmlSerializer(); - - for (final Document doc : list) { - - try { - // select specific PortType/Interface with name and operation - String exprString = "/wsdl:definitions/wsdl:portType[@name=\"" + wsdlInterfaceName - + "\"]/wsdl:operation[@name=\"" + wsdlOperationName + "\"]/wsdl:input/@message"; - XPathExpression expr; - - expr = this.xpath.compile(exprString); - final NodeList messageQName = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); - - this.LOG.debug(exprString); - this.LOG.trace("Found results: " + messageQName.getLength()); - // LOG.trace(serializer.docToString(doc, true)); - - // if there is a PortType/Interface in this document, then there - // is the message defined as well - if (messageQName.getLength() == 1) { - - final QName id = new QName(this.toscaReferenceMapper.getNamespaceOfPlan(csarID, planID), planID); - - this.LOG.debug("Found the message QName {} for plan {}.", messageQName, id); - - // check whether synchronous or asynchronous - exprString = "/wsdl:definitions/wsdl:portType[@name=\"" + wsdlInterfaceName - + "\"]/wsdl:operation[@name=\"" + wsdlOperationName + "\"]/wsdl:output/@message"; - expr = this.xpath.compile(exprString); - final NodeList output = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); - if (output.getLength() > 0) { - // this is a synchronous bpel plan - this.LOG.debug("This plan is synchronous."); - this.toscaReferenceMapper.storePlanAsynchronousBoolean(csarID, id, false); - } else if (output.getLength() == 0) { - // this is an asynchronous bpel plan - this.LOG.debug("This plan is asynchronous."); - this.toscaReferenceMapper.storePlanAsynchronousBoolean(csarID, id, true); - } - - // wsdl porttype/interface to wsdl message - String value = messageQName.item(0).getNodeValue(); - // String prefix = value.substring(0, value.indexOf(":")); - final String name = value.substring(value.indexOf(":") + 1); - // String namespace = doc.lookupNamespaceURI(prefix); - // QName wsdlMessageID = new QName(namespace, name); - - this.LOG.debug("Found the PortType. Searching for the message \"" + name + "\"."); - - // wsdl message to schema message - // TODO multiple parts? - exprString = "/wsdl:definitions/wsdl:message[@name=\"" + name + "\"]/wsdl:part/@element"; - // exprString = "/wsdl:definitions/wsdl:message[@name=\"" + - // name - // + "\"]/wsdl:part[@name=\"payload\"]/@element"; - expr = this.xpath.compile(exprString); - final NodeList messages = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); - - this.LOG.debug(exprString); - this.LOG.debug("Count results: " + messages.getLength()); - - if (messages.getLength() == 1) { - - value = messages.item(0).getNodeValue(); - - this.LOG.debug("Value of " + messages.item(0).getLocalName() + " is " + value); - - final QName messageID = - new QName(doc.lookupNamespaceURI(value.substring(0, value.indexOf(":"))), - value.substring(value.indexOf(":") + 1)); - this.LOG.debug("Found message QName: " + messageID.toString()); - return messageID; - - } - } - - } - catch (final XPathExpressionException e) { - e.printStackTrace(); - } - } - - this.LOG.error("Did not find the message!"); - - return null; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/PolicyConsolidation.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/PolicyConsolidation.java deleted file mode 100644 index 8287c41e2..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/consolidation/PolicyConsolidation.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.opentosca.container.core.engine.impl.consolidation; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.ToscaEngineServiceImpl; -import org.opentosca.container.core.engine.impl.ToscaReferenceMapper; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Policies; -import org.opentosca.container.core.tosca.model.TEntityTemplate; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TPolicy; -import org.opentosca.container.core.tosca.model.TServiceTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PolicyConsolidation { - - private final Logger LOG = LoggerFactory.getLogger(ExportedInterfacesConsolidation.class); - - private final ToscaReferenceMapper toscaReferenceMapper = ToscaEngineServiceImpl.toscaReferenceMapper; - - - /** - * Consolidates the Policies of ServiceTemplates and NodeTemplates inside a CSAR. - * - * @param csarID the ID of the CSAR. - * @return true for success, false if an error occured - */ - public boolean consolidate(final CSARID csarID) { - - this.LOG.info("Consolidate the Policies of ServiceTemplates and NodeTemplates inside the CSAR \"" + csarID - + "\"."); - - for (final QName serviceTemplateID : this.toscaReferenceMapper.getServiceTemplateIDsContainedInCSAR(csarID)) { - - this.LOG.debug("Processing the Service Template \"" + serviceTemplateID + "\"."); - - final TServiceTemplate serviceTemplate = - (TServiceTemplate) this.toscaReferenceMapper.getJAXBReference(csarID, serviceTemplateID); - - // Policies contained in the Service Template itself - if (null != serviceTemplate.getBoundaryDefinitions()) { - this.LOG.debug("Search inside of the Boundary Definitions."); - final Policies policies = serviceTemplate.getBoundaryDefinitions().getPolicies(); - if (null != policies) { - this.createAndStorePolicies(csarID, serviceTemplateID, policies.getPolicy()); - } - } - - // Policies contained in the Node Templates of the Service Template - if (null != serviceTemplate.getTopologyTemplate()) { - - this.LOG.debug("Process the Node Templates inside of the Topology Template."); - - for (final TEntityTemplate template : serviceTemplate.getTopologyTemplate() - .getNodeTemplateOrRelationshipTemplate()) { - - // NodeTemplates - if (template instanceof TNodeTemplate) { - - final TNodeTemplate nodeTemplate = (TNodeTemplate) template; - if (null != nodeTemplate.getPolicies()) { - this.createAndStorePolicies(csarID, - new QName(serviceTemplateID.getNamespaceURI(), - nodeTemplate.getId()), - nodeTemplate.getPolicies().getPolicy()); - } - } - } - } - } - - return true; - } - - /** - * Creates the Consolidated Policies and stores it due the ToscaReferenceMapper. - * - * @param csarID - * @param objectFactory - * @param templateID - * @param policies - */ - private void createAndStorePolicies(final CSARID csarID, final QName templateID, final List policies) { - - final Policies pols = new Policies(); - pols.getPolicy().addAll(policies); - - this.LOG.debug("Store the Consolidated Policies for template ID \"" + templateID + "\"."); - this.toscaReferenceMapper.storeConsolidatedPolicies(csarID, templateID, pols); - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ArtifactTemplateResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ArtifactTemplateResolver.java deleted file mode 100644 index a57fa4a56..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ArtifactTemplateResolver.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TArtifactTemplate; -import org.opentosca.container.core.tosca.model.TExtensibleElements; - -public class ArtifactTemplateResolver extends GenericResolver { - - public ArtifactTemplateResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * - * @param definitions - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - - // ArtifactTemplate - if (element instanceof TArtifactTemplate) { - - final TArtifactTemplate artifactTemplate = (TArtifactTemplate) element; - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(definitions.getTargetNamespace(), - artifactTemplate.getId()), artifactTemplate); - - // resolve the ArtifactType - if (artifactTemplate.getType() != null && !artifactTemplate.getType().toString().equals("")) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(artifactTemplate.getType(), - ElementNamesEnum.ARTIFACTTYPE); - } - - // Properties - // nothing to do here - - // PropertyConstraints - // nothing to do here - - // ArtifactReferences - // if (artifactTemplate.getArtifactReferences() != null) { - // for (TArtifactReference artifactReference : - // artifactTemplate.getArtifactReferences().getArtifactReference()) - // { - // this is done by the ToscaEngine with the method - // getFilesOfAArtifactTemplate - // } - // } - - } - } - return errorOccurred; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ArtifactTypeResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ArtifactTypeResolver.java deleted file mode 100644 index 2ff4a536a..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ArtifactTypeResolver.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TArtifactType; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ArtifactTypeResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(ArtifactTypeResolver.class); - - - public ArtifactTypeResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * - * @param definitions - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - if (element instanceof TArtifactType) { - - final TArtifactType artifactType = (TArtifactType) element; - - // store the ArtifactType - String targetNamespace; - if (artifactType.getTargetNamespace() != null && !artifactType.getTargetNamespace().equals("")) { - targetNamespace = artifactType.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - artifactType.getName()), artifactType); - - this.LOG.debug("Resolve the ArtifactType \"" + targetNamespace + ":" + artifactType.getName() + "\"."); - - // DerivedFrom - if (artifactType.getDerivedFrom() != null && artifactType.getDerivedFrom().getTypeRef() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(artifactType.getDerivedFrom() - .getTypeRef(), - ElementNamesEnum.ARTIFACTTYPE); - } - - // PropertiesDefinition - // if (artifactType.getPropertiesDefinition() != null) { - // if (!(new - // PropertiesDefinitionResolver(this.referenceMapper)).resolve(artifactType.getPropertiesDefinition())) - // { - // this.LOG.error("The ArtifactType \"" + targetNamespace + ":" - // + artifactType.getName() + - // "\" specifies both attributes in its child element - // PropertiesDefinition which is not allowed."); - // } - // } - } - } - return errorOccurred; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/CapabilityTypeResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/CapabilityTypeResolver.java deleted file mode 100644 index 8c9c7d8bb..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/CapabilityTypeResolver.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TCapabilityType; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CapabilityTypeResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(NodeTypeResolver.class); - - - public CapabilityTypeResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * - * @param definitions - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - if (element instanceof TCapabilityType) { - - final TCapabilityType capabilityType = (TCapabilityType) element; - - // store the CapabilityType - String targetNamespace; - if (capabilityType.getTargetNamespace() != null && !capabilityType.getTargetNamespace().equals("")) { - targetNamespace = capabilityType.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - capabilityType.getName()), capabilityType); - - this.LOG.debug("Resolve the CapabilityType \"" + targetNamespace + ":" + capabilityType.getName() - + "\"."); - - // Tags - // nothing to do here - - // DerivedFrom - if (capabilityType.getDerivedFrom() != null && capabilityType.getDerivedFrom().getTypeRef() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(capabilityType.getDerivedFrom() - .getTypeRef(), - ElementNamesEnum.CAPABILITYTYPE); - } - - // PropertiesDefinition - if (capabilityType.getPropertiesDefinition() != null) { - if (new PropertiesDefinitionResolver( - this.referenceMapper).resolve(capabilityType.getPropertiesDefinition())) { - this.LOG.error("The CapabilityType \"" + targetNamespace + ":" + capabilityType.getName() - + "\" specifies both attributes in its child element PropertiesDefinition which is not allowed."); - errorOccurred = true; - } - } - } - } - return errorOccurred; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/DefinitionsResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/DefinitionsResolver.java deleted file mode 100644 index c254df173..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/DefinitionsResolver.java +++ /dev/null @@ -1,338 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import java.io.IOException; -import java.net.URLDecoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.engine.impl.PathResolver; -import org.opentosca.container.core.engine.impl.ServiceHandler; -import org.opentosca.container.core.engine.impl.ToscaEngineServiceImpl; -import org.opentosca.container.core.model.AbstractFile; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TImport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.SAXException; - -/** - * The DefinitionsResolver resolves references inside of TOSCA Definitions according to the TOSCA - * specification wd14. The resolving reaches elements of the Definitions Documents of the passed - * CSAR and elements inside of imported files of Definitions Documents. Each found element and the - * document in which the element is nested is stored by the org.opentosca.toscaengine.service.impl. - * toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a Definitions: The Definitions has to be valid in all kind of - * meanings. - * - * @author endrescn@fachschaft.informatik.uni-stuttgart.de - */ -public class DefinitionsResolver { - - private final Logger LOG = LoggerFactory.getLogger(DefinitionsResolver.class); - - private CSARContent csarContent = null; - - // list documents which are processed - private LinkedList listOfTOSCA = null; - private LinkedList listOfTOSCADefinitions = null; - private LinkedList listOfXML = null; - private LinkedList listOfWSDL = null; - private Map> mapOfNSToDocuments = null; - - // list of TOSCA documents which imports are not processed - private LinkedList listOfNewlyImportedDocuments = null; - private Set alreadyImportedDocuments = null; - - - private void init() { - this.csarContent = null; - this.listOfTOSCA = new LinkedList<>(); - this.listOfTOSCADefinitions = new LinkedList<>(); - this.listOfXML = new LinkedList<>(); - this.listOfWSDL = new LinkedList<>(); - this.mapOfNSToDocuments = new HashMap<>(); - this.listOfNewlyImportedDocuments = new LinkedList<>(); - this.alreadyImportedDocuments = new HashSet<>(); - } - - /** - * Resolves the referenced TOSCA files inside of a CSAR and stores the mapping into the - * ToscaReferenceMapper. - * - * @param csarID The ID of the passed CSAR which shall be resolved. - * @return true means no error, false one or more errors - */ - public boolean resolveDefinitions(final CSARID csarID) { - - this.LOG.info("Start resolving of the CSAR \"" + csarID.getFileName() + "\"."); - - this.init(); - - // first of all search all documents - boolean errorOccured = !this.resolveImports(csarID); - if (errorOccured) { - this.LOG.error("There was an error while searching for the imports of the TOSCA documents."); - return false; - } - - ToscaEngineServiceImpl.toscaReferenceMapper.storeListOfWSDLForCSAR(csarID, this.listOfWSDL); - - // if no error occurred, start the resolving of references - this.LOG.info("All import elements are resolvable, now starting the resolving."); - - // initialize all needed resolver - final ReferenceMapper referenceMapper = new ReferenceMapper(csarID, this.mapOfNSToDocuments); - final ExtensionsResolver extensionResolver = new ExtensionsResolver(referenceMapper); - final TypesResolver typesResolver = new TypesResolver(referenceMapper); - final ServiceTemplateResolver serviceTemplateResolver = new ServiceTemplateResolver(referenceMapper); - final NodeTypeResolver nodeTypeResolver = new NodeTypeResolver(referenceMapper); - final NodeTypeImplementationResolver nodeTypeImplementationResolver = - new NodeTypeImplementationResolver(referenceMapper, csarID); - final CapabilityTypeResolver capabilityTypeResolver = new CapabilityTypeResolver(referenceMapper); - final RequirementTypeResolver requirementTypeResolver = new RequirementTypeResolver(referenceMapper); - final RelationshipTypeResolver relationshipTypeResolver = new RelationshipTypeResolver(referenceMapper); - final RelationshipTypeImplementationResolver relationshipTypeImplementationResolver = - new RelationshipTypeImplementationResolver(referenceMapper); - final ArtifactTypeResolver artifactTypeResolver = new ArtifactTypeResolver(referenceMapper); - final ArtifactTemplateResolver artifactTemplateResolver = new ArtifactTemplateResolver(referenceMapper); - final PolicyTypeResolver policyTypeResolver = new PolicyTypeResolver(referenceMapper); - final PolicyTemplateResolver policyTemplateResolver = new PolicyTemplateResolver(referenceMapper); - - // resolve each Definitions content - for (final Definitions definitionsToResolve : this.listOfTOSCADefinitions) { - - ToscaEngineServiceImpl.toscaReferenceMapper.storeDefinitions(csarID, definitionsToResolve); - this.LOG.info("Start to resolve the Definitions \"{" + definitionsToResolve.getTargetNamespace() + "}" - + definitionsToResolve.getId() + "\"."); - - errorOccured = errorOccured || extensionResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || typesResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || serviceTemplateResolver.resolve(definitionsToResolve, csarID); - errorOccured = errorOccured || nodeTypeResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || nodeTypeImplementationResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || relationshipTypeResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || relationshipTypeImplementationResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || requirementTypeResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || capabilityTypeResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || artifactTypeResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || artifactTemplateResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || policyTypeResolver.resolve(definitionsToResolve); - errorOccured = errorOccured || policyTemplateResolver.resolve(definitionsToResolve); - - } - - // if an error occurred the TOSCA Proccessing was not successfull, thus - // delete the stored data - if (errorOccured) { - this.LOG.error("Resolving of the CSAR \"" + csarID.getFileName() + "\" was not successfull!"); - this.LOG.debug("Deleting stored references."); - ToscaEngineServiceImpl.toscaReferenceMapper.clearCSARContent(csarID); - return false; - } - - this.LOG.info("Resolving of the CSAR \"" + csarID.getFileName() + "\" was successfull!"); - return true; - } - - /** - * This method traverses the tree of imports of TOSCA documents starting in the main TOSCA defined - * in the TOSCA meta file of the CSAR. - * - * TODO prevent cycles in the imports of other TOSCA documents - * - * @param csarID of the CSAR - * @return true means no error, false one or more errors - */ - private boolean resolveImports(final CSARID csarID) { - - // DocumentBuilder for parsing the files - final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder; - try { - dbf.setNamespaceAware(true); - dbf.setIgnoringComments(true); - builder = dbf.newDocumentBuilder(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - return false; - } - - if (ServiceHandler.coreFileService == null) { - this.LOG.error("The CoreFileService is null!"); - return false; - } - - // get the csarContent - try { - this.csarContent = ServiceHandler.coreFileService.getCSAR(csarID); - } - catch (final UserException exc) { - this.LOG.warn("An User Exception occured.", exc); - return false; - } - - // get the main TOSCA - this.listOfNewlyImportedDocuments.add(this.csarContent.getRootTOSCA()); - - // while there are TOSCA files to process - while (!this.listOfNewlyImportedDocuments.isEmpty()) { - - // remove the current TOSCA file from the list - final AbstractFile file = this.listOfNewlyImportedDocuments.remove(); - - this.LOG.trace("File is at \"" + file.getPath() + "\"."); - - // parse the file - Document doc = null; - try { - doc = builder.parse(file.getFileAsInputStream()); - doc.getDocumentElement().normalize(); - } - catch (SAXException | IOException | SystemException e) { - e.printStackTrace(); - this.LOG.error("There was an error while parsing a XML file."); - return false; - } - - final Node root = doc.getFirstChild(); - - // some error checking and getting the namespace - if (null == root) { - this.LOG.warn("An imported XML document has no content."); - continue; - } - - String ns = root.getNamespaceURI(); - if (null == ns || ns.equals("")) { - if (null != root.getAttributes() && null != root.getAttributes().getNamedItem("xmlns")) { - ns = root.getAttributes().getNamedItem("xmlns").getTextContent(); - } - } - - if (null == ns || ns.equals("")) { - this.LOG.error("An imported XML document has no namespace."); - return false; - } - - if (ns.endsWith("/")) { - ns = ns.substring(0, ns.length() - 1); - } - - // add the document for further processing - if (!this.mapOfNSToDocuments.containsKey(ns)) { - this.mapOfNSToDocuments.put(ns, new ArrayList()); - } - this.mapOfNSToDocuments.get(ns).add(doc); - - // distinguish between TOSCA, WSLD and other XML - // TOSCA - if (ns.equals("http://docs.oasis-open.org/tosca/ns/2011/12") - || ns.equals("http://docs.oasis-open.org/tosca/ns/2011/12/")) { - this.LOG.trace("Found document is a TOSCA document."); - this.listOfTOSCA.add(doc); - - final Definitions def = ServiceHandler.xmlSerializerService.getXmlSerializer().unmarshal(doc); - this.listOfTOSCADefinitions.add(def); - - final QName defID = new QName(def.getTargetNamespace(), def.getId()); - final String loc = file.getPath(); - ToscaEngineServiceImpl.toscaReferenceMapper.storeDefinitionsLocation(csarID, defID, loc); - - // resolve the imports of the TOSCA - for (final TImport imp : def.getImport()) { - - final String oldLocation = imp.getLocation(); - - if (null == oldLocation || oldLocation.trim().equals("")) { - this.LOG.error("One import has no or an empty location attribute."); - return false; - } - - // try { - // location = URLDecoder.decode(location, "UTF-8"); - // } catch (UnsupportedEncodingException e1) { - // this.LOG.error("The decoding of the location attribute of - // an import failed: {}", - // e1.getLocalizedMessage()); - // e1.printStackTrace(); - // continue; - // } - - final String location = - PathResolver.resolveRelativePath(file.getPath(), oldLocation, this.csarContent); - - this.LOG.trace("Import (at \"" + oldLocation + "\") should be at \"" + location + "\"."); - - AbstractFile newFile; - try { - newFile = this.csarContent.getFile(URLDecoder.decode(location, "UTF-8")); - if (null == newFile) { - this.LOG.error("The file at \"" + location + "\" does not exit"); - return false; - } - - doc = builder.parse(newFile.getFileAsInputStream()); - doc.getDocumentElement().normalize(); - } - catch (SAXException | IOException | SystemException e) { - e.printStackTrace(); - this.LOG.error("There was an error while parsing a XML file."); - return false; - } - - // add the documents to the according lists - if (imp.getImportType().equals("http://docs.oasis-open.org/tosca/ns/2011/12") - || imp.getImportType().equals("http://docs.oasis-open.org/tosca/ns/2011/12/")) { - if (!this.alreadyImportedDocuments.contains(newFile)) { - this.listOfNewlyImportedDocuments.add(newFile); - this.alreadyImportedDocuments.add(newFile); - } - } else if (imp.getImportType().equals("http://schemas.xmlsoap.org/wsdl") - || imp.getImportType().equals("http://schemas.xmlsoap.org/wsdl/")) { - if (!this.listOfWSDL.contains(doc)) { - this.listOfWSDL.add(doc); - } - } else { - if (!this.listOfXML.contains(doc)) { - this.listOfXML.add(doc); - } - } - } - - } - // WSDL - else if (ns.equals("http://schemas.xmlsoap.org/wsdl") || ns.equals("http://schemas.xmlsoap.org/wsdl/")) { - this.LOG.trace("Found document is a WSDL document."); - this.listOfWSDL.add(doc); - } - // other XML - else { - this.LOG.trace("Found document is a XML document."); - this.listOfXML.add(doc); - } - } - - this.LOG.debug("TOSCA:" + this.listOfTOSCA.size() + " WSDL:" + this.listOfWSDL.size() + " XML:" - + this.listOfXML.size()); - return true; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/DeploymentArtifactResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/DeploymentArtifactResolver.java deleted file mode 100644 index fa7a21600..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/DeploymentArtifactResolver.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.TDeploymentArtifact; - -/** - * The DeploymentArtifactResolver resolves references inside of TOSCA DeploymentArtifacts according - * to the TOSCA specification wd14. Each found element and the document in which the element is - * nested is stored by the org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a DeploymentArtifact: Definitions has to be valid in all kind of - * meanings. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class DeploymentArtifactResolver extends GenericResolver { - - /** - * Instantiate an object of the Resolver to resolve references inside of DeploymentArtifacts. This - * constructor sets the ReferenceMapper which searches for references. - * - * @param referenceMapper - */ - public DeploymentArtifactResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * Resolves a DeploymentArtifact and stores the mapping into the ToscaReferenceMapper. - * - * @param deploymentArtifact The DeploymentArtifact object. - * @param targetNamespace the Namespace in which the Artifact shall be - * @return true if an error occurred, false if not - */ - public boolean resolve(final TDeploymentArtifact deploymentArtifact, final String targetNamespace) { - boolean errorOccurred = false; - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - deploymentArtifact.getName()), deploymentArtifact); - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(deploymentArtifact.getArtifactType(), - ElementNamesEnum.ARTIFACTTYPE); - if (deploymentArtifact.getArtifactRef() != null && !deploymentArtifact.getArtifactRef().toString().equals("")) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithID(deploymentArtifact.getArtifactRef()); - } - return errorOccurred; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ExtensionsResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ExtensionsResolver.java deleted file mode 100644 index 240ee4f65..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ExtensionsResolver.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import org.opentosca.container.core.tosca.model.Definitions; - -/** - * The ExtensionsResolver resolves references inside of TOSCA Extensions according to the TOSCA - * specification wd14. Each found element and the document in which the element is nested is stored - * by the org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving an Extensions: Definitions has to be valid in all kind of meanings. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class ExtensionsResolver extends GenericResolver { - - /** - * Instantiate an object of the Resolver to resolve references inside of Extensions. This - * constructor sets the ReferenceMapper which search for references. - * - * @param referenceMapper - */ - public ExtensionsResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * Resolves an Extensions and stores the mapping into the ToscaReferenceMapper. - * - * @param definitions The Definitions object. - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions def) { - // nothing to do here - return false; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/GenericResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/GenericResolver.java deleted file mode 100644 index ef93728e3..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/GenericResolver.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -public class GenericResolver { - - public ReferenceMapper referenceMapper = null; - - - public GenericResolver(final ReferenceMapper referenceMapper) { - this.referenceMapper = referenceMapper; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ImplementationArtifactResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ImplementationArtifactResolver.java deleted file mode 100644 index 294232bde..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ImplementationArtifactResolver.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.StaticTOSCANamespaces; -import org.opentosca.container.core.tosca.model.TImplementationArtifact; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The ImplementationArtifactResolver resolves references inside of TOSCA ImplementationArtifacts - * according to the TOSCA specification wd14. Each found element and the document in which the - * element is nested is stored by the - * org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a ImplementationArtifact: Definitions has to be valid in all kind of - * meanings. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class ImplementationArtifactResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(ImplementationArtifactResolver.class); - - - /** - * Instantiate an object of the Resolver to resolve references inside of NodeTypeImplementations. - * This constructor sets the ReferenceMapper which searches for references. - * - * @param referenceMapper - */ - public ImplementationArtifactResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * Resolves a ImplementationArtifact and stores the mapping into the ToscaReferenceMapper. - * - * @param implementationArtifact The ImplementationArtifact object. - * @param ownerTargetNamespace the Namespace in which the ImplementationArtifact shall be - * @param ownerName the Name of the NodeTypeImplementation or RelationshipTypeImplementation owning - * the ImplementationArtifact - * @param iANumber the number of the ImplementationArtifact in the list of ImplementationArtifacts - * of the owner - * @return true if an error occurred, false if not - */ - public boolean resolve(final TImplementationArtifact implementationArtifact, final String ownerTargetNamespace, - final String ownerName, final int iANumber) { - - boolean errorOccurred = false; - - String implArtName = - implementationArtifact.getOtherAttributes().get(new QName(StaticTOSCANamespaces.nsToscaExtension, "name")); - - // if the name attribute of the implementation artifact is not available - if (null == implArtName) { - implArtName = ownerName + StaticTOSCANamespaces.nameIANameExtension + iANumber; - this.LOG.warn("One resolved implementation artifact of \"" + ownerName - + "\" has no name attribute specified. Thus set the name \"" + implArtName + "\"."); - implementationArtifact.setName(new QName(StaticTOSCANamespaces.nsToscaExtension, "name"), implArtName); - } else { - this.LOG.debug("Found the implementation artifact name \"" + implArtName - + "\" in the extension namespace of OpenTOSCA."); - implementationArtifact.setName(implArtName); - } - - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(ownerTargetNamespace, implArtName), - implementationArtifact); - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(implementationArtifact.getArtifactType(), - ElementNamesEnum.ARTIFACTTYPE); - if (implementationArtifact.getArtifactRef() != null - && !implementationArtifact.getArtifactRef().toString().equals("")) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithID(implementationArtifact.getArtifactRef()); - } - - return errorOccurred; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/NodeTypeImplementationResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/NodeTypeImplementationResolver.java deleted file mode 100644 index 1804191a1..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/NodeTypeImplementationResolver.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.ToscaEngineServiceImpl; -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TDeploymentArtifact; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TImplementationArtifact; -import org.opentosca.container.core.tosca.model.TNodeTypeImplementation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The NodeTypeImplementationResolver resolves references inside of TOSCA NodeTypeImplementations - * according to the TOSCA specification wd14. Each found element and the document in which the - * element is nested is stored by the - * org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a NodeTypeImplementation: Definitions has to be valid in all kind of - * meanings. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class NodeTypeImplementationResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(NodeTypeImplementationResolver.class); - - private final CSARID csarID; - - - /** - * Instantiate an object of the Resolver to resolve references inside of NodeTypeImplementations. - * This constructor sets the ReferenceMapper which searches for references. - * - * @param referenceMapper - * @param csarID - */ - public NodeTypeImplementationResolver(final ReferenceMapper referenceMapper, final CSARID csarID) { - super(referenceMapper); - this.csarID = csarID; - } - - /** - * Resolves all NodeTypeImplementations inside of a Definitions and stores the mapping into the - * ToscaReferenceMapper. - * - * @param definitions The Definitions object. - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - if (element instanceof TNodeTypeImplementation) { - - final TNodeTypeImplementation nodeTypeImplementation = (TNodeTypeImplementation) element; - - // store the NodeTypeImplementation - String targetNamespace; - if (nodeTypeImplementation.getTargetNamespace() != null - && !nodeTypeImplementation.getTargetNamespace().equals("")) { - targetNamespace = nodeTypeImplementation.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - - this.LOG.debug("Resolve the NodeTypeImplementation \"" + targetNamespace + ":" - + nodeTypeImplementation.getName() + "\"."); - - // is the NodeType known - if (!ToscaEngineServiceImpl.toscaReferenceMapper.containsReferenceInsideCSAR(this.csarID, - nodeTypeImplementation.getNodeType())) { - this.LOG.error("The NodeTypeImplementation \"" + targetNamespace + ":" - + nodeTypeImplementation.getName() + "\" refers to the NodeType \"" - + nodeTypeImplementation.getNodeType() + "\" which was not found."); - } - - // Tags - // nothing to do - - // DerivedFrom - if (nodeTypeImplementation.getDerivedFrom() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(nodeTypeImplementation.getDerivedFrom() - .getNodeTypeImplementationRef(), - ElementNamesEnum.NODETYPEIMPLEMENTATION); - } - - // RequiredContainerFeatures - // nothing to do here - - // ImplementationArtifacts - if (nodeTypeImplementation.getImplementationArtifacts() != null) { - for (final TImplementationArtifact implementationArtifact : nodeTypeImplementation.getImplementationArtifacts() - .getImplementationArtifact()) { - final int iANumber = - nodeTypeImplementation.getImplementationArtifacts().getImplementationArtifact() - .indexOf(implementationArtifact); - errorOccurred = errorOccurred || new ImplementationArtifactResolver( - this.referenceMapper).resolve(implementationArtifact, targetNamespace, - nodeTypeImplementation.getName(), iANumber); - } - } - - // DeploymentArtifacts - if (nodeTypeImplementation.getDeploymentArtifacts() != null) { - for (final TDeploymentArtifact deploymentArtifact : nodeTypeImplementation.getDeploymentArtifacts() - .getDeploymentArtifact()) { - errorOccurred = errorOccurred - || new DeploymentArtifactResolver(this.referenceMapper).resolve(deploymentArtifact, - targetNamespace); - } - } - - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - nodeTypeImplementation.getName()), nodeTypeImplementation); - } - } - return errorOccurred; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/NodeTypeResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/NodeTypeResolver.java deleted file mode 100644 index 6334946eb..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/NodeTypeResolver.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TCapabilityDefinition; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TInterface; -import org.opentosca.container.core.tosca.model.TNodeType; -import org.opentosca.container.core.tosca.model.TOperation; -import org.opentosca.container.core.tosca.model.TRequirementDefinition; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The NodeTypeResolver resolves references inside of TOSCA NodeTypes according to the TOSCA - * specification wd14. Each found element and the document in which the element is nested is stored - * by the org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a NodeType: Definitions has to be valid in all kind of meanings. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class NodeTypeResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(NodeTypeResolver.class); - - - /** - * Instantiate an object of the Resolver to resolve references inside of NodeTypes. This constructor - * sets the ReferenceMapper which searches for references. - * - * @param referenceMapper - */ - public NodeTypeResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * Resolves all NodeTypes inside of a Definitions and stores the mapping into the - * ToscaReferenceMapper. - * - * @param definitions The Definitions object. - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - if (element instanceof TNodeType) { - - final TNodeType nodeType = (TNodeType) element; - - // store the NodeType - String targetNamespace; - if (nodeType.getTargetNamespace() != null && !nodeType.getTargetNamespace().equals("")) { - targetNamespace = nodeType.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - nodeType.getName()), nodeType); - - this.LOG.debug("Resolve the NodeType \"" + targetNamespace + ":" + nodeType.getName() + "\"."); - - // Tags - // nothing to do here - - // DerivedFrom - if (nodeType.getDerivedFrom() != null && nodeType.getDerivedFrom().getTypeRef() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(nodeType.getDerivedFrom() - .getTypeRef(), - ElementNamesEnum.NODETYPE); - } - - // PropertiesDefinition - if (nodeType.getPropertiesDefinition() != null) { - if (new PropertiesDefinitionResolver( - this.referenceMapper).resolve(nodeType.getPropertiesDefinition())) { - this.LOG.error("The NodeType \"" + targetNamespace + ":" + nodeType.getName() - + "\" specifies both attributes in its child element PropertiesDefinition which is not allowed."); - errorOccurred = true; - } - } - - // RequirementDefinition - if (nodeType.getRequirementDefinitions() != null) { - for (final TRequirementDefinition requirementDefinition : nodeType.getRequirementDefinitions() - .getRequirementDefinition()) { - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - requirementDefinition.getName()), requirementDefinition); - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(requirementDefinition.getRequirementType(), - ElementNamesEnum.REQUIREMENTTYPE); - } - } - - // CapabilityDefinitions - if (nodeType.getCapabilityDefinitions() != null) { - for (final TCapabilityDefinition capabilityDefinition : nodeType.getCapabilityDefinitions() - .getCapabilityDefinition()) { - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - capabilityDefinition.getName()), capabilityDefinition); - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(capabilityDefinition.getCapabilityType(), - ElementNamesEnum.CAPABILITYTYPE); - } - } - - // InstanceStates - // nothing to do here - - // Interfaces - if (nodeType.getInterfaces() != null) { - for (final TInterface iface : nodeType.getInterfaces().getInterface()) { - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - iface.getName()), iface); - - for (final TOperation operation : iface.getOperation()) { - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - operation.getName()), operation); - } - } - } - } - } - return errorOccurred; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PolicyTemplateResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PolicyTemplateResolver.java deleted file mode 100644 index c5b114ebb..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PolicyTemplateResolver.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TPolicyTemplate; - -public class PolicyTemplateResolver extends GenericResolver { - - public PolicyTemplateResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * - * @param definitions - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - - // PolicyTemplate - if (element instanceof TPolicyTemplate) { - - final TPolicyTemplate policyTemplate = (TPolicyTemplate) element; - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(definitions.getTargetNamespace(), - policyTemplate.getId()), policyTemplate); - - // resolve the PolicyType - if (policyTemplate.getType() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(policyTemplate.getType(), - ElementNamesEnum.POLICYTYPE); - } - - // Properties - // nothing to do here - - // PropertyConstraints - // nothing to do here - - } - } - return errorOccurred; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PolicyTypeResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PolicyTypeResolver.java deleted file mode 100644 index 47c788786..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PolicyTypeResolver.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TAppliesTo.NodeTypeReference; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TPolicyType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PolicyTypeResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(PolicyTypeResolver.class); - - - public PolicyTypeResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * - * @param definitions - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - if (element instanceof TPolicyType) { - - final TPolicyType policyType = (TPolicyType) element; - - // store the PolicyType - String targetNamespace; - if (policyType.getTargetNamespace() != null && !policyType.getTargetNamespace().equals("")) { - targetNamespace = policyType.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - policyType.getName()), policyType); - - this.LOG.debug("Resolve the PolicyType \"" + targetNamespace + ":" + policyType.getName() + "\"."); - - // Tags - // nothing to do here - - // DerivedFrom - if (policyType.getDerivedFrom() != null && policyType.getDerivedFrom().getTypeRef() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(policyType.getDerivedFrom() - .getTypeRef(), - ElementNamesEnum.POLICYTYPE); - } - - // PropertiesDefinition - if (policyType.getPropertiesDefinition() != null) { - if (new PropertiesDefinitionResolver( - this.referenceMapper).resolve(policyType.getPropertiesDefinition())) { - this.LOG.error("The PolicyType \"" + targetNamespace + ":" + policyType.getName() - + "\" specifies both attributes in its child element PropertiesDefinition which is not allowed."); - errorOccurred = true; - } - } - - // AppliesTo - if (policyType.getAppliesTo() != null) { - for (final NodeTypeReference nodeTypeReference : policyType.getAppliesTo().getNodeTypeReference()) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(nodeTypeReference.getTypeRef(), - ElementNamesEnum.NODETYPE); - } - } - } - } - return errorOccurred; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PropertiesDefinitionResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PropertiesDefinitionResolver.java deleted file mode 100644 index 69101d406..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/PropertiesDefinitionResolver.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import org.opentosca.container.core.tosca.model.TEntityType.PropertiesDefinition; - -/** - * The PropertiesDefinitionResolver resolves references inside of TOSCA PropertiesDefinitions - * according to the TOSCA specification wd14. Each found element and the document in which the - * element is nested is stored by the - * org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a PropertiesDefinition: Definitions has to be valid in all kind of - * meanings. - * - * Copyright 2012 Christian Endres - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - * - */ -public class PropertiesDefinitionResolver extends GenericResolver { - - /** - * Instantiate an object of the Resolver to resolve references inside of PropertiesDefinitions. This - * constructor sets the ReferenceMapper which searches for references. - * - * @param referenceMapper - */ - public PropertiesDefinitionResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * Resolves all PropertiesDefinitions inside of a Definitions and stores the mapping into the - * ToscaReferenceMapper. - * - * @param definitions The Definitions object. - * @return true if an error occurred, false if not - */ - public boolean resolve(final PropertiesDefinition propertiesDefinition) { - if (propertiesDefinition.getElement() != null ^ propertiesDefinition.getType() != null) { - if (propertiesDefinition.getElement() != null) { - this.referenceMapper.searchXMLElement(propertiesDefinition.getElement()); - } else { - this.referenceMapper.searchXMLType(propertiesDefinition.getType()); - } - } else { - return true; - } - - return false; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ReferenceMapper.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ReferenceMapper.java deleted file mode 100644 index 33e97cc74..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ReferenceMapper.java +++ /dev/null @@ -1,744 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpression; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.opentosca.container.core.engine.impl.ServiceHandler; -import org.opentosca.container.core.engine.impl.ToscaEngineServiceImpl; -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.engine.impl.resolver.data.ReferenceResultWrapper; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Properties.PropertyMappings; -import org.opentosca.container.core.tosca.model.TCapability; -import org.opentosca.container.core.tosca.model.TExportedInterface; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TRequirement; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * The ReferenceMapper provides functionality for searching of specific elements inside of the - * imported documents of TOSCA and mapping the found data to the reference. - * - * TODO This class can be refactored to reduce amount of code. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - * - */ -public class ReferenceMapper { - - - private final XPath xpath = XPathFactory.newInstance().newXPath(); - private CSARID csarID = null; - private Map> mapOfNSToDocuments = null; - - private final Logger LOG = LoggerFactory.getLogger(ReferenceMapper.class); - - /** - * This defines some default namespaces in which elements can be nested. - */ - NamespaceContext nsContext = new NamespaceContext() { - - - @Override - public String getNamespaceURI(final String prefix) { - String uri; - if (prefix.equals("wsdl")) { - uri = "http://schemas.xmlsoap.org/wsdl/"; - } else if (prefix.equals("xs")) { - uri = "http://www.w3.org/2001/XMLSchema"; - } else if (prefix.equals("tosca")) { - uri = "http://docs.oasis-open.org/tosca/ns/2011/12"; - } else { - uri = null; - } - return uri; - } - - // Dummy implementation - // Suppress warnings because of this method is auto generated and not - // used. - @SuppressWarnings("rawtypes") - @Override - public Iterator getPrefixes(final String val) { - return null; - } - - // Dummy implemenation - not used! - @Override - public String getPrefix(final String uri) { - return null; - } - }; - - - /** - * Initialize a new ReferenceMapper. - * - * @param csarID The identification of the CSAR. - * @param mapOfNSToDocuments the data structure containing the DOM Documents in which an instance of - * this ReferenceMapper searches. - */ - public ReferenceMapper(final CSARID csarID, final Map> mapOfNSToDocuments) { - this.csarID = csarID; - this.mapOfNSToDocuments = mapOfNSToDocuments; - this.xpath.setNamespaceContext(this.nsContext); - } - - /** - * This method stores a object into the ToscaReferenceMapper for future use. - * - * @param csarID the ID of the CSAR containing the object. - * @param reference the reference which shall describe the object. - * @param objectToStore the object to store. - */ - public void storeJAXBObjectIntoToscaReferenceMapper(final QName reference, final Object objectToStore) { - final Node node = ServiceHandler.xmlSerializerService.getXmlSerializer().marshalToNode(objectToStore); - ToscaEngineServiceImpl.toscaReferenceMapper.storeReference(this.csarID, reference, node); - } - - /** - * This method stores a certain Node which was requested by the ReferenceResolver. The Node is - * attached to the passed THOR ID and the passed QName which references the Node in a TOSCA document - * of the referenced THOR. - * - * @param csarID The ID of the current THOR environment. - * @param nodeReference Reference of the Node to store. - * @param nodeToStore Node to store. - */ - private void storeNodeIntoReferenceMapper(final QName nodeReference, final Node nodeToStore) { - ToscaEngineServiceImpl.toscaReferenceMapper.storeReference(this.csarID, nodeReference, nodeToStore); - } - - /** - * This method stores a certain Document which nests a requested Node by the ReferenceResolver. The - * Document is attached to the passed THOR ID and the passed QName of the requested Node which - * references the Node in a TOSCA document of the referenced THOR. - * - * @param csarID The ID of the current THOR environment. - * @param nodeReference Reference of the Node which is nested by the passed Document. - * @param documentToStore Document to store. - */ - protected void storeDocumentIntoReferenceMapper(final QName nodeReference, final Document documentToStore) { - ToscaEngineServiceImpl.toscaReferenceMapper.storeDocument(this.csarID, nodeReference, documentToStore); - } - - /** - * Stores an exported interface of a service template into the ToscaReferenceMapper. - * - * @param csarID CSARID of the owning CSAR - * @param serviceTemplateID ServiceTemplateID for whicht the interface is exported - * @param iface the exported interface JAXB object - */ - protected void storeExportedInterface(final CSARID csarID, final QName serviceTemplateID, - final TExportedInterface iface) { - ToscaEngineServiceImpl.toscaReferenceMapper.storeExportedInterface(csarID, serviceTemplateID, iface); - } - - /** - * Searches for elements inside of DOM documents which have an ID (note that an attribute called id - * is not an xsd:ID necessarily). - * - * @param elementReference The QName which references the element. - * @param documentType The Type of document in which shall be searched. - * @return the ReferenceResultWrapper in case of success, otherwise null - */ - private ReferenceResultWrapper searchElementWithID(final QName elementReference, final String documentType) { - - this.LOG.debug("Search for an ID for the QName \"" + elementReference.toString() + "\"."); - - // if there are no documents - if (this.mapOfNSToDocuments.isEmpty()) { - this.LOG.error("There are no known documents."); - return null; - } - - // if there is no document list defined for the namespace of the element - // reference there cannot be searched - if (!this.mapOfNSToDocuments.containsKey(elementReference.getNamespaceURI())) { - this.LOG.warn("The namespace \"" + elementReference.getNamespaceURI() - + "\" was not found inside the data structure."); - return null; - } - - // xpath expression which selects by ID - final String exprString = "//*[@id=\"" + elementReference.getLocalPart() + "\"]"; - - // search inside of the documents of the passed reference namespace - for (final Document doc : this.mapOfNSToDocuments.get(elementReference.getNamespaceURI())) { - - // checks if the document type is the passed one - if (doc.getFirstChild().getLocalName().equals(documentType)) { - - // search and wrap the result - try { - final XPathExpression expr = this.xpath.compile(exprString); - final Object result = expr.evaluate(doc, XPathConstants.NODESET); - final NodeList list = (NodeList) result; - if (list.getLength() > 0) { - final ReferenceResultWrapper wrapper = new ReferenceResultWrapper(); - wrapper.setDoc(doc); - wrapper.setNodeList(list); - return wrapper; - } - - } - catch (final XPathExpressionException e) { - e.printStackTrace(); - this.LOG.error("An error occured while searching inside the document via xpath. The message is: " - + e.getMessage()); - } - } - } - - this.LOG.warn("The ID \"" + elementReference + "\" was not found."); - - return null; - } - - /** - * Searches for elements inside of DOM documents which have an ID (note that an attribute called id - * is not an xsd:ID necessarily). - * - * @param reference The QName which references the element. - * @return the ReferenceResultWrapper in case of success, otherwise null - */ - private ReferenceResultWrapper searchElementWithIDWithoutNamespacePresort(final QName reference) { - - this.LOG.debug("Search somewhere else."); - - // if there are no documents - if (this.mapOfNSToDocuments.isEmpty()) { - this.LOG.error("There are no known documents."); - return null; - } - - // xpath expression which selects by ID - final String exprString = "//*[@id=\"" + reference.getLocalPart() + "\"]"; - - // search inside of all known documents - for (final String key : this.mapOfNSToDocuments.keySet()) { - for (final Document doc : this.mapOfNSToDocuments.get(key)) { - - // search and wrap the result - try { - - final XPathExpression expr = this.xpath.compile(exprString); - final Object result = expr.evaluate(doc, XPathConstants.NODESET); - final NodeList list = (NodeList) result; - if (list.getLength() > 0) { - final ReferenceResultWrapper wrapper = new ReferenceResultWrapper(); - wrapper.setDoc(doc); - wrapper.setNodeList(list); - return wrapper; - } - - } - catch (final XPathExpressionException e) { - e.printStackTrace(); - this.LOG.error("An error occured while searching inside the document via xpath. The message is: " - + e.getMessage()); - } - } - } - - this.LOG.error("The ID \"" + reference + "\" was not found."); - - return null; - } - - /** - * Searches for elements inside of DOM documents with a certain name. - * - * @param elementReference The QName which references the element. The local part of this shall be - * the value of the attribute name. - * @param elementName The local name of the requested element. If the parameter is null, this method - * searches for all elements. - * @param documentType The Type of document in which shall be searched. - * @return the ReferenceResultWrapper in case of success, otherwise null - */ - private ReferenceResultWrapper searchElementWithName(final QName elementReference, String elementName, - final String documentType) { - - // if there are no documents - if (this.mapOfNSToDocuments.isEmpty()) { - this.LOG.error("There are no known documents."); - return null; - } - - // if there is no document list defined for the namespace of the element - // reference there cannot be searched - if (!this.mapOfNSToDocuments.containsKey(elementReference.getNamespaceURI())) { - this.LOG.warn("The namespace \"" + elementReference.getNamespaceURI() - + "\" was not found inside the data structure."); - return null; - } - - // no name passed, thus search for all via wildcard - if (elementName == null) { - elementName = "*"; - } - - this.LOG.debug("Search for a name for the QName \"" + elementReference.toString() + "\" inside of an element \"" - + elementName + "\"."); - - // xpath expression which selects by element name and the attribute name - // of the element - final String exprString = "//" + elementName + "[@name=\"" + elementReference.getLocalPart() + "\"]"; - - // search inside of the documents of the passed reference namespace - for (final Document doc : this.mapOfNSToDocuments.get(elementReference.getNamespaceURI())) { - - // checks if the document type is the passed one - if (doc.getFirstChild().getLocalName().equals(documentType)) { - - try { - - final XPathExpression expr = this.xpath.compile(exprString); - final Object result = expr.evaluate(doc, XPathConstants.NODESET); - final NodeList list = (NodeList) result; - if (list.getLength() > 0) { - final ReferenceResultWrapper wrapper = new ReferenceResultWrapper(); - wrapper.setDoc(doc); - wrapper.setNodeList(list); - return wrapper; - } - - } - catch (final XPathExpressionException e) { - e.printStackTrace(); - this.LOG.error("An error occured while searching inside the document via xpath. The message is: " - + e.getMessage()); - } - } - } - - this.LOG.warn("The element with the name \"" + elementReference + "\" was not found."); - - return null; - } - - /** - * Searches for elements inside of DOM documents with a certain name. This method searches inside - * all known documents for a certain THOR. - * - * @param reference The QName which references the element. - * @param elementName The name of the requested element. If the parameter is null, this method - * searches for all kind of elements. - * @return the ReferenceResultWrapper in case of success, otherwise null - */ - private ReferenceResultWrapper searchElementWithNameWithoutNamespacePresort(final QName reference, - String elementName) { - - this.LOG.debug("Search somewhere else."); - - // if there are no documents - if (this.mapOfNSToDocuments.isEmpty()) { - this.LOG.error("There are no known documents."); - return null; - } - - // no name passed, thus search for all via wildcard - if (elementName == null) { - elementName = "*"; - } - - // xpath expression which selects by element name and the attribute name - // of the element - // String exprString = "//" + elementName + "[@name=\"" + - // reference.getLocalPart() + "\" and @targetNamespace='" + - // reference.getNamespaceURI() + "']"; - final String exprString = "//" + elementName + "[@name=\"" + reference.getLocalPart() + "\"]"; - this.LOG.debug(exprString); - - // search inside of all known documents - for (final String key : this.mapOfNSToDocuments.keySet()) { - for (final Document doc : this.mapOfNSToDocuments.get(key)) { - - // search and wrap the result - try { - - final XPathExpression expr = this.xpath.compile(exprString); - final Object result = expr.evaluate(doc, XPathConstants.NODESET); - final NodeList list = (NodeList) result; - if (list.getLength() > 0) { - final ReferenceResultWrapper wrapper = new ReferenceResultWrapper(); - wrapper.setDoc(doc); - wrapper.setNodeList(list); - return wrapper; - } - - } - catch (final XPathExpressionException e) { - e.printStackTrace(); - this.LOG.error("An error occured while searching inside the document via xpath. The message is: " - + e.getMessage()); - } - } - } - - this.LOG.error("The element with the name \"" + reference + "\" was not found."); - - return null; - } - - /** - * Searches for an element inside the ServiceTemplate via IDRef and stores it. Possible are only - * TNodeTemplates. - * - * @param targetElement IDREF as Object - * @return true means no error, false one or more errors - */ - protected boolean searchElementViaIDREF(final Object targetElement, final String targetNamespace) { - - this.LOG.debug("Resolve an IDREF."); - - if (!(targetElement instanceof TNodeTemplate || targetElement instanceof TRequirement - || targetElement instanceof TCapability)) { - this.LOG.error("The referenced element is of the Type \"" + targetElement.getClass().getCanonicalName() - + "\". It has to be one of NodeTemplate, Requirement or Capability."); - return false; - } - - Node node = null; - String id = null; - - node = ServiceHandler.xmlSerializerService.getXmlSerializer().marshalToNode(targetElement); - - // if not null, store it and nesting Document - if (node != null) { - - id = node.getAttributes().getNamedItem("id").getTextContent(); - storeNodeIntoReferenceMapper(new QName(targetNamespace, id), node); - return true; - - } else { - this.LOG.error("There occured an error while marshalling \"" + id + "\" to a Node."); - } - - return false; - } - - /** - * Search an element of TOSCA. If the element is available, store it and the containing document - * inside the referenceMapper. The QName parameter has to contain the ID of the demanded element as - * local part. Due the new version of TOSCA there can be references to the attribute name instead of - * ID. In this case please use the method searchToscaElementByQNameWithName. - * - * TODO check the namespace the requested element has to be inside - * - * @param reference the QName of the demanded element - * @return true means no error, false one or more errors - */ - protected boolean searchToscaElementByQNameWithID(final QName reference) { - - // reference is null, therefore there is no reference to resolve - if (reference == null || reference.toString().equals("")) { - return true; - } - - // search - this.LOG.debug("Search for a element inside of a Definitions with the QName \"" + reference + "\"."); - ReferenceResultWrapper wrapper = searchElementWithID(reference, "Definitions"); - - // search again everywhere - if (wrapper == null) { - wrapper = searchElementWithIDWithoutNamespacePresort(reference); - if (wrapper == null) { - - // not found, thus error - this.LOG.error("The requested Element was not found!"); - return false; - } else { - this.LOG.info("Luckily found the requested Element!"); - } - } - - // found something - if (wrapper.getNodeList().getLength() == 1) { - - // found exactly the requested - storeNodeIntoReferenceMapper(reference, wrapper.getNodeList().item(0)); - this.LOG.info("The element " + reference + " was found."); - return true; - } else if (wrapper.getNodeList().getLength() == 0) { - - // found nothing, but should be catched by the both conditions - // wrapper == null - this.LOG.debug("The element was not found."); - } else { - - // found too much - this.LOG.error("There are " + wrapper.getNodeList().getLength() - + " elements with the requested QName found inside this document. The following Nodes are found:"); - final NodeList foundElements = wrapper.getNodeList(); - for (int itr = 0; itr < foundElements.getLength(); itr++) { - this.LOG.debug(ServiceHandler.xmlSerializerService.getXmlSerializer() - .docToString(foundElements.item(itr), true)); - } - } - - return false; - } - - /** - * Search an element of TOSCA. If the element is available, store it and the containing document - * inside the referenceMapper. The QName parameter has to contain the ID of the demanded element as - * local part. Due the new version of TOSCA there can be references to the attribute name instead of - * ID. In this case please use the method searchToscaElementByQNameWithName. - * - * TODO check the namespace the requested element has to be inside - * - * @param reference the QName of the demanded element - * @return true means no error, false one or more errors - */ - protected boolean searchToscaElementByQNameWithName(final QName reference, final ElementNamesEnum element) { - - // reference is null, therefore there is no reference to resolve - if (reference == null || reference.toString().equals("")) { - return true; - } - - // search - this.LOG.debug("Search for a " + element + " inside of a Definitions with the name \"" - + reference.getLocalPart() + "\" inside the namespace \"" + reference.getNamespaceURI() + "\"."); - ReferenceResultWrapper wrapper = searchElementWithName(reference, element.toString(), "Definitions"); - - // search again everywhere - if (wrapper == null) { - wrapper = searchElementWithNameWithoutNamespacePresort(reference, element.toString()); - if (wrapper == null) { - - // not found, thus error - this.LOG.error("The requested Element was not found!"); - return false; - } else { - this.LOG.info("Luckily found the requested Element!"); - } - } - - // found something - if (wrapper.getNodeList().getLength() == 1) { - - // found exactly the requested - storeNodeIntoReferenceMapper(reference, wrapper.getNodeList().item(0)); - this.LOG.info("The element " + reference + " was found."); - return true; - } else - - // found nothing, but should be catched by the both conditions - // wrapper == null - if (wrapper.getNodeList().getLength() == 0) { - this.LOG.debug("The element was not found."); - } else { - - // found too much - this.LOG.error("There are " + wrapper.getNodeList().getLength() - + " elements with the requested QName found inside this document. The following Nodes are found:"); - final NodeList foundElements = wrapper.getNodeList(); - for (int itr = 0; itr < foundElements.getLength(); itr++) { - this.LOG.debug(ServiceHandler.xmlSerializerService.getXmlSerializer() - .docToString(foundElements.item(itr), true)); - } - } - - return false; - } - - /** - * Search an element inside a XML Schema. If the element is available, store it and the containing - * document inside the referenceMapper. - * - * @param reference the QName of the demanded element - * @return true means no error, false one or more errors - */ - protected boolean searchXMLElement(final QName element) { - - // search - this.LOG.debug("Search for a element with the QName \"" + element + "\"."); - ReferenceResultWrapper wrapper = searchElementWithName(element, null, "schema"); - - // search again everywhere - if (wrapper == null) { - wrapper = searchElementWithNameWithoutNamespacePresort(element, "xs:element"); - if (wrapper == null) { - - // not found, thus error - this.LOG.error("The requested Element was not found!"); - return false; - } else { - this.LOG.info("Luckily found the requested Element!"); - } - } - - // found something - if (wrapper.getNodeList().getLength() == 1) { - - // found exactly the requested - storeNodeIntoReferenceMapper(element, wrapper.getNodeList().item(0)); - storeDocumentIntoReferenceMapper(element, wrapper.getDoc()); - return true; - } else if (wrapper.getNodeList().getLength() == 0) { - - // found nothing, but should be catched by the both conditions - // wrapper == null - this.LOG.debug("The element was not found."); - } else { - - // found too much - this.LOG.error("There are " + wrapper.getNodeList().getLength() - + " elements with the requested QName found inside this document. The following Nodes are found:"); - final NodeList foundElements = wrapper.getNodeList(); - for (int itr = 0; itr < foundElements.getLength(); itr++) { - this.LOG.debug(ServiceHandler.xmlSerializerService.getXmlSerializer() - .docToString(foundElements.item(itr), true)); - } - - } - - return false; - } - - /** - * Search type inside a XML Schema. If the element is available, store it and the containing - * document inside the referenceMapper. - * - * @param reference the QName of the demanded element - * @return true means no error, false one or more errors - */ - protected boolean searchXMLType(final QName type) { - - // search - this.LOG.debug("Search for a ComplexType with the QName \"" + type + "\"."); - ReferenceResultWrapper wrapper = searchElementWithName(type, "xs:complexType", "schema"); - - // search again everywhere - if (wrapper == null) { - wrapper = searchElementWithNameWithoutNamespacePresort(type, "xs:complexType"); - if (wrapper == null) { - - // not found, thus error - this.LOG.error("The requested Element was not found!"); - return false; - } else { - this.LOG.info("Luckily found the requested Element!"); - } - } - - // found something - if (wrapper.getNodeList().getLength() == 1) { - - // found exactly the requested - storeNodeIntoReferenceMapper(type, wrapper.getNodeList().item(0)); - storeDocumentIntoReferenceMapper(type, wrapper.getDoc()); - return true; - } else if (wrapper.getNodeList().getLength() == 0) { - - // found nothing, but should be catched by the both conditions - // wrapper == null - this.LOG.debug("The complex type was not found."); - } else { - - // found too much - this.LOG.error("There are " + wrapper.getNodeList().getLength() - + " complex types with the requested QName found inside this document. The following Nodes are found:"); - final NodeList foundElements = wrapper.getNodeList(); - for (int itr = 0; itr < foundElements.getLength(); itr++) { - this.LOG.debug(ServiceHandler.xmlSerializerService.getXmlSerializer() - .docToString(foundElements.item(itr), true)); - } - - } - - return false; - } - - /** - * Search a definition for a REST body inside of a XML Schema. If the element is available, store it - * and the containing document inside the referenceMapper. - * - * @param reference the QName of the demanded element - * @return true means no error, false one or more errors - */ - protected boolean searchRESTBody(final QName body) { - - // TODO dont know how to search, thus search for all - this.LOG.debug("Search for a REST body with the QName \"" + body + "\"."); - ReferenceResultWrapper wrapper = searchElementWithName(body, null, "schema"); - - // search again everywhere - if (wrapper == null) { - wrapper = searchElementWithNameWithoutNamespacePresort(body, ElementNamesEnum.ALLELEMENTS.toString()); - if (wrapper == null) { - - // not found, thus error - this.LOG.error("The requested Element was not found!"); - return false; - } else { - this.LOG.info("Luckily found the requested Element!"); - } - } - - // found something - if (wrapper.getNodeList().getLength() == 1) { - - // found exactly the requested - storeNodeIntoReferenceMapper(body, wrapper.getNodeList().item(0)); - storeDocumentIntoReferenceMapper(body, wrapper.getDoc()); - return true; - } else if (wrapper.getNodeList().getLength() == 0) { - - // found nothing, but should be catched by the both conditions - // wrapper == null - this.LOG.debug("The element was not found."); - } else { - - // found too much - this.LOG.error("There are " + wrapper.getNodeList().getLength() - + " elements with the requested QName found inside this document. The following Nodes are found:"); - final NodeList foundElements = wrapper.getNodeList(); - for (int itr = 0; itr < foundElements.getLength(); itr++) { - this.LOG.debug(ServiceHandler.xmlSerializerService.getXmlSerializer() - .docToString(foundElements.item(itr), true)); - } - - } - - return false; - } - - public void storeRelationshipTemplateIDForServiceTemplateAndCSAR(final CSARID csarID, final QName serviceTemplateId, - final String id) { - ToscaEngineServiceImpl.toscaReferenceMapper.storeRelationshipTemplateIDForServiceTemplateAndCSAR(csarID, - serviceTemplateId, - id); - } - - public void storeNodeTemplateIDForServiceTemplateAndCSAR(final CSARID csarID, final QName serviceTemplateID, - final String id) { - ToscaEngineServiceImpl.toscaReferenceMapper.storeNodeTemplateIDForServiceTemplateAndCSAR(csarID, - serviceTemplateID, id); - } - - public void storeServiceTemplateBoundsProperties(final CSARID csarID, final QName serviceTemplateID, - final String propertiesContent, - final PropertyMappings propertyMappings) { - ToscaEngineServiceImpl.toscaReferenceMapper.storeServiceTemplateBoundsPropertiesInformation(csarID, - serviceTemplateID, - propertiesContent, - propertyMappings); - } -} - diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RelationshipTypeImplementationResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RelationshipTypeImplementationResolver.java deleted file mode 100644 index d9692ccec..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RelationshipTypeImplementationResolver.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TImplementationArtifact; -import org.opentosca.container.core.tosca.model.TRelationshipTypeImplementation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RelationshipTypeImplementationResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(RelationshipTypeImplementationResolver.class); - - - public RelationshipTypeImplementationResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * - * @param definitions - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - if (element instanceof TRelationshipTypeImplementation) { - - final TRelationshipTypeImplementation relationshipTypeImplementation = - (TRelationshipTypeImplementation) element; - - // store the RelationshipTypeImplementation - String targetNamespace; - if (relationshipTypeImplementation.getTargetNamespace() != null - && !relationshipTypeImplementation.getTargetNamespace().equals("")) { - targetNamespace = relationshipTypeImplementation.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - - this.LOG.debug("Resolve the RelationshipTypeImplementation \"" + targetNamespace + ":" - + relationshipTypeImplementation.getName() + "\"."); - - // Tags - // nothing to do here - - // DerivedFrom - if (relationshipTypeImplementation.getDerivedFrom() != null - && relationshipTypeImplementation.getDerivedFrom().getRelationshipTypeImplementationRef() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(relationshipTypeImplementation.getDerivedFrom() - .getRelationshipTypeImplementationRef(), - ElementNamesEnum.RELATIONSHIPTYPEIMPLEMENTATION); - } - - // RequieredContainerFeatures - // nothing to do here - - // ImplementationArtifacts - if (relationshipTypeImplementation.getImplementationArtifacts() != null) { - for (final TImplementationArtifact implementationArtifact : relationshipTypeImplementation.getImplementationArtifacts() - .getImplementationArtifact()) { - final int iANumber = - relationshipTypeImplementation.getImplementationArtifacts().getImplementationArtifact() - .indexOf(implementationArtifact); - errorOccurred = errorOccurred || new ImplementationArtifactResolver( - this.referenceMapper).resolve(implementationArtifact, targetNamespace, - relationshipTypeImplementation.getName(), iANumber); - } - } - - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - relationshipTypeImplementation.getName()), relationshipTypeImplementation); - } - } - return errorOccurred; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RelationshipTypeResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RelationshipTypeResolver.java deleted file mode 100644 index 2eae613eb..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RelationshipTypeResolver.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TRelationshipType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The RelationshipTypeResolver resolves references inside of TOSCA RelationshipTypes according to - * the TOSCA specification wd14. Each found element and the document in which the element is nested - * is stored by the org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a RelationshipType: Definitions has to be valid in all kind of - * meanings. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class RelationshipTypeResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(RelationshipTypeResolver.class); - - - /** - * Instantiate an object of the Resolver to resolve references inside of RelationshipTypes. This - * constructor sets the ReferenceMapper which searches for references. - * - * @param referenceMapper - */ - public RelationshipTypeResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * Resolves all RelationshipTypes inside of a Definitions and stores the mapping into the - * ToscaReferenceMapper. - * - * @param definitions The Definitions object. - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - if (element instanceof TRelationshipType) { - - final TRelationshipType relationshipType = (TRelationshipType) element; - - // store the RelationshipType - String targetNamespace; - if (relationshipType.getTargetNamespace() != null - && !relationshipType.getTargetNamespace().equals("")) { - targetNamespace = relationshipType.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - relationshipType.getName()), relationshipType); - - this.LOG.debug("Resolve the RelationshipType \"" + targetNamespace + ":" + relationshipType.getName() - + "\"."); - - // Tags - // nothing to do here - - // DerivedFrom - if (relationshipType.getDerivedFrom() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(relationshipType.getDerivedFrom() - .getTypeRef(), - ElementNamesEnum.RELATIONSHIPTYPE); - } - - // PropertiesDefinition - if (relationshipType.getPropertiesDefinition() != null) { - if (new PropertiesDefinitionResolver( - this.referenceMapper).resolve(relationshipType.getPropertiesDefinition())) { - this.LOG.error("The RelationshipType \"" + targetNamespace + ":" + relationshipType.getName() - + "\" specifies both attributes in its child element PropertiesDefinition which is not allowed."); - errorOccurred = true; - } - } - - // InstanceStates - // nothing to do here - - // SourceInterfaces - // TODO not clear what to implement and what we aim for - - // TargetInterfaces - // TODO not clear what to implement and what we aim for - - // TODO implement the rules of the spec mentioned in - // 8.2-ValidSource/Target - // ValidSource - if (relationshipType.getValidSource() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(relationshipType.getValidSource() - .getTypeRef(), - ElementNamesEnum.ALLELEMENTS); - } - - // TODO implement the rules of the spec mentioned in - // 8.2-ValidSource/Target - // ValidTarget - if (relationshipType.getValidTarget() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(relationshipType.getValidTarget() - .getTypeRef(), - ElementNamesEnum.ALLELEMENTS); - } - } - } - return errorOccurred; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RequirementTypeResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RequirementTypeResolver.java deleted file mode 100644 index 10282d1bd..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/RequirementTypeResolver.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TRequirementType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RequirementTypeResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(RequirementTypeResolver.class); - - - public RequirementTypeResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * - * @param definitions - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions) { - - boolean errorOccurred = false; - - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - if (element instanceof TRequirementType) { - - final TRequirementType requirementType = (TRequirementType) element; - - // store the RequirementType - String targetNamespace; - if (requirementType.getTargetNamespace() != null && !requirementType.getTargetNamespace().equals("")) { - targetNamespace = requirementType.getTargetNamespace(); - } else { - targetNamespace = definitions.getTargetNamespace(); - } - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - requirementType.getName()), requirementType); - - this.LOG.debug("Resolve the RequirementType \"" + targetNamespace + ":" + requirementType.getName() - + "\"."); - - if (requirementType.getRequiredCapabilityType() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(requirementType.getRequiredCapabilityType(), - ElementNamesEnum.CAPABILITYTYPE); - } - - // Tags - // nothing to do here - - // DerivedFrom - if (requirementType.getDerivedFrom() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(requirementType.getDerivedFrom() - .getTypeRef(), - ElementNamesEnum.REQUIREMENTTYPE); - } - - // PropertiesDefinition - if (requirementType.getPropertiesDefinition() != null) { - if (new PropertiesDefinitionResolver( - this.referenceMapper).resolve(requirementType.getPropertiesDefinition())) { - this.LOG.error("The NodeType \"" + targetNamespace + ":" + requirementType.getName() - + "\" specifies both attributes in its child element PropertiesDefinition which is not allowed."); - errorOccurred = true; - } - } - } - } - return errorOccurred; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ServiceTemplateResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ServiceTemplateResolver.java deleted file mode 100644 index c0f3f185a..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/ServiceTemplateResolver.java +++ /dev/null @@ -1,362 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.impl.ServiceHandler; -import org.opentosca.container.core.engine.impl.ToscaEngineServiceImpl; -import org.opentosca.container.core.engine.impl.resolver.data.ElementNamesEnum; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Properties.PropertyMappings; -import org.opentosca.container.core.tosca.model.TCapability; -import org.opentosca.container.core.tosca.model.TDeploymentArtifact; -import org.opentosca.container.core.tosca.model.TEntityTemplate; -import org.opentosca.container.core.tosca.model.TExportedInterface; -import org.opentosca.container.core.tosca.model.TExtensibleElements; -import org.opentosca.container.core.tosca.model.TNodeTemplate; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPlans; -import org.opentosca.container.core.tosca.model.TPolicy; -import org.opentosca.container.core.tosca.model.TRelationshipTemplate; -import org.opentosca.container.core.tosca.model.TRequirement; -import org.opentosca.container.core.tosca.model.TServiceTemplate; -import org.opentosca.container.core.tosca.model.TTags; -import org.opentosca.container.core.tosca.model.TTopologyTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; - -/** - * The ServiceTemplateResolver resolves references inside of TOSCA ServiceTemplates according to the - * TOSCA specification wd14. Each found element and the document in which the element is nested is - * stored by the org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a ServiceTemplate: Definitions has to be valid in all kind of - * meanings. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class ServiceTemplateResolver extends GenericResolver { - - private final Logger LOG = LoggerFactory.getLogger(ServiceTemplateResolver.class); - - - /** - * Instantiate an object of the Resolver to resolve references inside of ServiceTemplates. This - * constructor sets the ReferenceMapper which searches for references. - * - * @param referenceMapper - */ - public ServiceTemplateResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * Resolves all ServiceTemplates inside of a Definitions and stores the mapping into the - * ToscaReferenceMapper. - * - * @param definitions The Definitions object. - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions definitions, final CSARID csarID) { - - boolean errorOccurred = false; - final QName definitionsID = new QName(definitions.getTargetNamespace(), definitions.getId()); - - // store the Definitions for further search - final Document definitionsDocument = - ServiceHandler.xmlSerializerService.getXmlSerializer().marshalToDocument(definitions); - this.referenceMapper.storeDocumentIntoReferenceMapper(definitionsID, definitionsDocument); - - // resolve all the ServiceTemplates - for (final TExtensibleElements element : definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { - - if (element instanceof TServiceTemplate) { - - final TServiceTemplate serviceTemplate = (TServiceTemplate) element; - String targetNamespace = serviceTemplate.getTargetNamespace(); - if (targetNamespace == null || targetNamespace.equals("")) { - targetNamespace = definitions.getTargetNamespace(); - } - final QName serviceTemplateID = new QName(targetNamespace, serviceTemplate.getId()); - - this.LOG.debug("Resolve the ServiceTemplate \"" + serviceTemplateID + "\"."); - - // store the ServiceTemplate - ToscaEngineServiceImpl.toscaReferenceMapper.storeServiceTemplateIDForCSARID(serviceTemplateID, csarID); - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(serviceTemplateID, serviceTemplate); - - // resolve the SubstitutableNodeType - if (serviceTemplate.getSubstitutableNodeType() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(serviceTemplate.getSubstitutableNodeType(), - ElementNamesEnum.NODETYPE); - } - - // resolve the other data objects - errorOccurred = errorOccurred || this.resolveTags(serviceTemplate.getTags(), targetNamespace); - errorOccurred = errorOccurred - || this.resolveBoundaryDefinitions(serviceTemplate, definitions.getTargetNamespace(), csarID); - errorOccurred = errorOccurred - || this.resolveTopologyTemplate(serviceTemplate.getTopologyTemplate(), serviceTemplateID, csarID); - errorOccurred = errorOccurred - || this.resolvePlans(serviceTemplate.getPlans(), definitionsID, serviceTemplateID, csarID); - } - } - return errorOccurred; - } - - /** - * Resolves Tags inside of a ServiceTemplate and stores the mapping into the ToscaReferenceMapper. - * - * @param tags The TTags object. - * @return true if an error occurred, false if not - */ - private boolean resolveTags(final TTags tags, final String targetNamespace) { - // nothing to do here - return false; - } - - /** - * TODO Implement this! - * - * Resolves BoundaryDefinitions inside of a ServiceTemplate and stores the mapping into the - * ToscaReferenceMapper. - * - * @param definitionsTargetNamespace - * @param boundaryDefinitions the TBoundaryDefinitions object. - * @return true if an error occurred, false if not - */ - private boolean resolveBoundaryDefinitions(final TServiceTemplate serviceTemplate, - final String definitionsTargetNamespace, final CSARID csarID) { - - if (serviceTemplate.getBoundaryDefinitions() == null) { - return false; - } else { - - String targetNamespace; - if (null == serviceTemplate.getTargetNamespace() - || serviceTemplate.getTargetNamespace().trim().equals("")) { - targetNamespace = definitionsTargetNamespace; - } else { - targetNamespace = serviceTemplate.getTargetNamespace(); - } - - final QName serviceTemplateID = new QName(targetNamespace, serviceTemplate.getId()); - final TBoundaryDefinitions boundaryDefinitions = serviceTemplate.getBoundaryDefinitions(); - - if (boundaryDefinitions.getProperties() != null) { - - final String propertiesContent = - ServiceHandler.xmlSerializerService.getXmlSerializer() - .marshalToString(boundaryDefinitions.getProperties()); - final PropertyMappings propertyMappings = boundaryDefinitions.getProperties().getPropertyMappings(); - - // for (TPropertyMapping mapping : - // propertyMappings.getPropertyMapping()){ - // LOG.debug("mapping: " + - // mapping.getTargetObjectRef().toString()); - // } - - this.referenceMapper.storeServiceTemplateBoundsProperties(csarID, serviceTemplateID, propertiesContent, - propertyMappings); - - if (boundaryDefinitions.getProperties().getPropertyMappings() != null) { - - // for (TPropertyMapping propertyMapping : - // boundaryDefinitions.getProperties().getPropertyMappings().getPropertyMapping()) - // { - // TODO implement - // } - // TODO implement - } - // TODO implement - } - - if (boundaryDefinitions.getInterfaces() != null) { - // resolve Interfaces - for (final TExportedInterface iface : boundaryDefinitions.getInterfaces().getInterface()) { - - if (iface.getOperation().size() > 0) { - this.referenceMapper.storeExportedInterface(csarID, serviceTemplateID, iface); - } - - // TODO implement - - } - - } - - // TODO implement - } - // TODO implement - return false; - } - - /** - * Resolves the TopologyTemplate inside of a ServiceTemplate and stores the mapping into the - * ToscaReferenceMapper. - * - * @param topologyTemplate the TTopologyTemplate object. - * @param definitions the Definitions object. - * @return true if an error occurred, false if not - */ - private boolean resolveTopologyTemplate(final TTopologyTemplate topologyTemplate, final QName serviceTemplateID, - final CSARID csarID) { - - final String targetNamespace = serviceTemplateID.getNamespaceURI(); - - boolean errorOccurred = false; - - // resolve all NodeTemplates and RelationshipTemplates - if (topologyTemplate.getNodeTemplateOrRelationshipTemplate().size() > 0) { - for (final TEntityTemplate template : topologyTemplate.getNodeTemplateOrRelationshipTemplate()) { - - // NodeTemplates - if (template instanceof TNodeTemplate) { - final TNodeTemplate nodeTemplate = (TNodeTemplate) template; - - this.referenceMapper.storeNodeTemplateIDForServiceTemplateAndCSAR(csarID, serviceTemplateID, - nodeTemplate.getId()); - - final QName nodeTemplateID = new QName(targetNamespace, nodeTemplate.getId()); - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(nodeTemplateID, nodeTemplate); - - // resolve the NodeType - if (nodeTemplate.getType() != null && !nodeTemplate.getType().toString().equals("")) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(nodeTemplate.getType(), - ElementNamesEnum.NODETYPE); - } - - // Properties - // nothing to do here - - // PropertyConstraints - // nothing to do here - - // Requirements - if (nodeTemplate.getRequirements() != null) { - for (final TRequirement requirement : nodeTemplate.getRequirements().getRequirement()) { - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - requirement.getId()), requirement); - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(requirement.getType(), - ElementNamesEnum.REQUIREMENTTYPE); - } - } - - // Capabilities - if (nodeTemplate.getCapabilities() != null) { - for (final TCapability capability : nodeTemplate.getCapabilities().getCapability()) { - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - capability.getId()), capability); - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(capability.getType(), - ElementNamesEnum.CAPABILITYTYPE); - } - } - - // Policies - if (nodeTemplate.getPolicies() != null) { - for (final TPolicy policy : nodeTemplate.getPolicies().getPolicy()) { - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - policy.getName()), policy); - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(policy.getPolicyType(), - ElementNamesEnum.POLICYTYPE); - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithID(policy.getPolicyRef()); - } - } - - // DeploymentArtifacts - if (nodeTemplate.getDeploymentArtifacts() != null - && nodeTemplate.getDeploymentArtifacts().getDeploymentArtifact().size() > 0) { - for (final TDeploymentArtifact deploymentArtifact : nodeTemplate.getDeploymentArtifacts() - .getDeploymentArtifact()) { - errorOccurred = errorOccurred - || new DeploymentArtifactResolver(this.referenceMapper).resolve(deploymentArtifact, - targetNamespace); - } - } - } else - - // RelationshipTemplates - if (template instanceof TRelationshipTemplate) { - - final TRelationshipTemplate relationshipTemplate = (TRelationshipTemplate) template; - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(new QName(targetNamespace, - relationshipTemplate.getId()), relationshipTemplate); - - this.referenceMapper.storeRelationshipTemplateIDForServiceTemplateAndCSAR(csarID, serviceTemplateID, - relationshipTemplate.getId()); - - // resolve the RelationshipType - if (relationshipTemplate.getType() != null - && !relationshipTemplate.getType().toString().equals("")) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchToscaElementByQNameWithName(relationshipTemplate.getType(), - ElementNamesEnum.RELATIONSHIPTYPE); - } - - // Properties - // nothing to do here - - // PropertyConstraints - // nothing to do here - - // SourceElement - if (relationshipTemplate.getSourceElement() != null - && relationshipTemplate.getSourceElement().getRef() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchElementViaIDREF(relationshipTemplate.getSourceElement() - .getRef(), - targetNamespace); - } - - // TargetElement - if (relationshipTemplate.getTargetElement() != null - && relationshipTemplate.getTargetElement().getRef() != null) { - errorOccurred = errorOccurred - || !this.referenceMapper.searchElementViaIDREF(relationshipTemplate.getTargetElement() - .getRef(), - targetNamespace); - } - - // RelationshipConstraints - } - } - } - - return errorOccurred; - } - - /** - * Resolves Plans inside of a ServiceTemplate and stores the mapping into the ToscaReferenceMapper. - * - * @param plans The TPlans object. - * @param csarID - * @return true if an error occurred, false if not - */ - private boolean resolvePlans(final TPlans plans, final QName definitionsID, final QName serviceTemplateID, - final CSARID csarID) { - - if (null == plans) { - return false; - } - - for (final TPlan plan : plans.getPlan()) { - final QName id = new QName(serviceTemplateID.getNamespaceURI(), plan.getId()); - this.referenceMapper.storeJAXBObjectIntoToscaReferenceMapper(id, plan); - ToscaEngineServiceImpl.toscaReferenceMapper.storePlanIDForCSARAndServiceTemplate(csarID, serviceTemplateID, - id); - ToscaEngineServiceImpl.toscaReferenceMapper.storeContainingDefinitionsID(csarID, id, definitionsID); - ToscaEngineServiceImpl.toscaReferenceMapper.storeNamespaceOfPlan(csarID, plan.getId(), - serviceTemplateID.getNamespaceURI()); - } - - return false; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/TypesResolver.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/TypesResolver.java deleted file mode 100644 index 8a997588c..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/TypesResolver.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver; - -import org.opentosca.container.core.tosca.model.Definitions; - -/** - * The ServiceTemplateResolver resolves references inside of TOSCA Types according to the TOSCA - * specification wd14. Each found element and the document in which the element is nested is stored - * by the org.opentosca.core.model.toscareferencemapping.ToscaReferenceMapper. - * - * Preconditions for resolving a Types: Definitions has to be valid in all kind of meanings. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class TypesResolver extends GenericResolver { - - /** - * Instantiate an object of the Resolver to resolve references inside of Types. This constructor - * sets the ReferenceMapper which search for references. - * - * @param referenceMapper - */ - public TypesResolver(final ReferenceMapper referenceMapper) { - super(referenceMapper); - } - - /** - * Resolves a Types and stores the mapping into the ToscaReferenceMapper. - * - * @param definitions The Definitions object. - * @return true if an error occurred, false if not - */ - public boolean resolve(final Definitions def) { - // nothing to do here - return false; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/DefinitionsData.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/DefinitionsData.java deleted file mode 100644 index 34a7c52c3..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/DefinitionsData.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver.data; - -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.Definitions; - -/** - * This DTO stores data of a CSAR and access to nested files as well as the marshalled main - * Definitions. This DTO serves the transfer of the data between the resolver classes of the package - * org.opentosca.toscaengine.service.impl.resolver. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class DefinitionsData { - - private final Definitions mainDef; - private final CSARContent csarContent; - private final CSARID csarID; - - - public DefinitionsData(final Definitions mainDef, final CSARContent csarContent, final CSARID csarID) { - this.mainDef = mainDef; - this.csarContent = csarContent; - this.csarID = csarID; - } - - /** - * @return the main Definitions - */ - public Definitions getMainDefinitions() { - return this.mainDef; - } - - /** - * @return the CSAR content - */ - public CSARContent getCSARContent() { - return this.csarContent; - } - - /** - * @return the CSAR ID - */ - public CSARID getCSARID() { - return this.csarID; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ElementNamesEnum.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ElementNamesEnum.java deleted file mode 100644 index 1203f0b53..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ElementNamesEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver.data; - -/** - * This enum provides the correct names of TOSCA elements which are searched by the ReferenceMapper - * with a name instead of an ID. - * - * @author endrescn@fachschaft.informatik.uni-stuttgart.de - */ -public enum ElementNamesEnum { - NODETYPE("tosca:NodeType"), NODETYPEIMPLEMENTATION("tosca:NodeTypeImplementation"), RELATIONSHIPTYPE("tosca:RelationshipType"), RELATIONSHIPTYPEIMPLEMENTATION("tosca:RelationshipTypeImplementation"), REQUIREMENTTYPE("tosca:RequirementType"), CAPABILITYTYPE("tosca:CapabilityType"), ARTIFACTTYPE("tosca:ArtifactType"), POLICYTYPE("tosca:PolicyType"), ALLELEMENTS(null); - - // the element name definded by TOSCA - private String elementName; - - - /** - * This constructor sets the name of an element. - * - * @param elementName the name of the element. - */ - ElementNamesEnum(final String elementName) { - this.elementName = elementName; - } - - /** - * This method returns the name of the element defined by TOSCA. - */ - @Override - public String toString() { - return this.elementName; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ImportType.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ImportType.java deleted file mode 100644 index d9fd98e4c..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ImportType.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver.data; - -/** - * This enum maps URIs of specifications to an enum value. The URIs are representing types of - * imported resources due a ServiceTemplate. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public enum ImportType { - TOSCA, WSDL, SCHEMA; - - /** - * - * @param type Type of an import element inside of a ServiceTemplate. - * @return - */ - public static ImportType getImportType(final String type) { - - if (type.equals("http://docs.oasis-open.org/tosca/ns/2011/12")) { - return TOSCA; - } else if (type.equals("http://schemas.xmlsoap.org/wsdl/")) { - return WSDL; - } else if (type.equals("http://www.w3.org/2001/XMLSchema")) { - return SCHEMA; - } - - return null; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ReferenceResultWrapper.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ReferenceResultWrapper.java deleted file mode 100644 index 169da2536..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/impl/resolver/data/ReferenceResultWrapper.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.opentosca.container.core.engine.impl.resolver.data; - -import org.w3c.dom.Document; -import org.w3c.dom.NodeList; - -/** - * This DTO stores data of found DOM Documents and nested Nodes which are searched by - * org.opentosca.toscaengine.service.impl.resolver.ReferenceMapper. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class ReferenceResultWrapper { - - private Document doc = null; - private NodeList nodeList = null; - - - /** - * @return the doc - */ - public Document getDoc() { - return this.doc; - } - - /** - * @param doc the doc to set - */ - public void setDoc(final Document doc) { - this.doc = doc; - } - - /** - * @return the nodeList - */ - public NodeList getNodeList() { - return this.nodeList; - } - - /** - * @param nodeList the nodeList to set - */ - public void setNodeList(final NodeList nodeList) { - this.nodeList = nodeList; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializer.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializer.java deleted file mode 100644 index 3a1d67e19..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializer.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.opentosca.container.core.engine.xml; - -import java.io.File; -import java.io.InputStream; -import java.util.List; - -import javax.xml.bind.JAXBElement; - -import org.opentosca.container.core.tosca.model.Definitions; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * Interface of the XML Serialization for marshaling and unmarshaling objects of the TOSCA universe - * to the needed JAXB or DOM objects as well as other XML content to DOM objects. Instances of this - * Interface can be created with the SerializerFactory. - * - * An implementation of this interface provides functionality for processing XML data in files and - * JAXB objects. Further the Serializer can convert these data to DOM and String representations. - * - * The instance of this interface is used by
    - * - org.opentosca.containerapi
    - * - org.opentosca.core.model
    - * - org.opentosca.toscaengine.service
    - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public interface IXMLSerializer { - - /** - * This method marshals an object of the TOSCA model into a DOM Node representation. - * - * @param element The JAXBElement to serialize into a DOM representation. - * @return The DOM node representation of the element. - */ - public Node marshalToNode(Object objToMarshal); - - /** - * This method marshals a given ServiceTemplate into a DOM Document representation. - * - * @param objToMarshal The root element to serialize into a DOM representation. - * @return The DOM Document representation of the element. - */ - public Document marshalToDocument(Definitions definitions); - - /** - * This method marshals a passed JAXBElement into a String. - * - * @param objToMarshal The root element to serialize into a String representation. - * @return The String representation of the object. - */ - public String marshalToString(Object objToMarshal); - - /** - * This method unmarshals a ServiceTemplate of a passed XML File object.
    - * - * @param file The File object which shall be unmarshaled. - * @return ServiceTemplate The ServiceTemplate which contains the xml data of the File. The method - * returns null if the file is empty or one or more errors occurs. - */ - public abstract Definitions unmarshal(File fileToUnmarshal); - - /** - * This method unmarshals a ServiceTemplate of a passed InputStream.
    - * - * @param streamToUnmarshal The InputStream which contains the xml data. - * @return The ServiceTemplate which contains the xml data. The method returns null if the stream is - * empty or one or more errors occurs. - */ - public abstract Definitions unmarshal(InputStream streamToUnmarshal); - - /** - * This method unmarshals a ServiceTemplate of a passed DOM document.
    - * - * @param The DOM Document which contains the data. - * @return ServiceTemplate The ServiceTemplate which contains the xml data. The method returns a - * null if the file is empty or one or more errors occurs. - */ - public abstract Definitions unmarshal(Document doc); - - /** - * This method unmarshals a object of a passed DOM Node. For the mapping you need to provide the - * destination class with which a instance is generated and the data is stored. - * - * @param nodeToUnmarshal The Node which shall be unmarshalled. - * @param destinationClazz The class which represents the Node. - * @return An Object of the type of the second parameter and the data of the first. - */ - public abstract Object unmarshal(Node nodeToUnmarshal, Class destinationClazz); - - /** - * This method creates a JAXBElement object which contains the given object. - * - * @param obj The object which is needed in form of a JAXBElement. - * @return The JAXBElement of the given object or null if the given object is not in the context of - * the TOSCA JAXB classes. - */ - @SuppressWarnings("rawtypes") - public abstract JAXBElement createJAXBElement(Object obj); - - /** - * This method puts a given DOM Element into a proper DOM Document structure. The root element in - * the new document is a copy of the original one. - * - * @param Element the element which shall be the root element of a new DOM Document. - * @return a new DOM Document or null in case of an error. - */ - public Document elementIntoDocument(Element element); - - /** - * This method puts a given list of DOM Elements into a proper DOM Document structure. The original - * elements are copied and the new elements are put into a new root element with the name depending - * on the second parameter. - * - * @param elements list of elements which provide the content of the new document - * @param rootElementName the name of the new root element - * @return a new DOM Document or null in case of an error. - */ - // TODO change type of rootElementName to QName to support namespaces - public Document elementsIntoDocument(List elements, String rootElementName); - - /** - * This method sets the validation against the schema active or inactive. By default the validation - * is activated. - * - * @param bool True for activation and false for deactivation of the validation. - */ - public abstract void setValidation(Boolean bool); - - /** - * Serializes a DOM Node to a String representation. - * - * @param node A node containing the data which to serialize to a String representation. - * @param removeWhitespaces Flag for removing the whitespace. - * @return formatted String - */ - public abstract String docToString(Node node, boolean removeWhitespaces); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializerFactory.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializerFactory.java deleted file mode 100644 index 705cf85f4..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializerFactory.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.opentosca.container.core.engine.xml; - -import java.io.File; - -public interface IXMLSerializerFactory { - - /** - * Creates a new instance of the XML Serializer of the TOSCA universe for a passed class which marks - * the context and a File object which represents the TOSCA Schema. - * - * @param classContext A JAXB class which marks the context in which the Serializer is instantiated. - * @param schemaFile A File object which provides the Schema file of TOSCA. - * @return An instance of the XML Serializer of the TOSCA universe. - */ - public abstract IXMLSerializer createSerializer(Class classContext, File schemaFile); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializerService.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializerService.java deleted file mode 100644 index 8970646d4..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/IXMLSerializerService.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.opentosca.container.core.engine.xml; - -import org.opentosca.container.core.tosca.model.IToscaModelFactory; - -/** - * This interface describes the XMLSerializerService which provides the IXMLSerializer which - * serializes data of the TOSCA universe and related data like WSDL or XML Schema. Furthermore the - * service provides access to the ObjectFactory of JAXB objects of TOSCA. - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public interface IXMLSerializerService { - - /** - * Getter for the XMLSerializer which handles data of TOSCA or is used by TOSCA. - * - * @return The xmlSerializer for data which is TOSCA or is used by TOSCA. - */ - public abstract IXMLSerializer getXmlSerializer(); - - /** - * Getter for the ToscaModelFactory which is a ObjectFactory for JAXB objects of TOSCA. - * - * @return The ObjectFactory which creates JAXB objects of TOSCA. - */ - public abstract IToscaModelFactory getToscaModelFactory(); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializerServiceImpl.java b/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializerServiceImpl.java deleted file mode 100644 index 7c0df7b5a..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/engine/xml/impl/XMLSerializerServiceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.opentosca.container.core.engine.xml.impl; - -import java.io.File; - -import org.opentosca.container.core.engine.xml.IXMLSerializer; -import org.opentosca.container.core.engine.xml.IXMLSerializerService; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.container.core.tosca.model.Definitions; -import org.opentosca.container.core.tosca.model.IToscaModelFactory; -import org.opentosca.container.core.tosca.model.ObjectFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Implementation of the interface - * org.opentosca.toscaengine.xmlserializer.service.IXMLSerializerService - * - * @see org.opentosca.container.core.engine.xml.IXMLSerializerService - * - * @author Christian Endres - endrescn@studi.informatik.uni-stuttgart.de - */ -public class XMLSerializerServiceImpl implements IXMLSerializerService { - - private IXMLSerializer xmlSerializer; - private IToscaModelFactory toscaModelFactory; - - private IFileAccessService fileAccessService = null; - - private final Logger LOG = LoggerFactory.getLogger(XMLSerializerServiceImpl.class); - - - /** - * {@inheritDoc} - */ - @Override - public IXMLSerializer getXmlSerializer() { - if (this.xmlSerializer == null) { - this.LOG.error("There is no XMLSerializer initiated yet."); - } - return this.xmlSerializer; - } - - /** - * {@inheritDoc} - */ - @Override - public IToscaModelFactory getToscaModelFactory() { - if (this.toscaModelFactory == null) { - this.toscaModelFactory = new ObjectFactory(); - } - return this.toscaModelFactory; - } - - public void bindIFileAccessService(final IFileAccessService service) { - if (service == null) { - this.LOG.error("Service IFileAccessService is null."); - } else { - this.LOG.debug("Bind of the IFileAccessService."); - this.fileAccessService = service; - - if (this.xmlSerializer == null) { - - this.LOG.debug("Create a new XMLSerializer."); - final File schemaFile = this.fileAccessService.getOpenToscaSchemaFile(); - - // this boolean is for preventing a unused warning and to get - // the Serialization working with validation easily if needed - final boolean trueForCreateValidation = false; - if (trueForCreateValidation) { - this.LOG.debug("Create TOSCA XML Serialization with schema validation."); - this.xmlSerializer = new XMLSerializerFactory().createSerializer(Definitions.class, schemaFile); - } else { - this.LOG.debug("Create TOSCA XML Serialization without schema validation."); - this.xmlSerializer = new XMLSerializerFactory().createSerializer(Definitions.class, null); - } - this.xmlSerializer.setValidation(true); - } - } - } - - public void unbindIFileAccessService(final IFileAccessService service) { - this.LOG.debug("Unbind of the IFileAccessService."); - this.fileAccessService = null; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CSARIDToDefinitionsMap.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CSARIDToDefinitionsMap.java deleted file mode 100644 index 30b5e9ba0..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CSARIDToDefinitionsMap.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TDefinitions; - -/** - * Maps a CSARID to a list of TOSCA Definitions. - * - * @author endrescn@fachschaft.informatik.uni-stuttgart.de - */ -public class CSARIDToDefinitionsMap implements Map> { - - private Map> definitionsMap = new HashMap<>(); - - - @Override - public void clear() { - this.definitionsMap.clear(); - } - - @Override - public boolean containsKey(final Object key) { - - return this.definitionsMap.containsKey(key); - } - - @Override - public boolean containsValue(final Object value) { - - return this.definitionsMap.containsValue(value); - } - - @Override - public Set>> entrySet() { - - return this.definitionsMap.entrySet(); - } - - @Override - public List get(final Object key) { - - return this.definitionsMap.get(key); - } - - @Override - public boolean isEmpty() { - - return this.definitionsMap.isEmpty(); - } - - @Override - public Set keySet() { - - return this.definitionsMap.keySet(); - } - - @Override - public List put(final CSARID key, final List value) { - - final List result = this.definitionsMap.put(key, value); - return result; - } - - @Override - public void putAll(final Map> m) { - - this.definitionsMap.putAll(m); - - } - - @Override - public List remove(final Object key) { - - final List result = this.definitionsMap.remove(key); - return result; - } - - @Override - public int size() { - - return this.definitionsMap.size(); - } - - @Override - public Collection> values() { - - return this.definitionsMap.values(); - } - - public Map> getDefinitionsMap() { - - return this.definitionsMap; - } - - public void setDefinitionsMap(final Map> documentMap) { - - this.definitionsMap = documentMap; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CSARIDToServiceTemplateIDsMap.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CSARIDToServiceTemplateIDsMap.java deleted file mode 100644 index 258c2d1c7..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CSARIDToServiceTemplateIDsMap.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; - -/** - * Maps a CSARID to a list of QNames of TOSCA Service Templates. - */ -public class CSARIDToServiceTemplateIDsMap implements Map> { - - private Map> serviceTemplatesMap = new HashMap<>(); - - - @Override - public void clear() { - this.serviceTemplatesMap.clear(); - } - - @Override - public boolean containsKey(final Object key) { - - return this.serviceTemplatesMap.containsKey(key); - } - - @Override - public boolean containsValue(final Object value) { - - return this.serviceTemplatesMap.containsValue(value); - } - - @Override - public Set>> entrySet() { - - return this.serviceTemplatesMap.entrySet(); - } - - @Override - public List get(final Object key) { - - return this.serviceTemplatesMap.get(key); - } - - @Override - public boolean isEmpty() { - - return this.serviceTemplatesMap.isEmpty(); - } - - @Override - public Set keySet() { - - return this.serviceTemplatesMap.keySet(); - } - - @Override - public List put(final CSARID key, final List value) { - - final List result = this.serviceTemplatesMap.put(key, value); - return result; - } - - @Override - public void putAll(final Map> m) { - - this.serviceTemplatesMap.putAll(m); - - } - - @Override - public List remove(final Object key) { - - final List result = this.serviceTemplatesMap.remove(key); - return result; - } - - @Override - public int size() { - - return this.serviceTemplatesMap.size(); - } - - @Override - public Collection> values() { - - return this.serviceTemplatesMap.values(); - } - - public Map> getServiceTemplatesMap() { - // - return this.serviceTemplatesMap; - } - - public void setServiceTemplatesMap(final Map> documentMap) { - - this.serviceTemplatesMap = documentMap; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToPlanTypeToPlanNameToPlan.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToPlanTypeToPlanNameToPlan.java deleted file mode 100644 index be6ccf732..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToPlanTypeToPlanNameToPlan.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.PlanTypes; -import org.opentosca.container.core.tosca.model.TPlan; - -/** - * Persistence of the implemented data structure. - * - * @author endrescn@fachschaft.informatik.uni-stuttgart.de - */ -public class CsarIDToPlanTypeToPlanNameToPlan implements Map>> { - - private Map>> csarIDToPlanTypeToIntegerToPlanMap = - new HashMap<>(); - - - @Override - public void clear() { - - this.csarIDToPlanTypeToIntegerToPlanMap.clear(); - } - - @Override - public boolean containsKey(final Object arg0) { - - return this.csarIDToPlanTypeToIntegerToPlanMap.containsKey(arg0); - } - - @Override - public boolean containsValue(final Object arg0) { - - return this.csarIDToPlanTypeToIntegerToPlanMap.containsValue(arg0); - } - - @Override - public Set>>> entrySet() { - - return this.csarIDToPlanTypeToIntegerToPlanMap.entrySet(); - } - - @Override - public Map> get(final Object arg0) { - - return this.csarIDToPlanTypeToIntegerToPlanMap.get(arg0); - } - - @Override - public boolean isEmpty() { - - return this.csarIDToPlanTypeToIntegerToPlanMap.isEmpty(); - } - - @Override - public Set keySet() { - - return this.csarIDToPlanTypeToIntegerToPlanMap.keySet(); - } - - @Override - public Map> put(final CSARID arg0, - final Map> arg1) { - - final Map> result = - this.csarIDToPlanTypeToIntegerToPlanMap.put(arg0, arg1); - return result; - } - - @Override - public void putAll(final Map>> arg0) { - - this.csarIDToPlanTypeToIntegerToPlanMap.putAll(arg0); - } - - @Override - public Map> remove(final Object arg0) { - - final Map> result = this.csarIDToPlanTypeToIntegerToPlanMap.remove(arg0); - return result; - } - - @Override - public int size() { - - return this.csarIDToPlanTypeToIntegerToPlanMap.size(); - } - - @Override - public Collection>> values() { - - return this.csarIDToPlanTypeToIntegerToPlanMap.values(); - } - - public Map>> getMap() { - return this.csarIDToPlanTypeToIntegerToPlanMap; - } - - public void setMap(final Map>> map) { - - this.csarIDToPlanTypeToIntegerToPlanMap = map; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToPolicies.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToPolicies.java deleted file mode 100644 index 375b5266c..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToPolicies.java +++ /dev/null @@ -1,157 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TBoundaryDefinitions.Policies; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class stores the mapping for Consolidated Policies. A CSARID is mapped to the amount of - * Templates (ServiceTemplate or NodeTemplate) which can contain Policies and the actual - * Consolidated Policies. - * - * @author endrescn@studi.informatik.uni-stuttgart.de - */ -public class CsarIDToPolicies implements Map> { - - private final Logger LOG = LoggerFactory.getLogger(CsarIDToPolicies.class); - - private final Map> csarIDToTemplateToPolicies = new HashMap<>(); - - - /** - * Puts the Consolidated Policies of a ServiceTemplate or NodeTemplate into the storage. - * - * @param csarID the CSARID - * @param templateID the QName of a ServiceTemplate or NodeTemplate - * @param policies the Policies object - */ - public void put(final CSARID csarID, final QName templateID, final Policies policies) { - - if (!this.csarIDToTemplateToPolicies.containsKey(csarID)) { - this.csarIDToTemplateToPolicies.put(csarID, new HashMap()); - } - - if (null != this.csarIDToTemplateToPolicies.get(csarID).get(templateID)) { - this.LOG.warn("There are Consolidated Policies stored already for the CSARID \"" + csarID - + " and TemplateID \"" + templateID + "\". Thus do overwrite the Consolidated Policies."); - } - - this.csarIDToTemplateToPolicies.get(csarID).put(templateID, policies); - - } - - /** - * Returns the requested Consolidated Policies. - * - * @param csarID The CSARID. - * @param templateID The QName pointing to the template. - * @return the Consolidated Policies or null of none are found. - */ - public Policies get(final CSARID csarID, final QName templateID) { - - if (!this.csarIDToTemplateToPolicies.containsKey(csarID)) { - this.LOG.error("There are no informations stored for the CSARID \"" + csarID + "\"."); - } else if (!this.csarIDToTemplateToPolicies.get(csarID).containsKey(templateID)) { - this.LOG.error("There are no informations stored for the CSARID \"" + csarID + "\" and the TemplateID \"" - + templateID + "\"."); - } else { - return this.csarIDToTemplateToPolicies.get(csarID).get(templateID); - } - - return null; - - } - - public List getTemplateIDs(final CSARID csarID) { - - final List list = new ArrayList<>(); - - if (this.csarIDToTemplateToPolicies.containsKey(csarID)) { - list.addAll(this.csarIDToTemplateToPolicies.get(csarID).keySet()); - } - - return list; - } - - @Override - public int size() { - return this.csarIDToTemplateToPolicies.size(); - } - - @Override - public boolean isEmpty() { - return this.csarIDToTemplateToPolicies.isEmpty(); - } - - @Override - public boolean containsKey(final Object key) { - return this.csarIDToTemplateToPolicies.containsKey(key); - } - - @Override - public boolean containsValue(final Object value) { - return this.containsValue(value); - } - - @Deprecated - @Override - public Map get(final Object key) { - return this.csarIDToTemplateToPolicies.get(key); - } - - @Deprecated - @Override - public Map put(final CSARID key, final Map value) { - return this.csarIDToTemplateToPolicies.put(key, value); - } - - @Override - public Map remove(final Object key) { - - if (key instanceof CSARID) { - final CSARID csarID = (CSARID) key; - if (this.csarIDToTemplateToPolicies.containsKey(csarID)) { - return this.csarIDToTemplateToPolicies.remove(csarID); - } - } - - return null; - } - - @Deprecated - @Override - public void putAll(final Map> m) { - this.csarIDToTemplateToPolicies.putAll(m); - } - - @Override - public void clear() { - this.csarIDToTemplateToPolicies.clear(); - } - - @Override - public Set keySet() { - return this.csarIDToTemplateToPolicies.keySet(); - } - - @Override - public Collection> values() { - return this.csarIDToTemplateToPolicies.values(); - } - - @Override - public Set>> entrySet() { - return this.csarIDToTemplateToPolicies.entrySet(); - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToServiceTemplateIDToPlanID.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToServiceTemplateIDToPlanID.java deleted file mode 100644 index 3584b4890..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToServiceTemplateIDToPlanID.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; - -/** - * Maps a CSARID to a Map of Service Template QNames which maps to a list of TOSCA Plan QNames. - */ -public class CsarIDToServiceTemplateIDToPlanID implements Map>> { - - private Map>> csarIDToServiceTemplateIDToPlanIDMap = new HashMap<>(); - - - @Override - public void clear() { - - this.csarIDToServiceTemplateIDToPlanIDMap.clear(); - - } - - @Override - public boolean containsKey(final Object arg0) { - - return this.csarIDToServiceTemplateIDToPlanIDMap.containsKey(arg0); - } - - @Override - public boolean containsValue(final Object arg0) { - - return this.csarIDToServiceTemplateIDToPlanIDMap.containsValue(arg0); - } - - @Override - public Set>>> entrySet() { - - return this.csarIDToServiceTemplateIDToPlanIDMap.entrySet(); - } - - @Override - public Map> get(final Object arg0) { - - return this.csarIDToServiceTemplateIDToPlanIDMap.get(arg0); - } - - @Override - public boolean isEmpty() { - - return this.csarIDToServiceTemplateIDToPlanIDMap.isEmpty(); - } - - @Override - public Set keySet() { - - return this.csarIDToServiceTemplateIDToPlanIDMap.keySet(); - } - - @Override - public Map> put(final CSARID arg0, final Map> arg1) { - - final Map> result = this.csarIDToServiceTemplateIDToPlanIDMap.put(arg0, arg1); - - return result; - } - - @Override - public void putAll(final java.util.Map>> arg0) { - - this.csarIDToServiceTemplateIDToPlanIDMap.putAll(arg0); - - } - - @Override - public Map> remove(final Object arg0) { - - final Map> result = this.csarIDToServiceTemplateIDToPlanIDMap.remove(arg0); - - return result; - } - - @Override - public int size() { - - return this.csarIDToServiceTemplateIDToPlanIDMap.size(); - } - - @Override - public Collection>> values() { - - return this.csarIDToServiceTemplateIDToPlanIDMap.values(); - } - - public Map>> getMap() { - return this.csarIDToServiceTemplateIDToPlanIDMap; - } - - public void setMap(final Map>> map) { - - this.csarIDToServiceTemplateIDToPlanIDMap = map; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToWSDLDocuments.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToWSDLDocuments.java deleted file mode 100644 index 1435d09cc..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/CsarIDToWSDLDocuments.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.w3c.dom.Document; - -/** - * Maps a CSARID to a list of DOM Documents of parsed WSDLs. - */ -public class CsarIDToWSDLDocuments implements Map> { - - private Map> csarIDToWSDLDocumentsMap = new HashMap<>(); - - - @Override - public void clear() { - - this.csarIDToWSDLDocumentsMap.clear(); - } - - @Override - public boolean containsKey(final Object arg0) { - - return this.csarIDToWSDLDocumentsMap.containsKey(arg0); - } - - @Override - public boolean containsValue(final Object arg0) { - - return this.csarIDToWSDLDocumentsMap.containsValue(arg0); - } - - @Override - public Set>> entrySet() { - - return this.csarIDToWSDLDocumentsMap.entrySet(); - } - - @Override - public List get(final Object arg0) { - - return this.csarIDToWSDLDocumentsMap.get(arg0); - } - - @Override - public boolean isEmpty() { - - return this.csarIDToWSDLDocumentsMap.isEmpty(); - } - - @Override - public Set keySet() { - - return this.csarIDToWSDLDocumentsMap.keySet(); - } - - @Override - public List put(final CSARID arg0, final List arg1) { - - final List result = this.csarIDToWSDLDocumentsMap.put(arg0, arg1); - return result; - } - - @Override - public void putAll(final java.util.Map> arg0) { - - this.csarIDToWSDLDocumentsMap.putAll(arg0); - } - - @Override - public List remove(final Object arg0) { - - final List result = this.csarIDToWSDLDocumentsMap.remove(arg0); - return result; - } - - @Override - public int size() { - - return this.csarIDToWSDLDocumentsMap.size(); - } - - @Override - public Collection> values() { - - return this.csarIDToWSDLDocumentsMap.values(); - } - - public Map> getMap() { - - return this.csarIDToWSDLDocumentsMap; - } - - public void setMap(final Map> map) { - - this.csarIDToWSDLDocumentsMap = map; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/DocumentMap.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/DocumentMap.java deleted file mode 100644 index e064b771c..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/DocumentMap.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.w3c.dom.Document; - -public class DocumentMap implements Map> { - - private Map> documentMapMap = new HashMap<>(); - - - @Override - public void clear() { - - this.documentMapMap.clear(); - } - - @Override - public boolean containsKey(final Object key) { - - return this.documentMapMap.containsKey(key); - } - - @Override - public boolean containsValue(final Object value) { - - return this.documentMapMap.containsValue(value); - } - - @Override - public Set>> entrySet() { - - return this.documentMapMap.entrySet(); - } - - @Override - public Map get(final Object key) { - - return this.documentMapMap.get(key); - } - - @Override - public boolean isEmpty() { - - return this.documentMapMap.isEmpty(); - } - - @Override - public Set keySet() { - - return this.documentMapMap.keySet(); - } - - @Override - public Map put(final CSARID key, final Map value) { - - final Map result = this.documentMapMap.put(key, value); - return result; - } - - @Override - public void putAll(final Map> m) { - - this.documentMapMap.putAll(m); - } - - @Override - public Map remove(final Object key) { - - final Map result = this.documentMapMap.remove(key); - return result; - } - - @Override - public int size() { - - return this.documentMapMap.size(); - } - - @Override - public Collection> values() { - - return this.documentMapMap.values(); - } - - public Map> getDocumentMap() { - - return this.documentMapMap; - } - - public void setDocumentMap(final Map> documentMap) { - - this.documentMapMap = documentMap; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/MapQNameDocument.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/MapQNameDocument.java deleted file mode 100644 index ddee7fb54..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/MapQNameDocument.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.w3c.dom.Document; - -/** - * Generic Map of QName to Document. Intended for JPA but does not work. - * - * @author endrescn@fachschaft.informatik.uni-stuttgart.de - */ -public class MapQNameDocument implements Map { - - private Map map = new HashMap<>(); - - - @Override - public void clear() { - - this.map.clear(); - - } - - @Override - public boolean containsKey(final Object key) { - - return this.map.containsKey(key); - } - - @Override - public boolean containsValue(final Object value) { - - return this.map.containsValue(value); - } - - @Override - public Set> entrySet() { - - return this.map.entrySet(); - } - - @Override - public Document get(final Object key) { - - return this.map.get(key); - } - - @Override - public boolean isEmpty() { - - return this.map.isEmpty(); - } - - @Override - public Set keySet() { - - return this.map.keySet(); - } - - @Override - public Document put(final QName key, final Document value) { - - final Document result = this.map.put(key, value); - return result; - } - - @Override - public void putAll(final Map m) { - - this.map.putAll(m); - - } - - @Override - public Document remove(final Object key) { - - final Document result = this.map.remove(key); - return result; - } - - @Override - public int size() { - - return this.map.size(); - } - - @Override - public Collection values() { - - return this.map.values(); - } - - public Map getMap() { - - return this.map; - } - - public void setMap(final Map map) { - - this.map = map; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/MapQNameNode.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/MapQNameNode.java deleted file mode 100644 index f8022bc74..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/MapQNameNode.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import javax.xml.namespace.QName; - -import org.w3c.dom.Node; - -/** - * Generic Map of QName to Node. Intended for JPA but does not work. - */ -public class MapQNameNode implements Map { - - private Map qnameNode = new HashMap<>(); - - - @Override - public void clear() { - this.qnameNode.clear(); - - } - - @Override - public boolean containsKey(final Object key) { - - return this.qnameNode.containsKey(key); - } - - @Override - public boolean containsValue(final Object value) { - - return this.qnameNode.containsValue(value); - } - - @Override - public Set> entrySet() { - - return this.qnameNode.entrySet(); - } - - @Override - public Node get(final Object key) { - - return this.qnameNode.get(key); - } - - @Override - public boolean isEmpty() { - - return this.qnameNode.isEmpty(); - } - - @Override - public Set keySet() { - - return this.qnameNode.keySet(); - } - - @Override - public Node put(final QName key, final Node value) { - - final Node result = this.qnameNode.put(key, value); - return result; - } - - @Override - public void putAll(final Map m) { - - this.qnameNode.putAll(m); - - } - - @Override - public Node remove(final Object key) { - - final Node result = this.qnameNode.remove(key); - return result; - } - - @Override - public int size() { - - return this.qnameNode.size(); - } - - @Override - public Collection values() { - - return this.qnameNode.values(); - } - - public Map getQnameNode() { - - return this.qnameNode; - } - - public void setQnameNode(final Map map) { - - this.qnameNode = map; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/ReferenceMap.java b/org.opentosca.container.core/src/org/opentosca/container/core/mapping/ReferenceMap.java deleted file mode 100644 index 90938ce13..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/mapping/ReferenceMap.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.opentosca.container.core.mapping; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.opentosca.container.core.model.csar.id.CSARID; - -public class ReferenceMap implements Map { - - private Map csarIDToMapQNameNode = new HashMap<>(); - - - @Override - public void clear() { - - this.csarIDToMapQNameNode.clear(); - } - - @Override - public boolean containsKey(final Object key) { - - return this.csarIDToMapQNameNode.containsKey(key); - } - - @Override - public boolean containsValue(final Object value) { - - return this.csarIDToMapQNameNode.containsValue(value); - } - - @Override - public Set> entrySet() { - - return this.csarIDToMapQNameNode.entrySet(); - } - - @Override - public MapQNameNode get(final Object key) { - - return this.csarIDToMapQNameNode.get(key); - } - - @Override - public boolean isEmpty() { - - return this.csarIDToMapQNameNode.isEmpty(); - } - - @Override - public Set keySet() { - - return this.csarIDToMapQNameNode.keySet(); - } - - @Override - public MapQNameNode put(final CSARID key, final MapQNameNode value) { - - final MapQNameNode result = this.csarIDToMapQNameNode.put(key, value); - return result; - } - - @Override - public void putAll(final Map m) { - - this.csarIDToMapQNameNode.putAll(m); - } - - @Override - public MapQNameNode remove(final Object key) { - - final MapQNameNode result = this.csarIDToMapQNameNode.remove(key); - return result; - } - - @Override - public int size() { - - return this.csarIDToMapQNameNode.size(); - } - - @Override - public Collection values() { - - return this.csarIDToMapQNameNode.values(); - } - - public Map getCsarIDToMapQNameNode() { - - return this.csarIDToMapQNameNode; - } - - public void setCsarIDToMapQNameNode(final Map referenceMap) { - - this.csarIDToMapQNameNode = referenceMap; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractArtifact.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractArtifact.java deleted file mode 100644 index aa36b2266..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractArtifact.java +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.core.model; - -import java.util.Collections; -import java.util.Set; - -import org.opentosca.container.core.common.UserException; - -/** - * Abstract class of an artifact that consists of files and directories.
    - * Each class that extends this class represents an certain type of artifact respectively artifact - * reference, e.g. an HTTP artifact (reference begins with http). - *

    - * Provides methods for getting the passed artifact reference and include and/or exclude patterns, - * check if an artifact reference belongs to this type of artifact, and browsing the artifact - * content (this is the artifact root). - */ -public abstract class AbstractArtifact implements IBrowseable { - - /** - * Reference that points to this artifact. - */ - private final String ARTIFACT_REFERENCE; - - private final Set INCLUDE_PATTERNS; - private final Set EXCLUDE_PATTERNS; - - - /** - * Creates an artifact. - * - * @param artifactReference that points to this artifact. - * @param includePatterns to include only certain files in this artifact. - * @param excludePatterns to exclude certain files from this artifact. - * @throws UserException if artifact reference points a non-existent file / directory. - */ - public AbstractArtifact(final String artifactReference, final Set includePatterns, - final Set excludePatterns) throws UserException { - - this.ARTIFACT_REFERENCE = artifactReference; - this.INCLUDE_PATTERNS = includePatterns; - this.EXCLUDE_PATTERNS = excludePatterns; - - } - - /** - * @return {@link AbstractDirectory} that represents the root of the artifact.
    - * Note: The browsing methods in this class redirecting to the same methods of this - * {@link AbstractDirectory} by delegation. - */ - protected abstract AbstractDirectory getArtifactRoot(); - - /** - * @return {@inheritDoc}
    - * Also {@code null} if {@code relPathOfFile} not matches patterns (if any were - * given).
    - * If this artifact represents an file artifact (artifact reference points to a file) the - * file of the artifact can be returned by passing an arbitrary string. - */ - @Override - public AbstractFile getFile(final String relPathOfFile) { - return this.getArtifactRoot().getFile(relPathOfFile); - } - - /** - * @return {@inheritDoc}
    - * If any patterns were given only files will be returned that matches these patterns.
    - * In case this artifact represents a file artifact (artifact reference points to a file) a - * {@code Set} with one element will be returned that contains the file of the artifact - * (patterns will be ignored). - */ - @Override - public Set getFiles() { - return this.getArtifactRoot().getFiles(); - } - - /** - * @return {@inheritDoc}
    - * If patterns were given only files will be returned that matches these patterns.
    - * In case this artifact represents a file artifact (artifact reference points to a file) a - * {@code Set} with one element will be returned that contains the file of the artifact - * (patterns will be ignored). - */ - @Override - public Set getFilesRecursively() { - return this.getArtifactRoot().getFilesRecursively(); - } - - /** - * @return {@inheritDoc}
    - * If any patterns were given only files will be returned that matches these patterns. - */ - @Override - public AbstractDirectory getDirectory(final String relPathOfDirectory) { - return this.getArtifactRoot().getDirectory(relPathOfDirectory); - } - - @Override - public Set getDirectories() { - return this.getArtifactRoot().getDirectories(); - } - - /** - * - * @return {@code true} if reference of this artifact points to a file, otherwise {@code false}. - */ - public abstract boolean isFileArtifact(); - - /** - * Checks if {@code artifactReference} fits to this type of artifact.
    - * It only performs syntax checks which not need network access. - * - * @param artifactReference to check - * @return {@code true} if {@code artifactReference} fits, otherwise {@code false} - */ - public static boolean fitsArtifactReference(final String artifactReference) { - throw new UnsupportedOperationException("Not yet implemented"); - } - - /** - * @return Artifact reference. - */ - public String getArtifactReference() { - return this.ARTIFACT_REFERENCE; - } - - /** - * @return Patterns to include only certain files in this artifact.
    - * In case of an file artifact no patterns are allowed. Thus, always an empty {@code Set} - * will be returned. - */ - public Set getIncludePatterns() { - - if (this.isFileArtifact()) { - return Collections.emptySet(); - } - - return this.INCLUDE_PATTERNS; - - } - - /** - * @return Patterns to exclude certain files from this artifact.
    - * In case of an file artifact no patterns are allowed. Thus, always an empty {@code Set} - * will be returned. - */ - public Set getExcludePatterns() { - - if (this.isFileArtifact()) { - return Collections.emptySet(); - } - - return this.EXCLUDE_PATTERNS; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractDirectory.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractDirectory.java deleted file mode 100644 index 2ed4e821a..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/AbstractDirectory.java +++ /dev/null @@ -1,183 +0,0 @@ -package org.opentosca.container.core.model; - -import java.util.HashSet; -import java.util.Set; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Abstract class of a directory. Provides methods for browsing the directory and getting their meta - * data. - */ -public abstract class AbstractDirectory implements IBrowseable { - - private final static Logger LOG = LoggerFactory.getLogger(AbstractDirectory.class); - - /** - * Reference that points to this directory. - */ - private final String DIRECTORY_REFERENCE; - - private final Set INCLUDE_PATTERNS; - private final Set EXCLUDE_PATTERNS; - - /** - * @see #isFileArtifact() - */ - private final boolean FILE_ARTIFACT; - - - /** - * Creates a directory. - * - * @param directoryReference that points to this directory. - * @param includePatterns to include only certain files in this directory. - * @param excludePatterns to exclude certain files from this directory. - * @param fileArtifact - {@code true} if this directory represents a file artifact (directory - * contains only the file at the artifact reference), otherwise {@code false}. - */ - public AbstractDirectory(final String directoryReference, final Set includePatterns, - final Set excludePatterns, final boolean fileArtifact) { - this.DIRECTORY_REFERENCE = directoryReference; - this.INCLUDE_PATTERNS = includePatterns; - this.EXCLUDE_PATTERNS = excludePatterns; - this.FILE_ARTIFACT = fileArtifact; - } - - /** - * @return {@inheritDoc}
    - * Also {@code null} if {@code relPathOfFile} not matches patterns (if any were given). - */ - @Override - public AbstractFile getFile(final String relPathOfFile) { - - final AbstractFile file = this.getFileNotConsiderPatterns(relPathOfFile); - - if (file != null) { - - // no patterns were given => we not doing pattern matching - if (this.getIncludePatterns().isEmpty() && this.getExcludePatterns().isEmpty()) { - AbstractDirectory.LOG.debug("File \"{}\" relative to \"{}\" was found.", relPathOfFile, this.getPath()); - return file; - } else { - - final boolean matchesPatterns = - PatternMatcher.isFileMatchesPatterns(file, this.getIncludePatterns(), this.getExcludePatterns()); - - if (matchesPatterns) { - AbstractDirectory.LOG.debug("File \"{}\" relative to \"{}\" was found and matches pattern(s).", - relPathOfFile, this.getPath()); - return file; - } - - } - - } - - AbstractDirectory.LOG.warn("File \"{}\" relative to \"{}\" was not found.", relPathOfFile, this.getPath()); - - return null; - } - - /** - * This method should not consider any given patterns. - * - * @see AbstractDirectory#getFile(String) - */ - protected abstract AbstractFile getFileNotConsiderPatterns(String relPathOfFile); - - /** - * @return {@inheritDoc}
    - * If patterns were given only files will be returned that matches these patterns. - */ - @Override - public Set getFiles() { - - Set files; - - // no patterns were given => we not doing pattern matching - if (this.getIncludePatterns().isEmpty() && this.getExcludePatterns().isEmpty()) { - files = this.getFilesNotConsiderPatterns(); - } else { - files = PatternMatcher.findFilesMatchesPatterns(this.getFilesNotConsiderPatterns(), - this.getIncludePatterns(), this.getExcludePatterns()); - } - return files; - - } - - /** - * This method should not consider any given patterns. - * - * @see AbstractDirectory#getFiles() - */ - protected abstract Set getFilesNotConsiderPatterns(); - - /** - * @return {@inheritDoc}
    - * If patterns were given only files will be returned that matches these patterns. - */ - @Override - public Set getFilesRecursively() { - final Set files = new HashSet<>(); - this.walkFileTree(this, files); - return files; - } - - /** - * Recursively adds all files in {@code directory} and it's sub directories to {@code files}. - * - * @param directory - * @param files - */ - private void walkFileTree(final AbstractDirectory directory, final Set files) { - - files.addAll(directory.getFiles()); - - final Set subDirectories = directory.getDirectories(); - - for (final AbstractDirectory subDirectory : subDirectories) { - this.walkFileTree(subDirectory, files); - } - - } - - @Override - public abstract AbstractDirectory getDirectory(String relPathOfDirectory); - - /** - * @return Name of this directory. - */ - public abstract String getName(); - - /** - * @return Reference that points to this directory. - */ - public String getPath() { - return this.DIRECTORY_REFERENCE; - } - - /** - * @return Patterns to include only certain files in this directory. - */ - protected Set getIncludePatterns() { - return this.INCLUDE_PATTERNS; - } - - /** - * @return Patterns to exclude certain files from this directory. - */ - protected Set getExcludePatterns() { - return this.EXCLUDE_PATTERNS; - } - - /** - * @return {@code true} if this directory represents a file artifact, otherwise {@code false}. A - * file artifact is referenced by an URI that points on a file.
    - * If {@code true} this directory only contains the file at the reference. - */ - protected boolean isFileArtifact() { - return this.FILE_ARTIFACT; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARArtifact.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARArtifact.java deleted file mode 100644 index c0c87c483..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARArtifact.java +++ /dev/null @@ -1,182 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.core.model; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLDecoder; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Represents a CSAR artifact that is a directory or file in a CSAR. It can be also a complete CSAR. - * Provides methods for getting the artifact reference and include and / or exclude patterns, check - * if an artifact reference is a CSAR artifact (relative artifact reference), and browsing the - * content of the CSAR artifact (this is the artifact root). - */ -public class CSARArtifact extends AbstractArtifact { - - final private static Logger LOG = LoggerFactory.getLogger(CSARArtifact.class); - - /** - * {@link CSARDirectory} that represents the artifact root. - */ - private final CSARDirectory CSAR_ARTIFACT_ROOT; - - /** - * {@code true} if the reference of this CSAR artifact points to a file. If reference points to a - * directory {@code false}. - */ - private boolean fileArtifactReference = false; - - - /** - * Creates a {@link CSARArtifact}. - * - * @param artifactReference that points to this CSAR artifact. - * @param includePatterns to include only certain files in this CSAR artifact. - * @param excludePatterns to exclude certain files from this CSAR artifact. - * @param csarID of CSAR this artifact belongs to. - * @param directories - directories in this CSAR artifact (recursively). Each directory must be - * given relative to the CSAR root. - * @param fileToStorageProviderIDMap - file to storage provider ID mapping of all files in this CSAR - * artifact (recursively). Each file path must be given relative to the CSAR root. - * @throws UserException if artifact reference points a non-existent file / directory in CSAR or URL - * decoding on artifact reference failed. - */ - public CSARArtifact(final String artifactReference, final Set includePatterns, - final Set excludePatterns, final CSARID csarID, final Set directories, - final Map fileToStorageProviderIDMap) throws UserException { - super(artifactReference, includePatterns, excludePatterns); - - // As the artifact reference is a URI we must decode it to get the - // directory / file path with that can be searched in the CSAR meta - // data. - try { - final String artifactReferenceDecoded = URLDecoder.decode(this.getArtifactReference(), "UTF-8"); - - // directories and files in the artifact - final Set artifactDirectories = new HashSet<>(); - final Map artifactFileToStorageProviderIDMap = new HashMap<>(); - - // Artifact reference points to the CSAR root. We know - // directly that all directories and files of the CSAR belongs - // the artifact. - if (artifactReferenceDecoded.equals("")) { - - artifactDirectories.addAll(directories); - artifactFileToStorageProviderIDMap.putAll(fileToStorageProviderIDMap); - - } else { - - final Path artifactReferenceAsPath = Paths.get(artifactReferenceDecoded); - - for (final Map.Entry fileToStorageProviderIDEntry : fileToStorageProviderIDMap.entrySet()) { - final Path file = fileToStorageProviderIDEntry.getKey(); - if (file.startsWith(artifactReferenceAsPath)) { - final String fileStorageProviderID = fileToStorageProviderIDEntry.getValue(); - artifactFileToStorageProviderIDMap.put(file, fileStorageProviderID); - } - } - - // artifact reference points to a file in CSAR - if (artifactFileToStorageProviderIDMap.containsKey(artifactReferenceAsPath)) { - - this.fileArtifactReference = true; - - // artifact reference points to a directory or non-existent - // file / directory in CSAR - } else { - - for (final Path directory : directories) { - if (directory.startsWith(artifactReferenceAsPath)) { - artifactDirectories.add(directory); - } - } - - // artifact reference points to a directory - if (!artifactDirectories.isEmpty() || !artifactFileToStorageProviderIDMap.isEmpty()) { - // remove artifact root, because it's not in the - // artifact - artifactDirectories.remove(artifactReferenceAsPath); - } else { - throw new UserException("Artifact reference \"" + artifactReferenceDecoded - + "\" points to a non-existent file / directory in CSAR \"" + csarID + "\"."); - } - - } - - } - - // creates CSARDirectory that represents the artifact root - this.CSAR_ARTIFACT_ROOT = - new CSARDirectory(artifactReferenceDecoded, this.getIncludePatterns(), this.getExcludePatterns(), - csarID, artifactDirectories, artifactFileToStorageProviderIDMap, this.isFileArtifact()); - - } - catch (final UnsupportedEncodingException exc) { - throw new UserException( - "URL decoding on artifact reference \"" + this.getArtifactReference() + "\" failed.", exc); - } - - } - - @Override - protected AbstractDirectory getArtifactRoot() { - return this.CSAR_ARTIFACT_ROOT; - } - - /** - * Syntactically checks if the URI {@code artifactReference} refers to a file or directory in a - * CSAR.
    - * It points to a CSAR file / directory if it's a relative URI respectively without scheme.
    - *
    - * Note: This method only performs a syntax check, it doesn't make a statement about the existence - * of the CSAR file / directory. - * - * @param artifactReference to check - * @return {@code true} if {@code artifactReference} refers to a CSAR file / directory, otherwise - * {@code false}. - */ - public static boolean fitsArtifactReference(final String artifactReference) { - - String artifactRefScheme; - - try { - - artifactRefScheme = new URI(artifactReference).getScheme(); - if (artifactRefScheme == null) { - CSARArtifact.LOG.debug("Artifact reference \"{}\" refers to a file or directory in a CSAR.", - artifactReference); - return true; - } - - } - catch (final URISyntaxException exc) { - CSARArtifact.LOG.warn("An URI Exception occured.", exc); - } - - CSARArtifact.LOG.debug("Artifact reference \"{}\" refers not to a file or directory in a CSAR.", - artifactReference); - return false; - - } - - @Override - public boolean isFileArtifact() { - return this.fileArtifactReference; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARDirectory.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARDirectory.java deleted file mode 100644 index 27b86911c..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARDirectory.java +++ /dev/null @@ -1,263 +0,0 @@ -package org.opentosca.container.core.model; - -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Represents a directory in a CSAR. Provides methods for browsing and getting the meta data of the - * directory by using the local stored meta data of the CSAR. - */ -public class CSARDirectory extends AbstractDirectory { - - private final static Logger LOG = LoggerFactory.getLogger(CSARDirectory.class); - - /** - * CSAR ID of CSAR that contains this directory. - */ - private final CSARID CSAR_ID; - - /** - * Files and directories in this directory. - */ - private final Set DIRECTORIES; - private final Map FILE_TO_STORAGE_PROVIDER_ID_MAP; - - - /** - * Creates a {@link CSARDirectory} without any include / exclude patterns which have to be - * considered. Besides, the directory not represents a file artifact (reference of a file artifact - * points to a file). - * - * @param path - relative path to CSAR root of this directory. An empty string means the root. - * @param csarID of CSAR that contains this directory. - * @param directories - directories in this directory (recursively). Each directory must be given - * relative to the CSAR root. - * @param fileToStorageProviderIDMap - file to storage provider ID mapping of all files in this - * directory (recursively). Each file path must be given relative to the CSAR root. - */ - public CSARDirectory(final String directoryPath, final CSARID csarID, final Set directories, - final Map fileToStorageProviderIDMap) { - // no patterns, so we pass empty sets (immutable to avoid unnecessary - // object creations) - this(directoryPath, Collections.emptySet(), Collections.emptySet(), csarID, directories, - fileToStorageProviderIDMap, false); - } - - /** - * Creates a {@link CSARDirectory}. - * - * @param path - relative path to CSAR root of this directory. An empty string means the root. - * @param includePatterns to include only certain files in this directory. - * @param excludePatterns to exclude certain files from this directory. - * @param csarID of CSAR that contains this directory. - * @param directories - directories in this directory (recursively). Each directory must be given - * relative to the CSAR root. - * @param fileArtifact - {@code true} if this directory represents a file artifact (directory - * contains only the file at the artifact reference), otherwise {@code false}. - * @param fileToStorageProviderIDMap - file to storage provider ID mapping of files in this - * directory (recursively). Each file must be given relative to the CSAR root. - */ - public CSARDirectory(final String directoryPath, final Set includePatterns, - final Set excludePatterns, final CSARID csarID, final Set directories, - final Map fileToStorageProviderIDMap, final boolean fileArtifact) { - super(directoryPath, includePatterns, excludePatterns, fileArtifact); - this.FILE_TO_STORAGE_PROVIDER_ID_MAP = fileToStorageProviderIDMap; - this.CSAR_ID = csarID; - this.DIRECTORIES = directories; - - } - - @Override - protected AbstractFile getFileNotConsiderPatterns(final String relPathOfFile) { - - final Path relPathOfFileToCSARRoot = Paths.get(this.getPath()).resolve(relPathOfFile); - - if (!this.isFileArtifact()) { - - for (final Map.Entry fileToStorageProviderIDEntry : this.FILE_TO_STORAGE_PROVIDER_ID_MAP.entrySet()) { - - final Path file = fileToStorageProviderIDEntry.getKey(); - final String fileStorageProviderID = fileToStorageProviderIDEntry.getValue(); - - // found file to get - if (file.equals(relPathOfFileToCSARRoot)) { - return new CSARFile(file.toString(), this.CSAR_ID, fileStorageProviderID); - } - - } - - } else { - - // If it's a file artifact we know directly that the one file in the - // Map is the file of the artifact. - for (final Map.Entry fileToStorageProviderIDEntry : this.FILE_TO_STORAGE_PROVIDER_ID_MAP.entrySet()) { - - final Path file = fileToStorageProviderIDEntry.getKey(); - final String fileStorageProviderID = fileToStorageProviderIDEntry.getValue(); - - return new CSARFile(file.toString(), this.CSAR_ID, fileStorageProviderID); - - } - - } - - return null; - - } - - @Override - protected Set getFilesNotConsiderPatterns() { - - final Set csarFiles = new HashSet<>(); - - if (!this.isFileArtifact()) { - - final Path directoryReferenceAsPath = Paths.get(this.getPath()); - - for (final Map.Entry fileToStorageProviderIDEntry : this.FILE_TO_STORAGE_PROVIDER_ID_MAP.entrySet()) { - - final Path file = fileToStorageProviderIDEntry.getKey(); - final Path fileParent = file.getParent(); - final String fileStorageProviderID = fileToStorageProviderIDEntry.getValue(); - - // the second condition only applies if the file is in - // the CSAR root, because a file in root has no parent - if (directoryReferenceAsPath.equals(fileParent) || fileParent == null) { - csarFiles.add(new CSARFile(file.toString(), this.CSAR_ID, fileStorageProviderID)); - } - - } - - } else { - csarFiles.add(this.getFileNotConsiderPatterns("")); - } - - return csarFiles; - - } - - @Override - public AbstractDirectory getDirectory(final String relPathOfDirectory) { - - // If it's a file artifact we have no directories and can directly - // return null - if (!this.isFileArtifact()) { - - final Path relPathOfDirectoryToCSARRoot = Paths.get(this.getPath()).resolve(relPathOfDirectory); - - final AbstractDirectory directory = this.getDirectory(relPathOfDirectoryToCSARRoot); - - if (directory != null) { - CSARDirectory.LOG.debug("Directory \"{}\" relative to \"{}\" was found.", relPathOfDirectory, - this.getPath()); - } else { - CSARDirectory.LOG.warn("Directory \"{}\" relative to \"{}\" was not found.", relPathOfDirectory, - this.getPath()); - } - - return directory; - - } - - return null; - - } - - /** - * @param relPathOfDirectoryToCSARRoot - directory path relative to CSAR root. - * @return {@link AbstractDirectory} of directory {@code relPathOfDirectoryToCSARRoot}. If it not - * exists {@code null}. - */ - private AbstractDirectory getDirectory(final Path relPathOfDirectoryToCSARRoot) { - - // directories in directory to get - final Set directoriesInDirectory = new HashSet<>(); - - for (final Path directory : this.DIRECTORIES) { - if (directory.startsWith(relPathOfDirectoryToCSARRoot)) { - directoriesInDirectory.add(directory); - } - } - - // directory to get exists - if (!directoriesInDirectory.isEmpty()) { - - // files in directory to get - final Map fileToStorageProviderIDMapOfDirectory = new HashMap<>(); - - for (final Map.Entry fileToStorageProviderID : this.FILE_TO_STORAGE_PROVIDER_ID_MAP.entrySet()) { - - final Path file = fileToStorageProviderID.getKey(); - final String fileStorageProviderID = fileToStorageProviderID.getValue(); - - if (file.startsWith(relPathOfDirectoryToCSARRoot)) { - fileToStorageProviderIDMapOfDirectory.put(file, fileStorageProviderID); - } - - } - - // remove the directory to get (it's not IN the directory) - directoriesInDirectory.remove(relPathOfDirectoryToCSARRoot); - - return new CSARDirectory(relPathOfDirectoryToCSARRoot.toString(), this.getIncludePatterns(), - this.getExcludePatterns(), this.CSAR_ID, directoriesInDirectory, fileToStorageProviderIDMapOfDirectory, - false); - - } - - return null; - } - - @Override - public Set getDirectories() { - - final Set csarDirectories = new HashSet<>(); - - // If it's a file artifact we have no directories and can directly - // return an empty set. - if (!this.isFileArtifact()) { - - final Path directoryReferenceAsPath = Paths.get(this.getPath()); - - for (final Path directory : this.DIRECTORIES) { - - final Path directoryParent = directory.getParent(); - - // the second condition only applies if this directory is in - // the CSAR root, because a directory in root has no parent - if (directoryReferenceAsPath.equals(directoryParent) || directoryParent == null) { - csarDirectories.add(this.getDirectory(directory)); - } - - } - - } - - return csarDirectories; - - } - - @Override - public String getName() { - final Path directoryPath = Paths.get(this.getPath()); - return directoryPath.getFileName().toString(); - } - - /** - * @return {@inheritDoc} It's the relative path to CSAR root. - */ - @Override - public String getPath() { - return super.getPath(); - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARFile.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARFile.java deleted file mode 100644 index db505bf63..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/CSARFile.java +++ /dev/null @@ -1,279 +0,0 @@ -package org.opentosca.container.core.model; - -import java.io.InputStream; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.container.core.service.internal.ICoreInternalFileStorageProviderService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Represents a file in a CSAR. This file can be stored at an arbitrary storage provider. Provides - * methods to get it's meta data using the local stored meta data and fetch the file from the - * appropriate storage provider. - * - * @see ICoreInternalFileStorageProviderService - */ -public class CSARFile extends AbstractFile { - - private final static Logger LOG = LoggerFactory.getLogger(CSARFile.class); - - /** - * CSAR ID of CSAR that contains this file. - */ - private final CSARID CSAR_ID; - - /** - * ID of the storage provider on which this file is stored. - * - * @see ICoreInternalFileStorageProviderService - * - */ - private final String STORAGE_PROVIDER_ID; - - /** - * Bound, available storage providers.
    - *
    - * Note: Must be {@code static}, because otherwise, if we instantiate this class manually with - * {@code new} and not (automatically) by the OSGi framework, this variable would be not set. - */ - private static Map STORAGE_PROVIDERS = - Collections.synchronizedMap(new HashMap()); - - /** - * Must be {@code static}, because this class will be instantiated with {@code new}. - */ - private static IFileAccessService fileAccessService; - - - /** - * Default constructor needed by OSGi to instantiate this class. - */ - public CSARFile() { - this(null, null, null); - } - - /** - * Creates a {@link CSARFile}. - * - * @param relFilePathToCSARRoot - relative path to CSAR root of this file. - * @param csarID of CSAR that contains this file. - * @param storageProviderID of storage provider on which this file is stored. - * - * @see ICoreInternalFileStorageProviderService - */ - public CSARFile(final String relFilePathToCSARRoot, final CSARID csarID, final String storageProviderID) { - super(relFilePathToCSARRoot); - this.CSAR_ID = csarID; - this.STORAGE_PROVIDER_ID = storageProviderID; - } - - /** - * @param storageProviderID of storage provider to check if it's ready. - * @return {@code true} if storage provider {@code storageProviderID} is available and has no - * unsatisfied requirements, so it can be used. Otherwise {@code false} will be - * returned.
    - * Usually a requirement of a storage provider are the credentials (exception: file system - * storage provider) which must be set in the storage provider. - */ - private boolean isStorageProviderReady(final String storageProviderID) { - - CSARFile.LOG.debug("Checking if storage provider \"{}\" is ready...", storageProviderID); - - final ICoreInternalFileStorageProviderService storageProvider = - CSARFile.STORAGE_PROVIDERS.get(storageProviderID); - - if (storageProvider != null) { - if (storageProvider.isStorageProviderReady()) { - CSARFile.LOG.debug("Storage provider \"{}\" is ready.", storageProviderID); - return true; - } else { - CSARFile.LOG.warn("Storage provider \"{}\" is not ready.", storageProviderID); - } - } else { - CSARFile.LOG.warn("Storage provider \"{}\" is not available.", storageProviderID); - } - - return false; - - } - - /** - * @throws SystemException if required storage provider is not available and ready, file was not - * found on storage provider or an error occurred during retrieving. - */ - @Override - public Path getFile() throws SystemException { - - if (this.isStorageProviderReady(this.STORAGE_PROVIDER_ID)) { - - final ICoreInternalFileStorageProviderService storageProvider = - CSARFile.STORAGE_PROVIDERS.get(this.STORAGE_PROVIDER_ID); - - final Path targetFile = CSARFile.fileAccessService.getTemp().toPath().resolve(this.getName()); - - final String relFilePathOnStorageProvider = - this.buildFileOfCSARStorageProviderPath(this.CSAR_ID, this.getPath()); - - storageProvider.getFile(relFilePathOnStorageProvider, targetFile); - - return targetFile; - - } else { - throw new SystemException("Can't retrieve file \"" + this.getPath() + "\" of CSAR \"" + this.CSAR_ID - + "\", because storage provider \"" + this.STORAGE_PROVIDER_ID + "\" is not available and ready."); - } - - } - - /** - * @throws SystemException if required storage provider is not available and ready, file was not - * found on storage provider or an error occurred during getting. - */ - @Override - public InputStream getFileAsInputStream() throws SystemException { - - if (this.isStorageProviderReady(this.STORAGE_PROVIDER_ID)) { - - final ICoreInternalFileStorageProviderService storageProvider = - CSARFile.STORAGE_PROVIDERS.get(this.STORAGE_PROVIDER_ID); - - final String relFilePathOnStorageProvider = - this.buildFileOfCSARStorageProviderPath(this.CSAR_ID, this.getPath()); - - InputStream fileInputStream; - - fileInputStream = storageProvider.getFileAsInputStream(relFilePathOnStorageProvider); - - return fileInputStream; - - } else { - throw new SystemException("Can't retrieve file \"" + this.getPath() + "\" of CSAR \"" + this.CSAR_ID - + "\" as input stream, because storage provider \"" + this.STORAGE_PROVIDER_ID + "\" is not ready."); - } - - } - - /** - * Builds the relative path where file {@code relFilePathToCSARRoot} of CSAR {@code csarID} should - * be stored / is located on a storage provider.
    - *
    - * Location of a file of a CSAR on a storage provider:
    - * {@code /}
    - *
    - * Note: On a blob store usually this path will be created in a container. Name of the container is - * defined by the storage provider. - * - * @param csarID of CSAR - * @param relFilePathToCSARRoot - relative path to CSAR root of file - * @return Relative path where the CSAR file should be stored / is located. - */ - private String buildFileOfCSARStorageProviderPath(final CSARID csarID, final String relFilePathToCSARRoot) { - final String relFilePathToStore = Paths.get(csarID.toString()).resolve(relFilePathToCSARRoot).toString(); - return relFilePathToStore; - } - - @Override - public String getName() { - final Path filePath = Paths.get(this.getPath()); - return filePath.getFileName().toString(); - } - - /** - * @return {@inheritDoc} It's the relative path to CSAR root. - */ - @Override - public String getPath() { - return super.getPath(); - } - - @Override - public String toString() { - return "File \"" + this.getPath() + "\" of CSAR \"" + this.CSAR_ID + "\" on storage provider \"" - + this.STORAGE_PROVIDER_ID + "\"."; - } - - @Override - public boolean equals(final Object file) { - if (file instanceof CSARFile) { - final CSARFile csarFile = (CSARFile) file; - if (this.getPath().equals(csarFile.getPath()) && this.CSAR_ID.equals(csarFile.CSAR_ID) - && this.STORAGE_PROVIDER_ID.equals(csarFile.STORAGE_PROVIDER_ID)) { - return true; - } - } - return false; - } - - @Override - public int hashCode() { - return this.toString().hashCode(); - } - - /** - * Binds the File Access Service. - * - * @param fileAccessService to bind - */ - protected void bindFileAccessService(final IFileAccessService fileAccessService) { - if (fileAccessService != null) { - CSARFile.fileAccessService = fileAccessService; - CSARFile.LOG.debug("File Access Service bound."); - } else { - CSARFile.LOG.warn("Binding File Access Service failed."); - } - } - - /** - * Unbinds the File Access Service. - * - * @param fileAccessService to unbind - */ - protected void unbindFileAccessService(final IFileAccessService fileAccessService) { - if (fileAccessService != null) { - CSARFile.fileAccessService = null; - CSARFile.LOG.debug("File Access Service unbound."); - } else { - CSARFile.LOG.warn("Unbinding File Access Service failed."); - } - } - - /** - * Binds a File Storage Provider. - * - * @param storageProvider to bind - */ - protected void bindCoreInternalFileStorageProviderService(final ICoreInternalFileStorageProviderService storageProvider) { - if (storageProvider != null) { - CSARFile.STORAGE_PROVIDERS.put(storageProvider.getStorageProviderID(), storageProvider); - CSARFile.LOG.debug("Storage provider \"{}\" ({}) bound.", storageProvider.getStorageProviderID(), - storageProvider.getStorageProviderName()); - } else { - CSARFile.LOG.warn("Binding a storage provider failed."); - } - } - - /** - * Unbinds a File Storage Provider. - * - * @param storageProvider to unbind - */ - protected void unbindCoreInternalFileStorageProviderService(final ICoreInternalFileStorageProviderService storageProvider) { - if (storageProvider != null) { - final String storageProviderID = storageProvider.getStorageProviderID(); - CSARFile.STORAGE_PROVIDERS.remove(storageProviderID); - CSARFile.LOG.debug("Storage provider \"{}\" ({}) unbound.", storageProvider.getStorageProviderID(), - storageProvider.getStorageProviderName()); - } else { - CSARFile.LOG.warn("Unbinding a storage provider failed."); - } - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/CSARContent.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/CSARContent.java deleted file mode 100644 index a008c36b2..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/CSARContent.java +++ /dev/null @@ -1,519 +0,0 @@ -package org.opentosca.container.core.model.csar; - -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.persistence.CollectionTable; -import javax.persistence.Column; -import javax.persistence.ElementCollection; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.MapKeyColumn; -import javax.persistence.NamedNativeQuery; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.PostLoad; -import javax.persistence.Table; -import javax.persistence.Transient; - -import org.eclipse.persistence.annotations.Convert; -import org.eclipse.persistence.annotations.Converter; -import org.eclipse.persistence.annotations.Converters; -import org.eclipse.persistence.annotations.MapKeyConvert; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.common.jpa.PathConverter; -import org.opentosca.container.core.model.AbstractArtifact; -import org.opentosca.container.core.model.AbstractDirectory; -import org.opentosca.container.core.model.AbstractFile; -import org.opentosca.container.core.model.CSARArtifact; -import org.opentosca.container.core.model.CSARDirectory; -import org.opentosca.container.core.model.IBrowseable; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.csar.id.CSARIDConverter; -import org.opentosca.container.core.model.csar.toscametafile.TOSCAMetaFile; -import org.opentosca.container.core.model.csar.toscametafile.TOSCAMetaFileAttributes; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Represents the meta data of a CSAR and makes the content the CSAR available. It provides - * structured access to all files and directories of the CSAR. For CSAR browsing this represents the - * CSAR root. Access to information contained in the TOSCA meta file of the CSAR, e.g. the author. - * Additionally, it resolves artifact references respectively gives access to the artifact content. - */ -@NamedQueries({@NamedQuery(name = CSARContent.getCSARIDs, query = CSARContent.getCSARIDsQuery), - @NamedQuery(name = CSARContent.getFileToStorageProviderIDMapByCSARID, - query = CSARContent.getFileToStorageProviderIDMapByCSARIDQuery), - @NamedQuery(name = CSARContent.getDirectoriesByCSARID, query = CSARContent.getDirectoriesByCSARIDQuery)}) -@NamedNativeQuery(name = CSARContent.storeStorageProviderIDByFileAndCSARID, - query = CSARContent.storeStorageProviderIDByFileAndCSARIDQuery) -@Entity(name = CSARContent.CSAR_TABLE_NAME) -@Table(name = CSARContent.CSAR_TABLE_NAME) -@Converters({@Converter(name = "CSARIDConverter", converterClass = CSARIDConverter.class), - @Converter(name = "PathConverter", converterClass = PathConverter.class)}) -public class CSARContent implements IBrowseable { - - final private static Logger LOG = LoggerFactory.getLogger(CSARContent.class); - - protected static final String CSAR_TABLE_NAME = "CSAR"; - protected static final String CSAR_FILES_TABLE_NAME = "CSAR_Files"; - protected static final String CSAR_DIRECTORIES_TABLE_NAME = "CSAR_Directories"; - - /* - * JPQL Queries - */ - public static final String getCSARIDs = "CSARContent.getCSARIDs"; - protected static final String getCSARIDsQuery = "SELECT t.csarID FROM " + CSARContent.CSAR_TABLE_NAME + " t"; - - public static final String getFileToStorageProviderIDMapByCSARID = - CSARContent.CSAR_TABLE_NAME + ".getFileToStorageProviderIDMapByCSARID"; - protected static final String getFileToStorageProviderIDMapByCSARIDQuery = "SELECT KEY(u), VALUE(u) FROM " - + CSARContent.CSAR_TABLE_NAME + " t JOIN t.fileToStorageProviderIDMap u WHERE t.csarID = :csarID"; - - /** - * For storing / updating the storage provider ID of a file in CSAR we must use a native SQL query, - * because JPQL update queries doesn't work on Maps. - */ - public static final String storeStorageProviderIDByFileAndCSARID = - CSARContent.CSAR_TABLE_NAME + ".storeStorageProviderIDByFileAndCSARID"; - protected static final String storeStorageProviderIDByFileAndCSARIDQuery = - "UPDATE " + CSARContent.CSAR_FILES_TABLE_NAME + " SET storageProviderID = ? WHERE file = ? AND csarID = ?"; - - public static final String getDirectoriesByCSARID = CSARContent.CSAR_TABLE_NAME + ".getDirectoriesByCSARID"; - protected static final String getDirectoriesByCSARIDQuery = - "SELECT t FROM " + CSARContent.CSAR_TABLE_NAME + " t WHERE t.csarID = :csarID"; - - /** - * Relative path to CSAR root of the {@code IMPORTS} directory. - * - * @see org.opentosca.settings.Settings - */ - @Transient - private final String IMPORTS_DIR_REL_PATH = Settings.getSetting("csarImportsRelPath"); - - /** - * Relative path to CSAR root of the {@code Definitions} directory. - * - * @see org.opentosca.settings.Settings - */ - @Transient - private final String CSAR_DEFINITIONS_DIR_REL_PATH = Settings.getSetting("csarDefinitionsRelPath"); - - /** - * Possible file extensions of a TOSCA file. - * - * @see org.opentosca.settings.Settings - */ - @Transient - private final String[] TOSCA_FILE_EXTENSIONS = Settings.getSetting("toscaFileExtensions").split(";"); - - /** - * Identifies this CSAR file. - */ - @Id - @Convert("CSARIDConverter") - @Column(name = "csarID") - private CSARID csarID; - - /** - * File to storage provider ID mapping of all files in this CSAR. Each file path is given relative - * to the CSAR root. - */ - @ElementCollection - @CollectionTable(name = CSARContent.CSAR_FILES_TABLE_NAME, joinColumns = @JoinColumn(name = "csarID")) - @MapKeyColumn(name = "file") - @MapKeyConvert("PathConverter") - @Column(name = "storageProviderID") - private Map fileToStorageProviderIDMap; - - /** - * Directories in this CSAR.
    - * Each directory is given relative to the CSAR root. - */ - @ElementCollection - @CollectionTable(name = CSARContent.CSAR_DIRECTORIES_TABLE_NAME, joinColumns = @JoinColumn(name = "csarID")) - @Column(name = "directory") - @Convert("PathConverter") - private Set directories; - - /** - * Contains the content of the TOSCA meta file of this CSAR. - */ - @Column(name = "toscaMetaFile") - private TOSCAMetaFile toscaMetaFile = null; - - /** - * For CSAR browsing this class represents the CSAR root.
    - * Browsing methods in this class redirecting to the same methods of this {@link CSARDirectory} by - * delegation. - */ - @Transient - private AbstractDirectory csarRoot = null; - - - /** - * Needed by Eclipse Link. - */ - public CSARContent() { - super(); - } - - /** - * Creates a {@code CSARContent}. - * - * @param csarID of CSAR - * @param directories in the CSAR. - * @param fileToStorageProviderID - Files in the CSAR. A file given relative to the CSAR root is - * mapped to the ID of the storage provider on which the file is stored. - * @param toscaMetaFile - contains the content of the TOSCA meta file of the CSAR. - */ - public CSARContent(final CSARID csarID, final Set directories, - final Map fileToStorageProviderIDMap, final TOSCAMetaFile toscaMetaFile) { - this.directories = directories; - this.fileToStorageProviderIDMap = fileToStorageProviderIDMap; - this.toscaMetaFile = toscaMetaFile; - this.csarID = csarID; - } - - /** - * Creates a {@link CSARDirectory} that represents the CSAR root. This is necessary for CSAR - * browsing.
    - * Method will be automatically called by Eclipse Link after this entity was retrieved. - */ - @PostLoad - protected void setUpBrowsing() { - this.csarRoot = new CSARDirectory("", this.csarID, this.directories, this.fileToStorageProviderIDMap); - } - - /** - * @return CSAR ID of this CSAR. - */ - public CSARID getCSARID() { - return this.csarID; - } - - @Override - public AbstractFile getFile(final String relPathOfFile) { - return this.csarRoot.getFile(relPathOfFile); - } - - @Override - public Set getFiles() { - return this.csarRoot.getFiles(); - } - - @Override - public Set getFilesRecursively() { - return this.csarRoot.getFilesRecursively(); - } - - @Override - public AbstractDirectory getDirectory(final String relPathOfDirectory) { - return this.csarRoot.getDirectory(relPathOfDirectory); - } - - @Override - public Set getDirectories() { - return this.csarRoot.getDirectories(); - } - - public Set getDirectoriesJpa() { - return this.directories; - } - - /** - * @param fileExtension - * @return All files with extension {@code fileExtension} in directory "IMPORTS" of this CSAR as Set - * of {@code AbstractFile}. - */ - private Set getImportFiles(final String fileExtension) { - - final Set importFiles = new HashSet<>(); - - CSARContent.LOG.debug("Retrieving import file(s) with extension \"{}\" in CSAR \"{}\"...", fileExtension, - this.csarID); - - final AbstractDirectory importsDirectory = this.getDirectory(this.IMPORTS_DIR_REL_PATH); - - if (importsDirectory != null) { - for (final AbstractFile file : importsDirectory.getFilesRecursively()) { - if (file.getName().toLowerCase().endsWith("." + fileExtension)) { - importFiles.add(file); - } - } - } - - CSARContent.LOG.debug("{} import file(s) with extension \"{}\" were found in CSAR \"{}\".", importFiles.size(), - fileExtension, this.csarID); - - return importFiles; - } - - /** - * Resolves the artifact reference {@code artifactReference} and makes the content of the artifact - * available.
    - * - * @param artifactReference - relative or absolute URI that points to a file or directory. A - * relative URI points to a file / directory in this CSAR. If you pass an empty string it's - * means the CSAR root, so you get an artifact that represents the complete CSAR. - * @return {@code AbstractArtifact} that makes the content of the artifact available. - * @throws UserException if {@code artifactReference} points to a non-existent file / directory or - * is an invalid URI. - * @throws SystemException if type of {@code artifactReference} respectively artifact is not - * supported. - */ - public AbstractArtifact resolveArtifactReference(final String artifactReference) throws UserException, - SystemException { - - // no patterns, so we pass empty sets (immutable to avoid unnecessary - // object creations) - return this.resolveArtifactReference(artifactReference, Collections.emptySet(), - Collections.emptySet()); - - } - - /** - * Resolves the artifact reference {@code artifactReference} and makes the content of the artifact - * available. Optionally {@code includePatterns} and {@code excludePatterns} can be passed.
    - *
    - * An include pattern includes only certain files at the reference in the artifact. By analogy, an - * exclude pattern excludes files from the artifact. A pattern must be given as a regular - * expression.
    - * Note, patterns will be only applied if artifact reference points to a directory (or root). - * Furthermore, they will be only matched against files at the artifact reference. These - * restrictions are in accordance with the TOSCA specification CS01. - * - * @param artifactReference - relative or absolute URI that points to a file or directory. A - * relative URI points to a file / directory in this CSAR. If you pass an empty string it's - * means the CSAR root, so you get an artifact that represents the complete CSAR. - * @param includePatterns to include only certain files in the artifact. No include patterns must be - * passed by an empty set. - * @param excludePatterns to exclude certain files from the artifact. No exclude patterns must be - * passed by an empty set. - * @return {@code AbstractArtifact} that makes the content of the artifact available. - * @throws UserException if {@code artifactReference} points to a non-existent file / directory or - * is not a valid URI. - * @throws SystemException if type of {@code artifactReference} respectively artifact is not - * supported. - */ - public AbstractArtifact resolveArtifactReference(final String artifactReference, final Set includePatterns, - final Set excludePatterns) throws UserException, - SystemException { - - CSARContent.LOG.debug("Resolving artifact reference \"{}\"...", artifactReference); - - String artifactReferenceTrimed = artifactReference.trim(); - - // spaces are allowed in XSD anyURI => we must encode spaces - artifactReferenceTrimed = artifactReferenceTrimed.replaceAll("[ ]", "%20"); - - try { - - new URI(artifactReferenceTrimed); - CSARContent.LOG.debug("Artifact reference \"{}\" is a valid URI.", artifactReferenceTrimed.toString()); - - AbstractArtifact artifact = null; - - if (CSARArtifact.fitsArtifactReference(artifactReferenceTrimed)) { - artifact = new CSARArtifact(artifactReferenceTrimed, includePatterns, excludePatterns, this.csarID, - this.directories, this.fileToStorageProviderIDMap); - // if further AbstractArtifact implementations exists, we - // can check here if they fits - } else { - throw new SystemException("Artifact reference \"" + artifactReferenceTrimed + "\" is not supported."); - } - - CSARContent.LOG.debug("Resolving artifact reference \"{}\" completed.", artifactReferenceTrimed); - - return artifact; - - } - catch (final URISyntaxException exc) { - throw new UserException("Artifact reference \"" + artifactReference + "\" is not a valid URI.", exc); - } - - } - - /** - * @return All files in directory "Definitions" of this CSAR as Set of {@code AbstractFile}. - */ - public Set getTOSCAsInDefinitionsDir() { - - CSARContent.LOG.debug("Retrieving TOSCA files in directory \"{}\" of CSAR \"{}\"...", - this.CSAR_DEFINITIONS_DIR_REL_PATH, this.csarID); - - Set toscasInDefinitionsDir = new HashSet<>(); - - final AbstractDirectory definitionsDir = this.getDirectory(this.CSAR_DEFINITIONS_DIR_REL_PATH); - - if (definitionsDir != null) { - - toscasInDefinitionsDir = definitionsDir.getFilesRecursively(); - - // for (AbstractFile fileInDefinitionDir : - // definitionsDir.getFilesRecursively()) { - // if (this.hasFileExtension(fileInDefinitionDir.getPath(), - // this.TOSCA_FILE_EXTENSIONS)) { - // toscasInDefinitionsDir.add(fileInDefinitionDir); - // } - // } - - } else { - CSARContent.LOG.warn("Directory \"{}\" was not found in CSAR \"{}\".", this.CSAR_DEFINITIONS_DIR_REL_PATH, - this.csarID); - } - - CSARContent.LOG.debug("{} TOSCA files were found in directory \"{}\" of CSAR \"{}\".", - toscasInDefinitionsDir.size(), this.CSAR_DEFINITIONS_DIR_REL_PATH, this.csarID); - - return toscasInDefinitionsDir; - - } - - // /** - // * @param file - // * @param extensions of a file. - // * @return {@code true}, if file {@code file} has any of the file - // extensions - // * {@code extensions}, otherwise {@code false}. - // */ - // private boolean hasFileExtension(String file, String... extensions) { - // for (String extension : extensions) { - // if (file.toLowerCase().endsWith("." + extension)) { - // return true; - // } - // } - // return false; - // } - - /** - * @return Root TOSCA file of this CSAR as {@code AbstractFile}.
    - * If no root TOSCA path is specified in the TOSCA meta file (attribute "Entry-Definitions") - * or path points to a non-existent file {@code null}. - */ - public AbstractFile getRootTOSCA() { - - CSARContent.LOG.debug("Retrieving root TOSCA of CSAR \"{}\"...", this.csarID); - - String relPathOfRootTOSCA = null; - AbstractFile rootTOSCA = null; - - relPathOfRootTOSCA = this.toscaMetaFile.getEntryDefinitions(); - - if (relPathOfRootTOSCA != null) { - - rootTOSCA = this.getFile(relPathOfRootTOSCA); - - if (rootTOSCA != null) { - CSARContent.LOG.debug("Root TOSCA exists at \"{}\" in CSAR \"{}\".", rootTOSCA.getPath(), this.csarID); - } else { - CSARContent.LOG.warn("Root TOSCA path \"{}\" specified in TOSCA meta file of CSAR \"{}\" points to a non-existing file.", - relPathOfRootTOSCA, this.csarID); - } - - } else { - CSARContent.LOG.warn("Root TOSCA path is not specified in TOSCA meta file of CSAR \"{}\".", this.csarID); - } - - return rootTOSCA; - } - - /** - * @return XML files in directory "IMPORTS" of this CSAR as Set of {@code AbstractFile}. - */ - public Set getXMLImports() { - return this.getImportFiles("xml"); - } - - /** - * @return WSDL files in directory "IMPORTS" of this CSAR as Set of {@code AbstractFile}. - */ - public Set getWSDLImports() { - return this.getImportFiles("wsdl"); - } - - /** - * @return XSD files in directory "IMPORTS" of this CSAR as Set of {@code AbstractFile}. - */ - public Set getXSDImports() { - return this.getImportFiles("xsd"); - } - - /** - * @return Author of this CSAR. If no author is specified in TOSCA meta file {@code null}. - */ - public String getCSARAuthor() { - - final String author = this.toscaMetaFile.getCreatedBy(); - - if (author == null) { - CSARContent.LOG.debug("Author is not specified in TOSCA meta file of CSAR \"{}\".", - TOSCAMetaFileAttributes.CREATED_BY, this.csarID); - } else { - CSARContent.LOG.debug("Author of CSAR \"{}\": {}", this.csarID, author); - } - - return author; - - } - - /** - * @return Description of this CSAR. If no description is specified in TOSCA meta file {@code null}. - */ - public String getCSARDescription() { - - final String description = this.toscaMetaFile.getDescription(); - - if (description == null) { - CSARContent.LOG.debug("Description is not specified in TOSCA meta file of CSAR \"{}\".", - TOSCAMetaFileAttributes.DESCRIPTION, this.csarID); - } else { - CSARContent.LOG.debug("Description of CSAR \"{}\": {}", this.csarID, description); - } - - return description; - - } - - /** - * @return Picture that visualizes the topology of this CSAR as {@code AbstractFile}. If no topology - * picture path is specified in TOSCA meta file (attribute "Topology") or path points to a - * non-existent file {@code null}. - */ - public AbstractFile getTopologyPicture() { - - String topologyPictureRelPath = null; - AbstractFile topologyPicture = null; - - topologyPictureRelPath = this.toscaMetaFile.getTopology(); - - if (topologyPictureRelPath != null) { - topologyPicture = this.getFile(topologyPictureRelPath); - if (topologyPicture != null) { - CSARContent.LOG.debug("Topology picture exists at \"{}\" in CSAR \"{}\".", topologyPicture.getPath(), - this.csarID); - } else { - CSARContent.LOG.warn("Topology picture path specified in TOSCA meta file of CSAR \"{}\" points to a non-existing file.", - this.csarID); - } - } else { - CSARContent.LOG.warn("Topology picture path is not specified in TOSCA meta file of CSAR \"{}\".", - this.csarID); - } - - return topologyPicture; - - } - - public AbstractDirectory getCsarRoot() { - return this.csarRoot; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/id/CSARIDConverter.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/id/CSARIDConverter.java deleted file mode 100644 index 918d3c9e2..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/id/CSARIDConverter.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.opentosca.container.core.model.csar.id; - -import org.eclipse.persistence.mappings.DatabaseMapping; -import org.eclipse.persistence.mappings.converters.Converter; -import org.eclipse.persistence.sessions.Session; - -/** - * This class is used to convert {@link CSARID} to String, and {@link String} back to {@link CSARID} - * when persisting {@link CSARID} fields with JPA. The conversion needs to be done, as we cannot - * directly query for {@link CSARID} in JPQL. - */ -public class CSARIDConverter implements Converter { - - private static final long serialVersionUID = -3390146119281040955L; - - - @Override - public Object convertDataValueToObjectValue(final Object arg0, final Session arg1) { - return arg0 != null ? new CSARID((String) arg0) : null; - } - - @Override - public Object convertObjectValueToDataValue(final Object arg0, final Session arg1) { - return arg0 != null ? ((CSARID) arg0).toString() : null; - } - - @Override - public void initialize(final DatabaseMapping arg0, final Session arg1) {} - - @Override - public boolean isMutable() { - return false; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFile.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFile.java deleted file mode 100644 index 047a805ee..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFile.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.opentosca.container.core.model.csar.toscametafile; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.springsource.util.parser.manifest.ManifestContents; - -/** - * Provides structured access to the content of a TOSCA meta file. - */ -public class TOSCAMetaFile implements Serializable { - - private static final long serialVersionUID = 5636441655503533546L; - - Map block0 = new HashMap<>(); - List> fileBlocks = new ArrayList<>(); - - - public TOSCAMetaFile(final ManifestContents manifestContent) { - this.block0 = manifestContent.getMainAttributes(); - for (final String name : manifestContent.getSectionNames()) { - final Map fileBlock = new HashMap<>(); - fileBlock.put(TOSCAMetaFileAttributes.NAME, name); - fileBlock.putAll(manifestContent.getAttributesForSection(name)); - this.fileBlocks.add(fileBlock); - } - } - - public String getCSARVersion() { - return this.block0.get(TOSCAMetaFileAttributes.CSAR_VERSION); - } - - public String getTOSCAMetaVersion() { - return this.block0.get(TOSCAMetaFileAttributes.TOSCA_META_VERSION); - } - - public String getCreatedBy() { - return this.block0.get(TOSCAMetaFileAttributes.CREATED_BY); - } - - public String getEntryDefinitions() { - return this.block0.get(TOSCAMetaFileAttributes.ENTRY_DEFINITIONS); - } - - public String getDescription() { - return this.block0.get(TOSCAMetaFileAttributes.DESCRIPTION); - } - - public String getTopology() { - return this.block0.get(TOSCAMetaFileAttributes.TOPOLOGY); - } - - public Map getBlock0() { - return this.block0; - } - - public List> getFileBlocks() { - return this.fileBlocks; - } - - /** - * Returns the Mime Type for a given name. - * - * @param name a reference to a file - * @return the mime type associated with the given name, null if no mime type was found - */ - public String getMimeType(final String name) { - Objects.requireNonNull(name, "Name must not be null"); - for (final Map map : this.getFileBlocks()) { - final String storedName = map.get("Name"); - if (name.equals(storedName)) { - // first hit, check whether content-type is stored - final String contentType = map.get("Content-Type"); - if (contentType != null) { - // hit - return the found content type - return contentType; - } - } - } - // nothing found - return null; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileAttributes.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileAttributes.java deleted file mode 100644 index 97a06af1b..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileAttributes.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.opentosca.container.core.model.csar.toscametafile; - -/** - * Predefined attribute names and values of a TOSCA meta file. - */ -public class TOSCAMetaFileAttributes { - - // of block 0 - final public static String TOSCA_META_VERSION = "TOSCA-Meta-Version"; - final public static String TOSCA_META_VERSION_VALUE = "1.0"; - final public static String CSAR_VERSION = "CSAR-Version"; - final public static String CSAR_VERSION_VALUE = "1.0"; - final public static String CREATED_BY = "Created-By"; - final public static String ENTRY_DEFINITIONS = "Entry-Definitions"; - final public static String TOPOLOGY = "Topology"; - final public static String DESCRIPTION = "Description"; - - // of blocks > 0 (file blocks) - final public static String NAME = "Name"; - final public static String CONTENT_TYPE = "Content-Type"; -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileParser.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileParser.java deleted file mode 100644 index 592682763..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileParser.java +++ /dev/null @@ -1,284 +0,0 @@ -package org.opentosca.container.core.model.csar.toscametafile; - -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.nio.file.Path; -import java.util.List; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.springsource.util.parser.manifest.ManifestContents; -import com.springsource.util.parser.manifest.ManifestParser; -import com.springsource.util.parser.manifest.ManifestProblem; -import com.springsource.util.parser.manifest.RecoveringManifestParser; - -/** - * Parses and validates a TOSCA meta file. - */ -public class TOSCAMetaFileParser { - - final private static Logger LOG = LoggerFactory.getLogger(TOSCAMetaFileParser.class); - - - /** - * Parses and validates the toscaMetaFile. - * - * @param toscaMetaFile to process - * @return TOSCAMetaFile that gives access to the content of the TOSCA meta file. If - * the given file doesn't exist or is invalid null. - */ - public TOSCAMetaFile parse(final Path toscaMetaFile) { - - // counts the errors during parsing - int numErrors = 0; - - FileReader reader = null; - ManifestParser parser = null; - ManifestContents manifestContent = null; - TOSCAMetaFile toscaMetaFileContent = null; - - try { - - parser = new RecoveringManifestParser(); - reader = new FileReader(toscaMetaFile.toFile()); - TOSCAMetaFileParser.LOG.debug("Parsing TOSCA meta file \"{}\"...", toscaMetaFile.getFileName().toString()); - manifestContent = parser.parse(reader); - reader.close(); - - for (final ManifestProblem problem : parser.getProblems()) { - this.logManifestProblem(problem); - numErrors++; - } - - numErrors += this.validateBlock0(manifestContent); - numErrors += this.validateFileBlocks(manifestContent); - - if (numErrors == 0) { - TOSCAMetaFileParser.LOG.debug("Parsing TOSCA meta file \"{}\" completed without errors. TOSCA meta file is valid.", - toscaMetaFile.getFileName().toString()); - toscaMetaFileContent = new TOSCAMetaFile(manifestContent); - } else { - TOSCAMetaFileParser.LOG.error("Parsing TOSCA meta file \"{}\" failed - {} error(s) occured. TOSCA meta file is invalid.", - toscaMetaFile.getFileName().toString(), numErrors); - } - - } - catch (final FileNotFoundException exc) { - TOSCAMetaFileParser.LOG.error("\"{}\" doesn't exist or is not a file.", toscaMetaFile, exc); - } - catch (final IOException exc) { - TOSCAMetaFileParser.LOG.error("An IO Exception occured.", exc); - } - finally { - if (reader != null) { - try { - reader.close(); - } - catch (final IOException exc) { - TOSCAMetaFileParser.LOG.warn("An IOException occured.", exc); - } - } - } - - return toscaMetaFileContent; - - } - - /** - * Validates block 0 of the TOSCA meta file.
    - *
    - * Required attributes in block 0: - *

      - *
    • TOSCA-Meta-Version (value must be 1.0)
    • - *
    • CSAR-Version (value must be 1.0)
    • - *
    • Created-By
    • - *
    - * Optional attributes in block 0: - *
      - *
    • Entry-Definitions
    • - *
    • Description
    • - *
    • Topology
    • - *
    - * - * Further, arbitrary attributes are also allowed.
    - *
    - * - * @param mf to validate - * @return Number of errors occurred during validation. - */ - private int validateBlock0(final ManifestContents mf) { - - int numErrors = 0; - - String metaFileVersion = null; - String csarVersion = null; - String createdBy = null; - String entryDefinitions = null; - String description = null; - String topology = null; - - final Map mainAttr = mf.getMainAttributes(); - - metaFileVersion = mainAttr.get(TOSCAMetaFileAttributes.TOSCA_META_VERSION); - - if (metaFileVersion == null) { - this.logAttrMissing(TOSCAMetaFileAttributes.TOSCA_META_VERSION, 0); - numErrors++; - } else if (!(metaFileVersion = - metaFileVersion.trim()).equals(TOSCAMetaFileAttributes.TOSCA_META_VERSION_VALUE)) { - this.logAttrWrongVal(TOSCAMetaFileAttributes.TOSCA_META_VERSION, 0, - TOSCAMetaFileAttributes.TOSCA_META_VERSION_VALUE); - numErrors++; - } - - csarVersion = mainAttr.get(TOSCAMetaFileAttributes.CSAR_VERSION); - - if (csarVersion == null) { - this.logAttrMissing(TOSCAMetaFileAttributes.CSAR_VERSION, 0); - numErrors++; - } else if (!(csarVersion = csarVersion.trim()).equals(TOSCAMetaFileAttributes.TOSCA_META_VERSION_VALUE)) { - this.logAttrWrongVal(TOSCAMetaFileAttributes.CSAR_VERSION, 0, TOSCAMetaFileAttributes.CSAR_VERSION_VALUE); - numErrors++; - } - - createdBy = mainAttr.get(TOSCAMetaFileAttributes.CREATED_BY); - - if (createdBy == null) { - this.logAttrMissing(TOSCAMetaFileAttributes.CREATED_BY, 0); - numErrors++; - } else if ((createdBy = createdBy.trim()).isEmpty()) { - this.logAttrValEmpty(TOSCAMetaFileAttributes.CREATED_BY, 0); - numErrors++; - } - - entryDefinitions = mainAttr.get(TOSCAMetaFileAttributes.ENTRY_DEFINITIONS); - - if (entryDefinitions != null && entryDefinitions.trim().isEmpty()) { - this.logAttrValEmpty(TOSCAMetaFileAttributes.ENTRY_DEFINITIONS, 0); - numErrors++; - } - - description = mainAttr.get(TOSCAMetaFileAttributes.DESCRIPTION); - - if (description != null && description.trim().isEmpty()) { - this.logAttrValEmpty(TOSCAMetaFileAttributes.DESCRIPTION, 0); - numErrors++; - } - - topology = mainAttr.get(TOSCAMetaFileAttributes.TOPOLOGY); - - if (topology != null && topology.trim().isEmpty()) { - this.logAttrValEmpty(TOSCAMetaFileAttributes.TOPOLOGY, 0); - numErrors++; - } - - return numErrors; - - } - - /** - * Validates the file blocks (block 1 to last block) of the TOSCA meta file.
    - *
    - * Each file block has the following required attributes: - *
      - *
    • Name
    • - *
    • Content-Type (will be checked for correct syntax)
    • - *
    - * - * Further, arbitrary attributes are also allowed in a file block.
    - *
    - * - * @param mf to validate. - * @return Number of errors occurred during validation. - */ - private int validateFileBlocks(final ManifestContents mf) { - - int blockNr = 0; - int numErrors = 0; - - String contentType; - - final List names = mf.getSectionNames(); - - for (final String name : names) { - - blockNr++; - - if (name != null && name.trim().isEmpty()) { - this.logAttrValEmpty(name, blockNr); - numErrors++; - } - - final Map attr = mf.getAttributesForSection(name); - contentType = attr.get(TOSCAMetaFileAttributes.CONTENT_TYPE); - - if (contentType == null) { - this.logAttrMissing(TOSCAMetaFileAttributes.CONTENT_TYPE, blockNr); - numErrors++; - } else if (!contentType.trim().matches("^[-\\w\\+\\.]+/[-\\w\\+\\.]+$")) { - this.logAttrWrongVal(TOSCAMetaFileAttributes.CONTENT_TYPE, blockNr); - numErrors++; - } - - } - - return numErrors; - - } - - /** - * Logs that attribute attributeName in block blockNr is missing. - * - * @param attributeName - * @param blockNr - */ - private void logAttrMissing(final String attributeName, final int blockNr) { - TOSCAMetaFileParser.LOG.warn("Required attribute {} in block {} is missing.", attributeName, blockNr); - } - - /** - * Logs that attribute attributeName in block blockNr has an invalid - * value. Correct is correctValue. - * - * @param attributeName - * @param blockNr - * @param correctValue - */ - private void logAttrWrongVal(final String attributeName, final int blockNr, final String correctValue) { - TOSCAMetaFileParser.LOG.warn("Attribute {} in block {} has an invalid value. Must be {}.", attributeName, - blockNr, correctValue); - } - - /** - * Logs that attribute attributeName in block blockNr has an invalid - * value. - * - * @param attributeName - * @param blockNr - */ - private void logAttrWrongVal(final String attributeName, final int blockNr) { - TOSCAMetaFileParser.LOG.warn("Attribute {} in block {} has an invalid value.", attributeName, blockNr); - } - - /** - * Logs that attribute attributeName in block blockNr has an empty value. - * - * @param attributeName - * @param blockNr - */ - private void logAttrValEmpty(final String attributeName, final int blockNr) { - TOSCAMetaFileParser.LOG.warn("Attribute {} in block {} has a empty value.", attributeName, blockNr); - } - - /** - * Logs the ManifestProblem problem. - * - * @param problem - */ - private void logManifestProblem(final ManifestProblem problem) { - TOSCAMetaFileParser.LOG.warn(problem.toString()); - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/AbstractDeploymentInfo.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/AbstractDeploymentInfo.java deleted file mode 100644 index f7e785919..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/AbstractDeploymentInfo.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.opentosca.container.core.model.deployment; - -import javax.persistence.Column; -import javax.persistence.MappedSuperclass; - -import org.eclipse.persistence.annotations.Convert; -import org.eclipse.persistence.annotations.Converter; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.csar.id.CSARIDConverter; - -/** - * Abstract class for deployment information that belongs to a CSAR file. - */ -@MappedSuperclass -@Converter(name = "CSARIDConverter", converterClass = CSARIDConverter.class) -public abstract class AbstractDeploymentInfo { - - // TODO: Rename property to csarId - @Convert("CSARIDConverter") - @Column(name = "csarID") - private CSARID csarID; - - - protected AbstractDeploymentInfo() { - - } - - /** - * @param csarID that uniquely identifies a CSAR file - */ - public AbstractDeploymentInfo(final CSARID csarID) { - this.csarID = csarID; - } - - public CSARID getCsarID() { - return this.csarID; - } - - public void setCsarID(final CSARID csarID) { - this.csarID = csarID; - } - - // TODO: Remove this method - public CSARID getCSARID() { - return this.csarID; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/ia/IADeploymentInfo.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/ia/IADeploymentInfo.java deleted file mode 100644 index 6d0bc6f4e..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/ia/IADeploymentInfo.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.opentosca.container.core.model.deployment.ia; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; - -import org.eclipse.persistence.annotations.PrimaryKey; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.deployment.AbstractFileDeploymentInfo; - -/** - * Deployment information of a Implementation Artifact inside a CSAR file. It is used for tracking - * its deploy progress. - */ -@Entity -@Inheritance(strategy = InheritanceType.JOINED) -@NamedQueries({@NamedQuery(name = IADeploymentInfo.getIADeploymentInfoByCSARIDAndRelPath, - query = IADeploymentInfo.getIADeploymentInfoByCSARIDAndRelPathQuery), - @NamedQuery(name = IADeploymentInfo.getIADeploymentInfoByCSARID, - query = IADeploymentInfo.getIADeploymentInfoByCSARIDQuery)}) -@Table(name = IADeploymentInfo.tableName) -@PrimaryKey(columns = {@Column(name = "csarID"), @Column(name = "RelPath")}) -public class IADeploymentInfo extends AbstractFileDeploymentInfo { - - protected static final String tableName = "IADeploymentInfo"; - - /* - * JPQL Queries - */ - public static final String getIADeploymentInfoByCSARIDAndRelPath = "IADeploymentInfo.ByCSARIDAndRelPath"; - protected static final String getIADeploymentInfoByCSARIDAndRelPathQuery = - "select t from " + IADeploymentInfo.tableName + " t where t.relPath = :iaRelPath and t.csarID = :csarID"; - - public static final String getIADeploymentInfoByCSARID = "IADeploymentInfo.ByCSARID"; - protected static final String getIADeploymentInfoByCSARIDQuery = - "select t from " + IADeploymentInfo.tableName + " t where t.csarID = :csarID"; - - /** - * Deployment state of this IA. - */ - @Enumerated(EnumType.STRING) - @Column(name = "DeploymentState") - private IADeploymentState deploymentState; - - - protected IADeploymentInfo() { - - } - - public IADeploymentInfo(final CSARID csarID, final String relPath, final IADeploymentState deploymentState) { - super(csarID, relPath); - this.deploymentState = deploymentState; - } - - public IADeploymentState getDeploymentState() { - return this.deploymentState; - } - - public void setDeploymentState(final IADeploymentState deploymentState) { - this.deploymentState = deploymentState; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/plan/PlanDeploymentInfo.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/plan/PlanDeploymentInfo.java deleted file mode 100644 index 5e81dd7c0..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/deployment/plan/PlanDeploymentInfo.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.opentosca.container.core.model.deployment.plan; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; - -import org.eclipse.persistence.annotations.PrimaryKey; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.deployment.AbstractFileDeploymentInfo; - -/** - * Deployment information of a Plan inside a CSAR file. It is used for tracking its deploy progress. - */ -@Entity -@Inheritance(strategy = InheritanceType.JOINED) -@NamedQueries({@NamedQuery(name = PlanDeploymentInfo.getPlanDeploymentInfoByCSARIDAndRelPath, - query = PlanDeploymentInfo.getPlanDeploymentInfoByCSARIDAndRelPathQuery), - @NamedQuery(name = PlanDeploymentInfo.getPlanDeploymentInfoByCSARID, - query = PlanDeploymentInfo.getPlanDeploymentInfoByCSARIDQuery)}) -@Table(name = PlanDeploymentInfo.tableName) -@PrimaryKey(columns = {@Column(name = "csarID"), @Column(name = "RelPath")}) -public class PlanDeploymentInfo extends AbstractFileDeploymentInfo { - - protected final static String tableName = "PlanDeploymentInfo"; - - /* - * JPQL Queries - */ - public static final String getPlanDeploymentInfoByCSARIDAndRelPath = "PlanDeploymentInfo.ByCSARIDAndRelPath"; - protected static final String getPlanDeploymentInfoByCSARIDAndRelPathQuery = - "select t from " + PlanDeploymentInfo.tableName + " t where t.relPath = :planRelPath and t.csarID = :csarID"; - - public static final String getPlanDeploymentInfoByCSARID = "PlanDeploymentInfo.ByCSARID"; - protected static final String getPlanDeploymentInfoByCSARIDQuery = - "select t from " + PlanDeploymentInfo.tableName + " t where t.csarID = :csarID"; - - /** - * Deployment state of this Plan. - */ - @Enumerated(EnumType.STRING) - @Column(name = "DeploymentState") - private PlanDeploymentState deploymentState; - - - protected PlanDeploymentInfo() { - - } - - public PlanDeploymentInfo(final CSARID csarID, final String relPath, final PlanDeploymentState deploymentState) { - super(csarID, relPath); - this.deploymentState = deploymentState; - } - - public PlanDeploymentState getDeploymentState() { - return this.deploymentState; - } - - public void setDeploymentState(final PlanDeploymentState deploymentState) { - this.deploymentState = deploymentState; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/GenericEndpoint.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/GenericEndpoint.java deleted file mode 100644 index fa7c34eb7..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/GenericEndpoint.java +++ /dev/null @@ -1,163 +0,0 @@ -package org.opentosca.container.core.model.endpoint; - -import java.net.URI; -import java.util.Map; - -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.MappedSuperclass; - -import org.eclipse.persistence.annotations.Convert; -import org.eclipse.persistence.annotations.Converter; -import org.eclipse.persistence.annotations.Converters; -import org.opentosca.container.core.common.jpa.UriConverter; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.csar.id.CSARIDConverter; - -/** - * This abstract class is used as a super-class for WSDL and REST Endpoints. - */ -@MappedSuperclass -@Converters({@Converter(converterClass = CSARIDConverter.class, name = "CSARIDConverter"), - @Converter(converterClass = UriConverter.class, name = "URIConverter")}) -public abstract class GenericEndpoint { - - @Id - @GeneratedValue - protected Long id; - - /** - * The URI which can be used to access the endpoint that is represented by this class. - */ - @Basic - @Convert("URIConverter") - @Column(name = "uri", nullable = false) - private URI uri; - - /** - * The host name of the OpenTOSCA Container where the CSAR identified by - * {@link GenericEndpoint#csarId} is deployed. This attribute is needed to clearly identify - * CSARs and service instances for collaboration, because otherwise different OpenTOSCA - * Containers could use the same IDs for different instances. When no collaboration is used, - * this attribute is always the host name of the local Container. - */ - @Basic - @Column(name = "triggeringContainer", nullable = false) - private String triggeringContainer; - - /** - * The host name of the OpenTOSCA Container which manages this endpoint. If the endpoint is - * deployed by the local Container, the field equals the value of - * {@link org.opentosca.container.core.common.Settings#OPENTOSCA_CONTAINER_HOSTNAME}. If the - * endpoint was created by collaboration between different OpenTOSCA Container instances, the - * field identifies the Container that is responsible for access to and the undeployment of the - * endpoint. This might be necessary if the endpoint is protected by a firewall and can not be - * accessed directly by this Container. - */ - @Basic - @Column(name = "managingContainer", nullable = false) - private String managingContainer; - - /** - * Identifies the CSAR to which this endpoint belongs. The ID has to be set for all endpoints, - * except the Management Bus endpoint as this endpoint is CSAR independent. To avoid null values - * "***" is set for this endpoint. - */ - @Convert("CSARIDConverter") - @Column(name = "csarID", nullable = false) - private CSARID csarId; - - /** - * Identifies a service instance of the CSAR defined by {@link GenericEndpoint#csarId} where - * this endpoint belongs to. Some endpoints belong to a certain service instance of a CSAR (IA - * endpoints) whereas others only belong to a CSAR (Plan endpoints). Therefore, this field is - * set for IA endpoints and it is null for Plan endpoints. - */ - @Basic - @Column(name = "serviceTemplateInstanceID") - private Long serviceTemplateInstanceID; - - @Column(name = "metadata") - private Map metadata; - - /** - * Constructor - * - * @param uri - * @param managingContainer - * @param managingContainer - * @param csarId - * @param serviceTemplateInstanceID - */ - public GenericEndpoint(final URI uri, final String triggeringContainer, final String managingContainer, - final CSARID csarId, final Long serviceTemplateInstanceID, final Map metadata) { - setURI(uri); - setTriggeringContainer(triggeringContainer); - setManagingContainer(managingContainer); - setCSARId(csarId); - setServiceTemplateInstanceID(serviceTemplateInstanceID); - setMetadata(metadata); - } - - public Long getId() { - return this.id; - } - - public void setId(final Long id) { - this.id = id; - } - - public GenericEndpoint() { - super(); - } - - public URI getURI() { - return this.uri; - } - - public void setURI(final URI uri) { - this.uri = uri; - } - - public CSARID getCSARId() { - return this.csarId; - } - - public void setCSARId(final CSARID csarId) { - this.csarId = csarId; - } - - public Long getServiceTemplateInstanceID() { - return this.serviceTemplateInstanceID; - } - - public void setServiceTemplateInstanceID(final Long serviceTemplateInstanceID) { - this.serviceTemplateInstanceID = serviceTemplateInstanceID; - } - - public String getManagingContainer() { - return this.managingContainer; - } - - public void setManagingContainer(final String managingContainer) { - this.managingContainer = managingContainer; - } - - public String getTriggeringContainer() { - return this.triggeringContainer; - } - - public void setTriggeringContainer(final String triggeringContainer) { - this.triggeringContainer = triggeringContainer; - } - - public Map getMetadata(){ - return this.metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/RESTEndpoint.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/RESTEndpoint.java deleted file mode 100644 index 08b1aa583..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/rest/RESTEndpoint.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.opentosca.container.core.model.endpoint.rest; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.xml.namespace.QName; - -import org.eclipse.persistence.annotations.Convert; -import org.eclipse.persistence.annotations.Converter; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.GenericEndpoint; - -/** - * This class Represents a REST-Endpoint (an endpoint with a REST-Operation). For the fields of this - * class refer to the REST operation element in the TOSCA-Specification. - */ -// Named Queries for JPA -@NamedQueries({@NamedQuery(name = RESTEndpoint.getEndpointForPath, query = RESTEndpoint.getEndpointForPathQuery), - @NamedQuery(name = RESTEndpoint.getEndpointForPathAndMethod, - query = RESTEndpoint.getEndpointForPathAndMethodQuery), - @NamedQuery(name = RESTEndpoint.getEndpointForUri, query = RESTEndpoint.getEndpointForUriQuery)}) -@Entity -@Inheritance(strategy = InheritanceType.JOINED) -@Table(name = RESTEndpoint.tableName, uniqueConstraints = @UniqueConstraint(columnNames = {"path", "method", "csarId"})) -public class RESTEndpoint extends GenericEndpoint { - - protected static final String tableName = "RESTEndpoint"; - - // Named queries: - - // Query to retrieve RESTEndpoints by Path. - public static final String getEndpointForPath = "RESTEndpoint.getByPath"; - protected static final String getEndpointForPathQuery = - "select t from " + RESTEndpoint.tableName + " t where t.path = :path and t.csarId = :csarId"; - - // Query to retrieve a RESTEndpoint by Path and Method - public static final String getEndpointForPathAndMethod = "RESTEndpoint.getByPathAndMethod"; - protected static final String getEndpointForPathAndMethodQuery = "select t from " + RESTEndpoint.tableName - + " t where t.path = :path and t.method = :method and t.csarId = :csarId"; - - // Query to check if an Endpoint with given URI exists. - public static final String getEndpointForUri = "RESTEndpoint.getByUri"; - protected static final String getEndpointForUriQuery = - "select t from " + RESTEndpoint.tableName + " t where t.uri = :uri and t.csarId = :csarId"; - - - public static enum restMethod { - GET, PUT, POST, DELETE - }; - - - // Converter to Convert QNames to String, and back from String to QName. - // Used when persisting, so we can Query for QName-Objects. - @Basic - @Converter(name = "QNameConverter", converterClass = org.opentosca.container.core.common.jpa.QNameConverter.class) - @Column(name = "method") - private restMethod method; - - @Column(name = "path") - private String path; - - @Convert("QNameConverter") - private QName requestPayload; - - @Convert("QNameConverter") - private QName responsePayload; - - @Column(name = "RequestHeaders") - private final List headers = new ArrayList<>(); - - @Column(name = "Parameters") - private final List params = new ArrayList<>(); - - - public RESTEndpoint() { - super(); - } - - public RESTEndpoint(final URI uri, final restMethod method, final String triggeringContainer, - final String managingContainer, final CSARID csarId, final Long serviceInstanceID, Map metadata) { - super(uri, triggeringContainer, managingContainer, csarId, serviceInstanceID, metadata); - this.method = method; - this.path = uri.getPath(); - } - - public RESTEndpoint(final String host, final String path, final restMethod method, final String managingContainer, - final String triggeringContainer, final CSARID csarId, - final Long serviceInstanceID, Map metadata) throws URISyntaxException { - // Check if the path starts with a "/", if not we prepend a "/". - this(new URI(host + (path.charAt(0) == '/' ? path : '/' + path)), method, triggeringContainer, - managingContainer, csarId, serviceInstanceID, metadata); - } - - public RESTEndpoint(final URI uri, final restMethod method, final QName requestPayload, final QName responsePayload, - final String triggeringContainer, final String managingContainer, final CSARID csarId, - final Long serviceInstanceID, Map metadata) { - this(uri, method, triggeringContainer, managingContainer, csarId, serviceInstanceID, metadata); - this.requestPayload = requestPayload; - this.responsePayload = responsePayload; - } - - public QName getRequestPayload() { - return this.requestPayload; - } - - public QName getResponsePayload() { - return this.responsePayload; - } - - public restMethod getRequestMethod() { - return this.method; - } - - public String getPath() { - return this.path; - } - - public void setPath(final String path) { - this.path = path; - } - - public void addParameter(final Parameter p) { - this.params.add(p); - } - - public void addRequestHeader(final RequestHeader h) { - this.headers.add(h); - } - - public List getRequestHeaders() { - return this.headers; - } - - public List getParameters() { - return this.params; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/wsdl/WSDLEndpoint.java b/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/wsdl/WSDLEndpoint.java deleted file mode 100644 index efd12fb80..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/model/endpoint/wsdl/WSDLEndpoint.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.opentosca.container.core.model.endpoint.wsdl; - -import java.net.URI; -import java.util.Map; - -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.xml.namespace.QName; - -import org.eclipse.persistence.annotations.Convert; -import org.eclipse.persistence.annotations.Converter; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.GenericEndpoint; - -/** - * This class Represents a WSDL-Endpoint (an endpoint which points to a SOAP-Operation of a WSDL). - * For the fields of this class refer to the WSDL operation element in the TOSCA-Specification. - */ -@Entity -@Inheritance(strategy = InheritanceType.JOINED) -@Table(name = WSDLEndpoint.tableName, - uniqueConstraints = @UniqueConstraint(columnNames = {"portType", "csarId", "managingContainer", - "serviceInstanceID"})) -public class WSDLEndpoint extends GenericEndpoint { - - // Table Name - protected final static String tableName = "WSDLEndpoint"; - - // Converter to Convert QNames to String, and back from String to QName. - // Used when persisting, so we can Query for QName-Objects. - @Basic - @Converter(name = "QNameConverter", converterClass = org.opentosca.container.core.common.jpa.QNameConverter.class) - @Convert("QNameConverter") - @Column(name = "PortType") - private QName PortType; - - // NodeTypeImplementation/RelationshipTypeImplementation and IA name are there to identify - // specific IAs - @Basic - @Convert("QNameConverter") - @Column(name = "TypeImplementation") - private QName TypeImplementation; - - @Basic - @Column(name = "IaName") - private String IaName; - - // only the planid is used for plan endpoints, cause in tosca the id for a - // plan must be unique in the targetnamespace - @Basic - @Convert("QNameConverter") - @Column(name = "PlanId") - private QName PlanId; - - public WSDLEndpoint() { - super(); - } - - // if planid is set serviceInstanceID, nodeTypeimpl and iaName must be "null" - public WSDLEndpoint(final URI uri, final QName portType, final String triggeringContainer, - final String managingContainer, final CSARID csarId, final Long serviceInstanceID, - final QName planid, final QName nodeTypeImplementation, final String iaName, final Map metadata) { - super(uri, triggeringContainer, managingContainer, csarId, serviceInstanceID, metadata); - setPortType(portType); - setIaName(iaName); - setPlanId(planid); - setTypeImplementation(nodeTypeImplementation); - } - - public QName getPortType() { - return this.PortType; - } - - public void setPortType(final QName portType) { - this.PortType = portType; - } - - public QName getTypeImplementation() { - return this.TypeImplementation; - } - - public void setTypeImplementation(final QName nodeTypeImplementation) { - this.TypeImplementation = nodeTypeImplementation; - } - - public QName getPlanId() { - return this.PlanId; - } - - public void setPlanId(final QName planId) { - this.PlanId = planId; - } - - public String getIaName() { - return this.IaName; - } - - public void setIaName(final String iaName) { - this.IaName = iaName; - } - - @Override - public boolean equals(final Object o) { - if (!(o instanceof WSDLEndpoint)) { - return false; - } - - final WSDLEndpoint compareEndpoint = (WSDLEndpoint) o; - if (compareEndpoint.getId() != getId()) { - return false; - } - if (!compareEndpoint.getCSARId().equals(getCSARId())) { - return false; - } - return true; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/jpa/EntityManagerProvider.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/jpa/EntityManagerProvider.java deleted file mode 100644 index 3fbff8fc8..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/jpa/EntityManagerProvider.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.opentosca.container.core.next.jpa; - -import java.io.File; -import java.lang.reflect.Proxy; -import java.util.HashMap; -import java.util.Map; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.Persistence; - -import org.eclipse.persistence.config.PersistenceUnitProperties; -import org.opentosca.container.core.next.utils.Consts; - -public final class EntityManagerProvider { - - public static final String DATABASE_FILE = new File(Consts.DBDIR, "opentosca").getAbsolutePath(); - public static final String DATABASE_PROPERTIES = ";AUTO_SERVER=TRUE"; - public static final String JDBC_URL = "jdbc:h2:file:" + DATABASE_FILE + DATABASE_PROPERTIES; - - public static final String PERSISTENCE_UNIT = "default"; - - private static EntityManagerFactory emf = null; - - static { - final Map cfg = new HashMap<>(); - // We cannot reference Java's temp directory thru the persistence.xml unfortunately. - // Therefore, we set the "javax.persistence.jdbc.url" property via code. - cfg.put(PersistenceUnitProperties.JDBC_URL, JDBC_URL); - emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT, cfg); - } - - public static AutoCloseableEntityManager createEntityManager() { - return createEntityManager(emf.createEntityManager()); - } - - public static AutoCloseableEntityManager createEntityManager(final EntityManager em) { - return proxyOf(em); - } - - private static AutoCloseableEntityManager proxyOf(final EntityManager em) { - return (AutoCloseableEntityManager) Proxy.newProxyInstance(EntityManagerProvider.class.getClassLoader(), - new Class[] {AutoCloseableEntityManager.class}, - (proxy, method, args) -> { - return method.invoke(em, args); - }); - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/jpa/SoftDeleteCustomizer.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/jpa/SoftDeleteCustomizer.java deleted file mode 100644 index b88d521df..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/jpa/SoftDeleteCustomizer.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.opentosca.container.core.next.jpa; - -import java.util.Date; - -import org.eclipse.persistence.config.DescriptorCustomizer; -import org.eclipse.persistence.descriptors.ClassDescriptor; -import org.eclipse.persistence.internal.sessions.AbstractRecord; -import org.eclipse.persistence.internal.sessions.AbstractSession; -import org.eclipse.persistence.queries.DatabaseQuery; -import org.eclipse.persistence.queries.DeleteObjectQuery; -import org.eclipse.persistence.queries.QueryRedirector; -import org.eclipse.persistence.queries.UpdateObjectQuery; -import org.eclipse.persistence.sessions.Record; -import org.eclipse.persistence.sessions.Session; -import org.opentosca.container.core.next.model.PersistenceObject; - -public class SoftDeleteCustomizer implements DescriptorCustomizer { - - @Override - public void customize(final ClassDescriptor descriptor) throws Exception { - descriptor.setDefaultDeleteObjectQueryRedirector(new SoftDeleteRedirector()); - descriptor.getQueryManager().setAdditionalCriteria("this.deletedAt IS NULL"); - } - - private static class SoftDeleteRedirector implements QueryRedirector { - - private static final long serialVersionUID = -5508649536294092802L; - - @Override - public Object invokeQuery(final DatabaseQuery query, final Record arguments, final Session session) { - final ClassDescriptor descriptor = session.getDescriptor(query.getReferenceClass()); - final DeleteObjectQuery deleteObjectQuery = (DeleteObjectQuery) query; - final PersistenceObject entity = (PersistenceObject) deleteObjectQuery.getObject(); - entity.setDeletedAt(new Date()); - final UpdateObjectQuery updateObjectQuery = new UpdateObjectQuery(entity); - updateObjectQuery.setDescriptor(descriptor); - deleteObjectQuery.setDescriptor(updateObjectQuery.getDescriptor()); - return updateObjectQuery.execute((AbstractSession) session, (AbstractRecord) arguments); - } - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanType.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanType.java deleted file mode 100644 index 441f720e6..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/PlanType.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.opentosca.container.core.next.model; - -public enum PlanType { - - BUILD("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan"), TERMINATION("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/TerminationPlan"), MANAGEMENT("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/ManagementPlan"), TRANSFORMATION("http://opentosca.org/plantypes/TransformationPlan"); - - private String name; - - - PlanType(final String name) { - this.name = name; - } - - @Override - public String toString() { - return this.name; - } - - public static PlanType fromString(final String name) { - if (name != null) { - for (final PlanType o : PlanType.values()) { - if (name.equalsIgnoreCase(o.name)) { - return o; - } - } - } - throw new IllegalArgumentException("Parameter 'name' does not match an Enum type"); - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationsMonitor.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationsMonitor.java deleted file mode 100644 index 7a624fd3d..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/model/SituationsMonitor.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.opentosca.container.core.next.model; - -import java.util.Collection; -import java.util.Map; - -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.OneToOne; -import javax.persistence.Table; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - - -@Entity -@Table(name = SituationsMonitor.TABLE_NAME) -public class SituationsMonitor extends PersistenceObject { - - private static final long serialVersionUID = 6770816160173767058L; - - public static final String TABLE_NAME = "SITUATIONSMONITOR"; - - - @Column(name = "NODESITUATIONMAPPING") - private Map> node2situations = Maps.newHashMap(); - - @OneToOne - @JoinColumn(name = "SERVICE_TEMPLATE_INSTANCE_ID", nullable = true) - private ServiceTemplateInstance serviceInstance; - - public Map> getNode2Situations() { - return node2situations; - } - - public void setNode2Situations(Map> node2situations) { - this.node2situations = node2situations; - } - - public ServiceTemplateInstance getServiceInstance() { - return serviceInstance; - } - - public void setServiceInstance(ServiceTemplateInstance serviceInstance) { - this.serviceInstance = serviceInstance; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/DeploymentTestRepository.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/DeploymentTestRepository.java deleted file mode 100644 index 96472ff13..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/DeploymentTestRepository.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.opentosca.container.core.next.repository; - -import org.opentosca.container.core.next.model.DeploymentTest; - -public class DeploymentTestRepository extends JpaRepository { - - public DeploymentTestRepository() { - super(DeploymentTest.class); - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/NodeTemplateInstanceRepository.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/NodeTemplateInstanceRepository.java deleted file mode 100644 index 8114ef8e2..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/NodeTemplateInstanceRepository.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.opentosca.container.core.next.repository; - -import java.util.Collection; - -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.ParameterExpression; -import javax.persistence.criteria.Root; -import javax.xml.namespace.QName; - -import org.opentosca.container.core.next.jpa.AutoCloseableEntityManager; -import org.opentosca.container.core.next.jpa.EntityManagerProvider; -import org.opentosca.container.core.next.model.NodeTemplateInstance; - -public class NodeTemplateInstanceRepository extends JpaRepository { - - public NodeTemplateInstanceRepository() { - super(NodeTemplateInstance.class); - } - - public Collection findByTemplateId(final QName templateId) { - try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { - final CriteriaBuilder cb = em.getCriteriaBuilder(); - - final ParameterExpression templateIdParameter = cb.parameter(QName.class); - - final CriteriaQuery cq = cb.createQuery(NodeTemplateInstance.class); - final Root sti = cq.from(NodeTemplateInstance.class); - cq.select(sti).where(cb.equal(sti.get("templateId"), templateIdParameter)); - - final TypedQuery q = em.createQuery(cq); - q.setParameter(templateIdParameter, templateId); - - return q.getResultList(); - } - } - - public Collection findByTemplateType(final QName templateType) { - try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { - final CriteriaBuilder cb = em.getCriteriaBuilder(); - - final ParameterExpression templateTypeParameter = cb.parameter(QName.class); - - final CriteriaQuery cq = cb.createQuery(NodeTemplateInstance.class); - final Root sti = cq.from(NodeTemplateInstance.class); - cq.select(sti).where(cb.equal(sti.get("templateType"), templateTypeParameter)); - - final TypedQuery q = em.createQuery(cq); - q.setParameter(templateTypeParameter, templateType); - - return q.getResultList(); - } - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/ServiceTemplateInstanceRepository.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/ServiceTemplateInstanceRepository.java deleted file mode 100644 index 96fbb71d8..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/ServiceTemplateInstanceRepository.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.opentosca.container.core.next.repository; - -import java.util.Collection; - -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.ParameterExpression; -import javax.persistence.criteria.Root; -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.jpa.AutoCloseableEntityManager; -import org.opentosca.container.core.next.jpa.EntityManagerProvider; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; - -public class ServiceTemplateInstanceRepository extends JpaRepository { - - public ServiceTemplateInstanceRepository() { - super(ServiceTemplateInstance.class); - } - - public Collection findByTemplateId(final QName templateId) { - try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { - final CriteriaBuilder cb = em.getCriteriaBuilder(); - // Parameters - final ParameterExpression templateIdParameter = cb.parameter(QName.class); - // Build the Criteria Query - final CriteriaQuery cq = cb.createQuery(ServiceTemplateInstance.class); - final Root sti = cq.from(ServiceTemplateInstance.class); - cq.select(sti).where(cb.equal(sti.get("templateId"), templateIdParameter)); - // Create a TypedQuery - final TypedQuery q = em.createQuery(cq); - q.setParameter(templateIdParameter, templateId); - // Execute - return q.getResultList(); - } - } - - public Collection findByCsarId(final CSARID csarId) { - try (AutoCloseableEntityManager em = EntityManagerProvider.createEntityManager()) { - final CriteriaBuilder cb = em.getCriteriaBuilder(); - // Parameters - final ParameterExpression csarIdParameter = cb.parameter(CSARID.class); - // Build the Criteria Query - final CriteriaQuery cq = cb.createQuery(ServiceTemplateInstance.class); - final Root sti = cq.from(ServiceTemplateInstance.class); - cq.select(sti).where(cb.equal(sti.get("csarId"), csarIdParameter)); - // Create a TypedQuery - final TypedQuery q = em.createQuery(cq); - q.setParameter(csarIdParameter, csarId); - // Execute - return q.getResultList(); - } - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationRepository.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationRepository.java deleted file mode 100644 index fdcdca03f..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationRepository.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.opentosca.container.core.next.repository; - -import org.opentosca.container.core.next.model.Situation; - -public class SituationRepository extends JpaRepository { - - public SituationRepository() { - super(Situation.class); - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationTriggerInstanceRepository.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationTriggerInstanceRepository.java deleted file mode 100644 index d91390cec..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationTriggerInstanceRepository.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.opentosca.container.core.next.repository; - -import java.util.List; - -import org.opentosca.container.core.next.model.SituationTriggerInstance; - -import com.google.common.collect.Lists; - -public class SituationTriggerInstanceRepository extends JpaRepository { - - public SituationTriggerInstanceRepository() { - super(SituationTriggerInstance.class); - } - - public List findBySituationTriggerId(final Long situationTriggerId) { - final List result = Lists.newArrayList(); - - findAll().forEach(x -> { - if (x.getSituationTrigger().getId() == situationTriggerId) { - result.add(x); - } - }); - - return result; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationTriggerRepository.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationTriggerRepository.java deleted file mode 100644 index 1e7a129f2..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationTriggerRepository.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.opentosca.container.core.next.repository; - -import java.util.List; - -import org.opentosca.container.core.next.model.Situation; -import org.opentosca.container.core.next.model.SituationTrigger; - -import com.google.common.collect.Lists; - -public class SituationTriggerRepository extends JpaRepository { - - public SituationTriggerRepository() { - super(SituationTrigger.class); - } - - public List findSituationTriggersBySituationId(final Long situationId) { - final List result = Lists.newArrayList(); - - findAll().forEach(x -> { - for (final Situation situation : x.getSituations()) { - if (situation.getId() == situationId) { - result.add(x); - } - } - }); - - return result; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationsMonitorRepository.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationsMonitorRepository.java deleted file mode 100644 index 2673dff67..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/repository/SituationsMonitorRepository.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.opentosca.container.core.next.repository; - -import java.util.Collection;import java.util.stream.Collectors; - -import org.opentosca.container.core.next.model.SituationsMonitor; - -import com.google.common.collect.Lists; - -public class SituationsMonitorRepository extends JpaRepository { - - public SituationsMonitorRepository() { - super(SituationsMonitor.class); - } - - public Collection findSituationMonitorsBySituationId(Long situationId) { - Collection result = Lists.newArrayList(); - - for(SituationsMonitor moni : this.findAll()) { - for(Collection sits:moni.getNode2Situations().values()) { - if(sits.contains(situationId)) { - result.add(moni); - } - } - } - - return result; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/trigger/SituationListener.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/trigger/SituationListener.java deleted file mode 100644 index 09dc33b02..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/trigger/SituationListener.java +++ /dev/null @@ -1,198 +0,0 @@ -package org.opentosca.container.core.next.trigger; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import javax.persistence.PostLoad; -import javax.persistence.PostUpdate; -import javax.persistence.PreUpdate; - -import org.opentosca.container.core.next.model.Situation; -import org.opentosca.container.core.next.model.SituationTrigger; -import org.opentosca.container.core.next.model.SituationTriggerInstance; -import org.opentosca.container.core.next.model.SituationsMonitor; -import org.opentosca.container.core.next.repository.SituationRepository; -import org.opentosca.container.core.next.repository.SituationTriggerInstanceRepository; -import org.opentosca.container.core.next.repository.SituationTriggerRepository; -import org.opentosca.container.core.next.repository.SituationsMonitorRepository; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.event.Event; -import org.osgi.service.event.EventAdmin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - -/** - * @author kalmankepes - * - */ -public class SituationListener { - - final private static Logger LOG = LoggerFactory.getLogger(SituationListener.class); - - final SituationRepository sitRepo = new SituationRepository(); - - final SituationTriggerRepository sitTrigRepo = new SituationTriggerRepository(); - - final SituationTriggerInstanceRepository sitTrigInstRepo = new SituationTriggerInstanceRepository(); - - final SituationsMonitorRepository sitMonRepo = new SituationsMonitorRepository(); - - @PostUpdate - void situationAfterUpdate(final Situation situation) { - Collection monis = this.sitMonRepo.findSituationMonitorsBySituationId(situation.getId()); - - for (SituationsMonitor moni : monis) { - this.sendServiceInstanceAdaptationEvent(moni); - } - } - - @PreUpdate - void situationBeforeUpdate(final Situation situation) { - LOG.info("Updating situation with template " + situation.getSituationTemplateId() + " and thing " - + situation.getThingId() + " with active state " + situation.isActive()); - - final Situation sitInRepo = this.sitRepo.find(situation.getId()).get(); - - if (situation.isActive() == sitInRepo.isActive()) { - // nothing changed => do nothing - return; - } else { - - // handling triggers on situation changes - final List triggers = - this.sitTrigRepo.findSituationTriggersBySituationId(situation.getId()); - final List newInstances = Lists.newArrayList(); - - if (situation.isActive()) { - // fetch triggers that must be triggered on activation - triggers.forEach(x -> { - if (x.isTriggerOnActivation()) { - - - boolean allActive = true; - - for (Situation sit : x.getSituations()) { - if(!sit.equals(situation)) { - allActive &= sit.isActive(); - } - } - - if (allActive) { - - - if (!x.isSingleInstance()) { - // if this is not a single instance we can just kick of another trigger - final SituationTriggerInstance newInstance = new SituationTriggerInstance(); - newInstance.setSituationTrigger(x); - newInstance.setStarted(false); - newInstance.setFinished(false); - newInstances.add(newInstance); - } else { - // we have to check if there is already an instance of the trigger - - final List singleInstanceTriggerInstances = - this.sitTrigInstRepo.findBySituationTriggerId(x.getId()); - - int count = 0; - - for (final SituationTriggerInstance instance : singleInstanceTriggerInstances) { - if (instance.isFinished()) { - count++; - } - } - - if (count == singleInstanceTriggerInstances.size()) { - // create new instance - final SituationTriggerInstance newInstance = new SituationTriggerInstance(); - newInstance.setSituationTrigger(x); - newInstance.setStarted(false); - newInstance.setFinished(false); - newInstances.add(newInstance); - } - - } - } - - } - }); - - } else { - // fetch triggers that must kicked of on deactivation - triggers.forEach(x -> { - if (!x.isTriggerOnActivation()) { - - boolean allInactive = false; - - for (Situation sit : x.getSituations()) { - allInactive &= sit.isActive(); - } - - if (!allInactive) { - - - if (!x.isSingleInstance()) { - // if this is not a single instance we can just kick of another trigger - final SituationTriggerInstance newInstance = new SituationTriggerInstance(); - newInstance.setSituationTrigger(x); - newInstance.setStarted(false); - newInstance.setFinished(false); - newInstances.add(newInstance); - } else { - // we have to check if there is already an instance of the trigger - - final List singleInstanceTriggerInstances = - this.sitTrigInstRepo.findBySituationTriggerId(x.getId()); - - int count = 0; - - for (final SituationTriggerInstance instance : singleInstanceTriggerInstances) { - if (instance.isFinished()) { - count++; - } - } - - if (count == singleInstanceTriggerInstances.size()) { - // create new instance - final SituationTriggerInstance newInstance = new SituationTriggerInstance(); - newInstance.setSituationTrigger(x); - newInstance.setStarted(false); - newInstance.setFinished(false); - newInstances.add(newInstance); - } - - } - - } - } - }); - } - this.sitTrigInstRepo.add(newInstances); - } - } - - private void sendServiceInstanceAdaptationEvent(SituationsMonitor monitor) { - final Map eventProperties = Maps.newHashMap(); - eventProperties.put("SERVICEINSTANCE", monitor.getServiceInstance()); - // eventProperties.put("SITUATIONS", monitor.getSituations()); - eventProperties.put("NODE2SITUATIONS", monitor.getNode2Situations()); - - - Event situationAdaptationEvent = new Event("org_opentosca_situationadaptation/requests", eventProperties); - this.getEventAdminService().postEvent(situationAdaptationEvent); - } - - - - private EventAdmin getEventAdminService() { - BundleContext ctx = org.opentosca.container.core.Activator.getContext(); - ServiceReference ref = ctx.getServiceReference(EventAdmin.class.getName()); - EventAdmin eventAdmin = (EventAdmin) ctx.getService(ref); - return eventAdmin; - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/trigger/SituationTriggerInstanceListener.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/trigger/SituationTriggerInstanceListener.java deleted file mode 100644 index 50bc5d555..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/trigger/SituationTriggerInstanceListener.java +++ /dev/null @@ -1,308 +0,0 @@ -package org.opentosca.container.core.next.trigger; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.sql.Date; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -import javax.persistence.PostPersist; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.Duration; -import javax.xml.namespace.QName; - -import org.glassfish.jersey.uri.UriComponent; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.model.PlanInstanceEvent; -import org.opentosca.container.core.next.model.PlanInstanceState; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.model.Situation; -import org.opentosca.container.core.next.model.SituationTriggerInstance; -import org.opentosca.container.core.next.model.SituationTriggerInstanceProperty; -import org.opentosca.container.core.next.model.SituationTriggerProperty; -import org.opentosca.container.core.next.repository.PlanInstanceRepository; -import org.opentosca.container.core.next.repository.SituationTriggerInstanceRepository; -import org.opentosca.container.core.service.IPlanInvocationEngine; -import org.opentosca.container.core.tosca.extension.TParameterDTO; -import org.opentosca.container.core.tosca.extension.TPlanDTO; -import org.opentosca.container.core.tosca.model.TPlan; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Lists; - -public class SituationTriggerInstanceListener { - - private static final List obs = Lists.newArrayList(); - - private static Map> planToOperationMap = new HashMap<>(); - - @PostPersist - public void startSituationTriggerInstanceObserver(final SituationTriggerInstance instance) { - final SituationTriggerInstanceObserver obs = new SituationTriggerInstanceObserver(instance); - SituationTriggerInstanceListener.obs.add(obs); - new Thread(obs).start(); - } - - private class SituationTriggerInstanceObserver implements Runnable { - - final private Logger LOG = LoggerFactory.getLogger(SituationTriggerInstanceObserver.class); - - private final SituationTriggerInstanceRepository repo = new SituationTriggerInstanceRepository(); - - private final IPlanInvocationEngine planInvocEngine; - - private final IToscaEngineService toscaEngine; - - private final PlanInstanceRepository planRepository = new PlanInstanceRepository(); - - private final SituationTriggerInstance instance; - - - public SituationTriggerInstanceObserver(final SituationTriggerInstance instance) { - this.instance = instance; - final BundleContext ctx = org.opentosca.container.core.Activator.getContext(); - - ServiceReference ref = ctx.getServiceReference(IPlanInvocationEngine.class.getName()); - this.planInvocEngine = (IPlanInvocationEngine) ctx.getService(ref); - - ref = ctx.getServiceReference(IToscaEngineService.class.getName()); - this.toscaEngine = (IToscaEngineService) ctx.getService(ref); - } - - @Override - public void run() { - - this.instance.setStarted(true); - this.repo.update(this.instance); - - this.LOG.debug("Started SituationTriggerInstance " + this.instance.getId()); - - - final String interfaceName = this.instance.getSituationTrigger().getInterfaceName(); - final String operationName = this.instance.getSituationTrigger().getOperationName(); - final Set inputs = this.instance.getSituationTrigger().getInputs(); - - long timeAvailableInSeconds = Long.MAX_VALUE; - - for (Situation sit : this.instance.getSituationTrigger().getSituations()) { - long duration = Long.parseLong(sit.getEventTime()); - if(duration < timeAvailableInSeconds) { - timeAvailableInSeconds = duration; - } - } - - - final ServiceTemplateInstance servInstance = this.instance.getSituationTrigger().getServiceInstance(); - final NodeTemplateInstance nodeInstance = this.instance.getSituationTrigger().getNodeInstance(); - - if (nodeInstance == null) { - // plan invocation - - // get info about current plan - final QName planId = this.toscaEngine.getToscaReferenceMapper() - .getBoundaryPlanOfCSARInterface(this.instance.getSituationTrigger().getCsarId(), - interfaceName, operationName); - final TPlan plan = this.toscaEngine.getToscaReferenceMapper() - .getPlanForCSARIDAndPlanID(this.instance.getSituationTrigger().getCsarId(), planId); - - final TPlanDTO planDTO = new TPlanDTO(plan, planId.getNamespaceURI()); - - - - final long calculatedTimeFromPreviousExecutions = plan.getCalculatedWCET(); - - if (calculatedTimeFromPreviousExecutions > 0) { - // check if time is shorter than timeAvailable - if (calculatedTimeFromPreviousExecutions > timeAvailableInSeconds) { - this.LOG.info("Update (WCET = %d ms) not completable in timeframe of %d ms. Aborting.", - calculatedTimeFromPreviousExecutions, timeAvailableInSeconds); - return; - } else { - this.LOG.info("Update (WCET = %d ms) is completable in timeframe of %d ms. Executing.", - calculatedTimeFromPreviousExecutions, timeAvailableInSeconds); - } - } - - - this.LOG.debug("Time: " + calculatedTimeFromPreviousExecutions); - - - - for (final TParameterDTO param : planDTO.getInputParameters().getInputParameter()) { - if (servInstance != null && param.getName().equals("OpenTOSCAContainerAPIServiceInstanceURL")) { - String url = Settings.CONTAINER_INSTANCEDATA_API + "/" + servInstance.getId(); - url = url.replace("{csarid}", servInstance.getCsarId().getFileName()); - url = url.replace("{servicetemplateid}", - UriComponent.encode(servInstance.getTemplateId().toString(), - UriComponent.Type.PATH_SEGMENT)); - - final URI uri = URI.create(UriComponent.encode(url, UriComponent.Type.PATH)); - param.setValue(uri.toString()); - } - - if (param.getValue() == null) { - for (final SituationTriggerProperty val : inputs) { - if (param.getName().equals(val.getName())) { - param.setValue(val.getValue()); - } - } - } - } - - try { - - final String correlationId = this.planInvocEngine.createCorrelationId(); - if(servInstance != null) { - this.planInvocEngine.invokePlan(servInstance.getCsarId(), servInstance.getTemplateId(), - servInstance.getId(), planDTO, correlationId); - } else { - this.planInvocEngine.invokePlan(this.instance.getSituationTrigger().getCsarId(), this.toscaEngine.getServiceTemplatesInCSAR(this.instance.getSituationTrigger().getCsarId()).get(0), - -1, planDTO, correlationId); - } - - - // now wait for finished execution - PlanInstance planInstance = this.planRepository.findByCorrelationId(correlationId); - while (planInstance == null || !(planInstance.getState().equals(PlanInstanceState.FINISHED) - || planInstance.getState().equals(PlanInstanceState.FAILED))) { - Thread.sleep(10000); - planInstance = this.planRepository.findByCorrelationId(correlationId); - } - - // plan finished, write output to trigger instance - planInstance.getOutputs() - .forEach(x -> this.instance.getOutputs().add(new SituationTriggerInstanceProperty( - x.getName(), x.getValue(), x.getType()))); - - this.instance.setFinished(true); - this.repo.update(this.instance); - } - - catch (final UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - catch (final InterruptedException e) { - throw new RuntimeException(e); - } - } else { - // IA invocation - } - - } - - } - - private boolean isPlanExecutionFinished(final TPlanDTO plan, final String correlationId) { - - for (final TParameterDTO param : plan.getOutputParameters().getOutputParameter()) { - if (param.getName().equalsIgnoreCase("correlationid") && param.getValue() != null - && param.getValue().equals(correlationId)) { - return true; - } - } - - return false; - } - - public Map> getPlanToOperationMap() { - return SituationTriggerInstanceListener.planToOperationMap; - } - - public void setPlanToOperationMap(final Map> planToOperationMap) { - SituationTriggerInstanceListener.planToOperationMap = planToOperationMap; - } - - /** - * calculate the WCET for the given Plan by summing up operation times in plan. Does not regard - * parallel executions. - * - * @param plan - * @return - */ - public long calculateWCETForPlan(final TPlan plan) { - long calculatedTimeFromPreviousExecutions = 0; - - // contains mapping of PlanName to its contained operations - final Map> planNameToOperationsMap = getPlanToOperationMap(); - // map of longest execution times for each operation - final Map longestDurationMap = new HashMap<>(); - // find all operations contained in current plan - final List allOperationsInPlan = planNameToOperationsMap.get(plan.getId()); - - // get all previously completed PlanInstances from DB - final PlanInstanceRepository planRepo = new PlanInstanceRepository(); - final Collection allOccurences = planRepo.findAll(); - - // iterate all instances until match is found - if (allOperationsInPlan != null) { - for (final PlanInstance currInstance : allOccurences) { - if (currInstance.getTemplateId().getLocalPart().equals(plan.getId())) { - iterateInstanceEventsForExecutionTimes(longestDurationMap, allOperationsInPlan, currInstance); - } - } - } - // add up the times of longest durations found for operations in plan - for (final Long duration : longestDurationMap.values()) { - calculatedTimeFromPreviousExecutions += duration; - } - return calculatedTimeFromPreviousExecutions; - } - - /** - * iterate through all PlanInstanceEvents of a PlanInstance and compare with matching operation from - * current Plan - * - * @param longestDurationMap - * @param allOperationsInPlan - * @param currInstance - */ - private void iterateInstanceEventsForExecutionTimes(final Map longestDurationMap, - final List allOperationsInPlan, - final PlanInstance currInstance) { - // iterate all operations from current plan - for (final String oneOperationFromPlan : allOperationsInPlan) { - // iterate all events from current PlanInstance - for (final PlanInstanceEvent aEvent : currInstance.getEvents()) { - if (Objects.nonNull(aEvent.getOperationName()) && Objects.nonNull(aEvent.getExecutionDuration()) - && Objects.nonNull(aEvent.getNodeTemplateID())) { - if (oneOperationFromPlan.equals(aEvent.getNodeTemplateID() + aEvent.getOperationName())) { - checkIfCurrentOperationExecutionTimeIsLonger(longestDurationMap, aEvent); - } - } - } - } - } - - /** - * if operation already contained in map, check if current execution duration is larger (replace) or - * smaller (leave) - * - * @param longestDurationMap - * @param aEvent - */ - private void checkIfCurrentOperationExecutionTimeIsLonger(final Map longestDurationMap, - final PlanInstanceEvent aEvent) { - // key already exists in map - if (longestDurationMap.containsKey(aEvent.getNodeTemplateID() + aEvent.getOperationName())) { - if (longestDurationMap.get(aEvent.getNodeTemplateID() - + aEvent.getOperationName()) < aEvent.getExecutionDuration()) { - longestDurationMap.put(aEvent.getNodeTemplateID() + aEvent.getOperationName(), - aEvent.getExecutionDuration()); - } - } else { - longestDurationMap.put(aEvent.getNodeTemplateID() + aEvent.getOperationName(), - aEvent.getExecutionDuration()); - } - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Consts.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Consts.java deleted file mode 100644 index 7b8a10652..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Consts.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.opentosca.container.core.next.utils; - -import java.io.File; - -public abstract class Consts { - - public static final boolean PASSES = true; - public static final boolean FAILS = false; - - public static final boolean SUCCESS = true; - public static final boolean FAILURE = false; - - public static final boolean TRUE = true; - public static final boolean FALSE = false; - - public static final String EMPTY = ""; - public static final String SPACE = " "; - public static final String TAB = "\t"; - public static final String SINGLE_QUOTE = "'"; - public static final String PERIOD = "."; - public static final String DOUBLE_QUOTE = "\""; - - /** - * Useful for {@link String} operations, which return an index of -1 when an item is not - * found. - */ - public static final int NOT_FOUND = -1; - - /** - * System property - line.separator - */ - public static final String NL = System.getProperty("line.separator"); - - /** - * System property - file.separator - */ - public static final String FS = System.getProperty("file.separator"); - - /** - * System property - path.separator - */ - public static final String PS = System.getProperty("path.separator"); - - /** - * System property - java.io.tmpdir - */ - public static final String TMPDIR = System.getProperty("java.io.tmpdir"); - - /** - * OpenTOSCA Container base directory - */ - public static final File BASEDIR = new File(TMPDIR, "opentosca"); - - /** - * OpenTOSCA Container CSAR directory - */ - public static final File CSARDIR = new File(BASEDIR, "csars"); - - /** - * OpenTOSCA Container database location - */ - public static final File DBDIR = new File(BASEDIR, "db"); -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Types.java b/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Types.java deleted file mode 100644 index 7580059ca..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/next/utils/Types.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.opentosca.container.core.next.utils; - -public abstract class Types { - - /** - * Utility function to create a proper type definition using generics. - * - * Usage: Class> mapType = Types.generify(Map.class); - * - * @param clazz The type to generify - * @return The generified type - */ - @SuppressWarnings("unchecked") - public static Class generify(final Class clazz) { - return (Class) clazz; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreCapabilityService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreCapabilityService.java deleted file mode 100644 index b7aadfad7..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreCapabilityService.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.opentosca.container.core.service; - -import java.util.List; -import java.util.Map; - -import org.opentosca.container.core.model.capability.provider.ProviderType; - -/** - * This interface provides methods to store, get and delete capabilities of different provider and - * provider types.
    - *

    - * The IAEngine needs this capabilities to decide if a Implementation Artifact should be deployed or - * not. - * - * @see ProviderType - */ -public interface ICoreCapabilityService { - - /** - * Stores capabilities. - * - * @param capabilities to store. - * @param providerName Name of the provider (e.g. a plugin) where the capabilities are from. - * @param providerType identifies if the capabilities are from the Container, a PlanEnginePlugin or - * a IAEnginePlugin (see {@link ProviderType}). - */ - public void storeCapabilities(List capabilities, String providerName, ProviderType providerType); - - /** - * @param providerType identifies if the capabilities are from the Container, a PlanEnginePlugin or - * a IAEnginePlugin (see {@link ProviderType}). - * @return Map with all providers and their capabilities. - */ - public Map> getCapabilities(ProviderType providerType); - - /** - * @param providerName Name of the provider (e.g. a plugin) where the capabilities should be fetched - * from. - * @param providerType identifies if the capabilities are from the Container, a PlanEnginePlugin or - * a IAEnginePlugin (see {@link ProviderType}). - * @return List with all capabilities of given provider. - */ - public List getCapabilities(String providerName, ProviderType providerType); - - /** - * Deletes all stored capabilities of a provider. - * - * @param providerName Name of the provider (e.g. a plugin) where the capabilities should be deleted - * from. - */ - public void deleteCapabilities(String providerName); -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreCredentialsService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreCredentialsService.java deleted file mode 100644 index d1db3bdf6..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreCredentialsService.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.opentosca.container.core.service; - -import java.util.Set; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.credentials.Credentials; - -/** - * This interface of the Core Internal Credentials Service defines methods for storing, getting and - * deleting credentials, checking if credentials are set in a storage provider, setting credentials - * in a storage provider, getting the name of the credentials identity and key of a storage - * provider, and getting all available storage providers. - */ -public interface ICoreCredentialsService { - - /** - * Stores credentials {@code credentials}.
    - * Also injects the credentials in the appropriate storage provider if the following conditions are - * fulfilled:
    - * - Storage provider is available.
    - * - Storage provider has no injected credentials.
    - *
    - * Note: Credentials will be only stored if storage provider of credentials needs credentials. If - * storage provider is not available, we can't check if this requirement is fulfilled. - * - * @param credentials to store. - * - * @return Generated ID of stored credentials. - * @throws UserException if {@code credentials} contains missing required data, are already stored - * according to unique constraints defined in {@link Credentials} or storage provider of - * credentials needs no credentials. - */ - public long storeCredentials(Credentials credentials) throws UserException; - - /** - * @param credentialsID of credentials. - * @return {@link Credentials} with ID {@code credentialsID}. - * @throws UserException if credentials were not found. - */ - public Credentials getCredentials(long credentialsID) throws UserException; - - /** - * @return IDs of all stored credentials. - */ - public Set getCredentialsIDs(); - - /** - * @param storageProviderID of storage provider - * @return All stored {@link Credentials} for storage provider {@code storageProviderID}. - */ - public Set getAllCredentialsOfStorageProvider(String storageProviderID); - - /** - * @return All stored {@link Credentials}. - */ - public Set getAllCredentials(); - - /** - * Deletes credentials {@code credentialsID}.
    - * If necessary, also deletes these credentials in their storage provider. - * - * @param credentialsID of credentials. - * - * @throws UserException if credentials to delete were not found. - */ - public void deleteCredentials(long credentialsID) throws UserException; - - /** - * Deletes all stored credentials.
    - * Also deletes the credentials in their storage providers, if necessary. - */ - public void deleteAllCredentials(); - - /** - * Sets / injects stored credentials {@code credentialsID} in their storage provider. - * - * @param credentialsID of credentials. - * @throws SystemException if storage provider of credentials is not available. - * @throws UserException if credentials were not found or storage provider of credentials - * {@code credentialsID} needs no credentials. - */ - public void setCredentialsInStorageProvider(long credentialsID) throws UserException, SystemException; - - /** - * Deletes credentials in storage provider {@code storageProviderID}, if necessary. - * - * @param storageProviderID of storage provider. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public void deleteCredentialsInStorageProvider(String storageProviderID) throws SystemException; - - /** - * @param storageProviderID of storage provider - * @return {@code true} if storage provider {@code storageProviderID} has currently credentials, - * otherwise {@code false}. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public boolean hasStorageProviderCredentials(String storageProviderID) throws SystemException; - - /** - * @param credentialsID of credentials. - * @return {@code true} if storage provider of credentials {@code credentialsID} has these - * credentials, otherwise {@code false}.
    - * Also {@code false} will be returned if storage provider of credentials - * {@code credentialsID} is not available. - * - * @UserException if credentials {@code credentialsID} were not found. - */ - public boolean hasStorageProviderCredentials(long credentialsID) throws UserException; - - /** - * @param storageProviderID of storage provider - * @return {@code true} if storage provider {@code storageProviderID} needs credentials, otherwise - * {@code false}. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public boolean needsStorageProviderCredentials(String storageProviderID) throws SystemException; - - /** - * @param storageProviderID of storage provider - * @return Name of the credentials identity of storage provider {@code storageProviderID}, e.g. for - * AWS S3 it's the Access Key ID. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public String getCredentialsIdentityName(String storageProviderID) throws SystemException; - - /** - * @param storageProviderID of storage provider - * @return Name of the credentials key of storage provider {@code storageProviderID}, e.g. for AWS - * S3 it's the Secret Access Key. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public String getCredentialsKeyName(String storageProviderID) throws SystemException; - - /** - * @return IDs of available storage providers.
    - * A storage provider is defined as available if it's bundle is installed and is in bundle - * state {@code ACTIVE}. - */ - public Set getStorageProviders(); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreDeploymentTrackerService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreDeploymentTrackerService.java deleted file mode 100644 index 9438b8241..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreDeploymentTrackerService.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.opentosca.container.core.service; - -import java.util.List; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.deployment.ia.IADeploymentInfo; -import org.opentosca.container.core.model.deployment.ia.IADeploymentState; -import org.opentosca.container.core.model.deployment.plan.PlanDeploymentInfo; -import org.opentosca.container.core.model.deployment.plan.PlanDeploymentState; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; - -/** - * Interface that provides methods for storing and getting the deployment states of CSAR files, IAs - * and Plans. - */ -public interface ICoreDeploymentTrackerService { - - /** - * Stores the deployment state of a CSAR file. - * - * @param csarID that uniquely identifies a CSAR file - * @param deploymentState to store - * @return true if storing was successful, otherwise false - */ - public boolean storeDeploymentState(CSARID csarID, DeploymentProcessState deploymentState); - - /** - * @param csarID that uniquely identifies a CSAR file - * @return the deployment state of the CSAR file; if CSAR file doesn't exist null - */ - public DeploymentProcessState getDeploymentState(CSARID csarID); - - /** - * Stores deployment information for a Implementation Artifact. Already stored deployment - * information will be overwritten! - * - * @param iaDeploymentInfo to store (contains CSARID, relative file path where the IA is located - * inside the CSAR file and deployment state of IA) - * @return true if storing was successful, otherwise false - */ - public boolean storeIADeploymentInfo(IADeploymentInfo iaDeploymentInfo); - - /** - * Stores deployment information for a Implementation Artifact. Already stored deployment - * information will be overwritten! - * - * @param csarID that uniquely identifies a CSAR file - * @param iaRelPath- relative file path where the Implementation Artifact is located inside the CSAR - * file - * @param iaDeploymentState - deployment state of the Implementation Artifact - * @return true if storing was successful, otherwise false - */ - public boolean storeIADeploymentInfo(CSARID csarID, String iaRelPath, IADeploymentState iaDeploymentState); - - /** - * @param csarID that uniquely identifies a CSAR file - * @param iaRelPath - relative file path where the Implementation Artifact is located inside the - * CSAR file - * @return if Implementation Artifact exists, its deployment information; otherwise - * null - */ - public IADeploymentInfo getIADeploymentInfo(CSARID csarID, String iaRelPath); - - /** - * @param csarID that uniquely identifies a CSAR file - * @return the deployment informations for all Implementation Artifacts of the CSAR file. - */ - public List getIADeploymentInfos(CSARID csarID); - - /** - * Stores the deployment information for a Plan. Already stored deployment information will be - * overwritten! - * - * @param planDeploymentInfo to store (contains CSARID, relative file path where the Plan is located - * inside the CSAR file and deployment state of Plan) - * @return true if storing was successful, otherwise false - */ - public boolean storePlanDeploymentInfo(PlanDeploymentInfo planDeploymentInfo); - - /** - * Stores deployment information for a Plan. Already stored deployment information will be - * overwritten! - * - * @param csarID that uniquely identifies a CSAR file - * @param planRelPath - relative file path where the Plan is located inside the CSAR file - * @param planDeploymentState - deployment state of the Plan - * @return true if storing was successful, otherwise false - */ - public boolean storePlanDeploymentInfo(CSARID csarID, String planRelPath, PlanDeploymentState planDeploymentState); - - /** - * @param csarID that uniquely identifies a CSAR file - * @param planRelPath - relative file path where the Plan is located inside the CSAR file - * @return if Plan exists, its deployment information; otherwise null - */ - public PlanDeploymentInfo getPlanDeploymentInfo(CSARID csarID, String planRelPath); - - /** - * @param csarID that uniquely identifies a CSAR file - * @return the deployment informations for all Plans of the CSAR file - */ - public List getPlanDeploymentInfos(CSARID csarID); - - /** - * Deletes all deployment information for the given CSAR id - * - * @param csarID the CSAR id whose deployment state should be deleted - */ - public void deleteDeploymentState(CSARID csarId); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreEndpointService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreEndpointService.java deleted file mode 100644 index 93467ecb3..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreEndpointService.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.opentosca.container.core.service; - -import java.net.URI; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.service.internal.ICoreInternalEndpointService; - -/** - * This interface provides methods to retrieve and store endpoints. It is meant to be used by the - * Engines. - */ -public interface ICoreEndpointService { - - /** - * @see ICoreInternalEndpointService#getWSDLEndpoints - */ - public List getWSDLEndpoints(QName portType, String triggeringContainer, CSARID csarId); - - /** - * @see ICoreInternalEndpointService#storeWSDLEndpoint - */ - public void storeWSDLEndpoint(WSDLEndpoint endpoint); - - /** - * @see ICoreInternalEndpointService#getRestEndpoints - */ - public List getRestEndpoints(URI anyURI, String triggeringContainer, CSARID csarId); - - /** - * @see ICoreInternalEndpointService#getWSDLEndpointForPlanId - */ - public WSDLEndpoint getWSDLEndpointForPlanId(String triggeringContainer, CSARID csarId, QName planId); - - /** - * @see ICoreInternalEndpointService#getWSDLEndpointsForCSARID - */ - public List getWSDLEndpointsForCSARID(String triggeringContainer, CSARID csarId); - - /** - * @see ICoreInternalEndpointService#getWSDLEndpointsForSTID() - */ - public List getWSDLEndpointsForSTID(String triggeringContainer, Long serviceTemplateInstanceID); - - /** - * @see ICoreInternalEndpointService#getWSDLEndpointsForNTImplAndIAName - */ - public List getWSDLEndpointsForNTImplAndIAName(String triggeringContainer, String managingContainer, - QName nodeTypeImpl, String iaName); - - /** - * @see ICoreInternalEndpointService#getWSDLEndpoints - */ - public List getWSDLEndpoints(); - - /** - * @see ICoreInternalEndpointService#storeRESTEndpoint - */ - public void storeRESTEndpoint(RESTEndpoint endpoint); - - /** - * @see ICoreInternalEndpointService#removePlanEndpoints - */ - public void removePlanEndpoints(String triggeringContainer, CSARID csarId); - - /** - * Removes the given WSDL Endpoint if found - * - * @param endpoint the WSDL Endpoint to remove - * @return true if removing the endpoint was successful, else false - */ - public boolean removeWSDLEndpoint(WSDLEndpoint endpoint); - - /** - * Debug print of plan endpoints. - */ - public void printPlanEndpoints(); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreFileService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreFileService.java deleted file mode 100644 index 63f837d6c..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreFileService.java +++ /dev/null @@ -1,264 +0,0 @@ -package org.opentosca.container.core.service; - -import java.nio.file.Path; -import java.util.Set; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.internal.ICoreInternalFileService; - -/** - * This interface of the Core File Service defines methods for
    - *
    - * - storing, getting, moving and deleting CSAR files.
    - * - moving files or directories contained in CSAR files.
    - * - getting available and ready storage providers.
    - * - getting and setting the active storage provider.
    - * - getting the default storage provider.
    - *
    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @see CSARContent - * - * @author Rene Trefft - rene.trefft@developers.opentosca.org - * - */ -public interface ICoreFileService { - - /** - * - * @return IDs of available storage providers which have no unsatisfied requirements (ready) and - * therefore can be used.
    - * - * @see #isReadyStorageProvider() - */ - public Set getReadyStorageProviders(); - - /** - * @param storageProviderID of storage provider to check if it's ready. - * @return {@code true} if storage provider {@code storageProviderID} is available and has no - * unsatisfied requirements, so it can be used. Otherwise {@code false} will be - * returned.
    - * Usually a requirement of a storage provider are the credentials (exception: file system - * storage provider) which must be set in the storage provider. - */ - public boolean isReadyStorageProvider(String storageProviderID); - - /** - * @return IDs of available storage providers.
    - * A storage provider is defined as available if it's bundle is installed and is in bundle - * state {@code ACTIVE}. - */ - public Set getStorageProviders(); - - /** - * @return ID of active storage provider that will used for storing a CSAR and as target for moving - * a CSAR or a file / directory contained in a CSAR. - */ - public String getActiveStorageProvider(); - - /** - * @return Friendly name of the storage provider {@code storageProviderID}. If - * {@code storageProviderID} is not available {@code null}. - */ - public String getStorageProviderName(String storageProviderID); - - /** - * Sets storage provider {@code storageProviderID} as the active storage provider that will used for - * storing a CSAR and as target for moving a CSAR or file / directory contained in a CSAR.
    - *
    - * Notes:
    - * 1) After the start of the Container no active storage provider is set.
    - * 2) If the active storage provider goes unavailable, this setting will be cleared (no active - * storage provider is set).
    - * 3) By passing {@code null} you can manually set no active storage provider. - * - * - * @param storageProviderID of the storage provider to set as the active one. - * @throws UserException if storage provider {@code storageProviderID} is not available. - */ - public void setActiveStorageProvider(String storageProviderID) throws UserException; - - /** - * @return ID of the default storage provider. It will be used for storing a CSAR and as the target - * for moving a CSAR or a file / directory of a CSAR if no active storage storage provider - * is set or it's not ready. If the default storage provider is also not available and ready - * the operation fails.
    - * The default storage provider is hard-coded and can't be changed. - */ - public String getDefaultStorageProvider(); - - /** - * Stores the CSAR file {@code csarFile}.
    - * First, it will be checked if the given file has correct extension and is not already stored. Then - * the CSAR will be unpacked (path is specified in Settings bundle), its content validated and the - * TOSCA meta file parsed. Finally all files of the CSAR will be stored on the active storage - * provider. After storing on storage provider the meta data of the CSAR (file and directory paths, - * TOSCA meta file content and CSAR ID) will be stored in the database and the unpack directory - * deleted.
    - *
    - * Note 1: If no active storage provider is set (e.g. directly after the start of the container) or - * it's not ready, the default storage provider will be used instead, if it's available and - * ready.
    - * Note 2: Only files of a CSAR will be stored on the storage provider. Directories will be stored - * as meta data only.
    - * Note 3: If an error occurred during storing the unpack directory will be also deleted (if - * necessary). - * - * @param csarFile to store. - * @return CSAR ID thats uniquely identifies the CSAR file. - * - * @throws SystemException if active storage provider is not set / can't be used and default storage - * provider also can't be used, unpacking CSAR failed, access to an directory denied while - * getting files and directories in unpack directory or if an error occurred during storing - * on the storage provider. - * - * @throws UserException if {@code csarFile} is not a existent file, has wrong file extension, is - * already stored or it's content is invalid, e.g. contains no TOSCA file or has an invalid - * TOSCA meta file. - * - * @see org.opentosca.settings.Settings - * - * - */ - public CSARID storeCSAR(Path csarFile) throws UserException, SystemException; - - /** - * Retrieves meta data of CSAR {@code csarID}. - * - * @param csarID of CSAR - * @return {@link CSARContent} that gives access to all files and directories and the TOSCA meta - * file of the CSAR. - * @throws UserException if CSAR {@code csarID} was not found. - */ - public CSARContent getCSAR(CSARID csarID) throws UserException; - - /** - * Exports a stored CSAR {@code csarID}.
    - * First, it retrieves the meta data of the CSAR and checks if the required storage provider(s) are - * available and ready to minimize the risk of a cancel during retrieving files. Then it creates the - * directory structure and retrieves all files of the CSAR from the appropriate storage provider(s) - * to a sub directory of a Temp directory. Finally the content of this directory will be compressed - * as a CSAR file. The created CSAR file is located directly in the Temp directory.
    - *
    - * - * Note: At the end or if an error occurred the directory that contains the content of the CSAR file - * will be deleted (if necessary). - * - * @param csarID of CSAR - * @return CSAR {@code csarID} as {@link Path} object. - * @throws UserException if CSAR {@code csarID} was not found. - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during retrieving files of CSAR. - */ - public Path exportCSAR(CSARID csarID) throws UserException, SystemException; - - /** - * @return CSAR IDs of all stored CSAR files. - */ - public Set getCSARIDs(); - - /** - * Moves a CSAR {@code csarID} from it's storage provider(s) to the active storage provider (target - * storage provider).
    - *
    - * First, the files meta data of CSAR {@code csarID} will be retrieved to check if the CSAR is - * stored and to get the storage provider(s) of the files of the CSAR. Then all files will be - * determined that must be moved to the target storage provider. If no files were found (completely - * stored on target storage provider), the move process is completed. Otherwise the files will be - * moved successively to the target storage provider.
    - * If an error occurred while moving files, the process will be canceled respectively further files - * will not be moved anymore.
    - *
    - * Note: If no active storage provider is set (e.g. directly after the start of the container) or - * it's not ready, the default storage provider will be used instead, if it's available and ready. - * - * @param csarID of CSAR. - * @see CoreInternalFileServiceImpl#findFilesToMove - * @see CoreInternalFileServiceImpl#moveFilesToStorageProvider - * - * @throws UserException if CSAR {@code csarID} was not found. - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during moving files. - * - */ - public void moveCSAR(CSARID csarID) throws UserException, SystemException; - - /** - * Moves the file / directory {@code fileOrDirRelToCSARRoot} of CSAR {@code csarID} from it's - * storage provider(s) to the active storage provider.
    - *
    - * First, the files and directories meta data of CSAR {@code csarID} will be retrieved to check if - * the CSAR is stored, given {@code fileOrDirRelToCSARRoot} is a existent file or directory and to - * get the storage provider of the file respectively the storage providers of all files in the - * directory to move. If file / directory exists, all files will be determined that must be moved to - * the target storage provider. If no files were found (completely stored on target storage - * provider), the move process is completed. Otherwise the files will be moved successively to the - * target storage provider.
    - * If an error occurred while moving files, the process will be canceled respectively further files - * will not be moved anymore.
    - *
    - * Note 1: If no active storage provider is set (e.g. directly after the start of the container) or - * it's not ready, the default storage provider will be used instead, if it's available and - * ready.
    - * Note 2: Moving a directory means that all files in the directory will be moved. Directories are - * only stored as meta data. - * - * @param csarID of CSAR - * @param fileOrDirRelToCSARRoot - path relative to CSAR root of a file or directory in CSAR - * {@code csarID}. - * - * @see CoreInternalFileServiceImpl#findFilesToMove - * @see CoreInternalFileServiceImpl#moveFileToStorageProvider - * @see CoreInternalFileServiceImpl#moveFilesToStorageProvider - * - * @throws UserException if CSAR {@code csarID} was not found or {@code fileOrDirRelToCSARRoot} does - * not exist in CSAR {@code csarID}. - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during moving files. - * - */ - public void moveFileOrDirectoryOfCSAR(CSARID csarID, Path fileOrDirRelToCSARRoot) throws UserException, - SystemException; - - /** - * Deletes the CSAR {@code csarID}.
    - *
    - * First, the files meta data of CSAR {@code csarID} will be retrieved to check if the CSAR exists - * and to get the storage provider(s) of the files. Then it will be checked if each storage provider - * is available and ready to minimize the risk for a cancel of the deletion process. Finally all - * files of the CSAR will be deleted on the storage provider(s). After deletion the meta data of the - * CSAR will be deleted, too.
    - * If an error occurred while deleting files, the complete process will be canceled respectively - * further files will not be deleted anymore. The meta data of the CSAR is not deleted, so deletion - * can be executed again to delete the remaining files. - * - * @param csarID of CSAR - * @see StorageProviderManager#deleteFilesOfCSAR - * - * @throws UserException if CSAR {@code csarID} was not found. - * - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during deleting files. - * - */ - public void deleteCSAR(CSARID csarID) throws SystemException, UserException; - - /** - * Deletes all CSAR files.
    - *
    - * The CSAR IDs of all stored CSAR will be retrieved and then each CSAR deleted by using - * {@link ICoreInternalFileService#deleteCSAR(CSARID)}.
    - * If an error occurred while deleting a CSAR, the complete process will be canceled respectively - * further CSARs will not be deleted anymore.
    - * - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during deleting files of CSARs. - * - */ - public void deleteCSARs() throws SystemException; - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreModelRepositoryService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreModelRepositoryService.java deleted file mode 100644 index 0949d2be7..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/ICoreModelRepositoryService.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.opentosca.container.core.service; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TDefinitions; - -/** - * This interface provides methods to retrieve and store Tosca-XML files. It is meant to be used by - * the Engines. - */ -public interface ICoreModelRepositoryService { - - // /** - // * Stores a TOSCA file / Definitions. - // * - // * @param toscaFile to store - // * @return If storing was successful the Definitions ID of the TOSCA file, - // * otherwise null. - // */ - // public QName storeTOSCA(File toscaFile); - - /** - * - * @return IDs of all Definitions of CSAR csarID. - */ - public List getAllDefinitionsIDs(CSARID csarID); - - /** - * @param definitionsID - * @return Definitions with ID definitionsID of CSAR csarID. If it - * doesn't exist null. - */ - public TDefinitions getDefinitions(CSARID csarID, QName definitionsID); - - // /** - // * - // * @param csarID - // * @param definitionsID - // * @return IDs of all service templates contained in Definitions with ID - // * definitionsID and CSAR csarID. - // */ - // public List getServiceTemplateIDs(CSARID csarID, QName - // definitionsID); - - // /** - // * Deletes all stored Definitions / TOSCAs. - // * - // * @return Number of deleted Definitions. - // */ - // public int deleteAllDefinitions(); - // - // /** - // * Deletes a Definitions / TOSCA. - // * - // * @param definitionsID of Definitions to delete - // * @return true if deletion was successful, otherwise - // * false. - // */ - // public boolean deleteDefinitions(QName definitionsID); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/IFileAccessService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/IFileAccessService.java deleted file mode 100644 index 3e6e0eac8..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/IFileAccessService.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.opentosca.container.core.service; - -import java.io.File; -import java.util.List; - -/** - * Interface that provides methods to access files stored in this File Access Service. - */ -// TODO: Why do we need this class? Seems like a test class... -public interface IFileAccessService { - - /** - * @return file object of the build plan of SuperAppNotebook - */ - public File getNotebookAppBuildPlan(); - - /** - * @return file object of the TOSCA schema v.1.0-cs02 - */ - public File getOpenToscaSchemaFile(); - - /** - * @return file object of the XLink annotated Deployment Artifact schema - */ - public File getDeploymentArtifactXMLSchemaFile(); - - /** - * @return file object of the TOSCA test A XML - */ - public File getToscaTestXMLFileA(); - - /** - * @return file object of the TOSCA test B XML - */ - public File getToscaTestXMLFileB(); - - /** - * @return file object of the TOSCA test merge XML - */ - public File getToscaTestXMLFileMergeURI(); - - /** - * @return file object of the test WAR Implementation Artifact - */ - public File getTestWarImplementationArtifact(); - - /** - * @return IA WAR-File AWSDeployer - */ - public File getAWSDeployer(); - - /** - * @return IA WAR-File DBCreator - */ - public File getDBCreator(); - - /** - * @return file object of the test AAR Implementation Artifact - */ - public File getTestAarImplementationArtifact(); - - /** - * @return file object of the test WSDL - */ - public File getTestWSDLFile(); - - /** - * @return file object of the resolver test main TOSCA - */ - public File getResolverTest_MainTOSCA(); - - /** - * @return file object of the resolver test import TOSCA - */ - public File getResolverTest_ImportTOSCA(); - - /** - * @return file object of the resolver test import WSDL - */ - public File getResolverTest_ImportWSDL(); - - /** - * @return file object of the resolver test THOR - */ - public File getResolverThorFile(); - - /** - * @return file object of the XML schema data types schema - */ - public File getXMLSchemaDatatypesSchema(); - - /** - * @return file object of the Super Application main TOSCA - */ - public File getTHORSuperApplicationToscaFile(); - - /** - * @return File object of the SugarCRM3 CSAR file. - */ - public File getCSARSugarCRM3(); - - /** - * @return File object of a CSAR file with invalid file extension. - */ - public File getCSARWithInvalidFileExtension(); - - /** - * @return File object of the SuperApplicationNotebook CSAR file. - */ - public File getCSARSuperApplicationNotebook(); - - /** - * @return File object of the Moodle CSAR file. - */ - public File getCSARMoodle(); - - /** - * @return File object of a invalid TOSCA meta file (meta file version is not "1.0"). - */ - public File getTOSCAMetaFileInvalid1(); - - /** - * @return File object of a invalid TOSCA meta file (CSAR version is empty, Created by is missing). - */ - public File getTOSCAMetaFileInvalid2(); - - /** - * @return File object of a invalid TOSCA meta file (Created by is empty). - */ - public File getTOSCAMetaFileInvalid3(); - - /** - * @return File object of a invalid TOSCA meta file (Description is defined, but is missing). - */ - public File getTOSCAMetaFileInvalid4(); - - /** - * @return File object of a invalid TOSCA meta file (Topology is defined, but is empty). - */ - public File getTOSCAMetaFileInvalid5(); - - /** - * @return File object of a invalid TOSCA meta file (Entry Definitions is defined, but is empty). - */ - public File getTOSCAMetaFileInvalid6(); - - /** - * @return File object of a invalid TOSCA meta file (Content-Type in file block is invalid). - */ - public File getTOSCAMetaFileInvalid7(); - - /** - * @return File object of a invalid TOSCA meta file (Content-Type in file block is missing). - */ - public File getTOSCAMetaFileInvalid8(); - - /** - * @return File object of a valid TOSCA meta file. - */ - public File getTOSCAMetaFileValid1(); - - /** - * @return File object of a valid TOSCA meta file (Topology is not defined). - */ - public File getTOSCAMetaFileValid2(); - - /** - * @return File object of a valid TOSCA meta file (with additional attribute in block 0 and 2 file - * blocks). - */ - public File getTOSCAMetaFileValid3(); - - /** - * @return Test CSAR for Core File Service test cases - */ - public File getTestCSAR(); - - /** - * @return Test CSAR for Core File Service test cases (contains no Definitions). - */ - public File getTestCSAR2(); - - /** - * @return Test file for storage provider test cases - */ - public File getStorageProviderTestFile1(); - - /** - * @return Empty test file for storage provider test cases - */ - public File getStorageProviderTestFile2(); - - /** - * ---------------------------------------------------------------- - */ - - /** - * @return a created Temp directory for storing files temporarily - */ - public File getTemp(); - - /** - * Unpacks zipFile to a created Temp directory. - * - * @param zipFile to unpack - * @return the created Temp directory containing the unpacked files - */ - public File unpackToTemp(File zipFile); - - /** - * Creates a new ZIP archive containing the contents of supplied directory.
    - * Existing archives with the same name will be overwritten. - * - * @param directory - absolute path to the directory that content (including sub directories) should - * be zipped - * @param archive - absolute path to the ZIP archive that should be created - */ - public File zip(File directory, File archive); - - /** - * Unpacks the ZIP archive archive to target. - * - * @param archive - absolute path to the ZIP archive - * @param target - directory where the content of the archive should be unpacked - * @return a list of files that were unpacked - */ - public List unzip(File archive, File target); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/IHTTPService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/IHTTPService.java deleted file mode 100644 index eba6490a9..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/IHTTPService.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.opentosca.container.core.service; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.cookie.Cookie; - -/** - * This interface defines the standard HTTP commands as methods, plus some specific methods mainly - * created for the AAR plug-in of the IAEngine, that are provided by the HTTPService. - * - * @see org.opentosca.iaengine.plugins.aaraxis.service.impl - */ -public interface IHTTPService { - - public HttpResponse Get(String uri, List cookies) throws ClientProtocolException, IOException; - - /** - * Executes a HTTP GET command. - * - * @param uri - Resource URI - * @return Response Message - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Get(String uri) throws ClientProtocolException, IOException; - - /** - * Executes a HTTP GET command. - * - * @param uri - Resource URI - * @param headers - map of headers and values - * @return Response Message - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Get(String uri, Map headers) throws ClientProtocolException, IOException; - - - /** - * Executes a HTTP GET command. - * - * @param uri - * @param username - * @param password - * @return - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Get(String uri, String username, String password) throws ClientProtocolException, IOException; - - /** - * Executes a HTTP HEAD command. - * - * @param uri - Resource URI - * @return Response Message - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Head(String uri) throws ClientProtocolException, IOException; - - /** - * Executes a HTTP POST command. - * - * @param uri - Resource URI - * @param httpEntity - Payload - * @return Response Message - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Post(String uri, HttpEntity httpEntity) throws ClientProtocolException, IOException; - - public HttpResponse Post(String uri, HttpEntity httpEntity, Header... header) throws ClientProtocolException, - IOException; - - public HttpResponse Post(String uri, HttpEntity httpEntity, List cookies) throws ClientProtocolException, - IOException; - - public List PostCookies(String uri, HttpEntity httpEntity) throws ClientProtocolException, IOException; - - /** - * Executes a HTTP PUT command. - * - * @param uri - Resource URI - * @param httpEntity - Payload - * @return Response Message - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Put(String uri, HttpEntity httpEntity) throws ClientProtocolException, IOException; - - /** - * @param uri - * @param httpEntity - * @param username - * @param password - * @return - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Put(String uri, HttpEntity httpEntity, String username, - String password) throws ClientProtocolException, IOException; - - /** - * Executes a HTTP DELETE command. - * - * @param uri - Resource URI - * @return Response Message - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Delete(String uri) throws ClientProtocolException, IOException; - - /** - * Executes a HTTP TRACE command. - * - * @param uri - Resource URI - * @return Response Message - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Trace(String uri) throws ClientProtocolException, IOException; - - /** - * Executes a HTTP OPTIONS command. - * - * @param uri - Resource URI - * @return Response Message - * @throws ClientProtocolException - * @throws IOException - */ - public HttpResponse Options(String uri) throws ClientProtocolException, IOException; - - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/IInstanceDataService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/IInstanceDataService.java deleted file mode 100644 index 4af5abc51..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/IInstanceDataService.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.opentosca.container.core.service; - -import java.net.URI; -import java.util.HashMap; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.common.ReferenceNotFoundException; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.instance.NodeInstance; -import org.opentosca.container.core.model.instance.RelationInstance; -import org.opentosca.container.core.model.instance.ServiceInstance; -import org.w3c.dom.Document; - -/** - * Interface of the InstanceDataService. The interface specifies methods to manage instances of - * ServiceTemplates (=ServiceInstances) and NodeTemplates (NodeInstances) and properties of - * NodeInstances. - */ -public interface IInstanceDataService { - - // TODO: remove deprecated methods! - - /** - * Sets a property. - * - * @param key of the property to identify it. - * @param value of the property. - * - * - * - */ - @Deprecated - public void setProperty(String key, String value); - - /** - * Returns a property. - * - * @param key that identifies a property. - * - * @return a property as String. - * - */ - @Deprecated - public String getProperty(String key); - - /** - * Returns a HashMap of properties. - * - * @param key that identifies the properties. - * - * @return properties in a HashMap. - * - */ - @Deprecated - public HashMap getProperties(String key); - - /** - * Creates a ServiceInstance of the specified serviceTemplate (specified by the given - * ID and TemplateNamespace) - * - * @param serviceTemplateNamespace - * @param ServiceTemplateID - * @return the new generated ServiceInstance - */ - public ServiceInstance createServiceInstance(CSARID csarID, - QName serviceTemplateID) throws ReferenceNotFoundException; - - /** - * Deletes the serviceInstance represnted by the given serviceInstanceID - * - * @param serviceInstanceID - of the instance which will be deleted - */ - public void deleteServiceInstance(URI serviceInstanceID); - - /** - * Queries for all ServiceInstances identified by the given parameters. It then returns a List of - * the matching serviceInstances. - * - * @see serviceInstance - * @TODO: additional parameters in JDOC - * @param serviceInstanceID : ID to identify the serviceInstance - * @return List containing all corresponding ServiceInstances - */ - public List getServiceInstances(URI serviceInstanceID, String serviceTemplateName, - QName serviceTemplateID); - - /** - * Create a NodeInstanceof the specified nodeTemplate of the given serviceInstanceID - * - * @param nodeTemplateID - * @param serviceInstanceID - * @return the new generated NodeInstance - */ - public NodeInstance createNodeInstance(CSARID csarId, QName serviceTemplateId, int serviceInstanceID, - QName nodeTemplateID) throws ReferenceNotFoundException; - - /** - * Create a RelationInstanceof the specified Relationship Template of the given - * serviceInstanceID - * - * @param csarId the Id of the CSAR the Relationship Template should belong to - * @param serviceTemplateId the Service Template ID the Relationship Template should belong to - * @param serviceTemplateInstanceID the Instance ID of the Service Template - * @param relationshipTemplateID the ID of the Relationship Template - * @param sourceInstanceId the id of the node instance which is the source of this relationship - * instance - * @param targetInstanceId the id of the node instance which is the target of this relationship - * instance - * @return a new RelationInstance Object - * @throws ReferenceNotFoundException - */ - public RelationInstance createRelationInstance(CSARID csarId, QName serviceTemplateId, - int serviceTemplateInstanceID, QName relationshipTemplateID, - String sourceInstanceId, - String targetInstanceId) throws ReferenceNotFoundException; - - /** - * Deletes the specified NodeInstance - * - * @param nodeInstanceID - */ - public void deleteNodeInstance(URI nodeInstanceID); - - /** - * Deletes the specified RelationInstance - * - * @param relationInstanceID the RelationInstance Id as URI - */ - public void deleteRelationInstance(URI relationInstanceID); - - /** - * returns all NodeInstances matching the given parameters the parameters are ANDed therefore a - * nodeInstance has to match all parameters to be returned - * - * @param nodeInstanceID - * @param nodeTemplateID - * @param nodeTemplateName - * @param serviceInstanceID - * @return all matching nodeInstances - */ - public List getNodeInstances(URI nodeInstanceID, QName nodeTemplateID, String nodeTemplateName, - URI serviceInstanceID); - - /** - * returns all RelationInstances matching the given parameters the parameters are ANDed therefore a - * relationInstance has to match all parameters to be returned - * - * @param relationInstanceID the relationInstanceId - * @param relationshipTemplateID - * @param relationshipTemplateName - * @param serviceInstanceID - * @return all matching nodeInstances - */ - public List getRelationInstances(URI relationInstanceID, QName relationshipTemplateID, - String relationshipTemplateName, URI serviceInstanceID); - - /** - * returns the state of the NodeInstance specified by nodeInstanceID - * - * @param nodeInstanceID - * @return State - * @throws ReferenceNotFoundException if nodeInstanceID doesn't exist - */ - public QName getNodeInstanceState(URI nodeInstanceID) throws ReferenceNotFoundException; - - /** - * Sets the state of the specified nodeInstanceID - * - * @param nodeInstanceID - * @param state - * @throws ReferenceNotFoundException if nodeInstanceID doesn't exist - */ - public void setNodeInstanceState(URI nodeInstanceID, String state) throws ReferenceNotFoundException; - - /** - * returns a DOM structure containing all properties specified in the propertiesList - *

      - *
    • if propertiesList is empty all properties are returned
    • - *
    • if propertiesList is null no properties are returned
    • - *
    - * - * @param serviceInstanceID - * @param propertiesList - * @return DOM - * @throws ReferenceNotFoundException - */ - public Document getServiceInstanceProperties(URI serviceInstanceID, - List propertiesList) throws ReferenceNotFoundException; - - /** - * returns a DOM structure containing all properties specified in the propertiesList - *
      - *
    • if propertiesList is empty all properties are returned
    • - *
    • if propertiesList is null no properties are returned
    • - *
    - * - * @param nodeInstanceID - * @param propertiesList - * @return DOM - * @throws ReferenceNotFoundException - */ - public Document getNodeInstanceProperties(URI nodeInstanceID, - List propertiesList) throws ReferenceNotFoundException; - - public void setNodeInstanceProperties(URI nodeInstanceID, Document properties) throws ReferenceNotFoundException; - - public void setServiceInstanceProperties(URI serviceInstanceID, - Document properties) throws ReferenceNotFoundException; - - public NodeInstance createNodeInstance(QName nodeTemplateIDQName, - URI serviceInstanceIdURI) throws ReferenceNotFoundException; - - public List getServiceInstancesWithDetails(CSARID csarId, QName serviceTemplateId, - Integer serviceTemplateInstanceID); - - public QName getRelationInstanceState(URI relationInstanceID) throws ReferenceNotFoundException; - - public void setRelationInstanceState(URI relationInstanceID, String state) throws ReferenceNotFoundException; - - public void setRelationInstanceProperties(URI relationInstanceID, - Document properties) throws ReferenceNotFoundException; - - public Document getRelationInstanceProperties(URI relationInstanceID, - List propertiesList) throws ReferenceNotFoundException; - - public String getServiceInstanceState(URI serviceInstanceID) throws ReferenceNotFoundException; - - public void setServiceInstanceState(URI serviceInstanceIDtoURI, String state) throws ReferenceNotFoundException; - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/IPlanInvocationEngine.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/IPlanInvocationEngine.java deleted file mode 100644 index fc2db3bc4..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/IPlanInvocationEngine.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.opentosca.container.core.service; - -import java.io.UnsupportedEncodingException; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.extension.TPlanDTO; - -/** - * Interface of the PlanInvocationEngine. This service provides a the functionality of invoking - * PublicPlans, getting a list of CorrelationIDs of active PublicPlans and one specific PublicPlan. - */ -public interface IPlanInvocationEngine { - - - public String createCorrelationId(); - - /** - * Invoke a PublicPlan for a CSAR. If this PublicPlan is of Type OTHERMANAGEMENT or TERMINATION, the - * information about the CSARInstance is stored inside the PublicPlan. - * - * @param csarID - * @param instance ID of a CSAR instance - * @param publicPlan - * @return boolean about success - * @throws UnsupportedEncodingException - */ - public void invokePlan(CSARID csarID, QName serviceTemplateId, long serviceTemplateInstanceID, TPlanDTO plan, - String correlationID) throws UnsupportedEncodingException; -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/IPlanLogHandler.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/IPlanLogHandler.java deleted file mode 100644 index dd4815192..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/IPlanLogHandler.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.opentosca.container.core.service; - -import java.util.Map; - -@Deprecated -public interface IPlanLogHandler { - - void log(String corrId, String logMsg); - - Map getLogsOfPlanInstance(String corrId); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/PathUtils.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/PathUtils.java deleted file mode 100644 index df095a815..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/PathUtils.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.opentosca.container.core.service; - -import java.io.File; - -public class PathUtils { - - public final static char UNIX_SEPARATOR = '/'; - - - /** - * Converts every occurrence of the system-dependent file separator in {@code path} to the Unix file - * separator '/'.
    - * This is necessary for jclouds. Paths on a jclouds provider / api must have Unix file separators. - * - * @param path whose file separators should be converted to the Unix file separator. - * @return Path with Unix file separators. - */ - public static String separatorsToUnix(String path) { - if (File.separatorChar != PathUtils.UNIX_SEPARATOR) { - path = path.replace(File.separatorChar, PathUtils.UNIX_SEPARATOR); - } - return path; - } -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/AbstractJCloudsFileStorageProvider.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/AbstractJCloudsFileStorageProvider.java deleted file mode 100644 index 9ed914192..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/AbstractJCloudsFileStorageProvider.java +++ /dev/null @@ -1,640 +0,0 @@ -package org.opentosca.container.core.service.internal; - -import java.io.BufferedOutputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collections; -import java.util.Properties; - -import org.jclouds.ContextBuilder; -import org.jclouds.apis.ApiMetadata; -import org.jclouds.blobstore.BlobStore; -import org.jclouds.blobstore.BlobStoreContext; -import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.domain.BlobBuilder; -import org.jclouds.blobstore.domain.BlobMetadata; -import org.jclouds.domain.Location; -import org.jclouds.logging.slf4j.config.SLF4JLoggingModule; -import org.jclouds.osgi.ApiListener; -import org.jclouds.osgi.MetadataBundleListener; -import org.jclouds.osgi.ProviderListener; -import org.jclouds.providers.ProviderMetadata; -import org.jclouds.rest.AuthorizationException; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.model.credentials.Credentials; -import org.opentosca.container.core.service.PathUtils; -import org.osgi.framework.FrameworkUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.ImmutableSet; -import com.google.inject.Module; - -/** - * Abstract storage provider implementation for all jclouds providers / APIs (blobstores). A storage - * provider realized with this implementation is ready, if it has credentials (requirement only - * applies if method {@link #needsCredentials()} returns {@code true}) and the appropriate jclouds - * Provider / API bundle is available (bundle state {@code ACTIVE}). - * - * A CSAR file will be stored as follows on the blobstore: - * {@code //} The container is a namespace for the - * files, on Amazon S3 it's called bucket. By default, the container name is - * {@code org.opentosca.csars}. Setting a new bucket name or getting the current one is possible - * with appropriate methods. - * - * If a storage provider will be implemented that is supported by jclouds it should be realized by - * extending from this class. - */ -public abstract class AbstractJCloudsFileStorageProvider implements ICoreInternalFileStorageProviderService, - ProviderListener, ApiListener { - - private final static Logger LOG = LoggerFactory.getLogger(AbstractJCloudsFileStorageProvider.class); - - private Long credentialsID = null; - - /** - * Identity as part of the credentials of a jclouds storage provider. By default no identity is set. - */ - private String credentialsIdentity = null; - - /** - * Key as part of the credentials of a jclouds storage provider. By default no key is set. - */ - private String credentialsKey = null; - - /** - * Name of the container of a jclouds storage provider. It's predefined, but can be changed using - * {@link #setContainerName(String)}. - */ - private String containerName = "org.opentosca.csars"; - - /** - * jclouds {@code BlobStoreContext} and {@code BlobStore}. These variables are global, as we do not - * want to create them each time a method is called. - */ - private BlobStoreContext blobStoreContext; - private BlobStore blobStore; - - /** - * {@code true} when storage provider is currently initialized. - */ - private boolean isInitialized = false; - - /** - * {@code true} when required jclouds BlobStore API / Provider bundle is currently available. - */ - private boolean isJCloudsBundleAvailable = false; - - /** - * jclouds module to use SLF4J facade for logging. - */ - Module slf4jLoggingModule = new SLF4JLoggingModule(); - - /** - * jclouds modules that should be loaded beside the default modules during initialization of the - * storage provider. - */ - ImmutableSet modules = - new ImmutableSet.Builder().add(this.slf4jLoggingModule).addAll(this.getJCloudsModules()).build(); - - - /** - * Constructor.
    - * Adds this class as a jclouds Provider and API listener. We need these listeners, because we want - * to know when the necessary jclouds Provider / API bundle is available. - */ - public AbstractJCloudsFileStorageProvider() { - final MetadataBundleListener jcloudsBundleListener = new MetadataBundleListener(); - jcloudsBundleListener.addProviderListener(this); - jcloudsBundleListener.addApiListenerListener(this); - // Manually stopping bundle listener is not necessary, because it will - // be automatically stopped when bundle is stopped. - jcloudsBundleListener.start(FrameworkUtil.getBundle(this.getClass()).getBundleContext()); - } - - /** - * Initializes this storage provider, if necessary.
    - * Builds the {@link BlobStoreContext} and {@link BlobStore} and finally creates the container on - * the storage provider, if necessary. - * - * @throws SystemException if storage provider is not ready, credentials are invalid or an other - * jclouds error occurred. - */ - private void initialize() throws SystemException { - - if (!this.isInitialized) { - - if (this.isStorageProviderReady()) { - - AbstractJCloudsFileStorageProvider.LOG.debug("Initialize storage provider \"{}\"...", - this.getStorageProviderID()); - - try { - final ContextBuilder contextBuilder = ContextBuilder.newBuilder(this.getStorageProviderID()); - if (this.needsCredentials()) { - contextBuilder.credentials(this.credentialsIdentity, this.credentialsKey); - } - contextBuilder.modules(this.modules); - contextBuilder.overrides(this.overwriteJCloudsProperties()); - this.blobStoreContext = contextBuilder.build(BlobStoreContext.class); - - this.blobStore = this.blobStoreContext.getBlobStore(); - AbstractJCloudsFileStorageProvider.LOG.debug("Creating container \"{}\" on storage provider \"{}\"...", - this.getContainerName(), this.getStorageProviderID()); - final boolean isContainerCreated = - this.blobStore.createContainerInLocation(this.getContainerLocation(), this.getContainerName()); - - if (isContainerCreated) { - AbstractJCloudsFileStorageProvider.LOG.debug("Container \"{}\" was created on storage provider \"{}\".", - this.getContainerName(), - this.getStorageProviderID()); - } else { - AbstractJCloudsFileStorageProvider.LOG.debug("Container \"{}\" already exists on storage provider \"{}\" and was created with the provided credentials.", - this.getContainerName(), - this.getStorageProviderID()); - } - - this.isInitialized = true; - AbstractJCloudsFileStorageProvider.LOG.debug("Initialization of storage provider \"{}\" completed.", - this.getStorageProviderID()); - - } - catch (final AuthorizationException exc) { - this.close(); - throw new SystemException( - "Credentials of storage provider \"" + this.getStorageProviderID() + "\" are invalid.", exc); - } - catch (final Exception exc) { - this.close(); - throw new SystemException("A jclouds error occured.", exc); - } - - } else { - - throw new SystemException("Can't initialize storage provider \"" + this.getStorageProviderID() - + "\", because it's not ready!"); - - } - - } else { - AbstractJCloudsFileStorageProvider.LOG.debug("Storage provider \"{}\" is already initialized.", - this.getStorageProviderID()); - } - - } - - @Override - public final void storeFile(final Path absFilePath, final String relFilePathOnProvider) throws SystemException { - - this.initialize(); - - AbstractJCloudsFileStorageProvider.LOG.debug("Storing file \"{}\" as \"{}\" on storage provider \"{}\"...", - absFilePath, relFilePathOnProvider, this.getStorageProviderID()); - - if (Files.isRegularFile(absFilePath)) { - - try { - - BlobBuilder blobBuilder = this.blobStore.blobBuilder(PathUtils.separatorsToUnix(relFilePathOnProvider)); - blobBuilder = blobBuilder.payload(absFilePath.toFile()); - final Blob blob = blobBuilder.build(); - this.blobStore.putBlob(this.getContainerName(), blob); - - AbstractJCloudsFileStorageProvider.LOG.debug("Storing file \"{}\" as \"{}\" on storage provider \"{}\" completed.", - absFilePath, relFilePathOnProvider, - this.getStorageProviderID()); - - } - catch (final Exception exc) { - - throw new SystemException("A jclouds error occured.", exc); - - } - - } else { - - throw new SystemException("\"{}\" is not an absolute path to an existing file."); - - } - - } - - @Override - public final void storeFile(final InputStream fileInputStream, final long fileSize, - final String relFilePathOnProvider) throws SystemException { - - AbstractJCloudsFileStorageProvider.LOG.debug("Storing input stream as file \"{}\" on storage provider \"{}\"...", - relFilePathOnProvider, this.getStorageProviderID()); - - this.initialize(); - - try { - - final BlobBuilder blobBuilder = - this.blobStore.blobBuilder(PathUtils.separatorsToUnix(relFilePathOnProvider)); - // setting content length is necessary if payload is given by an - // input stream - blobBuilder.payload(fileInputStream).contentLength(fileSize); - - final Blob blob = blobBuilder.build(); - - this.blobStore.putBlob(this.getContainerName(), blob); - - AbstractJCloudsFileStorageProvider.LOG.debug("Storing input stream as file \"{}\" on storage provider \"{}\" completed.", - relFilePathOnProvider, this.getStorageProviderID()); - - } - catch (final Exception exc) { - throw new SystemException("A jclouds error occured.", exc); - } - - } - - /** - * Uninitializes this storage provider by closing the {@link BlobStoreContext}.
    - */ - private void close() { - - AbstractJCloudsFileStorageProvider.LOG.debug("Closing storage provider \"{}\"...", this.getStorageProviderID()); - - if (this.blobStoreContext != null) { - this.blobStoreContext.close(); - } - - this.isInitialized = false; - - AbstractJCloudsFileStorageProvider.LOG.debug("Closing storage provider \"{}\" completed.", - this.getStorageProviderID()); - - } - - @Override - public final void deleteCredentials() { - - if (this.isInitialized) { - AbstractJCloudsFileStorageProvider.LOG.debug("Storage provider \"{}\" is initialized. For deleting credentials it will be closed now."); - this.close(); - } - - AbstractJCloudsFileStorageProvider.LOG.debug("Deleting credentials in storage provider \"{}\"...", - this.getStorageProviderID()); - this.credentialsID = null; - this.credentialsIdentity = null; - this.credentialsKey = null; - AbstractJCloudsFileStorageProvider.LOG.debug("Deleting credentials in storage provider \"{}\" completed.", - this.getStorageProviderID()); - - } - - @Override - public final void deleteFile(final String relFilePathOnProvider) throws SystemException { - - AbstractJCloudsFileStorageProvider.LOG.debug("Deleting file \"{}\" on storage provider \"{}\"...", - relFilePathOnProvider, this.getStorageProviderID()); - - this.initialize(); - - try { - - this.blobStore.removeBlob(this.getContainerName(), PathUtils.separatorsToUnix(relFilePathOnProvider)); - AbstractJCloudsFileStorageProvider.LOG.debug("Deleting file \"{}\" on storage provider \"{}\" completed.", - relFilePathOnProvider, this.getStorageProviderID()); - - } - catch (final Exception exc) { - - throw new SystemException("A jclouds error occured.", exc); - - } - - } - - @Override - public final InputStream getFileAsInputStream(final String relFilePathOnProvider) throws SystemException { - - AbstractJCloudsFileStorageProvider.LOG.debug("Getting input stream of file \"{}\" on storage provider \"{}\" ...", - relFilePathOnProvider, this.getStorageProviderID()); - - this.initialize(); - - try { - - final Blob blob = - this.blobStore.getBlob(this.getContainerName(), PathUtils.separatorsToUnix(relFilePathOnProvider)); - - if (blob == null) { - throw new SystemException("File \"" + relFilePathOnProvider + "\" was not found on storage provider \"" - + this.getStorageProviderID() + "\"."); - } - - final InputStream blobInputStream = blob.getPayload().getInput(); - - AbstractJCloudsFileStorageProvider.LOG.debug("Getting input stream of \"{}\" on storage provider \"{}\" completed.", - relFilePathOnProvider, this.getStorageProviderID()); - - return blobInputStream; - - } - catch (final Exception exc) { - - throw new SystemException("A jclouds error occured.", exc); - - } - - } - - @Override - public final void getFile(final String relFilePathOnProvider, final Path targetAbsFilePath) throws SystemException { - - AbstractJCloudsFileStorageProvider.LOG.debug("Retrieving file \"{}\" on storage provider \"{}\" ...", - relFilePathOnProvider, this.getStorageProviderID()); - - this.initialize(); - - AbstractJCloudsFileStorageProvider.LOG.debug("Location of file after it's fetched: {}", targetAbsFilePath); - - OutputStream fileOutputStream = null; - BufferedOutputStream bufferedOutputStream = null; - - try { - - fileOutputStream = Files.newOutputStream(targetAbsFilePath); - bufferedOutputStream = new BufferedOutputStream(fileOutputStream); - - try { - - final Blob blob = - this.blobStore.getBlob(this.getContainerName(), PathUtils.separatorsToUnix(relFilePathOnProvider)); - - if (blob == null) { - throw new SystemException("File \"" + relFilePathOnProvider - + "\" was not found on storage provider \"" + this.getStorageProviderID() + "\"."); - } - - blob.getPayload().writeTo(bufferedOutputStream); - - } - catch (final Exception exc) { - throw new SystemException("A jclouds error occured.", exc); - } - - AbstractJCloudsFileStorageProvider.LOG.debug("Retrieving file \"{}\" on storage provider \"{}\" completed.", - relFilePathOnProvider, this.getStorageProviderID()); - - } - catch (final FileNotFoundException exc) { - - throw new SystemException("Can't create file \"" + targetAbsFilePath.toString() + "\".", exc); - - } - catch (final IOException exc) { - - throw new SystemException("An IO Exception occured.", exc); - - } - finally { - - if (bufferedOutputStream != null) { - try { - bufferedOutputStream.close(); - } - catch (final IOException exc) { - AbstractJCloudsFileStorageProvider.LOG.warn("An IO Exception occured.", exc); - } - } - - if (fileOutputStream != null) { - try { - fileOutputStream.close(); - } - catch (final IOException exc) { - AbstractJCloudsFileStorageProvider.LOG.warn("An IO Exception occured.", exc); - } - } - - } - - } - - @Override - public final long getFileSize(final String relFilePathOnProvider) throws SystemException { - - AbstractJCloudsFileStorageProvider.LOG.debug("Getting size of file \"{}\" on storage provider \"{}\" ...", - relFilePathOnProvider, this.getStorageProviderID()); - - this.initialize(); - - long contentLength; - - try { - - final BlobMetadata blobMetadata = - this.blobStore.blobMetadata(this.getContainerName(), PathUtils.separatorsToUnix(relFilePathOnProvider)); - - if (blobMetadata == null) { - throw new SystemException("File \"" + relFilePathOnProvider + "\" was not found on storage provider \"" - + this.getStorageProviderID() + "\"."); - } - - contentLength = blobMetadata.getContentMetadata().getContentLength(); - - } - catch (final Exception exc) { - throw new SystemException("A jclouds error occured.", exc); - } - - AbstractJCloudsFileStorageProvider.LOG.debug("Size of file \"{}\" on storage provider \"{}\": {} bytes", - relFilePathOnProvider, this.getStorageProviderID(), contentLength); - - return contentLength; - } - - /** - * @return {@inheritDoc}
    - * Note: The ID must be equal to the ID of the used jclouds Provider / API, otherwise the - * initialization of the storage provider fails. - */ - @Override - public abstract String getStorageProviderID(); - - /** - * @return {@code true} when required jclouds Provider / API bundle is available (bundle state - * {@code ACTIVE}), otherwise {@code false}. - */ - private boolean isJCloudsBundleAvailable() { - if (this.isJCloudsBundleAvailable) { - AbstractJCloudsFileStorageProvider.LOG.debug("jclouds bundle for storage provider \"{}\" is available.", - this.getStorageProviderID()); - } else { - AbstractJCloudsFileStorageProvider.LOG.warn("jclouds bundle for storage provider \"{}\" is not available.", - this.getStorageProviderID()); - } - return this.isJCloudsBundleAvailable; - } - - @Override - public final boolean isStorageProviderReady() { - - if ((!this.needsCredentials() || this.getCredentialsID() != null) && this.isJCloudsBundleAvailable()) { - return true; - } - - return false; - - } - - @Override - public final void setCredentials(final Credentials credentials) { - - if (this.isInitialized) { - AbstractJCloudsFileStorageProvider.LOG.debug("Storage provider \"{}\" is initialized. For storing credentials it will be closed now.", - this.getStorageProviderID()); - this.close(); - } - - this.credentialsID = credentials.getID(); - this.credentialsIdentity = credentials.getIdentity(); - this.credentialsKey = credentials.getKey(); - - } - - /** - * Sets a new container name in this storage provider.
    - *
    - * Note: If you have stored files on this storage provider and then set a new container name, these - * files can't be found anymore, because the storage provider searches for the files in the new - * bucket. Thus, for getting access to these files again, you must set the previous container name. - * - * @param containerName to set - */ - protected final void setContainerName(final String containerName) { - if (this.isInitialized) { - AbstractJCloudsFileStorageProvider.LOG.debug("Storage provider \"{}\" is initialized. For setting new container name it will be closed now.", - this.getStorageProviderID()); - this.close(); - } - AbstractJCloudsFileStorageProvider.LOG.debug("Setting container name \"{}\" in storage provider \"{}\"...", - containerName, this.getStorageProviderID()); - this.containerName = containerName; - AbstractJCloudsFileStorageProvider.LOG.debug("Setting container name \"{}\" in storage provider \"{}\" completed.", - containerName, this.getStorageProviderID()); - } - - /** - * - * @return Container name of this storage provider. - */ - protected String getContainerName() { - return this.containerName; - } - - /** - * @return Location of the container of this storage provider.
    - * If you not overwrite this method, the default container location (defined by the - * provider) will be used. - */ - protected Location getContainerLocation() { - return null; - } - - @Override - public final Long getCredentialsID() { - return this.credentialsID; - } - - /** - * @return jclouds modules that should be loaded beside the default modules during initialization of - * the storage provider. The SLF4J logging module will be loaded always.
    - * If you not overwrite this method, no further modules will be loaded. - */ - protected Iterable getJCloudsModules() { - - return Collections.emptyList(); - - } - - /** - * - * @return jclouds properties to overwrite the pre-defined jclouds properties. These properties will - * be passed during initialization of the storage provider.
    - * If you not overwrite this method, no jclouds properties will be overwritten. - */ - protected Properties overwriteJCloudsProperties() { - return new Properties(); - } - - /** - * Called when ANY jclouds API bundle goes available respectively is in bundle state - * {@code ACTIVE}.
    - * If the bundle is the required bundle for this storage provider, {@link #isJCloudsBundleAvailable} - * will be set to {@code true}. - */ - @Override - public final void added(final A apiMetadata) { - final String jcloudsApiID = apiMetadata.getId(); - - if (jcloudsApiID.equals(this.getStorageProviderID())) { - this.isJCloudsBundleAvailable = true; - AbstractJCloudsFileStorageProvider.LOG.debug("jclouds API bundle of storage provider \"{}\" is available.", - this.getStorageProviderID()); - } - - } - - /** - * Called when ANY jclouds API bundle goes unavailable.
    - * If the bundle is the required bundle for this storage provider, {@link #isJCloudsBundleAvailable} - * will be set to {@code false}. - */ - @Override - public final
    void removed(final A apiMetadata) { - final String jcloudsApiID = apiMetadata.getId(); - - if (jcloudsApiID.equals(this.getStorageProviderID())) { - this.isJCloudsBundleAvailable = false; - AbstractJCloudsFileStorageProvider.LOG.debug("JClouds API bundle of storage provider \"{}\" is not more available.", - this.getStorageProviderID()); - } - - } - - /** - * Called when ANY jclouds Provider bundle goes available respectively is in bundle state - * {@code ACTIVE}.
    - * If the bundle is the required bundle for this storage provider, {@link #isJCloudsBundleAvailable} - * will be set to {@code true}. - */ - @Override - public final

    void added(final P providerMetadata) { - final String jcloudsProviderID = providerMetadata.getId(); - - if (jcloudsProviderID.equals(this.getStorageProviderID())) { - this.isJCloudsBundleAvailable = true; - AbstractJCloudsFileStorageProvider.LOG.debug("JClouds provider bundle of storage provider \"{}\" is available.", - this.getStorageProviderID()); - } - - } - - /** - * Called when ANY jclouds Provider bundle goes unavailable.
    - * If the bundle is the required bundle for this storage provider, {@link #isJCloudsBundleAvailable} - * will be set to {@code false}. - */ - @Override - public final

    void removed(final P providerMetadata) { - final String jcloudsProviderID = providerMetadata.getId(); - - if (jcloudsProviderID.equals(this.getStorageProviderID())) { - this.isJCloudsBundleAvailable = false; - AbstractJCloudsFileStorageProvider.LOG.debug("JClouds provider bundle of storage provider \"{}\" is not more available.", - this.getStorageProviderID()); - } - - } - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalCapabilityService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalCapabilityService.java deleted file mode 100644 index a9cb7649c..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalCapabilityService.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.opentosca.container.core.service.internal; - -import java.util.List; -import java.util.Map; - -import org.opentosca.container.core.model.capability.provider.ProviderType; - -/** - * This interface provides methods to store, get and delete capabilities of different provider and - * provider types. The IAEngine needs this capabilities to decide if a Implementation Artifact - * should be deployed or not. - * - * @see ProviderType - */ -public interface ICoreInternalCapabilityService { - - /** - * Stores capabilities. - * - * @param capabilities to store. - * @param providerName Name of the provider (e.g. a plugin) where the capabilities are from. - * @param providerType identifies if the capabilities are from the Container, PanEnginePlugin or - * IAEnginePlugin (see {@link ProviderType}). - */ - public void storeCapabilities(List capabilities, String providerName, ProviderType providerType); - - /** - * @param providerType identifies if the capabilities are from the Container, a PlanEnginePlugin or - * a IAEnginePlugin (see {@link ProviderType}). - * @return Map with all providers and their capabilities. - */ - public Map> getCapabilities(ProviderType providerType); - - /** - * @param providerName Name of the provider (e.g. a plugin) where the capabilities should be fetched - * from. - * @param providerType identifies if the capabilities are from the Container, a PlanEnginePlugin or - * a IAEnginePlugin (see {@link ProviderType}). - * @return List with all capabilities of given provider. - */ - public List getCapabilities(String providerName, ProviderType providerType); - - /** - * Deletes all stored capabilities of a provider. - * - * @param providerName Name of the provider (e.g. a plugin) where the capabilities should be deleted - * from. - */ - public void deleteCapabilities(String providerName); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalCredentialsService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalCredentialsService.java deleted file mode 100644 index ec7728a23..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalCredentialsService.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.opentosca.container.core.service.internal; - -import java.util.Set; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.credentials.Credentials; - -/** - * - * This interface of the Core Internal Credentials Service defines methods for storing, getting and - * deleting credentials, checking if credentials are set in a storage provider, setting credentials - * in a storage provider, getting the name of the credentials identity and key of a storage - * provider, getting all available storage providers. - */ -public interface ICoreInternalCredentialsService { - - /** - * Stores credentials {@code credentials}.
    - * Also injects the credentials in the appropriate storage provider if the following conditions are - * fulfilled:
    - * - Storage provider is available.
    - * - Storage provider has no injected credentials.
    - *
    - * Note: Credentials will be only stored if storage provider of credentials needs credentials. If - * storage provider is not available, we can't check if this requirement is fulfilled. - * - * @param credentials to store. - * - * @return Generated ID of stored credentials. - * @throws UserException if {@code credentials} contains missing required data, are already stored - * according to unique constraints defined in {@link Credentials} or storage provider of - * credentials needs no credentials. - */ - public long storeCredentials(Credentials credentials) throws UserException; - - /** - * @param credentialsID of credentials. - * @return {@link Credentials} with ID {@code credentialsID}. - * @throws UserException if credentials were not found. - */ - public Credentials getCredentials(long credentialsID) throws UserException; - - /** - * @return IDs of all stored credentials. - */ - public Set getCredentialsIDs(); - - /** - * @param storageProviderID of storage provider - * @return All stored {@link Credentials} for storage provider {@code storageProviderID}. - */ - public Set getAllCredentialsOfStorageProvider(String storageProviderID); - - /** - * @return All stored {@link Credentials}. - */ - public Set getAllCredentials(); - - /** - * Deletes credentials {@code credentialsID}.
    - * If necessary, also deletes these credentials in their storage provider. - * - * @param credentialsID of credentials. - * - * @throws UserException if credentials to delete were not found. - */ - public void deleteCredentials(long credentialsID) throws UserException; - - /** - * Deletes all stored credentials.
    - * Also deletes the credentials in their storage providers, if necessary. - */ - public void deleteAllCredentials(); - - /** - * Sets / injects stored credentials {@code credentialsID} in their storage provider. - * - * @param credentialsID of credentials. - * @throws SystemException if storage provider of credentials is not available. - * @throws UserException if credentials were not found or storage provider of credentials - * {@code credentialsID} needs no credentials. - */ - public void setCredentialsInStorageProvider(long credentialsID) throws UserException, SystemException; - - /** - * Deletes credentials in storage provider {@code storageProviderID}, if necessary. - * - * @param storageProviderID of storage provider. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public void deleteCredentialsInStorageProvider(String storageProviderID) throws SystemException; - - /** - * @param storageProviderID of storage provider - * @return {@code true} if storage provider {@code storageProviderID} has currently credentials, - * otherwise {@code false}. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public boolean hasStorageProviderCredentials(String storageProviderID) throws SystemException; - - /** - * @param credentialsID of credentials. - * @return {@code true} if storage provider of credentials {@code credentialsID} has these - * credentials, otherwise {@code false}.
    - * Also {@code false} will be returned if storage provider of credentials - * {@code credentialsID} is not available. - * - * @UserException if credentials {@code credentialsID} were not found. - */ - public boolean hasStorageProviderCredentials(long credentialsID) throws UserException; - - /** - * @param storageProviderID of storage provider - * @return {@code true} if storage provider {@code storageProviderID} needs credentials, otherwise - * {@code false}. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public boolean needsStorageProviderCredentials(String storageProviderID) throws SystemException; - - /** - * @param storageProviderID of storage provider - * @return Name of the credentials identity of storage provider {@code storageProviderID}, e.g. for - * AWS S3 it's the Access Key ID. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public String getCredentialsIdentityName(String storageProviderID) throws SystemException; - - /** - * @param storageProviderID of storage provider - * @return Name of the credentials key of storage provider {@code storageProviderID}, e.g. for AWS - * S3 it's the Secret Access Key. - * @throws SystemException if storage provider {@code storageProviderID} is not available. - */ - public String getCredentialsKeyName(String storageProviderID) throws SystemException; - - /** - * @return IDs of available storage providers.
    - * A storage provider is defined as available if it's bundle is installed and is in bundle - * state {@code ACTIVE}. - */ - public Set getStorageProviders(); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalDeploymentTrackerService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalDeploymentTrackerService.java deleted file mode 100644 index abeb8b124..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalDeploymentTrackerService.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.opentosca.container.core.service.internal; - -import java.util.List; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.deployment.ia.IADeploymentInfo; -import org.opentosca.container.core.model.deployment.ia.IADeploymentState; -import org.opentosca.container.core.model.deployment.plan.PlanDeploymentInfo; -import org.opentosca.container.core.model.deployment.plan.PlanDeploymentState; -import org.opentosca.container.core.model.deployment.process.DeploymentProcessState; - -/** - * Interface that provides methods for storing and getting the deployment states of CSAR files, IAs - * and Plans. - */ -public interface ICoreInternalDeploymentTrackerService { - - /** - * Stores the deployment state of a CSAR file. - * - * @param csarID that uniquely identifies a CSAR file - * @param deploymentState to store - * @return true if storing was successful, otherwise false - */ - public boolean storeDeploymentState(CSARID csarID, DeploymentProcessState deploymentState); - - /** - * @param csarID that uniquely identifies a CSAR file - * @return the deployment state of the CSAR file; if CSAR file doesn't exist null - */ - public DeploymentProcessState getDeploymentState(CSARID csarID); - - /** - * Stores deployment information for a Implementation Artifact. Already stored deployment - * information will be overwritten! - * - * @param iaDeploymentInfo to store (contains CSARID, relative file path where the IA is located - * inside the CSAR file and deployment state of IA) - * @return true if storing was successful, otherwise false - */ - public boolean storeIADeploymentInfo(IADeploymentInfo iaDeploymentInfo); - - /** - * Stores deployment information for a Implementation Artifact. Already stored deployment - * information will be overwritten! - * - * @param csarID that uniquely identifies a CSAR file - * @param iaRelPath- relative file path where the Implementation Artifact is located inside the CSAR - * file - * @param iaDeploymentState - deployment state of the Implementation Artifact - * @return true if storing was successful, otherwise false - */ - public boolean storeIADeploymentInfo(CSARID csarID, String iaRelPath, IADeploymentState iaDeploymentState); - - /** - * @param csarID that uniquely identifies a CSAR file - * @param iaRelPath - relative file path where the Implementation Artifact is located inside the - * CSAR file - * @return if Implementation Artifact exists, its deployment information; otherwise - * null - */ - public IADeploymentInfo getIADeploymentInfo(CSARID csarID, String iaRelPath); - - /** - * @param csarID that uniquely identifies a CSAR file - * @return the deployment informations for all Implementation Artifacts of the CSAR file. - */ - public List getIADeploymentInfos(CSARID csarID); - - /** - * Stores the deployment information for a Plan. Already stored deployment information will be - * overwritten! - * - * @param planDeploymentInfo to store (contains CSARID, relative file path where the Plan is located - * inside the CSAR file and deployment state of Plan) - * @return true if storing was successful, otherwise false - */ - public boolean storePlanDeploymentInfo(PlanDeploymentInfo planDeploymentInfo); - - /** - * Stores deployment information for a Plan. Already stored deployment information will be - * overwritten! - * - * @param csarID that uniquely identifies a CSAR file - * @param planRelPath - relative file path where the Plan is located inside the CSAR file - * @param planDeploymentState - deployment state of the Plan - * @return true if storing was successful, otherwise false - */ - public boolean storePlanDeploymentInfo(CSARID csarID, String planRelPath, PlanDeploymentState planDeploymentState); - - /** - * @param csarID that uniquely identifies a CSAR file - * @param planRelPath - relative file path where the Plan is located inside the CSAR file - * @return if Plan exists, its deployment information; otherwise null - */ - public PlanDeploymentInfo getPlanDeploymentInfo(CSARID csarID, String planRelPath); - - /** - * @param csarID that uniquely identifies a CSAR file - * @return the deployment informations for all Plans of the CSAR file - */ - public List getPlanDeploymentInfos(CSARID csarID); - - /** - * Deletes all deployment information for the given CSAR id - * - * @param csarID the CSAR id whose deployment state should be deleted - */ - public void deleteDeploymentState(CSARID csarID); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalEndpointService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalEndpointService.java deleted file mode 100644 index 5d13780f5..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalEndpointService.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.opentosca.container.core.service.internal; - -import java.net.URI; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; - -/** - * This Interface provides Methods to store and get Endpoints - * - * @see RESTEndpoint - * @see WSDLEndpoint - */ -public interface ICoreInternalEndpointService { - - /** - * This method queries for all WSDL-Endpoints identified by the given portType, Container and - * csarId. It then returns a List of the retrieved Endpoints. - * - * @see WSDLEndpoint - * - * @param portType : PortType to identify the Endpoint - * @param triggeringContainer Container where the CSAR identified by csarId resides - * @param csarId : csarId to identify the Endpoint - * @return ArrayList containing all corresponding WSDLEndpoints - */ - public List getWSDLEndpoints(QName portType, String triggeringContainer, CSARID csarId); - - /** - * This method stores a given WSDLEndpoint object. - * - * @see WSDLEndpoint - * - * @param endpoint : The WSDL-Endpoint to store - */ - public void storeWSDLEndpoint(WSDLEndpoint endpoint); - - /** - * This method queries for RESTEndpoints identified by the given URI and thorID - * - * @see RESTEndpoint - * - * @param anyURI : Uri to identify the Endpoint - * @param thorID : thorID to identify the Endpoint - * @return ArrayList containing all endpoints matching the given parameters - */ - public List getRestEndpoints(URI anyURI, String triggeringContainer, CSARID csarId); - - /** - * This method queries for a WSDLEndpoint identified by the given Container, CSARID and PlanId - * - * @param triggeringContainer Container where the CSAR identified by csarId resides - * @param csarId an id of type CSARID - * @param planId an id of type QName - * @return a WSDLEndpoint representing a Plan stored in the endpoint db or null if nothing was - * found - */ - public WSDLEndpoint getWSDLEndpointForPlanId(String triggeringContainer, CSARID csarId, QName planId); - - /** - * This method stores a given RESTEndpoint object. - * - * @see WSDLEndpoint - * - * @param endpoint : RESTEndpoint to store - */ - public void storeRESTEndpoint(RESTEndpoint endpoint); - - /** - * Removes all plan endpoints associated with the CSAR identified by the given OpenTOSCA - * Container host name and the given CSARID - * - * @param triggeringContainer the OpenTOSCA Container where the CSAR is deployed - * @param csarId the CSARID whose plan endpoints should be removed - */ - public void removePlanEndpoints(String triggeringContainer, CSARID csarId); - - /** - * Debug print of plan endpoints. - */ - public void printPlanEndpoints(); - - /** - * This method queries for all WSDLEndpoints identified by the given Container and CSARID - * - * @param triggeringContainer Container where the CSAR identified by csarId resides - * @param csarId an id of type CSARID - * @return List of WSDLEndpoints of the given CSARID if min. one was found else null - */ - public List getWSDLEndpointsForCSARID(String triggeringContainer, CSARID csarId); - - /** - * This method queries for all WSDLEndpoints identified by the given Container and - * ServiceTemplateInstance ID - * - * @param triggeringContainer OpenTOSCA Container host name where the ServiceTemplateInstance - * identified by serviceTemplateInstanceID resides - * @param serviceTemplateInstanceID an ID which identifies a ServiceTemplateInstance uniquely - * @return List of WSDLEndpoints of the given serviceTemplateInstanceID if min. one was found - * else null - */ - public List getWSDLEndpointsForSTID(String triggeringContainer, Long serviceTemplateInstanceID); - - /** - * This method queries for a WSDLEndpoint identified by the triggering and managing OpenTOSCA - * Container, the NodeTypeImplementationId and the ImplementationArtifact name - * - * @param triggeringContainer OpenTOSCA Container which initiated the creation of the endpoint - * @param managingContainer OpenTOSCA Container which is responsible for handling the endpoint - * @param nodeTypeImpl an ID of type QName - * @param iaName an ID of type String - * @return a WSDLEndpoint representing the given IA if one was found else null - */ - public List getWSDLEndpointsForNTImplAndIAName(String triggeringContainer, String managingContainer, - QName nodeTypeImpl, String iaName); - - /** - * This method queries for all WSDLEndpoints - * - * @return List of WSDLEndpoints if min. one was found else null - */ - public List getWSDLEndpoints(); - - /** - * Removes the given WSDL Endpoint if found - * - * @param endpoint the WSDL Endpoint to remove - * @return true if removing the endpoint was successful, else false - */ - public boolean removeWSDLEndpoint(WSDLEndpoint endpoint); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalFileService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalFileService.java deleted file mode 100644 index 3cdc9de88..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalFileService.java +++ /dev/null @@ -1,254 +0,0 @@ -package org.opentosca.container.core.service.internal; - -import java.nio.file.Path; -import java.util.Set; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; - -/** - * This interface of the Core Internal File Service defines methods for storing, getting, moving and - * deleting CSAR files, moving files or directories contained in CSAR files, getting available and - * ready storage providers, getting and setting the active storage provider, getting the default - * storage provider. - * - * @see CSARContent - */ -public interface ICoreInternalFileService { - - /** - * - * @return IDs of available storage providers which have no unsatisfied requirements (ready) and - * therefore can be used.
    - * - * @see #isReadyStorageProvider() - */ - public Set getReadyStorageProviders(); - - /** - * @param storageProviderID of storage provider to check if it's ready. - * @return {@code true} if storage provider {@code storageProviderID} is available and has no - * unsatisfied requirements, so it can be used. Otherwise {@code false} will be - * returned.
    - * Usually a requirement of a storage provider are the credentials (exception: file system - * storage provider) which must be set in the storage provider. - */ - public boolean isReadyStorageProvider(String storageProviderID); - - /** - * @return IDs of available storage providers.
    - * A storage provider is defined as available if it's bundle is installed and is in bundle - * state {@code ACTIVE}. - */ - public Set getStorageProviders(); - - /** - * @return ID of active storage provider that will used for storing a CSAR and as target for moving - * a CSAR or a file / directory contained in a CSAR. - */ - public String getActiveStorageProvider(); - - /** - * @return Friendly name of the storage provider {@code storageProviderID}. If - * {@code storageProviderID} is not available {@code null}. - */ - public String getStorageProviderName(String storageProviderID); - - /** - * Sets storage provider {@code storageProviderID} as the active storage provider that will used for - * storing a CSAR and as target for moving a CSAR or file / directory contained in a CSAR.
    - *
    - * Notes:
    - * 1) After the start of the Container no active storage provider is set.
    - * 2) If the active storage provider goes unavailable, this setting will be cleared (no active - * storage provider is set).
    - * 3) By passing {@code null} you can manually set no active storage provider. - * - * - * @param storageProviderID of the storage provider to set as the active one. - * @throws UserException if storage provider {@code storageProviderID} is not available. - */ - public void setActiveStorageProvider(String storageProviderID) throws UserException; - - /** - * @return ID of the default storage provider. It will be used for storing a CSAR and as the target - * for moving a CSAR or a file / directory of a CSAR if no active storage storage provider - * is set or it's not ready. If the default storage provider is also not available and ready - * the operation fails.
    - * The default storage provider is hard-coded and can't be changed. - */ - public String getDefaultStorageProvider(); - - /** - * Stores the CSAR file {@code csarFile}.
    - * First, it will be checked if the given file has correct extension and is not already stored. Then - * the CSAR will be unpacked (path is specified in Settings bundle), its content validated and the - * TOSCA meta file parsed. Finally all files of the CSAR will be stored on the active storage - * provider. After storing on storage provider the meta data of the CSAR (file and directory paths, - * TOSCA meta file content and CSAR ID) will be stored in the database and the unpack directory - * deleted.
    - *
    - * Note 1: If no active storage provider is set (e.g. directly after the start of the container) or - * it's not ready, the default storage provider will be used instead, if it's available and - * ready.
    - * Note 2: Only files of a CSAR will be stored on the storage provider. Directories will be stored - * as meta data only.
    - * Note 3: If an error occurred during storing the unpack directory will be also deleted (if CSAR - * was already unpacked). - * - * @param csarFile to store. - * @return CSAR ID thats uniquely identifies the CSAR file. - * - * @throws SystemException if active storage provider is not set / can't be used and default storage - * provider also can't be used, unpacking CSAR failed, access to an directory denied while - * getting files and directories in unpack directory or if an error occurred during storing - * on the storage provider. - * - * @throws UserException if {@code csarFile} does not exist, is not a valid ZIP file, is already - * stored or it's content is invalid, e.g. contains no TOSCA file in {@code Definitions} - * directory or has an invalid TOSCA meta file. - * - * @see org.opentosca.settings.Settings - * - * - */ - public CSARID storeCSAR(Path csarFile) throws UserException, SystemException; - - /** - * Retrieves meta data of CSAR {@code csarID}. - * - * @param csarID of CSAR - * @return {@link CSARContent} that gives access to all files and directories and the TOSCA meta - * file of the CSAR. - * @throws UserException if CSAR {@code csarID} was not found. - */ - public CSARContent getCSAR(CSARID csarID) throws UserException; - - /** - * Exports a stored CSAR {@code csarID}.
    - * First, it retrieves the meta data of the CSAR and checks if the required storage provider(s) are - * available and ready to minimize the risk of a cancel during retrieving files. Then it creates the - * directory structure and retrieves all files of the CSAR from the appropriate storage provider(s) - * to a sub directory of a Temp directory. Finally the content of this directory will be compressed - * as a CSAR file. The created CSAR file is located directly in the Temp directory.
    - *
    - * - * Note: At the end or if an error occurred the directory that contains the content of the CSAR file - * will be deleted (if necessary). - * - * @param csarID of CSAR - * @return CSAR {@code csarID} as {@link Path} object. - * @throws UserException if CSAR {@code csarID} was not found. - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during retrieving files of CSAR. - */ - public Path exportCSAR(CSARID csarID) throws UserException, SystemException; - - /** - * @return CSAR IDs of all stored CSAR files. - */ - public Set getCSARIDs(); - - /** - * Moves a CSAR {@code csarID} from it's storage provider(s) to the active storage provider (target - * storage provider).
    - *
    - * First, the files meta data of CSAR {@code csarID} will be retrieved to check if the CSAR is - * stored and to get the storage provider(s) of the files of the CSAR. Then all files will be - * determined that must be moved to the target storage provider. If no files were found (completely - * stored on target storage provider), the move process is completed. Otherwise the files will be - * moved successively to the target storage provider.
    - * If an error occurred while moving files, the process will be canceled respectively further files - * will not be moved anymore.
    - *
    - * Note: If no active storage provider is set (e.g. directly after the start of the container) or - * it's not ready, the default storage provider will be used instead, if it's available and ready. - * - * @param csarID of CSAR. - * @see CoreInternalFileServiceImpl#findFilesToMove - * @see CoreInternalFileServiceImpl#moveFilesToStorageProvider - * - * @throws UserException if CSAR {@code csarID} was not found. - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during moving files. - * - */ - public void moveCSAR(CSARID csarID) throws UserException, SystemException; - - /** - * Moves the file / directory {@code fileOrDirRelToCSARRoot} of CSAR {@code csarID} from it's - * storage provider(s) to the active storage provider.
    - *
    - * First, the files and directories meta data of CSAR {@code csarID} will be retrieved to check if - * the CSAR is stored, given {@code fileOrDirRelToCSARRoot} is a existent file or directory and to - * get the storage provider of the file respectively the storage providers of all files in the - * directory to move. If file / directory exists, all files will be determined that must be moved to - * the target storage provider. If no files were found (completely stored on target storage - * provider), the move process is completed. Otherwise the files will be moved successively to the - * target storage provider.
    - * If an error occurred while moving files, the process will be canceled respectively further files - * will not be moved anymore.
    - *
    - * Note 1: If no active storage provider is set (e.g. directly after the start of the container) or - * it's not ready, the default storage provider will be used instead, if it's available and - * ready.
    - * Note 2: Moving a directory means that all files in the directory will be moved. Directories are - * only stored as meta data. - * - * @param csarID of CSAR - * @param fileOrDirRelToCSARRoot - path relative to CSAR root of a file or directory in CSAR - * {@code csarID}. - * - * @see CoreInternalFileServiceImpl#findFilesToMove - * @see CoreInternalFileServiceImpl#moveFileToStorageProvider - * @see CoreInternalFileServiceImpl#moveFilesToStorageProvider - * - * @throws UserException if CSAR {@code csarID} was not found or {@code fileOrDirRelToCSARRoot} does - * not exist in CSAR {@code csarID}. - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during moving files. - * - */ - public void moveFileOrDirectoryOfCSAR(CSARID csarID, Path fileOrDirRelToCSARRoot) throws UserException, - SystemException; - - /** - * Deletes the CSAR {@code csarID}.
    - *
    - * First, the files meta data of CSAR {@code csarID} will be retrieved to check if the CSAR exists - * and to get the storage provider(s) of the files. Then it will be checked if each storage provider - * is available and ready to minimize the risk for a cancel of the deletion process. Finally all - * files of the CSAR will be deleted on the storage provider(s). After deletion the meta data of the - * CSAR will be deleted, too.
    - * If an error occurred while deleting files, the complete process will be canceled respectively - * further files will not be deleted anymore. The meta data of the CSAR is not deleted, so deletion - * can be executed again to delete the remaining files. - * - * @param csarID of CSAR - * @see StorageProviderManager#deleteFilesOfCSAR - * - * @throws UserException if CSAR {@code csarID} was not found. - * - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during deleting files. - * - */ - public void deleteCSAR(CSARID csarID) throws SystemException, UserException; - - /** - * Deletes all CSAR files.
    - *
    - * The CSAR IDs of all stored CSAR will be retrieved and then each CSAR deleted by using - * {@link ICoreInternalFileService#deleteCSAR(CSARID)}.
    - * If an error occurred while deleting a CSAR, the complete process will be canceled respectively - * further CSARs will not be deleted anymore.
    - * - * @throws SystemException if a required storage provider is not available and ready or an error - * occurred during deleting files of CSARs. - * - */ - public void deleteCSARs() throws SystemException; - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalFileStorageProviderService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalFileStorageProviderService.java deleted file mode 100644 index cf19fa7ad..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalFileStorageProviderService.java +++ /dev/null @@ -1,138 +0,0 @@ -package org.opentosca.container.core.service.internal; - -import java.io.InputStream; -import java.nio.file.Path; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.model.credentials.Credentials; - -/** - * This interface of a storage provider provides methods for getting the ID and name of the storage - * provider, checking if the storage provider is ready, storing, getting and deleting files on the - * storage provider, getting the size of files on the storage provider, managing credentials of the - * storage provider and getting the storage provider-specific identity and key names of credentials. - */ -public interface ICoreInternalFileStorageProviderService { - - /** - * - * @return ID of this storage provider. - */ - public String getStorageProviderID(); - - /** - * - * @return Name of this storage provider. - */ - public String getStorageProviderName(); - - /** - * - * @return {@code true} if all requirements of this storage provider are satisfied so it can be - * used, otherwise {@code false}. - */ - public boolean isStorageProviderReady(); - - /** - * Stores the file {@code absFilePath} as {@code relFilePathOnProvider} on this storage - * provider.
    - * If the file already exists, it will be overwritten. - * - * @param absFilePath - absolute path of file. - * @param relFilePathOnProvider - relative path where the file should be stored on storage provider. - * @throws SystemException if {@code absFilePath} doesn't points to an existing file or an error - * occurred during storing. - */ - public void storeFile(Path absFilePath, String relFilePathOnProvider) throws SystemException; - - /** - * Stores the file given as input stream {@code fileInputStream} as file - * {@code relFilePathOnProvider} on this storage provider.
    - * If the file already exists, it will be overwritten. - * - * @param fileInputStream of file. - * @param fileSize - size of file in bytes. - * @param relFilePathOnProvider - relative path where the file should be stored on the storage - * provider. - * @throws SystemException if an error occurred during storing. - */ - public void storeFile(InputStream fileInputStream, long fileSize, - String relFilePathOnProvider) throws SystemException; - - /** - * Retrieves the file {@code relFilePathOnProvider} from this storage provider. It will be stored at - * {@code targetAbsFilePath}.
    - * If file {@code targetAbsFilePath} not exists, it will be created. Otherwise it will be - * overwritten. - * - * @param relFilePathOnProvider - relative path of file on storage provider - * @param targetAbsFilePath - local absolute file path. - * @throws SystemException if {@code relFilePathOnProvider} was not found on storage provider, - * creating or writing to file {@code targetAbsFilePath} failed or an error occurred during - * retrieving. - */ - public void getFile(String relFilePathOnProvider, Path targetAbsFilePath) throws SystemException; - - /** - * - * Gets the input stream of file {@code relFilePathOnProvider} from this storage provider. - * - * @param relFilePathOnProvider - relative path of file on storage provider. - * @return {@link InputStream} of file {@code relFilePathOnProvider}. - * @throws SystemException if {@code relFilePathOnProvider} was not found on storage provider or an - * error occurred during getting. - */ - public InputStream getFileAsInputStream(String relFilePathOnProvider) throws SystemException; - - /** - * @param relFilePathOnProvider - relative path of file on storage provider. - * @return Size of file {@code relFilePathOnProvider} in bytes. - * @throws SystemException if {@code relFilePathOnProvider} was not found on storage provider or an - * error occurred during getting size. - */ - public long getFileSize(String relFilePathOnProvider) throws SystemException; - - /** - * Deletes the file {@code relFilePathOnProvider} on this storage provider, if it exists (deleting a - * non-existent file is also a successful execution). - * - * @param relFilePathOnProvider - relative path of file on storage provider. - * @throws SystemException if an error occurred during deleting. - */ - public void deleteFile(String relFilePathOnProvider) throws SystemException; - - /** - * @return {@code true} if storage provider needs credentials, otherwise {@code false}. - */ - public boolean needsCredentials(); - - /** - * - * Sets the credentials {@code credentials} in this storage provider. - * - * @param credentials to set. - */ - public void setCredentials(Credentials credentials); - - /** - * Deletes the credentials in this storage provider. - */ - public void deleteCredentials(); - - /** - * @return Name of the credentials identity of this storage provider. - */ - public String getCredentialsIdentityName(); - - /** - * @return Name of the credentials key of this storage provider. - */ - public String getCredentialsKeyName(); - - /** - * - * @return ID of set credentials. If storage provider has currently no credentials {@code null}. - */ - public Long getCredentialsID(); - -} diff --git a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalModelRepositoryService.java b/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalModelRepositoryService.java deleted file mode 100644 index 59a87a7f0..000000000 --- a/org.opentosca.container.core/src/org/opentosca/container/core/service/internal/ICoreInternalModelRepositoryService.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.opentosca.container.core.service.internal; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TDefinitions; - -/** - * This interface provides methods to to store and retrieve TOSCAs / Definitions. - */ -public interface ICoreInternalModelRepositoryService { - - // /** - // * Stores a TOSCA file / Definitions. - // * - // * @param toscaFile to store - // * @return If storing was successful the Definitions ID of the TOSCA file, - // * otherwise null. - // */ - // public QName storeTOSCA(File toscaFile); - - // /** - // * @param definitionsID - // * @return IDs of all service templates contained in Definitions with ID - // * definitionsID. - // */ - - // /** - // * - // * @param csarID - // * @param definitionsID - // * @return IDs of all service templates contained in Definitions with ID - // * definitionsID and CSAR csarID. - // */ - // public List getServiceTemplateIDs(CSARID csarID, QName - // definitionsID); - - // /** - // * Deletes all stored Definitions / TOSCAs. - // * - // * @return Number of deleted Definitions. - // */ - // public int deleteAllDefinitions(); - - // /** - // * Deletes a Definitions / TOSCA. - // * - // * @param definitionsID of Definitions to delete - // * @return true if deletion was successful, otherwise - // * false. - // */ - // public boolean deleteDefinitions(QName definitionsID); - - /** - * - * @return IDs of all Definitions of CSAR csarID. - */ - public List getAllDefinitionsIDs(CSARID csarID); - - /** - * @param definitionsID - * @return Definitions with ID definitionsID of CSAR csarID. If it - * doesn't exist null. - */ - public TDefinitions getDefinitions(CSARID csarID, QName definitionsID); - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/META-INF/MANIFEST.MF b/org.opentosca.container.engine.plan.plugin.bpel/META-INF/MANIFEST.MF deleted file mode 100644 index 446f579d9..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Plan Engine BPEL 2.0 Plugin for WSO2 BPS 2.1.2 and Apache ODE 1.3.6 -Bundle-SymbolicName: org.opentosca.container.engine.plan.plugin.bpel -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.ibm.wsdl.extensions.http, - com.ibm.wsdl.extensions.soap, - javax.wsdl;version="1.6.0", - javax.wsdl.extensions;version="1.6.0", - javax.wsdl.extensions.http;version="1.6.0", - javax.wsdl.extensions.soap;version="1.6.0", - javax.wsdl.factory;version="1.6.0", - javax.wsdl.xml;version="1.6.0", - org.apache.commons.io;version="2.2.0", - org.eclipse.osgi.util;version="1.1.0", - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.6.4" -Bundle-ActivationPolicy: lazy -Require-Bundle: org.opentosca.container.core, - org.opentosca.container.core.tosca, - org.opentosca.container.engine.plan, - org.opentosca.container.connector.bps, - org.opentosca.container.connector.ode -Service-Component: OSGI-INF/* -Bundle-Activator: org.opentosca.container.engine.plan.plugin.bpel.Activator -Export-Package: org.opentosca.container.engine.plan.plugin.bpel diff --git a/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/BPELRESTLightUpdater_component.xml b/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/BPELRESTLightUpdater_component.xml deleted file mode 100644 index c8a23ee5d..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/BPELRESTLightUpdater_component.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/BpelPlanEnginePlugin_component.xml b/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/BpelPlanEnginePlugin_component.xml deleted file mode 100644 index 6cabceef9..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/BpelPlanEnginePlugin_component.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/ODEEndpointUpdater_component.xml b/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/ODEEndpointUpdater_component.xml deleted file mode 100644 index 9a7f434d6..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/OSGI-INF/ODEEndpointUpdater_component.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.container.engine.plan.plugin.bpel/build.properties b/org.opentosca.container.engine.plan.plugin.bpel/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.container.engine.plan.plugin.bpel/pom.xml b/org.opentosca.container.engine.plan.plugin.bpel/pom.xml index ad4de6705..6efd322a4 100644 --- a/org.opentosca.container.engine.plan.plugin.bpel/pom.xml +++ b/org.opentosca.container.engine.plan.plugin.bpel/pom.xml @@ -1,6 +1,6 @@ + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 @@ -10,6 +10,34 @@ org.opentosca.container.engine.plan.plugin.bpel - eclipse-plugin + + + org.opentosca + org.opentosca.container.engine.plan + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + + wsdl4j + wsdl4j + + + + org.opentosca + org.opentosca.container.connector.ode + ${project.version} + + + org.opentosca + org.opentosca.container.legacy + ${project.version} + + + diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java new file mode 100644 index 000000000..7738a5b24 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java @@ -0,0 +1,149 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See
    http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.apache.ode.schemas.dd._2007._03 package. + *

    + * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _Deploy_QNAME = new QName("http://www.apache.org/ode/schemas/dd/2007/03", "deploy"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.apache.ode.schemas.dd._2007._03 + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link TService } + */ + public TService createTService() { + return new TService(); + } + + /** + * Create an instance of {@link TInvoke.Binding } + */ + public TInvoke.Binding createTInvokeBinding() { + return new TInvoke.Binding(); + } + + /** + * Create an instance of {@link TCleanup } + */ + public TCleanup createTCleanup() { + return new TCleanup(); + } + + /** + * Create an instance of {@link TInvoke } + */ + public TInvoke createTInvoke() { + return new TInvoke(); + } + + /** + * Create an instance of {@link TDeployment.Process } + */ + public TDeployment.Process createTDeploymentProcess() { + return new TDeployment.Process(); + } + + /** + * Create an instance of {@link TDeployment } + */ + public TDeployment createTDeployment() { + return new TDeployment(); + } + + /** + * Create an instance of {@link TMexInterceptor } + */ + public TMexInterceptor createTMexInterceptor() { + return new TMexInterceptor(); + } + + /** + * Create an instance of {@link TSchedule } + */ + public TSchedule createTSchedule() { + return new TSchedule(); + } + + /** + * Create an instance of {@link TDeployment.Process.MexInterceptors } + */ + public TDeployment.Process.MexInterceptors createTDeploymentProcessMexInterceptors() { + return new TDeployment.Process.MexInterceptors(); + } + + /** + * Create an instance of {@link TEnableSharing } + */ + public TEnableSharing createTEnableSharing() { + return new TEnableSharing(); + } + + /** + * Create an instance of {@link TScopeEvents } + */ + public TScopeEvents createTScopeEvents() { + return new TScopeEvents(); + } + + /** + * Create an instance of {@link TProcessEvents } + */ + public TProcessEvents createTProcessEvents() { + return new TProcessEvents(); + } + + /** + * Create an instance of {@link TDeployment.Process.Property } + */ + public TDeployment.Process.Property createTDeploymentProcessProperty() { + return new TDeployment.Process.Property(); + } + + /** + * Create an instance of {@link TEnableEventList } + */ + public TEnableEventList createTEnableEventList() { + return new TEnableEventList(); + } + + /** + * Create an instance of {@link TProvide } + */ + public TProvide createTProvide() { + return new TProvide(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TDeployment }{@code >}} + */ + @XmlElementDecl(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", name = "deploy") + public JAXBElement createDeploy(final TDeployment value) { + return new JAXBElement<>(_Deploy_QNAME, TDeployment.class, null, value); + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java new file mode 100644 index 000000000..a32bf9b97 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java @@ -0,0 +1,139 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tCleanup complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tCleanup">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="category" maxOccurs="unbounded" minOccurs="0">
    + *           <simpleType>
    + *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *               <enumeration value="instance"/>
    + *               <enumeration value="variables"/>
    + *               <enumeration value="messages"/>
    + *               <enumeration value="correlations"/>
    + *               <enumeration value="events"/>
    + *               <enumeration value="all"/>
    + *             </restriction>
    + *           </simpleType>
    + *         </element>
    + *         <element name="filter" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="on">
    + *         <simpleType>
    + *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *             <enumeration value="success"/>
    + *             <enumeration value="failure"/>
    + *             <enumeration value="always"/>
    + *           </restriction>
    + *         </simpleType>
    + *       </attribute>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tCleanup", propOrder = {"category", "filter"}) +public class TCleanup { + + @XmlElement(defaultValue = "all") + protected List category; + protected List filter; + @XmlAttribute + protected String on; + + /** + * Gets the value of the category property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the category property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getCategory().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getCategory() { + if (this.category == null) { + this.category = new ArrayList<>(); + } + return this.category; + } + + /** + * Gets the value of the filter property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the filter property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getFilter().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getFilter() { + if (this.filter == null) { + this.filter = new ArrayList<>(); + } + return this.filter; + } + + /** + * Gets the value of the on property. + * + * @return possible object is {@link String } + */ + public String getOn() { + return this.on; + } + + /** + * Sets the value of the on property. + * + * @param value allowed object is {@link String } + */ + public void setOn(final String value) { + this.on = value; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java new file mode 100644 index 000000000..0087bdd2a --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java @@ -0,0 +1,622 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) +// Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source +// schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tDeployment complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tDeployment">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="process" maxOccurs="unbounded" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="property" maxOccurs="unbounded" minOccurs="0">
    + *                     <complexType>
    + *                       <complexContent>
    + *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                           <sequence>
    + *                             <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    + *                           </sequence>
    + *                           <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *                         </restriction>
    + *                       </complexContent>
    + *                     </complexType>
    + *                   </element>
    + *                   <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    + *                   <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    + *                   <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    + *                   <element name="mex-interceptors" minOccurs="0">
    + *                     <complexType>
    + *                       <complexContent>
    + *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                           <sequence>
    + *                             <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    + *                           </sequence>
    + *                         </restriction>
    + *                       </complexContent>
    + *                     </complexType>
    + *                   </element>
    + *                   <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    + *                   <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    + *                   <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    + *                 </sequence>
    + *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *                 <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *                 <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlRootElement(name = "tDeployment", namespace = "http://www.apache.org/ode/schemas/dd/2007/03") +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tDeployment", propOrder = {"process"}) +public class TDeployment { + + protected List process; + + /** + * Gets the value of the process property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the process property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getProcess().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TDeployment.Process } + */ + public List getProcess() { + if (this.process == null) { + this.process = new ArrayList<>(); + } + return this.process; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="property" maxOccurs="unbounded" minOccurs="0">
    +     *           <complexType>
    +     *             <complexContent>
    +     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *                 <sequence>
    +     *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    +     *                 </sequence>
    +     *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *               </restriction>
    +     *             </complexContent>
    +     *           </complexType>
    +     *         </element>
    +     *         <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    +     *         <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    +     *         <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    +     *         <element name="mex-interceptors" minOccurs="0">
    +     *           <complexType>
    +     *             <complexContent>
    +     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *                 <sequence>
    +     *                   <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    +     *                 </sequence>
    +     *               </restriction>
    +     *             </complexContent>
    +     *           </complexType>
    +     *         </element>
    +     *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    +     *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    +     *         <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    +     *       </sequence>
    +     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *       <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    +     *       <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"active", "retired", "inMemory", "property", "processEvents", "provide", "invoke", + "mexInterceptors", "type", "cleanup", "schedule"}) + public static class Process { + + @XmlElement(defaultValue = "true") + protected Boolean active; + @XmlElement(defaultValue = "false") + protected Boolean retired; + @XmlElement(name = "in-memory", defaultValue = "false") + protected Boolean inMemory; + protected List property; + @XmlElement(name = "process-events") + protected TProcessEvents processEvents; + protected List provide; + protected List invoke; + @XmlElement(name = "mex-interceptors") + protected TDeployment.Process.MexInterceptors mexInterceptors; + protected QName type; + protected List cleanup; + protected List schedule; + @XmlAttribute(required = true) + protected QName name; + @XmlAttribute + protected String fileName; + @XmlAttribute(name = "bpel11wsdlFileName") + protected String bpel11WsdlFileName; + + /** + * Gets the value of the active property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isActive() { + return this.active; + } + + /** + * Sets the value of the active property. + * + * @param value allowed object is {@link Boolean } + */ + public void setActive(final Boolean value) { + this.active = value; + } + + /** + * Gets the value of the retired property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isRetired() { + return this.retired; + } + + /** + * Sets the value of the retired property. + * + * @param value allowed object is {@link Boolean } + */ + public void setRetired(final Boolean value) { + this.retired = value; + } + + /** + * Gets the value of the inMemory property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isInMemory() { + return this.inMemory; + } + + /** + * Sets the value of the inMemory property. + * + * @param value allowed object is {@link Boolean } + */ + public void setInMemory(final Boolean value) { + this.inMemory = value; + } + + /** + * Gets the value of the property property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the property property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getProperty().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TDeployment.Process.Property } + */ + public List getProperty() { + if (this.property == null) { + this.property = new ArrayList<>(); + } + return this.property; + } + + /** + * Gets the value of the processEvents property. + * + * @return possible object is {@link TProcessEvents } + */ + public TProcessEvents getProcessEvents() { + return this.processEvents; + } + + /** + * Sets the value of the processEvents property. + * + * @param value allowed object is {@link TProcessEvents } + */ + public void setProcessEvents(final TProcessEvents value) { + this.processEvents = value; + } + + /** + * Gets the value of the provide property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the provide property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getProvide().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TProvide } + */ + public List getProvide() { + if (this.provide == null) { + this.provide = new ArrayList<>(); + } + return this.provide; + } + + /** + * Gets the value of the invoke property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the invoke property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getInvoke().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TInvoke } + */ + public List getInvoke() { + if (this.invoke == null) { + this.invoke = new ArrayList<>(); + } + return this.invoke; + } + + /** + * Gets the value of the mexInterceptors property. + * + * @return possible object is {@link TDeployment.Process.MexInterceptors } + */ + public TDeployment.Process.MexInterceptors getMexInterceptors() { + return this.mexInterceptors; + } + + /** + * Sets the value of the mexInterceptors property. + * + * @param value allowed object is {@link TDeployment.Process.MexInterceptors } + */ + public void setMexInterceptors(final TDeployment.Process.MexInterceptors value) { + this.mexInterceptors = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link QName } + */ + public QName getType() { + return this.type; + } + + /** + * Sets the value of the type property. + * + * @param value allowed object is {@link QName } + */ + public void setType(final QName value) { + this.type = value; + } + + /** + * Gets the value of the cleanup property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the cleanup property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getCleanup().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCleanup } + */ + public List getCleanup() { + if (this.cleanup == null) { + this.cleanup = new ArrayList<>(); + } + return this.cleanup; + } + + /** + * Gets the value of the schedule property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the schedule property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getSchedule().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TSchedule } + */ + public List getSchedule() { + if (this.schedule == null) { + this.schedule = new ArrayList<>(); + } + return this.schedule; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(final QName value) { + this.name = value; + } + + /** + * Gets the value of the fileName property. + * + * @return possible object is {@link String } + */ + public String getFileName() { + return this.fileName; + } + + /** + * Sets the value of the fileName property. + * + * @param value allowed object is {@link String } + */ + public void setFileName(final String value) { + this.fileName = value; + } + + /** + * Gets the value of the bpel11WsdlFileName property. + * + * @return possible object is {@link String } + */ + public String getBpel11WsdlFileName() { + return this.bpel11WsdlFileName; + } + + /** + * Sets the value of the bpel11WsdlFileName property. + * + * @param value allowed object is {@link String } + */ + public void setBpel11WsdlFileName(final String value) { + this.bpel11WsdlFileName = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +         * <complexType>
    +         *   <complexContent>
    +         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +         *       <sequence>
    +         *         <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    +         *       </sequence>
    +         *     </restriction>
    +         *   </complexContent>
    +         * </complexType>
    +         * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"mexInterceptor"}) + public static class MexInterceptors { + + @XmlElement(name = "mex-interceptor") + protected List mexInterceptor; + + /** + * Gets the value of the mexInterceptor property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a + * set method for the mexInterceptor property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +             * getMexInterceptor().add(newItem);
    +             * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TMexInterceptor } + */ + public List getMexInterceptor() { + if (this.mexInterceptor == null) { + this.mexInterceptor = new ArrayList<>(); + } + return this.mexInterceptor; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +         * <complexType>
    +         *   <complexContent>
    +         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +         *       <sequence>
    +         *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    +         *       </sequence>
    +         *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +         *     </restriction>
    +         *   </complexContent>
    +         * </complexType>
    +         * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"any"}) + public static class Property { + + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(required = true) + protected QName name; + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a + * set method for the any property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +             * getAny().add(newItem);
    +             * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (this.any == null) { + this.any = new ArrayList<>(); + } + return this.any; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(final QName value) { + this.name = value; + } + } + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java new file mode 100644 index 000000000..0bbdf9497 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java @@ -0,0 +1,72 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tEnableEventList complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tEnableEventList">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="enable-event" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tEnableEventList", propOrder = {"enableEvent"}) +@XmlSeeAlso( {TProcessEvents.class, TScopeEvents.class}) +public class TEnableEventList { + + @XmlElement(name = "enable-event") + protected List enableEvent; + + /** + * Gets the value of the enableEvent property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the enableEvent property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getEnableEvent().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getEnableEvent() { + if (this.enableEvent == null) { + this.enableEvent = new ArrayList<>(); + } + return this.enableEvent; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java new file mode 100644 index 000000000..4321b262a --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java @@ -0,0 +1,35 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tEnableSharing complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tEnableSharing">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tEnableSharing") +public class TEnableSharing { + +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java new file mode 100644 index 000000000..da6faf8df --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java @@ -0,0 +1,179 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tInvoke complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tInvoke">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    + *         <element name="binding" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element ref="{http://ode.apache.org/activityRecovery}failureHandling" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="usePeer2Peer" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tInvoke", propOrder = {"service", "binding"}) +public class TInvoke { + + @XmlElement(required = true) + protected TService service; + protected TInvoke.Binding binding; + @XmlAttribute(required = true) + protected String partnerLink; + @XmlAttribute + protected Boolean usePeer2Peer; + + /** + * Gets the value of the service property. + * + * @return possible object is {@link TService } + */ + public TService getService() { + return this.service; + } + + /** + * Sets the value of the service property. + * + * @param value allowed object is {@link TService } + */ + public void setService(final TService value) { + this.service = value; + } + + /** + * Gets the value of the binding property. + * + * @return possible object is {@link TInvoke.Binding } + */ + public TInvoke.Binding getBinding() { + return this.binding; + } + + /** + * Sets the value of the binding property. + * + * @param value allowed object is {@link TInvoke.Binding } + */ + public void setBinding(final TInvoke.Binding value) { + this.binding = value; + } + + /** + * Gets the value of the partnerLink property. + * + * @return possible object is {@link String } + */ + public String getPartnerLink() { + return this.partnerLink; + } + + /** + * Sets the value of the partnerLink property. + * + * @param value allowed object is {@link String } + */ + public void setPartnerLink(final String value) { + this.partnerLink = value; + } + + /** + * Gets the value of the usePeer2Peer property. + * + * @return possible object is {@link Boolean } + */ + public boolean isUsePeer2Peer() { + if (this.usePeer2Peer == null) { + return true; + } else { + return this.usePeer2Peer; + } + } + + /** + * Sets the value of the usePeer2Peer property. + * + * @param value allowed object is {@link Boolean } + */ + public void setUsePeer2Peer(final Boolean value) { + this.usePeer2Peer = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Binding { + + @XmlAttribute(required = true) + protected QName name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(final QName value) { + this.name = value; + } + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java new file mode 100644 index 000000000..b7cc08555 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java @@ -0,0 +1,62 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + * Message exchange interceptor configuration. + * + * + *

    + * Java class for tMexInterceptor complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tMexInterceptor">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="class-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tMexInterceptor", propOrder = {"className"}) +public class TMexInterceptor { + + @XmlElement(name = "class-name", required = true) + protected String className; + + /** + * Gets the value of the className property. + * + * @return possible object is {@link String } + */ + public String getClassName() { + return this.className; + } + + /** + * Sets the value of the className property. + * + * @param value allowed object is {@link String } + */ + public void setClassName(final String value) { + this.className = value; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java new file mode 100644 index 000000000..eaae3f751 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java @@ -0,0 +1,99 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tProcessEvents complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tProcessEvents">
    + *   <complexContent>
    + *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    + *       <sequence>
    + *         <element name="scope-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tScopeEvents" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="generate">
    + *         <simpleType>
    + *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *             <enumeration value="all"/>
    + *             <enumeration value="none"/>
    + *           </restriction>
    + *         </simpleType>
    + *       </attribute>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tProcessEvents", propOrder = {"scopeEvents"}) +public class TProcessEvents extends TEnableEventList { + + @XmlElement(name = "scope-events") + protected List scopeEvents; + @XmlAttribute + protected String generate; + + /** + * Gets the value of the scopeEvents property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the scopeEvents property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getScopeEvents().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TScopeEvents } + */ + public List getScopeEvents() { + if (this.scopeEvents == null) { + this.scopeEvents = new ArrayList<>(); + } + return this.scopeEvents; + } + + /** + * Gets the value of the generate property. + * + * @return possible object is {@link String } + */ + public String getGenerate() { + return this.generate; + } + + /** + * Sets the value of the generate property. + * + * @param value allowed object is {@link String } + */ + public void setGenerate(final String value) { + this.generate = value; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProvide.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProvide.java new file mode 100644 index 000000000..a6fb66df7 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProvide.java @@ -0,0 +1,101 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tProvide complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tProvide">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    + *         <element name="enableSharing" type="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableSharing" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tProvide", propOrder = {"service", "enableSharing"}) +public class TProvide { + + @XmlElement(required = true) + protected TService service; + protected TEnableSharing enableSharing; + @XmlAttribute(required = true) + protected String partnerLink; + + /** + * Gets the value of the service property. + * + * @return possible object is {@link TService } + */ + public TService getService() { + return this.service; + } + + /** + * Sets the value of the service property. + * + * @param value allowed object is {@link TService } + */ + public void setService(final TService value) { + this.service = value; + } + + /** + * Gets the value of the enableSharing property. + * + * @return possible object is {@link TEnableSharing } + */ + public TEnableSharing getEnableSharing() { + return this.enableSharing; + } + + /** + * Sets the value of the enableSharing property. + * + * @param value allowed object is {@link TEnableSharing } + */ + public void setEnableSharing(final TEnableSharing value) { + this.enableSharing = value; + } + + /** + * Gets the value of the partnerLink property. + * + * @return possible object is {@link String } + */ + public String getPartnerLink() { + return this.partnerLink; + } + + /** + * Sets the value of the partnerLink property. + * + * @param value allowed object is {@link String } + */ + public void setPartnerLink(final String value) { + this.partnerLink = value; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java new file mode 100644 index 000000000..22d90c105 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java @@ -0,0 +1,90 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tSchedule complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tSchedule">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="when" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tSchedule", propOrder = {"cleanup"}) +public class TSchedule { + + protected List cleanup; + @XmlAttribute(required = true) + protected String when; + + /** + * Gets the value of the cleanup property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the cleanup property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getCleanup().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCleanup } + */ + public List getCleanup() { + if (this.cleanup == null) { + this.cleanup = new ArrayList<>(); + } + return this.cleanup; + } + + /** + * Gets the value of the when property. + * + * @return possible object is {@link String } + */ + public String getWhen() { + return this.when; + } + + /** + * Sets the value of the when property. + * + * @param value allowed object is {@link String } + */ + public void setWhen(final String value) { + this.when = value; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java new file mode 100644 index 000000000..424eb89ad --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java @@ -0,0 +1,57 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tScopeEvents complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tScopeEvents">
    + *   <complexContent>
    + *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tScopeEvents") +public class TScopeEvents extends TEnableEventList { + + @XmlAttribute(required = true) + protected String name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TService.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TService.java new file mode 100644 index 000000000..22ab1a7c4 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TService.java @@ -0,0 +1,121 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tService complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tService">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="port" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tService", propOrder = {"any"}) +public class TService { + + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(required = true) + protected QName name; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String port; + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the any property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getAny().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (this.any == null) { + this.any = new ArrayList<>(); + } + return this.any; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(final QName value) { + this.name = value; + } + + /** + * Gets the value of the port property. + * + * @return possible object is {@link String } + */ + public String getPort() { + return this.port; + } + + /** + * Sets the value of the port property. + * + * @param value allowed object is {@link String } + */ + public void setPort(final String value) { + this.port = value; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/package-info.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/package-info.java new file mode 100644 index 000000000..5910f24b3 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/apache/ode/schemas/dd/_2007/_03/package-info.java @@ -0,0 +1,11 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.05.16 at 05:29:02 PM MESZ +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", + elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.apache.ode.schemas.dd._2007._03; diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/BpelPlanEnginePlugin.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/BpelPlanEnginePlugin.java new file mode 100644 index 000000000..539bc495c --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/BpelPlanEnginePlugin.java @@ -0,0 +1,365 @@ +package org.opentosca.container.engine.plan.plugin.bpel; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.wsdl.WSDLException; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerConfigurationException; + +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPlan.PlanModelReference; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.container.connector.ode.OdeConnector; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.impl.service.FileSystem; +import org.opentosca.container.core.model.AbstractArtifact; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.csar.backwards.ArtifactResolver; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService; +import org.opentosca.container.engine.plan.plugin.bpel.util.BPELRESTLightUpdater; +import org.opentosca.container.engine.plan.plugin.bpel.util.ODEEndpointUpdater; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.xml.sax.SAXException; + +/** + *

    + * This class implements functionality for deployment of WS-BPEL 2.0 Processes through the {@link + * IPlanEnginePlanRefPluginService} unto a WSO2 Business Process Server or Apache Orchestration Director Engine (ODE). + *

    + *

    + * The class is the highlevel control of the plugin. It uses the classes {@link BPELRESTLightUpdater} to update + * BPEL4RESTLight (see: OpenTOSCA/trunk/examples/org.opentosca.bpel4restlight.bpelextension) extension activities with + * up-to-date endpoints. The plugin also uses {@link ODEEndpointUpdater} to update the bindings inside the used WSDL + * Descriptions referenced in the BPEL process. + *

    + * The endpoints for the update are retrieved through a service that implements the {@link ICoreEndpointService} + * interface. + *

    + *

    + * The actual deployment is done on the endpoint given in the properties. The plugin uses the {@link OdeConnector} class + * to deploy the updated plan unto the Apache ODE behind the endpoint. + *

    + * + * @see BPELRESTLightUpdater + * @see ODEEndpointUpdater + * @see OdeConnector + * @see ICoreEndpointService + */ +@NonNullByDefault +@Service +public class BpelPlanEnginePlugin implements IPlanEnginePlanRefPluginService { + + public static final String BPS_ENGINE = "BPS"; + + private static final Logger LOG = LoggerFactory.getLogger(BpelPlanEnginePlugin.class); + private static final String DEFAULT_ENGINE_URL = "http://localhost:9763/ode"; + private static final String DEFAULT_ENGINE = "ODE"; + private static final String DEFAULT_SERVICE_URL = "http://localhost:9763/ode/processes"; + private static final String DEFAULT_ENGINE_LANGUAGE = "http://docs.oasis-open.org/wsbpel/2.0/process/executable"; + + private final String processEngine; + private final String username; + private final String password; + private final String url; + private final String servicesUrl; + + private final ICoreEndpointService endpointService; + private final CsarStorageService storage; + + @Inject + public BpelPlanEnginePlugin(ICoreEndpointService endpointService, CsarStorageService storage) { + this.endpointService = endpointService; + this.storage = storage; + + this.processEngine = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.engine", DEFAULT_ENGINE); + this.url = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.url", DEFAULT_ENGINE_URL); + this.servicesUrl = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.services.url", DEFAULT_SERVICE_URL); + this.username = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.username", ""); + this.password = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.password", ""); + } + + /** + * {@inheritDoc} + */ + @Override + public String getLanguageUsed() { + return DEFAULT_ENGINE_LANGUAGE; + } + + /** + * {@inheritDoc} + */ + @Override + public List getCapabilties() { + final List capabilities = new ArrayList<>(); + for (final String capability : "http://docs.oasis-open.org/wsbpel/2.0/process/executable".split("[,;]")) { + capabilities.add(capability.trim()); + } + return capabilities; + } + + public boolean deployPlanFile(final Path planLocation, final CsarId csarId, final QName planId, Map endpointMetadata) { + final List planContents; + Path tempDir = null; + try { + // creating temporary dir for update + tempDir = FileSystem.getTemporaryFolder(); + LOG.debug("Unzipping Plan '{}' to '{}'.", planLocation.getFileName().toString(), tempDir.toAbsolutePath().toString()); + planContents = FileSystem.unzip(planLocation, tempDir).parallelStream() + .map(Path::toFile) + .collect(Collectors.toList()); + } catch (IOException e) { + LOG.warn("Could not unzip plan from {} to {} due to an exception", planLocation.toString(), tempDir, e); + return false; + } + + Path tempPlan = tempDir.resolve(planLocation.getFileName()); + // changing endpoints in WSDLs + ODEEndpointUpdater odeUpdater; + // variable for the (inbound) portType of the process, if this is null + // till end the process can't be instantiated by the container + QName portType = null; + try { + odeUpdater = new ODEEndpointUpdater(servicesUrl, processEngine, endpointService); + portType = odeUpdater.getPortType(planContents); + if (!odeUpdater.changeEndpoints(planContents, csarId)) { + LOG.error("Not all endpoints used by the plan {} have been changed", + planLocation); + } + } catch (final WSDLException e) { + LOG.error("Couldn't load ODEEndpointUpdater", e); + } + + // update the bpel and bpel4restlight elements (ex.: GET, PUT,..) + BPELRESTLightUpdater bpelRestUpdater; + try { + bpelRestUpdater = new BPELRESTLightUpdater(endpointService); + if (!bpelRestUpdater.changeEndpoints(planContents, csarId)) { + // we don't abort deployment here + LOG.warn("Couldn't change all endpoints inside BPEL4RESTLight Elements in the given process {}", planLocation); + } + } catch (final TransformerConfigurationException e) { + LOG.error("Couldn't load BPELRESTLightUpdater transformer", e); + } catch (final ParserConfigurationException e) { + LOG.error("Couldn't load BPELRESTLightUpdaters parser", e); + } catch (final SAXException e) { + LOG.error("ParseError: Couldn't parse .bpel file", e); + } catch (final IOException e) { + LOG.error("IOError: Couldn't access .bpel file", e); + } + + // package process + LOG.info("Prepare deployment of PlanModelReference"); + + try { + Files.createFile(tempPlan); + // package the updated files + LOG.debug("Packaging plan to {} ", tempPlan.toAbsolutePath().toString()); + FileSystem.zip(tempPlan, tempDir); + } catch (final IOException e) { + LOG.error("Can't package temporary plan for deployment", e); + return false; + } + + // deploy process + LOG.info("Deploying Plan: {}", tempPlan.getFileName().toString()); + String processId = ""; + Map endpoints = Collections.emptyMap(); + try { + if (processEngine.equalsIgnoreCase(BPS_ENGINE)) { + LOG.error("BPS ENGINE IS NO LONGER SUPPORTED!!"); + } else { + final OdeConnector connector = new OdeConnector(); + processId = connector.deploy(tempPlan.toFile(), url); + endpoints = connector.getEndpointsForPID(processId, url); + } + } catch (final Exception e) { + e.printStackTrace(); + } + + // this will be the endpoint the container can use to instantiate the + // BPEL Process + URI endpoint = null; + if (endpoints.keySet().size() == 1) { + endpoint = (URI) endpoints.values().toArray()[0]; + } else { + for (final String partnerLink : endpoints.keySet()) { + if (partnerLink.equals("client")) { + endpoint = endpoints.get(partnerLink); + } + } + } + + if (endpoint == null) { + return false; + } + + if (processId == null || endpoint == null || portType == null || this.endpointService == null) { + LOG.error("Error while processing plan"); + if (processId == null) { + LOG.error("ProcessId is null"); + } + if (endpoint == null) { + LOG.error("Endpoint for process is null"); + } + if (portType == null) { + LOG.error("PortType of process is null"); + } + + if (this.endpointService == null) { + LOG.error("Endpoint Service is null"); + } + return false; + } + LOG.debug("Endpoint for ProcessID \"" + processId + "\" is \"" + endpoints + "\"."); + LOG.info("Deployment of Plan was successfull: {}", tempPlan.getFileName().toString()); + + // save endpoint + final String localContainer = Settings.OPENTOSCA_CONTAINER_HOSTNAME; + final WSDLEndpoint wsdlEndpoint = + new WSDLEndpoint(endpoint, portType, localContainer, localContainer, csarId, null, planId, null, null, endpointMetadata); + this.endpointService.storeWSDLEndpoint(wsdlEndpoint); + + return true; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean deployPlanReference(final QName planId, final PlanModelReference planRef, final CsarId csarId) { + + if (storage == null) { + LOG.error("Can't fetch relevant Csar from storage: StorageService not available"); + return false; + } + + Path planLocation = planLocationOnDisk(csarId, planId, planRef); + if (planLocation == null) { + // diagnostics already in planLocationOnDisk + return false; + } + + return this.deployPlanFile(planLocation, csarId, planId, new HashMap()); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean undeployPlanReference(final QName planId, final PlanModelReference planRef, final CsarId csarId) { + // retrieve process + Path planLocation = planLocationOnDisk(csarId, planId, planRef); + if (planLocation == null) { + // diagnostics already in planLocationOnDisk + return false; + } + + boolean wasUndeployed = false; + if (processEngine.equalsIgnoreCase(BPS_ENGINE)) { + LOG.error("BPS Engine is no longer supported"); + } else { + final OdeConnector connector = new OdeConnector(); + wasUndeployed = connector.undeploy(planLocation.toFile(), url); + } + + // remove endpoint from core + if (this.endpointService != null) { + LOG.debug("Starting to remove endpoint!"); + WSDLEndpoint endpoint = this.endpointService.getWSDLEndpointForPlanId(Settings.OPENTOSCA_CONTAINER_HOSTNAME, csarId, planId); + if (endpoint == null) { + LOG.warn("Couldn't remove endpoint for plan {}, because endpoint service didn't find any endpoint associated with the plan to remove", + planRef.getReference()); + } else if (this.endpointService.removeWSDLEndpoint(endpoint)) { + LOG.debug("Removed endpoint {} for plan {}", endpoint.toString(), + planRef.getReference()); + } + } else { + LOG.warn("Couldn't remove endpoint for plan {}, cause endpoint service is not available", + planRef.getReference()); + } + + if (wasUndeployed) { + LOG.info("Undeployment of Plan " + planRef.getReference() + " was successful"); + } else { + LOG.warn("Undeployment of Plan " + planRef.getReference() + " was unsuccessful"); + } + return wasUndeployed; + } + + @Nullable + private Path planLocationOnDisk(CsarId csarId, QName planId, PlanModelReference planRef) { + if (storage == null) { + return null; + } + @SuppressWarnings("null") // ignore MT implications + Csar csar = storage.findById(csarId); + TPlan toscaPlan; + try { + toscaPlan = ToscaEngine.resolvePlanReference(csar, planId); + } catch (NotFoundException e) { + LOG.error("Plan [{}] could not be found in csar {}", planId, csarId.csarName()); + return null; + } + TServiceTemplate containingServiceTemplate = ToscaEngine.getContainingServiceTemplate(csar, toscaPlan); + assert (containingServiceTemplate != null); // shouldn't be null, since we have a plan from it + + // planRef.getReference() is overencoded. It's also not relative to the Csar root (but to one level below it) + Path planLocation = ArtifactResolver.resolvePlan.apply(containingServiceTemplate, toscaPlan); + // FIXME get rid of AbstractArtifact! + AbstractArtifact planReference = ArtifactResolver.resolveArtifact(csar, planLocation, + // just use the last segment, determining the filename. + Paths.get(planRef.getReference().substring(planRef.getReference().lastIndexOf('/') + 1))); + if (planReference == null) { + LOG.error("Plan reference '{}' resulted in a null ArtifactReference.", + planRef.getReference()); + return null; + } + if (!planReference.isFileArtifact()) { + LOG.warn("Only plan references pointing to a file are supported!"); + return null; + } + Path artifact; + try { + artifact = planReference.getFile("").getFile(); + } catch (SystemException e) { + LOG.warn("ugh... SystemException when getting a path we already had", e); + return null; + } + if (!artifact.getFileName().toString().endsWith(".zip")) { + LOG.debug("Plan reference is not a ZIP file. It was '{}'.", artifact.getFileName()); + return null; + } + return artifact; + } + + @Override + public String toString() { + return "openTOSCA PlanEngine WS-BPEL 2.0 Plugin v1.0"; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElement.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElement.java similarity index 95% rename from org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElement.java rename to org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElement.java index 88351580c..64fc0afaf 100644 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElement.java +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElement.java @@ -17,11 +17,13 @@ import org.w3c.dom.Node; /** - * This class provides a mapping between Java and BPEL4RESTLight XML elements. It provides - * funtionality conform to the rules in BPELRESTLightUpdater when updating URIs on the DOM Nodes. + * This class provides a mapping between Java and BPEL4RESTLight XML elements. It provides funtionality conform to the + * rules in BPELRESTLightUpdater when updating URIs on the DOM Nodes. */ public class BPELRESTLightElement { + private final static Logger LOG = LoggerFactory.getLogger(BPELRESTLightUpdater.class); + private BPELRESTLightElementType type; private Node parentNode; private final Node uriNode; @@ -30,9 +32,6 @@ public class BPELRESTLightElement { private int firstVarPos; private URIFormatType uriType = null; - private final static Logger LOG = LoggerFactory.getLogger(BPELRESTLightUpdater.class); - - /** *

    * This exception informs about what went wrong when initialzing BPELRESTLightElements fails @@ -41,13 +40,11 @@ public class BPELRESTLightElement { *
    * * @author kepeskn@studi.informatik.uni-stuttgart.de - * */ public class NoBPELRESTLightElementException extends Exception { private static final long serialVersionUID = 900021575519412804L; - private NoBPELRESTLightElementException(final String msg) { super(msg); } @@ -61,7 +58,6 @@ protected enum URIFormatType { PLAINURI, BPELVAR, BOTH } - /** *

    * Conctructor for BPELRESTLightElement. @@ -82,8 +78,8 @@ protected enum URIFormatType { *

    * * @param node the node to embed in this BPELRESTLightElement - * @throws NoBPELRESTLightElementException when the given node isn't a extension activity from - * BPEL4RESTLight ODE Extension conforming the above rules + * @throws NoBPELRESTLightElementException when the given node isn't a extension activity from BPEL4RESTLight ODE + * Extension conforming the above rules */ protected BPELRESTLightElement(final Node node) throws NoBPELRESTLightElementException { BPELRESTLightElement.LOG.debug("Checking node with name {} ", node.getLocalName()); @@ -122,9 +118,7 @@ protected BPELRESTLightElement(final Node node) throws NoBPELRESTLightElementExc try { BPELRESTLightElement.LOG.debug("Retrieving uri attribute value"); temp = this.uriNode.getNodeValue(); - - } - catch (final DOMException e) { + } catch (final DOMException e) { throw new NoBPELRESTLightElementException("Can't process node: Retrieving node attribute uri failed"); } this.setURIFormatType(temp); @@ -133,8 +127,7 @@ protected BPELRESTLightElement(final Node node) throws NoBPELRESTLightElementExc /** * Returns the URI of this element * - * @return a URI. The uri can be just a part of the real URI value in the DOM if it contains - * $bpelvar[bpelVariable] + * @return a URI. The uri can be just a part of the real URI value in the DOM if it contains $bpelvar[bpelVariable] */ public URI getURI() { switch (this.uriType) { @@ -143,8 +136,7 @@ public URI getURI() { case BOTH: try { return new URI(this.getURIPart()); - } - catch (final URISyntaxException e) { + } catch (final URISyntaxException e) { BPELRESTLightElement.LOG.error("Internal Error: Stored URI was invalid", e); } default: @@ -156,8 +148,8 @@ public URI getURI() { * Sets the URI. The URI MUST not be relative * * @param uri the absolute URI to set - * @throws URISyntaxException if assembling the new URI failed * @return true if changing was successful, else false + * @throws URISyntaxException if assembling the new URI failed */ protected boolean setURI(final URI uri) throws URISyntaxException { String oldURI; @@ -220,8 +212,8 @@ private void setURIPart(final String newURIPart) { * Determines the type of the uri value of the node this BPELRESTLightElement has to manage * * @param value the pure uri value inside the DOM node - * @throws NoBPELRESTLightElementException whenever the uri value doesn't apply to rules specified - * for BPEL4RESTLight elements + * @throws NoBPELRESTLightElementException whenever the uri value doesn't apply to rules specified for + * BPEL4RESTLight elements */ private void setURIFormatType(String value) throws NoBPELRESTLightElementException { BPELRESTLightElement.LOG.debug("Checking uri type in node attribute"); @@ -268,8 +260,7 @@ private void setURIFormatType(String value) throws NoBPELRESTLightElementExcepti // checking if uri in value is valid try { temp = new URI(value); - } - catch (final URISyntaxException e) { + } catch (final URISyntaxException e) { BPELRESTLightElement.LOG.debug("Node attribute value is false: URI syntax exception"); throw new NoBPELRESTLightElementException( "Node isn't a valid BPEL4RESTLight Element: The URI in uri attribute is fraud", e); @@ -292,7 +283,6 @@ private void setURIFormatType(String value) throws NoBPELRESTLightElementExcepti } else { BPELRESTLightElement.LOG.debug("Node attribute contains bpelvar[] keyword: string before keyword is a valid uri"); } - } /** @@ -352,8 +342,7 @@ public String toString() { t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); t.setOutputProperty(OutputKeys.INDENT, "yes"); t.transform(new DOMSource(this.parentNode), new StreamResult(sw)); - } - catch (final TransformerException te) { + } catch (final TransformerException te) { System.out.println("nodeToString Transformer Exception"); } return sw.toString(); diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElementType.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElementType.java similarity index 100% rename from org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElementType.java rename to org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightElementType.java diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightUpdater.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightUpdater.java new file mode 100644 index 000000000..db20c68b0 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightUpdater.java @@ -0,0 +1,321 @@ +package org.opentosca.container.engine.plan.plugin.bpel.util; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +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; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +/** + * This class provides functionality for updating BPEL4RESTLight Elements inside a WSBPEL 2.0 file. + *

    + * BPEL4RESTLight elements are extension activities defined by the ODE Extension BPEL4RESTLight (see: + * OpenTOSCA/trunk/plans/odeextensions). These must have URI attribute which represent endpoints for http requests but + * maybe have to be updated. + *

    + * This class maps BPEL4RESTLight XML elements into BPELRESTLightElement objects and operates on them for the updates. + *

    + * Rules for update: + *

  • 1. The uri is absolute -> no update. This is because we need to have the ability to use URIs + * like amazon.com + *
  • 2. The uri is relative -> update. Relative URIs are updated if an endpoint exists in the + * openTOSCA Core for the referenced HTTP service. + *
  • 3. The uri is a $bpelvar[varname] construct -> no update. + *
  • 4. The uri is a mix of 1 and 3 or 2 and 3. The class tries to cut out bpelVar part and checks + * if URI is a URI in first place and if it is relative or absolute, then the above rules are tried to apply + * + * @See org.opentosca.container.engine.plan.plugin.bpel.util.BPEL4RESTLightElement + * @See org.opentosca.container.engine.plan.plugin.bpel.util.BPEL4RESTLightElementType + */ +@NonNullByDefault +public class BPELRESTLightUpdater { + + private final static Logger LOG = LoggerFactory.getLogger(BPELRESTLightUpdater.class); + + private final ICoreEndpointService endpointService; + private final DocumentBuilder builder; + private final DocumentBuilderFactory domFactory; + private final XPathFactory factory; + private final TransformerFactory transformerFactory; + private final Transformer transformer; + + // not injected because instance-creation is manual + public BPELRESTLightUpdater(ICoreEndpointService endpointService) throws ParserConfigurationException, TransformerConfigurationException { + // initialize parsers + this.endpointService = endpointService; + this.domFactory = DocumentBuilderFactory.newInstance(); + this.domFactory.setNamespaceAware(true); + this.builder = this.domFactory.newDocumentBuilder(); + this.factory = XPathFactory.newInstance(); + this.transformerFactory = TransformerFactory.newInstance(); + this.transformer = this.transformerFactory.newTransformer(); + } + + /** + *

    + * Changes endpoints (URIs) inside the given BPEL file. If the bpel file contains somewhere the tag {OPENTOSCA} the + * tag will be replaced by the actual host of the container + *

    + *

    + * If the BPEL file contains elements of BPEL4RESTLight (GET, PUT, POST, DELETE) it will check if the given URIs are + * services contained in the endpoint service and change them accordingly + *

    + * + * @param processFiles a list of files containing the complete content of a Apache ODE WS-BPEL 2.0 zip file + * @param csarId a identifier of the CSAR this BPEL file belongs to + * @return true only if some change was made + * @throws IOException is thrown when access of BPEL file failed + * @throws SAXException is thrown when parsing of BPEL file failed + */ + public boolean changeEndpoints(final List processFiles, final CsarId csarId) throws IOException, + SAXException { + final File bpelFile = getBPELFile(processFiles); + + if (bpelFile == null) { + LOG.debug("No bpel file found"); + return false; + } + + LOG.debug("Parsing bpel file {} ", bpelFile.getAbsoluteFile()); + final Document document = this.builder.parse(bpelFile); + + // get the elements + final List elements = getAllBPELRESTLightElements(document); + + final Set localURIs = getRESTURI(elements); + final Set notChanged = new HashSet<>(); + + for (final URI localUri : localURIs) { + for (final RESTEndpoint endpoint : endpointService.getRestEndpoints(localUri, Settings.OPENTOSCA_CONTAINER_HOSTNAME, csarId)) { + notChanged.addAll(changeAddress(endpoint, elements)); + } + } + + if (notChanged.isEmpty()) { + final DOMSource source = new DOMSource(document); + final StreamResult result = new StreamResult(bpelFile); + boolean wroteFile = false; + try { + this.transformer.transform(source, result); + wroteFile = true; + } catch (final TransformerException e) { + wroteFile = false; + } + + return wroteFile; + } else { + // log couldn't change all uris inside bpel --> isn't valid anymore + LOG.warn("Chouldn't change all URIs in bpel file"); + for (final BPELRESTLightElement element : notChanged) { + LOG.warn("Could'nt change address in element {}", element.toString()); + } + + // just return true + return true; + } + } + + /** + * Retrieves all BPEL4RESTLight elements in the given DOM document. + * + * @param document the DOM document to look in + * @return a List of BPELRESTLightElements + */ + public List getAllBPELRESTLightElements(final Document document) { + LOG.debug("Retrieving all BPEL4RESTLight elements"); + LOG.debug("Retrieving PUT elements"); + final List elements = getBPELRESTLightElements(BPELRESTLightElementType.PUT, document); + LOG.debug("Retrieving POST elements"); + elements.addAll(getBPELRESTLightElements(BPELRESTLightElementType.POST, document)); + LOG.debug("Retrieving GET elements"); + elements.addAll(getBPELRESTLightElements(BPELRESTLightElementType.GET, document)); + LOG.debug("Retrieving DELETE elements"); + elements.addAll(getBPELRESTLightElements(BPELRESTLightElementType.DELETE, document)); + return elements; + } + + /** + * Retrieves all BPEL4RESTLight elements of the given type (GET,PUT,POST,DELETE) + * + * @param type BPELRESTLightElementType to parse for + * @param document the DOM document to look in + * @return a List containing all elements of the given type + */ + private List getBPELRESTLightElements(final BPELRESTLightElementType type, + final Document document) { + String xpathExp = ""; + // using straight forward xpath expressions + // TODO do with namespace check + switch (type) { + case PUT: + xpathExp = "//*[local-name()='PUT']"; + break; + case POST: + xpathExp = "//*[local-name()='POST']"; + break; + case DELETE: + xpathExp = "//*[local-name()='DELETE']"; + break; + case GET: + xpathExp = "//*[local-name()='GET']"; + break; + } + final List elements = new LinkedList<>(); + NodeList result = null; + + final XPath xpath = this.factory.newXPath(); + XPathExpression expr; + try { + LOG.debug("Querying document with {} ", xpathExp); + expr = xpath.compile(xpathExp); + result = (NodeList) expr.evaluate(document, XPathConstants.NODESET); + } catch (final XPathExpressionException e) { + LOG.error("Internal Error: XPath expression wasn't valid", e); + } + LOG.debug("Found Elements: {} ", String.valueOf(result.getLength())); + for (int i = 0; i < result.getLength(); i++) { + // in this block the BPELRESTLightElement class assures that we + // change only elements which should be changed. + // the rules for this are written in the header of this class + BPELRESTLightElement element = null; + try { + final Node node = result.item(i); + element = new BPELRESTLightElement(node); + } catch (final org.opentosca.container.engine.plan.plugin.bpel.util.BPELRESTLightElement.NoBPELRESTLightElementException e) { + LOG.warn(e.getMessage()); + } finally { + if (element != null) { + // adding element which can and should be changed to the + // list + elements.add(element); + } + } + } + return elements; + } + + /** + * Returns the URIs of the given BPELRESTLight elements + * + * @param elements a list of BPELRESTLight elements + * @return a set of URIs + */ + private Set getRESTURI(final List elements) { + // set is used to achieve that endpoint fetching is more efficient + final Set uris = new HashSet<>(); + for (final BPELRESTLightElement element : elements) { + if (element.getURI() != null) { + uris.add(element.getURI()); + } + } + return uris; + } + + /** + * Changes the URI in the given BPELRESTLight elements + * + * @param endpoint an endpoint with the uri + * @param elements a list of BPELRESTLight elements + * @return a list of NOT changed elements, if list is empty every element was changed + */ + private Set changeAddress(final RESTEndpoint endpoint, + final List elements) { + final List toRemove = new LinkedList<>(); + final Set notChanged = new HashSet<>(); + for (final BPELRESTLightElement element : elements) { + // the following check is pretty unstable, if the path isn't exactly + // the same. this could really happen if the service was deployed in + // some "nested" environment. + // Example: + // {serviceroot}/{somepath} are URIs of the REST service and after + // deployment the endpoint is + // host/someotherpath/{serviceroot}/{somepath} + // the path method would return + // someotherpath/{serviceroot}/{somepath} + // which isn't equal to {serviceroot}/{somepath} + final String endpointPath = normalizePath(endpoint.getURI().getPath()); + final String elementPath = normalizePath(element.getURI().getPath()); + if (endpointPath.equals(elementPath)) { + try { + LOG.debug("Setting address in bpel4RestLight element "); + if (element.setURI(endpoint.getURI())) { + toRemove.add(element); + } + } catch (final URISyntaxException e) { + LOG.debug("Setting address failed (URISyntaxException): URI {}", + endpoint.getURI().toString()); + } + } + } + // remove changed elements + elements.removeAll(toRemove); + // return as set for uniqueness + notChanged.addAll(elements); + return notChanged; + } + + /** + * Adds Slashes ('/') at beginning and end of the given string + * + * @param path The String to modify + * @return returns a String where String.charAt(0) == '/' and String.charAt(String.length() - 1) == '/' + */ + private String normalizePath(final String path) { + String temp = path; + if (path.charAt(0) != '/') { + temp = "/" + path; + } + if (path.charAt(path.length() - 1) != '/') { + temp = temp + "/"; + } + return temp; + } + + /** + * Looks for the first BPEL file it finds in the given list + * + * @param files a list of files + * @return file which ends with .bpel, else null + */ + private File getBPELFile(final List files) { + for (final File file : files) { + final int pos = file.getName().lastIndexOf('.'); + if (pos > 0 && pos < file.getName().length() - 1) { + if (file.getName().substring(pos + 1).equals("bpel")) { + return file; + } + } + } + return null; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/ODEEndpointUpdater.java b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/ODEEndpointUpdater.java new file mode 100644 index 000000000..56f137866 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.bpel/src/main/java/org/opentosca/container/engine/plan/plugin/bpel/util/ODEEndpointUpdater.java @@ -0,0 +1,625 @@ +package org.opentosca.container.engine.plan.plugin.bpel.util; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.PortType; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.extensions.ExtensibilityElement; +import javax.wsdl.extensions.http.HTTPAddress; +import javax.wsdl.extensions.soap.SOAPAddress; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.namespace.QName; +import javax.xml.transform.stream.StreamSource; + +import com.ibm.wsdl.extensions.http.HTTPConstants; +import com.ibm.wsdl.extensions.soap.SOAPConstants; +import org.apache.ode.schemas.dd._2007._03.TDeployment; +import org.apache.ode.schemas.dd._2007._03.TInvoke; +import org.apache.ode.schemas.dd._2007._03.TProvide; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.opentosca.container.engine.plan.plugin.bpel.BpelPlanEnginePlugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + *

    + * This class implements functionality for updating bindings inside wsdl files which are referenced inside a Apache ODE + * deloy.xml file. + *

    + *

    + * The update is done on a list of files which must include one deploy.xml file (schema: + * http://svn.apache.org/viewvc/ode/trunk/bpel-schemas/src/main/xsd/) and wsdl files which are referenced inside the + * deploy.xml. + *

    + *

    + * This class uses the ICoreEndpointService to get the up-to-date endpoints from the openTOSCA Core + *

    + * + *
    + * Copyright 2012 IAAS University of Stuttgart
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + * @see org.opentosca.container.core.service.ICoreEndpointService + * @see org.apache.ode.schemas.dd._2007._03.TDeployment + */ +public class ODEEndpointUpdater { + + private static final Logger LOG = LoggerFactory.getLogger(ODEEndpointUpdater.class); + + private final WSDLFactory factory; + + private CsarId csarId; + private final String servicesRoot; + private ICoreEndpointService endpointService; + + // @hahnml: The type of plan engine used (BPS or ODE) + private String engineType; + + // private static IToscaEngineService toscaEngineService = null; + + /** + * Contructor * + * + * @throws WSDLException if no instance of WSDLFactory was found + */ + public ODEEndpointUpdater(final String servicesRoot, final String engineType, ICoreEndpointService endpointService) throws WSDLException { + this.factory = WSDLFactory.newInstance(); + this.servicesRoot = servicesRoot; + this.engineType = engineType; + this.endpointService = endpointService; + } + + /** + * Changes the endpoints of all WSDL files used by the given WS-BPEL 2.0 Process + * + * @param processFiles a list of files containing the complete content of a Apache ODE WS-BPEL 2.0 zip file + * @param csarId the identifier of the CSAR where this process/plan is declared + * @return true if every WSDL file used by the process was updated (if needed) with endpoints from the openTOSCA + * Core, else false + */ + public boolean changeEndpoints(final List processFiles, final CsarId csarId) { + this.csarId = csarId; + + final Map> unchangedFiles = new HashMap<>(); + final File deployXml = getDeployXML(processFiles); + + if (deployXml == null) { + LOG.error("Given BPEL Plan has no deploy.xml file! Can't change addresses!"); + return false; + } + + // update addresses inside the process archive that are invoked by the plan + try { + final List portsInDeployXml = getInvokedDeployXMLPorts(deployXml); + // check with modelrepo if any of the qnames have to be thrown out + // cause they aren't referenced in the CSAR/TOSCA + if (!portsInDeployXml.isEmpty()) { + for (final QName portType : portsInDeployXml) { + LOG.debug("Proceeding to update address for portType: {}", portType); + } + final Map> changeMap = + getWSDLtoChange(portsInDeployXml, getAllWSDLFiles(processFiles)); + unchangedFiles.putAll(this.updateInvokedWSDLAddresses(changeMap)); + } else { + LOG.debug("No PortTypes to change were found: No portType in plan is referenced in ServiceTemplate"); + } + } catch (final JAXBException e) { + LOG.error("Deploy.xml file in process isn't valid", e); + } catch (final WSDLException e) { + LOG.error("Couldn't access wsdl files of process", e); + } + + // update addresses in bpel archive that are provided by the plan + try { + final List portsInDeployXml = getProvidedDeployXMLPorts(deployXml); + + final Map> changeMap = getWSDLtoChange(portsInDeployXml, getAllWSDLFiles(processFiles)); + unchangedFiles.putAll(this.updateProvidedWSDLAddresses(changeMap)); + } catch (final JAXBException e) { + e.printStackTrace(); + } catch (final WSDLException e) { + e.printStackTrace(); + } + + for (final QName portType : unchangedFiles.keySet()) { + LOG.warn("Following files weren't changed for PortType {}", portType.toString()); + for (final File file : unchangedFiles.get(portType)) { + LOG.warn("WSDL file {} which contained portType {} and couldn't be updated", + file.toPath().toString(), portType.toString()); + } + } + + // as of recent events, when some address couldn't be changed we return + // true, even if nothing was changed + return true; + } + + /** + * Returns a file named deploy.xml,if it is in the list of files + * + * @param files a list of files + * @return a file object of a deploy.xml (can be invalid) file if it was found in the given list, else null + */ + private File getDeployXML(final List files) { + for (final File file : files) { + if (file.getName().equals("deploy.xml")) { + LOG.debug("Found deploy.xml file"); + return file; + } + } + LOG.debug("Didn't find deploy.xml file"); + return null; + } + + /** + * Returns a list of QName's which are referenced in the ODE deploy.xml File as invoked service.
    + * + * @param deployXML a file object of a valid deploy.xml File + * @return a list of QNames which represent the PortTypes used by the BPEL process to invoke operations + * @throws JAXBException if the JAXB parser couldn't work properly + */ + private List getInvokedDeployXMLPorts(final File deployXML) throws JAXBException { + // http://svn.apache.org/viewvc/ode/trunk/bpel-schemas/src/main/xsd/ + // grabbed that and using jaxb + final List qnames = new LinkedList<>(); + final JAXBContext context = + JAXBContext.newInstance("org.apache.ode.schemas.dd._2007._03", this.getClass().getClassLoader()); + final Unmarshaller unmarshaller = context.createUnmarshaller(); + final TDeployment deploy = unmarshaller.unmarshal(new StreamSource(deployXML), TDeployment.class).getValue(); + for (final org.apache.ode.schemas.dd._2007._03.TDeployment.Process process : deploy.getProcess()) { + for (final TInvoke invoke : process.getInvoke()) { + final QName serviceName = invoke.getService().getName(); + // add only qnames which aren't from the plan itself + if (!serviceName.getNamespaceURI().equals(process.getName().getNamespaceURI())) { + qnames.add(new QName(serviceName.getNamespaceURI(), invoke.getService().getPort())); + } + } + } + return qnames; + } + + /** + * Returns a List of Services referenced in the provide elements of the given deploy.xml file + * + * @param deployXML a Apache ODE deploy.xml file + * @return a List of QNames denoting services + * @throws JAXBException is thrown when the given file can't be parsed + */ + private List getProvidedDeployXMLPorts(final File deployXML) throws JAXBException { + final List ports = new ArrayList<>(); + final JAXBContext context = + JAXBContext.newInstance("org.apache.ode.schemas.dd._2007._03", this.getClass().getClassLoader()); + final Unmarshaller unmarshaller = context.createUnmarshaller(); + final TDeployment deploy = unmarshaller.unmarshal(new StreamSource(deployXML), TDeployment.class).getValue(); + for (final org.apache.ode.schemas.dd._2007._03.TDeployment.Process process : deploy.getProcess()) { + for (final TProvide provide : process.getProvide()) { + final QName serviceName = provide.getService().getName(); + // add only qnames which aren't from the plan itself + + // @hahnml: The plan generator assigns to provided services addresses like + // http://[IP]:8080 + // which is fine for WSO2 BPS but won't work for Apache ODE. ODE rejects the + // deployment if the service addresses do not follow the following schema: + // http://[IP]:[Port]/ode/processes/[ServiceName]. + // Added an engine type check so that for ODE, also the provided process service + // ports are added. + if (this.engineType.equals(BpelPlanEnginePlugin.BPS_ENGINE)) { + if (!serviceName.getNamespaceURI().equals(process.getName().getNamespaceURI())) { + ports.add(new QName(serviceName.getNamespaceURI(), provide.getService().getPort())); + } + } else { + ports.add(new QName(serviceName.getNamespaceURI(), provide.getService().getPort())); + } + } + } + return ports; + } + + /** + * Returns all WSDL files of the given List + * + * @param files a list of files + * @return a list of WSDL files if there are any + */ + private List getAllWSDLFiles(final List files) { + final List tempFiles = new LinkedList<>(); + for (final File file : files) { + if (file.isDirectory()) { + // recursive call to allow searching in directories + LOG.debug("Found directory inside bpel archive: {}", file.getAbsolutePath()); + final File[] subFiles = file.listFiles(); + // this is just here to transform the array to a list + final List temp = new LinkedList<>(); + for (final File subFile : subFiles) { + temp.add(subFile); + } + tempFiles.addAll(getAllWSDLFiles(temp)); + } + final int pos = file.getName().lastIndexOf('.'); + if (pos > 0 && pos < file.getName().length() - 1) { + if (file.getName().substring(pos + 1).equals("wsdl")) { + LOG.debug("Adding .wsdl file {} ", file.getName()); + tempFiles.add(file); + } + } + } + return tempFiles; + } + + /** + * Returns a map with QNames as keys and list of files as values, where the QNames are taken out of the given list + * of portTypes and the files from the other given List + * + * @param ports a list of portType QName's + * @param wsdlFiles a list of wsdl Files + * @return a Map> containing information which porttype is in which wsdl file + */ + private Map> getWSDLtoChange(final List ports, + final List wsdlFiles) throws WSDLException { + final Map> portTypeToFileMap = new HashMap<>(); + // we check if we have any porttypes which isn't in the endpoint db + for (final QName port : ports) { + LOG.debug("Searching through wsdls for porttype: {}", port.toString()); + final List filesContainingPortType = new LinkedList<>(); + QName portType = null; + for (final File wsdlFile : wsdlFiles) { + LOG.debug("Checking if wsdl file {} contains portType {}", + wsdlFile.getAbsolutePath(), port.toString()); + final Definition wsdlDef = getWsdlReader().readWSDL(wsdlFile.getAbsolutePath()); + // check if port is in wsdl file + if (!checkIfPortIsInWsdlDef(port, wsdlDef)) { + continue; + } else { + portType = getPortTypeFromPort(port, wsdlDef); + } + + for (final Object obj : wsdlDef.getPortTypes().values()) { + final PortType portTypeInWsdl = (PortType) obj; + // TODO when axis1 service port and porttype have the same name, + // still don't know what the problem will be if it happens, + // cause i check only portTypes here + // please send me an email with the problem + if (portTypeInWsdl.getQName().toString().equals(portType.toString())) { + // this wsdl file contains the porttype + filesContainingPortType.add(wsdlFile); + } + } + } + if (!filesContainingPortType.isEmpty() && portType != null) { + // found wsdl files with this porttype + portTypeToFileMap.put(portType, filesContainingPortType); + } + } + return portTypeToFileMap; + } + + private WSDLReader getWsdlReader() { + WSDLReader reader = factory.newWSDLReader(); + reader.setFeature("javax.wsdl.verbose", false); + return reader; + } + + /** + * Returns a PortType as QName if the given port is defined inside the given WSDL Definition + * + * @param port the Port to check with as QName + * @param wsdlDef the WSDL Definition to look trough + * @return a QName representing the PortType implemented by the given Port if it was found inside the WSDL + * Definition, else null + */ + private QName getPortTypeFromPort(final QName port, final Definition wsdlDef) { + for (final Object serviceObj : wsdlDef.getServices().values()) { + final Service service = (Service) serviceObj; + for (final Object portObj : service.getPorts().values()) { + final Port wsdlPort = (Port) portObj; + if (wsdlPort.getName().equals(port.getLocalPart()) + && wsdlDef.getTargetNamespace().equals(port.getNamespaceURI())) { + return wsdlPort.getBinding().getPortType().getQName(); + } + } + } + return null; + } + + /** + * Checks whether the given Port is defined inside the given WSDL Definition + * + * @param port the Port to check with as QName + * @param wsdlDef the WSDL Definition to check in + * @return true if the Port is found inside the given WSDL Definition, else false + */ + private boolean checkIfPortIsInWsdlDef(final QName port, final Definition wsdlDef) { + for (final Object serviceObj : wsdlDef.getServices().values()) { + final Service service = (Service) serviceObj; + for (final Object portObj : service.getPorts().values()) { + final Port wsdlPort = (Port) portObj; + final String namespace = wsdlDef.getTargetNamespace(); + final String name = wsdlPort.getName(); + LOG.debug("Checking if port {} matches port with name {} and namespace {} ", + port.toString(), name, namespace); + if (name.equals(port.getLocalPart()) && namespace.equals(port.getNamespaceURI())) { + return true; + } + } + } + return false; + } + + private Map> updateProvidedWSDLAddresses(final Map> changeMap) throws WSDLException { + final Map> notChanged = new HashMap<>(); + for (final QName portType : changeMap.keySet()) { + final List notUpdateWSDLs = new ArrayList<>(); + + for (final File wsdlFile : changeMap.get(portType)) { + if (!this.updateProvidedWSDLAddresses(portType, wsdlFile)) { + notUpdateWSDLs.add(wsdlFile); + } + } + if (!notUpdateWSDLs.isEmpty()) { + notChanged.put(portType, notUpdateWSDLs); + } + } + return notChanged; + } + + /** + * Updates the addresses in the given WSDL files by using endpoints added in the endpoint db + * + * @param map a map containing > pairs. A QName here represents a portType that is inside the + * files + * @return returns a map > containing all the files which weren't changed + */ + private Map> updateInvokedWSDLAddresses(final Map> map) throws WSDLException { + final Map> notChanged = new HashMap<>(); + for (final QName portType : map.keySet()) { + final List notUpdatedWSDLs = new LinkedList<>(); + // update wsdl files associated with the given porttype + for (final File wsdlFile : map.get(portType)) { + if (!this.updateInvokedWSDLAddresses(portType, wsdlFile)) { + LOG.error("Unable to update '{}' for porttype '{}'.", wsdlFile.toString(), + portType.toString()); + notUpdatedWSDLs.add(wsdlFile); + } + } + if (!notUpdatedWSDLs.isEmpty()) { + // if empty, nothing was changed + LOG.debug("Couldn't update address for porttype: {}", portType.toString()); + notChanged.put(portType, notUpdatedWSDLs); + } + } + return notChanged; + } + + private boolean updateProvidedWSDLAddresses(final QName portType, final File wsdlFile) throws WSDLException { + boolean changed = false; + final Definition wsdlDef = getWsdlReader().readWSDL(wsdlFile.getAbsolutePath()); + for (final Object o : wsdlDef.getAllServices().values()) { + final Service service = (Service) o; + for (final Object obj : service.getPorts().values()) { + final Port port = (Port) obj; + if (port.getBinding().getPortType().getQName().equals(portType)) { + if (changePortAddressWithBpelEngineEndpoints(service, port)) { + changed = true; + } + } + } + } + try { + // if we changed something, rewrite the the wsdl + if (changed) { + this.factory.newWSDLWriter().writeWSDL(wsdlDef, new FileOutputStream(wsdlFile)); + } + } catch (final FileNotFoundException e) { + LOG.debug("Couldn't locate wsdl file", e); + changed = false; + } + return changed; + } + + /** + * Updates the addresses inside the given WSDL file by using endpoints inside the endpoint db + * + * @param portType a QName which represents a PortType + * @param wsdl a File which is from type .wsdl + * @throws WSDLException if the WSDL parser couldn't parse + */ + private boolean updateInvokedWSDLAddresses(final QName portType, final File wsdl) throws WSDLException { + boolean changed = false; + LOG.debug("Trying to change WSDL file {} ", wsdl.getName()); + final Definition wsdlDef = getWsdlReader().readWSDL(wsdl.getAbsolutePath()); + for (final Object o : wsdlDef.getAllServices().values()) { + // get the services + final Service service = (Service) o; + for (final Object obj : service.getPorts().values()) { + // get the ports of the service + final Port port = (Port) obj; + if (port.getBinding().getPortType().getQName().equals(portType)) { + // get binding and its porttype + // get the extensible elements out of wsdl and check them + // with endpointservice + + LOG.debug("Found matching porttype for WSDL file {} ", wsdl.getName()); + if (changePortAddressWithEndpointDB(port)) { + // changing -> success + changed = true; + } + } + } + } + try { + // if we changed something, rewrite the the wsdl + if (changed) { + this.factory.newWSDLWriter().writeWSDL(wsdlDef, new FileOutputStream(wsdl)); + } + } catch (final FileNotFoundException e) { + LOG.debug("Couldn't locate wsdl file", e); + changed = false; + } + return changed; + } + + private boolean changePortAddressWithBpelEngineEndpoints(final Service service, final Port port) { + boolean changed = false; + + for (final Object obj : port.getExtensibilityElements()) { + final ExtensibilityElement element = (ExtensibilityElement) obj; + for (final WSDLEndpoint endpoint : getWSDLEndpointForBpelEngineCallback(service, port)) { + if (changeAddress(element, endpoint)) { + changed = true; + } + } + } + + return changed; + } + + /** + * Changes address in the given port if endpoint in the endpoint service is available + * + * @param port the Port to update + * @return true if change was made, else false + */ + private boolean changePortAddressWithEndpointDB(final Port port) { + boolean changed = false; + + LOG.debug("Trying to match address element with available endpoints for port {} ", + port.getName()); + for (final Object obj : port.getExtensibilityElements()) { + // in the wsdl spec they use the extensibility mechanism + final ExtensibilityElement element = (ExtensibilityElement) obj; + for (final WSDLEndpoint endpoint : getWSDLEndpointsFromEndpointDB(port)) { + LOG.debug("Changing address for endpoint: {}", endpoint.getURI()); + if (changeAddress(element, endpoint)) { + changed = true; + } + } + } + return changed; + } + + private List getWSDLEndpointForBpelEngineCallback(final Service service, final Port port) { + final List endpoints = new ArrayList<>(); + + /* + * The WSO2 BPS and Apache ODE are creating addresses by using the Service Name + * OpenTOSCA_On_VSphere.csarInvokerService + * location="http://10.0.2.15:9763/services/OpenTOSCA_On_VSphere. csarInvokerService/ + * + * The only difference is the servicesRoot which is '/services/..' for BPS and + * '/ode/processes/..' for ODE. + */ + String callbackEndpoint = ""; + if (this.servicesRoot.endsWith("/")) { + callbackEndpoint += this.servicesRoot + service.getQName().getLocalPart(); + } else { + callbackEndpoint += this.servicesRoot + "/" + service.getQName().getLocalPart(); + } + + try { + final String localContainer = Settings.OPENTOSCA_CONTAINER_HOSTNAME; + endpoints.add(new WSDLEndpoint(new URI(callbackEndpoint), port.getBinding().getPortType().getQName(), + localContainer, localContainer, null, null, null, null, null, new HashMap<>())); + } catch (final URISyntaxException e) { + e.printStackTrace(); + } + + return endpoints; + } + + /** + * Returns a list of WSDLEndpoints for the specific Port from the endpoint DB + * + * @param port the Port to check for + * @return a list containing all WSDLEndpoints that matches the portTypes of the given Port + */ + private List getWSDLEndpointsFromEndpointDB(final Port port) { + final List endpoints = new LinkedList<>(); + if (endpointService != null) { + LOG.debug("Fetching Endpoints for PortType {} ", + port.getBinding().getPortType().getQName().toString()); + final List temp = endpointService.getWSDLEndpoints(); + for (final WSDLEndpoint endpoint : temp) { + if (endpoint.getPortType().equals(port.getBinding().getPortType().getQName()) + && endpoint.getManagingContainer().equals(Settings.OPENTOSCA_CONTAINER_HOSTNAME)) { + LOG.debug("Found endpoint: {}", endpoint.getURI().toString()); + endpoints.add(endpoint); + } + } + } else { + LOG.debug("Endpoint service not available"); + } + LOG.debug("{} endpoints found for PortType {}", endpoints.size(), port.getBinding().getPortType().getQName().toString()); + return endpoints; + } + + /** + * Changes the address in the given ExtensibilityElement to address given in the given WSDLEndpoint + * + * @param element the ExtensibilityElement to change + * @param endpoint the WSDLEndpoint containing the address + * @return true if changing was successful, this means the ExtensibilityElement had the type {@link + * com.ibm.wsdl.extensions.soap.SOAPConstants.Q_ELEM_SOAP_ADDRESS} or {@link com.ibm.wsdl.extensions.http.HTTPConstants.Q_ELEM_HTTP_ADDRESS} + * , else false + */ + private boolean changeAddress(final ExtensibilityElement element, final WSDLEndpoint endpoint) { + // TODO check if we could generalize this, we did once, but after + // looking at it again it seems not right enough + if (element.getElementType().equals(SOAPConstants.Q_ELEM_SOAP_ADDRESS)) { + LOG.debug("Changing the SOAP-Address Element inside for porttype {} ", + endpoint.getPortType().toString()); + final SOAPAddress address = (SOAPAddress) element; + address.setLocationURI(endpoint.getURI().toString()); + } else if (element.getElementType().equals(HTTPConstants.Q_ELEM_HTTP_ADDRESS)) { + LOG.debug("Changing the HTTP-Address Element inside for porttype {} ", + endpoint.getPortType().toString()); + final HTTPAddress address = (HTTPAddress) element; + address.setLocationURI(endpoint.getURI().toString()); + } else { + LOG.debug("Address element inside WSDL isn't supported"); + return false; + } + return true; + } + + /** + * Returns PortType of the bpel process composed of the given files list + * + * @param planContents List of Files which make up the BPEL Process + * @return QName which should be exactly the PortType of the given BPEL Process + */ + public QName getPortType(final List planContents) { + try { + final File deployXML = getDeployXML(planContents); + final JAXBContext context = + JAXBContext.newInstance("org.apache.ode.schemas.dd._2007._03", this.getClass().getClassLoader()); + final Unmarshaller unmarshaller = context.createUnmarshaller(); + final TDeployment deploy = + unmarshaller.unmarshal(new StreamSource(deployXML), TDeployment.class).getValue(); + for (final TDeployment.Process process : deploy.getProcess()) { + return process.getName(); + } + } catch (final JAXBException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/FailureHandling.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/FailureHandling.java deleted file mode 100644 index 66b99cf67..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/FailureHandling.java +++ /dev/null @@ -1,112 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.activityrecovery; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType>
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <all>
    - *         <element name="retryFor" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    - *         <element name="retryDelay" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    - *         <element name="faultOnFailure" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *       </all>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - -}) -@XmlRootElement(name = "failureHandling") -public class FailureHandling { - - protected Integer retryFor; - protected Integer retryDelay; - protected Boolean faultOnFailure; - - /** - * Gets the value of the retryFor property. - * - * @return possible object is {@link Integer } - * - */ - public Integer getRetryFor() { - return this.retryFor; - } - - /** - * Sets the value of the retryFor property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setRetryFor(final Integer value) { - this.retryFor = value; - } - - /** - * Gets the value of the retryDelay property. - * - * @return possible object is {@link Integer } - * - */ - public Integer getRetryDelay() { - return this.retryDelay; - } - - /** - * Sets the value of the retryDelay property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setRetryDelay(final Integer value) { - this.retryDelay = value; - } - - /** - * Gets the value of the faultOnFailure property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isFaultOnFailure() { - return this.faultOnFailure; - } - - /** - * Sets the value of the faultOnFailure property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setFaultOnFailure(final Boolean value) { - this.faultOnFailure = value; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/ObjectFactory.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/ObjectFactory.java deleted file mode 100644 index 65d3f2e84..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/ObjectFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.activityrecovery; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.apache.ode.activityrecovery package. - *

    - * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.apache.ode.activityrecovery - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link FailureHandling } - * - */ - public FailureHandling createFailureHandling() { - return new FailureHandling(); - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/package-info.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/package-info.java deleted file mode 100644 index 2fe717218..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/activityrecovery/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://ode.apache.org/activityRecovery", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.apache.ode.activityrecovery; diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java deleted file mode 100644 index 04957c5fc..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java +++ /dev/null @@ -1,169 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.apache.ode.schemas.dd._2007._03 package. - *

    - * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _Deploy_QNAME = new QName("http://www.apache.org/ode/schemas/dd/2007/03", "deploy"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.apache.ode.schemas.dd._2007._03 - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link TService } - * - */ - public TService createTService() { - return new TService(); - } - - /** - * Create an instance of {@link TInvoke.Binding } - * - */ - public TInvoke.Binding createTInvokeBinding() { - return new TInvoke.Binding(); - } - - /** - * Create an instance of {@link TCleanup } - * - */ - public TCleanup createTCleanup() { - return new TCleanup(); - } - - /** - * Create an instance of {@link TInvoke } - * - */ - public TInvoke createTInvoke() { - return new TInvoke(); - } - - /** - * Create an instance of {@link TDeployment.Process } - * - */ - public TDeployment.Process createTDeploymentProcess() { - return new TDeployment.Process(); - } - - /** - * Create an instance of {@link TDeployment } - * - */ - public TDeployment createTDeployment() { - return new TDeployment(); - } - - /** - * Create an instance of {@link TMexInterceptor } - * - */ - public TMexInterceptor createTMexInterceptor() { - return new TMexInterceptor(); - } - - /** - * Create an instance of {@link TSchedule } - * - */ - public TSchedule createTSchedule() { - return new TSchedule(); - } - - /** - * Create an instance of {@link TDeployment.Process.MexInterceptors } - * - */ - public TDeployment.Process.MexInterceptors createTDeploymentProcessMexInterceptors() { - return new TDeployment.Process.MexInterceptors(); - } - - /** - * Create an instance of {@link TEnableSharing } - * - */ - public TEnableSharing createTEnableSharing() { - return new TEnableSharing(); - } - - /** - * Create an instance of {@link TScopeEvents } - * - */ - public TScopeEvents createTScopeEvents() { - return new TScopeEvents(); - } - - /** - * Create an instance of {@link TProcessEvents } - * - */ - public TProcessEvents createTProcessEvents() { - return new TProcessEvents(); - } - - /** - * Create an instance of {@link TDeployment.Process.Property } - * - */ - public TDeployment.Process.Property createTDeploymentProcessProperty() { - return new TDeployment.Process.Property(); - } - - /** - * Create an instance of {@link TEnableEventList } - * - */ - public TEnableEventList createTEnableEventList() { - return new TEnableEventList(); - } - - /** - * Create an instance of {@link TProvide } - * - */ - public TProvide createTProvide() { - return new TProvide(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link TDeployment }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", name = "deploy") - public JAXBElement createDeploy(final TDeployment value) { - return new JAXBElement<>(_Deploy_QNAME, TDeployment.class, null, value); - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java deleted file mode 100644 index 83a37c995..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java +++ /dev/null @@ -1,150 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tCleanup complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCleanup">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="category" maxOccurs="unbounded" minOccurs="0">
    - *           <simpleType>
    - *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *               <enumeration value="instance"/>
    - *               <enumeration value="variables"/>
    - *               <enumeration value="messages"/>
    - *               <enumeration value="correlations"/>
    - *               <enumeration value="events"/>
    - *               <enumeration value="all"/>
    - *             </restriction>
    - *           </simpleType>
    - *         </element>
    - *         <element name="filter" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="on">
    - *         <simpleType>
    - *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *             <enumeration value="success"/>
    - *             <enumeration value="failure"/>
    - *             <enumeration value="always"/>
    - *           </restriction>
    - *         </simpleType>
    - *       </attribute>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCleanup", propOrder = {"category", "filter"}) -public class TCleanup { - - @XmlElement(defaultValue = "all") - protected List category; - protected List filter; - @XmlAttribute - protected String on; - - /** - * Gets the value of the category property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the category property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getCategory().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } - * - * - */ - public List getCategory() { - if (this.category == null) { - this.category = new ArrayList<>(); - } - return this.category; - } - - /** - * Gets the value of the filter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the filter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getFilter().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } - * - * - */ - public List getFilter() { - if (this.filter == null) { - this.filter = new ArrayList<>(); - } - return this.filter; - } - - /** - * Gets the value of the on property. - * - * @return possible object is {@link String } - * - */ - public String getOn() { - return this.on; - } - - /** - * Sets the value of the on property. - * - * @param value allowed object is {@link String } - * - */ - public void setOn(final String value) { - this.on = value; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java deleted file mode 100644 index 2da082419..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java +++ /dev/null @@ -1,676 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - -/** - *

    - * Java class for tDeployment complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDeployment">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="process" maxOccurs="unbounded" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="property" maxOccurs="unbounded" minOccurs="0">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *                           </sequence>
    - *                           <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                   <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    - *                   <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    - *                   <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    - *                   <element name="mex-interceptors" minOccurs="0">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    - *                           </sequence>
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                   <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    - *                   <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    - *                   <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    - *                 </sequence>
    - *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *                 <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *                 <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlRootElement(name = "tDeployment", namespace = "http://www.apache.org/ode/schemas/dd/2007/03") -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDeployment", propOrder = {"process"}) -public class TDeployment { - - protected List process; - - - /** - * Gets the value of the process property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the process property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getProcess().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TDeployment.Process } - * - * - */ - public List getProcess() { - if (this.process == null) { - this.process = new ArrayList<>(); - } - return this.process; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="property" maxOccurs="unbounded" minOccurs="0">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    -     *                 </sequence>
    -     *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *         <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    -     *         <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    -     *         <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    -     *         <element name="mex-interceptors" minOccurs="0">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    -     *                 </sequence>
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    -     *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    -     *         <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    -     *       </sequence>
    -     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *       <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *       <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"active", "retired", "inMemory", "property", "processEvents", "provide", "invoke", - "mexInterceptors", "type", "cleanup", "schedule"}) - public static class Process { - - @XmlElement(defaultValue = "true") - protected Boolean active; - @XmlElement(defaultValue = "false") - protected Boolean retired; - @XmlElement(name = "in-memory", defaultValue = "false") - protected Boolean inMemory; - protected List property; - @XmlElement(name = "process-events") - protected TProcessEvents processEvents; - protected List provide; - protected List invoke; - @XmlElement(name = "mex-interceptors") - protected TDeployment.Process.MexInterceptors mexInterceptors; - protected QName type; - protected List cleanup; - protected List schedule; - @XmlAttribute(required = true) - protected QName name; - @XmlAttribute - protected String fileName; - @XmlAttribute(name = "bpel11wsdlFileName") - protected String bpel11WsdlFileName; - - - /** - * Gets the value of the active property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isActive() { - return this.active; - } - - /** - * Sets the value of the active property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setActive(final Boolean value) { - this.active = value; - } - - /** - * Gets the value of the retired property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isRetired() { - return this.retired; - } - - /** - * Sets the value of the retired property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setRetired(final Boolean value) { - this.retired = value; - } - - /** - * Gets the value of the inMemory property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isInMemory() { - return this.inMemory; - } - - /** - * Sets the value of the inMemory property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setInMemory(final Boolean value) { - this.inMemory = value; - } - - /** - * Gets the value of the property property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the property property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getProperty().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TDeployment.Process.Property } - * - * - */ - public List getProperty() { - if (this.property == null) { - this.property = new ArrayList<>(); - } - return this.property; - } - - /** - * Gets the value of the processEvents property. - * - * @return possible object is {@link TProcessEvents } - * - */ - public TProcessEvents getProcessEvents() { - return this.processEvents; - } - - /** - * Sets the value of the processEvents property. - * - * @param value allowed object is {@link TProcessEvents } - * - */ - public void setProcessEvents(final TProcessEvents value) { - this.processEvents = value; - } - - /** - * Gets the value of the provide property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the provide property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getProvide().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TProvide } - * - * - */ - public List getProvide() { - if (this.provide == null) { - this.provide = new ArrayList<>(); - } - return this.provide; - } - - /** - * Gets the value of the invoke property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the invoke property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInvoke().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TInvoke } - * - * - */ - public List getInvoke() { - if (this.invoke == null) { - this.invoke = new ArrayList<>(); - } - return this.invoke; - } - - /** - * Gets the value of the mexInterceptors property. - * - * @return possible object is {@link TDeployment.Process.MexInterceptors } - * - */ - public TDeployment.Process.MexInterceptors getMexInterceptors() { - return this.mexInterceptors; - } - - /** - * Sets the value of the mexInterceptors property. - * - * @param value allowed object is {@link TDeployment.Process.MexInterceptors } - * - */ - public void setMexInterceptors(final TDeployment.Process.MexInterceptors value) { - this.mexInterceptors = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link QName } - * - */ - public QName getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link QName } - * - */ - public void setType(final QName value) { - this.type = value; - } - - /** - * Gets the value of the cleanup property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the cleanup property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getCleanup().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCleanup } - * - * - */ - public List getCleanup() { - if (this.cleanup == null) { - this.cleanup = new ArrayList<>(); - } - return this.cleanup; - } - - /** - * Gets the value of the schedule property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the schedule property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getSchedule().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TSchedule } - * - * - */ - public List getSchedule() { - if (this.schedule == null) { - this.schedule = new ArrayList<>(); - } - return this.schedule; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link QName } - * - */ - public QName getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link QName } - * - */ - public void setName(final QName value) { - this.name = value; - } - - /** - * Gets the value of the fileName property. - * - * @return possible object is {@link String } - * - */ - public String getFileName() { - return this.fileName; - } - - /** - * Sets the value of the fileName property. - * - * @param value allowed object is {@link String } - * - */ - public void setFileName(final String value) { - this.fileName = value; - } - - /** - * Gets the value of the bpel11WsdlFileName property. - * - * @return possible object is {@link String } - * - */ - public String getBpel11WsdlFileName() { - return this.bpel11WsdlFileName; - } - - /** - * Sets the value of the bpel11WsdlFileName property. - * - * @param value allowed object is {@link String } - * - */ - public void setBpel11WsdlFileName(final String value) { - this.bpel11WsdlFileName = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    -         *       </sequence>
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"mexInterceptor"}) - public static class MexInterceptors { - - @XmlElement(name = "mex-interceptor") - protected List mexInterceptor; - - - /** - * Gets the value of the mexInterceptor property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the mexInterceptor property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -             * getMexInterceptor().add(newItem);
    -             * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TMexInterceptor } - * - * - */ - public List getMexInterceptor() { - if (this.mexInterceptor == null) { - this.mexInterceptor = new ArrayList<>(); - } - return this.mexInterceptor; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    -         *       </sequence>
    -         *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class Property { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(required = true) - protected QName name; - - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -             * getAny().add(newItem);
    -             * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link QName } - * - */ - public QName getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link QName } - * - */ - public void setName(final QName value) { - this.name = value; - } - - } - - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java deleted file mode 100644 index 3751f6f3f..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java +++ /dev/null @@ -1,79 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tEnableEventList complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEnableEventList">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="enable-event" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEnableEventList", propOrder = {"enableEvent"}) -@XmlSeeAlso({TProcessEvents.class, TScopeEvents.class}) -public class TEnableEventList { - - @XmlElement(name = "enable-event") - protected List enableEvent; - - /** - * Gets the value of the enableEvent property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the enableEvent property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getEnableEvent().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } - * - * - */ - public List getEnableEvent() { - if (this.enableEvent == null) { - this.enableEvent = new ArrayList<>(); - } - return this.enableEvent; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java deleted file mode 100644 index 4bd1241a8..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java +++ /dev/null @@ -1,40 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tEnableSharing complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEnableSharing">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEnableSharing") -public class TEnableSharing { - - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java deleted file mode 100644 index 31d129ffc..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java +++ /dev/null @@ -1,222 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.apache.ode.activityrecovery.FailureHandling; - - -/** - *

    - * Java class for tInvoke complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tInvoke">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    - *         <element name="binding" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element ref="{http://ode.apache.org/activityRecovery}failureHandling" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="usePeer2Peer" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tInvoke", propOrder = {"service", "binding", "failureHandling"}) -public class TInvoke { - - @XmlElement(required = true) - protected TService service; - protected TInvoke.Binding binding; - @XmlElement(namespace = "http://ode.apache.org/activityRecovery") - protected FailureHandling failureHandling; - @XmlAttribute(required = true) - protected String partnerLink; - @XmlAttribute - protected Boolean usePeer2Peer; - - /** - * Gets the value of the service property. - * - * @return possible object is {@link TService } - * - */ - public TService getService() { - return this.service; - } - - /** - * Sets the value of the service property. - * - * @param value allowed object is {@link TService } - * - */ - public void setService(final TService value) { - this.service = value; - } - - /** - * Gets the value of the binding property. - * - * @return possible object is {@link TInvoke.Binding } - * - */ - public TInvoke.Binding getBinding() { - return this.binding; - } - - /** - * Sets the value of the binding property. - * - * @param value allowed object is {@link TInvoke.Binding } - * - */ - public void setBinding(final TInvoke.Binding value) { - this.binding = value; - } - - /** - * Gets the value of the failureHandling property. - * - * @return possible object is {@link FailureHandling } - * - */ - public FailureHandling getFailureHandling() { - return this.failureHandling; - } - - /** - * Sets the value of the failureHandling property. - * - * @param value allowed object is {@link FailureHandling } - * - */ - public void setFailureHandling(final FailureHandling value) { - this.failureHandling = value; - } - - /** - * Gets the value of the partnerLink property. - * - * @return possible object is {@link String } - * - */ - public String getPartnerLink() { - return this.partnerLink; - } - - /** - * Sets the value of the partnerLink property. - * - * @param value allowed object is {@link String } - * - */ - public void setPartnerLink(final String value) { - this.partnerLink = value; - } - - /** - * Gets the value of the usePeer2Peer property. - * - * @return possible object is {@link Boolean } - * - */ - public boolean isUsePeer2Peer() { - if (this.usePeer2Peer == null) { - return true; - } else { - return this.usePeer2Peer; - } - } - - /** - * Sets the value of the usePeer2Peer property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setUsePeer2Peer(final Boolean value) { - this.usePeer2Peer = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Binding { - - @XmlAttribute(required = true) - protected QName name; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link QName } - * - */ - public QName getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link QName } - * - */ - public void setName(final QName value) { - this.name = value; - } - - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java deleted file mode 100644 index 0941ff9ed..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java +++ /dev/null @@ -1,70 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * - * Message exchange interceptor configuration. - * - * - *

    - * Java class for tMexInterceptor complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tMexInterceptor">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="class-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tMexInterceptor", propOrder = {"className"}) -public class TMexInterceptor { - - @XmlElement(name = "class-name", required = true) - protected String className; - - /** - * Gets the value of the className property. - * - * @return possible object is {@link String } - * - */ - public String getClassName() { - return this.className; - } - - /** - * Sets the value of the className property. - * - * @param value allowed object is {@link String } - * - */ - public void setClassName(final String value) { - this.className = value; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java deleted file mode 100644 index fc94d8e14..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java +++ /dev/null @@ -1,108 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tProcessEvents complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tProcessEvents">
    - *   <complexContent>
    - *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    - *       <sequence>
    - *         <element name="scope-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tScopeEvents" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="generate">
    - *         <simpleType>
    - *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *             <enumeration value="all"/>
    - *             <enumeration value="none"/>
    - *           </restriction>
    - *         </simpleType>
    - *       </attribute>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tProcessEvents", propOrder = {"scopeEvents"}) -public class TProcessEvents extends TEnableEventList { - - @XmlElement(name = "scope-events") - protected List scopeEvents; - @XmlAttribute - protected String generate; - - /** - * Gets the value of the scopeEvents property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the scopeEvents property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getScopeEvents().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TScopeEvents } - * - * - */ - public List getScopeEvents() { - if (this.scopeEvents == null) { - this.scopeEvents = new ArrayList<>(); - } - return this.scopeEvents; - } - - /** - * Gets the value of the generate property. - * - * @return possible object is {@link String } - * - */ - public String getGenerate() { - return this.generate; - } - - /** - * Sets the value of the generate property. - * - * @param value allowed object is {@link String } - * - */ - public void setGenerate(final String value) { - this.generate = value; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TProvide.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TProvide.java deleted file mode 100644 index 37b04722f..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TProvide.java +++ /dev/null @@ -1,112 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tProvide complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tProvide">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    - *         <element name="enableSharing" type="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableSharing" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tProvide", propOrder = {"service", "enableSharing"}) -public class TProvide { - - @XmlElement(required = true) - protected TService service; - protected TEnableSharing enableSharing; - @XmlAttribute(required = true) - protected String partnerLink; - - /** - * Gets the value of the service property. - * - * @return possible object is {@link TService } - * - */ - public TService getService() { - return this.service; - } - - /** - * Sets the value of the service property. - * - * @param value allowed object is {@link TService } - * - */ - public void setService(final TService value) { - this.service = value; - } - - /** - * Gets the value of the enableSharing property. - * - * @return possible object is {@link TEnableSharing } - * - */ - public TEnableSharing getEnableSharing() { - return this.enableSharing; - } - - /** - * Sets the value of the enableSharing property. - * - * @param value allowed object is {@link TEnableSharing } - * - */ - public void setEnableSharing(final TEnableSharing value) { - this.enableSharing = value; - } - - /** - * Gets the value of the partnerLink property. - * - * @return possible object is {@link String } - * - */ - public String getPartnerLink() { - return this.partnerLink; - } - - /** - * Sets the value of the partnerLink property. - * - * @param value allowed object is {@link String } - * - */ - public void setPartnerLink(final String value) { - this.partnerLink = value; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java deleted file mode 100644 index 23f167852..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java +++ /dev/null @@ -1,99 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tSchedule complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tSchedule">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="when" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tSchedule", propOrder = {"cleanup"}) -public class TSchedule { - - protected List cleanup; - @XmlAttribute(required = true) - protected String when; - - /** - * Gets the value of the cleanup property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the cleanup property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getCleanup().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCleanup } - * - * - */ - public List getCleanup() { - if (this.cleanup == null) { - this.cleanup = new ArrayList<>(); - } - return this.cleanup; - } - - /** - * Gets the value of the when property. - * - * @return possible object is {@link String } - * - */ - public String getWhen() { - return this.when; - } - - /** - * Sets the value of the when property. - * - * @param value allowed object is {@link String } - * - */ - public void setWhen(final String value) { - this.when = value; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java deleted file mode 100644 index 817042ebb..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java +++ /dev/null @@ -1,64 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tScopeEvents complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tScopeEvents">
    - *   <complexContent>
    - *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tScopeEvents") -public class TScopeEvents extends TEnableEventList { - - @XmlAttribute(required = true) - protected String name; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TService.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TService.java deleted file mode 100644 index d5376dd4a..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/TService.java +++ /dev/null @@ -1,132 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tService complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tService">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="port" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tService", propOrder = {"any"}) -public class TService { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(required = true) - protected QName name; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String port; - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getAny().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link QName } - * - */ - public QName getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link QName } - * - */ - public void setName(final QName value) { - this.name = value; - } - - /** - * Gets the value of the port property. - * - * @return possible object is {@link String } - * - */ - public String getPort() { - return this.port; - } - - /** - * Sets the value of the port property. - * - * @param value allowed object is {@link String } - * - */ - public void setPort(final String value) { - this.port = value; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/package-info.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/package-info.java deleted file mode 100644 index fde482882..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/apache/ode/schemas/dd/_2007/_03/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2012.05.16 at 05:29:02 PM MESZ -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.apache.ode.schemas.dd._2007._03; diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/Activator.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/Activator.java deleted file mode 100644 index ba3479431..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/Activator.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.engine.plan.plugin.bpel; - -import org.opentosca.container.core.common.Settings; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.debug("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - - final String processEngine = context.getProperty("org.opentosca.container.engine.plan.plugin.bpel.engine"); - if (processEngine != null) { - Settings.setSetting("org.opentosca.container.engine.plan.plugin.bpel.engine", processEngine); - } - - final String url = context.getProperty("org.opentosca.container.engine.plan.plugin.bpel.url"); - - if (url != null) { - Settings.setSetting("org.opentosca.container.engine.plan.plugin.bpel.url", url); - } - - final String servicesUrl = context.getProperty("org.opentosca.container.engine.plan.plugin.bpel.services.url"); - - if (servicesUrl != null) { - Settings.setSetting("org.opentosca.container.engine.plan.plugin.bpel.services.url", servicesUrl); - } - - final String userName = context.getProperty("org.opentosca.container.engine.plan.plugin.bpel.username"); - - if (userName != null) { - Settings.setSetting("org.opentosca.container.engine.plan.plugin.bpel.username", userName); - } - - final String password = context.getProperty("org.opentosca.container.engine.plan.plugin.bpel.password"); - - if (password != null) { - Settings.setSetting("org.opentosca.container.engine.plan.plugin.bpel.password", password); - } - - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.debug("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } - -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/BpelPlanEnginePlugin.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/BpelPlanEnginePlugin.java deleted file mode 100644 index 02240cccb..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/BpelPlanEnginePlugin.java +++ /dev/null @@ -1,664 +0,0 @@ -package org.opentosca.container.engine.plan.plugin.bpel; - -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.wsdl.WSDLException; -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.opentosca.container.connector.bps.BpsConnector; -import org.opentosca.container.connector.ode.OdeConnector; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.AbstractArtifact; -import org.opentosca.container.core.model.AbstractFile; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.next.trigger.SituationTriggerInstanceListener; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.core.service.ICoreFileService; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.container.core.tosca.model.TPlan.PlanModelReference; -import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService; -import org.opentosca.container.engine.plan.plugin.bpel.util.BPELRESTLightUpdater; -import org.opentosca.container.engine.plan.plugin.bpel.util.Messages; -import org.opentosca.container.engine.plan.plugin.bpel.util.ODEEndpointUpdater; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - - -/** - * This class implements functionality for deployment of WS-BPEL 2.0 Processes through the - * {@link org.opentosca.planengine.plugin.service.IPlanEnginePlanRefPluginService} unto a WSO2 - * Business Process Server or Apache Orchestration Director Engine (ODE). - * - * The class is the highlevel control of the plugin. It uses the classes - * {@link org.opentosca.container.engine.plan.plugin.bpel.util.BPELRESTLightUpdater} to update - * BPEL4RESTLight (see: OpenTOSCA/trunk/examples/org.opentosca.bpel4restlight.bpelextension) - * extension activities with up-to-date endpoints. The plugin also uses - * {@link org.opentosca.container.engine.plan.plugin.bpel.util.ODEEndpointUpdater} to update the - * bindings inside the used WSDL Descriptions referenced in the BPEL process. The endpoints for the - * update are retrieved through a service that implements the - * {@link org.opentosca.core.endpoint.service.ICoreEndpointService} interface. - * - * The actual deployment is done on the endpoint which is declared in the - * {@link org.opentosca.container.engine.plan.plugin.bpel.util.Messages} class. The plugin uses - * {@link org.opentosca.container.connector.bps.BpsConnector} or - * {@link org.opentosca.container.connector.ode.OdeConnector} class to deploy the updated plan unto - * the WSO2 BPS or Apache ODE behind the endpoint, respectively. - * - * @see org.opentosca.planengine.plugin.bpelwso2.util.BPELRESTLightUpdates - * @see org.opentosca.container.engine.plan.plugin.bpel.util.ODEEndpointUpdater - * @see org.opentosca.container.connector.bps.BpsConnector - * @see org.opentosca.container.connector.ode.OdeConnector - * @see org.opentosca.container.engine.plan.plugin.bpel.util.Messages - * @see org.opentosca.core.endpoint.service.ICoreEndpointService - */ -public class BpelPlanEnginePlugin implements IPlanEnginePlanRefPluginService { - - final private static Logger LOG = LoggerFactory.getLogger(BpelPlanEnginePlugin.class); - - private ICoreFileService fileService = null; - private ICoreFileService oldFileService = null; - - private IFileAccessService fileAccessService = null; - private IFileAccessService oldFileAccessService = null; - - private ICoreEndpointService endpointService; - private ICoreEndpointService oldEndpointService; - - private IToscaEngineService toscaEngine; - - public static final String BPS_ENGINE = "BPS"; - - static private String ENGINE = Messages.BpelPlanEnginePlugin_engine; - static private String USERNAME = Messages.BpelPlanEnginePlugin_engineLoginName; - static private String PASSWORD = Messages.BpelPlanEnginePlugin_engineLoginPw; - static private String URL = Messages.BpelPlanEnginePlugin_engineAddress; - static private String SERVICESURL = Messages.BpelPlanEnginPlugin_engineServiceRootAddress; - - private final Map> planToOperationMap = new HashMap<>(); - - public BpelPlanEnginePlugin() { - final String processEngine = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.engine"); - - if (processEngine != null) { - ENGINE = processEngine; - } - - final String url = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.url"); - - if (url != null) { - URL = url; - } - - final String servicesUrl = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.services.url"); - - if (servicesUrl != null) { - SERVICESURL = servicesUrl; - } - - final String userName = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.username"); - - if (userName != null) { - USERNAME = userName; - } - - final String password = Settings.getSetting("org.opentosca.container.engine.plan.plugin.bpel.password"); - - if (password != null) { - PASSWORD = password; - } - } - - /** - * {@inheritDoc} - */ - @Override - public String getLanguageUsed() { - return Messages.BpelPlanEnginePlugin_language; - } - - /** - * {@inheritDoc} - */ - @Override - public List getCapabilties() { - final List capabilities = new ArrayList<>(); - - for (final String capability : Messages.BpelPlanEnginePlugin_capabilities.split("[,;]")) { - capabilities.add(capability.trim()); - } - return capabilities; - } - - - public boolean deployPlanFile(final Path filePath, final CSARID csarId, final QName planId, - final Map endpointMetadata) { - List planContents; - File tempDir; - File tempPlan; - QName portType = null; - - if (this.fileAccessService != null) { - // creating temporary dir for update - tempDir = this.fileAccessService.getTemp(); - tempPlan = new File(tempDir, filePath.getFileName().toString()); - BpelPlanEnginePlugin.LOG.debug("Unzipping Plan '{}' to '{}'.", filePath.getFileName().toString(), - tempDir.getAbsolutePath()); - planContents = this.fileAccessService.unzip(filePath.toFile(), tempDir); - - for (final File plan : planContents) { - final int i = plan.getName().lastIndexOf('.'); - if (i > 0) { - if (plan.getName().substring(i + 1).equals("bpel")) { - try { - final DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - final DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - final Document docToParse = dBuilder.parse(plan); - docToParse.getDocumentElement().normalize(); - - final XPath xPath = XPathFactory.newInstance().newXPath(); - final String expressionOperationName = "//*[local-name()='OperationName']"; - final NodeList nodeListOperationNames = - (NodeList) xPath.compile(expressionOperationName).evaluate(docToParse, - XPathConstants.NODESET); - - final String expressionNodeTemplateID = "//*[local-name()='NodeTemplateID']"; - final NodeList nodeListNodeTemplateIDs = - (NodeList) xPath.compile(expressionNodeTemplateID).evaluate(docToParse, - XPathConstants.NODESET); - - - - final List operationNames = new ArrayList<>(); - - for (int j = 0; j < nodeListOperationNames.getLength(); j++) { - if (nodeListOperationNames.item(j).getNodeType() == Node.ELEMENT_NODE) { - final Element operationNameElement = (Element) nodeListOperationNames.item(j); - final String opNameOperation = - operationNameElement.getChildNodes().item(0).getTextContent(); - - final Element nodeTemplateElement = (Element) nodeListNodeTemplateIDs.item(j); - final String nodeTemplateOperation = - nodeTemplateElement.getChildNodes().item(0).getTextContent(); - - operationNames.add(nodeTemplateOperation + opNameOperation); - } - } - - - this.planToOperationMap.put(planId.getLocalPart(), operationNames); - final SituationTriggerInstanceListener triggerListener = - new SituationTriggerInstanceListener(); - triggerListener.setPlanToOperationMap(this.planToOperationMap); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final XPathExpressionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - } - } - } else { - BpelPlanEnginePlugin.LOG.error("FileAccessService is not available, can't create needed temporary space on disk"); - return false; - } - - // changing endpoints in WSDLs - ODEEndpointUpdater odeUpdater; - try { - odeUpdater = new ODEEndpointUpdater(SERVICESURL, ENGINE); - portType = odeUpdater.getPortType(planContents); - if (!odeUpdater.changeEndpoints(planContents, csarId)) { - BpelPlanEnginePlugin.LOG.error("Not all endpoints used by the plan {} have been changed", filePath); - } - } - catch (final WSDLException e) { - BpelPlanEnginePlugin.LOG.error("Couldn't load ODEEndpointUpdater", e); - } - - // update the bpel and bpel4restlight elements (ex.: GET, PUT,..) - BPELRESTLightUpdater bpelRestUpdater; - try { - bpelRestUpdater = new BPELRESTLightUpdater(); - if (!bpelRestUpdater.changeEndpoints(planContents, csarId)) { - // we don't abort deployment here - BpelPlanEnginePlugin.LOG.warn("Could'nt change all endpoints inside BPEL4RESTLight Elements in the given process {}", - filePath); - } - } - catch (final TransformerConfigurationException e) { - BpelPlanEnginePlugin.LOG.error("Couldn't load BPELRESTLightUpdater transformer", e); - } - catch (final ParserConfigurationException e) { - BpelPlanEnginePlugin.LOG.error("Couldn't load BPELRESTLightUpdaters parser", e); - } - catch (final SAXException e) { - BpelPlanEnginePlugin.LOG.error("ParseError: Couldn't parse .bpel file", e); - } - catch (final IOException e) { - BpelPlanEnginePlugin.LOG.error("IOError: Couldn't access .bpel file", e); - } - - // package process - BpelPlanEnginePlugin.LOG.info("Prepare deployment of PlanModelReference"); - - if (this.fileAccessService != null) { - try { - if (tempPlan.createNewFile()) { - // package the updated files - BpelPlanEnginePlugin.LOG.debug("Packaging plan to {} ", tempPlan.getAbsolutePath()); - tempPlan = this.fileAccessService.zip(tempDir, tempPlan); - } else { - BpelPlanEnginePlugin.LOG.error("Can't package temporary plan for deployment"); - return false; - } - } - catch (final IOException e) { - BpelPlanEnginePlugin.LOG.error("Can't package temporary plan for deployment", e); - return false; - } - } - - // deploy process - BpelPlanEnginePlugin.LOG.info("Deploying Plan: {}", tempPlan.getName()); - String processId = ""; - Map endpoints = Collections.emptyMap(); - try { - if (ENGINE.equalsIgnoreCase(BPS_ENGINE)) { - final BpsConnector connector = new BpsConnector(); - - processId = connector.deploy(tempPlan, URL, USERNAME, PASSWORD); - - endpoints = connector.getEndpointsForPID(processId, URL, USERNAME, PASSWORD); - } else { - final OdeConnector connector = new OdeConnector(); - - processId = connector.deploy(tempPlan, URL); - - endpoints = connector.getEndpointsForPID(processId, URL); - } - } - catch (final Exception e) { - e.printStackTrace(); - } - - // this will be the endpoint the container can use to instantiate the - // BPEL Process - URI endpoint = null; - if (endpoints.keySet().size() == 1) { - endpoint = (URI) endpoints.values().toArray()[0]; - } else { - for (final String partnerLink : endpoints.keySet()) { - if (partnerLink.equals("client")) { - endpoint = endpoints.get(partnerLink); - } - } - } - - if (endpoint == null) { - return false; - } - - if (processId != null && endpoint != null && portType != null && this.endpointService != null) { - BpelPlanEnginePlugin.LOG.debug("Endpoint for ProcessID \"" + processId + "\" is \"" + endpoints + "\"."); - BpelPlanEnginePlugin.LOG.info("Deployment of Plan was successfull: {}", tempPlan.getName()); - - // save endpoint - final String localContainer = Settings.OPENTOSCA_CONTAINER_HOSTNAME; - final WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(endpoint, portType, localContainer, localContainer, - csarId, null, planId, null, null, endpointMetadata); - this.endpointService.storeWSDLEndpoint(wsdlEndpoint); - - } else { - BpelPlanEnginePlugin.LOG.error("Error while processing plan"); - if (processId == null) { - BpelPlanEnginePlugin.LOG.error("ProcessId is null"); - } - if (endpoint == null) { - BpelPlanEnginePlugin.LOG.error("Endpoint for process is null"); - } - if (portType == null) { - BpelPlanEnginePlugin.LOG.error("PortType of process is null"); - } - - if (this.endpointService == null) { - BpelPlanEnginePlugin.LOG.error("Endpoint Service is null"); - } - return false; - } - return true; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean deployPlanReference(final QName planId, final PlanModelReference planRef, final CSARID csarId) { - // retrieve process - if (this.fileService != null) { - - CSARContent csar = null; - - try { - csar = this.fileService.getCSAR(csarId); - } - catch (final UserException exc) { - BpelPlanEnginePlugin.LOG.error("An User Exception occured.", exc); - return false; - } - - AbstractArtifact planReference = null; - - planReference = this.toscaEngine.getPlanModelReferenceAbstractArtifact(csar, planId); - - if (planReference == null) { - BpelPlanEnginePlugin.LOG.error("Plan reference '{}' resulted in a null ArtifactReference.", - planRef.getReference()); - return false; - } - - if (!planReference.isFileArtifact()) { - BpelPlanEnginePlugin.LOG.warn("Only plan references pointing to a file are supported!"); - return false; - } - - final AbstractFile plan = planReference.getFile(""); - - if (plan == null) { - BpelPlanEnginePlugin.LOG.error("ArtifactReference resulted in null AbstractFile."); - return false; - } - - if (!plan.getName().substring(plan.getName().lastIndexOf('.') + 1).equals("zip")) { - BpelPlanEnginePlugin.LOG.debug("Plan reference is not a ZIP file. It was '{}'.", plan.getName()); - return false; - } - - Path fetchedPlan; - - try { - fetchedPlan = plan.getFile(); - } - catch (final SystemException exc) { - BpelPlanEnginePlugin.LOG.error("An System Exception occured. File could not be fetched.", exc); - return false; - } - - return deployPlanFile(fetchedPlan, csarId, planId, new HashMap()); - - - - } else { - BpelPlanEnginePlugin.LOG.error("Can't fetch relevant files from FileService: FileService not available"); - return false; - } - - } - - /** - * {@inheritDoc} - */ - @Override - public boolean undeployPlanReference(final QName planId, final PlanModelReference planRef, final CSARID csarId) { - // retrieve process - if (this.fileService != null) { - - CSARContent csar = null; - - try { - csar = this.fileService.getCSAR(csarId); - } - catch (final UserException exc) { - BpelPlanEnginePlugin.LOG.error("An User Exception occured.", exc); - return false; - } - - AbstractArtifact planReference = null; - - planReference = this.toscaEngine.getPlanModelReferenceAbstractArtifact(csar, planId); - - if (planReference == null) { - BpelPlanEnginePlugin.LOG.error("Plan reference '{}' resulted in a null ArtifactReference.", - planRef.getReference()); - return false; - } - - if (!planReference.isFileArtifact()) { - BpelPlanEnginePlugin.LOG.warn("Only plan references pointing to a file are supported!"); - return false; - } - - final AbstractFile plan = planReference.getFile(""); - - if (plan == null) { - BpelPlanEnginePlugin.LOG.error("ArtifactReference resulted in null AbstractFile."); - return false; - } - - if (!plan.getName().substring(plan.getName().lastIndexOf('.') + 1).equals("zip")) { - BpelPlanEnginePlugin.LOG.debug("Plan reference is not a ZIP file. It was '{}'.", plan.getName()); - return false; - } - - Path fetchedPlan; - - try { - fetchedPlan = plan.getFile(); - } - catch (final SystemException exc) { - BpelPlanEnginePlugin.LOG.error("An System Exception occured. File could not be fetched.", exc); - return false; - } - - boolean wasUndeployed = false; - if (ENGINE.equalsIgnoreCase(BPS_ENGINE)) { - final BpsConnector connector = new BpsConnector(); - - wasUndeployed = connector.undeploy(fetchedPlan.toFile(), URL, USERNAME, PASSWORD); - } else { - final OdeConnector connector = new OdeConnector(); - - wasUndeployed = connector.undeploy(fetchedPlan.toFile(), URL); - } - - // remove endpoint from core - WSDLEndpoint endpoint = null; - if (this.endpointService != null) { - BpelPlanEnginePlugin.LOG.debug("Starting to remove endpoint!"); - // this.endpointService.storeWSDLEndpoint(wsdlEndpoint); - endpoint = this.endpointService.getWSDLEndpointForPlanId(Settings.OPENTOSCA_CONTAINER_HOSTNAME, csarId, - planId); - - if (endpoint == null) { - BpelPlanEnginePlugin.LOG.warn("Couldn't remove endpoint for plan {}, because endpoint service didn't find any endpoint associated with the plan to remove", - planRef.getReference()); - } - - if (this.endpointService.removeWSDLEndpoint(endpoint)) { - BpelPlanEnginePlugin.LOG.debug("Removed endpoint {} for plan {}", endpoint.toString(), - planRef.getReference()); - } - - } else { - BpelPlanEnginePlugin.LOG.warn("Couldn't remove endpoint for plan {}, cause endpoint service is not available", - planRef.getReference()); - } - - if (wasUndeployed) { - BpelPlanEnginePlugin.LOG.info("Undeployment of Plan " + planRef.getReference() + " was successful"); - } else { - BpelPlanEnginePlugin.LOG.warn("Undeployment of Plan " + planRef.getReference() + " was unsuccessful"); - } - - return wasUndeployed; - } else { - BpelPlanEnginePlugin.LOG.error("Can't fetch relevant files from FileService: FileService not available"); - return false; - } - } - - /** - * Bind method for IFileServices - * - * @param fileService the file service to bind - */ - public void registerFileService(final ICoreFileService fileService) { - if (fileService != null) { - BpelPlanEnginePlugin.LOG.debug("Registering FileService {}", fileService.toString()); - if (this.fileService == null) { - this.fileService = fileService; - } else { - this.oldFileService = fileService; - this.fileService = fileService; - } - BpelPlanEnginePlugin.LOG.debug("Registered FileService {}", fileService.toString()); - } - } - - /** - * Unbind method for IFileServices - * - * @param fileService the file service to unbind - */ - protected void unregisterFileService(final ICoreFileService fileService) { - BpelPlanEnginePlugin.LOG.debug("Unregistering FileService {}", fileService.toString()); - if (this.oldFileService == null) { - this.fileService = null; - } else { - this.oldFileService = null; - } - BpelPlanEnginePlugin.LOG.debug("Unregistered FileService {}", fileService.toString()); - } - - /** - * Bind method for IFileAccessServices - * - * @param fileAccessService the fileAccessService to bind - */ - public void registerFileAccessService(final IFileAccessService fileAccessService) { - if (fileAccessService != null) { - BpelPlanEnginePlugin.LOG.debug("Registering FileAccessService {}", fileAccessService.toString()); - if (this.fileAccessService == null) { - this.fileAccessService = fileAccessService; - } else { - this.oldFileAccessService = fileAccessService; - this.fileAccessService = fileAccessService; - } - BpelPlanEnginePlugin.LOG.debug("Registered FileAccessService {}", fileAccessService.toString()); - } - } - - /** - * Unbind method for IFileAccessServices - * - * @param fileAccessService the fileAccessService to unbind - */ - protected void unregisterFileAccessService(final IFileAccessService fileAccessService) { - BpelPlanEnginePlugin.LOG.debug("Unregistering FileAccessService {}", fileAccessService.toString()); - if (this.oldFileAccessService == null) { - this.fileAccessService = null; - } else { - this.oldFileAccessService = null; - } - BpelPlanEnginePlugin.LOG.debug("Unregistered FileAccessService {}", fileAccessService.toString()); - } - - /** - * Bind method for ICoreEndpointServices - * - * @param endpointService the endpointService to bind - */ - public void registerEndpointService(final ICoreEndpointService endpointService) { - if (endpointService != null) { - BpelPlanEnginePlugin.LOG.debug("Registering EndpointService {}", endpointService.toString()); - if (this.endpointService == null) { - this.endpointService = endpointService; - } else { - this.oldEndpointService = endpointService; - this.endpointService = endpointService; - } - BpelPlanEnginePlugin.LOG.debug("Registered EndpointService {}", endpointService.toString()); - } - } - - /** - * Unbind method for ICoreEndpointServices - * - * @param endpointService the endpointService to unbind - */ - protected void unregisterEndpointService(final ICoreEndpointService endpointService) { - BpelPlanEnginePlugin.LOG.debug("Unregistering EndpointService {}", endpointService.toString()); - if (this.oldEndpointService == null) { - this.endpointService = null; - } else { - this.oldEndpointService = null; - } - BpelPlanEnginePlugin.LOG.debug("Unregistered EndpointService {}", endpointService.toString()); - } - - /** - * Bind method for IToscaEngineService - * - * @param service the IToscaEngineService to bind - */ - public void registerToscaEngine(final IToscaEngineService service) { - if (service != null) { - this.toscaEngine = service; - BpelPlanEnginePlugin.LOG.debug("Registered IToscaEngineService {}", service.toString()); - } - } - - /** - * Unbind method for IToscaEngineService - * - * @param endpointService the IToscaEngineService to unbind - */ - protected void unregisterToscaEngine(final IToscaEngineService endpointService) { - this.toscaEngine = null; - BpelPlanEnginePlugin.LOG.debug("Unregistered IToscaEngineService {}", endpointService.toString()); - } - - @Override - public String toString() { - return Messages.BpelPlanEnginePlugin_description; - } -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightUpdater.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightUpdater.java deleted file mode 100644 index 387a0e8ec..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/BPELRESTLightUpdater.java +++ /dev/null @@ -1,371 +0,0 @@ -package org.opentosca.container.engine.plan.plugin.bpel.util; - -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -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; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpression; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.rest.RESTEndpoint; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -/** - * This class provides functionality for updating BPEL4RESTLight Elements inside a WSBPEL 2.0 file. - * - * BPEL4RESTLight elements are extension activities defined by the ODE Extension BPEL4RESTLight - * (see: OpenTOSCA/trunk/plans/odeextensions). These must have URI attribute which represent - * endpoints for http requests but maybe have to be updated. - * - * This class maps BPEL4RESTLight XML elements into BPELRESTLightElement objects and operates on - * them for the updates. - * - * Rules for update: - *
  • 1. The uri is absolute -> no update. This is because we need to have the ability to use URIs - * like amazon.com - *
  • 2. The uri is relative -> update. Relative URIs are updated if an endpoint exists in the - * openTOSCA Core for the referenced HTTP service. - *
  • 3. The uri is a $bpelvar[varname] construct -> no update. - *
  • 4. The uri is a mix of 1 and 3 or 2 and 3. The class tries to cut out bpelVar part and checks - * if URI is a URI in first place and if it is relative or absolute, then the above rules are tried - * to apply - * - * @See org.opentosca.container.engine.plan.plugin.bpel.util.BPEL4RESTLightElement - * @See org.opentosca.container.engine.plan.plugin.bpel.util.BPEL4RESTLightElementType - */ -public class BPELRESTLightUpdater { - - private static ICoreEndpointService endpointService; - private static ICoreEndpointService oldEndpointService; - private final DocumentBuilder builder; - private final DocumentBuilderFactory domFactory; - private final XPathFactory factory; - private final TransformerFactory transformerFactory; - private final Transformer transformer; - private CSARID csarId; - - private final static Logger LOG = LoggerFactory.getLogger(BPELRESTLightUpdater.class); - - - public BPELRESTLightUpdater() throws ParserConfigurationException, TransformerConfigurationException { - // initialize parsers - this.domFactory = DocumentBuilderFactory.newInstance(); - this.domFactory.setNamespaceAware(true); - this.builder = this.domFactory.newDocumentBuilder(); - this.factory = XPathFactory.newInstance(); - this.transformerFactory = TransformerFactory.newInstance(); - this.transformer = this.transformerFactory.newTransformer(); - } - - /** - *

    - * Changes endpoints (URIs) inside the given BPEL file. If the bpel file contains somewhere the - * tag {OPENTOSCA} the tag will be replaced by the actual host of the container - *

    - *

    - * If the BPEL file contains elements of BPEL4RESTLight (GET, PUT, POST, DELETE) it will check - * if the given URIs are services contained in the endpoint service and change them accordingly - *

    - * - * - * @param processFiles a list of files containing the complete content of a Apache ODE WS-BPEL - * 2.0 zip file - * @param csarId a identifier of the CSAR this BPEL file belongs to - * @return true only if some change was made - * @throws IOException is thrown when access of BPEL file failed - * @throws SAXException is thrown when parsing of BPEL file failed - */ - public boolean changeEndpoints(final List processFiles, final CSARID csarId) throws IOException, - SAXException { - this.csarId = csarId; - final File bpelFile = getBPELFile(processFiles); - - if (bpelFile == null) { - BPELRESTLightUpdater.LOG.debug("No bpel file found"); - return false; - } - - BPELRESTLightUpdater.LOG.debug("Parsing bpel file {} ", bpelFile.getAbsoluteFile()); - final Document document = this.builder.parse(bpelFile); - - // get the elements - final List elements = getAllBPELRESTLightElements(document); - - final Set localURIs = getRESTURI(elements); - final Set notChanged = new HashSet<>(); - - if (BPELRESTLightUpdater.endpointService != null) { - for (final URI localUri : localURIs) { - for (final RESTEndpoint endpoint : BPELRESTLightUpdater.endpointService.getRestEndpoints(localUri, - Settings.OPENTOSCA_CONTAINER_HOSTNAME, - this.csarId)) { - notChanged.addAll(changeAddress(endpoint, elements)); - } - } - } else { - BPELRESTLightUpdater.LOG.warn("No EndpointService available"); - } - - if (notChanged.isEmpty()) { - final DOMSource source = new DOMSource(document); - final StreamResult result = new StreamResult(bpelFile); - boolean wroteFile = false; - try { - this.transformer.transform(source, result); - wroteFile = true; - } - catch (final TransformerException e) { - wroteFile = false; - } - - return wroteFile; - } else { - // log couldn't change all uris inside bpel --> isn't valid anymore - BPELRESTLightUpdater.LOG.warn("Chouldn't change all URIs in bpel file"); - for (final BPELRESTLightElement element : notChanged) { - BPELRESTLightUpdater.LOG.warn("Could'nt change address in element {}", element.toString()); - } - - // just return true - return true; - } - } - - /** - * Retrieves all BPEL4RESTLight elements in the given DOM document. - * - * @param document the DOM document to look in - * @return a List of BPELRESTLightElements - */ - public List getAllBPELRESTLightElements(final Document document) { - BPELRESTLightUpdater.LOG.debug("Retrieving all BPEL4RESTLight elements"); - BPELRESTLightUpdater.LOG.debug("Retrieving PUT elements"); - final List elements = getBPELRESTLightElements(BPELRESTLightElementType.PUT, document); - BPELRESTLightUpdater.LOG.debug("Retrieving POST elements"); - elements.addAll(getBPELRESTLightElements(BPELRESTLightElementType.POST, document)); - BPELRESTLightUpdater.LOG.debug("Retrieving GET elements"); - elements.addAll(getBPELRESTLightElements(BPELRESTLightElementType.GET, document)); - BPELRESTLightUpdater.LOG.debug("Retrieving DELETE elements"); - elements.addAll(getBPELRESTLightElements(BPELRESTLightElementType.DELETE, document)); - return elements; - } - - /** - * Retrieves all BPEL4RESTLight elements of the given type (GET,PUT,POST,DELETE) - * - * @param type BPELRESTLightElementType to parse for - * @param document the DOM document to look in - * @return a List containing all elements of the given type - */ - private List getBPELRESTLightElements(final BPELRESTLightElementType type, - final Document document) { - String xpathExp = ""; - // using straight forward xpath expressions - // TODO do with namespace check - switch (type) { - case PUT: - xpathExp = "//*[local-name()='PUT']"; - break; - case POST: - xpathExp = "//*[local-name()='POST']"; - break; - case DELETE: - xpathExp = "//*[local-name()='DELETE']"; - break; - case GET: - xpathExp = "//*[local-name()='GET']"; - break; - } - final List elements = new LinkedList<>(); - NodeList result = null; - - final XPath xpath = this.factory.newXPath(); - XPathExpression expr; - try { - BPELRESTLightUpdater.LOG.debug("Querying document with {} ", xpathExp); - expr = xpath.compile(xpathExp); - result = (NodeList) expr.evaluate(document, XPathConstants.NODESET); - } - catch (final XPathExpressionException e) { - BPELRESTLightUpdater.LOG.error("Internal Error: XPath expression wasn't valid", e); - } - BPELRESTLightUpdater.LOG.debug("Found Elements: {} ", String.valueOf(result.getLength())); - for (int i = 0; i < result.getLength(); i++) { - // in this block the BPELRESTLightElement class assures that we - // change only elements which should be changed. - // the rules for this are written in the header of this class - BPELRESTLightElement element = null; - try { - final Node node = result.item(i); - element = new BPELRESTLightElement(node); - } - catch (final org.opentosca.container.engine.plan.plugin.bpel.util.BPELRESTLightElement.NoBPELRESTLightElementException e) { - BPELRESTLightUpdater.LOG.warn(e.getMessage()); - } - finally { - if (element != null) { - // adding element which can and should be changed to the - // list - elements.add(element); - } - } - } - return elements; - } - - /** - * Returns the URIs of the given BPELRESTLight elements - * - * @param elements a list of BPELRESTLight elements - * @return a set of URIs - */ - private Set getRESTURI(final List elements) { - // set is used to achieve that endpoint fetching is more efficient - final Set uris = new HashSet<>(); - for (final BPELRESTLightElement element : elements) { - if (element.getURI() != null) { - uris.add(element.getURI()); - } - } - return uris; - } - - /** - * Changes the URI in the given BPELRESTLight elements - * - * @param endpoint an endpoint with the uri - * @param elements a list of BPELRESTLight elements - * @return a list of NOT changed elements, if list is empty every element was changed - */ - private Set changeAddress(final RESTEndpoint endpoint, - final List elements) { - final List toRemove = new LinkedList<>(); - final Set notChanged = new HashSet<>(); - for (final BPELRESTLightElement element : elements) { - // the following check is pretty unstable, if the path isn't exactly - // the - // same. this could really happen if the service was deployed in - // some "nested" environment. - // Example: - // {serviceroot}/{somepath} are URIs of the REST service and after - // deployment the endpoint is - // host/someotherpath/{serviceroot}/{somepath} - // the path method would return - // someotherpath/{serviceroot}/{somepath} - // which isn't equal to {serviceroot}/{somepath} - final String endpointPath = normalizePath(endpoint.getURI().getPath()); - final String elementPath = normalizePath(element.getURI().getPath()); - if (endpointPath.equals(elementPath)) { - try { - BPELRESTLightUpdater.LOG.debug("Setting address in bpel4RestLight element "); - if (element.setURI(endpoint.getURI())) { - toRemove.add(element); - } - } - catch (final URISyntaxException e) { - BPELRESTLightUpdater.LOG.debug("Setting address failed (URISyntaxException): URI {}", - endpoint.getURI().toString()); - } - } - } - // remove changed elements - elements.removeAll(toRemove); - // return as set for uniqueness - notChanged.addAll(elements); - return notChanged; - } - - /** - * Adds Slashes ('/') at beginning and end of the given string - * - * @param path The String to modify - * @return returns a String where String.charAt(0) == '/' and String.charAt(String.length() - 1) - * == '/' - */ - private String normalizePath(final String path) { - String temp = path; - if (path.charAt(0) != '/') { - temp = "/" + path; - } - if (path.charAt(path.length() - 1) != '/') { - temp = temp + "/"; - } - return temp; - } - - /** - * Looks for the first BPEL file it finds in the given list - * - * @param files a list of files - * @return file which ends with .bpel, else null - */ - private File getBPELFile(final List files) { - for (final File file : files) { - final int pos = file.getName().lastIndexOf('.'); - if (pos > 0 && pos < file.getName().length() - 1) { - if (file.getName().substring(pos + 1).equals("bpel")) { - return file; - } - } - } - return null; - } - - /** - * Bind method for EndpointService - * - * @param endpointService the EndpointService to bind - */ - public void bindEndpointService(final ICoreEndpointService endpointService) { - if (endpointService != null) { - BPELRESTLightUpdater.LOG.debug("Registering EndpointService {}", endpointService.toString()); - if (BPELRESTLightUpdater.endpointService == null) { - BPELRESTLightUpdater.endpointService = endpointService; - } else { - BPELRESTLightUpdater.oldEndpointService = endpointService; - BPELRESTLightUpdater.endpointService = endpointService; - } - BPELRESTLightUpdater.LOG.debug("Registered EndpointService {}", endpointService.toString()); - } - } - - /** - * Unbind method for EndpointService - * - * @param endpointService the EndpointService to unbind - */ - public void unbindEndpointService(final ICoreEndpointService endpointService) { - BPELRESTLightUpdater.LOG.debug("Unregistering EndpointService {}", endpointService.toString()); - if (BPELRESTLightUpdater.oldEndpointService == null) { - BPELRESTLightUpdater.endpointService = null; - } else { - BPELRESTLightUpdater.oldEndpointService = null; - } - BPELRESTLightUpdater.LOG.debug("Unregistered EndpointService {}", endpointService.toString()); - } -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/Messages.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/Messages.java deleted file mode 100644 index 00d2fea69..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/Messages.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.opentosca.container.engine.plan.plugin.bpel.util; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - - private static final String BUNDLE_NAME = Messages.class.getPackage().getName() + ".messages"; - public static String BpelPlanEnginePlugin_engine; - public static String BpelPlanEnginePlugin_description; - public static String BpelPlanEnginePlugin_engineAddress; - public static String BpelPlanEnginePlugin_engineLoginName; - public static String BpelPlanEnginePlugin_engineLoginPw; - public static String BpelPlanEnginePlugin_language; - public static String BpelPlanEnginePlugin_capabilities; - public static String BpelPlanEnginPlugin_engineServiceRootAddress; - static { - // initialize resource bundle - NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class); - } - - - private Messages() { - } -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/ODEEndpointUpdater.java b/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/ODEEndpointUpdater.java deleted file mode 100644 index ae2f01cb6..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/ODEEndpointUpdater.java +++ /dev/null @@ -1,706 +0,0 @@ -package org.opentosca.container.engine.plan.plugin.bpel.util; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.wsdl.Service; -import javax.wsdl.WSDLException; -import javax.wsdl.extensions.ExtensibilityElement; -import javax.wsdl.extensions.http.HTTPAddress; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLReader; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.namespace.QName; -import javax.xml.transform.stream.StreamSource; - -import org.apache.ode.schemas.dd._2007._03.TDeployment; -import org.apache.ode.schemas.dd._2007._03.TInvoke; -import org.apache.ode.schemas.dd._2007._03.TProvide; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.engine.plan.plugin.bpel.BpelPlanEnginePlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.ibm.wsdl.extensions.http.HTTPConstants; -import com.ibm.wsdl.extensions.soap.SOAPConstants; - -/** - *

    - * This class implements functionality for updating bindings inside wsdl files which are referenced - * inside a Apache ODE deloy.xml file. - *

    - *

    - * The update is done on a list of files which must include one deploy.xml file (schema: - * http://svn.apache.org/viewvc/ode/trunk/bpel-schemas/src/main/xsd/) and wsdl files which are - * referenced inside the deploy.xml. - *

    - *

    - * This class uses the ICoreEndpointService to get the up-to-date endpoints from the openTOSCA Core - *

    - * - *
    - * Copyright 2012 IAAS University of Stuttgart
    - * - * @see org.opentosca.core.endpoint.service.ICoreEndpointService - * @see org.apache.ode.schemas.dd._2007._03.TDeployment - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class ODEEndpointUpdater { - - final private static Logger LOG = LoggerFactory.getLogger(ODEEndpointUpdater.class); - private final WSDLFactory factory; - private CSARID csarId; - // the services are static (bind/unbind too), if not, instantiation of - // this class will not have the services - private static ICoreEndpointService endpointService; - private static ICoreEndpointService oldEndpointService; - - private final String servicesRoot; - // @hahnml: The type of plan engine used (BPS or ODE) - private String engineType; - - // private static IToscaEngineService toscaEngineService = null; - - /** - * Contructor * - * - * @throws WSDLException if no instance of WSDLFactory was found - */ - public ODEEndpointUpdater(final String servicesRoot, final String engineType) throws WSDLException { - this.factory = WSDLFactory.newInstance(); - this.servicesRoot = servicesRoot; - this.engineType = engineType; - } - - /** - * Contructor - * - * @throws WSDLException if no instance of WSDLFactory was found - */ - public ODEEndpointUpdater() throws WSDLException { - this.factory = WSDLFactory.newInstance(); - this.servicesRoot = null; - } - - /** - * Changes the endpoints of all WSDL files used by the given WS-BPEL 2.0 Process - * - * @param processFiles a list of files containing the complete content of a Apache ODE WS-BPEL - * 2.0 zip file - * @param csarId the identifier of the CSAR where this process/plan is declared - * @return true if every WSDL file used by the process was updated (if needed) with endpoints - * from the openTOSCA Core, else false - */ - public boolean changeEndpoints(final List processFiles, final CSARID csarId) { - this.csarId = csarId; - - final Map> unchangedFiles = new HashMap<>(); - final File deployXml = getDeployXML(processFiles); - - if (deployXml == null) { - ODEEndpointUpdater.LOG.error("Given BPEL Plan has no deploy.xml file! Can't change addresses!"); - return false; - } - - // update addresses inside the process archive that are invoked by the - // plan - try { - final List portsInDeployXml = getInvokedDeployXMLPorts(deployXml); - // check with modelrepo if any of the qnames have to be thrown out - // cause they aren't referenced in the CSAR/TOSCA - - // quick fix,until we know how to "add" porttypes to tosca again - // if (ODEEndpointUpdater.modelRepoService != null) { - // List csarPortTypeReferences = - // ODEEndpointUpdater.toscaEngineService.getToscaReferenceMapper().getAllWSDLPortTypeReferencesInsideTHOR(csarId); - // List toRemove = new LinkedList(); - // for (QName portType : portsInDeployXml) { - // if (!csarPortTypeReferences.contains(portType)) { - // toRemove.add(portType); - // } - // } - // portsInDeployXml.removeAll(toRemove); - // } else { - // ODEEndpointUpdater.LOG.warn("No ModelRepositoryService is bound, - // may corrupt private wsdl files"); - // } - - if (!portsInDeployXml.isEmpty()) { - for (final QName portType : portsInDeployXml) { - ODEEndpointUpdater.LOG.debug("Proceeding to update address for portType: {}", portType); - } - final Map> changeMap = - getWSDLtoChange(portsInDeployXml, getAllWSDLFiles(processFiles)); - unchangedFiles.putAll(this.updateInvokedWSDLAddresses(changeMap)); - } else { - ODEEndpointUpdater.LOG.debug("No PortTypes to change were found: No portType in plan is referenced in ServiceTemplate"); - } - } - catch (final JAXBException e) { - ODEEndpointUpdater.LOG.error("Deploy.xml file in process isn't valid", e); - } - catch (final WSDLException e) { - ODEEndpointUpdater.LOG.error("Couldn't access wsdl files of process", e); - } - - // update addresses in bpel archive that are provided by the plan - try { - final List portsInDeployXml = getProvidedDeployXMLPorts(deployXml); - - final Map> changeMap = getWSDLtoChange(portsInDeployXml, getAllWSDLFiles(processFiles)); - unchangedFiles.putAll(this.updateProvidedWSDLAddresses(changeMap)); - - } - catch (final JAXBException e) { - e.printStackTrace(); - } - catch (final WSDLException e) { - e.printStackTrace(); - } - - for (final QName portType : unchangedFiles.keySet()) { - ODEEndpointUpdater.LOG.warn("Following files weren't changed for PortType {}", portType.toString()); - for (final File file : unchangedFiles.get(portType)) { - ODEEndpointUpdater.LOG.warn("WSDL file {} which contained portType {} and couldn't be updated", - file.toPath().toString(), portType.toString()); - } - } - - // as of recent events, when some address couldn't be changed we return - // true, even if nothing was changed - return true; - } - - /** - * Returns a file named deploy.xml,if it is in the list of files - * - * @param files a list of files - * @return a file object of a deploy.xml (can be invalid) file if it was found in the given - * list, else null - */ - private File getDeployXML(final List files) { - for (final File file : files) { - if (file.getName().equals("deploy.xml")) { - ODEEndpointUpdater.LOG.debug("Found deploy.xml file"); - return file; - } - } - ODEEndpointUpdater.LOG.debug("Didn't find deploy.xml file"); - return null; - } - - /** - * Returns a list of QName's which are referenced in the ODE deploy.xml File as invoked - * service.
    - * - * @param deployXML a file object of a valid deploy.xml File - * @return a list of QNames which represent the PortTypes used by the BPEL process to invoke - * operations - * @throws JAXBException if the JAXB parser couldn't work properly - */ - private List getInvokedDeployXMLPorts(final File deployXML) throws JAXBException { - // http://svn.apache.org/viewvc/ode/trunk/bpel-schemas/src/main/xsd/ - // grabbed that and using jaxb - final List qnames = new LinkedList<>(); - final JAXBContext context = - JAXBContext.newInstance("org.apache.ode.schemas.dd._2007._03", this.getClass().getClassLoader()); - final Unmarshaller unmarshaller = context.createUnmarshaller(); - final TDeployment deploy = unmarshaller.unmarshal(new StreamSource(deployXML), TDeployment.class).getValue(); - for (final org.apache.ode.schemas.dd._2007._03.TDeployment.Process process : deploy.getProcess()) { - for (final TInvoke invoke : process.getInvoke()) { - final QName serviceName = invoke.getService().getName(); - // add only qnames which aren't from the plan itself - if (!serviceName.getNamespaceURI().equals(process.getName().getNamespaceURI())) { - qnames.add(new QName(serviceName.getNamespaceURI(), invoke.getService().getPort())); - } - } - } - return qnames; - } - - /** - * Returns a List of Services referenced in the provide elements of the given deploy.xml file - * - * @param deployXML a Apache ODE deploy.xml file - * @return a List of QNames denoting services - * @throws JAXBException is thrown when the given file can't be parsed - */ - private List getProvidedDeployXMLPorts(final File deployXML) throws JAXBException { - final List ports = new ArrayList<>(); - final JAXBContext context = - JAXBContext.newInstance("org.apache.ode.schemas.dd._2007._03", this.getClass().getClassLoader()); - final Unmarshaller unmarshaller = context.createUnmarshaller(); - final TDeployment deploy = unmarshaller.unmarshal(new StreamSource(deployXML), TDeployment.class).getValue(); - for (final org.apache.ode.schemas.dd._2007._03.TDeployment.Process process : deploy.getProcess()) { - for (final TProvide provide : process.getProvide()) { - final QName serviceName = provide.getService().getName(); - // add only qnames which aren't from the plan itself - - // @hahnml: The plan generator assigns to provided services addresses like - // http://[IP]:8080 - // which is fine for WSO2 BPS but won't work for Apache ODE. ODE rejects the - // deployment if the service addresses do not follow the following schema: - // http://[IP]:[Port]/ode/processes/[ServiceName]. - // Added an engine type check so that for ODE, also the provided process service - // ports are added. - if (this.engineType.equals(BpelPlanEnginePlugin.BPS_ENGINE)) { - if (!serviceName.getNamespaceURI().equals(process.getName().getNamespaceURI())) { - ports.add(new QName(serviceName.getNamespaceURI(), provide.getService().getPort())); - } - } else { - ports.add(new QName(serviceName.getNamespaceURI(), provide.getService().getPort())); - } - } - } - return ports; - } - - /** - * Returns all WSDL files of the given List - * - * @param files a list of files - * @return a list of WSDL files if there are any - */ - private List getAllWSDLFiles(final List files) { - final List tempFiles = new LinkedList<>(); - for (final File file : files) { - if (file.isDirectory()) { - // recursive call to allow searching in directories - ODEEndpointUpdater.LOG.debug("Found directory inside bpel archive: {}", file.getAbsolutePath()); - final File[] subFiles = file.listFiles(); - // this is just here to transform the array to a list - final List temp = new LinkedList<>(); - for (final File subFile : subFiles) { - temp.add(subFile); - } - tempFiles.addAll(getAllWSDLFiles(temp)); - } - final int pos = file.getName().lastIndexOf('.'); - if (pos > 0 && pos < file.getName().length() - 1) { - if (file.getName().substring(pos + 1).equals("wsdl")) { - ODEEndpointUpdater.LOG.debug("Adding .wsdl file {} ", file.getName()); - tempFiles.add(file); - } - } - } - return tempFiles; - } - - /** - * Returns a map with QNames as keys and list of files as values, where the QNames are taken out - * of the given list of portTypes and the files from the other given List - * - * @param ports a list of portType QName's - * @param wsdlFiles a list of wsdl Files - * @return a Map> containing information which porttype is in which wsdl file - * @throws WSDLException - */ - private Map> getWSDLtoChange(final List ports, - final List wsdlFiles) throws WSDLException { - final Map> portTypeToFileMap = new HashMap<>(); - // we check if we have any porttypes which isn't in the endpoint db - for (final QName port : ports) { - ODEEndpointUpdater.LOG.debug("Searching through wsdls for porttype: {}", port.toString()); - final List filesContainingPortType = new LinkedList<>(); - QName portType = null; - for (final File wsdlFile : wsdlFiles) { - ODEEndpointUpdater.LOG.debug("Checking if wsdl file {} contains portType {}", - wsdlFile.getAbsolutePath(), port.toString()); - final Definition wsdlDef = this.getWSDLReader().readWSDL(wsdlFile.getAbsolutePath()); - // check if port is in wsdl file - if (!checkIfPortIsInWsdlDef(port, wsdlDef)) { - continue; - } else { - portType = getPortTypeFromPort(port, wsdlDef); - } - - for (final Object obj : wsdlDef.getPortTypes().values()) { - final PortType portTypeInWsdl = (PortType) obj; - // TODO when axis1 service port and porttype have the same - // name, - // still don't know what the problem will be if it happens, - // cause i check only portTypes here - // please send me an email with the problem - if (portTypeInWsdl.getQName().toString().equals(portType.toString())) { - // this wsdl file contains the porttype - filesContainingPortType.add(wsdlFile); - } - } - } - if (!filesContainingPortType.isEmpty() && portType != null) { - // found wsdl files with this porttype - portTypeToFileMap.put(portType, filesContainingPortType); - } - } - return portTypeToFileMap; - } - - private WSDLReader getWSDLReader() { - WSDLReader reader = this.factory.newWSDLReader(); - reader.setFeature("javax.wsdl.verbose", false); - return reader; - } - - /** - * Returns a PortType as QName if the given port is defined inside the given WSDL Definition - * - * @param port the Port to check with as QName - * @param wsdlDef the WSDL Definition to look trough - * @return a QName representing the PortType implemented by the given Port if it was found - * inside the WSDL Definition, else null - */ - private QName getPortTypeFromPort(final QName port, final Definition wsdlDef) { - for (final Object serviceObj : wsdlDef.getServices().values()) { - final Service service = (Service) serviceObj; - for (final Object portObj : service.getPorts().values()) { - final Port wsdlPort = (Port) portObj; - if (wsdlPort.getName().equals(port.getLocalPart()) - && wsdlDef.getTargetNamespace().equals(port.getNamespaceURI())) { - return wsdlPort.getBinding().getPortType().getQName(); - } - } - } - return null; - } - - /** - * Checks whether the given Port is defined inside the given WSDL Definition - * - * @param port the Port to check with as QName - * @param wsdlDef the WSDL Definition to check in - * @return true if the Port is found inside the given WSDL Definition, else false - */ - private boolean checkIfPortIsInWsdlDef(final QName port, final Definition wsdlDef) { - for (final Object serviceObj : wsdlDef.getServices().values()) { - final Service service = (Service) serviceObj; - for (final Object portObj : service.getPorts().values()) { - final Port wsdlPort = (Port) portObj; - final String namespace = wsdlDef.getTargetNamespace(); - final String name = wsdlPort.getName(); - ODEEndpointUpdater.LOG.debug("Checking if port {} matches port with name {} and namespace {} ", - port.toString(), name, namespace); - if (name.equals(port.getLocalPart()) && namespace.equals(port.getNamespaceURI())) { - return true; - } - - } - } - return false; - } - - private Map> updateProvidedWSDLAddresses(final Map> changeMap) throws WSDLException { - final Map> notChanged = new HashMap<>(); - for (final QName portType : changeMap.keySet()) { - final List notUpdateWSDLs = new ArrayList<>(); - - for (final File wsdlFile : changeMap.get(portType)) { - if (!this.updateProvidedWSDLAddresses(portType, wsdlFile)) { - notUpdateWSDLs.add(wsdlFile); - } - } - if (!notUpdateWSDLs.isEmpty()) { - notChanged.put(portType, notUpdateWSDLs); - } - - } - return notChanged; - } - - /** - * Updates the addresses in the given WSDL files by using endpoints added in the endpoint db - * - * @param map a map containing > pairs. A QName here represents a portType that - * is inside the files - * @return returns a map > containing all the files which weren't changed - * @throws WSDLException - */ - private Map> updateInvokedWSDLAddresses(final Map> map) throws WSDLException { - final Map> notChanged = new HashMap<>(); - for (final QName portType : map.keySet()) { - final List notUpdatedWSDLs = new LinkedList<>(); - // update wsdl files associated with the given porttype - for (final File wsdlFile : map.get(portType)) { - if (!this.updateInvokedWSDLAddresses(portType, wsdlFile)) { - ODEEndpointUpdater.LOG.error("Unable to update '{}' for porttype '{}'.", wsdlFile.toString(), - portType.toString()); - notUpdatedWSDLs.add(wsdlFile); - } - } - if (!notUpdatedWSDLs.isEmpty()) { - // if empty, nothing was changed - ODEEndpointUpdater.LOG.debug("Couldn't update address for porttype: {}", portType.toString()); - notChanged.put(portType, notUpdatedWSDLs); - } - } - return notChanged; - } - - private boolean updateProvidedWSDLAddresses(final QName portType, final File wsdlFile) throws WSDLException { - boolean changed = false; - final Definition wsdlDef = this.getWSDLReader().readWSDL(wsdlFile.getAbsolutePath()); - for (final Object o : wsdlDef.getAllServices().values()) { - final Service service = (Service) o; - for (final Object obj : service.getPorts().values()) { - final Port port = (Port) obj; - if (port.getBinding().getPortType().getQName().equals(portType)) { - if (changePortAddressWithBpelEngineEndpoints(service, port)) { - changed = true; - } - } - } - } - try { - // if we changed something, rewrite the the wsdl - if (changed) { - this.factory.newWSDLWriter().writeWSDL(wsdlDef, new FileOutputStream(wsdlFile)); - } - } - catch (final FileNotFoundException e) { - ODEEndpointUpdater.LOG.debug("Couldn't locate wsdl file", e); - changed = false; - } - return changed; - } - - /** - * Updates the addresses inside the given WSDL file by using endpoints inside the endpoint db - * - * @param portType a QName which represents a PortType - * @param wsdl a File which is from type .wsdl - * @throws WSDLException if the WSDL parser couldn't parse - */ - private boolean updateInvokedWSDLAddresses(final QName portType, final File wsdl) throws WSDLException { - boolean changed = false; - ODEEndpointUpdater.LOG.debug("Trying to change WSDL file {} ", wsdl.getName()); - final Definition wsdlDef = this.getWSDLReader().readWSDL(wsdl.getAbsolutePath()); - for (final Object o : wsdlDef.getAllServices().values()) { - // get the services - final Service service = (Service) o; - for (final Object obj : service.getPorts().values()) { - // get the ports of the service - final Port port = (Port) obj; - if (port.getBinding().getPortType().getQName().equals(portType)) { - // get binding and its porttype - // get the extensible elements out of wsdl and check them - // with endpointservice - - ODEEndpointUpdater.LOG.debug("Found matching porttype for WSDL file {} ", wsdl.getName()); - if (changePortAddressWithEndpointDB(port)) { - // changing -> success - changed = true; - } - } - } - } - try { - // if we changed something, rewrite the the wsdl - if (changed) { - this.factory.newWSDLWriter().writeWSDL(wsdlDef, new FileOutputStream(wsdl)); - } - } - catch (final FileNotFoundException e) { - ODEEndpointUpdater.LOG.debug("Couldn't locate wsdl file", e); - changed = false; - } - return changed; - } - - private boolean changePortAddressWithBpelEngineEndpoints(final Service service, final Port port) { - boolean changed = false; - - for (final Object obj : port.getExtensibilityElements()) { - final ExtensibilityElement element = (ExtensibilityElement) obj; - for (final WSDLEndpoint endpoint : getWSDLEndpointForBpelEngineCallback(service, port)) { - if (changeAddress(element, endpoint)) { - changed = true; - } - } - } - - return changed; - } - - /** - * Changes address in the given port if endpoint in the endpoint service is available - * - * @param port the Port to update - * @return true if change was made, else false - */ - private boolean changePortAddressWithEndpointDB(final Port port) { - boolean changed = false; - - ODEEndpointUpdater.LOG.debug("Trying to match address element with available endpoints for port {} ", - port.getName()); - for (final Object obj : port.getExtensibilityElements()) { - // in the wsdl spec they use the extensibility mechanism - final ExtensibilityElement element = (ExtensibilityElement) obj; - for (final WSDLEndpoint endpoint : getWSDLEndpointsFromEndpointDB(port)) { - - if (changeAddress(element, endpoint)) { - changed = true; - } - - } - } - return changed; - } - - private List getWSDLEndpointForBpelEngineCallback(final Service service, final Port port) { - final List endpoints = new ArrayList<>(); - - /* - * The WSO2 BPS and Apache ODE are creating addresses by using the Service Name - * OpenTOSCA_On_VSphere.csarInvokerService - * location="http://10.0.2.15:9763/services/OpenTOSCA_On_VSphere. csarInvokerService/ - * - * The only difference is the servicesRoot which is '/services/..' for BPS and - * '/ode/processes/..' for ODE. - */ - String callbackEndpoint = ""; - if (this.servicesRoot.endsWith("/")) { - callbackEndpoint += this.servicesRoot + service.getQName().getLocalPart(); - } else { - callbackEndpoint += this.servicesRoot + "/" + service.getQName().getLocalPart(); - } - - try { - final String localContainer = Settings.OPENTOSCA_CONTAINER_HOSTNAME; - endpoints.add(new WSDLEndpoint(new URI(callbackEndpoint), port.getBinding().getPortType().getQName(), - localContainer, localContainer, null, null, null, null, null, new HashMap())); - } - catch (final URISyntaxException e) { - e.printStackTrace(); - } - - return endpoints; - } - - /** - * Returns a list of WSDLEndpoints for the specific Port from the endpoint DB - * - * @param port the Port to check for - * @return a list containing all WSDLEndpoints that matches the portTypes of the given Port - */ - private List getWSDLEndpointsFromEndpointDB(final Port port) { - final List endpoints = new LinkedList<>(); - if (ODEEndpointUpdater.endpointService != null) { - ODEEndpointUpdater.LOG.debug("Fetching Endpoints for PortType {} ", - port.getBinding().getPortType().getQName().toString()); - final List temp = - ODEEndpointUpdater.endpointService.getWSDLEndpoints(port.getBinding().getPortType().getQName(), - Settings.OPENTOSCA_CONTAINER_HOSTNAME, this.csarId); - for (final WSDLEndpoint endpoint : temp) { - ODEEndpointUpdater.LOG.debug("Found endpoint: {}", endpoint.getURI().toString()); - endpoints.add(endpoint); - } - } else { - ODEEndpointUpdater.LOG.debug("Endpoint service not available"); - } - return endpoints; - } - - /** - * Changes the address in the given ExtensibilityElement to address given in the given - * WSDLEndpoint - * - * @param element the ExtensibilityElement to change - * @param endpoint the WSDLEndpoint containing the address - * @return true if changing was successful, this means the ExtensibilityElement had the type - * {@link com.ibm.wsdl.extensions.soap.SOAPConstants.Q_ELEM_SOAP_ADDRESS} or - * {@link com.ibm.wsdl.extensions.http.HTTPConstants.Q_ELEM_HTTP_ADDRESS} , else false - */ - private boolean changeAddress(final ExtensibilityElement element, final WSDLEndpoint endpoint) { - // TODO check if we could generalize this, we did once, but after - // looking at it again it seems not right enough - if (element.getElementType().equals(SOAPConstants.Q_ELEM_SOAP_ADDRESS)) { - ODEEndpointUpdater.LOG.debug("Changing the SOAP-Address Element inside for porttype {} ", - endpoint.getPortType().toString()); - final SOAPAddress address = (SOAPAddress) element; - address.setLocationURI(endpoint.getURI().toString()); - } else if (element.getElementType().equals(HTTPConstants.Q_ELEM_HTTP_ADDRESS)) { - ODEEndpointUpdater.LOG.debug("Changing the HTTP-Address Element inside for porttype {} ", - endpoint.getPortType().toString()); - final HTTPAddress address = (HTTPAddress) element; - address.setLocationURI(endpoint.getURI().toString()); - } else { - ODEEndpointUpdater.LOG.debug("Address element inside WSDL isn't supported"); - return false; - } - return true; - } - - /** - * Bind method for EndpointService - * - * @param endpointService the EndpointService to bind - */ - protected static void bindEndpointService(final ICoreEndpointService endpointService) { - if (endpointService != null) { - ODEEndpointUpdater.LOG.debug("Registering EndpointService {}", endpointService.toString()); - if (ODEEndpointUpdater.endpointService == null) { - ODEEndpointUpdater.endpointService = endpointService; - } else { - ODEEndpointUpdater.oldEndpointService = endpointService; - ODEEndpointUpdater.endpointService = endpointService; - } - ODEEndpointUpdater.LOG.debug("Registered EndpointService {}", endpointService.toString()); - } - } - - /** - * Unbind method for EndpointService - * - * @param endpointService the EndpointService to unbind - */ - protected static void unbindEndpointService(final ICoreEndpointService endpointService) { - ODEEndpointUpdater.LOG.debug("Unregistering EndpointService {}", endpointService.toString()); - if (ODEEndpointUpdater.oldEndpointService == null) { - ODEEndpointUpdater.endpointService = null; - } else { - ODEEndpointUpdater.oldEndpointService = null; - } - ODEEndpointUpdater.LOG.debug("Unregistered EndpointService {}", endpointService.toString()); - } - - /** - * Returns PortType of the bpel process composed of the given files list - * - * @param planContents List of Files which make up the BPEL Process - * @return QName which should be exactly the PortType of the given BPEL Process - */ - public QName getPortType(final List planContents) { - try { - final File deployXML = getDeployXML(planContents); - final JAXBContext context = - JAXBContext.newInstance("org.apache.ode.schemas.dd._2007._03", this.getClass().getClassLoader()); - final Unmarshaller unmarshaller = context.createUnmarshaller(); - final TDeployment deploy = - unmarshaller.unmarshal(new StreamSource(deployXML), TDeployment.class).getValue(); - for (final TDeployment.Process process : deploy.getProcess()) { - return process.getName(); - } - } - catch (final JAXBException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/messages.properties b/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/messages.properties deleted file mode 100644 index ab5b98c94..000000000 --- a/org.opentosca.container.engine.plan.plugin.bpel/src/org/opentosca/container/engine/plan/plugin/bpel/util/messages.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Default properties for Apache ODE BPEL Engine -BpelPlanEnginePlugin_engine=ODE -BpelPlanEnginePlugin_engineAddress=http://localhost:9763/ode -BpelPlanEnginePlugin_engineLoginName= -BpelPlanEnginePlugin_engineLoginPw= -BpelPlanEnginePlugin_language=http://docs.oasis-open.org/wsbpel/2.0/process/executable -BpelPlanEnginePlugin_capabilities=http://docs.oasis-open.org/wsbpel/2.0/process/executable -BpelPlanEnginePlugin_description=openTOSCA PlanEngine WS-BPEL 2.0 Plugin v1.0 -BpelPlanEnginPlugin_engineServiceRootAddress=http://localhost:9763/ode/processes - -# Default properties for WSO2 BPS BPEL Engine -#BpelPlanEnginePlugin_engine=BPS -#BpelPlanEnginePlugin_engineAddress=https://localhost:9443 -#BpelPlanEnginePlugin_engineLoginName=admin -#BpelPlanEnginePlugin_engineLoginPw=admin -#BpelPlanEnginePlugin_language=http://docs.oasis-open.org/wsbpel/2.0/process/executable -#BpelPlanEnginePlugin_capabilities=http://docs.oasis-open.org/wsbpel/2.0/process/executable -#BpelPlanEnginePlugin_description=openTOSCA PlanEngine WSO2 BPS WS-BPEL 2.0 Plugin v1.0 -#BpelPlanEnginPlugin_engineServiceRootAddress=http://localhost:9763/services \ No newline at end of file diff --git a/org.opentosca.container.engine.plan.plugin.camunda/META-INF/MANIFEST.MF b/org.opentosca.container.engine.plan.plugin.camunda/META-INF/MANIFEST.MF deleted file mode 100644 index 47464f5e3..000000000 --- a/org.opentosca.container.engine.plan.plugin.camunda/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Plan Engine BPEL 2.0 Plugin for Camunda -Bundle-SymbolicName: org.opentosca.container.engine.plan.plugin.camunda -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: - org.apache.commons.io;version="2.2.0", - org.apache.http;version="4.3.3", - org.apache.http.client;version="4.5.2", - org.apache.http.client.methods;version="4.5.2", - org.apache.http.entity;version="4.3.3", - org.apache.http.entity.mime;version="4.5.2", - org.apache.http.entity.mime.content;version="4.5.2", - org.apache.http.impl.client;version="4.5.2", - org.apache.http.util;version="4.4.6", - org.eclipse.osgi.util;version="1.1.0", - org.json.simple, - org.json.simple.parser, - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.6.4" -Bundle-Activator: org.opentosca.container.engine.plan.plugin.camunda.Activator -Service-Component: OSGI-INF/* -Bundle-ActivationPolicy: lazy -Require-Bundle: org.opentosca.container.core, - org.opentosca.container.core.tosca, - org.opentosca.container.engine.plan, - org.apache.httpcomponents.httpclient diff --git a/org.opentosca.container.engine.plan.plugin.camunda/OSGI-INF/CamundaPlanEnginePlugin_component.xml b/org.opentosca.container.engine.plan.plugin.camunda/OSGI-INF/CamundaPlanEnginePlugin_component.xml deleted file mode 100644 index 4d06e6a5e..000000000 --- a/org.opentosca.container.engine.plan.plugin.camunda/OSGI-INF/CamundaPlanEnginePlugin_component.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/org.opentosca.container.engine.plan.plugin.camunda/build.properties b/org.opentosca.container.engine.plan.plugin.camunda/build.properties deleted file mode 100644 index 98d41e652..000000000 --- a/org.opentosca.container.engine.plan.plugin.camunda/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/, diff --git a/org.opentosca.container.engine.plan.plugin.camunda/pom.xml b/org.opentosca.container.engine.plan.plugin.camunda/pom.xml index ca80063d9..8d98f24bf 100644 --- a/org.opentosca.container.engine.plan.plugin.camunda/pom.xml +++ b/org.opentosca.container.engine.plan.plugin.camunda/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 @@ -10,6 +10,33 @@ org.opentosca.container.engine.plan.plugin.camunda - eclipse-plugin + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.container.engine.plan + ${project.version} + + + org.opentosca + org.opentosca.container.legacy + ${project.version} + compile + + + org.apache.httpcomponents + httpmime + 4.5.1 + + + com.googlecode.json-simple + json-simple + 1.1.1 + + diff --git a/org.opentosca.container.engine.plan.plugin.camunda/src/main/java/org/opentosca/container/engine/plan/plugin/camunda/CamundaPlanEnginePlugin.java b/org.opentosca.container.engine.plan.plugin.camunda/src/main/java/org/opentosca/container/engine/plan/plugin/camunda/CamundaPlanEnginePlugin.java new file mode 100644 index 000000000..a151bae24 --- /dev/null +++ b/org.opentosca.container.engine.plan.plugin.camunda/src/main/java/org/opentosca/container/engine/plan/plugin/camunda/CamundaPlanEnginePlugin.java @@ -0,0 +1,379 @@ +package org.opentosca.container.engine.plan.plugin.camunda; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPlan.PlanModelReference; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.FileBody; +import org.apache.http.entity.mime.content.StringBody; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.impl.service.FileSystem; +import org.opentosca.container.core.model.AbstractArtifact; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.csar.backwards.ArtifactResolver; +import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; +import org.opentosca.container.core.next.model.PlanLanguage; +import org.opentosca.container.core.service.CsarStorageService; +import org.opentosca.container.core.service.ICoreEndpointService; +import org.opentosca.container.core.service.IHTTPService; +import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +@Service +@NonNullByDefault +/** + * This class implements functionality for the deployment and undeployment of BPMN 2.0 Processes on + * the Camunda BPMN Engine.
    + *
    + * + * Copyright 2019 IAAS University of Stuttgart
    + *
    + */ +public class CamundaPlanEnginePlugin implements IPlanEnginePlanRefPluginService { + + final private static Logger LOG = LoggerFactory.getLogger(CamundaPlanEnginePlugin.class); + + private static final String CAMUNDA_DESCRIPTION = "OpenTOSCA PlanEngine Camunda BPMN 2.0 Plugin v1.0"; + private static final String DEPLOYMENT_SUFFIX = "/deployment"; + private static final String CREATE_SUFFIX = "/create"; + private static final String PROCESS_DEFINITION_SUFFIX = "/process-definition"; + private static final String INSTANCE_CREATION_SUFFIX = "/submit-form"; + + private final JSONParser jsonParser = new JSONParser(); + private final ICoreEndpointService endpointService; + private final CsarStorageService storage; + private final IHTTPService httpService; + + @Inject + public CamundaPlanEnginePlugin(ICoreEndpointService endpointService, CsarStorageService storage, IHTTPService httpService) { + this.endpointService = endpointService; + this.storage = storage; + this.httpService = httpService; + } + + @Override + public boolean deployPlanReference(final QName planId, final PlanModelReference planRef, final CsarId csarId) { + LOG.debug("Trying to deploy plan with ID {} on Camunda BPMN engine...", planId); + Path fetchedPlan = planLocationOnDisk(csarId, planId, planRef); + return deployPlanFile(fetchedPlan, csarId, planId); + } + + /** + * Deploys the given plan into the Camunda BPMN engine + * + * @param planPath the path to the zip file containing the plan and its artifacts + * @param csarId the ID of the CSAR to which the plan belongs + * @param planId the QName to identify the plan + * @return true if deployment is successful, false otherwise + */ + private boolean deployPlanFile(final Path planPath, final CsarId csarId, final QName planId) { + LOG.debug("Starting to deploy plan from retrieved file..."); + + // create temporary directory and unzip plan + final List planContents; + try { + planContents = FileSystem.unzip(planPath, FileSystem.getTemporaryFolder()); + } catch (IOException e) { + LOG.info("Failed to extract plan contents for plan {} in CSAR {}", planId, csarId.csarName()); + return false; + } + LOG.debug("Plan contains {} files.", planContents.size()); + + // create Post request for the Camunda REST API + final HttpPost deploymentRequest = new HttpPost(Settings.ENGINE_PLAN_BPMN_URL + DEPLOYMENT_SUFFIX + CREATE_SUFFIX); + + // only deploy if plan was not deployed before or files have changed + final StringBody enableDuplicateFiltering = new StringBody("false", ContentType.TEXT_PLAIN); + final StringBody deployChangedOnly = new StringBody("false", ContentType.TEXT_PLAIN); + final StringBody deploymentName = new StringBody(planId.toString(), ContentType.TEXT_PLAIN); + + // add required meta data to the request + final MultipartEntityBuilder builder = MultipartEntityBuilder.create() + .addPart("deployment-name", deploymentName) + .addPart("enable-duplicate-filtering", enableDuplicateFiltering) + .addPart("deploy-changed-only", deployChangedOnly); + + // add all files contained in the plan to the request + for (final Path file : planContents) { + final FileBody fileBody = new FileBody(file.toFile()); + builder.addPart(file.getFileName().toString(), fileBody); + } + + try (final CloseableHttpClient httpClient = HttpClients.createDefault()) { + // send Post request to the engine + final HttpEntity httpEntity = builder.build(); + deploymentRequest.setEntity(httpEntity); + HttpResponse response = httpClient.execute(deploymentRequest); + + if (response.getStatusLine().getStatusCode() != 200) { + LOG.error("Response returned status code: {}", response.getStatusLine().getStatusCode()); + return false; + } + + // get the ID of the created deployment + final JSONObject json = (JSONObject) jsonParser.parse(EntityUtils.toString(response.getEntity())); + if (!json.containsKey("id")) { + LOG.error("Deployment response contains no ID for further processing!"); + return false; + } + + final String id = json.get("id").toString(); + LOG.debug("Deployment has the following ID: {}", id); + + // get all process definition IDs of the created deployment + final URIBuilder uriBuilder = new URIBuilder(Settings.ENGINE_PLAN_BPMN_URL + PROCESS_DEFINITION_SUFFIX); + uriBuilder.setParameter("deploymentId", id); + final HttpGet getProcessDefinition = new HttpGet(uriBuilder.build()); + response = httpClient.execute(getProcessDefinition); + + final JSONArray processDefinitions = (JSONArray) jsonParser.parse(EntityUtils.toString(response.getEntity())); + if (processDefinitions.isEmpty()) { + LOG.error("No process definitions contained in created deployment!"); + return false; + } + + // get the first process definition and create corresponding endpoint + final JSONObject planProcessDefinition = (JSONObject) processDefinitions.get(0); + final String planDefinitionID = planProcessDefinition.get("id").toString(); + final URI endpoint = new URI(Settings.ENGINE_PLAN_BPMN_URL + PROCESS_DEFINITION_SUFFIX + + "/" + planDefinitionID + INSTANCE_CREATION_SUFFIX); + final WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(endpoint, null, Settings.OPENTOSCA_CONTAINER_HOSTNAME, + Settings.OPENTOSCA_CONTAINER_HOSTNAME, csarId, null, planId, null, null, Collections.emptyMap()); + endpointService.storeWSDLEndpoint(wsdlEndpoint); + return true; + } catch (final ClientProtocolException e) { + LOG.error("A ClientProtocolException occured while sending post to the engine: ", e); + return false; + } catch (final IOException e) { + LOG.error("An IOException occured while sending post to the engine: ", e); + return false; + } catch (final ParseException e) { + LOG.error("A ParseException occured while parsing response to Json: ", e); + return false; + } catch (final URISyntaxException e) { + LOG.error("An URISyntaxException occured while creating URI to retrieve the process ID: ", e); + return false; + } + } + + @Override + public boolean undeployPlanReference(final QName planId, final PlanModelReference planRef, final CsarId csarId) { + LOG.debug("Trying to undeploy plan with ID {} from Camund BPMN engine...", planId); + + // get endpoint related to the plan and extract process definition ID from the URI + final WSDLEndpoint endpoint = endpointService.getWSDLEndpointForPlanId(Settings.OPENTOSCA_CONTAINER_HOSTNAME, csarId, planId); + final String[] endpointParts = endpoint.getURI().toString().split("/"); + + if (endpointParts.length < 2) { + LOG.error("Unable to parse process definition ID for plan {} out of endpoint {}", planId, endpoint.getURI()); + return false; + } + + final String processDefinitionID = endpointParts[endpointParts.length - 2]; + LOG.debug("Extracted following process definition ID: {}", processDefinitionID); + + try (final CloseableHttpClient httpClient = HttpClients.createDefault()) { + // get information for process definition to extract related deployment ID + final HttpGet getProcessDefinition = new HttpGet(Settings.ENGINE_PLAN_BPMN_URL + PROCESS_DEFINITION_SUFFIX + + "/" + processDefinitionID); + final HttpResponse processDefinitionResponse = httpClient.execute(getProcessDefinition); + + if (processDefinitionResponse.getStatusLine().getStatusCode() != 200) { + LOG.error("Request to retrieve process definition returned invalid status code {}", + processDefinitionResponse.getStatusLine().getStatusCode()); + return false; + } + + // extract deployment ID from Json response + final String processDefinitionInformation = EntityUtils.toString(processDefinitionResponse.getEntity()); + final JSONObject json = (JSONObject) jsonParser.parse(processDefinitionInformation); + if (!json.containsKey("deploymentId")) { + LOG.error("Deployment response contains no ID for further processing!"); + return false; + } + final String deploymentID = json.get("deploymentId").toString(); + LOG.debug("Extracted following deployment ID for deletion {}", deploymentID); + + // delete the deployment and all related process definitions and instances + final URIBuilder uriBuilder = new URIBuilder(Settings.ENGINE_PLAN_BPMN_URL + DEPLOYMENT_SUFFIX + "/" + deploymentID); + uriBuilder.setParameter("cascade", "true"); + final HttpDelete deleteDeployment = new HttpDelete(uriBuilder.build()); + final HttpResponse deletionResponse = httpClient.execute(deleteDeployment); + + // check success and reutrn to caller + if (deletionResponse.getStatusLine().getStatusCode() == 204) { + LOG.debug("Deletion of plan deployment successful."); + return true; + } else { + LOG.error("Deletion response returned invalid status code {}", + deletionResponse.getStatusLine().getStatusCode()); + return false; + } + } catch (final IOException e) { + LOG.error("An IOException occured while sending post to the Camunda engine: ", e); + return false; + } catch (final ParseException e) { + LOG.error("A ParseException occured while parsing response to Json: ", e); + return false; + } catch (final URISyntaxException e) { + LOG.error("An URISyntaxException occured while building delete URL", e); + return false; + } + } + + @Nullable + private Path planLocationOnDisk(CsarId csarId, QName planId, PlanModelReference planRef) { + if (storage == null) { + return null; + } + @SuppressWarnings("null") // ignore MT implications + Csar csar = storage.findById(csarId); + TPlan toscaPlan; + try { + toscaPlan = ToscaEngine.resolvePlanReference(csar, planId); + } catch (NotFoundException e) { + LOG.error("Plan [{}] could not be found in csar {}", planId, csarId.csarName()); + return null; + } + TServiceTemplate containingServiceTemplate = ToscaEngine.getContainingServiceTemplate(csar, toscaPlan); + assert (containingServiceTemplate != null); // shouldn't be null, since we have a plan from it + + // planRef.getReference() is overencoded. It's also not relative to the Csar root (but to one level below it) + Path planLocation = ArtifactResolver.resolvePlan.apply(containingServiceTemplate, toscaPlan); + // FIXME get rid of AbstractArtifact! + AbstractArtifact planReference = ArtifactResolver.resolveArtifact(csar, planLocation, + // just use the last segment, determining the filename. + Paths.get(planRef.getReference().substring(planRef.getReference().lastIndexOf('/') + 1))); + if (planReference == null) { + LOG.error("Plan reference '{}' resulted in a null ArtifactReference.", + planRef.getReference()); + return null; + } + if (!planReference.isFileArtifact()) { + LOG.warn("Only plan references pointing to a file are supported!"); + return null; + } + Path artifact; + try { + artifact = planReference.getFile("").getFile(); + } catch (SystemException e) { + LOG.warn("ugh... SystemException when getting a path we already had", e); + return null; + } + if (!artifact.getFileName().toString().endsWith(".war")) { + LOG.debug("Plan reference is not a WAR file. It was '{}'.", artifact.getFileName()); + return null; + } + return artifact; + } + + private URI searchForEndpoint(final String planName) throws URISyntaxException { + URI endpointURI; + LOG.debug("Search for Plan Endpoint"); + + final String processDefinitions = "http://localhost:8080/engine-rest/process-definition/"; + + HttpResponse response; + String output = null; + + LOG.debug("Retrieve list of deployed plans"); + try { + response = httpService.Get(processDefinitions); + output = EntityUtils.toString(response.getEntity(), "UTF-8"); + output = output.substring(1, output.length() - 1); + } catch (final IOException e) { + LOG.error("An error occured while retrieving the deployed plan list from camunda: ", + e.getLocalizedMessage()); + e.printStackTrace(); + return null; + } + final String json = output; + + LOG.trace("Response json: {}", json); + + final String[] list = json.split("\\{"); + + final HashMap ids = new HashMap<>(); + + for (final String entry : list) { + if (null != entry && !entry.equals("")) { + final String[] fields = entry.split(","); + + final String id = fields[0].substring(6, fields[0].length() - 1); + final String key = fields[1].substring(7, fields[1].length() - 1); + + ids.put(id, key); + LOG.trace("ID {} KEY {}", id, key); + } + } + + String planID = ""; + + if (ids.containsValue(planName)) { + for (final String id : ids.keySet()) { + if (ids.get(id).equals(planName)) { + planID = ids.get(id); + } + } + } + + if (planID.equals("")) { + LOG.warn("No endpoint found for plan {}!", planName); + return null; + } + + endpointURI = new URI(processDefinitions + "key/" + planID + "/start"); + return endpointURI; + } + + @Override + public String getLanguageUsed() { + return PlanLanguage.BPMN.toString(); + } + + @Override + public List getCapabilties() { + return Collections.singletonList(PlanLanguage.BPMN.toString()); + } + + @Override + public String toString() { + return CAMUNDA_DESCRIPTION; + } +} diff --git a/org.opentosca.container.engine.plan.plugin.camunda/src/org/opentosca/container/engine/plan/plugin/camunda/Activator.java b/org.opentosca.container.engine.plan.plugin.camunda/src/org/opentosca/container/engine/plan/plugin/camunda/Activator.java deleted file mode 100644 index 912ecb288..000000000 --- a/org.opentosca.container.engine.plan.plugin.camunda/src/org/opentosca/container/engine/plan/plugin/camunda/Activator.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.opentosca.container.engine.plan.plugin.camunda; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger LOG = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /** - * {@inheritDoc} - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - LOG.debug("Starting Camunda Engine Bundle..."); - Activator.context = bundleContext; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - LOG.debug("Terminating Camunda Engine Bundle..."); - Activator.context = null; - } -} diff --git a/org.opentosca.container.engine.plan.plugin.camunda/src/org/opentosca/container/engine/plan/plugin/camunda/CamundaPlanEnginePlugin.java b/org.opentosca.container.engine.plan.plugin.camunda/src/org/opentosca/container/engine/plan/plugin/camunda/CamundaPlanEnginePlugin.java deleted file mode 100644 index 4e7d777e0..000000000 --- a/org.opentosca.container.engine.plan.plugin.camunda/src/org/opentosca/container/engine/plan/plugin/camunda/CamundaPlanEnginePlugin.java +++ /dev/null @@ -1,421 +0,0 @@ -package org.opentosca.container.engine.plan.plugin.camunda; - -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; - -import javax.xml.namespace.QName; - -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.entity.mime.content.FileBody; -import org.apache.http.entity.mime.content.StringBody; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.opentosca.container.core.common.Settings; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.model.AbstractArtifact; -import org.opentosca.container.core.model.AbstractFile; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.model.endpoint.wsdl.WSDLEndpoint; -import org.opentosca.container.core.next.model.PlanLanguage; -import org.opentosca.container.core.service.ICoreEndpointService; -import org.opentosca.container.core.service.ICoreFileService; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.container.core.tosca.model.TPlan.PlanModelReference; -import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class implements functionality for the deployment and undeployment of BPMN 2.0 Processes on - * the Camunda BPMN Engine.
    - *
    - * - * Copyright 2019 IAAS University of Stuttgart
    - *
    - */ -public class CamundaPlanEnginePlugin implements IPlanEnginePlanRefPluginService { - - final private static Logger LOG = LoggerFactory.getLogger(CamundaPlanEnginePlugin.class); - - private final String CAMUNDA_DESCRIPTION = "OpenTOSCA PlanEngine Camunda BPMN 2.0 Plugin v1.0"; - private final String DEPLOYMENT_SUFFIX = "/deployment"; - private final String CREATE_SUFFIX = "/create"; - private final String PROCESS_DEFINITION_SUFFIX = "/process-definition"; - private final String INSTANCE_CREATION_SUFFIX = "/submit-form"; - - private ICoreFileService fileService = null; - private IToscaEngineService toscaEngine = null; - private IFileAccessService fileAccessService = null; - private ICoreEndpointService endpointService = null; - private final JSONParser parser = new JSONParser(); - - @Override - public boolean deployPlanReference(final QName planId, final PlanModelReference planRef, final CSARID csarId) { - LOG.debug("Trying to deploy plan with ID {} on Camunda BPMN engine...", planId); - - if (Objects.isNull(this.fileService)) { - LOG.error("Unable to deploy plan reference with file service equal to null!"); - return false; - } - - // get CSAR containing the plan - CSARContent csar = null; - try { - csar = this.fileService.getCSAR(csarId); - } - catch (final UserException exc) { - LOG.error("An User Exception occured while retrieving the CSAR: {}", exc); - return false; - } - - final AbstractArtifact planReference = this.toscaEngine.getPlanModelReferenceAbstractArtifact(csar, planId); - if (Objects.isNull(planReference) || !planReference.isFileArtifact()) { - LOG.error("Referenced artifact is invalid!"); - return false; - } - - final AbstractFile plan = planReference.getFile(""); - if (Objects.isNull(plan) || !plan.getName().substring(plan.getName().lastIndexOf('.') + 1).equals("zip")) { - LOG.debug("Plan reference is not a ZIP file!"); - return false; - } - - Path fetchedPlan = null; - try { - fetchedPlan = plan.getFile(); - } - catch (final SystemException exc) { - LOG.error("An System Exception occured while fetching the plan file: {}", exc); - return false; - } - - return deployPlanFile(fetchedPlan, csarId, planId); - } - - /** - * Deploys the given plan into the Camunda BPMN engine - * - * @param planPath the path to the zip file containing the plan and its artifacts - * @param csarId the ID of the CSAR to which the plan belongs - * @param planId the QName to identify the plan - * @return true if deployment is successful, false otherwise - */ - private boolean deployPlanFile(final Path planPath, final CSARID csarId, final QName planId) { - LOG.debug("Starting to deploy plan from retrieved file..."); - - if (Objects.isNull(this.fileAccessService)) { - LOG.error("FileAccessService is not available, can't create needed temporary space on disk!"); - return false; - } - - if (Objects.isNull(this.endpointService)) { - LOG.error("EndpointService is not available, unable to create plan endpoint!"); - return false; - } - - // create temporary directory and unzip plan - final File tempDir = this.fileAccessService.getTemp(); - final List planContents = this.fileAccessService.unzip(planPath.toFile(), tempDir); - LOG.debug("Plan contains {} files.", planContents.size()); - - // create Post request for the Camunda REST API - final HttpPost deploymentRequest = - new HttpPost(Settings.ENGINE_PLAN_BPMN_URL + this.DEPLOYMENT_SUFFIX + this.CREATE_SUFFIX); - - // only deploy if plan was not deployed before or files have changed - final StringBody enableDuplicateFiltering = new StringBody("false", ContentType.TEXT_PLAIN); - final StringBody deployChangedOnly = new StringBody("false", ContentType.TEXT_PLAIN); - final StringBody deploymentName = new StringBody(planId.toString(), ContentType.TEXT_PLAIN); - - // add required meta data to the request - final MultipartEntityBuilder builder = - MultipartEntityBuilder.create().addPart("deployment-name", deploymentName) - .addPart("enable-duplicate-filtering", enableDuplicateFiltering) - .addPart("deploy-changed-only", deployChangedOnly); - - // add all files contained in the plan to the request - for (final File file : planContents) { - final FileBody fileBody = new FileBody(file); - builder.addPart(file.getName(), fileBody); - } - - final CloseableHttpClient httpClient = HttpClients.createDefault(); - try { - // send Post request to the engine - final HttpEntity httpEntity = builder.build(); - deploymentRequest.setEntity(httpEntity); - HttpResponse response = httpClient.execute(deploymentRequest); - - if (response.getStatusLine().getStatusCode() != 200) { - LOG.error("Response returned status code: {}", response.getStatusLine().getStatusCode()); - return false; - } - - // get the ID of the created deployment - final JSONObject json = (JSONObject) this.parser.parse(EntityUtils.toString(response.getEntity())); - if (!json.containsKey("id")) { - LOG.error("Deployment response contains no ID for further processing!"); - return false; - } - final String id = json.get("id").toString(); - LOG.debug("Deployment has the following ID: {}", id); - - // get all process definition IDs of the created deployment - final URIBuilder uriBuilder = - new URIBuilder(Settings.ENGINE_PLAN_BPMN_URL + this.PROCESS_DEFINITION_SUFFIX); - uriBuilder.setParameter("deploymentId", id); - final HttpGet getProcessDefinition = new HttpGet(uriBuilder.build()); - response = httpClient.execute(getProcessDefinition); - - final JSONArray processDefinitions = - (JSONArray) this.parser.parse(EntityUtils.toString(response.getEntity())); - if (processDefinitions.isEmpty()) { - LOG.error("No process definitions contained in created deployment!"); - return false; - } - - // get the first process definition and create corresponding endpoint - final JSONObject planProcessDefinition = (JSONObject) processDefinitions.get(0); - final String planDefinitionID = planProcessDefinition.get("id").toString(); - final URI endpoint = new URI(Settings.ENGINE_PLAN_BPMN_URL + this.PROCESS_DEFINITION_SUFFIX + "/" - + planDefinitionID + this.INSTANCE_CREATION_SUFFIX); - final WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(endpoint, null, Settings.OPENTOSCA_CONTAINER_HOSTNAME, - Settings.OPENTOSCA_CONTAINER_HOSTNAME, csarId, null, planId, null, null, new HashMap()); - this.endpointService.storeWSDLEndpoint(wsdlEndpoint); - return true; - } - catch (final ClientProtocolException e) { - LOG.error("An ClientProtocolException occured while sending post to the engine:", e); - return false; - } - catch (final IOException e) { - LOG.error("An IOException occured while sending post to the engine:", e); - return false; - } - catch (final org.json.simple.parser.ParseException e) { - LOG.error("An ParseException occured while parsing response to Json:", e); - return false; - } - catch (final URISyntaxException e) { - LOG.error("An URISyntaxException occured while creating URI to retrieve the process ID:", e); - return false; - } - finally { - try { - httpClient.close(); - } - catch (final IOException e) { - // ignore - } - } - } - - @Override - public boolean undeployPlanReference(final QName planId, final PlanModelReference planRef, final CSARID csarId) { - LOG.debug("Trying to undeploy plan with ID {} from Camunda BPMN engine...", planId); - - if (Objects.isNull(this.endpointService)) { - LOG.error("EndpointService is null. Unable to retrieve endpoint for undeployment!"); - return false; - } - - // get endpoint related to the plan and extract process definition ID from URI - final WSDLEndpoint endpoint = - this.endpointService.getWSDLEndpointForPlanId(Settings.OPENTOSCA_CONTAINER_HOSTNAME, csarId, planId); - final String[] endpointParts = endpoint.getURI().toString().split("/"); - - if (endpointParts.length < 2) { - LOG.error("Unable to parse process definition ID out of endpoint: {}", endpoint.getURI()); - return false; - } - - final String processDefinitionID = endpointParts[endpointParts.length - 2]; - LOG.debug("Extracted following process definition ID: {}", processDefinitionID); - - final CloseableHttpClient httpClient = HttpClients.createDefault(); - try { - // get information for process definition to extract related deployment ID - final HttpGet getProcessDefinition = - new HttpGet(Settings.ENGINE_PLAN_BPMN_URL + this.PROCESS_DEFINITION_SUFFIX + "/" + processDefinitionID); - final HttpResponse processDefinitionResponse = httpClient.execute(getProcessDefinition); - - if (processDefinitionResponse.getStatusLine().getStatusCode() != 200) { - LOG.error("Request to retrieve process definition returned invalid status code: {}", - processDefinitionResponse.getStatusLine().getStatusCode()); - return false; - } - - // extract deployment ID from Json response - final String processDefinitionInformation = EntityUtils.toString(processDefinitionResponse.getEntity()); - final JSONObject json = (JSONObject) this.parser.parse(processDefinitionInformation); - if (!json.containsKey("deploymentId")) { - LOG.error("Deployment response contains no ID for further processing!"); - return false; - } - final String deploymentID = json.get("deploymentId").toString(); - LOG.debug("Extracted following deployment ID for deletion: {}", deploymentID); - - // delete the deployment and all related process definitions and instances - final URIBuilder uriBuilder = - new URIBuilder(Settings.ENGINE_PLAN_BPMN_URL + this.DEPLOYMENT_SUFFIX + "/" + deploymentID); - uriBuilder.setParameter("cascade", "true"); - final HttpDelete deleteDeployment = new HttpDelete(uriBuilder.build()); - final HttpResponse deletionResponse = httpClient.execute(deleteDeployment); - - // check success and return to caller - if (deletionResponse.getStatusLine().getStatusCode() == 204) { - LOG.debug("Deletion of plan deployment successful."); - return true; - } else { - LOG.error("Deletion response returned invalid status code: {}", - deletionResponse.getStatusLine().getStatusCode()); - return false; - } - } - catch (final IOException e) { - LOG.error("An IOException occured while sending post to the Camunda engine: {}", e); - return false; - } - catch (final org.json.simple.parser.ParseException e) { - LOG.error("An ParseException occured while parsing response to Json: {}", e); - return false; - } - catch (final URISyntaxException e) { - LOG.error("An URISyntaxException occured while building delete URL: {}", e); - return false; - } - finally { - try { - httpClient.close(); - } - catch (final IOException e) { - // ignore - } - } - } - - @Override - public String getLanguageUsed() { - return PlanLanguage.BPMN.toString(); - } - - @Override - public List getCapabilties() { - return Arrays.asList(PlanLanguage.BPMN.toString()); - } - - @Override - public String toString() { - return this.CAMUNDA_DESCRIPTION; - } - - /** - * Bind method for IFileServices - * - * @param fileService the file service to bind - */ - public void registerFileService(final ICoreFileService fileService) { - - if (Objects.nonNull(fileService)) { - this.fileService = fileService; - } - } - - /** - * Unbind method for IFileServices - * - * @param fileService the file service to unbind - */ - protected void unregisterFileService(final ICoreFileService fileService) { - LOG.debug("Unregistering FileService {}", fileService.toString()); - this.fileService = null; - } - - /** - * Bind method for IToscaEngineService - * - * @param service the IToscaEngineService to bind - */ - public void registerToscaEngine(final IToscaEngineService engineService) { - LOG.debug("Registering IToscaEngineService {}", engineService.toString()); - if (Objects.nonNull(engineService)) { - this.toscaEngine = engineService; - } - } - - /** - * Unbind method for IToscaEngineService - * - * @param endpointService the IToscaEngineService to unbind - */ - protected void unregisterToscaEngine(final IToscaEngineService engineService) { - LOG.debug("Unregistering IToscaEngineService {}", engineService.toString()); - this.toscaEngine = null; - } - - /** - * Bind method for IFileAccessServices - * - * @param fileAccessService the fileAccessService to bind - */ - public void registerFileAccessService(final IFileAccessService fileAccessService) { - LOG.debug("Registering FileAccessService {}", fileAccessService.toString()); - if (Objects.nonNull(fileAccessService)) { - this.fileAccessService = fileAccessService; - } - } - - /** - * Unbind method for IFileAccessServices - * - * @param fileAccessService the fileAccessService to unbind - */ - protected void unregisterFileAccessService(final IFileAccessService fileAccessService) { - LOG.debug("Unregistering IFileAccessService {}", fileAccessService.toString()); - this.fileAccessService = null; - } - - /** - * Bind method for ICoreEndpointServices - * - * @param endpointService the endpointService to bind - */ - public void registerEndpointService(final ICoreEndpointService endpointService) { - LOG.debug("Registering EndpointService {}", endpointService.toString()); - if (Objects.nonNull(endpointService)) { - this.endpointService = endpointService; - } - } - - /** - * Unbind method for ICoreEndpointServices - * - * @param endpointService the endpointService to unbind - */ - protected void unregisterEndpointService(final ICoreEndpointService endpointService) { - LOG.debug("Unregistering EndpointService {}", endpointService.toString()); - this.endpointService = null; - } -} diff --git a/org.opentosca.container.engine.plan/META-INF/MANIFEST.MF b/org.opentosca.container.engine.plan/META-INF/MANIFEST.MF deleted file mode 100644 index 6d76af60c..000000000 --- a/org.opentosca.container.engine.plan/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Plan Engine -Bundle-SymbolicName: org.opentosca.container.engine.plan -Bundle-Version: 2.0.0.qualifier -Export-Package: org.opentosca.container.engine.plan, - org.opentosca.container.engine.plan.impl, - org.opentosca.container.engine.plan.plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Import-Package: org.osgi.framework;version="1.8.0", - org.slf4j;version="1.7.2" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0" -Service-Component: OSGI-INF/* diff --git a/org.opentosca.container.engine.plan/OSGI-INF/PlanEngineImpl_component.xml b/org.opentosca.container.engine.plan/OSGI-INF/PlanEngineImpl_component.xml deleted file mode 100644 index c9ff97b1b..000000000 --- a/org.opentosca.container.engine.plan/OSGI-INF/PlanEngineImpl_component.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.opentosca.container.engine.plan/build.properties b/org.opentosca.container.engine.plan/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.container.engine.plan/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.container.engine.plan/pom.xml b/org.opentosca.container.engine.plan/pom.xml index 01558e1c6..0c4f004f3 100644 --- a/org.opentosca.container.engine.plan/pom.xml +++ b/org.opentosca.container.engine.plan/pom.xml @@ -1,6 +1,6 @@ + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 @@ -10,6 +10,17 @@ org.opentosca.container.engine.plan - eclipse-plugin + + + com.github.opentosca.winery + org.eclipse.winery.model.tosca + + + org.opentosca + org.opentosca.container.core + ${project.version} + compile + + diff --git a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/IPlanEngineService.java b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/IPlanEngineService.java similarity index 92% rename from org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/IPlanEngineService.java rename to org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/IPlanEngineService.java index d1ab34af1..1bdb801df 100644 --- a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/IPlanEngineService.java +++ b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/IPlanEngineService.java @@ -5,9 +5,10 @@ import java.util.List; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPlans; +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPlans; + +import org.opentosca.container.core.model.csar.CsarId; /** * This interface defines highlevel methods for deploying, undeploying of plans specified in the @@ -36,7 +37,7 @@ public interface IPlanEngineService { * @param csarId The id of CSAR file where the TPlans are defined * @return returns a list of plans which couldn't be deployed */ - public List deployPlans(TPlans plans, String targetNamespace, CSARID csarId); + public List deployPlans(TPlans plans, String targetNamespace, CsarId csarId); /** * Undeploys the given TPlans @@ -48,7 +49,7 @@ public interface IPlanEngineService { * @param csarId The id of CSAR file where the TPlans are contained * @return returns a list of TPlan's which coulnd't be undeployed */ - public List undeployPlans(TPlans plans, String targetNamespace, CSARID csarId); + public List undeployPlans(TPlans plans, String targetNamespace, CsarId csarId); /** * Deploys the given TPlan @@ -60,7 +61,7 @@ public interface IPlanEngineService { * @param csarId The id of CSAR file where this TPlan is contained * @return true if deployment was successful, else false */ - public boolean deployPlan(TPlan plan, String targetNamespace, CSARID csarId); + public boolean deployPlan(TPlan plan, String targetNamespace, CsarId csarId); /** * Undeploys the given TPlan @@ -71,6 +72,5 @@ public interface IPlanEngineService { * @param csarId The id of CSAR file where this TPlan is contained * @return true if undeployment was successful, else false */ - public boolean undeployPlan(TPlan plan, String targetNamspace, CSARID csarId); - + public boolean undeployPlan(TPlan plan, String targetNamspace, CsarId csarId); } diff --git a/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/impl/PlanEngineImpl.java b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/impl/PlanEngineImpl.java new file mode 100644 index 000000000..e499239fd --- /dev/null +++ b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/impl/PlanEngineImpl.java @@ -0,0 +1,227 @@ +package org.opentosca.container.engine.plan.impl; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.inject.Singleton; +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TPlan; +import org.eclipse.winery.model.tosca.TPlans; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.opentosca.container.core.model.capability.provider.ProviderType; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.service.ICoreCapabilityService; +import org.opentosca.container.engine.plan.IPlanEngineService; +import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanModelPluginService; +import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * This class implements the interface {@link IPlanEngineService} and provides functionality for deployment/undeployment + * of plans. + *

    + * Plugins which implement the interfaces {@link org.opentosca.container.engine.plan.plugin.IPlanEnginePlanModelPluginService} + * and {@link org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService} are discovered and injected + * through Spring. The plans (of class TPlan) are delegated to the compatible plugin for deployment/undeployment. + *

    + * Where the plans are deployed is business of the respective plugins. There should always be only one plugin for plans + * written in the same language. + */ +@Service +@Singleton // only instantiate once, to correctly store capabilities in capabilityService +@NonNullByDefault +public class PlanEngineImpl implements IPlanEngineService { + + final private static Logger LOG = LoggerFactory.getLogger(PlanEngineImpl.class); + + private final Map planReferencePlugins = Collections.synchronizedMap(new HashMap<>()); + private final Map planModelPlugins = Collections.synchronizedMap(new HashMap<>()); + + @Inject + public PlanEngineImpl(ICoreCapabilityService capabilityService, + // nullable because required = false injects null instead of an empty collection if no matching beans were found + // required = false because otherwise at least one implementation is expected + @Autowired(required = false) @Nullable Collection modelPlugins, + @Autowired(required = false) @Nullable Collection referencePlugins) { + if (modelPlugins != null) { + modelPlugins.forEach(mp -> capabilityService.storeCapabilities(mp.getCapabilties(), mp.toString(), ProviderType.PLAN_PLUGIN)); + this.planModelPlugins.putAll(modelPlugins.stream().collect(Collectors.toMap(IPlanEnginePlanModelPluginService::getLanguageUsed, Function.identity()))); + } + if (referencePlugins != null) { + referencePlugins.forEach(rp -> capabilityService.storeCapabilities(rp.getCapabilties(), rp.toString(), ProviderType.PLAN_PLUGIN)); + this.planReferencePlugins.putAll(referencePlugins.stream().collect(Collectors.toMap(IPlanEnginePlanRefPluginService::getLanguageUsed, Function.identity()))); + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean deployPlan(final TPlan plan, final String targetNamespace, final CsarId csarId) { + final String language = plan.getPlanLanguage(); + // XOR between PlanModel and PlanModelReference + if (plan.getPlanModel() != null) { + LOG.info("Searching PlanModelPlugin for plan {}", plan.getId()); + final IPlanEnginePlanModelPluginService plugin = this.getModelPlugin(language); + if (plugin == null) { + LOG.warn("No PlanModelPlugin available for plan {}", plan.getId()); + return false; + } + LOG.info("Found PlanModelPlugin for plan {}", plan.getId()); + return plugin.deployPlan(plan.getPlanModel(), csarId.toOldCsarId()); + } + final QName planId = new QName(targetNamespace, plan.getId()); + LOG.debug("Created new management plan id " + planId); + LOG.info("Searching PlanReferencePlugin for plan {} written in language {}", plan.getId(), language); + final IPlanEnginePlanRefPluginService plugin = this.getRefPlugin(language); + if (plugin == null) { + LOG.warn("No PlanReferencePlugin available for plan {}", plan.getId()); + return false; + } + LOG.info("Found PlanReferencePlugin for plan {}", plan.getId()); + return plugin.deployPlanReference(planId, plan.getPlanModelReference(), csarId); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean undeployPlan(final TPlan plan, final String targetNamespace, final CsarId csarId) { + final String language = plan.getPlanLanguage(); + if (plan.getPlanModel() != null) { + LOG.info("Searching PlanModelPlugin for plan {}", plan.getId()); + final IPlanEnginePlanModelPluginService plugin = this.getModelPlugin(language); + if (plugin == null) { + LOG.warn("No PlanModelPlugin available for plan {}", plan.getId()); + return false; + } + LOG.info("Found PlanModelPlugin for plan {}", plan.getId()); + return plugin.undeployPlan(plan.getPlanModel(), csarId.toOldCsarId()); + } + final QName planId = new QName(targetNamespace, plan.getId()); + LOG.debug("Created new management plan id" + planId); + LOG.info("Searching PlanReferencePlugin for plan {}", plan.getId()); + final IPlanEnginePlanRefPluginService plugin = this.getRefPlugin(language); + if (plugin == null) { + LOG.warn("No PlanReferencePlugin available for plan {}", plan.getId()); + return false; + } + LOG.info("Found PlanReferencePlugin for plan {}", plan.getId()); + return plugin.undeployPlanReference(planId, plan.getPlanModelReference(), csarId); + } + + /** + * {@inheritDoc} + */ + @Override + public List deployPlans(final TPlans plans, final String targetNamespace, final CsarId csarId) { + final List nonDeployedPlans = new LinkedList<>(); + final List p = plans.getPlan(); + + String namespace = plans.getTargetNamespace(); + if (namespace == null) { + namespace = targetNamespace; + } + + if (namespace == null) { + LOG.error("No namespace for Plans {} defined. Plugins communication with toscaEngine may be wrong", + plans.toString()); + return p; + } + + for (final TPlan plan : p) { + if (!this.deployPlan(plan, namespace, csarId)) { + nonDeployedPlans.add(plan); + } + } + + if (nonDeployedPlans.isEmpty()) { + LOG.info("Deployment of plans was successful"); + } else { + LOG.error("Deployment of plans failed"); + for (final TPlan plan : nonDeployedPlans) { + LOG.error("Couldn't deploy plan {}", plan.getName()); + } + } + return nonDeployedPlans; + } + + /** + * {@inheritDoc} + */ + @Override + public List undeployPlans(final TPlans plans, final String targetNamespace, final CsarId csarId) { + final List nonUndeployedPlans = new LinkedList<>(); + final List p = plans.getPlan(); + + String namespace = plans.getTargetNamespace(); + if (namespace == null) { + namespace = targetNamespace; + } + + if (namespace == null) { + LOG.error("No namespace for Plans {} defined. Plugins communication with toscaEngine may be wrong", + plans.toString()); + return p; + } + + for (final TPlan plan : p) { + // FIXME plans.getTargetNamespace can be null, then the + // targetNamespace has to be taken of the Service Template or Definitions + if (!this.undeployPlan(plan, namespace, csarId)) { + nonUndeployedPlans.add(plan); + } + } + + if (nonUndeployedPlans.isEmpty()) { + LOG.info("Undeployment of plans was successful"); + } else { + LOG.error("Undeployment of plans failed"); + for (final TPlan plan : nonUndeployedPlans) { + LOG.error("Couldn't undeploy plan {}", plan.getName()); + } + } + return nonUndeployedPlans; + } + + /** + * Returns a PlanEnginePlanModelPlugin capable of processing the given plan + * + * @param language the language of the plan + * @return PlanEnginePlanModelPlugin if there is a plugin, else null + */ + private IPlanEnginePlanModelPluginService getModelPlugin(final String language) { + return this.planModelPlugins.get(language); + } + + /** + * Returns a PlanEnginePlanRefPlugin capable of processing the given plan + * + * @param language the language of the plan + * @return PlanEnginePlanRefPlugin if there is a plugin, else null + */ + private IPlanEnginePlanRefPluginService getRefPlugin(final String language) { + return this.planReferencePlugins.get(language); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return "openTOSCA PlanEngine v1.0"; + } +} diff --git a/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanModelPluginService.java b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanModelPluginService.java new file mode 100644 index 000000000..6d68911cd --- /dev/null +++ b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanModelPluginService.java @@ -0,0 +1,46 @@ +package org.opentosca.container.engine.plan.plugin; + +import org.eclipse.winery.model.tosca.TPlan.PlanModel; + +import org.opentosca.container.core.model.csar.id.CSARID; + +/** + * This is a subinterface of {@link org.opentosca.container.engine.plan.plugin.IPlanEnginePluginService} and specifies + * handling of PlanModel elements inside a Plan element specified in Topology and Orchestration Specification for Cloud + * Applications Version 1.0 Chapter 11: Plans. + *

    + * A PlanModel element declares a Plan which is directly written inside ServiceTemplate, for example a bash script. This + * means the plugin must deploy the script on a appropiate system capable of executing it. + */ +public interface IPlanEnginePlanModelPluginService extends IPlanEnginePluginService { + + /** + *

    + * Method allows deployment of PlanModels + *

    + *

    + * In addition a service implementing {@link org.opentosca.core.endpoint.service.ICoreEndpointService} must provide + * a suitable endpoint. + *

    + * + * @param planModel the PlanModel element inside a Plan element of a ServiceTemplate Definition + * @param csarId the identifier of the CSAR this PlanModel element belongs to + * @return true if deployment was successful, else false + */ + public boolean deployPlan(PlanModel planModel, CSARID csarId); + + /** + *

    + * Method allows undeployment of PlanModels + *

    + *

    + * In addition a service implementing {@link org.opentosca.core.endpoint.service.ICoreEndpointService} must provide + * a suitable endpoint. + *

    + * + * @param planModel the PlanModel element inside a Plan element of a ServiceTemplate Definition + * @param csarId the identifier of the CSAR this PlanModel element belongs to + * @return true if undeployment was successful, else false + */ + public boolean undeployPlan(PlanModel planModel, CSARID csarId); +} diff --git a/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanRefPluginService.java b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanRefPluginService.java new file mode 100644 index 000000000..b16ca092e --- /dev/null +++ b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanRefPluginService.java @@ -0,0 +1,52 @@ +package org.opentosca.container.engine.plan.plugin; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TPlan.PlanModelReference; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.opentosca.container.core.model.csar.CsarId; + +/** + * This is a subinterface of {@link org.opentosca.container.engine.plan.plugin.IPlanEnginePluginService} and specifies + * handling of PlanReference elements inside a Plan element specified in Topology and Orchestration Specification for + * Cloud Applications Version 1.0 Chapter 11: Plans. + *

    + * The plugin musn't resolve the {@link org.opentosca.model.tosca.TPlan.PlanModelReference}, a service implementing + * {@link org.opentosca.core.file.service.ICoreFileService} should be called for the raw data. + */ +@NonNullByDefault +public interface IPlanEnginePlanRefPluginService extends IPlanEnginePluginService { + + /** + *

    + * Method allows deployment of PlanModelReferences. + *

    + *

    + * The reference must be resolved in a service implementing {@link org.opentosca.core.file.service.ICoreFileService}. + * In addition a service of {@link org.opentosca.core.endpoint.service.ICoreEndpointService} must provide a suitable + * endpoint. + *

    + * + * @param planRef the PlanReference element under a Plan element of a ServiceTemplate Definition + * @param csarId the identifier of the CSAR the PlanReference element belongs to + * @return true if deployment was successful, else false + */ + public boolean deployPlanReference(QName planId, PlanModelReference planRef, CsarId csarId); + + /** + *

    + * Method allows undeployment of PlanModelReferences. + *

    + *

    + * The reference must be resolved in a service implementing {@link org.opentosca.core.file.service.ICoreFileService}. + * In addition a service of {@link org.opentosca.core.endpoint.service.ICoreEndpointService} must provide a suitable + * endpoint. + *

    + * + * @param planRef the PlanReference element under a Plan element of a ServiceTemplate Definition + * @param csarId the identifier of the CSAR the PlanReference element belongs to + * @return true if undeployment was successful, else false + */ + public boolean undeployPlanReference(QName planId, PlanModelReference planRef, CsarId csarId); +} diff --git a/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePluginService.java b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePluginService.java new file mode 100644 index 000000000..fea075def --- /dev/null +++ b/org.opentosca.container.engine.plan/src/main/java/org/opentosca/container/engine/plan/plugin/IPlanEnginePluginService.java @@ -0,0 +1,46 @@ +package org.opentosca.container.engine.plan.plugin; + +import java.util.List; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * This interface is the superinterface for all plugins used by {@link org.opentosca.planengine.service.impl.PlanEngineImpl}. + *

    + * The plugins are splitted into two types, this is because there are two ways to declare a Plan in Topology and + * Orchestration Specification for Cloud Applications Version 1.0 Chapter 11: Plans + * + *

  • The {@link IPlanEnginePlanModelPluginService} interface is responsible for PlanModel elements + * inside the Plan element, the interface specifies plugins which can read the contents of the element and deploy them + * unto a compatible environment. Example: bash script on linux machine + * + *
  • The {@link IPlanEnginePlanRefPluginService} interface is responsible for PlanReference + * elements inside a Plan element. These elements reference plan implementations which can't be written directly into + * the ServiceTemplate and are packaged for deployment. Example: WS-BPEL 2.0 Process which has to be deployed unto a + * WSO2 BPS + *

    + * Deployment of Plans is completely plugin dependend, this means the PlanEngine doesn't say where to deploy/install the + * plan, this must be handled by the plugin itself. + */ +@NonNullByDefault +public interface IPlanEnginePluginService { + + /** + *

    + * Returns the exact plan language understood by this plugin. + *

    + *

    + * Example: if the plugin can process WS-BPEL 2.0 Processes it should return "http://docs.oasis-open.org/wsbpel/2.0/process/executable" + *

    + * + * @return a string representation of the plan language understood by this plugin + */ + public String getLanguageUsed(); + + /** + * Returns provided capabilities of this plugin. + * + * @return a list of strings denoting the capabilities of this plugin + */ + public List getCapabilties(); +} diff --git a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/Activator.java b/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/Activator.java deleted file mode 100644 index 7f805ba45..000000000 --- a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.engine.plan; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/impl/PlanEngineImpl.java b/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/impl/PlanEngineImpl.java deleted file mode 100644 index dc476b0f5..000000000 --- a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/impl/PlanEngineImpl.java +++ /dev/null @@ -1,347 +0,0 @@ -package org.opentosca.container.engine.plan.impl; - -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.capability.provider.ProviderType; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.ICoreCapabilityService; -import org.opentosca.container.core.tosca.model.TPlan; -import org.opentosca.container.core.tosca.model.TPlans; -import org.opentosca.container.engine.plan.IPlanEngineService; -import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanModelPluginService; -import org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class implements the interface {@link org.opentosca.planengine.service.IPlanEngineService} - * and provides functionality for deployment/undeployment of plans. - * - * The implementation uses the OSGi Framework to look for plugins which implement the interfaces - * {@link org.opentosca.container.engine.plan.plugin.IPlanEnginePlanModelPluginService} and - * {@link org.opentosca.container.engine.plan.plugin.IPlanEnginePlanRefPluginService} . The plans - * (of class TPlan) are delegated to the compatible plugin for deployment/undeployment. - * - * Where the plans are deployed is business of the respective plugins. There should always be only - * one plugin for plans written in the same language. - */ -public class PlanEngineImpl implements IPlanEngineService { - - // stores PlanReferencePlugins - private final Map refPluginsList = - Collections.synchronizedMap(new HashMap()); - // stores PlanModelPlugins - private final Map modelPluginsList = - Collections.synchronizedMap(new HashMap()); - private ICoreCapabilityService capabilityService; - private ICoreCapabilityService oldCapabilityService; - - final private static Logger LOG = LoggerFactory.getLogger(PlanEngineImpl.class); - - - /** - * {@inheritDoc} - */ - @Override - public boolean deployPlan(final TPlan plan, final String targetNamespace, final CSARID csarId) { - boolean planCheck; - final String language = plan.getPlanLanguage(); - // XOR between PlanModel and PlanModelReference - if (plan.getPlanModel() != null) { - PlanEngineImpl.LOG.info("Searching PlanModelPlugin for plan {} ", plan.getId()); - final IPlanEnginePlanModelPluginService plugin = this.getModelPlugin(language); - if (plugin != null) { - PlanEngineImpl.LOG.info("Found PlanModelPlugin for plan {} ", plan.getId()); - planCheck = plugin.deployPlan(plan.getPlanModel(), csarId); - } else { - PlanEngineImpl.LOG.warn("No PlanModelPlugin available for plan {} ", plan.getId()); - planCheck = false; - } - } else { - final QName planId = new QName(targetNamespace, plan.getId()); - PlanEngineImpl.LOG.debug("Created new management plan id " + planId); - PlanEngineImpl.LOG.info("Searching PlanReferencePlugin for plan {} written in language {}", plan.getId(), - language); - final IPlanEnginePlanRefPluginService plugin = this.getRefPlugin(language); - if (plugin != null) { - PlanEngineImpl.LOG.info("Found PlanReferencePlugin for plan {} ", plan.getId()); - planCheck = plugin.deployPlanReference(planId, plan.getPlanModelReference(), csarId); - } else { - PlanEngineImpl.LOG.warn("No PlanReferencePlugin available for plan {} ", plan.getId()); - planCheck = false; - } - } - - return planCheck; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean undeployPlan(final TPlan plan, final String targetNamespace, final CSARID csarId) { - boolean planCheck; - final String language = plan.getPlanLanguage(); - - if (plan.getPlanModel() != null) { - PlanEngineImpl.LOG.info("Searching PlanModelPlugin for plan {} ", plan.getId()); - final IPlanEnginePlanModelPluginService plugin = this.getModelPlugin(language); - if (plugin != null) { - PlanEngineImpl.LOG.info("Found PlanModelPlugin for plan {} ", plan.getId()); - - planCheck = plugin.undeployPlan(plan.getPlanModel(), csarId); - } else { - PlanEngineImpl.LOG.warn("No PlanModelPlugin available for plan {} ", plan.getId()); - planCheck = false; - } - } else { - final QName planId = new QName(targetNamespace, plan.getId()); - PlanEngineImpl.LOG.debug("Created new management plan id " + planId); - PlanEngineImpl.LOG.info("Searching PlanReferencePlugin for plan {} ", plan.getId()); - final IPlanEnginePlanRefPluginService plugin = this.getRefPlugin(language); - if (plugin != null) { - PlanEngineImpl.LOG.info("Found PlanReferencePlugin for plan {} ", plan.getId()); - planCheck = plugin.undeployPlanReference(planId, plan.getPlanModelReference(), csarId); - } else { - PlanEngineImpl.LOG.warn("No PlanReferencePlugin available for plan {} ", plan.getId()); - planCheck = false; - } - } - - return planCheck; - } - - /** - * {@inheritDoc} - */ - @Override - public List deployPlans(final TPlans plans, final String targetNamespace, final CSARID csarId) { - final List nonDeployedPlans = new LinkedList<>(); - final List p = plans.getPlan(); - - String namespace = plans.getTargetNamespace(); - if (namespace == null) { - namespace = targetNamespace; - } - - if (namespace == null) { - PlanEngineImpl.LOG.error("No namespace for Plans {} defined. Plugins communication with toscaEngine may be wrong", - plans.toString()); - return p; - } - - for (final TPlan plan : p) { - - if (!this.deployPlan(plan, namespace, csarId)) { - nonDeployedPlans.add(plan); - } - } - - if (nonDeployedPlans.isEmpty()) { - PlanEngineImpl.LOG.info("Deployment of plans was successful"); - } else { - PlanEngineImpl.LOG.error("Deployment of plans failed"); - for (final TPlan plan : nonDeployedPlans) { - PlanEngineImpl.LOG.error("Couldn't deploy plan {}", plan.getName()); - } - } - return nonDeployedPlans; - } - - /** - * {@inheritDoc} - */ - @Override - public List undeployPlans(final TPlans plans, final String targetNamespace, final CSARID csarId) { - final List nonUndeployedPlans = new LinkedList<>(); - final List p = plans.getPlan(); - - String namespace = plans.getTargetNamespace(); - if (namespace == null) { - namespace = targetNamespace; - } - - if (namespace == null) { - PlanEngineImpl.LOG.error("No namespace for Plans {} defined. Plugins communication with toscaEngine may be wrong", - plans.toString()); - return p; - } - - for (final TPlan plan : p) { - - // FIXME plans.getTargetNamespace can be null, then the - // targetNamespace has to be taken of the Service Template or - // Definitions - - if (!this.undeployPlan(plan, namespace, csarId)) { - nonUndeployedPlans.add(plan); - } - } - - if (nonUndeployedPlans.isEmpty()) { - PlanEngineImpl.LOG.info("Undeployment of plans was successful"); - } else { - PlanEngineImpl.LOG.error("Undeployment of plans failed"); - for (final TPlan plan : nonUndeployedPlans) { - PlanEngineImpl.LOG.error("Couldn't undeploy plan {}", plan.getName()); - } - } - return nonUndeployedPlans; - } - - /** - * Bind method for PlanModelPlugins - * - * @param planModelPlugin a PlanModelPlugin to bind - */ - protected void bindPlanModelPlugin(final IPlanEnginePlanModelPluginService planModelPlugin) { - if (planModelPlugin != null) { - PlanEngineImpl.LOG.debug("Registering PlanEnginePlanModel Plugin {}", planModelPlugin.toString()); - if (this.capabilityService != null) { - this.capabilityService.storeCapabilities(planModelPlugin.getCapabilties(), planModelPlugin.toString(), - ProviderType.PLAN_PLUGIN); - } else { - PlanEngineImpl.LOG.debug("CapabilityService unavailable, couldn't store plugin capabilities, will do later"); - } - this.modelPluginsList.put(planModelPlugin.getLanguageUsed(), planModelPlugin); - LOG.debug("Registered PlanEnginePlanModel Plugin {}", planModelPlugin.toString()); - LOG.debug("{} PlanEnginePlanModel plugins registered", this.modelPluginsList.size()); - } - } - - /** - * Unbind method for PlanModelPlugins - * - * @param planModelPlugin a PlanModelPlugin to unbind - */ - protected void unbindPlanModelPlugin(final IPlanEnginePlanModelPluginService planModelPlugin) { - if (planModelPlugin != null) { - PlanEngineImpl.LOG.debug("Unregistering PlanEnginePlanModel Plugin {}", planModelPlugin.toString()); - if (this.capabilityService != null) { - this.capabilityService.deleteCapabilities(planModelPlugin.toString()); - } else { - PlanEngineImpl.LOG.warn("CapabilityService unavailable, couldn't delete plugin capabilities"); - } - this.modelPluginsList.remove(planModelPlugin.getLanguageUsed()); - PlanEngineImpl.LOG.debug("Unregistered PlanEnginePlanModel Plugin {}", planModelPlugin.toString()); - } - } - - /** - * Bind method for PlanRefPlugins - * - * @param planRefPlugin a PlanRefPlugin to bind - */ - protected void bindPlanReferencePlugin(final IPlanEnginePlanRefPluginService planRefPlugin) { - if (planRefPlugin != null) { - PlanEngineImpl.LOG.debug("Registering PlanEnginePlanRef Plugin {} for language {}", - planRefPlugin.toString(), planRefPlugin.getLanguageUsed()); - if (this.capabilityService != null) { - this.capabilityService.storeCapabilities(planRefPlugin.getCapabilties(), planRefPlugin.toString(), - ProviderType.PLAN_PLUGIN); - } else { - PlanEngineImpl.LOG.debug("CapabilityService unavailable, couldn't store plugin capabilities, will do later"); - } - this.refPluginsList.put(planRefPlugin.getLanguageUsed(), planRefPlugin); - PlanEngineImpl.LOG.debug("Registered PlanEnginePlanRef Plugin {}", planRefPlugin.toString()); - LOG.debug("{} PlanEnginePlanRef plugins registered", this.refPluginsList.size()); - } - } - - /** - * Unbind method for PlanRefPlugins - * - * @param planRefPlugin a PlanRefPlugin to unbind - */ - protected void unbindPlanReferencePlugin(final IPlanEnginePlanRefPluginService planRefPlugin) { - if (planRefPlugin != null) { - PlanEngineImpl.LOG.debug("Unregistered PlanEnginePlanRef Plugin {}", planRefPlugin.toString()); - if (this.capabilityService != null) { - this.capabilityService.deleteCapabilities(planRefPlugin.toString()); - } else { - PlanEngineImpl.LOG.warn("CapabilityService unavailable, couldn't delete plugin capabilities"); - } - this.refPluginsList.remove(planRefPlugin.getLanguageUsed()); - PlanEngineImpl.LOG.debug("Unregistered PlanEnginePlanRef Plugin {}", planRefPlugin.toString()); - } - } - - /** - * Returns a PlanEnginePlanModelPlugin capable of processing the given plan - * - * @param language the language of the plan - * @return PlanEnginePlanModelPlugin if there is a plugin, else null - */ - private IPlanEnginePlanModelPluginService getModelPlugin(final String language) { - return this.modelPluginsList.get(language); - } - - /** - * Returns a PlanEnginePlanRefPlugin capable of processing the given plan - * - * @param language the language of the plan - * @return PlanEnginePlanRefPlugin if there is a plugin, else null - */ - private IPlanEnginePlanRefPluginService getRefPlugin(final String language) { - return this.refPluginsList.get(language); - } - - /** - * Bind method for CapabilityService - * - * @param capabilityService the CapabilityService to bind - */ - protected void bindCoreCapabilityService(final ICoreCapabilityService capabilityService) { - if (capabilityService != null) { - PlanEngineImpl.LOG.debug("Registering CapabilityService {}", capabilityService.toString()); - if (this.capabilityService == null) { - this.capabilityService = capabilityService; - } else { - this.oldCapabilityService = capabilityService; - this.capabilityService = capabilityService; - } - - // storing capabilities of already registered plugins - for (final IPlanEnginePlanModelPluginService planModelPlugin : this.modelPluginsList.values()) { - this.capabilityService.storeCapabilities(planModelPlugin.getCapabilties(), planModelPlugin.toString(), - ProviderType.PLAN_PLUGIN); - } - - for (final IPlanEnginePlanRefPluginService planRefPlugin : this.refPluginsList.values()) { - this.capabilityService.storeCapabilities(planRefPlugin.getCapabilties(), planRefPlugin.toString(), - ProviderType.PLAN_PLUGIN); - } - - PlanEngineImpl.LOG.debug("Registered CapabilityService {}", capabilityService.toString()); - } - } - - /** - * Unbind method for CapabilityService - * - * @param capabilityService the CapabilityService to unbind - */ - protected void unbindCoreCapabilityService(final ICoreCapabilityService capabilityService) { - PlanEngineImpl.LOG.debug("Unregistering CapabilityService {}", capabilityService.toString()); - if (this.oldCapabilityService == null) { - this.capabilityService = null; - } else { - this.oldCapabilityService = null; - } - PlanEngineImpl.LOG.debug("Unregistered CapabilityService {}", capabilityService.toString()); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return "openTOSCA PlanEngine v1.0"; - } -} diff --git a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanModelPluginService.java b/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanModelPluginService.java deleted file mode 100644 index b01fb487d..000000000 --- a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanModelPluginService.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.container.engine.plan.plugin; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TPlan.PlanModel; - -/** - * This is a subinterface of - * {@link org.opentosca.container.engine.plan.plugin.IPlanEnginePluginService} and specifies - * handling of PlanModel elements inside a Plan element specified in Topology and Orchestration - * Specification for Cloud Applications Version 1.0 Chapter 11: Plans. - * - * A PlanModel element declares a Plan which is directly written inside ServiceTemplate, for example - * a bash script. This means the plugin must deploy the script on a appropiate system capable of - * executing it. - */ -public interface IPlanEnginePlanModelPluginService extends IPlanEnginePluginService { - - /** - *

    - * Method allows deployment of PlanModels - *

    - *

    - * In addition a service implementing - * {@link org.opentosca.core.endpoint.service.ICoreEndpointService} must provide a suitable - * endpoint. - *

    - * - * @param planModel the PlanModel element inside a Plan element of a ServiceTemplate Definition - * @param csarId the identifier of the CSAR this PlanModel element belongs to - * @return true if deployment was successful, else false - */ - public boolean deployPlan(PlanModel planModel, CSARID csarId); - - /** - *

    - * Method allows undeployment of PlanModels - *

    - *

    - * In addition a service implementing - * {@link org.opentosca.core.endpoint.service.ICoreEndpointService} must provide a suitable - * endpoint. - *

    - * - * @param planModel the PlanModel element inside a Plan element of a ServiceTemplate Definition - * @param csarId the identifier of the CSAR this PlanModel element belongs to - * @return true if undeployment was successful, else false - */ - public boolean undeployPlan(PlanModel planModel, CSARID csarId); - -} diff --git a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanRefPluginService.java b/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanRefPluginService.java deleted file mode 100644 index 2876132b9..000000000 --- a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePlanRefPluginService.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.opentosca.container.engine.plan.plugin; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.tosca.model.TPlan.PlanModelReference; - -/** - * This is a subinterface of - * {@link org.opentosca.container.engine.plan.plugin.IPlanEnginePluginService} and specifies - * handling of PlanReference elements inside a Plan element specified in Topology and Orchestration - * Specification for Cloud Applications Version 1.0 Chapter 11: Plans. - * - * The plugin musn't resolve the {@link org.opentosca.model.tosca.TPlan.PlanModelReference}, a - * service implementing {@link org.opentosca.core.file.service.ICoreFileService} should be called - * for the raw data. - */ -public interface IPlanEnginePlanRefPluginService extends IPlanEnginePluginService { - - /** - *

    - * Method allows deployment of PlanModelReferences. - *

    - *

    - * The reference must be resolved in a service implementing - * {@link org.opentosca.core.file.service.ICoreFileService}. In addition a service of - * {@link org.opentosca.core.endpoint.service.ICoreEndpointService} must provide a suitable - * endpoint. - *

    - * - * - * @param planRef the PlanReference element under a Plan element of a ServiceTemplate Definition - * @param csarId the identifier of the CSAR the PlanReference element belongs to - * @return true if deployment was successful, else false - */ - public boolean deployPlanReference(QName planId, PlanModelReference planRef, CSARID csarId); - - /** - *

    - * Method allows undeployment of PlanModelReferences. - *

    - *

    - * The reference must be resolved in a service implementing - * {@link org.opentosca.core.file.service.ICoreFileService}. In addition a service of - * {@link org.opentosca.core.endpoint.service.ICoreEndpointService} must provide a suitable - * endpoint. - *

    - * - * - * @param planRef the PlanReference element under a Plan element of a ServiceTemplate Definition - * @param csarId the identifier of the CSAR the PlanReference element belongs to - * @return true if undeployment was successful, else false - */ - public boolean undeployPlanReference(QName planId, PlanModelReference planRef, CSARID csarId); - -} diff --git a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePluginService.java b/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePluginService.java deleted file mode 100644 index ca051315e..000000000 --- a/org.opentosca.container.engine.plan/src/org/opentosca/container/engine/plan/plugin/IPlanEnginePluginService.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opentosca.container.engine.plan.plugin; - -import java.util.List; - -/** - * This interface is the superinterface for all plugins used by - * {@link org.opentosca.planengine.service.impl.PlanEngineImpl}. - * - * The plugins are splitted into two types, this is because there are two ways to declare a Plan in - * Topology and Orchestration Specification for Cloud Applications Version 1.0 Chapter 11: Plans - * - *
  • The {@link IPlanEnginePlanModelPluginService} interface is responsible for PlanModel elements - * inside the Plan element, the interface specifies plugins which can read the contents of the - * element and deploy them unto a compatible environment. Example: bash script on linux machine - * - *
  • The {@link IPlanEnginePlanRefPluginService} interface is responsible for PlanReference - * elements inside a Plan element. These elements reference plan implementations which can't be - * written directly into the ServiceTemplate and are packaged for deployment. Example: WS-BPEL 2.0 - * Process which has to be deployed unto a WSO2 BPS - * - * Deployment of Plans is completely plugin dependend, this means the PlanEngine doesn't say where - * to deploy/install the plan, this must be handled by the plugin itself. - */ -public interface IPlanEnginePluginService { - - /** - *

    - * Returns the exact plan language understood by this plugin. - *

    - *

    - * Example: if the plugin can process WS-BPEL 2.0 Processes it should return - * "http://docs.oasis-open.org/wsbpel/2.0/process/executable" - *

    - * - * @return a string representation of the plan language understood by this plugin - */ - public String getLanguageUsed(); - - /** - * Returns provided capabilities of this plugin. - * - * @return a list of strings denoting the capabilities of this plugin - */ - public List getCapabilties(); -} diff --git a/org.opentosca.container.feature/build.properties b/org.opentosca.container.feature/build.properties deleted file mode 100644 index 82ab19c62..000000000 --- a/org.opentosca.container.feature/build.properties +++ /dev/null @@ -1 +0,0 @@ -bin.includes = feature.xml diff --git a/org.opentosca.container.feature/feature.xml b/org.opentosca.container.feature/feature.xml deleted file mode 100644 index 6060f69d8..000000000 --- a/org.opentosca.container.feature/feature.xml +++ /dev/null @@ -1,1579 +0,0 @@ - - - - - [Enter Feature Description here.] - - - - [Enter Copyright Description here.] - - - - [Enter License Description here.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.opentosca.container.feature/pom.xml b/org.opentosca.container.feature/pom.xml deleted file mode 100644 index 1ddee19c3..000000000 --- a/org.opentosca.container.feature/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.container.feature - eclipse-feature - - diff --git a/org.opentosca.container.integration.tests/META-INF/MANIFEST.MF b/org.opentosca.container.integration.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 4c1f55cf5..000000000 --- a/org.opentosca.container.integration.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,39 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Integration Tests -Bundle-SymbolicName: org.opentosca.container.integration.tests -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.junit;bundle-version="4.12.0", - org.hamcrest.generator;bundle-version="1.3.0", - org.hamcrest.integration;bundle-version="1.3.0", - org.hamcrest.library;bundle-version="1.3.0", - org.hamcrest.text;bundle-version="1.1.0", - org.mockito;bundle-version="1.9.5", - org.opentosca.container.api, - org.opentosca.planbuilder.importer, - org.opentosca.container.core, - org.opentosca.container.application;bundle-version="2.0.0", - org.opentosca.container.connector.bps;bundle-version="2.0.0", - org.opentosca.container.connector.winery;bundle-version="2.0.0", - org.opentosca.container.control;bundle-version="2.0.0", - org.opentosca.container.core.impl;bundle-version="2.0.0", - org.opentosca.container.core.tosca;bundle-version="2.0.0", - org.opentosca.planbuilder;bundle-version="2.0.0", - org.opentosca.planbuilder.model;bundle-version="2.0.0", - org.opentosca.bus.management.service, - org.opentosca.bus.management, - org.opentosca.deployment.tests -Import-Package: com.google.common.collect, - com.google.common.util.concurrent, - javax.ws.rs.core;version="1.1.1", - org.apache.camel;version="2.18.3", - org.apache.camel.core.osgi;version="2.18.3", - org.apache.camel.impl;version="2.18.3", - org.apache.camel.support;version="2.18.3", - org.apache.commons.io;version="2.2.0", - org.osgi.framework;version="1.8.0", - org.osgi.util.tracker;version="1.4.0", - org.slf4j;version="1.7.2" -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . diff --git a/org.opentosca.container.integration.tests/build.properties b/org.opentosca.container.integration.tests/build.properties deleted file mode 100644 index b107977f4..000000000 --- a/org.opentosca.container.integration.tests/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.container.integration.tests/org.opentosca.container.integration.tests.launch b/org.opentosca.container.integration.tests/org.opentosca.container.integration.tests.launch deleted file mode 100644 index 71680778d..000000000 --- a/org.opentosca.container.integration.tests/org.opentosca.container.integration.tests.launch +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.opentosca.container.integration.tests/pom.xml b/org.opentosca.container.integration.tests/pom.xml new file mode 100644 index 000000000..ad8a76a2f --- /dev/null +++ b/org.opentosca.container.integration.tests/pom.xml @@ -0,0 +1,51 @@ + + 4.0.0 + + org.opentosca + container + 2.0.0-SNAPSHOT + + + org.opentosca.container.integration.tests + + + + junit + junit + 4.12 + test + + + org.hamcrest + hamcrest-all + 1.3 + test + + + org.opentosca + org.opentosca.container.core + ${project.version} + test + + + org.opentosca + org.opentosca.planbuilder.integration + ${project.version} + test + + + org.opentosca + org.opentosca.deployment.checks + ${project.version} + test + + + org.opentosca + org.opentosca.container.api + ${project.version} + test + + + + diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileParserTest.java b/org.opentosca.container.integration.tests/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileParserTest.java deleted file mode 100644 index 30733078c..000000000 --- a/org.opentosca.container.integration.tests/src/org/opentosca/container/core/model/csar/toscametafile/TOSCAMetaFileParserTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.opentosca.container.core.model.csar.toscametafile; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; -import static org.hamcrest.Matchers.nullValue; - -import java.nio.file.Files; -import java.nio.file.Path; - -import org.apache.commons.io.FileUtils; -import org.junit.Test; - -public class TOSCAMetaFileParserTest { - - private final TOSCAMetaFileParser parser = new TOSCAMetaFileParser(); - - @Test - public void testParsingOfNewMetaFileStructure() throws Exception { - - final String test = "Entry-Definitions: Definitions/servicetemplates1__MyTinyToDo_Bare_Docker.tosca\r\n" - + "CSAR-Version: 1.0\r\n" + "Created-By: Winery 2.0.0-SNAPSHOT\r\n" + "TOSCA-Meta-Version: 1.0\r\n" + "\r\n" - + "Name: Definitions/servicetemplates1__MyTinyToDo_Bare_Docker.tosca\r\n" - + "Content-Type: application/vnd.oasis.tosca.definitions\r\n" - + "SHA-256: 6cb74ecd57adaebc2d9b87deed0be50e\r\n" + "\r\n" - + "Name: Definitions/nodetypes__MyTinyToDoDockerContainer.tosca\r\n" - + "Content-Type: application/vnd.oasis.tosca.definitions\r\n" - + "SHA-256: 6cb74ecd57adaebc2d9b87deed0be50e\r\n" + "\r\n" - + "Name: Definitions/ToscaBaseTypes__HostedOn.tosca\r\n" - + "Content-Type: application/vnd.oasis.tosca.definitions\r\n" - + "SHA-256: 6cb74ecd57adaebc2d9b87deed0be50e\r\n" + "\r\n" - + "Name: Definitions/artifacttemplates__MyTinyToDo_DA.tosca\r\n" - + "Content-Type: application/vnd.oasis.tosca.definitions\r\n" - + "SHA-256: 6cb74ecd57adaebc2d9b87deed0be50e\r\n" + "\r\n" - + "Name: Definitions/nodetypes__DockerEngine.tosca\r\n" - + "Content-Type: application/vnd.oasis.tosca.definitions\r\n" - + "SHA-256: 6cb74ecd57adaebc2d9b87deed0be50e\r\n" + "\r\n" - + "Name: Definitions/artifacttypes__DockerContainerArtifact.tosca\r\n" - + "Content-Type: application/vnd.oasis.tosca.definitions\r\n" + "SHA-256: 6cb74ecd57adaebc2d9b87deed0be50e"; - - // Prepare temp file - final Path file = Files.createTempFile("metafile", ".tosca"); - FileUtils.writeStringToFile(file.toFile(), test); - - // Test - final TOSCAMetaFile metafile = this.parser.parse(file); - - // Assertions - assertThat(metafile, is(not(nullValue()))); - assertThat(metafile.getBlock0().size(), is(4)); - assertThat(metafile.getFileBlocks().size(), is(6)); - - // Clean up - FileUtils.deleteQuietly(file.toFile()); - } -} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/model/RelationshipTemplateInstanceTest.java b/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/model/RelationshipTemplateInstanceTest.java deleted file mode 100644 index d80b32008..000000000 --- a/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/model/RelationshipTemplateInstanceTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.opentosca.container.core.next.model; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -import javax.xml.namespace.QName; - -import org.junit.Test; - -import com.google.common.collect.Iterables; - -public class RelationshipTemplateInstanceTest { - - @Test - public void testRelationBetweenNodes() { - - /* - * Create objects... - */ - final NodeTemplateInstance source = new NodeTemplateInstance(); - source.setId(1L); - source.setState(NodeTemplateInstanceState.CONFIGURED); - source.setTemplateId(QName.valueOf("Source")); - source.setTemplateType(QName.valueOf("TestType")); - - final NodeTemplateInstance target = new NodeTemplateInstance(); - target.setId(2L); - target.setState(NodeTemplateInstanceState.CONFIGURED); - target.setTemplateId(QName.valueOf("Source")); - target.setTemplateType(QName.valueOf("TestNodeType")); - - final RelationshipTemplateInstance relation = new RelationshipTemplateInstance(); - relation.setId(1L); - relation.setState(RelationshipTemplateInstanceState.CREATED); - relation.setTemplateId(QName.valueOf("HostedOn")); - relation.setTemplateType(QName.valueOf("TestRelationType")); - - /* - * Wire the nodes... - */ - relation.setSource(source); - relation.setTarget(target); - - /* - * Verify... - */ - assertThat(source.getOutgoingRelations().size(), is(1)); - assertThat(target.getIncomingRelations().size(), is(1)); - assertThat(Iterables.getFirst(source.getOutgoingRelations(), null), is(relation)); - assertThat(Iterables.getFirst(target.getIncomingRelations(), null), is(relation)); - assertThat(Iterables.getFirst(source.getOutgoingRelations(), null).getSource(), is(source)); - assertThat(Iterables.getFirst(source.getOutgoingRelations(), null).getTarget(), is(target)); - assertThat(Iterables.getFirst(target.getIncomingRelations(), null).getSource(), is(source)); - assertThat(Iterables.getFirst(target.getIncomingRelations(), null).getTarget(), is(target)); - } -} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/xml/DomUtilTest.java b/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/xml/DomUtilTest.java deleted file mode 100644 index 2c50ce572..000000000 --- a/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/xml/DomUtilTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.opentosca.container.core.next.xml; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -import java.io.StringReader; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.junit.Test; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; - -public class DomUtilTest { - - @Test - public void testUtilityMethods() throws Exception { - final String xml = "\r\n" + "\r\n" - + " My Company\r\n" + " \r\n" - + " Smith\r\n" + " Jim\r\n" - + " 123 Main Street\r\n" + " Mytown\r\n" - + " NY\r\n" + " 11234\r\n" + " \r\n" - + ""; - final Document document = createDocument(xml); - final Node company = DomUtil.getNode("Company", document.getChildNodes()); - final Node executive = DomUtil.getNode("Executive", company.getChildNodes()); - assertThat(executive.getNodeName(), is("Executive")); - assertThat(DomUtil.getNodeAttribute("type", executive), is("CEO")); - final NodeList properties = executive.getChildNodes(); - assertThat(DomUtil.getNodeValue("LastName", properties), is("Smith")); - assertThat(DomUtil.matchesNodeName("LastName", properties), is(true)); - assertThat(DomUtil.matchesNodeName("lastname", properties), is(true)); - assertThat(DomUtil.matchesNodeName(".*name.*", properties), is(true)); - assertThat(DomUtil.matchesNodeName("false", properties), is(false)); - } - - @Test - public void testSingleElementProperty() throws Exception { - final String xml = - "http://dind:9990"; - final Document document = createDocument(xml); - assertThat(DomUtil.matchesNodeName(".*selfserviceapplicationurl.*", document.getChildNodes()), - is(true)); - } - - private Document createDocument(final String xml) throws Exception { - final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - final DocumentBuilder builder = factory.newDocumentBuilder(); - return builder.parse(new InputSource(new StringReader(xml))); - } -} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/xml/PropertyParserTest.java b/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/xml/PropertyParserTest.java deleted file mode 100644 index b6edc53bc..000000000 --- a/org.opentosca.container.integration.tests/src/org/opentosca/container/core/next/xml/PropertyParserTest.java +++ /dev/null @@ -1,180 +0,0 @@ -package org.opentosca.container.core.next.xml; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.nullValue; - -import java.util.Map; - -import org.junit.Test; - -public class PropertyParserTest { - - @Test - public void testParseDockerContainerProperties() { - final String xml = - "\r\n" - + " 80\r\n" + " 9990\r\n" - + " 32768\r\n" - + " c1db84b59d41bf4312995a426de33d59119bc34ee27474f7a1e382650223936e;1efb0e8cc574e5e0ca4b13ad3e9684dd40a7cd47b4fcc7d1d93211dd9e38aa83\r\n" - + " dind"; - final PropertyParser parser = new PropertyParser(); - final Map properties = parser.parse(xml); - assertThat(properties.size(), is(5)); - assertThat(properties.get("ContainerPort"), is("80")); - assertThat(properties.get("Port"), is("9990")); - assertThat(properties.get("SSHPort"), is("32768")); - assertThat(properties.get("sshport"), is(nullValue())); - assertThat(properties.get("ContainerID"), is( - "c1db84b59d41bf4312995a426de33d59119bc34ee27474f7a1e382650223936e;1efb0e8cc574e5e0ca4b13ad3e9684dd40a7cd47b4fcc7d1d93211dd9e38aa83")); - assertThat(properties.get("ContainerIP"), is("dind")); - } - - @Test - public void testParseEmptyDockerContainerProperties() { - final String xml = "\r\n" - + "\r\n" - + ""; - final PropertyParser parser = new PropertyParser(); - final Map properties = parser.parse(xml); - assertThat(properties.size(), is(0)); - } - - @Test - public void testParseDockerEngineProperties() { - final String xml = - "\r\n" - + " tcp://dind:2375\r\n" - + " \r\n" - + " "; - final PropertyParser parser = new PropertyParser(); - final Map properties = parser.parse(xml); - assertThat(properties.size(), is(3)); - assertThat(properties.get("DockerEngineURL"), is("tcp://dind:2375")); - assertThat(properties.get("DockerEngineCertificate"), is(nullValue())); - assertThat(properties.get("Test"), is(nullValue())); - } - - @Test - public void testServiceTemplateProperties() { - final String xml = - "http://dind:9990"; - final PropertyParser parser = new PropertyParser(); - final Map properties = parser.parse(xml); - assertThat(properties.size(), is(1)); - assertThat(properties.get("selfserviceApplicationUrl"), is("http://dind:9990")); - assertThat(properties.get("selfserviceapplicationurl"), is(nullValue())); - } - - @Test - public void testEmptyServiceTemplateProperties() { - final String xml = - ""; - final PropertyParser parser = new PropertyParser(); - final Map properties = parser.parse(xml); - assertThat(properties.size(), is(0)); - } - - @Test - public void testXmlWithMultipleLines() { - final String xml = - "\r\n" - + " 129.69.214.229\r\n" - + " OT-ProvInstance-wursteml_1516957937521\r\n" - + " m1.medium.template4\r\n" - + " ubuntu\r\n" - + " NotNeeded\r\n" - + " -----BEGIN RSA PRIVATE KEY-----\r\n" - + "MIIEogIBAAKCAQEAj8ZW2WS3kG9N0/IvWRDgF6FsGbtiaQSNPRDR5SuYWEfF/95g\r\n" - + "rNXfPtY0wxRZsFRzafeXuoxNsidmTCWAi/OO0Ls4oBX9RB2pEmN5utLf2SRIp98+\r\n" - + "HxHZvjvNmniyOe2Bfmz4q0BagIuXRgwjFSdSeCltt8cKMbrzTV+YS9hX3NKlIrrg\r\n" - + "Y/TO2BB+sKP8os1Wbo2KCGMPuOdDrmHMkSHAtjLsf8e/M4wu5B4am3KcHbcOJa5c\r\n" - + "NwBKs2PHTshthIzPvBRuby1f69lTI7MvTGYa5E/31l3s9mSif1n8XxT3EZEwS1Mr\r\n" - + "14b7rjrkLPQX1khRonG1UDdywmHCb/Xj3uH8CQIBJQKCAQBRmhWd+uS5wqHLUhrf\r\n" - + "hh5SmeNojPKqTrEG+7VmZNns6ndMCJe8Cq8jqgJFNRBPUoaxw+B+oqijYnhUu1bL\r\n" - + "+PAxR6qEX4HoY9yADvIQFtITdXVYXBxW0sexKNx6RIDUxRIlKReDypQ7Hst6yJ5K\r\n" - + "RsAar7rQFwXJMsFxGpS1bPOZAQ3SETptjedknf7U8vJheUNTafIKXdqLV20Q0rtr\r\n" - + "E+2EJ6VNcS0wyjJleeZGjQEvrtxbwJeyOgLF2GSBPh5Gxtl7WINy7UbSC87543Qj\r\n" - + "RHilcBpoAulReygoLbNmDbAPhzalR4cVHMJXiZETu3Th/mnEzvRXU/KLy+sP4wct\r\n" - + "55G9AoGBAPjsJfWqcR/oYlCRGRbehvcEO3JPI6ohqJOTBW9Rlc+xoY8hXWaelzHl\r\n" - + "bnWlz+h9bzT095mfi1vUMpODEXFSvexMS7PBvCF8zKB3Hz+ttSpn3w9FBKIALaRm\r\n" - + "X8iaLADQpIPZr5zWFOAEUmlnhY0GPbB/CGvFW1gWoLmWydwrx+StAoGBAJPc2BYQ\r\n" - + "3v7c4PM6oeVhravXWnl2OIMDQyC0k72zpchxDo90ci2IIwW5m+qqF/qtyp4VJnpd\r\n" - + "cD9R2IK3PVki0g7ry0DKkjuPQQkMrdnadUB9htJsYFqLOW4ztd9ODcw98j/5GVfc\r\n" - + "P2/rGqvrzu2jYsI2Xi1ShSYvWcAGUuKrXYRNAoGBAJq8TvKoOHueSvPP0VNnu65O\r\n" - + "vSthoIxaHK7DLORVT0nBckQ3VbxUvtnTzwrcsawyTAwpkv6hck3W7wHALW/1KfPA\r\n" - + "uW+9nnWucVzUbV7vcJ3R3a+LxJwN8tvQ727cYIrij8eVJ/m1gpkXcX/Kus1JEZc6\r\n" - + "NarGyhQpvdsmYc4NYJURAoGAT+z/LoWo+Hdk1oCO3NraarmYsFuUKyRbovnTUcjj\r\n" - + "/aTlRp/PA9rif6KZd+09ZOhR2OjWh1UaFGOXoJpmWbH1ASWCn5AXsX3d9w3Fwd3e\r\n" - + "g7l5TyXTN9yNvwcx4H035AXPDdLBl0ae1LZvSCxv2mYni5MCeV0Js8aRYODS22OM\r\n" - + "ft0CgYEAomRyCpGHFaS5FhQ7a2kobsmmzHm6Fx86lGZTf5AnYH+5KwFHoSwiu6Al\r\n" - + "tzFyZItzOAIbQicrQMUyVhSZItJsYYtkns3PQ853QZ1U54ldUengeQQM++TfE4qq\r\n" - + "vN5P+dvI78foSfHLVjFLy/ZKwctr/GQSosgQBRsUE0RyDexHk0M=\r\n" - + "-----END RSA PRIVATE KEY-----\r\n" - + " ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAj8ZW2WS3kG9N0/IvWRDgF6FsGbtiaQSNPRDR5SuYWEfF/95grNXfPtY0wxRZsFRzafeXuoxNsidmTCWAi/OO0Ls4oBX9RB2pEmN5utLf2SRIp98+HxHZvjvNmniyOe2Bfmz4q0BagIuXRgwjFSdSeCltt8cKMbrzTV+YS9hX3NKlIrrgY/TO2BB+sKP8os1Wbo2KCGMPuOdDrmHMkSHAtjLsf8e/M4wu5B4am3KcHbcOJa5cNwBKs2PHTshthIzPvBRuby1f69lTI7MvTGYa5E/31l3s9mSif1n8XxT3EZEwS1Mr14b7rjrkLPQX1khRonG1UDdywmHCb/Xj3uH8CQ== rsa-key-20180126\r\n" - + " NotNeeded\r\n" - + " "; - final PropertyParser parser = new PropertyParser(); - final Map properties = parser.parse(xml); - assertThat(properties.get("VMPrivateKey"), - is("-----BEGIN RSA PRIVATE KEY-----\n" - + "MIIEogIBAAKCAQEAj8ZW2WS3kG9N0/IvWRDgF6FsGbtiaQSNPRDR5SuYWEfF/95g\n" - + "rNXfPtY0wxRZsFRzafeXuoxNsidmTCWAi/OO0Ls4oBX9RB2pEmN5utLf2SRIp98+\n" - + "HxHZvjvNmniyOe2Bfmz4q0BagIuXRgwjFSdSeCltt8cKMbrzTV+YS9hX3NKlIrrg\n" - + "Y/TO2BB+sKP8os1Wbo2KCGMPuOdDrmHMkSHAtjLsf8e/M4wu5B4am3KcHbcOJa5c\n" - + "NwBKs2PHTshthIzPvBRuby1f69lTI7MvTGYa5E/31l3s9mSif1n8XxT3EZEwS1Mr\n" - + "14b7rjrkLPQX1khRonG1UDdywmHCb/Xj3uH8CQIBJQKCAQBRmhWd+uS5wqHLUhrf\n" - + "hh5SmeNojPKqTrEG+7VmZNns6ndMCJe8Cq8jqgJFNRBPUoaxw+B+oqijYnhUu1bL\n" - + "+PAxR6qEX4HoY9yADvIQFtITdXVYXBxW0sexKNx6RIDUxRIlKReDypQ7Hst6yJ5K\n" - + "RsAar7rQFwXJMsFxGpS1bPOZAQ3SETptjedknf7U8vJheUNTafIKXdqLV20Q0rtr\n" - + "E+2EJ6VNcS0wyjJleeZGjQEvrtxbwJeyOgLF2GSBPh5Gxtl7WINy7UbSC87543Qj\n" - + "RHilcBpoAulReygoLbNmDbAPhzalR4cVHMJXiZETu3Th/mnEzvRXU/KLy+sP4wct\n" - + "55G9AoGBAPjsJfWqcR/oYlCRGRbehvcEO3JPI6ohqJOTBW9Rlc+xoY8hXWaelzHl\n" - + "bnWlz+h9bzT095mfi1vUMpODEXFSvexMS7PBvCF8zKB3Hz+ttSpn3w9FBKIALaRm\n" - + "X8iaLADQpIPZr5zWFOAEUmlnhY0GPbB/CGvFW1gWoLmWydwrx+StAoGBAJPc2BYQ\n" - + "3v7c4PM6oeVhravXWnl2OIMDQyC0k72zpchxDo90ci2IIwW5m+qqF/qtyp4VJnpd\n" - + "cD9R2IK3PVki0g7ry0DKkjuPQQkMrdnadUB9htJsYFqLOW4ztd9ODcw98j/5GVfc\n" - + "P2/rGqvrzu2jYsI2Xi1ShSYvWcAGUuKrXYRNAoGBAJq8TvKoOHueSvPP0VNnu65O\n" - + "vSthoIxaHK7DLORVT0nBckQ3VbxUvtnTzwrcsawyTAwpkv6hck3W7wHALW/1KfPA\n" - + "uW+9nnWucVzUbV7vcJ3R3a+LxJwN8tvQ727cYIrij8eVJ/m1gpkXcX/Kus1JEZc6\n" - + "NarGyhQpvdsmYc4NYJURAoGAT+z/LoWo+Hdk1oCO3NraarmYsFuUKyRbovnTUcjj\n" - + "/aTlRp/PA9rif6KZd+09ZOhR2OjWh1UaFGOXoJpmWbH1ASWCn5AXsX3d9w3Fwd3e\n" - + "g7l5TyXTN9yNvwcx4H035AXPDdLBl0ae1LZvSCxv2mYni5MCeV0Js8aRYODS22OM\n" - + "ft0CgYEAomRyCpGHFaS5FhQ7a2kobsmmzHm6Fx86lGZTf5AnYH+5KwFHoSwiu6Al\n" - + "tzFyZItzOAIbQicrQMUyVhSZItJsYYtkns3PQ853QZ1U54ldUengeQQM++TfE4qq\n" - + "vN5P+dvI78foSfHLVjFLy/ZKwctr/GQSosgQBRsUE0RyDexHk0M=\n" - + "-----END RSA PRIVATE KEY-----")); - } - - @Test - public void testParsePolicyTemplateProperties() throws Exception { - final String xml = - "\r\n" - + " GET\r\n" - + " /shop\r\n" - + " \r\n" + " \r\n" - + " 200\r\n" - + " \r\n" - + " \r\n" - + " VMIP\r\n" - + " 8080\r\n" - + " \r\n" + " "; - final PropertyParser parser = new PropertyParser(); - final Map properties = parser.parse(xml); - assertThat(properties.get("Port"), is("8080")); - assertThat(properties.get("port"), is(nullValue())); - assertThat(properties.get("TestBody"), is(nullValue())); - assertThat(properties.get("TestMethod"), is("GET")); - assertThat(properties.get("testMethod"), is(nullValue())); - } -} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/CsarActions.java b/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/CsarActions.java deleted file mode 100644 index ea69631eb..000000000 --- a/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/CsarActions.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.opentosca.container.integration.tests; - -import org.opentosca.container.api.service.CsarService; - -public final class CsarActions { - - public static boolean hasCsar(final String id) { - final CsarService service = ServiceTrackerUtil.getService(CsarService.class); - return service.findById(id) != null; - } - - private CsarActions() { - throw new UnsupportedOperationException(); - } -} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/ServiceTrackerUtil.java b/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/ServiceTrackerUtil.java deleted file mode 100644 index 9a781d2fb..000000000 --- a/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/ServiceTrackerUtil.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.opentosca.container.integration.tests; - -import org.opentosca.deployment.tests.TestExecutorTest; -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; -import org.osgi.util.tracker.ServiceTracker; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public final class ServiceTrackerUtil { - - private static Logger logger = LoggerFactory.getLogger(ServiceTrackerUtil.class); - - public static T getService(final Class clazz) { - final Bundle bundle = FrameworkUtil.getBundle(TestExecutorTest.class); - if (bundle == null) { - logger.warn("Could not resolve bundle for class {}, returning null...", clazz); - return null; - } - final ServiceTracker st = - new ServiceTracker(bundle.getBundleContext(), clazz, null); - st.open(); - try { - return st.waitForService(500); // Give the runtime some time to startup - } catch (InterruptedException e) { - logger.error("Error getting instance of class {}: {}", clazz.getName(), e.getMessage()); - } - return null; - } - - private ServiceTrackerUtil() { - throw new UnsupportedOperationException(); - } -} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/TestingUtil.java b/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/TestingUtil.java deleted file mode 100644 index 283d7df3f..000000000 --- a/org.opentosca.container.integration.tests/src/org/opentosca/container/integration/tests/TestingUtil.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.opentosca.container.integration.tests; - -import java.io.BufferedReader; -import java.io.File; -import java.io.InputStreamReader; -import java.net.URISyntaxException; -import java.net.URL; - -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; - -public final class TestingUtil { - - public static File pathToFile(final String relativePath) { - final URL url = pathToURL(relativePath); - File file; - try { - file = new File(url.toURI()); - } catch (URISyntaxException e) { - file = new File(url.getPath()); - } - return file; - } - - public static URL pathToURL(final String relativePath) { - final Bundle bundle = FrameworkUtil.getBundle(TestingUtil.class); - return bundle.getResource(relativePath); - } - - public static String getExternalIpAddress() { - try { - final URL url = new URL("http://checkip.amazonaws.com"); - final BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); - return in.readLine(); - } catch (Exception e) { - return "127.0.0.1"; - } - } - - private TestingUtil() { - throw new UnsupportedOperationException(); - } -} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/deployment/tests/TestExecutorTest.java b/org.opentosca.container.integration.tests/src/org/opentosca/deployment/tests/TestExecutorTest.java deleted file mode 100644 index 96242af46..000000000 --- a/org.opentosca.container.integration.tests/src/org/opentosca/deployment/tests/TestExecutorTest.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.opentosca.deployment.tests; - -import static org.junit.Assert.fail; - -import java.util.Collection; -import java.util.stream.Collectors; - -import org.junit.Before; -import org.junit.Test; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.DeploymentTest; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstanceState; -import org.opentosca.container.core.next.repository.DeploymentTestRepository; -import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; -import org.opentosca.container.integration.tests.CsarActions; -import org.opentosca.container.integration.tests.ServiceTrackerUtil; -import org.opentosca.planbuilder.importer.Importer; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; - -/** - * Currently, this integration test assumes that the "MyTinyToDo_Bare_Docker" CSAR has been manually - * uploaded and at lease one instance of it is available. Then, the test tries to execute the - * verification for each instance available. - */ -public class TestExecutorTest { - - private static final String CSAR_NAME = "MyTinyToDo_Bare_Docker.csar"; - - private final CSARID csar = new CSARID(CSAR_NAME); - private final DeploymentTestRepository repository = new DeploymentTestRepository(); - - private TestExecutor executor; - - - @Before - public void init() { - this.executor = ServiceTrackerUtil.getService(TestExecutor.class); - } - - @Test - public void execute() { - - if (CsarActions.hasCsar(CSAR_NAME)) { - - final Importer importer = new Importer(); - final AbstractDefinitions defs = importer.getMainDefinitions(this.csar); - - for (final AbstractServiceTemplate template : defs.getServiceTemplates()) { - - Collection instances = - new ServiceTemplateInstanceRepository().findByTemplateId(template.getQName()); - // Only select active instances - instances = instances.stream().filter(i -> i.getState().equals(ServiceTemplateInstanceState.CREATED)) - .collect(Collectors.toList()); - if (instances.isEmpty()) { - fail("No instance of service template \"" + template.getId() + "\" is available"); - } - - for (final ServiceTemplateInstance instance : instances) { - - // Prepare the verification - final DeploymentTest result = new DeploymentTest(); - result.setServiceTemplateInstance(instance); - this.repository.add(result); - - // Prepare the context - final TestContext context = new TestContext(); - context.setServiceTemplate(template); - context.setServiceTemplateInstance(instance); - context.setDeploymentTest(result); - - // Execute the verification - this.executor.verify(context).join(); - this.executor.shutdown(); - this.repository.update(result); - } - } - } - } -} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequestTest.java b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequestTest.java similarity index 89% rename from org.opentosca.container.integration.tests/src/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequestTest.java rename to org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequestTest.java index 60899e599..48aafdb52 100644 --- a/org.opentosca.container.integration.tests/src/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequestTest.java +++ b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/api/dto/request/CreateServiceTemplateInstanceRequestTest.java @@ -1,8 +1,5 @@ package org.opentosca.container.api.dto.request; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - import java.io.StringReader; import java.io.StringWriter; @@ -13,6 +10,9 @@ import org.junit.Before; import org.junit.Test; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + public class CreateServiceTemplateInstanceRequestTest { private JAXBContext context; @@ -25,7 +25,7 @@ public void setup() throws Exception { @Test public void testUnmarshalling() throws Exception { final String xml = - "123456789"; + "123456789"; final Unmarshaller o = this.context.createUnmarshaller(); final CreateServiceTemplateInstanceRequest result = (CreateServiceTemplateInstanceRequest) o.unmarshal(new StringReader(xml)); @@ -35,7 +35,7 @@ public void testUnmarshalling() throws Exception { @Test public void testMarshalling() throws Exception { final String xml = - "123456789"; + "123456789"; final CreateServiceTemplateInstanceRequest test = new CreateServiceTemplateInstanceRequest(); test.setCorrelationId("123456789"); final StringWriter writer = new StringWriter(); diff --git a/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/model/RelationshipTemplateInstanceTest.java b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/model/RelationshipTemplateInstanceTest.java new file mode 100644 index 000000000..e6a40346e --- /dev/null +++ b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/model/RelationshipTemplateInstanceTest.java @@ -0,0 +1,55 @@ +package org.opentosca.container.core.next.model; + +import javax.xml.namespace.QName; + +import com.google.common.collect.Iterables; +import org.junit.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +public class RelationshipTemplateInstanceTest { + + @Test + public void testRelationBetweenNodes() { + + /* + * Create objects... + */ + final NodeTemplateInstance source = new NodeTemplateInstance(); + source.setId(1L); + source.setState(NodeTemplateInstanceState.CONFIGURED); + source.setTemplateId("Source"); + source.setTemplateType(QName.valueOf("TestType")); + + final NodeTemplateInstance target = new NodeTemplateInstance(); + target.setId(2L); + target.setState(NodeTemplateInstanceState.CONFIGURED); + target.setTemplateId("Source"); + target.setTemplateType(QName.valueOf("TestNodeType")); + + final RelationshipTemplateInstance relation = new RelationshipTemplateInstance(); + relation.setId(1L); + relation.setState(RelationshipTemplateInstanceState.CREATED); + relation.setTemplateId("HostedOn"); + relation.setTemplateType(QName.valueOf("TestRelationType")); + + /* + * Wire the nodes... + */ + relation.setSource(source); + relation.setTarget(target); + + /* + * Verify... + */ + assertThat(source.getOutgoingRelations().size(), is(1)); + assertThat(target.getIncomingRelations().size(), is(1)); + assertThat(Iterables.getFirst(source.getOutgoingRelations(), null), is(relation)); + assertThat(Iterables.getFirst(target.getIncomingRelations(), null), is(relation)); + assertThat(Iterables.getFirst(source.getOutgoingRelations(), null).getSource(), is(source)); + assertThat(Iterables.getFirst(source.getOutgoingRelations(), null).getTarget(), is(target)); + assertThat(Iterables.getFirst(target.getIncomingRelations(), null).getSource(), is(source)); + assertThat(Iterables.getFirst(target.getIncomingRelations(), null).getTarget(), is(target)); + } +} diff --git a/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/xml/DomUtilTest.java b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/xml/DomUtilTest.java new file mode 100644 index 000000000..10e7483a2 --- /dev/null +++ b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/xml/DomUtilTest.java @@ -0,0 +1,54 @@ +package org.opentosca.container.core.next.xml; + +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.junit.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +public class DomUtilTest { + + @Test + public void testUtilityMethods() throws Exception { + final String xml = "\r\n" + "\r\n" + + " My Company\r\n" + " \r\n" + + " Smith\r\n" + " Jim\r\n" + + " 123 Main Street\r\n" + " Mytown\r\n" + + " NY\r\n" + " 11234\r\n" + " \r\n" + + ""; + final Document document = createDocument(xml); + final Node company = DomUtil.getNode("Company", document.getChildNodes()); + final Node executive = DomUtil.getNode("Executive", company.getChildNodes()); + assertThat(executive.getNodeName(), is("Executive")); + assertThat(DomUtil.getNodeAttribute("type", executive), is("CEO")); + final NodeList properties = executive.getChildNodes(); + assertThat(DomUtil.getNodeValue("LastName", properties), is("Smith")); + assertThat(DomUtil.matchesNodeName("LastName", properties), is(true)); + assertThat(DomUtil.matchesNodeName("lastname", properties), is(true)); + assertThat(DomUtil.matchesNodeName(".*name.*", properties), is(true)); + assertThat(DomUtil.matchesNodeName("false", properties), is(false)); + } + + @Test + public void testSingleElementProperty() throws Exception { + final String xml = + "http://dind:9990"; + final Document document = createDocument(xml); + assertThat(DomUtil.matchesNodeName(".*selfserviceapplicationurl.*", document.getChildNodes()), + is(true)); + } + + private Document createDocument(final String xml) throws Exception { + final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + final DocumentBuilder builder = factory.newDocumentBuilder(); + return builder.parse(new InputSource(new StringReader(xml))); + } +} diff --git a/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/xml/PropertyParserTest.java b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/xml/PropertyParserTest.java new file mode 100644 index 000000000..c5718afd5 --- /dev/null +++ b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/container/core/next/xml/PropertyParserTest.java @@ -0,0 +1,180 @@ +package org.opentosca.container.core.next.xml; + +import java.util.Map; + +import org.junit.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; + +public class PropertyParserTest { + + @Test + public void testParseDockerContainerProperties() { + final String xml = + "\r\n" + + " 80\r\n" + " 9990\r\n" + + " 32768\r\n" + + " c1db84b59d41bf4312995a426de33d59119bc34ee27474f7a1e382650223936e;1efb0e8cc574e5e0ca4b13ad3e9684dd40a7cd47b4fcc7d1d93211dd9e38aa83\r\n" + + " dind"; + final PropertyParser parser = new PropertyParser(); + final Map properties = parser.parse(xml); + assertThat(properties.size(), is(5)); + assertThat(properties.get("ContainerPort"), is("80")); + assertThat(properties.get("Port"), is("9990")); + assertThat(properties.get("SSHPort"), is("32768")); + assertThat(properties.get("sshport"), is(nullValue())); + assertThat(properties.get("ContainerID"), is( + "c1db84b59d41bf4312995a426de33d59119bc34ee27474f7a1e382650223936e;1efb0e8cc574e5e0ca4b13ad3e9684dd40a7cd47b4fcc7d1d93211dd9e38aa83")); + assertThat(properties.get("ContainerIP"), is("dind")); + } + + @Test + public void testParseEmptyDockerContainerProperties() { + final String xml = "\r\n" + + "\r\n" + + ""; + final PropertyParser parser = new PropertyParser(); + final Map properties = parser.parse(xml); + assertThat(properties.size(), is(0)); + } + + @Test + public void testParseDockerEngineProperties() { + final String xml = + "\r\n" + + " tcp://dind:2375\r\n" + + " \r\n" + + " "; + final PropertyParser parser = new PropertyParser(); + final Map properties = parser.parse(xml); + assertThat(properties.size(), is(3)); + assertThat(properties.get("DockerEngineURL"), is("tcp://dind:2375")); + assertThat(properties.get("DockerEngineCertificate"), is(nullValue())); + assertThat(properties.get("Test"), is(nullValue())); + } + + @Test + public void testServiceTemplateProperties() { + final String xml = + "http://dind:9990"; + final PropertyParser parser = new PropertyParser(); + final Map properties = parser.parse(xml); + assertThat(properties.size(), is(1)); + assertThat(properties.get("selfserviceApplicationUrl"), is("http://dind:9990")); + assertThat(properties.get("selfserviceapplicationurl"), is(nullValue())); + } + + @Test + public void testEmptyServiceTemplateProperties() { + final String xml = + ""; + final PropertyParser parser = new PropertyParser(); + final Map properties = parser.parse(xml); + assertThat(properties.size(), is(0)); + } + + @Test + public void testXmlWithMultipleLines() { + final String xml = + "\r\n" + + " 129.69.214.229\r\n" + + " OT-ProvInstance-wursteml_1516957937521\r\n" + + " m1.medium.template4\r\n" + + " ubuntu\r\n" + + " NotNeeded\r\n" + + " -----BEGIN RSA PRIVATE KEY-----\r\n" + + "MIIEogIBAAKCAQEAj8ZW2WS3kG9N0/IvWRDgF6FsGbtiaQSNPRDR5SuYWEfF/95g\r\n" + + "rNXfPtY0wxRZsFRzafeXuoxNsidmTCWAi/OO0Ls4oBX9RB2pEmN5utLf2SRIp98+\r\n" + + "HxHZvjvNmniyOe2Bfmz4q0BagIuXRgwjFSdSeCltt8cKMbrzTV+YS9hX3NKlIrrg\r\n" + + "Y/TO2BB+sKP8os1Wbo2KCGMPuOdDrmHMkSHAtjLsf8e/M4wu5B4am3KcHbcOJa5c\r\n" + + "NwBKs2PHTshthIzPvBRuby1f69lTI7MvTGYa5E/31l3s9mSif1n8XxT3EZEwS1Mr\r\n" + + "14b7rjrkLPQX1khRonG1UDdywmHCb/Xj3uH8CQIBJQKCAQBRmhWd+uS5wqHLUhrf\r\n" + + "hh5SmeNojPKqTrEG+7VmZNns6ndMCJe8Cq8jqgJFNRBPUoaxw+B+oqijYnhUu1bL\r\n" + + "+PAxR6qEX4HoY9yADvIQFtITdXVYXBxW0sexKNx6RIDUxRIlKReDypQ7Hst6yJ5K\r\n" + + "RsAar7rQFwXJMsFxGpS1bPOZAQ3SETptjedknf7U8vJheUNTafIKXdqLV20Q0rtr\r\n" + + "E+2EJ6VNcS0wyjJleeZGjQEvrtxbwJeyOgLF2GSBPh5Gxtl7WINy7UbSC87543Qj\r\n" + + "RHilcBpoAulReygoLbNmDbAPhzalR4cVHMJXiZETu3Th/mnEzvRXU/KLy+sP4wct\r\n" + + "55G9AoGBAPjsJfWqcR/oYlCRGRbehvcEO3JPI6ohqJOTBW9Rlc+xoY8hXWaelzHl\r\n" + + "bnWlz+h9bzT095mfi1vUMpODEXFSvexMS7PBvCF8zKB3Hz+ttSpn3w9FBKIALaRm\r\n" + + "X8iaLADQpIPZr5zWFOAEUmlnhY0GPbB/CGvFW1gWoLmWydwrx+StAoGBAJPc2BYQ\r\n" + + "3v7c4PM6oeVhravXWnl2OIMDQyC0k72zpchxDo90ci2IIwW5m+qqF/qtyp4VJnpd\r\n" + + "cD9R2IK3PVki0g7ry0DKkjuPQQkMrdnadUB9htJsYFqLOW4ztd9ODcw98j/5GVfc\r\n" + + "P2/rGqvrzu2jYsI2Xi1ShSYvWcAGUuKrXYRNAoGBAJq8TvKoOHueSvPP0VNnu65O\r\n" + + "vSthoIxaHK7DLORVT0nBckQ3VbxUvtnTzwrcsawyTAwpkv6hck3W7wHALW/1KfPA\r\n" + + "uW+9nnWucVzUbV7vcJ3R3a+LxJwN8tvQ727cYIrij8eVJ/m1gpkXcX/Kus1JEZc6\r\n" + + "NarGyhQpvdsmYc4NYJURAoGAT+z/LoWo+Hdk1oCO3NraarmYsFuUKyRbovnTUcjj\r\n" + + "/aTlRp/PA9rif6KZd+09ZOhR2OjWh1UaFGOXoJpmWbH1ASWCn5AXsX3d9w3Fwd3e\r\n" + + "g7l5TyXTN9yNvwcx4H035AXPDdLBl0ae1LZvSCxv2mYni5MCeV0Js8aRYODS22OM\r\n" + + "ft0CgYEAomRyCpGHFaS5FhQ7a2kobsmmzHm6Fx86lGZTf5AnYH+5KwFHoSwiu6Al\r\n" + + "tzFyZItzOAIbQicrQMUyVhSZItJsYYtkns3PQ853QZ1U54ldUengeQQM++TfE4qq\r\n" + + "vN5P+dvI78foSfHLVjFLy/ZKwctr/GQSosgQBRsUE0RyDexHk0M=\r\n" + + "-----END RSA PRIVATE KEY-----\r\n" + + " ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAj8ZW2WS3kG9N0/IvWRDgF6FsGbtiaQSNPRDR5SuYWEfF/95grNXfPtY0wxRZsFRzafeXuoxNsidmTCWAi/OO0Ls4oBX9RB2pEmN5utLf2SRIp98+HxHZvjvNmniyOe2Bfmz4q0BagIuXRgwjFSdSeCltt8cKMbrzTV+YS9hX3NKlIrrgY/TO2BB+sKP8os1Wbo2KCGMPuOdDrmHMkSHAtjLsf8e/M4wu5B4am3KcHbcOJa5cNwBKs2PHTshthIzPvBRuby1f69lTI7MvTGYa5E/31l3s9mSif1n8XxT3EZEwS1Mr14b7rjrkLPQX1khRonG1UDdywmHCb/Xj3uH8CQ== rsa-key-20180126\r\n" + + " NotNeeded\r\n" + + " "; + final PropertyParser parser = new PropertyParser(); + final Map properties = parser.parse(xml); + assertThat(properties.get("VMPrivateKey"), + is("-----BEGIN RSA PRIVATE KEY-----\n" + + "MIIEogIBAAKCAQEAj8ZW2WS3kG9N0/IvWRDgF6FsGbtiaQSNPRDR5SuYWEfF/95g\n" + + "rNXfPtY0wxRZsFRzafeXuoxNsidmTCWAi/OO0Ls4oBX9RB2pEmN5utLf2SRIp98+\n" + + "HxHZvjvNmniyOe2Bfmz4q0BagIuXRgwjFSdSeCltt8cKMbrzTV+YS9hX3NKlIrrg\n" + + "Y/TO2BB+sKP8os1Wbo2KCGMPuOdDrmHMkSHAtjLsf8e/M4wu5B4am3KcHbcOJa5c\n" + + "NwBKs2PHTshthIzPvBRuby1f69lTI7MvTGYa5E/31l3s9mSif1n8XxT3EZEwS1Mr\n" + + "14b7rjrkLPQX1khRonG1UDdywmHCb/Xj3uH8CQIBJQKCAQBRmhWd+uS5wqHLUhrf\n" + + "hh5SmeNojPKqTrEG+7VmZNns6ndMCJe8Cq8jqgJFNRBPUoaxw+B+oqijYnhUu1bL\n" + + "+PAxR6qEX4HoY9yADvIQFtITdXVYXBxW0sexKNx6RIDUxRIlKReDypQ7Hst6yJ5K\n" + + "RsAar7rQFwXJMsFxGpS1bPOZAQ3SETptjedknf7U8vJheUNTafIKXdqLV20Q0rtr\n" + + "E+2EJ6VNcS0wyjJleeZGjQEvrtxbwJeyOgLF2GSBPh5Gxtl7WINy7UbSC87543Qj\n" + + "RHilcBpoAulReygoLbNmDbAPhzalR4cVHMJXiZETu3Th/mnEzvRXU/KLy+sP4wct\n" + + "55G9AoGBAPjsJfWqcR/oYlCRGRbehvcEO3JPI6ohqJOTBW9Rlc+xoY8hXWaelzHl\n" + + "bnWlz+h9bzT095mfi1vUMpODEXFSvexMS7PBvCF8zKB3Hz+ttSpn3w9FBKIALaRm\n" + + "X8iaLADQpIPZr5zWFOAEUmlnhY0GPbB/CGvFW1gWoLmWydwrx+StAoGBAJPc2BYQ\n" + + "3v7c4PM6oeVhravXWnl2OIMDQyC0k72zpchxDo90ci2IIwW5m+qqF/qtyp4VJnpd\n" + + "cD9R2IK3PVki0g7ry0DKkjuPQQkMrdnadUB9htJsYFqLOW4ztd9ODcw98j/5GVfc\n" + + "P2/rGqvrzu2jYsI2Xi1ShSYvWcAGUuKrXYRNAoGBAJq8TvKoOHueSvPP0VNnu65O\n" + + "vSthoIxaHK7DLORVT0nBckQ3VbxUvtnTzwrcsawyTAwpkv6hck3W7wHALW/1KfPA\n" + + "uW+9nnWucVzUbV7vcJ3R3a+LxJwN8tvQ727cYIrij8eVJ/m1gpkXcX/Kus1JEZc6\n" + + "NarGyhQpvdsmYc4NYJURAoGAT+z/LoWo+Hdk1oCO3NraarmYsFuUKyRbovnTUcjj\n" + + "/aTlRp/PA9rif6KZd+09ZOhR2OjWh1UaFGOXoJpmWbH1ASWCn5AXsX3d9w3Fwd3e\n" + + "g7l5TyXTN9yNvwcx4H035AXPDdLBl0ae1LZvSCxv2mYni5MCeV0Js8aRYODS22OM\n" + + "ft0CgYEAomRyCpGHFaS5FhQ7a2kobsmmzHm6Fx86lGZTf5AnYH+5KwFHoSwiu6Al\n" + + "tzFyZItzOAIbQicrQMUyVhSZItJsYYtkns3PQ853QZ1U54ldUengeQQM++TfE4qq\n" + + "vN5P+dvI78foSfHLVjFLy/ZKwctr/GQSosgQBRsUE0RyDexHk0M=\n" + + "-----END RSA PRIVATE KEY-----")); + } + + @Test + public void testParsePolicyTemplateProperties() throws Exception { + final String xml = + "\r\n" + + " GET\r\n" + + " /shop\r\n" + + " \r\n" + " \r\n" + + " 200\r\n" + + " \r\n" + + " \r\n" + + " VMIP\r\n" + + " 8080\r\n" + + " \r\n" + " "; + final PropertyParser parser = new PropertyParser(); + final Map properties = parser.parse(xml); + assertThat(properties.get("Port"), is("8080")); + assertThat(properties.get("port"), is(nullValue())); + assertThat(properties.get("TestBody"), is(nullValue())); + assertThat(properties.get("TestMethod"), is("GET")); + assertThat(properties.get("testMethod"), is(nullValue())); + } +} diff --git a/org.opentosca.container.integration.tests/src/org/opentosca/deployment/tests/DeploymentTestResultTest.java b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/deployment/checks/DeploymentTestResultTest.java similarity index 96% rename from org.opentosca.container.integration.tests/src/org/opentosca/deployment/tests/DeploymentTestResultTest.java rename to org.opentosca.container.integration.tests/src/test/java/org/opentosca/deployment/checks/DeploymentTestResultTest.java index fc183339c..148117cc7 100644 --- a/org.opentosca.container.integration.tests/src/org/opentosca/deployment/tests/DeploymentTestResultTest.java +++ b/org.opentosca.container.integration.tests/src/test/java/org/opentosca/deployment/checks/DeploymentTestResultTest.java @@ -1,14 +1,14 @@ -package org.opentosca.deployment.tests; +package org.opentosca.deployment.checks; + +import org.junit.Test; +import org.opentosca.container.core.next.model.DeploymentTestResult; +import org.opentosca.container.core.next.model.DeploymentTestState; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; -import org.junit.Test; -import org.opentosca.container.core.next.model.DeploymentTestResult; -import org.opentosca.container.core.next.model.DeploymentTestState; - public class DeploymentTestResultTest { @Test diff --git a/org.opentosca.container.legacy/pom.xml b/org.opentosca.container.legacy/pom.xml new file mode 100644 index 000000000..0c2e88800 --- /dev/null +++ b/org.opentosca.container.legacy/pom.xml @@ -0,0 +1,33 @@ + + + + container + org.opentosca + 2.0.0-SNAPSHOT + + + 4.0.0 + + org.opentosca.container.legacy + + + org.opentosca + org.opentosca.container.core + ${project.version} + compile + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + + + com.springsource.util + com.springsource.util.parser.manifest + 2.0.0.RELEASE + + + + diff --git a/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/model/CSARContent.java b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/model/CSARContent.java new file mode 100644 index 000000000..36f613864 --- /dev/null +++ b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/model/CSARContent.java @@ -0,0 +1,152 @@ +package org.opentosca.container.legacy.core.model; + +import java.util.Set; + +import javax.persistence.Column; +import javax.persistence.Convert; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +import org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFile; + +import org.opentosca.container.core.common.jpa.CsarIdConverter; +import org.opentosca.container.core.model.AbstractDirectory; +import org.opentosca.container.core.model.AbstractFile; +import org.opentosca.container.core.model.IBrowseable; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.csar.backwards.FileSystemDirectory; +import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.legacy.core.model.jpa.FileSystemDirectoryConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Represents the meta data of a CSAR and makes the content the CSAR available. It provides structured access to all + * files and directories of the CSAR. For CSAR browsing this represents the CSAR root. Access to information contained + * in the TOSCA meta file of the CSAR, e.g. the author. Additionally, it resolves artifact references respectively gives + * access to the artifact content. + * + * @deprecated Instead use {@link Csar} + */ +@NamedQueries( { + @NamedQuery(name = CSARContent.GET_CSARIDS, query = CSARContent.GET_CSAR_IDS_QUERY), + @NamedQuery(name = CSARContent.BY_CSARID, query = CSARContent.GET_CSAR_CONTENTS_BY_CSARID_QUERY), +}) +@Entity(name = CSARContent.TABLE_NAME) +@Table(name = CSARContent.TABLE_NAME) +@Deprecated +public class CSARContent implements IBrowseable { + /* + * JPQL Queries + */ + public static final String GET_CSARIDS = "CSARContent.GET_CSARIDS"; + public static final String BY_CSARID = "CSARContent.byCSARID"; + /** + * For storing / updating the storage provider ID of a file in CSAR we must use a native SQL query, because JPQL + * update queries doesn't work on Maps. + */ + static final String TABLE_NAME = "CSAR"; + static final String GET_CSAR_IDS_QUERY = "SELECT t.csarID FROM " + CSARContent.TABLE_NAME + " t"; + static final String GET_CSAR_CONTENTS_BY_CSARID_QUERY = "SELECT t FROM " + CSARContent.TABLE_NAME + " t WHERE t.csarID = :csarID"; + + private static final Logger LOG = LoggerFactory.getLogger(CSARContent.class); + + /** + * Identifies this CSAR file. + */ + @Id + @GeneratedValue + @SuppressWarnings("unused") + // need a surrogate id, because we can't convert the id column with hibernate + long surrogateId; + + @Convert(converter = CsarIdConverter.class) + @Column(name = "csarID", unique = true, nullable = false) + private CsarId csarID; + + /** + * Contains the content of the TOSCA meta file of this CSAR. + */ + // store TOSCAMetaFile as TEXT / CLOB + @Column(name = "toscaMetaFile", columnDefinition = "TEXT") + private TOSCAMetaFile toscaMetaFile = null; + + /** + * For CSAR browsing this class represents the CSAR root.
    Browsing methods in this class redirecting to the + * same methods of this {@link AbstractDirectory} by delegation. + */ + @Convert(converter = FileSystemDirectoryConverter.class) + @Column(name = "csarRoot", nullable = false) + private FileSystemDirectory csarRoot = null; + + /** + * Needed by Eclipse Link. + */ + public CSARContent() { + super(); + } + + public CSARContent(final CSARID csarID, final FileSystemDirectory csarRoot, final TOSCAMetaFile toscaMetaFile) { + this.toscaMetaFile = toscaMetaFile; + this.csarID = new CsarId(csarID); + this.csarRoot = csarRoot; + } + + /** + * @return CSAR ID of this CSAR. + */ + public CSARID getCSARID() { + return this.csarID.toOldCsarId(); + } + + @Override + public AbstractFile getFile(final String relPathOfFile) { + return this.csarRoot.getFile(relPathOfFile); + } + + @Override + public Set getFiles() { + return this.csarRoot.getFiles(); + } + + @Override + public Set getFilesRecursively() { + return this.csarRoot.getFilesRecursively(); + } + + @Override + public AbstractDirectory getDirectory(final String relPathOfDirectory) { + return this.csarRoot.getDirectory(relPathOfDirectory); + } + + @Override + public Set getDirectories() { + return this.csarRoot.getDirectories(); + } + + /** + * @return Root TOSCA file of this CSAR as {@code AbstractFile}.
    If no root TOSCA path is specified in the + * TOSCA meta file (attribute "Entry-Definitions") or path points to a non-existent file {@code null}. + */ + public AbstractFile getRootTOSCA() { + LOG.debug("Retrieving root TOSCA of CSAR \"{}\"...", this.csarID); + String relPathOfRootTOSCA = this.toscaMetaFile.getEntryDefinitions(); + if (relPathOfRootTOSCA == null) { + LOG.warn("Root TOSCA path is not specified in TOSCA meta file of CSAR \"{}\".", this.csarID); + return null; + } + + AbstractFile rootTOSCA = getFile(relPathOfRootTOSCA); + if (rootTOSCA == null) { + LOG.warn("Root TOSCA path \"{}\" specified in TOSCA meta file of CSAR \"{}\" points to a non-existing file.", relPathOfRootTOSCA, this.csarID); + return null; + } + LOG.debug("Root TOSCA exists at \"{}\" in CSAR \"{}\".", rootTOSCA.getPath(), this.csarID); + return rootTOSCA; + } +} diff --git a/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/model/jpa/FileSystemDirectoryConverter.java b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/model/jpa/FileSystemDirectoryConverter.java new file mode 100644 index 000000000..c97305329 --- /dev/null +++ b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/model/jpa/FileSystemDirectoryConverter.java @@ -0,0 +1,20 @@ +package org.opentosca.container.legacy.core.model.jpa; + +import java.nio.file.Paths; + +import javax.persistence.AttributeConverter; + +import org.opentosca.container.core.model.csar.backwards.FileSystemDirectory; + +@javax.persistence.Converter +public class FileSystemDirectoryConverter implements AttributeConverter { + @Override + public String convertToDatabaseColumn(FileSystemDirectory fileSystemDirectory) { + return fileSystemDirectory == null ? null : fileSystemDirectory.getPath(); + } + + @Override + public FileSystemDirectory convertToEntityAttribute(String s) { + return s == null ? null : new FileSystemDirectory(Paths.get(s)); + } +} diff --git a/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/CSARMetaDataJPAStore.java b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/CSARMetaDataJPAStore.java new file mode 100644 index 000000000..4446d15d5 --- /dev/null +++ b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/CSARMetaDataJPAStore.java @@ -0,0 +1,150 @@ +package org.opentosca.container.legacy.core.service; + +import java.nio.file.Path; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; +import javax.persistence.Query; +import javax.persistence.TypedQuery; + +import org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFile; + +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.csar.backwards.FileSystemDirectory; +import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.core.next.jpa.EntityManagerProvider; +import org.opentosca.container.legacy.core.model.CSARContent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Manages CSAR meta data in the database by using Eclipse Link (JPA). + */ +@Deprecated +public class CSARMetaDataJPAStore { + + private final static Logger LOG = LoggerFactory.getLogger(CSARMetaDataJPAStore.class); + + private EntityManager em; + + /** + * Initializes JPA. + */ + private void initJPA() { + if (this.em == null) { + this.em = EntityManagerProvider.createEntityManager(); + } + } + + /** + * This method is called when the garbage collector destroys the class. We will then manually close the + * EntityManager / Factory and pass control back. + */ + @Override + protected void finalize() throws Throwable { + this.em.close(); + super.finalize(); + } + + /** + * Persists the meta data of CSAR {@code csarID}. + * + * @param csarID of the CSAR. + * @param toscaMetaFile - represents the content of the TOSCA meta file of the CSAR. + */ + public void storeCSARMetaData(final CSARID csarID, Path csarRoot, final TOSCAMetaFile toscaMetaFile) { + initJPA(); + LOG.debug("Storing meta data of CSAR \"{}\"...", csarID); + + final CSARContent csar = new CSARContent(csarID, new FileSystemDirectory(csarRoot), toscaMetaFile); + + this.em.getTransaction().begin(); + this.em.persist(csar); + this.em.getTransaction().commit(); + + // clear the JPA 1st level cache + this.em.clear(); + + LOG.debug("Storing meta data of CSAR \"{}\" completed.", csarID); + } + + /** + * @param csarID of CSAR + * @return {@code true} if meta data of CSAR {@code csarID} were found, otherwise {@code false}. + */ + public boolean isCSARMetaDataStored(final CSARID csarID) { + initJPA(); + LOG.debug("Checking if meta data of CSAR \"{}\" are stored...", csarID); + + final TypedQuery query = this.em.createNamedQuery(CSARContent.BY_CSARID, CSARContent.class); + query.setParameter("csarID", new CsarId(csarID)); + + try { + query.getSingleResult(); + LOG.debug("Meta data of CSAR \"{}\" were found.", csarID); + return true; + } catch (NoResultException e) { + LOG.debug("Meta data of CSAR \"{}\" were not found.", csarID); + return false; + } + } + + /** + * Retrieves the meta data of CSAR {@code csarID}. + * + * @param csarID of CSAR. + * @return {@link CSARContent} that gives access to all files and directories and the TOSCA meta file of the CSAR. + * @throws UserException if meta data of CSAR {@code csarID} were not found. + */ + public CSARContent getCSARMetaData(final CSARID csarID) throws UserException { + initJPA(); + LOG.debug("Retrieving meta data of CSAR \"{}\"...", csarID); + + final TypedQuery query = this.em.createNamedQuery(CSARContent.BY_CSARID, CSARContent.class); + query.setParameter("csarID", new CsarId(csarID)); + + try { + return query.getSingleResult(); + } catch (NoResultException e) { + String message = String.format("Meta data of CSAR \"%s\" were not found.", csarID); + LOG.debug(message); + throw new NotFoundException(message); + } + } + + /** + * @return CSAR IDs of all stored CSAR files. + */ + public Set getCSARIDsMetaData() { + initJPA(); + LOG.trace("Retrieving CSAR IDs of all stored CSARs..."); + final Query getCSARIDsQuery = this.em.createNamedQuery(CSARContent.GET_CSARIDS); + + @SuppressWarnings("unchecked") final List csarIDs = getCSARIDsQuery.getResultList(); + LOG.trace("{} CSAR ID(s) was / were found.", csarIDs.size()); + return new HashSet<>(csarIDs); + } + + /** + * Deletes the meta data of CSAR {@code csarID}. + * + * @param csarID of CSAR. + * @throws UserException if meta data of CSAR {@code csarID} were not found. + */ + public void deleteCSARMetaData(final CSARID csarID) throws UserException { + initJPA(); + LOG.debug("Deleting meta data of CSAR \"{}\"...", csarID); + final CSARContent csarContent = getCSARMetaData(csarID); + + this.em.getTransaction().begin(); + this.em.remove(csarContent); + this.em.getTransaction().commit(); + + LOG.info("Deleting meta data of CSAR \"{}\" completed.", csarID); + } +} diff --git a/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/CoreFileServiceImpl.java b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/CoreFileServiceImpl.java new file mode 100644 index 000000000..17b5c704a --- /dev/null +++ b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/CoreFileServiceImpl.java @@ -0,0 +1,141 @@ +package org.opentosca.container.legacy.core.service; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Set; + +import org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFile; +import org.eclipse.winery.model.csar.toscametafile.TOSCAMetaFileParser; +import org.eclipse.winery.repository.backend.filebased.FileUtils; + +import org.opentosca.container.core.common.EntityExistsException; +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.impl.service.FileSystem; +import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryVisitor; +import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.legacy.core.model.CSARContent; +import org.opentosca.container.legacy.core.service.csar.CSARUnpacker; +import org.opentosca.container.legacy.core.service.csar.CSARValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * Provides a store and management functionality for CSAR files. + *

    + * Meta data (file and directory paths, TOSCA meta file content and CSAR ID) of a CSAR will be stored locally in the + * database. This makes it possible to browse in a CSAR and get the TOSCA meta file data without network access. + * + * @see CSARContent + */ +@Deprecated +@Service +public class CoreFileServiceImpl implements ICoreFileService { + + private static final Logger LOG = LoggerFactory.getLogger(CoreFileServiceImpl.class); + + private static final CSARMetaDataJPAStore JPA_STORE = new CSARMetaDataJPAStore(); + private final Path baseDirectory; + + @Deprecated + public CoreFileServiceImpl() { + this(Settings.CONTAINER_STORAGE_BASEPATH); + } + + public CoreFileServiceImpl(Path baseDirectory) { + this.baseDirectory = baseDirectory; + } + + @Override + public CSARContent getCSAR(final CSARID csarID) throws UserException { + return JPA_STORE.getCSARMetaData(csarID); + } + + @Override + public CSARID storeCSAR(final Path csarFile) throws UserException, SystemException { + LOG.debug("Given file to store: {}", csarFile); + + CSARUnpacker csarUnpacker = null; + try { + if (!Files.isRegularFile(csarFile)) { + throw new UserException( + "\"" + csarFile.toString() + "\" to store is not an absolute path to an existent file."); + } + + final CSARID csarID = new CSARID(csarFile.getFileName().toString()); + if (JPA_STORE.isCSARMetaDataStored(csarID)) { + throw new EntityExistsException("CSAR \"" + csarID.toString() + "\" is already stored. Overwriting a CSAR is not allowed."); + } + + csarUnpacker = new CSARUnpacker(csarFile); + csarUnpacker.unpackAndVisitUnpackDir(); + + final Path csarUnpackDir = csarUnpacker.getUnpackDirectory(); + final DirectoryVisitor csarVisitor = csarUnpacker.getFilesAndDirectories(); + + final CSARValidator csarValidator = new CSARValidator(csarID, csarUnpackDir, csarVisitor); + if (!csarValidator.isValid()) { + throw new UserException(csarValidator.getErrorMessage()); + } + + final Path toscaMetaFileAbsPath = csarUnpackDir.resolve(Settings.TOSCA_META_FILE_REL_PATH); + final TOSCAMetaFile toscaMetaFile = new TOSCAMetaFileParser().parse(toscaMetaFileAbsPath); + if (toscaMetaFile == null) { + throw new UserException("TOSCA meta file is invalid."); + } + + Path persistentStorageLocation = baseDirectory.resolve(csarID.getFileName()); + try { + FileSystem.copyDirectory(csarUnpackDir, persistentStorageLocation); + } catch (IOException e) { + throw new SystemException("Creating the permanent storage for the CSAR failed", e); + } + + JPA_STORE.storeCSARMetaData(csarID, persistentStorageLocation, toscaMetaFile); + LOG.debug("Storing CSAR \"{}\" located at \"{}\" successfully completed.", csarID, csarFile); + return csarID; + } finally { + // At the end or if an exception occurred we should delete the + // unpack directory, if necessary. + if (csarUnpacker != null) { + csarUnpacker.deleteUnpackDir(); + } + } + } + + @Override + public void deleteCSAR(final CSARID csarID) throws UserException { + LOG.info("Deleting CSAR \"{}\" in planbuilder", csarID); + // Delete CSAR from disk + FileUtils.forceDelete(baseDirectory.resolve(csarID.getFileName())); + if (!JPA_STORE.isCSARMetaDataStored(csarID)) { + LOG.info("Nothing to delete"); + return; + } + JPA_STORE.deleteCSARMetaData(csarID); + LOG.info("Deleting CSAR \"{}\" completed.", csarID); + } + + @Override + public void deleteCSARs() throws SystemException { + LOG.debug("Deleting all CSARs..."); + final Set csarIDs = JPA_STORE.getCSARIDsMetaData(); + if (csarIDs.isEmpty()) { + LOG.debug("No CSARs are currently stored."); + return; + } + + LOG.debug("{} CSAR(s) is / are currently stored and will be deleted now.", csarIDs.size()); + for (final CSARID csarID : csarIDs) { + try { + deleteCSAR(csarID); + } catch (final UserException exc) { + throw new SystemException("An System Exception occured.", exc); + } + } + LOG.debug("Deleting all CSARs completed."); + } +} diff --git a/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/ICoreFileService.java b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/ICoreFileService.java new file mode 100644 index 000000000..8d0998a9b --- /dev/null +++ b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/ICoreFileService.java @@ -0,0 +1,80 @@ +package org.opentosca.container.legacy.core.service; + +import java.nio.file.Path; + +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.legacy.core.model.CSARContent; + +/** + * This interface of the Core File Service defines methods for

    - storing, getting, moving and deleting CSAR + * files.
    - moving files or directories contained in CSAR files.
    - getting available and ready storage + * providers.
    - getting and setting the active storage provider.
    - getting the default storage provider.

    Copyright 2013 IAAS University of Stuttgart

    + * + * @author Rene Trefft - rene.trefft@developers.opentosca.org + * @see CSARContent + */ +@Deprecated +public interface ICoreFileService { + + /** + * Stores the CSAR file {@code csarFile}.
    First, it will be checked if the given file has correct extension + * and is not already stored. Then the CSAR will be unpacked (path is specified in Settings bundle), its content + * validated and the TOSCA meta file parsed. Finally all files of the CSAR will be stored on the active storage + * provider. After storing on storage provider the meta data of the CSAR (file and directory paths, TOSCA meta file + * content and CSAR ID) will be stored in the database and the unpack directory deleted.

    Note 1: If no + * active storage provider is set (e.g. directly after the start of the container) or it's not ready, the default + * storage provider will be used instead, if it's available and ready.
    Note 2: Only files of a CSAR will be + * stored on the storage provider. Directories will be stored as meta data only.
    Note 3: If an error occurred + * during storing the unpack directory will be also deleted (if necessary). + * + * @param csarFile to store. + * @return CSAR ID thats uniquely identifies the CSAR file. + * @throws SystemException if active storage provider is not set / can't be used and default storage provider also + * can't be used, unpacking CSAR failed, access to an directory denied while getting files + * and directories in unpack directory or if an error occurred during storing on the storage + * provider. + * @throws UserException if {@code csarFile} is not a existent file, has wrong file extension, is already stored + * or it's content is invalid, e.g. contains no TOSCA file or has an invalid TOSCA meta + * file. + * @see org.opentosca.container.core.common.Settings + */ + public CSARID storeCSAR(Path csarFile) throws UserException, SystemException; + + /** + * Retrieves meta data of CSAR {@code csarID}. + * + * @param csarID of CSAR + * @return {@link CSARContent} that gives access to all files and directories and the TOSCA meta file of the CSAR. + * @throws UserException if CSAR {@code csarID} was not found. + */ + public CSARContent getCSAR(CSARID csarID) throws UserException; + + /** + * Deletes the CSAR {@code csarID}.

    First, the files meta data of CSAR {@code csarID} will be retrieved + * to check if the CSAR exists and to get the storage provider(s) of the files. Then it will be checked if each + * storage provider is available and ready to minimize the risk for a cancel of the deletion process. Finally all + * files of the CSAR will be deleted on the storage provider(s). After deletion the meta data of the CSAR will be + * deleted, too.
    If an error occurred while deleting files, the complete process will be canceled respectively + * further files will not be deleted anymore. The meta data of the CSAR is not deleted, so deletion can be executed + * again to delete the remaining files. + * + * @param csarID of CSAR + * @throws UserException if CSAR {@code csarID} was not found. + * @throws SystemException if a required storage provider is not available and ready or an error occurred during + * deleting files. + */ + public void deleteCSAR(CSARID csarID) throws SystemException, UserException; + + /** + * Deletes all CSAR files.

    The CSAR IDs of all stored CSAR will be retrieved and then each CSAR deleted + * by using {@link #deleteCSAR(CSARID)}.
    If an error occurred while deleting a CSAR, the complete process will + * be canceled respectively further CSARs will not be deleted anymore.
    + * + * @throws SystemException if a required storage provider is not available and ready or an error occurred during + * deleting files of CSARs. + */ + public void deleteCSARs() throws SystemException; +} diff --git a/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/InstanceDataServiceImpl.java b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/InstanceDataServiceImpl.java new file mode 100644 index 000000000..0e30c884c --- /dev/null +++ b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/InstanceDataServiceImpl.java @@ -0,0 +1,257 @@ +package org.opentosca.container.legacy.core.service; + +import java.net.URI; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.impl.persistence.Converters; +import org.opentosca.container.core.impl.persistence.DaoUtil; +import org.opentosca.container.core.impl.persistence.NodeInstanceDAO; +import org.opentosca.container.core.impl.persistence.RelationInstanceDAO; +import org.opentosca.container.core.impl.persistence.ServiceInstanceDAO; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.model.instance.IdConverter; +import org.opentosca.container.core.model.instance.NodeInstance; +import org.opentosca.container.core.model.instance.RelationInstance; +import org.opentosca.container.core.model.instance.ServiceInstance; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.repository.NodeTemplateInstanceRepository; +import org.opentosca.container.core.next.repository.RelationshipTemplateInstanceRepository; +import org.opentosca.container.core.next.repository.ServiceTemplateInstanceRepository; +import org.opentosca.container.core.service.IInstanceDataService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.w3c.dom.Document; + +/** + * The InstanceDataService.
    The Engine offers a service to manage InstanceData for existing ServiceTemplates inside + * the CSARs. It relies on the ToscaEngine to get its information about existence of those and for values for the + * default properties of created instances. + */ +@Deprecated +@Service +public class InstanceDataServiceImpl implements IInstanceDataService { + private static final Logger LOG = LoggerFactory.getLogger(InstanceDataServiceImpl.class); + + private final ServiceTemplateInstanceRepository serviceRepository = new ServiceTemplateInstanceRepository(); + private final NodeTemplateInstanceRepository nodeRepository = new NodeTemplateInstanceRepository(); + private final RelationshipTemplateInstanceRepository relationshipRepository = new RelationshipTemplateInstanceRepository(); + + // used for persistence + private final ServiceInstanceDAO siDAO = new ServiceInstanceDAO(); + private final NodeInstanceDAO niDAO = new NodeInstanceDAO(); + private final RelationInstanceDAO riDAO = new RelationInstanceDAO(); + + /** + * Creates an empty DOM document. + * + * @return An empty DOM document. + */ + private static Document emptyDocument() { + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + try { + final DocumentBuilder db = dbf.newDocumentBuilder(); + final Document doc = db.newDocument(); + return doc; + } catch (final ParserConfigurationException e) { + LOG.error(e.getMessage()); + } + return null; + } + + @Override + public List getServiceInstances(final URI serviceInstanceID, final String serviceTemplateName, + final QName serviceTemplateId) { + + LOG.info("getServiceInstances(): {}", serviceInstanceID); + LOG.info("getServiceInstances(): {}", serviceTemplateName); + LOG.info("getServiceInstances(): {}", serviceTemplateId); + + if (serviceInstanceID != null) { + Integer id = IdConverter.serviceInstanceUriToID(serviceInstanceID); + if (id == null) { + final String[] segments = serviceInstanceID.getPath().split("/"); + id = Integer.valueOf(segments[segments.length - 1]); + } + LOG.info("Using ServiceTemplate Instance ID: {}", id); + final Optional sti = this.serviceRepository.find(DaoUtil.toLong(id)); + if (sti.isPresent()) { + LOG.info("Single Result: {}", sti); + return Collections.singletonList(Converters.convert(sti.get())); + } else { + LOG.info("NOT FOUND"); + } + } + + if (serviceTemplateName != null) { + LOG.info("Using serviceTemplateId: {}", serviceTemplateId); + final Collection result = this.serviceRepository.findByTemplateId(serviceTemplateName); + if (result != null) { + LOG.info("Result: {}", result.size()); + return result.stream().map(Converters::convert).collect(Collectors.toList()); + } + } + return this.siDAO.getServiceInstances(serviceInstanceID, serviceTemplateName, serviceTemplateId); + } + + @Override + public List getServiceInstancesWithDetails(final CsarId csarId, final String serviceTemplateId, + final Integer serviceTemplateInstanceID) { + LOG.info("getServiceInstancesWithDetails(): {}", csarId); + LOG.info("getServiceInstancesWithDetails(): {}", serviceTemplateId); + LOG.info("getServiceInstancesWithDetails(): {}", serviceTemplateInstanceID); + + if (serviceTemplateInstanceID != null) { + final Optional sti = this.serviceRepository.find(DaoUtil.toLong(serviceTemplateInstanceID)); + if (sti.isPresent()) { + LOG.info("Single Result: {}", sti); + return Collections.singletonList(Converters.convert(sti.get())); + } else { + LOG.info("NOT FOUND"); + } + } + + if (serviceTemplateId != null) { + final Collection result = this.serviceRepository.findByTemplateId(serviceTemplateId); + if (result != null) { + LOG.info("Result: {}", result.size()); + return result.stream().map(Converters::convert).collect(Collectors.toList()); + } + } + + return this.siDAO.getServiceInstances(csarId, serviceTemplateId, serviceTemplateInstanceID); + } + + @Override + public List getNodeInstances(final URI nodeInstanceID, final String nodeTemplateID, + final String nodeTemplateName, final URI serviceInstanceID) { + LOG.info("getNodeInstances(): {}", nodeInstanceID); + LOG.info("getNodeInstances(): {}", nodeTemplateID); + LOG.info("getNodeInstances(): {}", nodeTemplateName); + LOG.info("getNodeInstances(): {}", serviceInstanceID); + + if (nodeInstanceID != null) { + Integer id = IdConverter.nodeInstanceUriToID(nodeInstanceID); + if (id == null) { + final String[] segments = serviceInstanceID.getPath().split("/"); + id = Integer.valueOf(segments[segments.length - 1]); + } + LOG.info("Using NodeTemplate Instance ID: {}", id); + final Optional nti = this.nodeRepository.find(DaoUtil.toLong(id)); + if (nti.isPresent()) { + LOG.info("Single Result: {}", nti); + return Collections.singletonList(Converters.convert(nti.get())); + } else { + LOG.info("NOT FOUND"); + } + } + + if (nodeTemplateID != null) { + final Collection result = this.nodeRepository.findByTemplateId(nodeTemplateID); + if (result != null) { + LOG.info("Result: {}", result.size()); + return result.stream().map(nti -> Converters.convert(nti)).collect(Collectors.toList()); + } + } + + if (serviceInstanceID != null) { + Integer id = IdConverter.serviceInstanceUriToID(serviceInstanceID); + if (id == null) { + final String[] segments = serviceInstanceID.getPath().split("/"); + id = Integer.valueOf(segments[segments.length - 1]); + } + LOG.info("Using ServiceTemplate Instance ID: {}", id); + final Optional sti = this.serviceRepository.find(DaoUtil.toLong(id)); + if (sti.isPresent()) { + final ServiceTemplateInstance i = sti.get(); + final Collection result = i.getNodeTemplateInstances(); + if (result != null) { + LOG.info("Result: {}", result.size()); + return result.stream().map(nti -> Converters.convert(nti)).collect(Collectors.toList()); + } + } else { + LOG.info("NOT FOUND"); + } + } + + return this.niDAO.getNodeInstances(serviceInstanceID, nodeTemplateID, nodeTemplateName, nodeInstanceID); + } + + @Override + public List getRelationInstances(final URI relationInstanceID, final QName relationshipTemplateID, + final String relationshipTemplateName, + final URI serviceInstanceID) { + + LOG.info("getRelationInstances(): {}", relationInstanceID); + LOG.info("getRelationInstances(): {}", relationshipTemplateID); + LOG.info("getRelationInstances(): {}", relationshipTemplateName); + LOG.info("getRelationInstances(): {}", serviceInstanceID); + + if (relationInstanceID != null) { + Integer id = IdConverter.relationInstanceUriToID(relationInstanceID); + if (id == null) { + final String[] segments = relationInstanceID.getPath().split("/"); + id = Integer.valueOf(segments[segments.length - 1]); + } + LOG.info("Using RelationshipTemplate Instance ID: {}", id); + final Optional nti = this.relationshipRepository.find(DaoUtil.toLong(id)); + if (nti.isPresent()) { + LOG.info("Single Result: {}", nti); + return Collections.singletonList(Converters.convert(nti.get())); + } else { + LOG.info("NOT FOUND"); + } + } + + if (relationshipTemplateID != null) { + final Collection result = + this.relationshipRepository.findByTemplateId(relationshipTemplateID.getLocalPart()); + if (result != null) { + LOG.info("Result: {}", result.size()); + return result.stream().map(Converters::convert).collect(Collectors.toList()); + } + } + + if (serviceInstanceID != null) { + final Set rels = new HashSet<>(); + Integer id = IdConverter.serviceInstanceUriToID(serviceInstanceID); + if (id == null) { + final String[] segments = serviceInstanceID.getPath().split("/"); + id = Integer.valueOf(segments[segments.length - 1]); + } + LOG.info("Using ServiceTemplate Instance ID: {}", id); + final Optional sti = this.serviceRepository.find(DaoUtil.toLong(id)); + if (sti.isPresent()) { + final ServiceTemplateInstance i = sti.get(); + final Collection result = i.getNodeTemplateInstances(); + if (result != null) { + for (final NodeTemplateInstance nti : result) { + rels.addAll(nti.getIncomingRelations()); + rels.addAll(nti.getOutgoingRelations()); + } + LOG.info("Result: {}", rels.size()); + return rels.stream().map(Converters::convert).collect(Collectors.toList()); + } + } else { + LOG.info("NOT FOUND"); + } + } + + return this.riDAO.getRelationInstances(serviceInstanceID, relationshipTemplateID, relationshipTemplateName, + relationInstanceID); + } +} diff --git a/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/csar/CSARUnpacker.java b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/csar/CSARUnpacker.java new file mode 100644 index 000000000..527a22940 --- /dev/null +++ b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/csar/CSARUnpacker.java @@ -0,0 +1,143 @@ +package org.opentosca.container.legacy.core.service.csar; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.impl.service.FileSystem; +import org.opentosca.container.core.impl.service.ZipManager; +import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryDeleteVisitor; +import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryVisitor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Unpacks a CSAR file and gets its files and directories. + */ +public class CSARUnpacker { + + private final static Logger LOG = LoggerFactory.getLogger(CSARUnpacker.class); + + private final Path csarFile; + + private Path csarUnpackDirectory; + private DirectoryVisitor csarVisitor; + + /** + * Default constructor needed by OSGi to instantiate this class. + */ + public CSARUnpacker() { + this.csarFile = null; + } + + /** + * Creates a {@code CSARUnpacker}. + * + * @param csarFile to process. + */ + public CSARUnpacker(final Path csarFile) { + if (csarFile == null) { + throw new IllegalArgumentException("CsarFile may not be null"); + } + + this.csarFile = csarFile; + } + + /** + * Unpacks the CSAR file to a temporary directory and gets all files and directories in the unpack directory.
    + *
    Note: If unpacking or getting files and directories in unpacking directory failed, deleting unpack + * directory will be attempted. + * + * @throws SystemException if unpacking or getting files and directories in unpack directory failed. + */ + public void unpackAndVisitUnpackDir() throws UserException, SystemException { + LOG.debug("Unpacking CSAR located at \"{}\"...", this.csarFile); + + try { + this.csarUnpackDirectory = FileSystem.getTemporaryFolder(); + LOG.debug("Unpacking directory: {}", csarUnpackDirectory); + + final List unpackedFiles = ZipManager.getInstance().unzip(this.csarFile.toFile(), csarUnpackDirectory.toFile()); + if (unpackedFiles == null) { + throw new UserException("Unpacking file located at \"" + this.csarFile.toString() + "\" failed."); + } + this.visitUnpackDir(); + + LOG.debug("Unpacking CSAR located at \"{}\" and getting its files and directories completed.", this.csarFile); + } catch (UserException | SystemException exc) { + this.deleteUnpackDir(); + throw exc; + } + } + + /** + * @return Directory where the CSAR was unpacked. If {@link #unpackAndVisitUnpackDir()} was not executed yet or + * failed {@code null}. + */ + public Path getUnpackDirectory() { + return this.csarUnpackDirectory; + } + + /** + * @return Files and directories in CSAR unpack directory as {@link DirectoryVisitor}. If {@link + * #unpackAndVisitUnpackDir()} was not executed yet or failed {@code null}. + */ + public DirectoryVisitor getFilesAndDirectories() { + return this.csarVisitor; + } + + /** + * Getting recursively all files and directories in the unpack directory. + * + * @throws SystemException if access to an directory denied that must be visited + */ + private void visitUnpackDir() throws SystemException { + LOG.debug("Getting files and directories in CSAR unpack directory \"{}\"...", this.csarUnpackDirectory); + final DirectoryVisitor directoryVisitor = new DirectoryVisitor(); + + try { + Files.walkFileTree(this.csarUnpackDirectory, directoryVisitor); + // removes the unpack directory (only the directory content is + // necessary) + directoryVisitor.getVisitedDirectories().remove(this.csarUnpackDirectory); + + LOG.debug("Getting files and directories in CSAR unpack directory \"{}\" completed.", this.csarUnpackDirectory); + this.csarVisitor = directoryVisitor; + } catch (final IOException exc) { + throw new SystemException( + "An IO Exception occurred. Getting files and directorties in CSAR unpack directory \"" + + this.csarUnpackDirectory.toString() + "\" failed.", + exc); + } + } + + /** + * Deletes the unpack directory. + * + * @throws SystemException if access to an directory denied that must be deleted. + */ + public void deleteUnpackDir() throws SystemException { + if (this.csarUnpackDirectory == null) { + return; + } + LOG.debug("Deleting CSAR unpack dir \"{}\"...", this.csarUnpackDirectory); + + final DirectoryDeleteVisitor csarDeleteVisitor = new DirectoryDeleteVisitor(); + try { + Files.walkFileTree(this.csarUnpackDirectory, csarDeleteVisitor); + LOG.debug("Deleting CSAR unpack dir \"{}\" completed.", this.csarUnpackDirectory); + } catch (final IOException exc) { + throw new SystemException( + "An IO Exception occurred. Deleting files and directories in CSAR unpack directory \"" + + this.csarUnpackDirectory.toString() + "\" failed.", + exc); + } finally { + this.csarUnpackDirectory = null; + this.csarVisitor = null; + } + } +} diff --git a/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/csar/CSARValidator.java b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/csar/CSARValidator.java new file mode 100644 index 000000000..54fc6b61e --- /dev/null +++ b/org.opentosca.container.legacy/src/main/java/org/opentosca/container/legacy/core/service/csar/CSARValidator.java @@ -0,0 +1,141 @@ +package org.opentosca.container.legacy.core.service.csar; + +import java.nio.file.Path; +import java.util.Set; + +import org.opentosca.container.core.common.Settings; +import org.opentosca.container.core.impl.service.internal.file.visitors.DirectoryVisitor; +import org.opentosca.container.core.model.csar.id.CSARID; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Validates the content of a CSAR. + */ +public class CSARValidator { + + private static final Logger LOG = LoggerFactory.getLogger(CSARValidator.class); + + /** + * Relative path to CSAR root of the {@code Definitions} directory. + */ + private static final String CSAR_DEFINITIONS_DIR_REL_PATH = "Definitions"; + + /** + * CSAR ID of the CSAR to validate. + */ + private final CSARID CSAR_ID; + + /** + * Absolute path to unpack directory of the CSAR to validate. + */ + private final Path CSAR_UNPACK_DIR; + + /** + * Contains all directories and files in the unpack directory of the CSAR to validate. + */ + private final DirectoryVisitor CSAR_VISITOR; + + /** + * Error message that can fetched if any errors occurred during validation. + */ + private final StringBuilder errorMessage = new StringBuilder(); + + private boolean isValidCSAR = true; + + /** + * Creates a {@link CSARValidator}.
    After creation {@link #isValid()} should be called to validate the CSAR + * content. + * + * @param csarID of CSAR + * @param csarUnpackDir - absolute path of CSAR unpack directory + * @param csarVisitor - must contain all files and directories in {@code csarUnpackDir}. + */ + public CSARValidator(final CSARID csarID, final Path csarUnpackDir, final DirectoryVisitor csarVisitor) { + this.CSAR_ID = csarID; + this.CSAR_UNPACK_DIR = csarUnpackDir; + this.CSAR_VISITOR = csarVisitor; + } + + /** + * Basic validation of the content of the CSAR. + * + * @return {@code true} if content of CSAR is valid, otherwise {@code false} . + */ + public boolean isValid() { + + LOG.debug("Validating content of CSAR \"{}\"...", this.CSAR_ID); + + final Set csarFiles = this.CSAR_VISITOR.getVisitedFiles(); + + if (!this.containsTOSCAs(this.CSAR_ID, this.CSAR_UNPACK_DIR, csarFiles)) { + this.isValidCSAR = false; + } + + if (!this.existsTOSCAMetaFile(this.CSAR_ID, this.CSAR_UNPACK_DIR, csarFiles)) { + this.isValidCSAR = false; + } + + if (this.isValidCSAR) { + LOG.debug("Validation of CSAR \"{}\" completed. CSAR is valid.", this.CSAR_ID); + } else { + LOG.warn("Validation of CSAR \"{}\" completed. CSAR is invalid!", this.CSAR_ID); + } + + return this.isValidCSAR; + } + + /** + * @return Occurred errors during validation of CSAR. If CSAR was not validated yet using {@link + * CSARValidator#isValid()} or no errors occurred {@code null}. + */ + public String getErrorMessage() { + if (this.isValidCSAR) { + return null; + } else { + // add beginning to error message + this.errorMessage.insert(0, "Content of CSAR \"" + this.CSAR_ID + "\" is invalid. Found errors:"); + return this.errorMessage.toString(); + } + } + + /** + * @param csarID of CSAR. + * @param csarUnpackDir - absolute path of CSAR unpack directory + * @param csarFiles - all files in {@code csarUnpackDir}. + * @return {@code true} if {@code Definitions} directory of CSAR {@code csarID} contains at least one TOSCA file, + * otherwise {@code false}. + */ + private boolean containsTOSCAs(final CSARID csarID, final Path csarUnpackDir, final Set csarFiles) { + + final Path csarDefinitionsDirAbsPath = csarUnpackDir.resolve(this.CSAR_DEFINITIONS_DIR_REL_PATH); + + for (final Path csarFile : csarFiles) { + if (csarFile.startsWith(csarDefinitionsDirAbsPath)) { + LOG.debug("At least one file was found in directory \"{}\" of CSAR \"{}\".", this.CSAR_DEFINITIONS_DIR_REL_PATH, this.CSAR_ID); + return true; + } + } + this.errorMessage.append("\n") + .append("No files were found in directory \"").append(this.CSAR_DEFINITIONS_DIR_REL_PATH) + .append("\" of CSAR \"").append(this.CSAR_ID).append("\". There must be at least one!"); + return false; + } + + /** + * @param csarID of CSAR. + * @param csarUnpackDir - absolute path of CSAR unpack directory + * @param csarFiles - all files in {@code csarUnpackDir}. + * @return {@code true} if TOSCA meta file exists in CSAR {@code csarID}, otherwise {@code false}. + */ + private boolean existsTOSCAMetaFile(final CSARID csarID, final Path csarUnpackDir, final Set csarFiles) { + final Path toscaMetaFileAbsPath = csarUnpackDir.resolve(Settings.TOSCA_META_FILE_REL_PATH); + if (csarFiles.contains(toscaMetaFileAbsPath)) { + LOG.debug("TOSCA meta file exists at \"{}\" in CSAR \"{}\".", Settings.TOSCA_META_FILE_REL_PATH, this.CSAR_ID); + return true; + } + this.errorMessage.append("\n").append("TOSCA meta file does not exist at \"").append(Settings.TOSCA_META_FILE_REL_PATH) + .append("\" in CSAR \"").append(this.CSAR_ID).append("\"."); + return false; + } +} diff --git a/org.opentosca.container.legacy/src/main/resources/spring/context-legacy.xml b/org.opentosca.container.legacy/src/main/resources/spring/context-legacy.xml new file mode 100644 index 000000000..b503a0ed7 --- /dev/null +++ b/org.opentosca.container.legacy/src/main/resources/spring/context-legacy.xml @@ -0,0 +1,18 @@ + + + + Configuration for Spring-Bean service discovery within the legacy module + + + + + + + + diff --git a/org.opentosca.container.portability/META-INF/MANIFEST.MF b/org.opentosca.container.portability/META-INF/MANIFEST.MF deleted file mode 100644 index 115485a88..000000000 --- a/org.opentosca.container.portability/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Container Portability Service -Bundle-SymbolicName: org.opentosca.container.portability -Bundle-Version: 2.0.0.qualifier -Export-Package: org.opentosca.container.portability, - org.opentosca.container.portability.impl, - org.opentosca.container.portability.model, - org.opentosca.container.portability.model.util -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ActivationPolicy: lazy -Service-Component: OSGI-INF/* -Import-Package: org.osgi.framework;version="1.8.0", - org.slf4j;version="1.7.2" -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0" -Bundle-Activator: org.opentosca.container.portability.Activator diff --git a/org.opentosca.container.portability/OSGI-INF/PortabilityServiceImpl_component.xml b/org.opentosca.container.portability/OSGI-INF/PortabilityServiceImpl_component.xml deleted file mode 100644 index 920981711..000000000 --- a/org.opentosca.container.portability/OSGI-INF/PortabilityServiceImpl_component.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.container.portability/build.properties b/org.opentosca.container.portability/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.container.portability/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.container.portability/pom.xml b/org.opentosca.container.portability/pom.xml deleted file mode 100644 index 2009f9a1b..000000000 --- a/org.opentosca.container.portability/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.container.portability - eclipse-plugin - - diff --git a/org.opentosca.container.portability/schema1.xsd b/org.opentosca.container.portability/schema1.xsd deleted file mode 100644 index 7a70940a5..000000000 --- a/org.opentosca.container.portability/schema1.xsd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/Activator.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/Activator.java deleted file mode 100644 index 7fc1bde19..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright 2012 - 2017, University of Stuttgart and the OpenTOSCA contributors - * SPDX-License-Identifier: Apache-2.0 - *******************************************************************************/ -package org.opentosca.container.portability; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Activator implements BundleActivator { - - private static Logger logger = LoggerFactory.getLogger(Activator.class); - - private static BundleContext context; - - - static BundleContext getContext() { - return context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - logger.info("Starting bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - context = bundleContext; - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - logger.info("Stopping bundle \"{}\" ({})...", bundleContext.getBundle().getSymbolicName(), - bundleContext.getBundle().getVersion()); - Activator.context = null; - } -} diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/IPortabilityService.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/IPortabilityService.java deleted file mode 100644 index facaeb0f8..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/IPortabilityService.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.opentosca.container.portability; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.portability.model.Artifacts; - -/** - * - * This interface describes functionality of resolving the Artifacts (esp. references) inside of - * ServiceTemplates in a passed CSAR. This is a needed functionality for the Plans. - * - * The main function is getting the Artifacts of a nodeTemplate specified by a nodeTemplateID It - * also offers functionality to verify to which or whether (instanceOf / getNodeTypeOfNodeInstance) - * an NodeInstance belongs to a NodeType. - */ -public interface IPortabilityService { - - // TODO: this method should be implemented by a generic - // ServiceInvoker-Interface - maybe call this interface here - // f. ex. public String getIAEndpoint(QName nodeTemplateID, String - // operationName) - - public enum ArtifactType { - IA, DA - } - - - /** - * retrieves a TArtifact containing the specified ArtifactTypes of the nodeTemplate referenced by - * the nodeTemplateID - * - * @param csarID the ID of the CSAR used - * @param serviceTemplate the ID (QName) of the serviceTemplate - * @param nodeTemplateID the ID (QName) of the nodeTemplate - * @param artifactType the Types of Artifactes which should be in the result document. (f.ex. - * IPortabilityService.ArtifactType.BOTH ) - * @param deploymentArtifactName the name of the deploymentArtifacts which should be retrieved - * @param interfaceName the interfaceName of the implementationArtifact which should be retrieved - * @param operationName the operationName of the implementationArtifact which should be retrieved - * - * @return TArtifacts containing information about the artifacts specified - */ - public Artifacts getNodeTemplateArtifacts(CSARID csarID, QName serviceTemplateID, QName nodeTemplateID, - ArtifactType artifactType, String deploymentArtifactName, - String interfaceName, String operationName); - - /** - * retrieves a TArtifact containing the specified ArtifactTypes of the nodeTemplate referenced by - * the nodeTemplateID - * - * @param csarID the ID of the CSAR used - * @param serviceTemplate the ID (QName) of the serviceTemplate - * @param relationshipTemplateID the ID (QName) of the relationshipTemplate - * @param artifactType the Types of Artifactes which should be in the result document. (f.ex. - * IPortabilityService.ArtifactType.BOTH ) - * @param deploymentArtifactName the name of the deploymentArtifacts for which the - * relationshipTemplateArtifacts should be retrieved - * @param interfaceName the interfaceName of the implementationArtifact for which the - * relationshipTemplateArtifacts should be retrieved - * @param operationName the operationName of the implementationArtifact for which the - * relationshipTemplateArtifacts should be retrieved - * - * @return TArtifacts containing information about the artifacts specified - */ - public Artifacts getRelationshipTemplateArtifacts(CSARID csarID, QName serviceTemplateID, - QName relationshipTemplateID, ArtifactType artifactType, - String deploymentArtifactName, String interfaceName, - String operationName); - - /** - * returns the QName of the NodeType which the NodeInstance specified by NodeInstanceID - * belongs to - * - * @param NodeInstanceID the ID of the NodeInstance (QName) - * @return QName of the NodeType - */ - public QName getNodeTypeOfNodeInstance(CSARID csarID, QName NodeInstanceID); - - /** - * Checks whether the given template QName is a NodeTemplate inside the referenced CSAR and - * ServiceTemplate - * - * @param csarID the CSARID of the CSAR the NodeTemplate should belong - * @param serviceTemplateID the QName of the ServiceTemplate the NodeTemplate should belong - * @param templateId the QName of the Template to check whether it is a NodeTemplate - * @return true if the QName denotes a NodeTemplate, else false - */ - public boolean isNodeTemplate(CSARID csarID, QName serviceTemplateID, QName templateId); - - /** - * returns whether the nodeInstanceID belongs to a given nodeType - * - * @param csarID - * @param nodeInstanceID - * @param nodeTypeID - * @return - */ - public boolean instanceOf(CSARID csarID, QName nodeInstanceID, QName nodeTypeID); - -} diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/impl/PortabilityServiceImpl.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/impl/PortabilityServiceImpl.java deleted file mode 100644 index 9f38b8634..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/impl/PortabilityServiceImpl.java +++ /dev/null @@ -1,397 +0,0 @@ -package org.opentosca.container.portability.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.engine.IToscaEngineService; -import org.opentosca.container.core.engine.ResolvedArtifacts; -import org.opentosca.container.core.engine.ResolvedArtifacts.ResolvedDeploymentArtifact; -import org.opentosca.container.core.engine.ResolvedArtifacts.ResolvedImplementationArtifact; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.portability.IPortabilityService; -import org.opentosca.container.portability.model.Artifacts; -import org.opentosca.container.portability.model.DeploymentArtifact; -import org.opentosca.container.portability.model.ImplementationArtifact; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The portabilityService can mainly be used to get the Artifacts of a nodeTemplate specified by a - * nodeTemplateID It also offers functionality to verify to which or whether (instanceOf / - * getNodeTypeOfNodeInstance) an NodeInstance belongs to a NodeType - */ -public class PortabilityServiceImpl implements IPortabilityService { - - final private static Logger LOG = LoggerFactory.getLogger(PortabilityServiceImpl.class); - - private static IToscaEngineService toscaEngineService; - - - @Override - public Artifacts getNodeTemplateArtifacts(final CSARID csarID, final QName serviceTemplateID, - final QName nodeTemplateID, final ArtifactType artifactType, - final String deploymentArtifactName, final String interfaceName, - final String operationName) { - - // retrieve qnames of all nodeTypes => and qnames of implementations of - // this nodeTypes - final QName nodeTypeOfNodeTemplate = - toscaEngineService.getNodeTypeOfNodeTemplate(csarID, serviceTemplateID, nodeTemplateID.getLocalPart()); - - // TODO: null check nodeTypeOfNodeTemplate - final List nodeTypeImplementationsOfNodeType = - toscaEngineService.getTypeImplementationsOfType(csarID, nodeTypeOfNodeTemplate); - - // for each implementation we want to get the resolvedArtifacts => for - // each imp we get the archifactSpecificContent OR the reference from - // the respecting ArchifactTemplate - // the results are filtered by name afterwards (if a name filter is - // specified) - final List filteredDAList = new ArrayList<>(); - final List filteredIAList = new ArrayList<>(); - - fillFilteredArtifactsOfNodeTypeImplByName(filteredDAList, filteredIAList, csarID, - nodeTypeImplementationsOfNodeType, deploymentArtifactName, - interfaceName, operationName); - - fillFilteredArtifactsOfNodeTemplateByName(filteredDAList, filteredIAList, csarID, nodeTemplateID, - deploymentArtifactName, interfaceName, operationName); - - // BUILD TArtifacts-Object - final Artifacts result = buildTArtifactsResult(filteredDAList, filteredIAList, artifactType); - - return result; - } - - @Override - public Artifacts getRelationshipTemplateArtifacts(final CSARID csarID, final QName serviceTemplateID, - final QName relationshipTemplateID, - final ArtifactType artifactType, final String deplArtifactName, - final String interfaceName, final String operationName) { - - // retrieve qnames of all nodeTypes => and qnames of implementations of - // this nodeTypes - final QName relationshipTypeOfNodeTemplate = - toscaEngineService.getRelationshipTypeOfRelationshipTemplate(csarID, serviceTemplateID, - relationshipTemplateID.getLocalPart()); - // TODO: null check nodeTypeOfNodeTemplate - final List relationshipTypeImplementationsOfNodeType = - toscaEngineService.getTypeImplementationsOfType(csarID, relationshipTypeOfNodeTemplate); - - // for each implementation we want to get the resolvedArtifacts => for - // each imp we get the archifactSpecificContent OR the reference from - // the respecting ArchifactTemplate - // the results are filtered by name afterwards (if a name filter is - // specified) - final List filteredDAList = new ArrayList<>(); - final List filteredIAList = new ArrayList<>(); - - fillFilteredArtifactsOfRelationshipTypeImplByName(filteredDAList, filteredIAList, csarID, - relationshipTypeImplementationsOfNodeType, deplArtifactName, - interfaceName, operationName); - - // BUILD TArtifacts-Object - final Artifacts result = buildTArtifactsResult(filteredDAList, filteredIAList, artifactType); - - return result; - } - - /** - * @param filteredDAList list of the DeploymentArtifacts - * @param filteredIAList list of the ImplementationArtifacts - * @param artifactType ArtifactType which should be contained in the results - * @see ArtifactType - * @return TArtifacts object which contains the artifacts of both given lists - */ - private Artifacts buildTArtifactsResult(final List filteredDAList, - final List filteredIAList, - final ArtifactType artifactType) { - - final Artifacts result = new Artifacts(); - // handling of different requests DAs / IAs or BOTH! - if (ArtifactType.DA.equals(artifactType)) { - - final List deploymentArtifacts = new ArrayList<>(); - - for (final ResolvedDeploymentArtifact da : filteredDAList) { - // generate the resultElement - DeploymentArtifact newDA = null; - if (da.getArtifactSpecificContent() != null) { - newDA = - new DeploymentArtifact(da.getName(), da.getType().toString(), da.getArtifactSpecificContent()); - } else { - final List references = da.getReferences(); - newDA = new DeploymentArtifact(da.getName(), da.getType().toString(), references); - - } - deploymentArtifacts.add(newDA); - } - - result.setDeploymentArtifact(deploymentArtifacts); - - } - - if (ArtifactType.IA.equals(artifactType)) { - final List implArtifacts = new ArrayList<>(); - - for (final ResolvedImplementationArtifact ia : filteredIAList) { - // generate the resultElement - ImplementationArtifact newIA = null; - if (ia.getArtifactSpecificContent() != null) { - newIA = new ImplementationArtifact(ia.getOperationName(), ia.getInterfaceName(), - ia.getType().toString(), ia.getArtifactSpecificContent()); - } else { - // we need to get the references - newIA = new ImplementationArtifact(ia.getOperationName(), ia.getInterfaceName(), - ia.getType().toString(), ia.getReferences()); - } - implArtifacts.add(newIA); - } - - result.setImplementationArtifact(implArtifacts); - - } - - return result; - } - - /** - * This method fills the both supplied lists (=> MODIFIES them). Therefore it queries the - * toscaEngineService for the NodeTemplate of the CSARID and filters them by the - * artifactName - * - * @param filteredDAList list of resolvedArtifacts where the filtered DAs will be STORED!!! - * @param filteredIAList list of resolvedArtifacts where the filtered IAs will be STORED!! - * @param csarID csarID of the CSAR - * @param nodeTemplateID NodeTemplate ID - * @param deploymentArtifactNameFilter Filter which will be applied (.equals) to the resolved - * DeploymentArtifacts - * @param interfaceNameFilter Filter which will be applied (.equals) to the resolved - * ImplArtifacts - * @param operationNameFilter Filter which will be applied (.equals) to the resolved - * ImplArtifacts - */ - private void fillFilteredArtifactsOfNodeTemplateByName(final List filteredDAList, - final List filteredIAList, - final CSARID csarID, final QName nodeTemplateID, - final String deploymentArtifactName, - final String interfaceName, final String operationName) { - - final ResolvedArtifacts resolvedTemp = - toscaEngineService.getResolvedArtifactsOfNodeTemplate(csarID, nodeTemplateID); - - // filter IAs by artifactName if necessary (only add if name not - // specified or matching) - for (final ResolvedImplementationArtifact resolvedIArtifact : resolvedTemp.getImplementationArtifacts()) { - - // a filter matches if the filter itself is NULL or it equals to - // the objects value - boolean matchesInterfaceName = false; - boolean matchesOperationName = false; - - // check interfaceName - if (interfaceName == null || interfaceName.equals(resolvedIArtifact.getInterfaceName())) { - matchesInterfaceName = true; - } - - // check operationName - if (operationName == null || operationName.equals(resolvedIArtifact.getOperationName())) { - matchesOperationName = true; - } - - // if both filters could be matched => add to list - if (matchesInterfaceName && matchesOperationName) { - filteredIAList.add(resolvedIArtifact); - } - } - - // filter DAs by artifactName if necessary (only add if name not - // specified or matching) - for (final ResolvedDeploymentArtifact resolvedDArtifact : resolvedTemp.getDeploymentArtifacts()) { - if (null == deploymentArtifactName || deploymentArtifactName.equals("") - || deploymentArtifactName.equals(resolvedDArtifact.getName())) { - filteredDAList.add(resolvedDArtifact); - } - } - } - - /** - * This method fills the both supplied lists (=> MODIFIES them). Therefore it queries the - * toscaEngineService for all the nodeTypeImplementations of the given - * nodeTypeImplementations of the CSARID and filters them by the - * artifactName - * - * @param filteredDAList list of resolvedArtifacts where the filtered DAs will be STORED!!! - * @param filteredIAList list of resolvedArtifacts where the filtered IAs will be STORED!! - * @param csarID csarID of the CSAR - * @param nodeTypeImplementations List of nodeTypeImplementations for which the Artifacts will - * be resolved - * @param deploymentArtifactNameFilter Filter which will be applied (.equals) to the resolved - * DeploymentArtifacts - * @param interfaceNameFilter Filter which will be applied (.equals) to the resolved - * ImplArtifacts - * @param operationNameFilter Filter which will be applied (.equals) to the resolved - * ImplArtifacts - */ - private void fillFilteredArtifactsOfNodeTypeImplByName(final List filteredDAList, - final List filteredIAList, - final CSARID csarID, - final List nodeTypeImplementations, - final String deploymentArtifactNameFilter, - final String interfaceNameFilter, - final String operationNameFilter) { - - for (final QName ntImplQName : nodeTypeImplementations) { - // add the list of ImplementationArtifactNames of the - // NodeTypeImplementation to the iaNames-List - // if name is specified only add matching artifactNames - - final ResolvedArtifacts resolvedTemp = - toscaEngineService.getResolvedArtifactsOfNodeTypeImplementation(csarID, ntImplQName); - - // filter IAs by artifactName if necessary (only add if name not - // specified or matching) - for (final ResolvedImplementationArtifact resolvedIArtifact : resolvedTemp.getImplementationArtifacts()) { - - // a filter matches if the filter itself is NULL or it equals to - // the objects value - boolean matchesInterfaceName = false; - boolean matchesOperationName = false; - - // check interfaceName - if (interfaceNameFilter == null || interfaceNameFilter.equals(resolvedIArtifact.getInterfaceName())) { - matchesInterfaceName = true; - } - - // check operationName - if (operationNameFilter == null || operationNameFilter.equals(resolvedIArtifact.getOperationName())) { - matchesOperationName = true; - } - - // if both filters could be matched => add to list - if (matchesInterfaceName && matchesOperationName) { - filteredIAList.add(resolvedIArtifact); - } - } - - // filter DAs by artifactName if necessary (only add if name not - // specified or matching) - for (final ResolvedDeploymentArtifact resolvedDArtifact : resolvedTemp.getDeploymentArtifacts()) { - if (null == deploymentArtifactNameFilter || deploymentArtifactNameFilter.equals("") - || deploymentArtifactNameFilter.equals(resolvedDArtifact.getName())) { - filteredDAList.add(resolvedDArtifact); - } - } - - } - - } - - /** - * This method fills the both supplied lists (=> MODIFIES them). Therefore it queries the - * toscaEngineService for all the relationshipTypeImplementations of the given - * relationTypeImplementations of the CSARID and filters them by the - * artifactName - * - * @param filteredDAList list of resolvedArtifacts where the filtered DAs will be STORED!!! - * @param filteredIAList list of resolvedArtifacts where the filtered IAs will be STORED!! - * @param csarID csarID of the CSAR - * @param relationshipTypeImplementations List of relationshipTypeImplementations for which the - * Artifacts will be resolved - * @param artifactNameFilter Filter which will be applied (.equals) to the resolved Artifacts - */ - private void fillFilteredArtifactsOfRelationshipTypeImplByName(final List filteredDAList, - final List filteredIAList, - final CSARID csarID, - final List relationshipTypeImplementations, - final String deploymentArtifactNameFilter, - final String interfaceNameFilter, - final String operationNameFilter) { - for (final QName ntImplQName : relationshipTypeImplementations) { - // add the list of ImplementationArtifactNames of the - // NodeTypeImplementation to the iaNames-List - // if name is specified only add matching artifactNames - - final ResolvedArtifacts resolvedTemp = - toscaEngineService.getResolvedArtifactsOfRelationshipTypeImplementation(csarID, ntImplQName); - - // if artifactName is not specified we add all Names - otherwise we - // need to filter - - // filter IAs by artifactName if necessary (only add if name not - // specified or matching) - // filter IAs by artifactName if necessary (only add if name not - // specified or matching) - for (final ResolvedImplementationArtifact resolvedIArtifact : resolvedTemp.getImplementationArtifacts()) { - - // a filter matches if the filter itself is NULL or it equals to - // the objects value - boolean matchesInterfaceName = false; - boolean matchesOperationName = false; - - // check interfaceName - if (interfaceNameFilter == null || interfaceNameFilter.equals(resolvedIArtifact.getInterfaceName())) { - matchesInterfaceName = true; - } - - // check operationName - if (operationNameFilter == null || operationNameFilter.equals(resolvedIArtifact.getOperationName())) { - matchesOperationName = true; - } - - // if both filters could be matched => add to list - if (matchesInterfaceName && matchesOperationName) { - filteredIAList.add(resolvedIArtifact); - } - } - - // filter DAs by artifactName if necessary (only add if name not - // specified or matching) - for (final ResolvedDeploymentArtifact resolvedDArtifact : resolvedTemp.getDeploymentArtifacts()) { - if (deploymentArtifactNameFilter == null - || deploymentArtifactNameFilter.equals(resolvedDArtifact.getName())) { - filteredDAList.add(resolvedDArtifact); - } - } - - } - - } - - @Override - public QName getNodeTypeOfNodeInstance(final CSARID csarID, final QName NodeInstanceID) { - // TODO: implement: this will need to use the instanceDataEngine because - // we need to get the NodeTemplateID for a - // NodeInstanceID and only the instanceDataEngine can do that! - return null; - } - - @Override - public boolean instanceOf(final CSARID csarID, final QName nodeInstanceID, final QName nodeTypeID) { - // TODO implement - return false; - } - - public void bindToscaEngineService(final IToscaEngineService toscaEngineService) { - if (toscaEngineService == null) { - PortabilityServiceImpl.LOG.error("Can't bind ToscaEngine Service."); - } else { - PortabilityServiceImpl.toscaEngineService = toscaEngineService; - PortabilityServiceImpl.LOG.info("ToscaEngine-Service bound."); - } - } - - public void unbindToscaEngineService(final IToscaEngineService toscaEngineService) { - PortabilityServiceImpl.toscaEngineService = null; - PortabilityServiceImpl.LOG.info("ToscaEngine-Service unbound."); - - } - - @Override - public boolean isNodeTemplate(final CSARID csarID, final QName serviceTemplateID, final QName templateId) { - return toscaEngineService.doesNodeTemplateExist(csarID, serviceTemplateID, templateId.getLocalPart()); - } - -} diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/ArtifactReferences.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/model/ArtifactReferences.java deleted file mode 100644 index 4064305d5..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/ArtifactReferences.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.opentosca.container.portability.model; - -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; - -public class ArtifactReferences { - - public ArtifactReferences(final List references) { - this.allReferences = references; - } - - - @XmlElement(name = "ref") - public List allReferences; - -} diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/Artifacts.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/model/Artifacts.java deleted file mode 100644 index 4d060a2c7..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/Artifacts.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.opentosca.container.portability.model; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.XmlType; - -/** - * JAXB Class for the results of the ArtifactQuery - */ -@XmlRootElement(name = "Artifacts") -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Artifacts") -public class Artifacts { - - @XmlTransient - public static final String NAMESPACE = "http://opentosca.org/planportability/rest"; - - @XmlElement(name = "deploymentArtifact") - @XmlElementWrapper(name = "deploymentArtifacts") - private List deploymentArtifact; - - @XmlElement(name = "implementationArtifact") - @XmlElementWrapper(name = "implementationtArtifacts") - private List implementationArtifact; - - - public List getImplementationArtifact() { - return this.implementationArtifact; - } - - public void setImplementationArtifact(final List implementationArtifact) { - this.implementationArtifact = implementationArtifact; - } - - public List getDeploymentArtifact() { - return this.deploymentArtifact; - } - - public void setDeploymentArtifact(final List deploymentArtifact) { - this.deploymentArtifact = deploymentArtifact; - } - -} diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/DeploymentArtifact.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/model/DeploymentArtifact.java deleted file mode 100644 index 4622fbcc7..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/DeploymentArtifact.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.opentosca.container.portability.model; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlTransient; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class DeploymentArtifact { - - private String name; - private String type; - - private ArtifactReferences references; - - private Document artifactSpecificContent; - - - protected DeploymentArtifact() { - - } - - public DeploymentArtifact(final String name, final String type, final ArtifactReferences references) { - super(); - this.setName(name); - this.setType(type); - this.setReferences(references); - } - - public DeploymentArtifact(final String name, final String type, final List references) { - super(); - this.setName(name); - this.setType(type); - this.setReferences(new ArtifactReferences(references)); - } - - public DeploymentArtifact(final String name, final String type, final Document artifactSpecificContent) { - super(); - this.setName(name); - this.setType(type); - this.setArtifactSpecificContent(artifactSpecificContent); - } - - public DeploymentArtifact(final String name, final String type) { - super(); - this.setName(name); - this.setType(type); - } - - @XmlTransient - public Document getArtifactSpecificContent() { - return this.artifactSpecificContent; - } - - public void setArtifactSpecificContent(final Document artifactSpecificContent) { - this.artifactSpecificContent = artifactSpecificContent; - } - - @XmlAnyElement(lax = false) - private Element getJaxbArtifactSpecificContent() { - if (this.artifactSpecificContent == null) { - return null; - } - return this.artifactSpecificContent.getDocumentElement(); - } - - @XmlAttribute - public String getName() { - return this.name; - } - - public void setName(final String name) { - this.name = name; - } - - @XmlAttribute - public String getType() { - return this.type; - } - - public void setType(final String type) { - this.type = type; - } - - @XmlElement(name = "references", type = ArtifactReferences.class) - public ArtifactReferences getReferences() { - return this.references; - } - - public void setReferences(final ArtifactReferences references) { - this.references = references; - } - -} diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/ImplementationArtifact.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/model/ImplementationArtifact.java deleted file mode 100644 index 1630dd23e..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/ImplementationArtifact.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.opentosca.container.portability.model; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlTransient; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class ImplementationArtifact { - - private String operationName; - - private String interfaceName; - - private String type; - - private ArtifactReferences references; - - private Document artifactSpecificContent; - - - public ImplementationArtifact(final String operationName, final String interfaceName, final String type, - final ArtifactReferences references) { - super(); - this.setOperationName(operationName); - this.setInterfaceName(interfaceName); - this.setType(type); - this.setReferences(references); - } - - public ImplementationArtifact(final String operationName, final String interfaceName, final String type, - final List references) { - super(); - this.setOperationName(operationName); - this.setInterfaceName(interfaceName); - this.setType(type); - this.setReferences(new ArtifactReferences(references)); - } - - public ImplementationArtifact(final String operationName, final String interfaceName, final String type, - final Document artifactSpecificContent) { - super(); - this.setOperationName(operationName); - this.setInterfaceName(interfaceName); - this.setType(type); - this.artifactSpecificContent = artifactSpecificContent; - } - - public ImplementationArtifact(final String operationName, final String type) { - super(); - this.setOperationName(operationName); - this.setType(type); - } - - @XmlTransient - public Document getArtifactSpecificContent() { - return this.artifactSpecificContent; - } - - public void setArtifactSpecificContent(final Document artifactSpecificContent) { - this.artifactSpecificContent = artifactSpecificContent; - } - - @XmlAnyElement(lax = false) - private Element getJaxbArtifactSpecificContent() { - if (this.artifactSpecificContent == null) { - return null; - } - return this.artifactSpecificContent.getDocumentElement(); - } - - @XmlAttribute - public String getType() { - return this.type; - } - - public void setType(final String type) { - this.type = type; - } - - @XmlAttribute - public String getOperationName() { - return this.operationName; - } - - public void setOperationName(final String operationName) { - this.operationName = operationName; - } - - @XmlAttribute - public String getInterfaceName() { - return this.interfaceName; - } - - public void setInterfaceName(final String interfaceName) { - this.interfaceName = interfaceName; - } - - @XmlElement(name = "references", type = ArtifactReferences.class) - public ArtifactReferences getReferences() { - return this.references; - } - - public void setReferences(final ArtifactReferences references) { - this.references = references; - } - -} diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/util/ArtifactSchemaOutputResolver.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/model/util/ArtifactSchemaOutputResolver.java deleted file mode 100644 index 1dcd044e9..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/util/ArtifactSchemaOutputResolver.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.opentosca.container.portability.model.util; - -import java.io.File; -import java.io.IOException; - -import javax.xml.bind.SchemaOutputResolver; -import javax.xml.transform.Result; -import javax.xml.transform.stream.StreamResult; - -public class ArtifactSchemaOutputResolver extends SchemaOutputResolver { - - @Override - public Result createOutput(final String namespaceUri, final String suggestedFileName) throws IOException { - final File file = new File(suggestedFileName); - final StreamResult result = new StreamResult(file); - result.setSystemId(file.toURI().toURL().toString()); - return result; - } - -} diff --git a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/util/JaxbGenerator.java b/org.opentosca.container.portability/src/org/opentosca/container/portability/model/util/JaxbGenerator.java deleted file mode 100644 index 7b9280d9c..000000000 --- a/org.opentosca.container.portability/src/org/opentosca/container/portability/model/util/JaxbGenerator.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.opentosca.container.portability.model.util; - -import java.io.IOException; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.SchemaOutputResolver; - -/** - * This class can be used to generate a Schema representing the returnType TArtifacts - */ -public class JaxbGenerator { - - /** - * @param args - */ - public static void main(final String[] args) { - final Class[] classes = new Class[4]; - classes[0] = org.opentosca.container.portability.model.Artifacts.class; - classes[1] = org.opentosca.container.portability.model.DeploymentArtifact.class; - classes[2] = org.opentosca.container.portability.model.ImplementationArtifact.class; - classes[3] = org.opentosca.container.portability.model.ArtifactReferences.class; - - try { - final JAXBContext jaxbContext = JAXBContext.newInstance(classes); - final SchemaOutputResolver sor = new ArtifactSchemaOutputResolver(); - jaxbContext.generateSchema(sor); - } - catch (final JAXBException e) { - e.printStackTrace(); - } - catch (final IOException e) { - e.printStackTrace(); - } - } - -} diff --git a/org.opentosca.container.product/config.ini b/org.opentosca.container.product/config.ini deleted file mode 100644 index 8557784b9..000000000 --- a/org.opentosca.container.product/config.ini +++ /dev/null @@ -1,42 +0,0 @@ -# Container Configuration -# Your external IP address, e.g. 129.69.214.56 -org.opentosca.container.hostname=localhost -org.opentosca.container.port=1337 - -# IA Engine Configuration (endpoint and credentials) -org.opentosca.container.engine.ia.hostname=localhost -org.opentosca.container.engine.ia.port=8090 -org.opentosca.container.engine.ia.plugin.tomcat.url=http://localhost:8090 -org.opentosca.container.engine.ia.plugin.tomcat.username=admin -org.opentosca.container.engine.ia.plugin.tomcat.password=admin - -# BPEL Plan Engine Configuration (endpoint and credentials) -org.opentosca.container.engine.plan.plugin.bpel.engine=ODE -org.opentosca.container.engine.plan.plugin.bpel.url=http://localhost:9763/ode -org.opentosca.container.engine.plan.plugin.bpel.username=admin -org.opentosca.container.engine.plan.plugin.bpel.password=admin -org.opentosca.container.engine.plan.plugin.bpel.services.url=http://localhost:9763/ode/processes - -# BPMN Plan Engine Configuration (endpoint and credentials) -org.opentosca.container.engine.plan.plugin.bpmn.engine=Camunda -org.opentosca.container.engine.plan.plugin.bpmn.url=http://localhost:8092/engine-rest -org.opentosca.container.engine.plan.plugin.bpmn.username=admin -org.opentosca.container.engine.plan.plugin.bpmn.password=admin - -# Container Model Repository (Winery) -org.opentosca.container.connector.winery.url=http://localhost:8081/winery - -# Local MQTT broker -org.opentosca.container.broker.mqtt.port=1883 -org.opentosca.container.broker.mqtt.username=admin -org.opentosca.container.broker.mqtt.password=admin - -# Distributed IA deployment -org.opentosca.container.collaboration.mode=false -org.opentosca.container.collaboration.hostnames= -org.opentosca.container.collaboration.ports= - -# Testing -org.opentosca.deployment.tests=false -org.opentosca.bus.management.mocking=false -org.opentosca.engine.ia.keepfiles=true diff --git a/org.opentosca.container.product/org.opentosca.container.launch b/org.opentosca.container.product/org.opentosca.container.launch deleted file mode 100644 index e012eae29..000000000 --- a/org.opentosca.container.product/org.opentosca.container.launch +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.opentosca.container.product/org.opentosca.container.product b/org.opentosca.container.product/org.opentosca.container.product deleted file mode 100644 index c08402b11..000000000 --- a/org.opentosca.container.product/org.opentosca.container.product +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - /org.opentosca.container.product/config.ini - - - - -consoleLog -console --launcher.secondThread - - -Declipse.ignoreApp=true --Dosgi.noShutdown=true --Dorg.osgi.service.http.port=1337 --DREFRESH_BUNDLES=false - - -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts - - - - - - - - - - - - - org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 - org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 - org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 - org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.opentosca.container.product/pom.xml b/org.opentosca.container.product/pom.xml deleted file mode 100644 index f2180a9f1..000000000 --- a/org.opentosca.container.product/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.container.product - eclipse-repository - - - - - org.eclipse.tycho - tycho-p2-director-plugin - ${tycho-version} - - - create-product-distributions - - materialize-products - archive-products - - - - - - - - diff --git a/org.opentosca.container.war/pom.xml b/org.opentosca.container.war/pom.xml new file mode 100644 index 000000000..99eb8aaed --- /dev/null +++ b/org.opentosca.container.war/pom.xml @@ -0,0 +1,410 @@ + + + 4.0.0 + + + org.opentosca + container + 2.0.0-SNAPSHOT + + + org.opentosca.container.war + war + + + 7.0.93 + + + + + + maven-war-plugin + + false + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.2 + + 1337 + / + + + + + org.apache.tomcat.embed + tomcat-embed-core + ${tomcat.version} + + + org.apache.tomcat + tomcat-util + ${tomcat.version} + + + org.apache.tomcat + tomcat-coyote + ${tomcat.version} + + + org.apache.tomcat + tomcat-api + ${tomcat.version} + + + org.apache.tomcat + tomcat-jdbc + ${tomcat.version} + + + org.apache.tomcat + tomcat-dbcp + ${tomcat.version} + + + org.apache.tomcat + tomcat-servlet-api + ${tomcat.version} + + + org.apache.tomcat + tomcat-jsp-api + ${tomcat.version} + + + org.apache.tomcat + tomcat-jasper + ${tomcat.version} + + + org.apache.tomcat + tomcat-jasper-el + ${tomcat.version} + + + org.apache.tomcat + tomcat-el-api + ${tomcat.version} + + + org.apache.tomcat + tomcat-catalina + ${tomcat.version} + + + org.apache.tomcat + tomcat-tribes + ${tomcat.version} + + + org.apache.tomcat + tomcat-catalina-ha + ${tomcat.version} + + + org.apache.tomcat + tomcat-annotations-api + ${tomcat.version} + + + org.apache.tomcat + tomcat-juli + ${tomcat.version} + + + org.apache.tomcat.embed + tomcat-embed-logging-juli + ${tomcat.version} + + + org.apache.tomcat.embed + tomcat-embed-logging-log4j + ${tomcat.version} + + + + + OpenTOSCA-container + + + + + org.opentosca + org.opentosca.container.api + ${project.version} + + + + org.opentosca + org.opentosca.bus.application.service + ${project.version} + + + + org.opentosca + org.opentosca.bus.application.api.jsonhttp + ${project.version} + + + org.opentosca + org.opentosca.bus.application.api.resthttp + ${project.version} + + + org.opentosca + org.opentosca.bus.application.api.soaphttp + ${project.version} + + + + org.opentosca + org.opentosca.bus.application.plugin.jsonhttp.service.impl + ${project.version} + + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + + org.opentosca + org.opentosca.bus.management.api.java + ${project.version} + + + org.opentosca + org.opentosca.bus.management.api.resthttp + ${project.version} + + + org.opentosca + org.opentosca.bus.management.api.soaphttp + ${project.version} + + + + org.opentosca + org.opentosca.bus.management.deployment.plugin.remote + ${project.version} + + + org.opentosca + org.opentosca.bus.management.deployment.plugin.script + ${project.version} + + + org.opentosca + org.opentosca.bus.management.deployment.plugin.tomcat + ${project.version} + + + + org.opentosca + org.opentosca.bus.management.invocation.plugin.remote + ${project.version} + + + org.opentosca + org.opentosca.bus.management.invocation.plugin.rest + ${project.version} + + + org.opentosca + org.opentosca.bus.management.invocation.plugin.script + ${project.version} + + + org.opentosca + org.opentosca.bus.management.invocation.plugin.soaphttp + ${project.version} + + + + org.opentosca + org.opentosca.container.engine.plan.plugin.camunda + ${project.version} + + + org.opentosca + org.opentosca.container.engine.plan.plugin.bpel + ${project.version} + + + + org.opentosca + org.opentosca.planbuilder.postphase.plugin.instancedata + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.postphase.plugin.monitoring + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.postphase.plugin.vinothek + ${project.version} + + + + org.opentosca + org.opentosca.planbuilder.postphase.plugin.situations + ${project.version} + + + + + org.opentosca + org.opentosca.planbuilder.prephase.plugin.fileupload + ${project.version} + + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.ansibleoperation + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + + + + org.opentosca + org.opentosca.planbuilder.selection.plugin.firstavailable + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.selection.plugin.input + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.selection.plugin.mosquitto.workload + ${project.version} + + + + org.opentosca + org.opentosca.planbuilder.type.plugin.connectsto + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.type.plugin.dockercontainer + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.type.plugin.hardware + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.type.plugin.mosquittoconnectsto + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.type.plugin.patternbased + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.type.plugin.platforms + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.type.plugin.ubuntuvm + ${project.version} + + + + org.opentosca + org.opentosca.broker.mqtt + ${project.version} + + + + + org.logback-extensions + logback-ext-spring + 0.1.5 + + + + + org.hibernate + hibernate-core + 5.4.1.Final + + + com.h2database + h2 + 1.4.199 + + + + org.glassfish.jersey.core + jersey-server + ${jersey.version} + + + org.glassfish.jersey.core + jersey-common + ${jersey.version} + + + org.glassfish.jersey.containers + jersey-container-servlet-core + ${jersey.version} + + + org.glassfish.jersey.ext + jersey-spring4 + ${jersey.version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey.version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey.version} + + + org.glassfish.jersey.media + jersey-media-jaxb + ${jersey.version} + + + + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + io.swagger.core.v3 + swagger-jaxrs2 + 2.1.2 + + + + diff --git a/org.opentosca.container.war/src/main/java/org/opentosca/container/war/Config.java b/org.opentosca.container.war/src/main/java/org/opentosca/container/war/Config.java new file mode 100644 index 000000000..1295e4d25 --- /dev/null +++ b/org.opentosca.container.war/src/main/java/org/opentosca/container/war/Config.java @@ -0,0 +1,34 @@ +package org.opentosca.container.war; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; + +import org.opentosca.broker.mqtt.BrokerSupport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.context.support.WebApplicationContextUtils; + +@WebListener +public class Config implements ServletContextListener { + + private static final Logger LOGGER = LoggerFactory.getLogger(Config.class); + + @Override + public void contextInitialized(ServletContextEvent event) { + LOGGER.info("STARTING APPLICATION CONTEXT CONFIGURATION FOR OPENTOSCA CONTAINER API"); + BrokerSupport mqttBroker = WebApplicationContextUtils + .getRequiredWebApplicationContext(event.getServletContext()) + .getBean(BrokerSupport.class); + mqttBroker.start(); + } + + @Override + public void contextDestroyed(ServletContextEvent event) { + LOGGER.info("SHUTTING DOWN APPLICATION CONTEXT"); + BrokerSupport mqttBroker = WebApplicationContextUtils + .getRequiredWebApplicationContext(event.getServletContext()) + .getBean(BrokerSupport.class); + mqttBroker.stop(); + } +} diff --git a/org.opentosca.container.war/src/main/java/org/opentosca/container/war/SpringJaxRSConfiguration.java b/org.opentosca.container.war/src/main/java/org/opentosca/container/war/SpringJaxRSConfiguration.java new file mode 100644 index 000000000..5c5c7befc --- /dev/null +++ b/org.opentosca.container.war/src/main/java/org/opentosca/container/war/SpringJaxRSConfiguration.java @@ -0,0 +1,40 @@ +package org.opentosca.container.war; + +import javax.ws.rs.ApplicationPath; + +import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource; +import org.glassfish.jersey.media.multipart.MultiPartFeature; +import org.glassfish.jersey.server.ResourceConfig; +import org.slf4j.LoggerFactory; + +@ApplicationPath("/") +public class SpringJaxRSConfiguration extends ResourceConfig { + + public SpringJaxRSConfiguration() { + registerControllers(); + registerFilters(); + configureSwagger(); + logReadyMessage(); + } + + private void registerControllers() { + packages("org.opentosca.container.api.controller"); + } + + private void registerFilters() { + packages("org.opentosca.container.api.config"); + register(MultiPartFeature.class); + } + + private void configureSwagger() { + register(OpenApiResource.class); + } + + private void logReadyMessage() { + final String readyMessage = "\n" + + "======================================================================================================\n" + + " OpenTOSCA CONTAINER is ready to use!\n" + + "======================================================================================================"; + LoggerFactory.getLogger("org.opentosca.container.api.ContainerApplication").info(readyMessage); + } +} diff --git a/org.opentosca.container.war/src/main/resources/META-INF/cxf/org.apache.cxf.logger b/org.opentosca.container.war/src/main/resources/META-INF/cxf/org.apache.cxf.logger new file mode 100644 index 000000000..6e7bd364d --- /dev/null +++ b/org.opentosca.container.war/src/main/resources/META-INF/cxf/org.apache.cxf.logger @@ -0,0 +1 @@ +org.apache.cxf.common.logging.Slf4jLogger diff --git a/org.opentosca.container.war/src/main/resources/logback.xml b/org.opentosca.container.war/src/main/resources/logback.xml new file mode 100644 index 000000000..78d464abb --- /dev/null +++ b/org.opentosca.container.war/src/main/resources/logback.xml @@ -0,0 +1,33 @@ + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%t] %-40.40logger{39} : %m%n + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.opentosca.container.war/src/main/resources/spring/root-context.xml b/org.opentosca.container.war/src/main/resources/spring/root-context.xml new file mode 100644 index 000000000..b9304b6f5 --- /dev/null +++ b/org.opentosca.container.war/src/main/resources/spring/root-context.xml @@ -0,0 +1,41 @@ + + + + Configuration for Spring-Bean service discovery and injection + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.opentosca.container.war/src/main/resources/spring/web-context.xml b/org.opentosca.container.war/src/main/resources/spring/web-context.xml new file mode 100644 index 000000000..f4d6fbb21 --- /dev/null +++ b/org.opentosca.container.war/src/main/resources/spring/web-context.xml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/org.opentosca.container.war/src/main/webapp/WEB-INF/web.xml b/org.opentosca.container.war/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..eb281ae6e --- /dev/null +++ b/org.opentosca.container.war/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,66 @@ + + + OpenTOSCA Container API + The OpenTOSCA ecosystem's tosca-container API application for REST-based csar deployment + + + Logback configuration definition + logbackConfigLocation + classpath:logback.xml + + + Application "Root Context" of Spring DI logic + contextConfigLocation + classpath:/spring/root-context.xml + + + + Encoding-Clamping filter + encoding-filter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + + encoding-filter + /* + + + + + Logging configuration listener + ch.qos.logback.ext.spring.web.LogbackConfigListener + + + + + Spring Controller injection listener + org.springframework.web.context.ContextLoaderListener + + + + + + Context startup listener for opentosca container configuration purposes + org.opentosca.container.war.Config + + + + jersey-servlet + org.glassfish.jersey.servlet.ServletContainer + + javax.ws.rs.Application + org.opentosca.container.war.SpringJaxRSConfiguration + + 1 + + + jersey-servlet + /* + + + diff --git a/org.opentosca.deployment.checks/META-INF/MANIFEST.MF b/org.opentosca.deployment.checks/META-INF/MANIFEST.MF deleted file mode 100644 index 069fdcf96..000000000 --- a/org.opentosca.deployment.checks/META-INF/MANIFEST.MF +++ /dev/null @@ -1,32 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Deployment Checks -Bundle-SymbolicName: org.opentosca.deployment.checks -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: com.google.common.base;version="15.0.0", - com.google.common.collect;version="15.0.0", - com.google.common.primitives;version="15.0.0", - com.google.common.util.concurrent;version="15.0.0", - com.google.gson;version="2.2.4", - com.google.gson.reflect;version="2.2.4", - javax.ws.rs;version="1.1.1", - org.apache.camel;version="2.18.3", - org.apache.camel.builder;version="2.18.3", - org.apache.camel.core.osgi;version="2.18.3", - org.apache.camel.impl;version="2.18.3", - org.apache.camel.model;version="2.18.3", - org.apache.camel.support;version="2.18.3", - org.apache.commons.io;version="2.2.0", - org.opentosca.planbuilder.importer, - org.osgi.framework;version="1.8.0", - org.slf4j;version="1.7.2" -Bundle-ActivationPolicy: lazy -Require-Bundle: org.opentosca.planbuilder;bundle-version="2.0.0", - org.opentosca.planbuilder.model, - org.opentosca.container.core, - org.opentosca.container.core.tosca;bundle-version="2.0.0", - org.opentosca.bus.management -Service-Component: OSGI-INF/* -Export-Package: org.opentosca.deployment.tests -Bundle-Activator: org.opentosca.deployment.tests.Activator diff --git a/org.opentosca.deployment.checks/OSGI-INF/DeploymentTestService.xml b/org.opentosca.deployment.checks/OSGI-INF/DeploymentTestService.xml deleted file mode 100644 index f708ff3cf..000000000 --- a/org.opentosca.deployment.checks/OSGI-INF/DeploymentTestService.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.deployment.checks/OSGI-INF/TestExecutor.xml b/org.opentosca.deployment.checks/OSGI-INF/TestExecutor.xml deleted file mode 100644 index 96b94ffb5..000000000 --- a/org.opentosca.deployment.checks/OSGI-INF/TestExecutor.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.opentosca.deployment.checks/build.properties b/org.opentosca.deployment.checks/build.properties deleted file mode 100644 index d6642e652..000000000 --- a/org.opentosca.deployment.checks/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.deployment.checks/pom.xml b/org.opentosca.deployment.checks/pom.xml index e23f6bc77..c69b8f800 100644 --- a/org.opentosca.deployment.checks/pom.xml +++ b/org.opentosca.deployment.checks/pom.xml @@ -1,6 +1,6 @@ - + 4.0.0 - org.opentosca container @@ -8,6 +8,52 @@ org.opentosca.deployment.checks - eclipse-plugin - \ No newline at end of file + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.integration + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.bus.management + ${project.version} + + + org.opentosca + org.opentosca.bus.management.service + ${project.version} + + + + com.google.guava + guava + + + org.apache.camel + camel-core + ${camel.version} + + + com.google.code.gson + gson + 2.8.0 + + + org.apache.camel + camel-stream + ${camel.version} + + + diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/DeploymentTestService.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/DeploymentTestService.java new file mode 100644 index 000000000..13b69cc26 --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/DeploymentTestService.java @@ -0,0 +1,123 @@ +package org.opentosca.deployment.checks; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +import javax.inject.Inject; + +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.model.csar.CsarId; +import org.opentosca.container.core.next.model.DeploymentTest; +import org.opentosca.container.core.next.model.DeploymentTestState; +import org.opentosca.container.core.next.model.PlanInstance; +import org.opentosca.container.core.next.model.PlanInstanceState; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; +import org.opentosca.container.core.next.repository.DeploymentTestRepository; +import org.opentosca.container.core.next.repository.PlanInstanceRepository; +import org.opentosca.container.core.service.CsarStorageService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DeploymentTestService { + + private static final Logger logger = LoggerFactory.getLogger(DeploymentTestService.class); + + private final DeploymentTestRepository repository = new DeploymentTestRepository(); + private final CsarStorageService csarStorage; + + private final ExecutorService pool = Executors.newFixedThreadPool(5); + + private final TestExecutor executor; + + @Inject + public DeploymentTestService(TestExecutor executor, CsarStorageService csarStorage) { + logger.debug("Instantiating DeploymentTestService"); + this.executor = executor; + this.csarStorage = csarStorage; + } + + /** + * Runs a deployment test if a plan with the given correlation id is in state FINISHED. + * + * @param csarId The corresponding CSAR + * @param correlationId The correlation ID of a plan + */ + public void runAfterPlan(final CsarId csarId, final String correlationId) { + logger.info("Trigger deployment test after plan has been finished; correlation_id={}, csar={}", correlationId, + csarId); + this.pool.submit(() -> { + final long sleep = 1000; + final long timeout = TimeUnit.MINUTES.toMillis(45); + long waited = 0; + while (true) { + PlanInstance pi = null; + boolean finished = false; + try { + pi = new PlanInstanceRepository().findByCorrelationId(correlationId); + finished = pi.getState().equals(PlanInstanceState.FINISHED); + } catch (final Exception e) { + finished = false; + } + if (finished) { + run(csarId, pi.getServiceTemplateInstance()); + break; + } + if (waited >= timeout) { + logger.warn("Timeout reached, deployment test has not been executed"); + break; + } + try { + Thread.sleep(sleep); + } catch (final InterruptedException e) { + } + waited += sleep; + } + }); + } + + /** + * Runs a deployment test for a certain service template instance. + * + * @param csarId The corresponding CSAR + * @param serviceTemplateInstance The service template instance + * @return The created Verification object + */ + public DeploymentTest run(final CsarId csarId, final ServiceTemplateInstance serviceTemplateInstance) { + + logger.info("Trigger deployment test for service template instance \"{}\" of CSAR \"{}\"", + serviceTemplateInstance.getId(), csarId); + + // Prepare + final DeploymentTest result = new DeploymentTest(); + result.setServiceTemplateInstance(serviceTemplateInstance); + result.setState(DeploymentTestState.STARTED); + this.repository.add(result); + + // Execute + this.pool.submit(() -> { + logger.info("Executing deployment test..."); + // Prepare the context + final Csar csar = csarStorage.findById(csarId); + final TServiceTemplate entryServiceTemplate = csar.entryServiceTemplate(); + final TestContext context = new TestContext(csar, entryServiceTemplate, serviceTemplateInstance, result); + final CompletableFuture future = this.executor.verify(context); + logger.info("Wait until jobs has been finished..."); + try { + future.join(); + logger.info("Jobs has been finished"); + result.setState(DeploymentTestState.FINISHED); + } catch (final Exception e) { + logger.error("Jobs completed with exception: {}", e.getMessage(), e); + result.setState(DeploymentTestState.FAILED); + } + this.repository.update(result); + }); + logger.info("Deployment test is running in background..."); + + return result; + } +} diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestContext.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestContext.java new file mode 100644 index 000000000..1fe177c9d --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestContext.java @@ -0,0 +1,84 @@ +package org.opentosca.deployment.checks; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TServiceTemplate; + +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.DeploymentTest; +import org.opentosca.container.core.next.model.DeploymentTestResult; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.ServiceTemplateInstance; + +public class TestContext { + + private final Csar csar; + private final TServiceTemplate serviceTemplate; + private final ServiceTemplateInstance serviceTemplateInstance; + private final DeploymentTest deploymentTest; + + public TestContext(Csar csar, TServiceTemplate serviceTemplate, ServiceTemplateInstance serviceTemplateInstance, DeploymentTest deploymentTest) { + this.csar = csar; + this.serviceTemplate = serviceTemplate; + this.serviceTemplateInstance = serviceTemplateInstance; + this.deploymentTest = deploymentTest; + } + + public TServiceTemplate getServiceTemplate() { + return this.serviceTemplate; + } + + public ServiceTemplateInstance getServiceTemplateInstance() { + if (this.serviceTemplate != null) { + return this.serviceTemplateInstance; + } else { + throw new IllegalStateException(); + } + } + + public DeploymentTest getDeploymentTest() { + return this.deploymentTest; + } + + public synchronized void setDeploymentTestResults(final List deploymentTestResults) { + if (this.deploymentTest == null) { + throw new IllegalStateException(); + } + deploymentTestResults.stream().forEach(this.deploymentTest::addDeploymentTestResult); + if (this.serviceTemplateInstance != null) { + this.deploymentTest.setServiceTemplateInstance(this.serviceTemplateInstance); + } + } + + public synchronized Collection getNodeTemplates() { + if (this.serviceTemplate == null) { + throw new IllegalStateException(); + } + return this.serviceTemplate.getTopologyTemplate().getNodeTemplates(); + } + + public synchronized Collection getNodeTemplateInstances() { + if (this.serviceTemplateInstance == null) { + throw new IllegalStateException(); + } + return this.serviceTemplateInstance.getNodeTemplateInstances(); + } + + public synchronized TNodeTemplate getNodeTemplate(final NodeTemplateInstance nodeTemplateInstance) { + return getNodeTemplates().stream() + .filter(o -> o.getType().equals(nodeTemplateInstance.getTemplateType())) + .findFirst().orElseThrow(IllegalStateException::new); + } + + public synchronized NodeTemplateInstance getNodeTemplateInstance(final TNodeTemplate nodeTemplate) { + return getNodeTemplateInstances().stream() + .filter(o -> o.getTemplateId().equals(nodeTemplate.getId())) + .findFirst().orElseThrow(IllegalStateException::new); + } + + public Csar getCsar() { + return csar; + } +} diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestExecutor.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestExecutor.java new file mode 100644 index 000000000..448958b4d --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestExecutor.java @@ -0,0 +1,136 @@ +package org.opentosca.deployment.checks; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import javax.inject.Inject; + +import org.eclipse.winery.common.ids.definitions.PolicyTemplateId; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TPolicyTemplate; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import org.apache.camel.CamelContext; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.DeploymentTestResult; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.deployment.checks.test.HttpTest; +import org.opentosca.deployment.checks.test.ManagementOperationTest; +import org.opentosca.deployment.checks.test.TcpPingTest; +import org.opentosca.deployment.checks.test.TestExecutionPlugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestExecutor { + + private static Logger logger = LoggerFactory.getLogger(TestExecutor.class); + + private final List plugins; + + private final ExecutorService jobExecutor; + private final ExecutorService testExecutor; + + @Inject + @Deprecated + public TestExecutor(CamelContext camelContext) { + this(Lists.newArrayList(new HttpTest(), new ManagementOperationTest(camelContext), new TcpPingTest() + // new PortBindingTest(), + // new SqlConnectionTest() + )); + } + + // @Inject + public TestExecutor(List plugins) { + this.plugins = plugins; + ThreadFactory threadFactory; + threadFactory = new ThreadFactoryBuilder().setNameFormat("job-pool-%d").setDaemon(true).build(); + this.jobExecutor = Executors.newFixedThreadPool(20, threadFactory); + threadFactory = new ThreadFactoryBuilder().setNameFormat("test-pool-%d").setDaemon(true).build(); + this.testExecutor = Executors.newFixedThreadPool(5, threadFactory); + } + + public CompletableFuture verify(final TestContext context) { + + Preconditions.checkNotNull(context.getServiceTemplate()); + Preconditions.checkNotNull(context.getServiceTemplateInstance()); + + return CompletableFuture.supplyAsync(() -> { + + final List> futures = Lists.newArrayList(); + + // Submit a job if an annotations is attached to a node template that can be + // handled by a registered plugin + for (final NodeTemplateInstance nodeTemplateInstance : context.getNodeTemplateInstances()) { + for (final TestExecutionPlugin plugin : this.plugins) { + final TNodeTemplate nodeTemplate = context.getNodeTemplate(nodeTemplateInstance); + final Csar csar = context.getCsar(); + final List policyTemplates = Optional.ofNullable(nodeTemplate.getPolicies()) + .map(ps -> ps.getPolicy()) + .orElse(Collections.emptyList()).stream() + .filter(Objects::nonNull) + .map(p -> (TPolicyTemplate) csar.queryRepository(new PolicyTemplateId(p.getPolicyRef()))) + .collect(Collectors.toList()); + for (final TPolicyTemplate policyTemplate : policyTemplates) { + if (plugin.canExecute(nodeTemplate, policyTemplate)) { + logger.info("Schedule job \"{}\" for node template \"{}\" (instance={}) because annotation \"{}\" is attached...", + plugin.getClass().getSimpleName(), nodeTemplate.getId(), + nodeTemplateInstance.getId(), policyTemplate.getType()); + futures.add(submit(plugin, context, nodeTemplate, nodeTemplateInstance, policyTemplate)); + } + } + } + } + + // Wait until all jobs have been completed + final List results = + futures.stream().map(CompletableFuture::join).collect(Collectors.toList()); + + context.setDeploymentTestResults(results); + logger.info("Job statistics: {}", context.getDeploymentTest().getStatistics()); + + return null; + }, this.testExecutor); + } + + public void shutdown() { + try { + logger.info("Attempt to shutdown executors..."); + this.jobExecutor.shutdown(); + this.jobExecutor.awaitTermination(5, TimeUnit.SECONDS); + this.testExecutor.shutdown(); + this.testExecutor.awaitTermination(5, TimeUnit.SECONDS); + } catch (final InterruptedException e) { + logger.warn("Jobs interrupted"); + } finally { + if (!this.jobExecutor.isTerminated() || !this.testExecutor.isTerminated()) { + logger.warn("Cancel non-finished jobs..."); + } + this.jobExecutor.shutdownNow(); + this.testExecutor.shutdownNow(); + logger.info("Shutdown finished"); + } + } + + private CompletableFuture submit(final TestExecutionPlugin plugin, final TestContext context, + final TNodeTemplate nodeTemplate, + final NodeTemplateInstance nodeTemplateInstance, + final TPolicyTemplate policyTemplate) { + final long start = System.currentTimeMillis(); + return CompletableFuture.supplyAsync(() -> { + final long d = System.currentTimeMillis() - start; + logger.info("Job \"{}\" for node template \"{}\" (instance={}) spent {}ms in queue", + plugin.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), d); + return plugin.execute(context, nodeTemplate, nodeTemplateInstance, policyTemplate); + }, this.jobExecutor); + } +} diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestUtil.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestUtil.java new file mode 100644 index 000000000..6cce97ab0 --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/TestUtil.java @@ -0,0 +1,69 @@ +package org.opentosca.deployment.checks; + +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.eclipse.winery.model.tosca.TNodeTemplate; + +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.model.RelationshipTemplateInstance; +import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.container.core.tosca.convention.Utils; +import org.opentosca.planbuilder.model.utils.ModelUtils; + +/** + * Utility class + */ +public abstract class TestUtil { + + public static synchronized void resolveInfrastructureNodes(final NodeTemplateInstance nodeTemplateInstance, + final TestContext context, + final Set nodes) { + + final List outgoingRelations = + nodeTemplateInstance.getOutgoingRelations().stream() + .filter(r -> r.getTemplateType().equals(Types.dependsOnRelationType) + || r.getTemplateType().equals(Types.deployedOnRelationType) + || r.getTemplateType().equals(Types.hostedOnRelationType)) + .collect(Collectors.toList()); + + for (final RelationshipTemplateInstance r : outgoingRelations) { + + final NodeTemplateInstance target = r.getTarget(); + final TNodeTemplate targetTemplate = context.getNodeTemplate(target); + + if (Utils.isSupportedInfrastructureNodeType(ModelUtils.getNodeBaseType(context.getCsar(), targetTemplate).getQName()) + || Utils.isSupportedCloudProviderNodeType(ModelUtils.getNodeBaseType(context.getCsar(), targetTemplate).getQName())) { + nodes.add(target); + } + + resolveInfrastructureNodes(target, context, nodes); + } + } + + public static synchronized void resolveChildNodes(final NodeTemplateInstance nodeTemplateInstance, + final TestContext context, + final Set nodes) { + // Only follow deployedOn and hostedOn relations + final List outgoingRelations = + nodeTemplateInstance.getOutgoingRelations().stream() + .filter(r -> r.getTemplateType().equals(Types.deployedOnRelationType) + || r.getTemplateType().equals(Types.hostedOnRelationType)) + .collect(Collectors.toList()); + for (final RelationshipTemplateInstance r : outgoingRelations) { + final NodeTemplateInstance target = r.getTarget(); + nodes.add(target); + resolveChildNodes(target, context, nodes); + } + } + + public static synchronized Map map(final Set nodes, + final Function> mapper) { + return nodes.stream().map(mapper).filter(Objects::nonNull).collect(Hashtable::new, Map::putAll, Map::putAll); + } +} diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/camel/RouteConfiguration.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/camel/RouteConfiguration.java new file mode 100644 index 000000000..fef706416 --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/camel/RouteConfiguration.java @@ -0,0 +1,22 @@ +package org.opentosca.deployment.checks.camel; + +import javax.inject.Inject; + +import org.apache.camel.builder.RouteBuilder; +import org.opentosca.bus.management.service.IManagementBusService; + +public class RouteConfiguration extends RouteBuilder { + + private IManagementBusService managementBusService; + + @Inject + public RouteConfiguration(IManagementBusService managementBusService) { + this.managementBusService = managementBusService; + } + + @Override + public void configure() throws Exception { + this.from("direct:invokeIA").to("stream:out").bean(managementBusService, "invokeIA").end(); + this.from("direct-vm:" + "org.opentosca.deployment.checks").recipientList(this.simple("direct:response-${id}")).end(); + } +} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/HttpTest.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/HttpTest.java similarity index 86% rename from org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/HttpTest.java rename to org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/HttpTest.java index 3da82d30f..e3169d215 100644 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/HttpTest.java +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/HttpTest.java @@ -1,4 +1,4 @@ -package org.opentosca.deployment.tests.test; +package org.opentosca.deployment.checks.test; import java.net.HttpURLConnection; import java.net.URL; @@ -17,19 +17,19 @@ import javax.net.ssl.X509TrustManager; import javax.xml.namespace.QName; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TPolicyTemplate; + +import com.google.common.base.Strings; +import com.google.common.collect.Sets; import org.opentosca.container.core.next.model.DeploymentTestResult; import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.deployment.tests.TestContext; -import org.opentosca.deployment.tests.TestUtil; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicyTemplate; +import org.opentosca.deployment.checks.TestContext; +import org.opentosca.deployment.checks.TestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Strings; -import com.google.common.collect.Sets; - -public class HttpTest implements TestExecutionPlugin { +public class HttpTest implements org.opentosca.deployment.checks.test.TestExecutionPlugin { public static final QName ANNOTATION_HTTP_TEST = new QName("http://opentosca.org/policytypes/annotations/tests", "HttpTest"); @@ -39,13 +39,13 @@ public class HttpTest implements TestExecutionPlugin { private static Logger logger = LoggerFactory.getLogger(HttpTest.class); @Override - public DeploymentTestResult execute(final TestContext context, final AbstractNodeTemplate nodeTemplate, + public DeploymentTestResult execute(final TestContext context, final TNodeTemplate nodeTemplate, final NodeTemplateInstance nodeTemplateInstance, - final AbstractPolicyTemplate policyTemplate) { + final TPolicyTemplate policyTemplate) { logger.debug("Execute test \"{}\" for node template \"{}\" (instance={}) based on policy template \"{}\"", - this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), - policyTemplate.getId()); + this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), + policyTemplate.getId()); final DeploymentTestResult result = new DeploymentTestResult(); result.setName(policyTemplate.getId()); @@ -59,7 +59,7 @@ public DeploymentTestResult execute(final TestContext context, final AbstractNod Set nodes; // Input properties - final Map inputProperties = policyTemplate.getProperties().asMap(); + final Map inputProperties = policyTemplate.getProperties().getKVProperties(); logger.debug("Input properties: {}", inputProperties); // TODO String testMethod = inputProperties.get("TestMethod"); final String testPath = inputProperties.get("TestPath"); @@ -107,7 +107,7 @@ public DeploymentTestResult execute(final TestContext context, final AbstractNod * Determine HTTPS or HTTP */ String scheme = "http://"; - if (policyTemplate.getType().getId().equals(ANNOTATION_HTTPS_TEST)) { + if (policyTemplate.getType().equals(ANNOTATION_HTTPS_TEST)) { scheme = "https://"; } @@ -115,7 +115,7 @@ public DeploymentTestResult execute(final TestContext context, final AbstractNod logger.debug("URL: {}", url); try { final URL endpoint = new URL(url); - final HttpURLConnection con = getConnection(endpoint, policyTemplate.getType().getId()); + final HttpURLConnection con = getConnection(endpoint, policyTemplate.getType()); con.setRequestMethod("GET"); final int status = con.getResponseCode(); con.disconnect(); @@ -123,8 +123,7 @@ public DeploymentTestResult execute(final TestContext context, final AbstractNod result.append(String.format("Test failed: expected \"%s\" but was \"%s\".", expectedStatus, status)); result.failed(); } - } - catch (final Exception e) { + } catch (final Exception e) { logger.error("Error executing test: {}", e.getMessage(), e); result.append("Error executing test: " + e.getMessage()); result.failed(); @@ -155,10 +154,10 @@ private HttpURLConnection getConnection(final URL url, final QName annotation) t } @Override - public boolean canExecute(final AbstractNodeTemplate nodeTemplate, final AbstractPolicyTemplate policyTemplate) { + public boolean canExecute(final TNodeTemplate nodeTemplate, final TPolicyTemplate policyTemplate) { - if (policyTemplate.getType().getId().equals(ANNOTATION_HTTP_TEST) - || policyTemplate.getType().getId().equals(ANNOTATION_HTTPS_TEST)) { + if (policyTemplate.getType().equals(ANNOTATION_HTTP_TEST) + || policyTemplate.getType().equals(ANNOTATION_HTTPS_TEST)) { return true; } @@ -170,11 +169,13 @@ public boolean canExecute(final AbstractNodeTemplate nodeTemplate, final Abstrac private static class LaxTrustManager implements X509TrustManager { @Override public void checkClientTrusted(final X509Certificate[] certificates, - final String s) throws CertificateException {} + final String s) throws CertificateException { + } @Override public void checkServerTrusted(final X509Certificate[] certificates, - final String s) throws CertificateException {} + final String s) throws CertificateException { + } @Override public X509Certificate[] getAcceptedIssuers() { diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/ManagementOperationTest.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/ManagementOperationTest.java new file mode 100644 index 000000000..e6ddfa557 --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/ManagementOperationTest.java @@ -0,0 +1,250 @@ +package org.opentosca.deployment.checks.test; + +import java.lang.reflect.Type; +import java.net.URI; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; + +import javax.inject.Inject; +import javax.xml.namespace.QName; + +import org.eclipse.winery.common.ids.definitions.NodeTypeId; +import org.eclipse.winery.model.tosca.TInterface; +import org.eclipse.winery.model.tosca.TInterfaces; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TNodeType; +import org.eclipse.winery.model.tosca.TOperation; +import org.eclipse.winery.model.tosca.TPolicyTemplate; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; +import com.google.gson.reflect.TypeToken; +import org.apache.camel.CamelContext; +import org.apache.camel.ProducerTemplate; +import org.opentosca.bus.management.header.MBHeader; +import org.opentosca.container.core.model.csar.Csar; +import org.opentosca.container.core.next.model.DeploymentTestResult; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.container.core.next.utils.Types; +import org.opentosca.deployment.checks.TestContext; +import org.opentosca.deployment.checks.TestUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ManagementOperationTest implements org.opentosca.deployment.checks.test.TestExecutionPlugin { + + public static final QName ANNOTATION = + new QName("http://opentosca.org/policytypes/annotations/tests", "ManagementOperationTest"); + + private static Logger logger = LoggerFactory.getLogger(ManagementOperationTest.class); + + private final ProducerTemplate producer; + + @Inject + public ManagementOperationTest(CamelContext camelContext) { + producer = camelContext.createProducerTemplate(); + } + + @Override + public DeploymentTestResult execute(final TestContext context, final TNodeTemplate nodeTemplate, + final NodeTemplateInstance nodeTemplateInstance, + final TPolicyTemplate policyTemplate) { + + logger.debug("Execute test \"{}\" for node template \"{}\" (instance={}) based on policy template \"{}\"", + this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), + policyTemplate.getId()); + + final DeploymentTestResult result = new DeploymentTestResult(); + result.setName(policyTemplate.getId()); + result.setNodeTemplateInstance(nodeTemplateInstance); + result.start(); + + if (policyTemplate.getProperties() == null) { + throw new IllegalStateException("Properties of policy template not initialized"); + } + + // Input properties + final Map inputProperties = policyTemplate.getProperties().getKVProperties(); + logger.debug("Input properties: {}", inputProperties); + + /* + * Make sure Management Interface and Management Operations exist on related Node Type + */ + final String interfaceName = inputProperties.get("InterfaceName"); + final String operationName = inputProperties.get("OperationName"); + final Csar csar = context.getCsar(); + final TNodeType nodeType = (TNodeType) csar.queryRepository(new NodeTypeId(nodeTemplate.getType())); + if (!checkInterfaceOperationSpecification(nodeType.getInterfaces(), interfaceName, operationName)) { + result.append("Wrong InterfaceName and/or OperationName specified"); + result.failed(); + } + + /* + * Try to resolve input parameters from given Node Templates + */ + final Map resolvedInputParameters = + resolveInputParameters(inputProperties.get("ResolveInputParametersFromNodeTemplate"), context); + logger.debug("Resolved input parameters: {}", resolvedInputParameters); + + /* + * Try to parse specified input parameters + */ + final Map parsedInputParameters = + parseJsonParameters(inputProperties.get("TestInputParameters")); + logger.debug("Parsed input parameters: {}", parsedInputParameters); + + /* + * Try to parse expected output parameters + */ + final Map parsedExpectedOutputParameters = + parseJsonParameters(inputProperties.get("ExpectedOutputParameters")); + logger.debug("Parsed expected output parameters: {}", parsedExpectedOutputParameters); + + /* + * Combine input parameters + */ + final Map inputParameters = Maps.newHashMap(); + inputParameters.putAll(resolvedInputParameters); + inputParameters.putAll(parsedInputParameters); + logger.debug("Merged input parameters: {}", inputParameters); + + // Filter input parameters so that only the required ones are submitted + final Set requiredInputParameters = + getRequiredInputParameters(nodeType.getInterfaces(), interfaceName, operationName); + final Map body = + inputParameters.entrySet().stream().filter(e -> requiredInputParameters.contains(e.getKey())) + .collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue())); + logger.debug("Message body: {}", body); + + try { + logger.debug("Invoke management operation..."); + final CompletableFuture> future = + invoke(context, nodeTemplate, interfaceName, operationName, body); + final Map output = future.get(); + logger.debug("Received output: {}", output); + result.success(); + parsedExpectedOutputParameters.entrySet().forEach(e -> { + final String value = output.get(e.getKey()); + if (value == null) { + result.failed(); + result.append(String.format("Test failed, expected parameter \"%s\" not present in output", + e.getKey())); + } else { + final String test = value.trim().replace("\n", "").replace("\r", ""); + if (!test.equals(e.getValue())) { + result.failed(); + result.append(String.format("Test failed, expected \"%s\" but got \"%s\"", e.getValue(), + value)); + } + } + }); + result.append("Output: "); + output.entrySet().stream().forEach(e -> result.append(e.toString())); + } catch (final Exception e) { + logger.error("Error executing test: {}", e.getMessage(), e); + result.append(String.format("Error executing test: " + e.getMessage())); + result.failed(); + } + + logger.info("Test executed: {}", result); + return result; + } + + private CompletableFuture> invoke(final TestContext context, + final TNodeTemplate nodeTemplate, + final String interfaceName, final String operationName, + final Map body) throws Exception { + + final Map headers = new HashMap<>(); + headers.put(MBHeader.CSARID.toString(), context.getServiceTemplateInstance().getCsarId()); + headers.put(MBHeader.SERVICETEMPLATEID_QNAME.toString(), context.getServiceTemplate().getId()); + headers.put(MBHeader.SERVICEINSTANCEID_URI.toString(), new URI(String.valueOf(context.getServiceTemplateInstance().getId()))); + headers.put(MBHeader.NODETEMPLATEID_STRING.toString(), nodeTemplate.getId()); + headers.put(MBHeader.NODEINSTANCEID_STRING.toString(), String.valueOf(context.getNodeTemplateInstance(nodeTemplate).getId())); + headers.put(MBHeader.INTERFACENAME_STRING.toString(), interfaceName); + headers.put(MBHeader.OPERATIONNAME_STRING.toString(), operationName); + headers.put(MBHeader.HASOUTPUTPARAMS_BOOLEAN.toString(), true); + headers.put(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), true); + + return this.producer.asyncRequestBodyAndHeaders("direct:invokeIA", body, headers, Types.generify(Map.class)); + } + + private Map parseJsonParameters(final String parameters) { + if (parameters == null) { + return new HashMap<>(); + } + final Type type = new TypeToken>() { + }.getType(); + final Gson gson = new Gson(); + try { + return gson.fromJson(parameters, type); + } catch (final JsonSyntaxException e) { + logger.error("Could not parse JSON: {}", e.getMessage(), e); + return new HashMap<>(); + } + } + + private Map resolveInputParameters(final String id, final TestContext context) { + if (id == null || context == null) { + return new HashMap<>(); + } + final Collection nodeTemplates = context.getNodeTemplates(); + for (final TNodeTemplate nodeTemplate : nodeTemplates) { + if (nodeTemplate.getId().equals(id)) { + final NodeTemplateInstance instance = context.getNodeTemplateInstance(nodeTemplate); + final Set nodes = Sets.newHashSet(instance); + TestUtil.resolveChildNodes(instance, context, nodes); + return TestUtil.map(nodes, n -> n.getPropertiesAsMap()); + } + } + logger.debug("Could not find Node Template with ID \"{}\"", id); + return new HashMap<>(); + } + + private boolean checkInterfaceOperationSpecification(final TInterfaces interfaces, final String interfaceName, + final String operationName) { + for (final TInterface i : interfaces.getInterface()) { + if (i.getName().equals(interfaceName)) { + for (final TOperation o : i.getOperation()) { + if (o.getName().equals(operationName)) { + logger.debug("Found specified operation \"{}\" on interface \"{}\"", operationName, + interfaceName); + return true; + } + } + } + } + logger.debug("Could not find operation \"{}\" on interface \"{}\"", operationName, interfaceName); + return false; + } + + private Set getRequiredInputParameters(final TInterfaces nodeTypeInterfaces, final String interfaceName, + final String operationName) { + for (final TInterface i : nodeTypeInterfaces.getInterface()) { + if (i.getName().equals(interfaceName)) { + for (final TOperation o : i.getOperation()) { + if (o.getName().equals(operationName)) { + final Set inputParameters = + o.getInputParameters().getInputParameter().stream().map(p -> p.getName()).collect(Collectors.toSet()); + logger.debug("Required input parameters of operation \"{}\" ({}): {}", operationName, + interfaceName, inputParameters); + return inputParameters; + } + } + } + } + logger.debug("Could not find operation \"{}\" on interface \"{}\"", operationName, interfaceName); + return Sets.newHashSet(); + } + + @Override + public boolean canExecute(final TNodeTemplate nodeTemplate, final TPolicyTemplate policyTemplate) { + return policyTemplate.getType().equals(ANNOTATION); + } +} diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/PortBindingTest.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/PortBindingTest.java new file mode 100644 index 000000000..5f64acfaa --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/PortBindingTest.java @@ -0,0 +1,51 @@ +package org.opentosca.deployment.checks.test; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TPolicyTemplate; + +import org.opentosca.container.core.next.model.DeploymentTestResult; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.deployment.checks.TestContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class PortBindingTest implements TestExecutionPlugin { + + public static final QName ANNOTATION = + new QName("http://opentosca.org/policytypes/annotations/tests", "PortBindingTest"); + + private static Logger logger = LoggerFactory.getLogger(PortBindingTest.class); + + @Override + public DeploymentTestResult execute(final TestContext context, final TNodeTemplate nodeTemplate, + final NodeTemplateInstance nodeTemplateInstance, + final TPolicyTemplate policyTemplate) { + + logger.debug("Execute test \"{}\" for node template \"{}\" (instance={}) based on policy template \"{}\"", + this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), + policyTemplate.getId()); + + final DeploymentTestResult result = new DeploymentTestResult(); + result.setName(policyTemplate.getId()); + result.setNodeTemplateInstance(nodeTemplateInstance); + result.start(); + + // TODO + + result.failed(); + logger.info("Test executed: {}", result); + return result; + } + + @Override + public boolean canExecute(final TNodeTemplate nodeTemplate, final TPolicyTemplate policyTemplate) { + + if (policyTemplate.getType().equals(ANNOTATION)) { + return true; + } + + return false; + } +} diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/SqlConnectionTest.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/SqlConnectionTest.java new file mode 100644 index 000000000..47b819789 --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/SqlConnectionTest.java @@ -0,0 +1,51 @@ +package org.opentosca.deployment.checks.test; + +import javax.xml.namespace.QName; + +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TPolicyTemplate; + +import org.opentosca.container.core.next.model.DeploymentTestResult; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.deployment.checks.TestContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SqlConnectionTest implements TestExecutionPlugin { + + public static final QName ANNOTATION = + new QName("http://opentosca.org/policytypes/annotations/tests", "SqlConnectionTest"); + + private static Logger logger = LoggerFactory.getLogger(SqlConnectionTest.class); + + @Override + public DeploymentTestResult execute(final TestContext context, final TNodeTemplate nodeTemplate, + final NodeTemplateInstance nodeTemplateInstance, + final TPolicyTemplate policyTemplate) { + + logger.debug("Execute test \"{}\" for node template \"{}\" (instance={}) based on policy template \"{}\"", + this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), + policyTemplate.getId()); + + final DeploymentTestResult result = new DeploymentTestResult(); + result.setName(policyTemplate.getId()); + result.setNodeTemplateInstance(nodeTemplateInstance); + result.start(); + + // TODO + + result.failed(); + logger.info("Test executed: {}", result); + return result; + } + + @Override + public boolean canExecute(final TNodeTemplate nodeTemplate, final TPolicyTemplate policyTemplate) { + + if (policyTemplate.getType().equals(ANNOTATION)) { + return true; + } + + return false; + } +} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/TcpPingTest.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/TcpPingTest.java similarity index 80% rename from org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/TcpPingTest.java rename to org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/TcpPingTest.java index 619c35a3f..b97d7109a 100644 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/TcpPingTest.java +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/TcpPingTest.java @@ -1,4 +1,4 @@ -package org.opentosca.deployment.tests.test; +package org.opentosca.deployment.checks.test; import java.net.InetSocketAddress; import java.net.Socket; @@ -7,18 +7,18 @@ import javax.xml.namespace.QName; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TPolicyTemplate; + +import com.google.common.base.Strings; +import com.google.common.collect.Sets; import org.opentosca.container.core.next.model.DeploymentTestResult; import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.deployment.tests.TestContext; -import org.opentosca.deployment.tests.TestUtil; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicyTemplate; +import org.opentosca.deployment.checks.TestContext; +import org.opentosca.deployment.checks.TestUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Strings; -import com.google.common.collect.Sets; - public class TcpPingTest implements TestExecutionPlugin { public static final QName ANNOTATION = @@ -27,13 +27,13 @@ public class TcpPingTest implements TestExecutionPlugin { private static Logger logger = LoggerFactory.getLogger(TcpPingTest.class); @Override - public DeploymentTestResult execute(final TestContext context, final AbstractNodeTemplate nodeTemplate, + public DeploymentTestResult execute(final TestContext context, final TNodeTemplate nodeTemplate, final NodeTemplateInstance nodeTemplateInstance, - final AbstractPolicyTemplate policyTemplate) { + final TPolicyTemplate policyTemplate) { logger.debug("Execute test \"{}\" for node template \"{}\" (instance={}) based on policy template \"{}\"", - this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), - policyTemplate.getId()); + this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), + policyTemplate.getId()); final DeploymentTestResult result = new DeploymentTestResult(); result.setName(policyTemplate.getId()); @@ -47,7 +47,7 @@ public DeploymentTestResult execute(final TestContext context, final AbstractNod Set nodes; // Input properties - final Map inputProperties = policyTemplate.getProperties().asMap(); + final Map inputProperties = policyTemplate.getProperties().getKVProperties(); logger.debug("Input properties: {}", inputProperties); final String hostnameProperty = "VMIP"; @@ -90,8 +90,7 @@ public DeploymentTestResult execute(final TestContext context, final AbstractNod socket.connect(new InetSocketAddress(hostname, Integer.parseInt(port)), 1000); result.append(String.format("Successfully pinged hostname \"%s\" on port \"%s\".", hostname, port)); result.success(); - } - catch (final Exception e) { + } catch (final Exception e) { logger.error("Error executing test: {}", e.getMessage(), e); result.append("Error executing test: " + e.getMessage()); result.failed(); @@ -102,12 +101,7 @@ public DeploymentTestResult execute(final TestContext context, final AbstractNod } @Override - public boolean canExecute(final AbstractNodeTemplate nodeTemplate, final AbstractPolicyTemplate policyTemplate) { - - if (policyTemplate.getType().getId().equals(ANNOTATION)) { - return true; - } - - return false; + public boolean canExecute(final TNodeTemplate nodeTemplate, final TPolicyTemplate policyTemplate) { + return policyTemplate.getType().equals(ANNOTATION); } } diff --git a/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/TestExecutionPlugin.java b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/TestExecutionPlugin.java new file mode 100644 index 000000000..3efede678 --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/java/org/opentosca/deployment/checks/test/TestExecutionPlugin.java @@ -0,0 +1,17 @@ +package org.opentosca.deployment.checks.test; + +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TPolicyTemplate; + +import org.opentosca.container.core.next.model.DeploymentTestResult; +import org.opentosca.container.core.next.model.NodeTemplateInstance; +import org.opentosca.deployment.checks.TestContext; + +public interface TestExecutionPlugin { + + DeploymentTestResult execute(final TestContext context, final TNodeTemplate nodeTemplate, + final NodeTemplateInstance nodeTemplateInstance, + final TPolicyTemplate policyTemplate); + + boolean canExecute(final TNodeTemplate nodeTemplate, final TPolicyTemplate policyTemplate); +} diff --git a/org.opentosca.deployment.checks/src/main/resources/spring/context-deployment-checks.xml b/org.opentosca.deployment.checks/src/main/resources/spring/context-deployment-checks.xml new file mode 100644 index 000000000..1afe6cc58 --- /dev/null +++ b/org.opentosca.deployment.checks/src/main/resources/spring/context-deployment-checks.xml @@ -0,0 +1,25 @@ + + + + Register the beans within the remote management bus invocation plugin. + + + + + + org.opentosca.deployment.checks.camel + + + + + + + + diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/Activator.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/Activator.java deleted file mode 100644 index b1d87d5a7..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright 2017 University of Stuttgart - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - *******************************************************************************/ -package org.opentosca.deployment.tests; - -import org.apache.camel.core.osgi.OsgiDefaultCamelContext; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.deployment.tests.camel.RouteConfiguration; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; - -public class Activator implements BundleActivator { - - public static final String ID = "org.opentosca.deployment.tests"; - - private static DefaultCamelContext camelContext; - - @Override - public void start(final BundleContext bundleContext) throws Exception { - camelContext = new OsgiDefaultCamelContext(bundleContext); - camelContext.addRoutes(new RouteConfiguration()); - camelContext.start(); - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - final ServiceReference ref = bundleContext.getServiceReference(TestExecutor.class); - if (ref != null) { - bundleContext.getService(ref).shutdown(); - } - if (camelContext != null) { - camelContext.stop(); - } - } - - public static DefaultCamelContext getCamelContext() { - if (camelContext == null) { - throw new IllegalStateException(); - } - return camelContext; - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/DeploymentTestService.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/DeploymentTestService.java deleted file mode 100644 index ab55e5598..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/DeploymentTestService.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.opentosca.deployment.tests; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - -import javax.ws.rs.InternalServerErrorException; - -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.next.model.DeploymentTest; -import org.opentosca.container.core.next.model.DeploymentTestState; -import org.opentosca.container.core.next.model.PlanInstance; -import org.opentosca.container.core.next.model.PlanInstanceState; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.container.core.next.repository.DeploymentTestRepository; -import org.opentosca.container.core.next.repository.PlanInstanceRepository; -import org.opentosca.planbuilder.importer.Importer; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DeploymentTestService { - - private static Logger logger = LoggerFactory.getLogger(DeploymentTestService.class); - - private final DeploymentTestRepository repository = new DeploymentTestRepository(); - private final Importer importer = new Importer(); - - private final ExecutorService pool = Executors.newFixedThreadPool(5); - - private TestExecutor executor; - - /** - * Runs a deployment test if a plan with the given correlation id is in state FINISHED. - * - * @param csarId The corresponding CSAR - * @param correlationId The correlation ID of a plan - */ - public void runAfterPlan(final CSARID csarId, final String correlationId) { - logger.info("Trigger deployment test after plan has been finished; correlation_id={}, csar={}", correlationId, - csarId); - this.pool.submit(() -> { - final long sleep = 1000; - final long timeout = TimeUnit.MINUTES.toMillis(45); - long waited = 0; - while (true) { - PlanInstance pi = null; - boolean finished = false; - try { - pi = new PlanInstanceRepository().findByCorrelationId(correlationId); - finished = pi.getState().equals(PlanInstanceState.FINISHED); - } - catch (final Exception e) { - finished = false; - } - if (finished) { - run(csarId, pi.getServiceTemplateInstance()); - break; - } - if (waited >= timeout) { - logger.warn("Timeout reached, deployment test has not been executed"); - break; - } - try { - Thread.sleep(sleep); - } - catch (final InterruptedException e) { - } - waited += sleep; - } - }); - } - - /** - * Runs a deployment test for a certain service template instance. - * - * @param csarId The corresponding CSAR - * @param serviceTemplateInstance The service template instance - * @return The created Verification object - */ - public DeploymentTest run(final CSARID csarId, final ServiceTemplateInstance serviceTemplateInstance) { - - logger.info("Trigger deployment test for service template instance \"{}\" of CSAR \"{}\"", - serviceTemplateInstance.getId(), csarId); - - // Prepare - final DeploymentTest result = new DeploymentTest(); - result.setServiceTemplateInstance(serviceTemplateInstance); - result.setState(DeploymentTestState.STARTED); - this.repository.add(result); - - // Execute - this.pool.submit(() -> { - logger.info("Executing deployment test..."); - // Prepare the context - final AbstractDefinitions defs = this.importer.getMainDefinitions(csarId); - final AbstractServiceTemplate serviceTemplate = - defs.getServiceTemplates().stream().findFirst().orElseThrow(InternalServerErrorException::new); - final TestContext context = new TestContext(); - context.setServiceTemplate(serviceTemplate); - context.setServiceTemplateInstance(serviceTemplateInstance); - context.setDeploymentTest(result); - final CompletableFuture future = this.executor.verify(context); - logger.info("Wait until jobs has been finished..."); - try { - future.join(); - logger.info("Jobs has been finished"); - result.setState(DeploymentTestState.FINISHED); - } - catch (final Exception e) { - logger.error("Jobs completed with exception: {}", e.getMessage(), e); - result.setState(DeploymentTestState.FAILED); - } - this.repository.update(result); - }); - logger.info("Deployment test is running in background..."); - - return result; - } - - public void setTestExecutor(final TestExecutor executor) { - this.executor = executor; - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestContext.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestContext.java deleted file mode 100644 index 609df1bec..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestContext.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.opentosca.deployment.tests; - -import java.util.Collection; -import java.util.List; - -import org.opentosca.container.core.next.model.DeploymentTest; -import org.opentosca.container.core.next.model.DeploymentTestResult; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.ServiceTemplateInstance; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; - -public class TestContext { - - private AbstractServiceTemplate serviceTemplate; - private ServiceTemplateInstance serviceTemplateInstance; - private DeploymentTest deploymentTest; - - - public AbstractServiceTemplate getServiceTemplate() { - return this.serviceTemplate; - } - - public void setServiceTemplate(final AbstractServiceTemplate serviceTemplate) { - this.serviceTemplate = serviceTemplate; - } - - public ServiceTemplateInstance getServiceTemplateInstance() { - if (this.serviceTemplate != null) { - return this.serviceTemplateInstance; - } else { - throw new IllegalStateException(); - } - } - - public void setServiceTemplateInstance(final ServiceTemplateInstance serviceTemplateInstance) { - this.serviceTemplateInstance = serviceTemplateInstance; - } - - public synchronized void setDeploymentTest(final DeploymentTest deploymentTest) { - this.deploymentTest = deploymentTest; - if (this.serviceTemplateInstance != null) { - this.deploymentTest.setServiceTemplateInstance(this.serviceTemplateInstance); - } - } - - public DeploymentTest getDeploymentTest() { - return this.deploymentTest; - } - - public synchronized void setDeploymentTestResults(final List deploymentTestResults) { - if (this.deploymentTest == null) { - throw new IllegalStateException(); - } - deploymentTestResults.stream().forEach(this.deploymentTest::addDeploymentTestResult); - if (this.serviceTemplateInstance != null) { - this.deploymentTest.setServiceTemplateInstance(this.serviceTemplateInstance); - } - } - - public synchronized Collection getNodeTemplates() { - if (this.serviceTemplate == null) { - throw new IllegalStateException(); - } - return this.serviceTemplate.getTopologyTemplate().getNodeTemplates(); - } - - public synchronized Collection getNodeTemplateInstances() { - if (this.serviceTemplateInstance == null) { - throw new IllegalStateException(); - } - return this.serviceTemplateInstance.getNodeTemplateInstances(); - } - - public synchronized AbstractNodeTemplate getNodeTemplate(final NodeTemplateInstance nodeTemplateInstance) { - return getNodeTemplates().stream() - .filter(o -> o.getType().getId().equals(nodeTemplateInstance.getTemplateType())) - .findFirst().orElseThrow(IllegalStateException::new); - } - - public synchronized NodeTemplateInstance getNodeTemplateInstance(final AbstractNodeTemplate nodeTemplate) { - return getNodeTemplateInstances().stream() - .filter(o -> o.getTemplateId().getLocalPart().equals(nodeTemplate.getId())) - .findFirst().orElseThrow(IllegalStateException::new); - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestExecutor.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestExecutor.java deleted file mode 100644 index 9297b1376..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestExecutor.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.opentosca.deployment.tests; - -import java.util.List; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -import org.opentosca.container.core.next.model.DeploymentTestResult; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.deployment.tests.test.HttpTest; -import org.opentosca.deployment.tests.test.ManagementOperationTest; -import org.opentosca.deployment.tests.test.TcpPingTest; -import org.opentosca.deployment.tests.test.TestExecutionPlugin; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicyTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; -import com.google.common.util.concurrent.ThreadFactoryBuilder; - -public class TestExecutor { - - private static Logger logger = LoggerFactory.getLogger(TestExecutor.class); - - private final List plugins = - Lists.newArrayList(new HttpTest(), new ManagementOperationTest(), new TcpPingTest() - // new PortBindingTest(), - // new SqlConnectionTest() - ); - - private final ExecutorService jobExecutor; - private final ExecutorService testExecutor; - - public TestExecutor() { - ThreadFactory threadFactory; - threadFactory = new ThreadFactoryBuilder().setNameFormat("job-pool-%d").setDaemon(true).build(); - this.jobExecutor = Executors.newFixedThreadPool(20, threadFactory); - threadFactory = new ThreadFactoryBuilder().setNameFormat("test-pool-%d").setDaemon(true).build(); - this.testExecutor = Executors.newFixedThreadPool(5, threadFactory); - } - - public CompletableFuture verify(final TestContext context) { - - Preconditions.checkNotNull(context.getServiceTemplate()); - Preconditions.checkNotNull(context.getServiceTemplateInstance()); - - return CompletableFuture.supplyAsync(() -> { - - final List> futures = Lists.newArrayList(); - - // Submit a job if an annotations is attached to a node template that can be - // handled by a registered plugin - for (final NodeTemplateInstance nodeTemplateInstance : context.getNodeTemplateInstances()) { - for (final TestExecutionPlugin plugin : this.plugins) { - final AbstractNodeTemplate nodeTemplate = context.getNodeTemplate(nodeTemplateInstance); - final List policyTemplates = - nodeTemplate.getPolicies().stream().filter(Objects::nonNull).map(p -> p.getTemplate()) - .collect(Collectors.toList()); - for (final AbstractPolicyTemplate policyTemplate : policyTemplates) { - if (plugin.canExecute(nodeTemplate, policyTemplate)) { - logger.info("Schedule job \"{}\" for node template \"{}\" (instance={}) because annotation \"{}\" is attached...", - plugin.getClass().getSimpleName(), nodeTemplate.getId(), - nodeTemplateInstance.getId(), policyTemplate.getType().getId()); - futures.add(submit(plugin, context, nodeTemplate, nodeTemplateInstance, policyTemplate)); - } - } - } - } - - // Wait until all jobs have been completed - final List results = - futures.stream().map(CompletableFuture::join).collect(Collectors.toList()); - - context.setDeploymentTestResults(results); - logger.info("Job statistics: {}", context.getDeploymentTest().getStatistics()); - - return null; - }, this.testExecutor); - } - - public void shutdown() { - try { - logger.info("Attempt to shutdown executors..."); - this.jobExecutor.shutdown(); - this.jobExecutor.awaitTermination(5, TimeUnit.SECONDS); - this.testExecutor.shutdown(); - this.testExecutor.awaitTermination(5, TimeUnit.SECONDS); - } - catch (final InterruptedException e) { - logger.warn("Jobs interrupted"); - } - finally { - if (!this.jobExecutor.isTerminated() || !this.testExecutor.isTerminated()) { - logger.warn("Cancel non-finished jobs..."); - } - this.jobExecutor.shutdownNow(); - this.testExecutor.shutdownNow(); - logger.info("Shutdown finished"); - } - } - - private CompletableFuture submit(final TestExecutionPlugin plugin, final TestContext context, - final AbstractNodeTemplate nodeTemplate, - final NodeTemplateInstance nodeTemplateInstance, - final AbstractPolicyTemplate policyTemplate) { - final long start = System.currentTimeMillis(); - return CompletableFuture.supplyAsync(() -> { - final long d = System.currentTimeMillis() - start; - logger.info("Job \"{}\" for node template \"{}\" (instance={}) spent {}ms in queue", - plugin.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), d); - return plugin.execute(context, nodeTemplate, nodeTemplateInstance, policyTemplate); - }, this.jobExecutor); - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestUtil.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestUtil.java deleted file mode 100644 index 26a641f17..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/TestUtil.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.opentosca.deployment.tests; - -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; - -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.model.RelationshipTemplateInstance; -import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; - -/** - * Utility class - */ -public abstract class TestUtil { - - public static synchronized void resolveInfrastructureNodes(final NodeTemplateInstance nodeTemplateInstance, - final TestContext context, - final Set nodes) { - - final List outgoingRelations = - nodeTemplateInstance.getOutgoingRelations().stream() - .filter(r -> r.getTemplateType().equals(Types.dependsOnRelationType) - || r.getTemplateType().equals(Types.deployedOnRelationType) - || r.getTemplateType().equals(Types.hostedOnRelationType)) - .collect(Collectors.toList()); - - for (final RelationshipTemplateInstance r : outgoingRelations) { - - final NodeTemplateInstance target = r.getTarget(); - final AbstractNodeTemplate targetTemplate = context.getNodeTemplate(target); - - if (org.opentosca.container.core.tosca.convention.Utils.isSupportedInfrastructureNodeType(ModelUtils.getNodeBaseType(targetTemplate)) - || org.opentosca.container.core.tosca.convention.Utils.isSupportedCloudProviderNodeType(ModelUtils.getNodeBaseType(targetTemplate))) { - nodes.add(target); - } - - resolveInfrastructureNodes(target, context, nodes); - } - } - - public static synchronized void resolveChildNodes(final NodeTemplateInstance nodeTemplateInstance, - final TestContext context, - final Set nodes) { - // Only follow deployedOn and hostedOn relations - final List outgoingRelations = - nodeTemplateInstance.getOutgoingRelations().stream() - .filter(r -> r.getTemplateType().equals(Types.deployedOnRelationType) - || r.getTemplateType().equals(Types.hostedOnRelationType)) - .collect(Collectors.toList()); - for (final RelationshipTemplateInstance r : outgoingRelations) { - final NodeTemplateInstance target = r.getTarget(); - nodes.add(target); - resolveChildNodes(target, context, nodes); - } - } - - public static synchronized Map map(final Set nodes, - final Function> mapper) { - return nodes.stream().map(mapper).filter(Objects::nonNull).collect(Hashtable::new, Map::putAll, Map::putAll); - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/camel/RouteConfiguration.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/camel/RouteConfiguration.java deleted file mode 100644 index 5ea36be9d..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/camel/RouteConfiguration.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.opentosca.deployment.tests.camel; - -import org.apache.camel.builder.RouteBuilder; -import org.opentosca.deployment.tests.Activator; - -public class RouteConfiguration extends RouteBuilder { - - private static final String MANAGEMENT_BUS = - "bean:org.opentosca.bus.management.service.IManagementBusService?method=invokeIA"; - - @Override - public void configure() throws Exception { - this.from("direct:invokeIA").to("stream:out").to(MANAGEMENT_BUS).end(); - this.from("direct-vm:" + Activator.ID).recipientList(this.simple("direct:response-${id}")).end(); - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/ManagementOperationTest.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/ManagementOperationTest.java deleted file mode 100644 index 7271f7ffe..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/ManagementOperationTest.java +++ /dev/null @@ -1,258 +0,0 @@ -package org.opentosca.deployment.tests.test; - -import java.lang.reflect.Type; -import java.net.URI; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.apache.camel.ProducerTemplate; -import org.apache.camel.impl.DefaultCamelContext; -import org.opentosca.bus.management.header.MBHeader; -import org.opentosca.container.core.next.model.DeploymentTestResult; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.container.core.next.utils.Types; -import org.opentosca.deployment.tests.Activator; -import org.opentosca.deployment.tests.TestContext; -import org.opentosca.deployment.tests.TestUtil; -import org.opentosca.planbuilder.model.tosca.AbstractInterface; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractNodeType; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractPolicyTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; -import com.google.gson.Gson; -import com.google.gson.JsonSyntaxException; -import com.google.gson.reflect.TypeToken; - -public class ManagementOperationTest implements TestExecutionPlugin { - - public static final QName ANNOTATION = - new QName("http://opentosca.org/policytypes/annotations/tests", "ManagementOperationTest"); - - private static Logger logger = LoggerFactory.getLogger(ManagementOperationTest.class); - - private final ProducerTemplate producer; - - - public ManagementOperationTest() { - final DefaultCamelContext camelContext = Activator.getCamelContext(); - this.producer = camelContext.createProducerTemplate(); - } - - @Override - public DeploymentTestResult execute(final TestContext context, final AbstractNodeTemplate nodeTemplate, - final NodeTemplateInstance nodeTemplateInstance, - final AbstractPolicyTemplate policyTemplate) { - - logger.debug("Execute test \"{}\" for node template \"{}\" (instance={}) based on policy template \"{}\"", - this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), - policyTemplate.getId()); - - final DeploymentTestResult result = new DeploymentTestResult(); - result.setName(policyTemplate.getId()); - result.setNodeTemplateInstance(nodeTemplateInstance); - result.start(); - - if (policyTemplate.getProperties() == null) { - throw new IllegalStateException("Properties of policy template not initialized"); - } - - // Input properties - final Map inputProperties = policyTemplate.getProperties().asMap(); - logger.debug("Input properties: {}", inputProperties); - - /* - * Make sure Management Interface and Management Operations exist on related Node Type - */ - final String interfaceName = inputProperties.get("InterfaceName"); - final String operationName = inputProperties.get("OperationName"); - if (!checkInterfaceOperationSpecification(nodeTemplate.getType(), interfaceName, operationName)) { - result.append("Wrong InterfaceName and/or OperationName specified"); - result.failed(); - } - - /* - * Try to resolve input parameters from given Node Templates - */ - final Map resolvedInputParameters = - resolveInputParameters(inputProperties.get("ResolveInputParametersFromNodeTemplate"), context); - logger.debug("Resolved input parameters: {}", resolvedInputParameters); - - /* - * Try to parse specified input parameters - */ - final Map parsedInputParameters = - parseJsonParameters(inputProperties.get("TestInputParameters")); - logger.debug("Parsed input parameters: {}", parsedInputParameters); - - /* - * Try to parse expected output parameters - */ - final Map parsedExpectedOutputParameters = - parseJsonParameters(inputProperties.get("ExpectedOutputParameters")); - logger.debug("Parsed expected output parameters: {}", parsedExpectedOutputParameters); - - /* - * Combine input parameters - */ - final Map inputParameters = Maps.newHashMap(); - inputParameters.putAll(resolvedInputParameters); - inputParameters.putAll(parsedInputParameters); - logger.debug("Merged input parameters: {}", inputParameters); - - /* - * Filter input parameters that only the required ones are submitted - */ - final Set requiredInputParameters = - getRequiredInputParameters(nodeTemplate.getType(), interfaceName, operationName); - final Map body = - inputParameters.entrySet().stream().filter(e -> requiredInputParameters.contains(e.getKey())) - .collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue())); - logger.debug("Message body: {}", body); - - try { - logger.debug("Invoke management operation..."); - final CompletableFuture> future = - invoke(context, nodeTemplate, interfaceName, operationName, body); - final Map output = future.get(); - logger.debug("Received output: {}", output); - result.success(); - parsedExpectedOutputParameters.entrySet().forEach(e -> { - final String value = output.get(e.getKey()); - if (value == null) { - result.failed(); - result.append(String.format("Test failed, expected parameter \"%s\" not present in output", - e.getKey())); - } else { - final String test = value.trim().replace("\n", "").replace("\r", ""); - if (!test.equals(e.getValue())) { - result.failed(); - result.append(String.format("Test failed, expected \"%s\" but got \"%s\"", e.getValue(), - value)); - } - } - }); - result.append("Output: "); - output.entrySet().stream().forEach(e -> result.append(e.toString())); - } - catch (final Exception e) { - logger.error("Error executing test: {}", e.getMessage(), e); - result.append(String.format("Error executing test: " + e.getMessage())); - result.failed(); - } - - logger.info("Test executed: {}", result); - return result; - } - - private CompletableFuture> invoke(final TestContext context, - final AbstractNodeTemplate nodeTemplate, - final String interfaceName, final String operationName, - final Map body) throws Exception { - - final Map headers = new HashMap<>(); - headers.put(MBHeader.CSARID.toString(), context.getServiceTemplateInstance().getCsarId()); - headers.put(MBHeader.SERVICETEMPLATEID_QNAME.toString(), context.getServiceTemplate().getQName()); - headers.put(MBHeader.SERVICEINSTANCEID_URI.toString(), - new URI(String.valueOf(context.getServiceTemplateInstance().getId()))); - headers.put(MBHeader.NODETEMPLATEID_STRING.toString(), nodeTemplate.getId()); - headers.put(MBHeader.NODEINSTANCEID_STRING.toString(), - String.valueOf(context.getNodeTemplateInstance(nodeTemplate).getId())); - headers.put(MBHeader.INTERFACENAME_STRING.toString(), interfaceName); - headers.put(MBHeader.OPERATIONNAME_STRING.toString(), operationName); - headers.put(MBHeader.HASOUTPUTPARAMS_BOOLEAN.toString(), true); - headers.put(MBHeader.SYNCINVOCATION_BOOLEAN.toString(), true); - - return this.producer.asyncRequestBodyAndHeaders("direct:invokeIA", body, headers, Types.generify(Map.class)); - } - - private Map parseJsonParameters(final String parameters) { - if (parameters == null) { - return new HashMap<>(); - } - final Type type = new TypeToken>() {}.getType(); - final Gson gson = new Gson(); - try { - return gson.fromJson(parameters, type); - } - catch (final JsonSyntaxException e) { - logger.error("Could not parse JSON: {}", e.getMessage(), e); - return new HashMap<>(); - } - } - - private Map resolveInputParameters(final String id, final TestContext context) { - if (id == null || context == null) { - return new HashMap<>(); - } - final Collection nodeTemplates = context.getNodeTemplates(); - for (final AbstractNodeTemplate nodeTemplate : nodeTemplates) { - if (nodeTemplate.getId().equals(id)) { - final NodeTemplateInstance instance = context.getNodeTemplateInstance(nodeTemplate); - final Set nodes = Sets.newHashSet(instance); - TestUtil.resolveChildNodes(instance, context, nodes); - return TestUtil.map(nodes, n -> n.getPropertiesAsMap()); - } - } - logger.debug("Could not find Node Template with ID \"{}\"", id); - return new HashMap<>(); - } - - private boolean checkInterfaceOperationSpecification(final AbstractNodeType nodeType, final String interfaceName, - final String operationName) { - for (final AbstractInterface i : nodeType.getInterfaces()) { - if (i.getName().equals(interfaceName)) { - for (final AbstractOperation o : i.getOperations()) { - if (o.getName().equals(operationName)) { - logger.debug("Found specified operation \"{}\" on interface \"{}\"", operationName, - interfaceName); - return true; - } - } - } - } - logger.debug("Could not find operation \"{}\" on interface \"{}\", not specified in Node Type {}", - operationName, interfaceName, nodeType.getId()); - return false; - } - - private Set getRequiredInputParameters(final AbstractNodeType nodeType, final String interfaceName, - final String operationName) { - for (final AbstractInterface i : nodeType.getInterfaces()) { - if (i.getName().equals(interfaceName)) { - for (final AbstractOperation o : i.getOperations()) { - if (o.getName().equals(operationName)) { - final Set inputParameters = - o.getInputParameters().stream().map(p -> p.getName()).collect(Collectors.toSet()); - logger.debug("Required input parameters of operation \"{}\" ({}): {}", operationName, - interfaceName, inputParameters); - return inputParameters; - } - } - } - } - logger.debug("Could not find operation \"{}\" on interface \"{}\", not specified in Node Type {}", - operationName, interfaceName, nodeType.getId()); - return Sets.newHashSet(); - } - - @Override - public boolean canExecute(final AbstractNodeTemplate nodeTemplate, final AbstractPolicyTemplate policyTemplate) { - - if (policyTemplate.getType().getId().equals(ANNOTATION)) { - return true; - } - - return false; - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/PortBindingTest.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/PortBindingTest.java deleted file mode 100644 index b16d099ef..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/PortBindingTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.deployment.tests.test; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.next.model.DeploymentTestResult; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.deployment.tests.TestContext; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicyTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PortBindingTest implements TestExecutionPlugin { - - public static final QName ANNOTATION = - new QName("http://opentosca.org/policytypes/annotations/tests", "PortBindingTest"); - - private static Logger logger = LoggerFactory.getLogger(PortBindingTest.class); - - @Override - public DeploymentTestResult execute(final TestContext context, final AbstractNodeTemplate nodeTemplate, - final NodeTemplateInstance nodeTemplateInstance, - final AbstractPolicyTemplate policyTemplate) { - - logger.debug("Execute test \"{}\" for node template \"{}\" (instance={}) based on policy template \"{}\"", - this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), - policyTemplate.getId()); - - final DeploymentTestResult result = new DeploymentTestResult(); - result.setName(policyTemplate.getId()); - result.setNodeTemplateInstance(nodeTemplateInstance); - result.start(); - - // TODO - - result.failed(); - logger.info("Test executed: {}", result); - return result; - } - - @Override - public boolean canExecute(final AbstractNodeTemplate nodeTemplate, final AbstractPolicyTemplate policyTemplate) { - - if (policyTemplate.getType().getId().equals(ANNOTATION)) { - return true; - } - - return false; - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/SqlConnectionTest.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/SqlConnectionTest.java deleted file mode 100644 index ca02baecb..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/SqlConnectionTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.deployment.tests.test; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.next.model.DeploymentTestResult; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.deployment.tests.TestContext; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicyTemplate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SqlConnectionTest implements TestExecutionPlugin { - - public static final QName ANNOTATION = - new QName("http://opentosca.org/policytypes/annotations/tests", "SqlConnectionTest"); - - private static Logger logger = LoggerFactory.getLogger(SqlConnectionTest.class); - - @Override - public DeploymentTestResult execute(final TestContext context, final AbstractNodeTemplate nodeTemplate, - final NodeTemplateInstance nodeTemplateInstance, - final AbstractPolicyTemplate policyTemplate) { - - logger.debug("Execute test \"{}\" for node template \"{}\" (instance={}) based on policy template \"{}\"", - this.getClass().getSimpleName(), nodeTemplate.getId(), nodeTemplateInstance.getId(), - policyTemplate.getId()); - - final DeploymentTestResult result = new DeploymentTestResult(); - result.setName(policyTemplate.getId()); - result.setNodeTemplateInstance(nodeTemplateInstance); - result.start(); - - // TODO - - result.failed(); - logger.info("Test executed: {}", result); - return result; - } - - @Override - public boolean canExecute(final AbstractNodeTemplate nodeTemplate, final AbstractPolicyTemplate policyTemplate) { - - if (policyTemplate.getType().getId().equals(ANNOTATION)) { - return true; - } - - return false; - } -} diff --git a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/TestExecutionPlugin.java b/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/TestExecutionPlugin.java deleted file mode 100644 index 42a797292..000000000 --- a/org.opentosca.deployment.checks/src/org/opentosca/deployment/tests/test/TestExecutionPlugin.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.opentosca.deployment.tests.test; - -import org.opentosca.container.core.next.model.DeploymentTestResult; -import org.opentosca.container.core.next.model.NodeTemplateInstance; -import org.opentosca.deployment.tests.TestContext; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicyTemplate; - -public interface TestExecutionPlugin { - - DeploymentTestResult execute(final TestContext context, final AbstractNodeTemplate nodeTemplate, - final NodeTemplateInstance nodeTemplateInstance, - final AbstractPolicyTemplate policyTemplate); - - boolean canExecute(final AbstractNodeTemplate nodeTemplate, final AbstractPolicyTemplate policyTemplate); -} diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.core.bpel/META-INF/MANIFEST.MF deleted file mode 100644 index e991e6448..000000000 --- a/org.opentosca.planbuilder.core.bpel/META-INF/MANIFEST.MF +++ /dev/null @@ -1,25 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Core Classes for the BPEL Plan Builder -Bundle-SymbolicName: org.opentosca.planbuilder.core.bpel -Bundle-Version: 2.0.0.qualifier -Bundle-Activator: org.opentosca.planbuilder.core.bpel.Activator -Bundle-ClassPath: ., - META-INF/resources/ -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: javax.wsdl;version="1.6.0", - javax.wsdl.factory;version="1.6.0", - javax.wsdl.xml;version="1.6.0", - org.apache.commons.io;version="2.2.0", - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.10" -Export-Package: org.opentosca.planbuilder.core.bpel, - org.opentosca.planbuilder.core.bpel.context, - org.opentosca.planbuilder.core.bpel.fragments, - org.opentosca.planbuilder.core.bpel.handlers, - org.opentosca.planbuilder.core.bpel.tosca.handlers, - org.opentosca.planbuilder.core.bpel.typebasedplanbuilder -Require-Bundle: org.opentosca.planbuilder.model;bundle-version="2.0.0", - org.opentosca.planbuilder, - org.opentosca.container.core.tosca;bundle-version="2.0.0", - org.eclipse.core.runtime;bundle-version="3.12.0" diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml deleted file mode 100644 index ac547a782..000000000 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml deleted file mode 100644 index 609bf0685..000000000 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELMonitoringSituation.xml b/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELMonitoringSituation.xml deleted file mode 100644 index 871809bb9..000000000 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELMonitoringSituation.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - $SituationIds - - - - - - - - $situationIdFromInputCopies - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignFromInputToStringVar.xml b/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignFromInputToStringVar.xml deleted file mode 100644 index d7f9682db..000000000 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignFromInputToStringVar.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml b/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml deleted file mode 100644 index deea9389e..000000000 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml b/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml deleted file mode 100644 index 2f58a145c..000000000 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelCopyOutputVarFromStringVariable.xml b/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelCopyOutputVarFromStringVariable.xml deleted file mode 100644 index 4041f7167..000000000 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelCopyOutputVarFromStringVariable.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.opentosca.planbuilder.core.bpel/build.properties b/org.opentosca.planbuilder.core.bpel/build.properties deleted file mode 100644 index dcfd84d9d..000000000 --- a/org.opentosca.planbuilder.core.bpel/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ diff --git a/org.opentosca.planbuilder.core.bpel/pom.xml b/org.opentosca.planbuilder.core.bpel/pom.xml deleted file mode 100644 index a8b52d183..000000000 --- a/org.opentosca.planbuilder.core.bpel/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.core.bpel - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/Activator.java b/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/Activator.java deleted file mode 100644 index 9380f0ebb..000000000 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/Activator.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.opentosca.planbuilder.core.bpel; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /** - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /** - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/BPELScopeBuilder.java b/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/BPELScopeBuilder.java deleted file mode 100644 index d382152b8..000000000 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/BPELScopeBuilder.java +++ /dev/null @@ -1,914 +0,0 @@ -package org.opentosca.planbuilder.core.bpel.artifactbasednodehandler; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.opentosca.planbuilder.core.bpel.tosca.handlers.TOSCAManagementInfrastructureNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractInterface; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTypeImplementation; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; -import org.opentosca.planbuilder.plugins.registry.PluginRegistry; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPrePhasePlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - *

    - * This Class represents the low-level algorithm for the concept in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans fuer - * OpenTOSCA. This includes selecting a implementation (NodeTypeImplementation,Relationship..) - * where all artifacts (IA, DA) and the operations of the template (Node and Relation) can be used - * for calling a chain/list/.. of TOSCA operations. All complete possibilities of calls based on the - * selected Node Type Implementation are hold inside a OperationChain Object. And can be selected to - * be generated by the determined operations and handling plugins. - * - *

    - * Copyright 2017 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class BPELScopeBuilder { - - final static Logger LOG = LoggerFactory.getLogger(BPELScopeBuilder.class); - - private static PluginRegistry pluginRegistry = new PluginRegistry(); - - /** - *

    - * Filters IA and DA Candidates inside the given ProvisioningChain. Filtering means if there are IA - * and DACandidates which don't operate on the same Template Implementation they are deleted. - *

    - * - * @param chain a ProvisioningChain to filter - */ - private static void filterIncompatibleIADACandidates(final OperationChain chain) { - final Map compatibleCandidates = new HashMap<>(); - for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { - for (final DANodeTypeImplCandidate daCandidate : chain.daCandidates) { - if (iaCandidate.nodeImpl.getName().equals(daCandidate.impl.getName())) { - compatibleCandidates.put(iaCandidate, daCandidate); - } - } - } - chain.daCandidates = new ArrayList<>(); - chain.iaCandidates = new ArrayList<>(); - - for (final IANodeTypeImplCandidate key : compatibleCandidates.keySet()) { - chain.iaCandidates.add(key); - chain.daCandidates.add(compatibleCandidates.get(key)); - } - } - - /** - * Creates a ProvisioningChain for the given RelationshipTemplate. - * - * @param relationshipTemplate an AbstractRelationshipTemplate which should be provisioned - * @param forSource determines whether provisioning is handle on the SourceInterface (set to true) - * or TargetInterface - * @return a ProvisioningChain with complete provisioning Candidates - */ - public static OperationChain createOperationChain(final AbstractRelationshipTemplate relationshipTemplate, - final boolean forSource) { - // get implementations - final List relationshipTypeImpls = - relationshipTemplate.getImplementations(); - - if (relationshipTypeImpls.isEmpty()) { - return null; - } - - // init chain - final OperationChain chain = new OperationChain(relationshipTemplate); - - // calculate infraNodes - final List infraNodes = new ArrayList<>(); - - ModelUtils.getInfrastructureNodes(relationshipTemplate, infraNodes, forSource); - - // check for IA Plugins - final List> iaPlugins = BPELScopeBuilder.pluginRegistry.getIaPlugins(); - - BPELScopeBuilder.calculateBestImplementationRelationIACandidates(relationshipTypeImpls, iaPlugins, infraNodes, - chain, forSource); - - // check for prov plugins - final List> provPlugins = - BPELScopeBuilder.pluginRegistry.getProvPlugins(); - - BPELScopeBuilder.calculateProvPlugins(chain, provPlugins); - - BPELScopeBuilder.filterIADACandidatesRelations(chain); - - BPELScopeBuilder.reorderProvCandidates(chain); - - return chain; - } - - /** - * TODO: We assume that IAs are already provisinoned on IA engine - * - * @param relationshipTemplate - * @param interfaceName - * @param operationName - * @return OperationChain - */ - public static OperationChain createOperationCall(final AbstractRelationshipTemplate relationshipTemplate, - final String interfaceName, final String operationName) { - - final List impls = relationshipTemplate.getImplementations(); - if (impls.isEmpty()) { - BPELScopeBuilder.LOG.warn("No implementations available for RelationshipTemplate {} , can't generate Provisioning logic", - relationshipTemplate.getId()); - return null; - } - - final OperationChain chain = new OperationChain(relationshipTemplate); - chain.provCandidates = new ArrayList<>(); - - final List> provPlugins = - BPELScopeBuilder.pluginRegistry.getProvPlugins(); - - for (final AbstractRelationshipTypeImplementation impl : impls) { - final OperationNodeTypeImplCandidate provCandidate = new OperationNodeTypeImplCandidate(); - for (final AbstractImplementationArtifact ia : impl.getImplementationArtifacts()) { - for (final IPlanBuilderProvPhaseOperationPlugin plugin : provPlugins) { - if (plugin.canHandle(ia.getArtifactType()) - && BPELScopeBuilder.getOperationForIa(chain.relationshipTemplate, ia, operationName) != null) { - provCandidate.add(BPELScopeBuilder.getOperationForIa(chain.relationshipTemplate, ia, - operationName), - ia, plugin); - } - } - } - chain.provCandidates.add(provCandidate); - } - return chain; - } - - /** - * Creates a complete ProvisioningChain for the given NodeTemplate - * - * @param nodeTemplate an AbstractNodeTemplate to create a ProvisioningChain for - * @return a complete ProvisioningChain - */ - public static OperationChain createOperationCall(final AbstractNodeTemplate nodeTemplate, - final String interfaceName, final String operationName) { - // get nodetype implementations - final List nodeTypeImpls = nodeTemplate.getImplementations(); - - if (nodeTypeImpls.isEmpty()) { - BPELScopeBuilder.LOG.warn("No implementations available for NodeTemplate {} , can't generate Provisioning logic", - nodeTemplate.getId()); - return null; - } - - final OperationChain chain = new OperationChain(nodeTemplate); - - // calculate infrastructure nodes - final List infraNodes = new ArrayList<>(); - ModelUtils.getInfrastructureNodes(nodeTemplate, infraNodes); - - // we'll add here a dummy infra node, representing the management - // infrastructure of the tosca engine (WAR IA's implementing tosca - // operation,..) - infraNodes.add(new TOSCAManagementInfrastructureNodeTemplate()); - - // check for IA Plugins - final List> iaPlugins = BPELScopeBuilder.pluginRegistry.getIaPlugins(); - - BPELScopeBuilder.LOG.debug("Calculating best IA candidates for nodeTemplate {} ", nodeTemplate.getId()); - // calculate nodeImpl candidates where all IAs of each can be - // provisioned - BPELScopeBuilder.calculateBestImplementationIACandidates(nodeTypeImpls, iaPlugins, infraNodes, chain, - interfaceName, operationName); - for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { - final int length = iaCandidate.ias.size(); - for (int i = 0; i < length; i++) { - final AbstractImplementationArtifact ia = iaCandidate.ias.get(i); - final AbstractNodeTemplate infraNode = iaCandidate.infraNodes.get(i); - final IPlanBuilderPlugin plugin = iaCandidate.plugins.get(i); - BPELScopeBuilder.LOG.debug("Found IA {} for deployment on the InfraNode {} with the Plugin {}", - ia.getName(), infraNode.getId(), plugin.getID()); - } - } - - // check for prov plugins - final List> provPlugins = - BPELScopeBuilder.pluginRegistry.getProvPlugins(); - - // search for prov plugins according to the chosen IA provisionings in - // the chain - BPELScopeBuilder.calculateProvPlugins(chain, provPlugins, interfaceName, operationName); - - // filter ia and da candidates where the operations can't be executed - BPELScopeBuilder.filterIADACandidates(chain); - - // order provisioning candidates - BPELScopeBuilder.reorderProvCandidates(chain); - - // TODO consistency plugins - final List array = new ArrayList<>(); - - array.add(operationName); - // select provisioning - BPELScopeBuilder.selectProvisioning(chain, array); - - return chain; - } - - /** - * Creates a complete ProvisioningChain for the given NodeTemplate - * - * @param nodeTemplate an AbstractNodeTemplate to create a ProvisioningChain for - * @return a complete ProvisioningChain - */ - public static OperationChain createOperationChain(final AbstractNodeTemplate nodeTemplate, - final List operationNames) { - // get nodetype implementations - final List nodeTypeImpls = nodeTemplate.getImplementations(); - - if (nodeTypeImpls.isEmpty()) { - BPELScopeBuilder.LOG.warn("No implementations available for NodeTemplate {} , can't generate Provisioning logic", - nodeTemplate.getId()); - return null; - } - - final OperationChain chain = new OperationChain(nodeTemplate); - - // calculate infrastructure nodes - final List infraNodes = new ArrayList<>(); - ModelUtils.getInfrastructureNodes(nodeTemplate, infraNodes); - - // we'll add here a dummy infra node, representing the management - // infrastructure of the tosca engine (WAR IA's implementing tosca - // operation,..) - infraNodes.add(new TOSCAManagementInfrastructureNodeTemplate()); - - // check for IA Plugins - final List> iaPlugins = BPELScopeBuilder.pluginRegistry.getIaPlugins(); - - BPELScopeBuilder.LOG.debug("Calculating best IA candidates for nodeTemplate {} ", nodeTemplate.getId()); - // calculate nodeImpl candidates where all IAs of each can be - // provisioned - BPELScopeBuilder.calculateBestImplementationIACandidates(nodeTypeImpls, iaPlugins, infraNodes, chain); - for (final IANodeTypeImplCandidate wrapper : chain.iaCandidates) { - final int length = wrapper.ias.size(); - for (int i = 0; i < length; i++) { - final AbstractImplementationArtifact ia = wrapper.ias.get(i); - final AbstractNodeTemplate infraNode = wrapper.infraNodes.get(i); - final IPlanBuilderPlugin plugin = wrapper.plugins.get(i); - BPELScopeBuilder.LOG.debug("Found IA {} for deployment on the InfraNode {} with the Plugin {}", - ia.getName(), infraNode.getId(), plugin.getID()); - } - } - - // check for DA Plugins - final List> daPlugins = BPELScopeBuilder.pluginRegistry.getDaPlugins(); - - // calculate nodeImpl candidates where all DAs of each can be - // provisioned - BPELScopeBuilder.calculateBestImplementationDACandidates(nodeTemplate, nodeTypeImpls, daPlugins, infraNodes, - chain); - for (final DANodeTypeImplCandidate wrapper : chain.daCandidates) { - final int length = wrapper.das.size(); - for (int i = 0; i < length; i++) { - final AbstractDeploymentArtifact da = wrapper.das.get(i); - final AbstractNodeTemplate infraNode = wrapper.infraNodes.get(i); - final IPlanBuilderPlugin plugin = wrapper.plugins.get(i); - BPELScopeBuilder.LOG.debug("Found DA {} for deployment on the InfraNode {} with the Plugin {}", - da.getName(), infraNode.getId(), plugin.getID()); - } - } - - // filter for nodeTypeImpl Candidates where both DAs and IAs can - // be provisioned - BPELScopeBuilder.filterIncompatibleIADACandidates(chain); - - // check for prov plugins - final List> provPlugins = - BPELScopeBuilder.pluginRegistry.getProvPlugins(); - - // search for prov plugins according to the chosen IA provisionings in - // the chain - BPELScopeBuilder.calculateProvPlugins(chain, provPlugins); - - // filter ia and da candidates where the operations can't be executed - BPELScopeBuilder.filterIADACandidates(chain); - - // order provisioning candidates - BPELScopeBuilder.reorderProvCandidates(chain); - - // TODO consistency plugins - - // select provisioning - BPELScopeBuilder.selectProvisioning(chain, operationNames); - - - return chain; - } - - /** - * Reorders the IA/ProvCandidates inside the given ProvisioningChain, so that a correct order is - * enforced - * - * @param chain a ProvisioningChain - */ - private static void reorderProvCandidates(final OperationChain chain) { - // ia candidates and da candidates in the chains are already ordered - // accordingly - final List reorderedList = new ArrayList<>(); - for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { - final int iaCandidateSize = iaCandidate.ias.size(); - for (final OperationNodeTypeImplCandidate provCandidate : chain.provCandidates) { - for (final AbstractImplementationArtifact iaCandidateIa : iaCandidate.ias) { - for (final AbstractImplementationArtifact provCandidateIa : provCandidate.ias) { - if (iaCandidateIa.equals(provCandidateIa)) { - reorderedList.add(provCandidate); - break; - } - } - } - } - } - - chain.provCandidates = reorderedList; - - } - - /** - * Filters IA and ProvCandidates which aren't generated from the same Template Implementation - * - * @param chain a ProvisioningChain - */ - private static void filterIADACandidatesRelations(final OperationChain chain) { - if (chain.provCandidates.size() != chain.iaCandidates.size()) { - final List iaCandidatesToRemove = new ArrayList<>(); - final Set provCandidatesWithMatch = new HashSet<>(); - for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { - final int iaCandidateSize = iaCandidate.ias.size(); - OperationNodeTypeImplCandidate match = null; - for (final OperationNodeTypeImplCandidate provCandidate : chain.provCandidates) { - int count = 0; - for (final AbstractImplementationArtifact iaCandidateIa : iaCandidate.ias) { - for (final AbstractImplementationArtifact procCandidateIa : provCandidate.ias) { - if (iaCandidateIa.equals(procCandidateIa)) { - count++; - } - } - } - if (count == iaCandidateSize) { - match = provCandidate; - } - } - if (match == null && !chain.provCandidates.isEmpty()) { - iaCandidatesToRemove.add(iaCandidate); - } else { - if (match != null) { - provCandidatesWithMatch.add(match); - } - } - } - if (!iaCandidatesToRemove.isEmpty()) { - // we need to remove ia and da candidates accordingly, because - // we didn't found matchin operation candidates for them - for (final IANodeTypeImplCandidate iaCandidateToRemove : iaCandidatesToRemove) { - final int index = chain.iaCandidates.indexOf(iaCandidateToRemove); - chain.iaCandidates.remove(index); - } - } - - if (!provCandidatesWithMatch.isEmpty()) { - // remove all prov candidates which weren't matched to some ia - // candidate - chain.provCandidates = new ArrayList<>(); - for (final OperationNodeTypeImplCandidate matchedCandidate : provCandidatesWithMatch) { - chain.provCandidates.add(matchedCandidate); - } - } - } - } - - /** - * Filters DA/IA Candidates where no OperationCandidates could be found - * - * @param chain a ProvisioningChain - */ - private static void filterIADACandidates(final OperationChain chain) { - if (chain.provCandidates.size() != chain.iaCandidates.size()) { - // search for ia/da-Candidates where no operation candidate could be - // found - final List iaCandidatesToRemove = new ArrayList<>(); - final Set provCandidatesWithMatch = new HashSet<>(); - for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { - final int iaCandidateSize = iaCandidate.ias.size(); - OperationNodeTypeImplCandidate match = null; - for (final OperationNodeTypeImplCandidate provCandidate : chain.provCandidates) { - int count = 0; - for (final AbstractImplementationArtifact iaCandidateIa : iaCandidate.ias) { - for (final AbstractImplementationArtifact provCandidateIa : provCandidate.ias) { - if (iaCandidateIa.equals(provCandidateIa)) { - count++; - } - } - } - if (count == iaCandidateSize) { - match = provCandidate; - } - } - if (match == null && !chain.provCandidates.isEmpty()) { - iaCandidatesToRemove.add(iaCandidate); - } else { - if (match != null) { - provCandidatesWithMatch.add(match); - } - } - } - - if (!iaCandidatesToRemove.isEmpty()) { - // we need to remove ia and da candidates accordingly, because - // we didn't found matchin operation candidates for them - for (final IANodeTypeImplCandidate iaCandidateToRemove : iaCandidatesToRemove) { - final int index = chain.iaCandidates.indexOf(iaCandidateToRemove); - chain.iaCandidates.remove(index); - chain.daCandidates.remove(index); - } - } - - if (!provCandidatesWithMatch.isEmpty()) { - // remove all prov candidates which weren't matched to some ia - // candidate - chain.provCandidates = new ArrayList<>(); - for (final OperationNodeTypeImplCandidate matchedCandidate : provCandidatesWithMatch) { - chain.provCandidates.add(matchedCandidate); - } - } - } - } - - private static void selectProvisioning(final OperationChain chain, final List operationNames) { - // TODO just select the first ia candidate, da candidate and prov - // candidate for now - // Selection should determine a minimal provisioning. Minimal= - // min{|IACandidates| + |DACandidates| +|ProvPhaseOperations|} - - // select first candidate set where the provisioning candidate uses the given operations - - int selectedCandidateSet = -1; - for (int i = 0; i < chain.provCandidates.size(); i++) { - - for (final AbstractOperation op : chain.provCandidates.get(i).ops) { - if (operationNames.contains(op.getName())) { - selectedCandidateSet = i; - break; - } - } - if (selectedCandidateSet != -1) { - break; - } - } - - - if (selectedCandidateSet != -1) { - chain.selectedCandidateSet = selectedCandidateSet; - } - - - } - - /** - * Calculates which Provisioning can be used for Provisioining according to the given - * IA/DACandidates inside the given ProvisioningChain - * - * @param chain a ProvisioningChain with set DA/IACandidates - * @param provPlugins a List of ProvPhaseOperationPlugins - */ - private static void calculateProvPlugins(final OperationChain chain, - final List> provPlugins, - final String interfaceName, final String operationName) { - final List candidates = new ArrayList<>(); - for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { - final OperationNodeTypeImplCandidate provCandidate = new OperationNodeTypeImplCandidate(); - for (final AbstractImplementationArtifact ia : iaCandidate.ias) { - if (!ia.getInterfaceName().trim().equals(interfaceName.trim())) { - continue; - } - if (ia.getOperationName() != null && !ia.getOperationName().trim().equals(operationName.trim())) { - continue; - } - for (final IPlanBuilderProvPhaseOperationPlugin plugin : provPlugins) { - if (chain.nodeTemplate != null) { - if (plugin.canHandle(ia.getArtifactType()) - && BPELScopeBuilder.getOperationForIa(chain.nodeTemplate, ia) != null) { - - provCandidate.add(BPELScopeBuilder.getOperationForIa(chain.nodeTemplate, ia), ia, plugin); - } - } else { - if (plugin.canHandle(ia.getArtifactType()) - && BPELScopeBuilder.getOperationForIa(chain.relationshipTemplate, ia) != null) { - provCandidate.add(BPELScopeBuilder.getOperationForIa(chain.relationshipTemplate, ia), ia, - plugin); - } - } - } - } - if (chain.nodeTemplate != null) { - if (provCandidate.isValid(chain.nodeTemplate, interfaceName, operationName)) { - candidates.add(provCandidate); - } - } else { - if (provCandidate.isValid(chain.relationshipTemplate)) { - candidates.add(provCandidate); - } - } - - } - chain.provCandidates = candidates; - } - - /** - * Calculates which Provisioning can be used for Provisioining according to the given - * IA/DACandidates inside the given ProvisioningChain - * - * @param chain a ProvisioningChain with set DA/IACandidates - * @param provPlugins a List of ProvPhaseOperationPlugins - */ - private static void calculateProvPlugins(final OperationChain chain, - final List> provPlugins) { - final List candidates = new ArrayList<>(); - for (final IANodeTypeImplCandidate candidate : chain.iaCandidates) { - final OperationNodeTypeImplCandidate provCandidate = new OperationNodeTypeImplCandidate(); - for (final AbstractImplementationArtifact ia : candidate.ias) { - for (final IPlanBuilderProvPhaseOperationPlugin plugin : provPlugins) { - if (chain.nodeTemplate != null) { - if (plugin.canHandle(ia.getArtifactType()) - && BPELScopeBuilder.getOperationForIa(chain.nodeTemplate, ia) != null) { - - provCandidate.add(BPELScopeBuilder.getOperationForIa(chain.nodeTemplate, ia), ia, plugin); - } - } else { - if (plugin.canHandle(ia.getArtifactType()) - && BPELScopeBuilder.getOperationForIa(chain.relationshipTemplate, ia) != null) { - provCandidate.add(BPELScopeBuilder.getOperationForIa(chain.relationshipTemplate, ia), ia, - plugin); - } - } - } - } - if (chain.nodeTemplate != null) { - if (provCandidate.isValid(chain.nodeTemplate)) { - candidates.add(provCandidate); - } - } else { - if (provCandidate.isValid(chain.relationshipTemplate)) { - candidates.add(provCandidate); - } - } - - } - chain.provCandidates = candidates; - } - - /** - * Returns the Operation which is implemented by the given IA - * - * @param nodeTemplate an AbstractNodeTemplate - * @param ia an AbstractImplementationArtifact - * @return AbstractOperation of the NodeTemplate if the given IA implements it, else null - */ - private static AbstractOperation getOperationForIa(final AbstractNodeTemplate nodeTemplate, - final AbstractImplementationArtifact ia) { - - if (ia.getInterfaceName() != null & ia.getOperationName() == null) { - return new InterfaceDummy(nodeTemplate, ia); - } - - for (final AbstractInterface iface : nodeTemplate.getType().getInterfaces()) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(ia.getOperationName())) { - return op; - } - } - } - return null; - } - - /** - * Returns the Operation which is implemented by the given IA - * - * @param relationshipTemplate an AbstractRelationshipTemplate - * @param ia an AbstractImplementationArtifact - * @return AbstractOperation of the RelationshipTemplate if the given IA implements it, else null - */ - private static AbstractOperation getOperationForIa(final AbstractRelationshipTemplate relationshipTemplate, - final AbstractImplementationArtifact ia) { - return getOperationForIa(relationshipTemplate, ia, ia.getOperationName()); - } - - private static AbstractOperation getOperationForIa(final AbstractRelationshipTemplate relationshipTemplate, - final AbstractImplementationArtifact ia, - final String operationNameFallback) { - String name = ia.getOperationName(); - if (name == null) { - name = operationNameFallback; - } - - for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getSourceInterfaces()) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(name)) { - return op; - } - } - } - for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getTargetInterfaces()) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(name)) { - return op; - } - } - } - for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getInterfaces()) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(name)) { - return op; - } - } - } - return null; - } - - /** - * Calculates correct mappings of the given NodeTypeImplementations, PrePhaseDAPlugins and - * InfrastructureNodes for the given ProvisioningChain - * - * @param impls a List of NodeTypeImplementations - * @param plugins a List of PrePhaseDAPlugins - * @param infraNodes a List of InfrastructureNode of the NodeTemplate the NodeTypeImplementations - * belong to - * @param chain a ProvisioningChain where the candidates are added to - */ - private static void calculateBestImplementationDACandidates(final AbstractNodeTemplate nodeTemplate, - final List impls, - final List> plugins, - final List infraNodes, - final OperationChain chain) { - final List candidates = new ArrayList<>(); - - for (final AbstractNodeTypeImplementation impl : impls) { - BPELScopeBuilder.LOG.debug("Checking DAs of NodeTypeImpl {} and NodeTemplate {}", impl.getName(), - nodeTemplate.getId()); - final DANodeTypeImplCandidate candidate = new DANodeTypeImplCandidate(nodeTemplate, impl); - - final List effectiveDAs = - BPELScopeBuilder.calculateEffectiveDAs(nodeTemplate, impl); - - for (final AbstractDeploymentArtifact da : effectiveDAs) { - BPELScopeBuilder.LOG.debug("Checking whether DA {} can be deployed", da.getName()); - for (final AbstractNodeTemplate infraNode : infraNodes) { - BPELScopeBuilder.LOG.debug("Checking if DA {} can be deployed on InfraNode {}", da.getName(), - infraNode.getId()); - for (final IPlanBuilderPrePhaseDAPlugin plugin : plugins) { - BPELScopeBuilder.LOG.debug("Checking with Plugin {}", plugin.getID()); - if (plugin.canHandle(da, infraNode.getType())) { - BPELScopeBuilder.LOG.debug("Adding Plugin, can handle DA on InfraNode"); - candidate.add(da, infraNode, plugin); - } - } - } - } - if (candidate.isValid()) { - BPELScopeBuilder.LOG.debug("Generated Candidate was valid, adding to all Candidates"); - candidates.add(candidate); - } else { - BPELScopeBuilder.LOG.debug("Generated Candidate was invalid, don't add to all Candidates"); - } - } - chain.daCandidates = candidates; - } - - /** - * Searches for NodeTypeImplementations where all IA's can be provisioned by some plugin in the - * system. - * - * @param impls all implementations of single nodetype - * @param plugins all plugins possibly capable of working with the ia's contained in a - * nodetypeImplementation - * @param infraNodes all infrastructure nodes of the nodetemplate the nodetypeimplementations - * originate from - * @return a list of Wrapper class Object which contain information of which ia is provisioned on - * which infrastructure by which plugin - */ - private static void calculateBestImplementationIACandidates(final List impls, - final List> plugins, - final List infraNodes, - final OperationChain chain, final String interfaceName, - final String operationName) { - - final List candidates = new ArrayList<>(); - // cycle through all implementations - for (final AbstractNodeTypeImplementation impl : impls) { - final IANodeTypeImplCandidate candidate = new IANodeTypeImplCandidate(impl); - // match the ias of the implementation with the infrastructure nodes - for (final AbstractImplementationArtifact ia : impl.getImplementationArtifacts()) { - if (!ia.getInterfaceName().trim().equals(interfaceName.trim())) { - continue; - } - if (ia.getOperationName() != null && !ia.getOperationName().trim().equals(operationName.trim())) { - continue; - } - - BPELScopeBuilder.LOG.debug("Checking whether IA {} can be deployed on a specific Infrastructure Node", - ia.getName()); - for (final AbstractNodeTemplate infraNode : infraNodes) { - // check if any plugin can handle installing the ia on the - // infraNode - for (final IPlanBuilderPrePhaseIAPlugin plugin : plugins) { - if (plugin.canHandle(ia, infraNode.getType())) { - candidate.add(ia, infraNode, plugin); - } - } - } - } - // check if all ias of the implementation can be provisioned - if (candidate.isValid(interfaceName, operationName)) { - candidates.add(candidate); - BPELScopeBuilder.LOG.debug("IA Candidate is valid, adding to candidate list"); - } else { - BPELScopeBuilder.LOG.debug("IA Candidate is invalid, discarding candidate"); - } - } - chain.iaCandidates = candidates; - } - - /** - * Searches for NodeTypeImplementations where all IA's can be provisioned by some plugin in the - * system. - * - * @param impls all implementations of single nodetype - * @param plugins all plugins possibly capable of working with the ia's contained in a - * nodetypeImplementation - * @param infraNodes all infrastructure nodes of the nodetemplate the nodetypeimplementations - * originate from - * @return a list of Wrapper class Object which contain information of which ia is provisioned on - * which infrastructure by which plugin - */ - private static void calculateBestImplementationIACandidates(final List impls, - final List> plugins, - final List infraNodes, - final OperationChain chain) { - - final List candidates = new ArrayList<>(); - // cycle through all implementations - for (final AbstractNodeTypeImplementation impl : impls) { - final IANodeTypeImplCandidate candidate = new IANodeTypeImplCandidate(impl); - // match the ias of the implementation with the infrastructure nodes - for (final AbstractImplementationArtifact ia : impl.getImplementationArtifacts()) { - BPELScopeBuilder.LOG.debug("Checking whether IA {} can be deployed on a specific Infrastructure Node", - ia.getName()); - for (final AbstractNodeTemplate infraNode : infraNodes) { - // check if any plugin can handle installing the ia on the - // infraNode - for (final IPlanBuilderPrePhaseIAPlugin plugin : plugins) { - if (plugin.canHandle(ia, infraNode.getType())) { - candidate.add(ia, infraNode, plugin); - } - } - } - } - // check if all ias of the implementation can be provisioned - if (candidate.isValid()) { - candidates.add(candidate); - BPELScopeBuilder.LOG.debug("IA Candidate is valid, adding to candidate list"); - } else { - BPELScopeBuilder.LOG.debug("IA Candidate is invalid, discarding candidate"); - } - } - chain.iaCandidates = candidates; - } - - /** - * Checks whether the IA implements a SourceInterfaceOperation - * - * @param ia the IA to check with - * @param relationshipTemplate the RelationshipTemplate to check with - * @return true if the IA implements a Operation inside a SourceInterface of the - * RelationshipTemplate - */ - private static boolean checkIfIaImplementsSrcIface(final AbstractImplementationArtifact ia, - final AbstractRelationshipTemplate relationshipTemplate) { - - for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getSourceInterfaces()) { - if (iface.getName().equals(ia.getInterfaceName())) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(ia.getOperationName())) { - return true; - } - } - } - } - return false; - } - - /** - * Calculates correct mappings for the given RelationshipTypeImplementations with the given Plugins - * and InfraNodes - * - * @param impls a List of RelationshipTypeImplementation - * @param plugins a List of PrePhaseIAPlugins - * @param infraNodes a List of InfrastructureNodes which belong to the RelationshipTemplate the - * given Implementation belong to - * @param chain a ProvisioningChain to save the results - * @param forSource whether the calculation is done for the SourceInterface or for the - * TargetInterface - */ - private static void calculateBestImplementationRelationIACandidates(final List impls, - final List> plugins, - final List infraNodes, - final OperationChain chain, - final boolean forSource) { - final List candidates = new ArrayList<>(); - for (final AbstractRelationshipTypeImplementation impl : impls) { - final IANodeTypeImplCandidate candidate = new IANodeTypeImplCandidate(impl); - for (final AbstractImplementationArtifact ia : impl.getImplementationArtifacts()) { - if (forSource) { - // check if ia implements source interfaces - if (!BPELScopeBuilder.checkIfIaImplementsSrcIface(ia, chain.relationshipTemplate)) { - continue; - } - } else { - if (BPELScopeBuilder.checkIfIaImplementsSrcIface(ia, chain.relationshipTemplate)) { - continue; - } - } - - for (final AbstractNodeTemplate infraNode : infraNodes) { - for (final IPlanBuilderPrePhaseIAPlugin plugin : plugins) { - if (plugin.canHandle(ia, infraNode.getType())) { - candidate.add(ia, infraNode, plugin); - } - } - } - } - if (candidate.isValid()) { - candidates.add(candidate); - } - } - chain.iaCandidates = candidates; - - } - - /** - * Calculates a list of DA's containing an effective set of DA combining the DA's from the given - * NodeImplementation and NodeTemplates according to the TOSCA specification. - * - * @param nodeTemplate the NodeTemplate the NodeImplementations belongs to - * @param nodeImpl a NodeTypeImplementation for the given NodeTemplate - * @return a possibly empty list of AbstractDeploymentArtifacts - */ - static List calculateEffectiveDAs(final AbstractNodeTemplate nodeTemplate, - final AbstractNodeTypeImplementation nodeImpl) { - final List effectiveDAs = new ArrayList<>(); - - final List nodeImplDAs = nodeImpl.getDeploymentArtifacts(); - final List nodeTemplateDAs = nodeTemplate.getDeploymentArtifacts(); - - for (final AbstractDeploymentArtifact templateDa : nodeTemplateDAs) { - boolean overridesDA = false; - int daIndex = -1; - for (int i = 0; i < nodeImplDAs.size(); i++) { - final AbstractDeploymentArtifact nodeImplDa = nodeImplDAs.get(i); - - if (nodeImplDa.getName().equals(templateDa.getName()) - & nodeImplDa.getArtifactType().equals(nodeImplDa.getArtifactType())) { - overridesDA = true; - daIndex = i; - } - } - - if (overridesDA) { - nodeImplDAs.remove(daIndex); - } - } - - effectiveDAs.addAll(nodeTemplateDAs); - effectiveDAs.addAll(nodeImplDAs); - - return effectiveDAs; - } -} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/fragments/BPELProcessFragments.java b/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/fragments/BPELProcessFragments.java deleted file mode 100644 index 74ad1125b..000000000 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/fragments/BPELProcessFragments.java +++ /dev/null @@ -1,1147 +0,0 @@ -package org.opentosca.planbuilder.core.bpel.fragments; - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; -import org.opentosca.planbuilder.core.bpel.typebasedplanbuilder.BPELFreezeProcessBuilder; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan.VariableType; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicy; -import org.osgi.framework.FrameworkUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.Text; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class BPELProcessFragments { - - private final static Logger LOG = LoggerFactory.getLogger(BPELProcessFragments.class); - - private final DocumentBuilderFactory docFactory; - private final DocumentBuilder docBuilder; - - /** - * Constructor - * - * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails - */ - public BPELProcessFragments() throws ParserConfigurationException { - this.docFactory = DocumentBuilderFactory.newInstance(); - this.docFactory.setNamespaceAware(true); - this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } - - public String loadFragmentResourceAsString(final String fileName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getResource(fileName); - final File bpelfragmentfile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelfragmentfile); - return template; - } - - public Node transformStringToNode(String xmlString) throws SAXException, IOException { - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(xmlString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String createAssignVarWithLiteral(final String literal, final String varName, - final String intent) throws IOException { - String template = this.loadFragmentResourceAsString("assignVarWithLiteral.xml"); - template = template.replaceAll("\\$literal", literal); - template = template.replaceAll("\\$VarName", varName); - template = template.replaceAll("\\$intent", intent); - return template; - } - - public Node createAssignTransformXmltoString(final BPELPlan plan, final String xmlVar, final String stringVar, - final Element elementToAppendBefore, String rootElementName) throws IOException, - SAXException { - final String xpathQuery1 = "ode:dom-to-string(\\$" + xmlVar + "/*[local-name()='"+rootElementName+ "'])"; - final String xpathQuery2 = "\\$" + stringVar; - - Node assign = - this.createAssignVarToVarWithXpathQueriesAsNode("transformXMLtoStringVar", xmlVar, null, - stringVar, null, xpathQuery1, xpathQuery2, - "Transforms one xml var to a string var as ODE sets a an xml element as wrapper around complex type when using the rest extension.", - new QName( - "http://www.apache.org/ode/type/extension", - "ode", "ode")); - - return assign; - - } - - public Node createAssignVarWithLiteralAsNode(final String literal, final String varName, - final String intent) throws IOException, SAXException { - final String templateString = createAssignVarWithLiteral(literal, varName, intent); - return this.transformStringToNode(templateString); - } - - /** - * Create a BPEL assign that copies the NodeInstanceURL from a NodeInstances Query (See - * {@link #createRESTExtensionGETForNodeInstanceDataAsNode(String, String, String, String, boolean)} - * - * @param assignName the name of the assign - * @param stringVarName the name of the xsd:string variable to write the NodeInstanceId into - * @param nodeInstanceResponseVarName the instanceDataAPI response to fetch the NodeInstanceId from - * @return a Node containing a BPEL assign activity - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node createAssign2FetchNodeInstanceIDFromInstanceDataAPIResponseAsNode(final String assignName, - final String stringVarName, - final String nodeInstanceResponseVarName) throws SAXException, - IOException { - final String templateString = - createAssign2FetchNodeInstanceIDFromInstanceDataAPIResponseAsString(assignName, stringVarName, - nodeInstanceResponseVarName); - return this.transformStringToNode(templateString); - } - - public Node createAssignVarToVarWithXpathQueryAsNode(final String assignName, final String fromVarName, - final String toVarName, - final String xpathQuery) throws IOException, SAXException { - final String templateString = - createAssignVarToVarWithXPathQuery(assignName, fromVarName, toVarName, xpathQuery); - return this.transformStringToNode(templateString); - } - - - - - public String createAssignAndPostSituationMonitor(Map> situationPolicies, - Map policy2IdMap , String serviceTemplateInstanceUrlVarName, String anyVarName, String requestVarName) throws IOException { - String template = this.loadFragmentResourceAsString("BPELMonitoringSituation.xml"); - - String situationIdRequestBody = ""; - String copyFromInputToRequestBody = ""; - - /* - * - - - - - - - */ - - for(AbstractNodeTemplate node : situationPolicies.keySet()) { - String nodeTemplateId = node.getId(); - List policies = new ArrayList(situationPolicies.get(node)); - - situationIdRequestBody += ""+nodeTemplateId+""; - for(int i = 0; i< policies.size();i++) { - AbstractPolicy policy = policies.get(i); - String inputLocalName = policy2IdMap.get(policy); - - situationIdRequestBody += ""; - copyFromInputToRequestBody += ""; - } - situationIdRequestBody += ""; - } - - -// for(int i = 0; i < situationIdInputLocalNames.size() ; i++) { -// String inputLocalName = situationIdInputLocalNames.get(i); -// situationIdRequestBody += ""; -// -// -// copyFromInputToRequestBody += ""; -// } - - template = template.replace("$SituationIds", situationIdRequestBody); - template = template.replace("$situationIdFromInputCopies", copyFromInputToRequestBody); - template = template.replace("$anyVar", anyVarName); - template = template.replace("$requestVar", requestVarName); - template = template.replace("$urlVarName", serviceTemplateInstanceUrlVarName); - - - return template; - } - - public Node createAssignAndPostSituationMonitorAsNode(Map> situationPolicies, - Map policy2IdMap , String serviceTemplateInstanceUrlVarName, String anyVarName, String requestVarName) throws SAXException, IOException { - final String templateString = this.createAssignAndPostSituationMonitor(situationPolicies, policy2IdMap, serviceTemplateInstanceUrlVarName, anyVarName, requestVarName); - return this.transformStringToNode(templateString); - } - - public String createAssignVarToVarWithXPathQuery(final String assignName, final String fromVarName, - final String toVarName, - final String xpathQuery) throws IOException { - // - String template = this.loadFragmentResourceAsString("assignVarFromVarWithXpath2Query.xml"); - template = template.replaceAll("\\$assignName", assignName); - template = template.replaceAll("\\$fromVarName", fromVarName); - template = template.replaceAll("\\$toVarName", toVarName); - template = template.replace("$xpath2query", xpathQuery); - return template; - } - - public Node createHTTPPOST(final String urlVarName, final String requestVarName, - final String responseVarName) throws IOException, SAXException { - String template = - this.loadFragmentResourceAsString("BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml"); - template = template.replaceAll("\\$InstanceDataURLVar", urlVarName); - template = template.replaceAll("\\$RequestVarName", requestVarName); - template = template.replaceAll("\\$ResponseVarName", responseVarName); - return this.transformStringToNode(template); - } - - public Node createHTTPPOST(final String urlVarName, final String responseVarName) throws IOException, SAXException { - String template = this.loadFragmentResourceAsString("BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml"); - template = template.replaceAll("\\$InstanceDataURLVar", urlVarName); - template = template.replaceAll("\\$ResponseVarName", responseVarName); - return this.transformStringToNode(template); - } - - public String createAssignVarToVarWithXpathQueries(final String assignName, final String fromVarName, - final String part1, final String toVarName, final String part2, - final String xpathQuery1, final String xpathQuery2, - final String intent, final QName extension) throws IOException { - String template = this.loadFragmentResourceAsString("assignVarFromVarWithXpath2Queries.xml"); - template = template.replaceAll("\\$assignName", assignName); - template = template.replaceAll("\\$fromVarName", fromVarName); - template = template.replaceAll("\\$toVarName", toVarName); - template = template.replace("$xpath2query1", xpathQuery1); - if (part1 != null) { - template = template.replaceAll("\\$part1", "part=\"" + part1 + "\""); - } else { - template = template.replaceAll("\\$part1", ""); - } - template = template.replace("$xpath2query2", xpathQuery2); - - if (part2 != null) { - template = template.replaceAll("\\$part2", "part=\"" + part2 + "\""); - } else { - template = template.replaceAll("\\$part2", ""); - } - template = template.replaceAll("\\$intent", intent); - - if (extension != null) { - template = - template.replaceAll("\\$extension", - "xmlns:" + extension.getPrefix() + "=\"" + extension.getNamespaceURI() + "\""); - } else { - template = template.replaceAll("\\$extension", ""); - } - return template; - } - - public Node createAssignVarToVarWithXpathQueriesAsNode(final String assignName, final String fromVarName, - final String part1, final String toVarName, - final String part2, final String xpathQuery1, - final String xpathQuery2, final String intent, - final QName extension) throws IOException, SAXException { - final String templateString = - createAssignVarToVarWithXpathQueries(assignName, fromVarName, part1, toVarName, part2, xpathQuery1, - xpathQuery2, intent, extension); - return this.transformStringToNode(templateString); - } - - /** - * Create a BPEL assign that copies the NodeInstanceURL from a NodeInstances Query (See - * {@link #createRESTExtensionGETForNodeInstanceDataAsNode(String, String, String, String, boolean)} - * - * @param assignName the name of the assign - * @param stringVarName the name of the xsd:string variable to write the NodeInstanceId into - * @param nodeInstanceResponseVarName the instanceDataAPI response to fetch the NodeInstanceId from - * @return a String containing a BPEL assign activity - * @throws IOException is thrown when reading internal files fails - */ - public String createAssign2FetchNodeInstanceIDFromInstanceDataAPIResponseAsString(final String assignName, - final String stringVarName, - final String nodeInstanceResponseVarName) throws IOException { - // - String template = this.loadFragmentResourceAsString("BpelAssignFromNodeInstanceRequestToStringVar.xml"); - template = template.replace("$assignName", assignName); - template = template.replace("$stringVarName", stringVarName); - template = template.replace("$NodeInstanceResponseVarName", nodeInstanceResponseVarName); - return template; - } - - /** - * Creates a BPEL assign activity that reads the property values from a NodeInstance Property - * response and sets the given variables - * - * @param assignName the name of the assign activity - * @param nodeInstancePropertyResponseVarName the name of the variable holding the property data - * @param propElement2BpelVarNameMap a Map from DOM Elements (representing Node Properties) to BPEL - * variable names - * @return a Node containing a BPEL assign activity - * @throws IOException is thrown when reading internal files fail - * @throws SAXException is thrown when parsing internal files fail - */ - public Node createAssignFromInstancePropertyToBPELVariableAsNode(final String assignName, - final String nodeInstancePropertyResponseVarName, - final Map propElement2BpelVarNameMap) throws IOException, - SAXException { - final String templateString = - createAssignFromInstancePropertyToBPELVariableAsString(assignName, nodeInstancePropertyResponseVarName, - propElement2BpelVarNameMap); - return this.transformStringToNode(templateString); - } - - /** - * Creates a BPEL assign activity that reads the property values from a NodeInstance Property - * response and sets the given variables - * - * @param assignName the name of the assign activity - * @param nodeInstancePropertyResponseVarName the name of the variable holding the property data - * @param propElement2BpelVarNameMap a Map from DOM Elements (representing Node Properties) to BPEL - * variable names - * @return a String containing a BPEL assign activity - * @throws IOException is thrown when reading internal files fail - */ - public String createAssignFromInstancePropertyToBPELVariableAsString(final String assignName, - final String nodeInstancePropertyResponseVarName, - final Map propElement2BpelVarNameMap) throws IOException { - final String template = this.loadFragmentResourceAsString("BpelCopyFromPropertyVarToNodeInstanceProperty.xml"); - - String assignString = - ""; - - // - for (final Element propElement : propElement2BpelVarNameMap.keySet()) { - String copyString = template.replace("$PropertyVarName", propElement2BpelVarNameMap.get(propElement)); - copyString = copyString.replace("$NodeInstancePropertyRequestVarName", nodeInstancePropertyResponseVarName); - copyString = copyString.replace("$NodeInstancePropertyLocalName", propElement.getLocalName()); - copyString = copyString.replace("$NodeInstancePropertyNamespace", propElement.getNamespaceURI()); - assignString += copyString; - } - - assignString += ""; - - BPELProcessFragments.LOG.debug("Generated following assign string:"); - BPELProcessFragments.LOG.debug(assignString); - - return assignString; - } - - public String createAssignSelectFirstRelationInstanceFromResponse(final String referencesResponseVarName, final String resultVarName) throws IOException { - String bpelAssignString = - this.loadFragmentResourceAsString("BpelAssignSelectFromRelationInstancesRequestToStringVar.xml"); - - bpelAssignString = - bpelAssignString.replaceAll("\\$assignName", "assignSelectFirstReference" + System.currentTimeMillis()); - bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", resultVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$NodeInstancesResponseVarName", referencesResponseVarName); - return bpelAssignString; - } - - public Node createAssignSelectFirstRelationInstanceFromResponseAsNode(final String referencesResponseVarName, final String resultVarName) throws SAXException, IOException { - final String templateString = this.createAssignSelectFirstRelationInstanceFromResponse(referencesResponseVarName, resultVarName); - return this.transformStringToNode(templateString); - } - - public String createAssignSelectFirstNodeInstanceAndAssignToStringVar(final String referencesResponseVarName, - final String stringVarName) throws IOException { - // BpelAssignSelectFromNodeInstancesRequestToStringVar.xml - // - String bpelAssignString = - this.loadFragmentResourceAsString("BpelAssignSelectFromNodeInstancesRequestToStringVar.xml"); - - bpelAssignString = - bpelAssignString.replaceAll("\\$assignName", "assignSelectFirstReference" + System.currentTimeMillis()); - bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", stringVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$NodeInstancesResponseVarName", referencesResponseVarName); - return bpelAssignString; - } - - public Node createAssignSelectFirstNodeInstanceAndAssignToStringVarAsNode(final String referencesResponseVarName, - final String stringVarName) throws IOException, - SAXException { - final String templateString = - createAssignSelectFirstNodeInstanceAndAssignToStringVar(referencesResponseVarName, stringVarName); - return this.transformStringToNode(templateString); - } - - public Node createIfTrueThrowsError(final String xpath, final QName faultName) { - final Document doc = this.docBuilder.newDocument(); - - final Element ifElement = doc.createElementNS(BPELPlan.bpelNamespace, "if"); - - final Element conditionElement = doc.createElementNS(BPELPlan.bpelNamespace, "condition"); - - conditionElement.setAttribute("expressionLanguage", BPELPlan.xpath2Namespace); - - final Text textSectionValue = doc.createTextNode(xpath); - conditionElement.appendChild(textSectionValue); - - ifElement.appendChild(conditionElement); - - final Element throwElement = doc.createElementNS(BPELPlan.bpelNamespace, "throw"); - - final String nsPrefix = "ns" + System.currentTimeMillis(); - - throwElement.setAttribute("xmlns:" + nsPrefix, faultName.getNamespaceURI()); - - throwElement.setAttribute("faultName", nsPrefix + ":" + faultName.getLocalPart()); - - ifElement.appendChild(throwElement); - - return ifElement; - } - - public Node createWaitForCondition(String xpathExpr, String durationExpression) throws IOException, SAXException { - String templateString = this.loadFragmentResourceAsString("BPELWaitTillTrue.xml"); - - templateString = templateString.replace("$xpath1Expr", xpathExpr); - templateString = templateString.replace("$durationexpression", durationExpression); - - - return this.transformStringToNode(templateString); - } - - /** - * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String - * variable. - * - * @param assignName the name of the BPEL assign - * @param xpath2Query the xPath query - * @param stringVarName the variable to load the queries results into - * @return a DOM Node representing a BPEL assign element - * @throws IOException is thrown when loading internal bpel fragments fails - * @throws SAXException is thrown when parsing internal format into DOM fails - */ - public Node createAssignXpathQueryToStringVarFragmentAsNode(final String assignName, final String xpath2Query, - final String stringVarName) throws IOException, - SAXException { - final String templateString = - createAssignXpathQueryToStringVarFragmentAsString(assignName, xpath2Query, stringVarName); - return this.transformStringToNode(templateString); - } - - /** - * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String - * variable. - * - * @param assignName the name of the BPEL assign - * @param xpath2Query the csarEntryPoint XPath query - * @param stringVarName the variable to load the queries results into - * @return a String containing a BPEL Assign element - * @throws IOException is thrown when reading the BPEL fragment form the resources fails - */ - public String createAssignXpathQueryToStringVarFragmentAsString(final String assignName, final String xpath2Query, - final String stringVarName) throws IOException { - // - String template = this.loadFragmentResourceAsString("assignStringVarWithXpath2Query.xml"); - template = template.replace("{AssignName}", assignName); - template = template.replace("{xpath2query}", xpath2Query); - template = template.replace("{stringVarName}", stringVarName); - return template; - } - - public Node createBPEL4RESTLightNodeInstancesGETAsNode(final String nodeTemplateId, - final String serviceInstanceIdVarName, - final String responseVarName) throws IOException, - SAXException { - final String templateString = - createBPEL4RESTLightNodeInstancesGETAsString(nodeTemplateId, serviceInstanceIdVarName, responseVarName); - return this.transformStringToNode(templateString); - } - - public String createBPEL4RESTLightNodeInstancesGETAsString(final String nodeTemplateId, - final String serviceInstanceIdVarName, - final String responseVarName) throws IOException { - // - String template = this.loadFragmentResourceAsString("BPEL4RESTLightGET_NodeInstances_InstanceDataAPI.xml"); - template = template.replace("$serviceInstanceURLVar", serviceInstanceIdVarName); - template = template.replace("$ResponseVarName", responseVarName); - template = template.replace("$nodeTemplateId", nodeTemplateId); - return template; - } - - public String createBPEL4RESTLightPlanInstanceLOGsPOST(final String urlVarName, - final String stringVarNameWithLogContent, - final String unassignedLogReqMessage) throws IOException { - // BPEL4RESTLightPOST_PlanInstance_Logs.xml - // - String template = this.loadFragmentResourceAsString("BPEL4RESTLightPOST_PlanInstance_Logs.xml"); - template = template.replaceAll("\\$urlVarName", urlVarName); - template = template.replaceAll("\\$requestVar", unassignedLogReqMessage); - template = template.replaceAll("\\$contentStringVar", stringVarNameWithLogContent); - return template; - } - - public Node createBPEL4RESTLightPlanInstanceLOGsPOSTAsNode(final String urlVarName, - final String stringVarNameWithLogContent, - final String unassignedLogReqMessage) throws IOException, - SAXException { - final String templateString = - createBPEL4RESTLightPlanInstanceLOGsPOST(urlVarName, stringVarNameWithLogContent, unassignedLogReqMessage); - return this.transformStringToNode(templateString); - } - - public String createBPEL4RESTLightPUTState(final String instanceURLVarName, - final String requestVarName) throws IOException { - // - String template = this.loadFragmentResourceAsString("BPEL4RESTLightPUTInstanceState.xml"); - template = template.replace("$urlVarName", instanceURLVarName); - template = template.replace("$requestVar", requestVarName); - return template; - } - - public Node createBPEL4RESTLightPutStateAsNode(final String instanceURLVarName, - final String requestVarName) throws IOException, SAXException { - final String templateString = createBPEL4RESTLightPUTState(instanceURLVarName, requestVarName); - return this.transformStringToNode(templateString); - } - - public Node createBPEL4RESTLightRelationInstancesGETAsNode(final String relationshipTemplateId, - final String serviceInstanceIdVarName, - final String responseVarName) throws IOException, - SAXException { - final String templateString = - createBPEL4RESTLightRelationInstancesGETAsString(relationshipTemplateId, serviceInstanceIdVarName, - responseVarName); - return this.transformStringToNode(templateString); - } - - public String createBPEL4RESTLightRelationInstancesGETAsString(final String relationshipTemplateId, - final String serviceInstanceIdVarName, - final String responseVarName) throws IOException { - // - String template = this.loadFragmentResourceAsString("BPEL4RESTLightGET_RelationInstances_InstanceDataAPI.xml"); - template = template.replace("$serviceInstanceURLVar", serviceInstanceIdVarName); - template = template.replace("$ResponseVarName", responseVarName); - template = template.replace("relationshipTemplateId", relationshipTemplateId); - return template; - } - - public Node createBPEL4RESTLightRelationInstancesTargetNodeInstanceQueryGETAsNode(final String serviceInstanceIdVarName, - final String relationshipTemplateId, - final String responseVarName, - final String nodeInstanceIdVarName) throws IOException, - SAXException { - final String templateString = - createBPEL4RESTLightRelationInstancesTargetNodeInstanceQueryGETAsString(serviceInstanceIdVarName, - relationshipTemplateId, - responseVarName, - nodeInstanceIdVarName); - return this.transformStringToNode(templateString); - } - - public String createBPEL4RESTLightRelationInstancesTargetNodeInstanceQueryGETAsString(final String serviceTemplateUrlVarName, - final String relationshipTemplateId, - final String responseVarName, - final String nodeInstanceIdVarName) throws IOException { - // BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml - // - String template = - this.loadFragmentResourceAsString("BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml"); - - // - - template = template.replace("$ServiceTemplateURLVarKeyword", serviceTemplateUrlVarName); - template = template.replace("$relationshipTemplateId", relationshipTemplateId); - template = template.replace("$ResponseVarName", responseVarName); - template = template.replace("$nodeInstanceIdVarName", nodeInstanceIdVarName); - return template; - } - - /** - * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. - * - * @param bpelVarName the variable containing an URL - * @param responseVarName the variable to hold the response - * @return a String containing a BPEL4RESTLight Activity - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node createRESTDeleteOnURLBPELVarAsNode(final String bpelVarName, - final String responseVarName) throws IOException, SAXException { - final String templateString = createRESTDeleteOnURLBPELVarAsString(bpelVarName, responseVarName); - return this.transformStringToNode(templateString); - } - - /** - * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. - * - * @param bpelVarName the variable containing an URL - * @param responseVarName the variable to hold the response - * @return a String containing a BPEL4RESTLight Activity - * @throws IOException is thrown when reading internal files fails - */ - public String createRESTDeleteOnURLBPELVarAsString(final String bpelVarName, - final String responseVarName) throws IOException { - String template = this.loadFragmentResourceAsString("BPEL4RESTLightDELETE.xml"); - template = template.replace("$urlVarName", bpelVarName); - template = template.replace("$ResponseVarName", responseVarName); - return template; - } - - /** - * Creates a Node containing a BPEL fragment which uses the BPELRESTExtension to fetch the - * InstanceData from an OpenTOSCA Container instanceDataAPI - * - * @param serviceTemplateUrlVar the name of the variable holding an URL to a serviceTemplate - * @param responseVarName the name of the variable holding the response of the request (must be - * xsd:anyType) - * @param templateId the id of the template the instance belongs to - * @param serviceInstanceUrlVarName the name of the variable holding the id/link of the - * serviceInstance - * @param isNodeTemplate whether the given tmeplateId belongs to a NodeTemplate or - * RelationshipTemplate - * @return a Node containing a BPEL Fragment - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node createRESTExtensionGETForNodeInstanceDataAsNode(final String serviceTemplateUrlVar, - final String responseVarName, final String templateId, - final String query) throws SAXException, IOException { - final String templateString = - createRESTExtensionGETForNodeInstanceDataAsString(serviceTemplateUrlVar, responseVarName, templateId, - query); - return this.transformStringToNode(templateString); - } - - /** - * Creates a String containing a BPEL fragment which uses the BPELRESTExtension to fetch the - * InstanceData from an OpenTOSCA Container instanceDataAPI - * - * @param serviceTemplateUrlVar the name of the variable holding an URL to a serviceTemplate - * @param responseVarName the name of the variable holding the response of the request (must be - * xsd:anyType) - * @param templateId the id of the template the instance belongs to - * @param serviceInstanceUrlVarName the name of the variable holding the id/link of the - * serviceInstance - * @param isNodeTemplate whether the given tmeplateId belongs to a NodeTemplate or - * RelationshipTemplate - * @return a String containing a BPEL Fragment - * @throws IOException is thrown when reading internal files fails - */ - public String createRESTExtensionGETForNodeInstanceDataAsString(final String serviceTemplateUrlVar, - final String responseVarName, - final String templateId, - final String query) throws IOException { - // - - // - String template = this.loadFragmentResourceAsString("BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml"); - template = template.replaceAll("\\$InstanceDataURLVar", serviceTemplateUrlVar); - template = template.replaceAll("\\$ResponseVarName", responseVarName); - template = template.replaceAll("\\$templateId", templateId); - - if (query != null) { - template = template.replace("?query", query); - } else { - template = template.replace("?query", ""); - } - - return template; - } - - public Node createRESTExtensionGETForRelationInstanceDataAsNode(final String serviceTemplateUrlVar, - final String responseVarName, - final String templateId, - final String query) throws SAXException, IOException { - final String templateString = - createRESTExtensionGETForRelationInstanceDataAsString(serviceTemplateUrlVar, responseVarName, templateId, - query); - return this.transformStringToNode(templateString); - } - - public String createRESTExtensionGETForRelationInstanceDataAsString(final String serviceTemplateUrlVar, - final String responseVarName, - final String templateId, - final String query) throws IOException { - String template = this.loadFragmentResourceAsString("BPEL4RESTLightGET_RelationInstance_InstanceDataAPI.xml"); - template = template.replaceAll("\\$InstanceDataURLVar", serviceTemplateUrlVar); - template = template.replaceAll("\\$ResponseVarName", responseVarName); - template = template.replaceAll("\\$templateId", templateId); - - if (query != null) { - template = template.replace("?query", query); - } else { - template = template.replace("?query", ""); - } - - return template; - } - - /** - * Creates a RESTExtension GET to fetch properties of NodeInstance - * - * @param nodeInstanceIDUrl the name of the variable holding the address to the nodeInstance - * @param responseVarName the name of the variable to store the response into - * @return a Node containing a BPEL RESTExtension Activity - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node createRESTExtensionGETForInstancePropertiesAsNode(final String nodeInstanceIDUrl, - final String responseVarName) throws IOException, - SAXException { - final String templateString = - createRESTExtensionGETForInstancePropertiesAsString(nodeInstanceIDUrl, responseVarName); - return this.transformStringToNode(templateString); - } - - /** - * Creates a RESTExtension GET to fetch properties of NodeInstance - * - * @param nodeInstanceIDUrl the name of the variable holding the address to the nodeInstance - * @param responseVarName the name of the variable to store the response into - * @return a String containing a BPEL RESTExtension Activity - * @throws IOException is thrown when reading internal files fails - */ - public String createRESTExtensionGETForInstancePropertiesAsString(final String nodeInstanceIDUrl, - final String responseVarName) throws IOException { - // - String template = this.loadFragmentResourceAsString("BPEL4RESTLightGET_NodeInstance_Properties.xml"); - template = template.replace("$urlVarName", nodeInstanceIDUrl); - template = template.replace("$ResponseVarName", responseVarName); - - return template; - } - - /** - * Returns an XPath Query which contructs a valid String, to GET a File from the openTOSCA API - * - * @param artifactPath a path inside an ArtifactTemplate - * @return a String containing an XPath query - */ - public String createXPathQueryForURLRemoteFilePath(final String artifactPath) { - BPELProcessFragments.LOG.debug("Generating XPATH Query for ArtifactPath: " + artifactPath); - final String filePath = - "string(concat(substring-before($input.payload//*[local-name()='instanceDataAPIUrl']/text(),'/servicetemplates'),'/content/" - + artifactPath + "'))"; - return filePath; - } - - public String generateServiceInstanceRequestMessageAssign(final String inputMessageElementLocalName, - final String anyElementariableName) throws IOException { - String bpelAssignString = - this.loadFragmentResourceAsString("BpelAssignServiceInstanceCorrelationIdPOSTRequest.xml"); - // - bpelAssignString = bpelAssignString.replaceAll("\\$inputElementLocalName", inputMessageElementLocalName); - bpelAssignString = bpelAssignString.replaceAll("\\$StringVariableName", anyElementariableName); - bpelAssignString = - bpelAssignString.replaceAll("\\$assignName", - "assignServiceInstanceCreateRequest" + System.currentTimeMillis()); - return bpelAssignString; - } - - public Node generateServiceInstanceRequestMessageAssignAsNode(final String inputMessageElementLocalName, - final String anyElementariableName) throws IOException, - SAXException { - final String templateString = - generateServiceInstanceRequestMessageAssign(inputMessageElementLocalName, anyElementariableName); - return this.transformStringToNode(templateString); - } - - /** - * Generates an assign activity that fetches the value of the input message and writes it into a - * string variable - * - * @param inputMessageElementLocalName the localName of the element inside the input message - * @param stringVariableName the name of the variable to assign the value to - * @return a String containing a BPEL assign activity - * @throws IOException is thrown when reading internal files fail - */ - public String generateAssignFromInputMessageToStringVariable(final String inputMessageElementLocalName, - final String stringVariableName) throws IOException { - String bpelAssignString = this.loadFragmentResourceAsString("BpelAssignFromInputToStringVar.xml"); - // - bpelAssignString = bpelAssignString.replace("$inputElementLocalName", inputMessageElementLocalName); - bpelAssignString = bpelAssignString.replace("$StringVariableName", stringVariableName); - bpelAssignString = - bpelAssignString.replace("$assignName", "assignFromInputToString" + System.currentTimeMillis()); - return bpelAssignString; - } - - /** - * Generates an assign activity that fetches the value of the input message and writes it into a - * string variable - * - * @param inputMessageElementLocalName the localName of the element inside the input message - * @param stringVariableName the name of the variable to assign the value to - * @return a Node containing a BPEL assign activity - * @throws IOException is thrown when reading internal files fail - * @throws SAXException is thrown when parsing internal files fail - */ - public Node generateAssignFromInputMessageToStringVariableAsNode(final String inputMessageElementLocalName, - final String stringVariableName) throws IOException, - SAXException { - final String templateString = - generateAssignFromInputMessageToStringVariable(inputMessageElementLocalName, stringVariableName); - return this.transformStringToNode(templateString); - } - - public String generateBPEL4RESTLightGETonURL(final String urlVarName, - final String responseVarName) throws IOException { - String bpelAssignString = this.loadFragmentResourceAsString("BPEL4RESTLightGET_URL_ApplicationXML.xml"); - // - bpelAssignString = bpelAssignString.replace("$ResponseVarName", responseVarName); - bpelAssignString = bpelAssignString.replace("$urlVar", urlVarName); - return bpelAssignString; - } - - public Node generateBPEL4RESTLightGETonURLAsNode(final String urlVarName, - final String reponseVarName) throws IOException, SAXException { - final String templateString = generateBPEL4RESTLightGETonURL(urlVarName, reponseVarName); - return this.transformStringToNode(templateString); - } - - /** - * Generates a BPEL POST at the given InstanceDataAPI with the given ServiceTemplate id to create a - * Service Instance - * - * @param instanceDataAPIUrlVariableName the name of the variable holding the address to the - * instanceDataAPI - * @param csarId the name of the csar the serviceTemplate belongs to - * @param serviceTemplateId the id of the serviceTemplate - * @param responseVariableName a name of an anyType variable to save the response into - * @return a String containing a BPEL4RESTLight POST extension activity - * @throws IOException is thrown when reading internal files fail - */ - public String generateBPEL4RESTLightServiceInstancePOST(final String instanceDataAPIUrlVariableName, - final String csarId, final QName serviceTemplateId, - final String responseVariableName) throws IOException { - // tags in xml snippet: $InstanceDataURLVar, $CSARName, - // $serviceTemplateId, $ResponseVarName - - String bpel4RestString = - this.loadFragmentResourceAsString("BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml"); - - bpel4RestString = bpel4RestString.replace("$InstanceDataURLVar", instanceDataAPIUrlVariableName); - bpel4RestString = bpel4RestString.replace("$CSARName", csarId); - bpel4RestString = bpel4RestString.replace("$serviceTemplateId", serviceTemplateId.toString()); - bpel4RestString = bpel4RestString.replace("$ResponseVarName", responseVariableName); - - return bpel4RestString; - } - - public File getOpenTOSCAAPISchemaFile() throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getResource("schemas/opentoscaapischema.xsd"); - final File schemaFile = new File(FileLocator.toFileURL(url).getPath()); - return schemaFile; - } - - public QName getOpenToscaApiCorrelationElementQname() { - return new QName("http://opentosca.org/api", "correlationID"); - } - - public QName getOpenToscaApiCreateRelationshipTemplateInstanceRequestElementQname() { - return new QName("http://opentosca.org/api", "CreateRelationshipTemplateInstanceRequest"); - } - - public QName getOpenToscaApiLogMsgReqElementQName() { - return new QName("http://opentosca.org/api", "log"); - } - - /** - * Generates a BPEL POST at the given InstanceDataAPI with the given ServiceTemplate id to create a - * Service Instance - * - * @param instanceDataAPIUrlVariableName the name of the variable holding the address to the - * instanceDataAPI - * @param csarId the name of the csar the serviceTemplate belongs to - * @param serviceTemplateId the id of the serviceTemplate - * @param responseVariableName a name of an anyType variable to save the response into - * @return a String containing a BPEL4RESTLight POST extension activity - * @throws IOException is thrown when reading internal files fail - */ - public String generateBPEL4RESTLightServiceInstancePOST(final String instanceDataAPIUrlVariableName, - final String requestVariableName, - final String responseVariableName) throws IOException { - // tags in xml snippet: $InstanceDataURLVar, $CSARName, - // $serviceTemplateId, $ResponseVarName - String bpel4RestString = - this.loadFragmentResourceAsString("BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml"); - - bpel4RestString = bpel4RestString.replace("$InstanceDataURLVar", instanceDataAPIUrlVariableName); - bpel4RestString = bpel4RestString.replace("$RequestVarName", requestVariableName); - bpel4RestString = bpel4RestString.replace("$ResponseVarName", responseVariableName); - - return bpel4RestString; - } - - /** - * Generates a BPEL POST at the given InstanceDataAPI with the given ServiceTemplate id to create a - * Service Instance - * - * @param instanceDataAPIUrlVariableName the name of the variable holding the address to the - * instanceDataAPI - * @param csarId the name of the csar the serviceTemplate belongs to - * @param serviceTemplateId the id of the serviceTemplate - * @param responseVariableName a name of an anyType variable to save the response into - * @return a Node containing a BPEL4RESTLight POST extension activity - * @throws IOException is thrown when reading internal files fail - * @throws SAXException is thrown when parsing internal files fail - */ - public Node generateBPEL4RESTLightServiceInstancePOSTAsNode(final String instanceDataAPIUrlVariableName, - final String csarId, final QName serviceTemplateId, - final String responseVariableName) throws IOException, - SAXException { - final String templateString = - this.generateBPEL4RESTLightServiceInstancePOST(instanceDataAPIUrlVariableName, csarId, serviceTemplateId, - responseVariableName); - return this.transformStringToNode(templateString); - } - - /** - * Generates a BPEL POST at the given InstanceDataAPI with the given ServiceTemplate id to create a - * Service Instance - * - * @param instanceDataAPIUrlVariableName the name of the variable holding the address to the - * instanceDataAPI - * @param csarId the name of the csar the serviceTemplate belongs to - * @param serviceTemplateId the id of the serviceTemplate - * @param requestVariableName a name of an anyType variable to take the request content from - * @param responseVariableName a name of an anyType variable to save the response into - * @return a Node containing a BPEL4RESTLight POST extension activity - * @throws IOException is thrown when reading internal files fail - * @throws SAXException is thrown when parsing internal files fail - */ - public Node generateBPEL4RESTLightServiceInstancePOSTAsNode(final String instanceDataAPIUrlVariableName, - final String requestVariableName, - final String responseVariableName) throws IOException, - SAXException { - final String templateString = - this.generateBPEL4RESTLightServiceInstancePOST(instanceDataAPIUrlVariableName, requestVariableName, - responseVariableName); - return this.transformStringToNode(templateString); - } - - /** - * Generates a BPEL If activity that throws the given fault when the given expr evaluates to true at - * runtime - * - * @param xpath1Expr a XPath 1.0 expression as String - * @param faultQName a QName denoting the fault to be thrown when the if evaluates to true - * @return a Node containing a BPEL If Activity - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node generateBPELIfTrueThrowFaultAsNode(final String xpath1Expr, final QName faultQName) throws IOException, - SAXException { - final String templateString = generateBPELIfTrueThrowFaultAsString(xpath1Expr, faultQName); - return this.transformStringToNode(templateString); - } - - /** - * Generates a BPEL If activity that throws the given fault when the given expr evaluates to true at - * runtime - * - * @param xpath1Expr a XPath 1.0 expression as String - * @param faultQName a QName denoting the fault to be thrown when the if evaluates to true - * @return a String containing a BPEL If Activity - * @throws IOException is thrown when reading internal files fails - */ - public String generateBPELIfTrueThrowFaultAsString(final String xpath1Expr, - final QName faultQName) throws IOException { - // - String bpelIfString = this.loadFragmentResourceAsString("BPELIfTrueThrowFault.xml"); - - bpelIfString = bpelIfString.replace("$xpath1Expr", xpath1Expr); - - bpelIfString = bpelIfString.replace("$faultPrefix", faultQName.getLocalPart()); - bpelIfString = bpelIfString.replace("$faultLocalName", faultQName.getLocalPart()); - - return bpelIfString; - } - - /** - * Generates an Assign Acitivity that writes the content of a Strig variable into the first element - * specified by prefix and localname - * - * @param assignName the name of the assign - * @param variableName the name of the string variable to take the value from - * @param outputVarName the name of the output message variable - * @param outputVarPartName the name of the part inside the message variable - * @param outputVarPrefix the prefix of the element inside the message part - * @param outputVarLocalName the localName of the element inside the message part - * @return a DOM Node containing a BPEL Assign Activity - * @throws IOException is thrown when reading internal files fail - * @throws SAXException is thrown when parsing internal files fail - */ - public Node generateCopyFromStringVarToOutputVariableAsNode(final String variableName, final String outputVarName, - final String outputVarPartName, - final String outputVarLocalName) throws IOException, - SAXException { - final String templateString = - generateCopyFromStringVarToOutputVariableAsString(variableName, outputVarName, outputVarPartName, - outputVarLocalName); - return this.transformStringToNode(templateString); - } - - /** - * Generates an Assign Activity that writes the content of a String variable into the first element - * specified by prefix and localname - * - * @param assignName the name of the assign - * @param variableName the name of the string variable to take the value from - * @param outputVarName the name of the output message variable - * @param outputVarPartName the name of the part inside the message variable - * @param outputVarPrefix the prefix of the element inside the message part - * @param outputVarLocalName the localname of the element inside the message part - * @return a String containing a BPEL assign activitiy - * @throws IOException is thrown when reading internal files fail - */ - public String generateCopyFromStringVarToOutputVariableAsString(final String variableName, - final String outputVarName, - final String outputVarPartName, - final String outputVarLocalName) throws IOException { - // BpelAssignOutputVarFromStringVariable.xml - // - String bpelAssignString = this.loadFragmentResourceAsString("BpelCopyOutputVarFromStringVariable.xml"); - bpelAssignString = bpelAssignString.replace("${variableName}", variableName); - bpelAssignString = bpelAssignString.replace("${outputVarName}", outputVarName); - bpelAssignString = bpelAssignString.replace("${outputVarPartName}", outputVarPartName); - bpelAssignString = bpelAssignString.replace("${outputVarLocalName}", outputVarLocalName); - return bpelAssignString; - } - - /** - * Generates a BPEL assign that sets serviceInstanceURL, ID and serviceTemplate URL from the given - * serviceTemplateInstance POST response message - * - * @param serviceInstanceResponseVarName the varariable name of the POST response message - * @param serviceInstanceURLVarName the varariable name to save the serviceTemplateInstance URL - * @param serviceTemplateInstancesURLVar the variable name that holds the serviceTemplateInstances - * URL - * @param serviceInstanceIDVarName the variable name to save the serviceTemplateInstance ID in (e.g. - * ID=123) - * @param serviceTemplateURLVarName the variable name to save the serviceTemplate URL in - * @return a DOM Node containing a BPEL assign activity - * @throws IOException is thrown when reading internal files fail - * @throws SAXException is thrown when parsing internal files fail - */ - public Node generateServiceInstanceDataVarsAssignForBuildPlansAsNode(final String serviceInstanceResponseVarName, - final String serviceInstanceURLVarName, - final String serviceTemplateInstancesURLVar, - final String serviceInstanceIdVarName, - final String serviceTemplateURLVarName, - final String serviceInstanceCorrelationIdVarName, - final String planName, - final String buildPlanUrlVarName) throws IOException, - SAXException { - final String templateString = - generateServiceInstanceDataVarsAssignForBuildPlansAsString(serviceInstanceResponseVarName, - serviceInstanceURLVarName, - serviceTemplateInstancesURLVar, - serviceInstanceIdVarName, - serviceTemplateURLVarName, - serviceInstanceCorrelationIdVarName, planName, - buildPlanUrlVarName); - return this.transformStringToNode(templateString); - } - - /** - * Generates a BPEL assign that retrieves the URL/ID of a serviceInstance POST response - * - * @param serviceInstanceResponseVarName the var name of the POST response - * @param serviceInstanceURLVarName the var name to save the URL/ID into - * @return a String containing a BPEL assign activity - * @throws IOException is thrown when reading internal files fail - */ - - public String generateServiceInstanceDataVarsAssignForBuildPlansAsString(final String serviceInstanceResponseVarName, - final String serviceInstanceURLVarName, - final String serviceTemplateInstancesURLVar, - final String serviceInstanceIdVarName, - final String serviceTemplateURLVarName, - final String serviceInstanceCorrelationIdVarName, - final String planName, - final String buildPlanUrlVarName) throws IOException { - String bpelAssignString = this.loadFragmentResourceAsString("BpelAssignServiceInstancePOSTResponse.xml"); - // - - bpelAssignString = - bpelAssignString.replaceAll("\\$assignName", "assignServiceInstance" + System.currentTimeMillis()); - bpelAssignString = - bpelAssignString.replaceAll("\\$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$ServiceInstanceURLVarName", serviceInstanceURLVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$ServiceInstanceIDVarName", serviceInstanceIdVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$serviceTemplateURLVarName", serviceTemplateURLVarName); - bpelAssignString = - bpelAssignString.replaceAll("\\$serviceTemplateInstancesURLVar", serviceTemplateInstancesURLVar); - bpelAssignString = - bpelAssignString.replaceAll("\\$ServiceInstanceCorrelationID", serviceInstanceCorrelationIdVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$planName", planName); - bpelAssignString = bpelAssignString.replaceAll("\\$planInstanceURL", buildPlanUrlVarName); - - return bpelAssignString; - } - - public Node generateServiceInstanceDataVarsAssignForManagementPlansAsNode(final String serviceInstanceResponseVarName, - final String serviceInstanceURLVarName, - final String serviceTemplateInstancesURLVar, - final String serviceInstanceIdVarName, - final String serviceTemplateURLVarName, - final String serviceInstanceCorrelationIdVarName, - final String planName, - final String buildPlanUrlVarName) throws IOException, - SAXException { - final String templateString = - generateServiceInstanceDataVarsAssignForManagementPlansAsString(serviceInstanceResponseVarName, - serviceInstanceURLVarName, - serviceTemplateInstancesURLVar, - serviceInstanceIdVarName, - serviceTemplateURLVarName, - serviceInstanceCorrelationIdVarName, - planName, buildPlanUrlVarName); - return this.transformStringToNode(templateString); - } - - public String generateServiceInstanceDataVarsAssignForManagementPlansAsString(final String serviceInstanceResponseVarName, - final String serviceInstanceURLVarName, - final String serviceTemplateInstancesURLVar, - final String serviceInstanceIdVarName, - final String serviceTemplateURLVarName, - final String serviceInstanceCorrelationIdVarName, - final String planName, - final String buildPlanUrlVarName) throws IOException { - String bpelAssignString = this.loadFragmentResourceAsString("BpelAssignServiceInstancePOSTResponse2.xml"); - // - - bpelAssignString = - bpelAssignString.replaceAll("\\$assignName", "assignServiceInstance" + System.currentTimeMillis()); - bpelAssignString = - bpelAssignString.replaceAll("\\$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$ServiceInstanceURLVarName", serviceInstanceURLVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$ServiceInstanceIDVarName", serviceInstanceIdVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$serviceTemplateURLVarName", serviceTemplateURLVarName); - bpelAssignString = - bpelAssignString.replaceAll("\\$serviceTemplateInstancesURLVar", serviceTemplateInstancesURLVar); - bpelAssignString = - bpelAssignString.replaceAll("\\$ServiceInstanceCorrelationID", serviceInstanceCorrelationIdVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$planName", planName); - bpelAssignString = bpelAssignString.replaceAll("\\$planInstanceURL", buildPlanUrlVarName); - - return bpelAssignString; - } - -} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBackupManagementProcessBuilder.java b/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBackupManagementProcessBuilder.java deleted file mode 100644 index 20607ab18..000000000 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBackupManagementProcessBuilder.java +++ /dev/null @@ -1,358 +0,0 @@ -package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; - -import java.io.IOException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.planbuilder.AbstractManagementFeaturePlanBuilder; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; -import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; -import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; -import org.opentosca.planbuilder.model.plan.ActivityType; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Node; -import org.xml.sax.SAXException; - -/** - *

    - * This process builder creates a backup management plan if one of the NodeTemplates in the topology - * is of a type that defines the freeze interface. - *

    - * - * Copyright 2019 IAAS University of Stuttgart
    - *
    - */ -public class BPELBackupManagementProcessBuilder extends AbstractManagementFeaturePlanBuilder { - - private final static Logger LOG = LoggerFactory.getLogger(BPELBackupManagementProcessBuilder.class); - - // handler for abstract buildplan operations - public BPELPlanHandler planHandler; - - // class for initializing properties inside the build plan - private final PropertyVariableHandler propertyInitializer; - - // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans - private SimplePlanBuilderServiceInstanceHandler serviceInstanceVarsHandler; - - // adds nodeInstanceIDs to each templatePlan - private NodeRelationInstanceVariablesHandler instanceVarsHandler; - - // class for finalizing build plans (e.g when some template didn't receive - // some provisioning logic and they must be filled with empty elements) - private final BPELFinalizer finalizer; - - private BPELProcessFragments bpelFragments; - - private CorrelationIDInitializer correlationHandler; - - /** - *

    - * Default Constructor - *

    - */ - public BPELBackupManagementProcessBuilder() { - try { - this.planHandler = new BPELPlanHandler(); - this.serviceInstanceVarsHandler = new SimplePlanBuilderServiceInstanceHandler(); - this.instanceVarsHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); - this.bpelFragments = new BPELProcessFragments(); - this.correlationHandler = new CorrelationIDInitializer(); - } - catch (final ParserConfigurationException e) { - LOG.error("Error while initializing BuildPlanHandler", e); - } - this.propertyInitializer = new PropertyVariableHandler(this.planHandler); - this.finalizer = new BPELFinalizer(); - } - - /* - * (non-Javadoc) - * - * @see org.opentosca.planbuilder.IPlanBuilder#buildPlan(java.lang.String, - * org.opentosca.planbuilder.model.tosca.AbstractDefinitions, javax.xml.namespace.QName) - */ - @Override - public BPELPlan buildPlan(final String csarName, final AbstractDefinitions definitions, - final AbstractServiceTemplate serviceTemplate) { - LOG.debug("Creating Backup Management Plan..."); - - if (Objects.isNull(serviceTemplate)) { - LOG.error("Unable to generate Backup Plan with ServiceTempolate equal to null."); - return null; - } - - final String processName = ModelUtils.makeValidNCName(serviceTemplate.getId() + "_backupManagementPlan"); - final String processNamespace = serviceTemplate.getTargetNamespace() + "_backupManagementPlan"; - - final AbstractPlan abstractBackupPlan = - generateMOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, ActivityType.BACKUP, true); - - LOG.debug("Generated the following abstract backup plan: "); - LOG.debug(abstractBackupPlan.toString()); - - abstractBackupPlan.setType(PlanType.MANAGE); - final BPELPlan newBackupPlan = - this.planHandler.createEmptyBPELPlan(processNamespace, processName, abstractBackupPlan, "backup"); - - this.planHandler.initializeBPELSkeleton(newBackupPlan, csarName); - - newBackupPlan.setTOSCAInterfaceName("OpenTOSCA-Management-Feature-Interface"); - newBackupPlan.setTOSCAOperationname("backup"); - - this.instanceVarsHandler.addInstanceURLVarToTemplatePlans(newBackupPlan, serviceTemplate); - this.instanceVarsHandler.addInstanceIDVarToTemplatePlans(newBackupPlan, serviceTemplate); - - final Property2VariableMapping propMap = - this.propertyInitializer.initializePropertiesAsVariables(newBackupPlan, serviceTemplate); - - // initialize instanceData handling - this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - newBackupPlan); - this.serviceInstanceVarsHandler.addServiceInstanceHandlingFromInput(newBackupPlan); - - final String serviceTemplateURLVarName = - this.serviceInstanceVarsHandler.getServiceTemplateURLVariableName(newBackupPlan); - - this.serviceInstanceVarsHandler.appendInitPropertyVariablesFromServiceInstanceData(newBackupPlan, propMap, - serviceTemplateURLVarName, - serviceTemplate, null); - - // fetch all node instances that are running - this.instanceVarsHandler.addNodeInstanceFindLogic(newBackupPlan, - "?state=STARTED&state=CREATED&state=CONFIGURED", - serviceTemplate); - this.instanceVarsHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(newBackupPlan, propMap, - serviceTemplate); - - try { - appendGenerateStatefulServiceTemplateLogic(newBackupPlan); - } - catch (final IOException e) { - e.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - - runPlugins(newBackupPlan, propMap, csarName); - - this.correlationHandler.addCorrellationID(newBackupPlan); - - this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newBackupPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newBackupPlan), - "ERROR", - this.serviceInstanceVarsHandler.findServiceInstanceUrlVariableName(newBackupPlan)); - this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newBackupPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newBackupPlan), - "FAILED", - this.serviceInstanceVarsHandler.findPlanInstanceUrlVariableName(newBackupPlan)); - - this.finalizer.finalize(newBackupPlan); - - LOG.debug("Created Plan:"); - LOG.debug(ModelUtils.getStringFromDoc(newBackupPlan.getBpelDocument())); - - return newBackupPlan; - } - - private void runPlugins(final BPELPlan plan, final Property2VariableMapping propMap, final String csarName) { - - final String statefulServiceTemplateUrlVarName = findStatefulServiceTemplateUrlVar(plan); - - final String serviceInstanceUrl = this.serviceInstanceVarsHandler.findServiceInstanceUrlVariableName(plan); - final String serviceInstanceId = this.serviceInstanceVarsHandler.findServiceInstanceIdVarName(plan); - final String serviceTemplateUrl = this.serviceInstanceVarsHandler.findServiceTemplateUrlVariableName(plan); - - - for (final BPELScope templatePlan : plan.getTemplateBuildPlans()) { - final BPELPlanContext context = new BPELPlanContext(plan, templatePlan, propMap, plan.getServiceTemplate(), - serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); - - // only handle NodeTemplates of type with save state interface - final AbstractNodeTemplate nodeTemplate = templatePlan.getNodeTemplate(); - if (Objects.nonNull(nodeTemplate) - && Objects.nonNull(ModelUtils.getInterfaceOfNode(nodeTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE))) { - LOG.debug("Adding backup logic for NodeTemplate {}", nodeTemplate.getName()); - - final String saveStateUrlVarName = - this.planHandler.addGlobalStringVariable("nodeTemplateStateSaveURL", plan); - - final String xpathQuery = "concat($" + statefulServiceTemplateUrlVarName - + ",'/topologytemplate/nodetemplates/" + nodeTemplate.getId() + "/state')"; - try { - Node assignSaveStateURL = - this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignNodeTemplate" - + nodeTemplate.getId() + "state" + System.currentTimeMillis(), - statefulServiceTemplateUrlVarName, - saveStateUrlVarName, xpathQuery); - assignSaveStateURL = context.importNode(assignSaveStateURL); - context.getPrePhaseElement().appendChild(assignSaveStateURL); - } - catch (final IOException e) { - e.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - - final AbstractOperation freezeOp = - ModelUtils.getOperationOfNode(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE); - if (Objects.nonNull(freezeOp)) { - final Variable saveStateUrlVar = context.getVariable(saveStateUrlVarName); - - final Map inputs = new HashMap<>(); - - // retrieve input parameters from all nodes which are downwards in the same topology stack - final List nodesForMatching = new ArrayList<>(); - ModelUtils.getNodesFromNodeToSink(nodeTemplate, nodesForMatching); - - LOG.debug("Backup on NodeTemplate {} needs the following input parameters:", - nodeTemplate.getName()); - for (final AbstractParameter param : freezeOp.getInputParameters()) { - LOG.debug("Input param: {}", param.getName()); - found: for (final AbstractNodeTemplate nodeForMatching : nodesForMatching) { - for (final String propName : ModelUtils.getPropertyNames(nodeForMatching)) { - if (param.getName().equals(propName)) { - inputs.put(param, context.getPropertyVariable(nodeForMatching, propName)); - break found; - } - } - } - } - - // add special parameter with winery URL - inputs.put(getSaveStateParameter(freezeOp), saveStateUrlVar); - - LOG.debug("Found {} of {} input parameters.", inputs.size(), freezeOp.getInputParameters().size()); - - context.executeOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE, inputs); - } - } - } - } - - @Override - public List buildPlans(final String csarName, final AbstractDefinitions definitions) { - LOG.info("Building the Backup Management Plans"); - final List plans = new ArrayList<>(); - for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { - - if (containsManagementInterface(serviceTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE)) { - LOG.debug("ServiceTemplate {} contains NodeTypes with defined backup interface.", - serviceTemplate.getName()); - final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); - if (Objects.nonNull(newBuildPlan)) { - LOG.debug("Created Backup Management Plan " - + newBuildPlan.getBpelProcessElement().getAttribute("name")); - plans.add(newBuildPlan); - } - } else { - LOG.debug("No backup interface defined in ServiceTemplate {}", serviceTemplate.getName()); - } - } - return plans; - } - - private void appendGenerateStatefulServiceTemplateLogic(final BPELPlan plan) throws IOException, SAXException { - final QName serviceTemplateId = plan.getServiceTemplate().getQName(); - - this.planHandler.addStringElementToPlanRequest(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT, - plan); - - // var to save serviceTemplate url on storage service - final String statefulServiceTemplateVarName = - this.planHandler.addGlobalStringVariable("statefulServiceTemplateUrl" + System.currentTimeMillis(), plan); - final String responseVarName = this.planHandler.createAnyTypeVar(plan); - - // assign variable with the original service template url - Node assignStatefuleServiceTemplateStorageVar = - this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignServiceTemplateStorageUrl" - + System.currentTimeMillis(), "input", statefulServiceTemplateVarName, - "concat(//*[local-name()='" - + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT - + "']/text(),'/servicetemplates/" - + URLEncoder.encode(URLEncoder.encode(serviceTemplateId.getNamespaceURI(), - "UTF-8"), - "UTF-8") - + "','/" + serviceTemplateId.getLocalPart() - + "','/createnewstatefulversion')"); - assignStatefuleServiceTemplateStorageVar = - plan.getBpelDocument().importNode(assignStatefuleServiceTemplateStorageVar, true); - plan.getBpelMainSequenceElement().insertBefore(assignStatefuleServiceTemplateStorageVar, - plan.getBpelMainSequencePropertyAssignElement()); - - // create append POST for creating a stateful service template version - Node createStatefulServiceTemplatePOST = - this.bpelFragments.createHTTPPOST(statefulServiceTemplateVarName, responseVarName); - - createStatefulServiceTemplatePOST = plan.getBpelDocument().importNode(createStatefulServiceTemplatePOST, true); - - plan.getBpelMainSequenceElement().insertBefore(createStatefulServiceTemplatePOST, - plan.getBpelMainSequencePropertyAssignElement()); - - // read response and assign url of created stateful service template query the localname from the - // response - final String xpathQuery1 = - "concat(substring-before($" + statefulServiceTemplateVarName + ",'" + serviceTemplateId.getLocalPart() - + "'),encode-for-uri(encode-for-uri(//*[local-name()='QName']/*[local-name()='localname']/text())))"; - - // query original service template url without the last path fragment(/service template localname) - final String xpathQuery2 = "string($" + statefulServiceTemplateVarName + ")"; - Node assignCreatedStatefulServiceTemplate = - this.bpelFragments.createAssignVarToVarWithXpathQueriesAsNode("assignCreatedStatefuleServiceTemplateUrl", - responseVarName, null, - statefulServiceTemplateVarName, null, - xpathQuery1, xpathQuery2, - "change the url from original service template to stateful", - null); - - assignCreatedStatefulServiceTemplate = - plan.getBpelDocument().importNode(assignCreatedStatefulServiceTemplate, true); - plan.getBpelMainSequenceElement().insertBefore(assignCreatedStatefulServiceTemplate, - plan.getBpelMainSequencePropertyAssignElement()); - } - - private String findStatefulServiceTemplateUrlVar(final BPELPlan plan) { - return this.planHandler.getMainVariableNames(plan).stream() - .filter(varName -> varName.contains("statefulServiceTemplateUrl")).findFirst() - .orElse(null); - } - - private AbstractParameter getSaveStateParameter(final AbstractOperation op) { - return op.getInputParameters().stream() - .filter(param -> param.getName() - .equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT)) - .findFirst().orElse(null); - } -} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBuildProcessBuilder.java b/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBuildProcessBuilder.java deleted file mode 100644 index ab6021d3d..000000000 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBuildProcessBuilder.java +++ /dev/null @@ -1,284 +0,0 @@ -package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.AbstractBuildPlanBuilder; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; -import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; -import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.EmptyPropertyToInputHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.ServiceTemplateBoundaryPropertyMappingsToOutputHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.SituationTriggerRegistration; -import org.opentosca.planbuilder.core.bpel.typebasednodehandler.BPELPluginHandler; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - *

    - * This Class represents the high-level algorithm of the concept in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans fuer - * OpenTOSCA. It is responsible for generating the Build Plan Skeleton and assign plugins to - * handle the different templates inside a TopologyTemplate. - *

    - * - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class BPELBuildProcessBuilder extends AbstractBuildPlanBuilder { - - final static Logger LOG = LoggerFactory.getLogger(BPELBuildProcessBuilder.class); - - // class for initializing properties inside the plan - private final PropertyVariableHandler propertyInitializer; - // class for initializing output with boundarydefinitions of a - // serviceTemplate - private final ServiceTemplateBoundaryPropertyMappingsToOutputHandler propertyOutputInitializer; - // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans - - private SimplePlanBuilderServiceInstanceHandler serviceInstanceInitializer; - - private CorrelationIDInitializer correlationHandler; - - private SituationTriggerRegistration sitRegistrationPlugin; - - // class for finalizing build plans (e.g when some template didn't receive - // some provisioning logic and they must be filled with empty elements) - private final BPELFinalizer finalizer; - - private BPELPlanHandler planHandler; - - private final BPELPluginHandler bpelPluginHandler = new BPELPluginHandler(); - - private NodeRelationInstanceVariablesHandler nodeRelationInstanceHandler; - - private final EmptyPropertyToInputHandler emptyPropInit = new EmptyPropertyToInputHandler(); - - /** - *

    - * Default Constructor - *

    - */ - public BPELBuildProcessBuilder() { - try { - this.planHandler = new BPELPlanHandler(); - this.serviceInstanceInitializer = new SimplePlanBuilderServiceInstanceHandler(); - this.nodeRelationInstanceHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); - this.sitRegistrationPlugin = new SituationTriggerRegistration(); - this.correlationHandler = new CorrelationIDInitializer(); - - } - catch (final ParserConfigurationException e) { - BPELBuildProcessBuilder.LOG.error("Error while initializing BuildPlanHandler", e); - } - // TODO seems ugly - this.propertyInitializer = new PropertyVariableHandler(this.planHandler); - this.propertyOutputInitializer = new ServiceTemplateBoundaryPropertyMappingsToOutputHandler(); - this.finalizer = new BPELFinalizer(); - } - - /* - * (non-Javadoc) - * - * @see org.opentosca.planbuilder.IPlanBuilder#buildPlan(java.lang.String, - * org.opentosca.planbuilder.model.tosca.AbstractDefinitions, javax.xml.namespace.QName) - */ - @Override - public BPELPlan buildPlan(final String csarName, final AbstractDefinitions definitions, - final AbstractServiceTemplate serviceTemplate) { - // create empty plan from servicetemplate and add definitions - - - String namespace; - if (serviceTemplate.getTargetNamespace() != null) { - namespace = serviceTemplate.getTargetNamespace(); - } else { - namespace = definitions.getTargetNamespace(); - } - - if (namespace.equals(serviceTemplate.getQName().getNamespaceURI()) - && serviceTemplate.getId().equals(serviceTemplate.getQName().getLocalPart())) { - - final String processName = ModelUtils.makeValidNCName(serviceTemplate.getId() + "_buildPlan"); - final String processNamespace = serviceTemplate.getTargetNamespace() + "_buildPlan"; - - final AbstractPlan buildPlan = - this.generatePOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate); - - LOG.debug("Generated the following abstract prov plan: "); - LOG.debug(buildPlan.toString()); - - final BPELPlan newBuildPlan = - this.planHandler.createEmptyBPELPlan(processNamespace, processName, buildPlan, "initiate"); - - newBuildPlan.setTOSCAInterfaceName("OpenTOSCA-Lifecycle-Interface"); - newBuildPlan.setTOSCAOperationname("initiate"); - - this.planHandler.initializeBPELSkeleton(newBuildPlan, csarName); - - this.nodeRelationInstanceHandler.addInstanceURLVarToTemplatePlans(newBuildPlan, serviceTemplate); - this.nodeRelationInstanceHandler.addInstanceIDVarToTemplatePlans(newBuildPlan, serviceTemplate); - - // newBuildPlan.setCsarName(csarName); - - this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - newBuildPlan); - - final Property2VariableMapping propMap = - this.propertyInitializer.initializePropertiesAsVariables(newBuildPlan, serviceTemplate); - // init output - this.propertyOutputInitializer.initializeBuildPlanOutput(definitions, newBuildPlan, propMap, - serviceTemplate); - - // instanceDataAPI handling is done solely trough this extension - - // initialize instanceData handling - this.serviceInstanceInitializer.appendCreateServiceInstanceVarsAndAnitializeWithInstanceDataAPI(newBuildPlan); - - - final String serviceInstanceUrl = - this.serviceInstanceInitializer.findServiceInstanceUrlVariableName(newBuildPlan); - final String serviceInstanceID = this.serviceInstanceInitializer.findServiceInstanceIdVarName(newBuildPlan); - final String serviceTemplateUrl = - this.serviceInstanceInitializer.findServiceTemplateUrlVariableName(newBuildPlan); - - this.emptyPropInit.initializeEmptyPropertiesAsInputParam(newBuildPlan, propMap, serviceInstanceUrl, - serviceInstanceID, serviceTemplateUrl, - serviceTemplate, csarName); - - runPlugins(newBuildPlan, propMap, serviceInstanceUrl, serviceInstanceID, serviceTemplateUrl, csarName); - - this.correlationHandler.addCorrellationID(newBuildPlan); - - - this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, - newBuildPlan.getBpelMainFlowElement(), - "CREATING", serviceInstanceUrl); - this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, - newBuildPlan.getBpelMainSequenceOutputAssignElement(), - "CREATED", serviceInstanceUrl); - - this.serviceInstanceInitializer.appendSetServiceInstanceStateAsChild(newBuildPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newBuildPlan), - "ERROR", serviceInstanceUrl); - this.serviceInstanceInitializer.appendSetServiceInstanceStateAsChild(newBuildPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newBuildPlan), - "FAILED", - this.serviceInstanceInitializer.findPlanInstanceUrlVariableName(newBuildPlan)); - - this.sitRegistrationPlugin.handle(serviceTemplate, newBuildPlan); - - - - this.finalizer.finalize(newBuildPlan); - return newBuildPlan; - } - - BPELBuildProcessBuilder.LOG.warn("Couldn't create BuildPlan for ServiceTemplate {} in Definitions {} of CSAR {}", - serviceTemplate.getQName().toString(), definitions.getId(), csarName); - return null; - } - - /* - * (non-Javadoc) - * - * @see org.opentosca.planbuilder.IPlanBuilder#buildPlans(java.lang.String, - * org.opentosca.planbuilder.model.tosca.AbstractDefinitions) - */ - @Override - public List buildPlans(final String csarName, final AbstractDefinitions definitions) { - final List plans = new ArrayList<>(); - for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { - - if (!serviceTemplate.hasBuildPlan()) { - BPELBuildProcessBuilder.LOG.debug("ServiceTemplate {} has no BuildPlan, generating BuildPlan", - serviceTemplate.getQName().toString()); - final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); - - if (newBuildPlan != null) { - BPELBuildProcessBuilder.LOG.debug("Created BuildPlan " - + newBuildPlan.getBpelProcessElement().getAttribute("name")); - plans.add(newBuildPlan); - } - } else { - BPELBuildProcessBuilder.LOG.debug("ServiceTemplate {} has BuildPlan, no generation needed", - serviceTemplate.getQName().toString()); - } - } - return plans; - } - - /** - *

    - * This method assigns plugins to the already initialized BuildPlan and its TemplateBuildPlans. - * First there will be checked if any generic plugin can handle a template of the TopologyTemplate - *

    - * - * @param buildPlan a BuildPlan which is already initialized - * @param map a PropertyMap which contains mappings from Template to Property and to variable name - * of inside the BuidlPlan - */ - private void runPlugins(final BPELPlan buildPlan, final Property2VariableMapping map, - final String serviceInstanceUrl, final String serviceInstanceID, - final String serviceTemplateUrl, final String csarFileName) { - - - - for (final BPELScope bpelScope : buildPlan.getTemplateBuildPlans()) { - final BPELPlanContext context = - new BPELPlanContext(buildPlan, bpelScope, map, buildPlan.getServiceTemplate(), serviceInstanceUrl, - serviceInstanceID, serviceTemplateUrl, csarFileName); - if (bpelScope.getNodeTemplate() != null) { - - final AbstractNodeTemplate nodeTemplate = bpelScope.getNodeTemplate(); - - // if this nodeTemplate has the label running (Property: State=Running), skip - // provisioning and just generate instance data handling - // extended check for OperatingSystem node type - if (isRunning(nodeTemplate) - || nodeTemplate.getType().getName().equals(Types.abstractOperatingSystemNodeType.getLocalPart())) { - BPELBuildProcessBuilder.LOG.debug("Skipping the provisioning of NodeTemplate " - + bpelScope.getNodeTemplate().getId() + " beacuse state=running is set."); - for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { - if (postPhasePlugin.canHandleCreate(context, bpelScope.getNodeTemplate())) { - postPhasePlugin.handleCreate(context, bpelScope.getNodeTemplate()); - } - } - continue; - } - - // generate code for the activity - this.bpelPluginHandler.handleActivity(context, bpelScope, nodeTemplate); - } else if (bpelScope.getRelationshipTemplate() != null) { - // handling relationshiptemplate - final AbstractRelationshipTemplate relationshipTemplate = bpelScope.getRelationshipTemplate(); - - this.bpelPluginHandler.handleActivity(context, bpelScope, relationshipTemplate); - } - - } - } - -} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELFreezeProcessBuilder.java b/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELFreezeProcessBuilder.java deleted file mode 100644 index b49a35c81..000000000 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELFreezeProcessBuilder.java +++ /dev/null @@ -1,475 +0,0 @@ -package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; - -import java.io.IOException; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.planbuilder.AbstractFreezePlanBuilder; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; -import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; -import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractInterface; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -/** - * @author Jan Ruthardt - st107755@stud.uni-stuttgart.de - * - */ -public class BPELFreezeProcessBuilder extends AbstractFreezePlanBuilder { - - private final static Logger LOG = LoggerFactory.getLogger(BPELFreezeProcessBuilder.class); - - // handler for abstract buildplan operations - public BPELPlanHandler planHandler; - - // class for initializing properties inside the build plan - private final PropertyVariableHandler propertyInitializer; - - // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans - private SimplePlanBuilderServiceInstanceHandler serviceInstanceVarsHandler; - - // adds nodeInstanceIDs to each templatePlan - private NodeRelationInstanceVariablesHandler instanceVarsHandler; - - // class for finalizing build plans (e.g when some template didn't receive - // some provisioning logic and they must be filled with empty elements) - private final BPELFinalizer finalizer; - - private BPELProcessFragments bpelFragments; - - private CorrelationIDInitializer correlationHandler; - - /** - *

    - * Default Constructor - *

    - */ - public BPELFreezeProcessBuilder() { - try { - this.planHandler = new BPELPlanHandler(); - this.serviceInstanceVarsHandler = new SimplePlanBuilderServiceInstanceHandler(); - this.instanceVarsHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); - this.bpelFragments = new BPELProcessFragments(); - this.correlationHandler = new CorrelationIDInitializer(); - } - catch (final ParserConfigurationException e) { - LOG.error("Error while initializing BuildPlanHandler", e); - } - this.propertyInitializer = new PropertyVariableHandler(this.planHandler); - this.finalizer = new BPELFinalizer(); - } - - /* - * (non-Javadoc) - * - * @see org.opentosca.planbuilder.IPlanBuilder#buildPlan(java.lang.String, - * org.opentosca.planbuilder.model.tosca.AbstractDefinitions, javax.xml.namespace.QName) - */ - @Override - public BPELPlan buildPlan(final String csarName, final AbstractDefinitions definitions, - final AbstractServiceTemplate serviceTemplate) { - LOG.info("Creating Freeze Plan..."); - - - if (!this.isStateful(serviceTemplate)) { - LOG.warn("Couldn't create FreezePlan for ServiceTemplate {} in Definitions {} of CSAR {}", - serviceTemplate.getQName().toString(), definitions.getId(), csarName); - return null; - } - - final String processName = ModelUtils.makeValidNCName(serviceTemplate.getId() + "_freezePlan"); - final String processNamespace = serviceTemplate.getTargetNamespace() + "_freezePlan"; - - // we take the overall flow of an termination plan, basically with the goal of - // saving state from the top to the bottom - final AbstractPlan newAbstractBackupPlan = - generateFOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate); - - newAbstractBackupPlan.setType(PlanType.TERMINATE); - final BPELPlan newFreezePlan = - this.planHandler.createEmptyBPELPlan(processNamespace, processName, newAbstractBackupPlan, "freeze"); - - this.planHandler.initializeBPELSkeleton(newFreezePlan, csarName); - - newFreezePlan.setTOSCAInterfaceName("OpenTOSCA-Stateful-Lifecycle-Interface"); - newFreezePlan.setTOSCAOperationname("freeze"); - - this.instanceVarsHandler.addInstanceURLVarToTemplatePlans(newFreezePlan, serviceTemplate); - this.instanceVarsHandler.addInstanceIDVarToTemplatePlans(newFreezePlan, serviceTemplate); - - final Property2VariableMapping propMap = - this.propertyInitializer.initializePropertiesAsVariables(newFreezePlan, serviceTemplate); - - // instanceDataAPI handling is done solely trough this extension - this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - newFreezePlan); - - // initialize instanceData handling, add - // instanceDataAPI/serviceInstanceID into input, add global - // variables to hold the value for plugins - this.serviceInstanceVarsHandler.addServiceInstanceHandlingFromInput(newFreezePlan); - final String serviceTemplateURLVarName = - this.serviceInstanceVarsHandler.getServiceTemplateURLVariableName(newFreezePlan); - this.serviceInstanceVarsHandler.appendInitPropertyVariablesFromServiceInstanceData(newFreezePlan, propMap, - serviceTemplateURLVarName, - serviceTemplate, - "?state=STARTED&state=CREATED&state=CONFIGURED"); - - // fetch all nodeinstances that are running - this.instanceVarsHandler.addNodeInstanceFindLogic(newFreezePlan, - "?state=STARTED&state=CREATED&state=CONFIGURED", - serviceTemplate); - this.instanceVarsHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(newFreezePlan, propMap, - serviceTemplate); - - try { - appendGenerateStatefulServiceTemplateLogic(newFreezePlan); - } - catch (final IOException e) { - e.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - - runPlugins(newFreezePlan, propMap, csarName); - - final String serviceInstanceURLVarName = - this.serviceInstanceVarsHandler.findServiceInstanceUrlVariableName(newFreezePlan); - this.serviceInstanceVarsHandler.appendSetServiceInstanceState(newFreezePlan, - newFreezePlan.getBpelMainSequenceOutputAssignElement(), - "DELETED", serviceInstanceURLVarName); - - this.correlationHandler.addCorrellationID(newFreezePlan); - - this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newFreezePlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newFreezePlan), - "ERROR", serviceInstanceURLVarName); - this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newFreezePlan, this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newFreezePlan), "FAILED", this.serviceInstanceVarsHandler.findPlanInstanceUrlVariableName(newFreezePlan)); - - this.finalizer.finalize(newFreezePlan); - - // add for each loop over found node instances to terminate each running - // instance - /* - * for (final BPELScopeActivity activ : changedActivities) { if (activ.getNodeTemplate() != null) { - * final BPELPlanContext context = new BPELPlanContext(activ, propMap, - * newTerminationPlan.getServiceTemplate()); - * this.instanceVarsHandler.appendCountInstancesLogic(context, activ.getNodeTemplate(), - * "?state=STARTED&state=CREATED&state=CONFIGURED"); } } - */ - - LOG.debug("Created Plan:"); - LOG.debug(ModelUtils.getStringFromDoc(newFreezePlan.getBpelDocument())); - - return newFreezePlan; - } - - @Override - public List buildPlans(final String csarName, final AbstractDefinitions definitions) { - LOG.info("Building the Freeze Plans"); - final List plans = new ArrayList<>(); - for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { - if (!this.isStateful(serviceTemplate)) { - continue; - } - - LOG.debug("ServiceTemplate {} has no Freeze Plan, generating Freeze Plan", - serviceTemplate.getQName().toString()); - final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); - - if (newBuildPlan != null) { - LOG.debug("Created Freeze Plan " + newBuildPlan.getBpelProcessElement().getAttribute("name")); - plans.add(newBuildPlan); - } - } - return plans; - } - - private boolean isStateful(final AbstractServiceTemplate serviceTemplate) { - return serviceTemplate.getTopologyTemplate().getNodeTemplates().stream().filter(node -> isStateful(node)) - .findFirst().isPresent(); - } - - private boolean isStateful(final AbstractNodeTemplate nodeTemplate) { - return hasSaveStateInterface(nodeTemplate) && hasStatefulComponentPolicy(nodeTemplate); - } - - private boolean hasSaveStateInterface(final AbstractNodeTemplate nodeTemplate) { - final AbstractOperation op = getSaveStateOperation(nodeTemplate); - return Objects.nonNull(op) && Objects.nonNull(getSaveStateParameter(op)); - } - - private AbstractInterface getSaveStateInterface(final AbstractNodeTemplate nodeTemplate) { - return nodeTemplate.getType().getInterfaces().stream() - .filter(iface -> iface.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE)) - .findFirst().orElse(null); - } - - private AbstractOperation getSaveStateOperation(final AbstractNodeTemplate nodeTemplate) { - final AbstractInterface iface = getSaveStateInterface(nodeTemplate); - if (iface != null) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE)) { - return op; - } - } - } - return null; - } - - private AbstractParameter getSaveStateParameter(final AbstractOperation op) { - return op.getInputParameters().stream() - .filter(param -> param.getName() - .equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT)) - .findFirst().orElse(null); - } - - private String findStatefulServiceTemplateUrlVar(final BPELPlan plan) { - return this.planHandler.getMainVariableNames(plan).stream() - .filter(varName -> varName.contains("statefulServiceTemplateUrl")).findFirst() - .orElse(null); - } - - private void appendGenerateStatefulServiceTemplateLogic(final BPELPlan plan) throws IOException, SAXException { - final QName serviceTemplateId = plan.getServiceTemplate().getQName(); - - this.planHandler.addStringElementToPlanRequest(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT, - plan); - - // var to save serviceTemplate url on storage service - final String statefulServiceTemplateVarName = - this.planHandler.addGlobalStringVariable("statefulServiceTemplateUrl" + System.currentTimeMillis(), plan); - final String responseVarName = this.planHandler.createAnyTypeVar(plan); - - // assign variable with the original service template url - Node assignStatefuleServiceTemplateStorageVar = - this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignServiceTemplateStorageUrl" - + System.currentTimeMillis(), "input", statefulServiceTemplateVarName, - "concat(//*[local-name()='" - + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT - + "']/text(),'/servicetemplates/" - + URLEncoder.encode(URLEncoder.encode(serviceTemplateId.getNamespaceURI(), - "UTF-8"), - "UTF-8") - + "','/" + serviceTemplateId.getLocalPart() - + "','/createnewstatefulversion')"); - assignStatefuleServiceTemplateStorageVar = - plan.getBpelDocument().importNode(assignStatefuleServiceTemplateStorageVar, true); - plan.getBpelMainSequenceElement().insertBefore(assignStatefuleServiceTemplateStorageVar, - plan.getBpelMainSequencePropertyAssignElement()); - - // create append POST for creating a stateful service template version - Node createStatefulServiceTemplatePOST = - this.bpelFragments.createHTTPPOST(statefulServiceTemplateVarName, responseVarName); - - createStatefulServiceTemplatePOST = plan.getBpelDocument().importNode(createStatefulServiceTemplatePOST, true); - - plan.getBpelMainSequenceElement().insertBefore(createStatefulServiceTemplatePOST, - plan.getBpelMainSequencePropertyAssignElement()); - - // read response and assign url of created stateful service template - // query the localname from the response - final String xpathQuery1 = - "concat(substring-before($" + statefulServiceTemplateVarName + ",'" + serviceTemplateId.getLocalPart() - + "'),encode-for-uri(encode-for-uri(//*[local-name()='QName']/*[local-name()='localname']/text())))"; - // query original service template url without the last path fragment(/service - // template localname) - final String xpathQuery2 = "string($" + statefulServiceTemplateVarName + ")"; - Node assignCreatedStatefulServiceTemplate = - this.bpelFragments.createAssignVarToVarWithXpathQueriesAsNode("assignCreatedStatefuleServiceTemplateUrl", - responseVarName, null, - statefulServiceTemplateVarName, null, - xpathQuery1, xpathQuery2, - "change the url from original service template to stateful", - null); - - assignCreatedStatefulServiceTemplate = - plan.getBpelDocument().importNode(assignCreatedStatefulServiceTemplate, true); - plan.getBpelMainSequenceElement().insertBefore(assignCreatedStatefulServiceTemplate, - plan.getBpelMainSequencePropertyAssignElement()); - } - - /** - * This Methods Finds out if a Service Template Container a freeze method and then creats a freeze - * plan out of this method - * - * @param plan the plan to execute the plugins on - * @param serviceTemplate the serviceTemplate the plan belongs to - * @param propMap a PropertyMapping from NodeTemplate to Properties to BPELVariables - */ - private List runPlugins(final BPELPlan plan, final Property2VariableMapping propMap, - final String csarName) { - - final List changedActivities = new ArrayList<>(); - - final String statefulServiceTemplateUrlVarName = findStatefulServiceTemplateUrlVar(plan); - - final String serviceInstanceUrl = this.serviceInstanceVarsHandler.findServiceInstanceUrlVariableName(plan); - final String serviceInstanceId = this.serviceInstanceVarsHandler.findServiceInstanceIdVarName(plan); - final String serviceTemplateUrl = this.serviceInstanceVarsHandler.findServiceTemplateUrlVariableName(plan); - - - for (final BPELScope templatePlan : plan.getTemplateBuildPlans()) { - final BPELPlanContext context = new BPELPlanContext(plan, templatePlan, propMap, plan.getServiceTemplate(), - serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); - if (templatePlan.getNodeTemplate() != null) { - - // create a context for the node - - final AbstractNodeTemplate nodeTemplate = templatePlan.getNodeTemplate(); - - // TODO add termination logic - - /* - * generic save state code - */ - if (this.isStateful(nodeTemplate)) { - - final String saveStateUrlVarName = - this.planHandler.addGlobalStringVariable("nodeTemplateStateSaveURL", plan); - - final String xpathQuery = "concat($" + statefulServiceTemplateUrlVarName - + ",'/topologytemplate/nodetemplates/" + nodeTemplate.getId() + "/state')"; - try { - Node assignSaveStateURL = - this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignNodeTemplate" - + nodeTemplate.getId() + "state" + System.currentTimeMillis(), - statefulServiceTemplateUrlVarName, - saveStateUrlVarName, - xpathQuery); - assignSaveStateURL = context.importNode(assignSaveStateURL); - context.getPrePhaseElement().appendChild(assignSaveStateURL); - } - catch (final IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - final Variable saveStateUrlVar = context.getVariable(saveStateUrlVarName); - - final Map inputs = new HashMap<>(); - - inputs.put(getSaveStateParameter(getSaveStateOperation(nodeTemplate)), saveStateUrlVar); - - context.executeOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE, inputs); - } - - if (org.opentosca.container.core.tosca.convention.Utils.isSupportedVMNodeType(templatePlan.getNodeTemplate() - .getType() - .getId())) { - - // fetch infrastructure node (cloud provider) - final List infraNodes = context.getInfrastructureNodes(); - for (final AbstractNodeTemplate infraNode : infraNodes) { - if (org.opentosca.container.core.tosca.convention.Utils.isSupportedCloudProviderNodeType(infraNode.getType() - .getId())) { - // append logic to call terminateVM method on the node - - context.executeOperation(infraNode, - org.opentosca.container.core.tosca.convention.Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER, - org.opentosca.container.core.tosca.convention.Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER_TERMINATEVM, - null); - - changedActivities.add(templatePlan); - } - } - - } else { - - if (!isDockerContainer(context.getNodeTemplate())) { - continue; - } - - // fetch infrastructure node (cloud provider) - final List nodes = new ArrayList<>(); - ModelUtils.getNodesFromNodeToSink(context.getNodeTemplate(), nodes); - - for (final AbstractNodeTemplate node : nodes) { - if (org.opentosca.container.core.tosca.convention.Utils.isSupportedDockerEngineNodeType(node.getType() - .getId())) { - context.executeOperation(node, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER, - null); - changedActivities.add(templatePlan); - } - } - - } - - for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { - if (postPhasePlugin.canHandleCreate(context, nodeTemplate)) { - postPhasePlugin.handleCreate(context, nodeTemplate); - } - } - } - } - - return changedActivities; - - } - - private boolean isDockerContainer(final AbstractNodeTemplate nodeTemplate) { - if (nodeTemplate.getProperties() == null) { - return false; - } - final Element propertyElement = nodeTemplate.getProperties().getDOMElement(); - final NodeList childNodeList = propertyElement.getChildNodes(); - - int check = 0; - boolean foundDockerImageProp = false; - for (int index = 0; index < childNodeList.getLength(); index++) { - if (childNodeList.item(index).getNodeType() != Node.ELEMENT_NODE) { - continue; - } - if (childNodeList.item(index).getLocalName().equals("ContainerPort")) { - check++; - } else if (childNodeList.item(index).getLocalName().equals("Port")) { - check++; - } else if (childNodeList.item(index).getLocalName().equals("ImageID")) { - foundDockerImageProp = true; - } - } - - if (check != 2) { - return false; - } - return true; - } -} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTerminationProcessBuilder.java b/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTerminationProcessBuilder.java deleted file mode 100644 index 00fe95fbd..000000000 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTerminationProcessBuilder.java +++ /dev/null @@ -1,249 +0,0 @@ -package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.soap.Node; - -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.planbuilder.AbstractTerminationPlanBuilder; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; -import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; -import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; -import org.opentosca.planbuilder.core.bpel.typebasednodehandler.BPELPluginHandler; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.ActivityType; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -/** - * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class BPELTerminationProcessBuilder extends AbstractTerminationPlanBuilder { - - private final static Logger LOG = LoggerFactory.getLogger(BPELTerminationProcessBuilder.class); - - // handler for abstract buildplan operations - private BPELPlanHandler planHandler; - - // class for initializing properties inside the build plan - private final PropertyVariableHandler propertyInitializer; - // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans - private SimplePlanBuilderServiceInstanceHandler serviceInstanceHandler; - // adds nodeInstanceIDs to each templatePlan - private NodeRelationInstanceVariablesHandler instanceVarsHandler; - // class for finalizing build plans (e.g when some template didn't receive - // some provisioning logic and they must be filled with empty elements) - private final BPELFinalizer finalizer; - - private BPELPluginHandler bpelPluginHandler = new BPELPluginHandler(); - private CorrelationIDInitializer correlationHandler; - - public BPELTerminationProcessBuilder() { - try { - this.planHandler = new BPELPlanHandler(); - this.serviceInstanceHandler = new SimplePlanBuilderServiceInstanceHandler(); - this.instanceVarsHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); - this.correlationHandler = new CorrelationIDInitializer(); - } - catch (final ParserConfigurationException e) { - BPELTerminationProcessBuilder.LOG.error("Error while initializing BuildPlanHandler", e); - } - this.propertyInitializer = new PropertyVariableHandler(this.planHandler); - this.finalizer = new BPELFinalizer(); - } - - /* - * (non-Javadoc) - * - * @see org.opentosca.planbuilder.IPlanBuilder#buildPlan(java.lang.String, - * org.opentosca.planbuilder.model.tosca.AbstractDefinitions, javax.xml.namespace.QName) - */ - @Override - public BPELPlan buildPlan(final String csarName, final AbstractDefinitions definitions, - final AbstractServiceTemplate serviceTemplate) { - - final String processName = ModelUtils.makeValidNCName(serviceTemplate.getId() + "_terminationPlan"); - final String processNamespace = serviceTemplate.getTargetNamespace() + "_terminationPlan"; - - final AbstractPlan newAbstractTerminationPlan = - generateTOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate); - - final BPELPlan newTerminationPlan = - this.planHandler.createEmptyBPELPlan(processNamespace, processName, newAbstractTerminationPlan, - "terminate"); - - newTerminationPlan.setTOSCAInterfaceName("OpenTOSCA-Lifecycle-Interface"); - newTerminationPlan.setTOSCAOperationname("terminate"); - - this.planHandler.initializeBPELSkeleton(newTerminationPlan, csarName); - - this.instanceVarsHandler.addInstanceURLVarToTemplatePlans(newTerminationPlan, serviceTemplate); - this.instanceVarsHandler.addInstanceIDVarToTemplatePlans(newTerminationPlan, serviceTemplate); - - final Property2VariableMapping propMap = - this.propertyInitializer.initializePropertiesAsVariables(newTerminationPlan, serviceTemplate); - - // instanceDataAPI handling is done solely trough this extension - this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - newTerminationPlan); - - // initialize instanceData handling, add - // instanceDataAPI/serviceInstanceID into input, add global - // variables to hold the value for plugins - this.serviceInstanceHandler.addServiceInstanceHandlingFromInput(newTerminationPlan); - String serviceTemplateURLVarName = - this.serviceInstanceHandler.getServiceTemplateURLVariableName(newTerminationPlan); - - String serviceInstanceId = this.serviceInstanceHandler.findServiceInstanceIdVarName(newTerminationPlan); - - this.serviceInstanceHandler.appendInitPropertyVariablesFromServiceInstanceData(newTerminationPlan, propMap, - serviceTemplateURLVarName, - serviceTemplate, - "?state=STARTED&state=CREATED&state=CONFIGURED"); - - // fetch all nodeinstances that are running - this.instanceVarsHandler.addNodeInstanceFindLogic(newTerminationPlan, - "?state=STARTED&state=CREATED&state=CONFIGURED&serviceInstanceId=$bpelvar[" - + serviceInstanceId + "]", - serviceTemplate); - this.instanceVarsHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(newTerminationPlan, propMap, - serviceTemplate); - - this.instanceVarsHandler.addRelationInstanceFindLogic(newTerminationPlan, - "?state=CREATED&state=INITIAL&serviceInstanceId=$bpelvar[" - + serviceInstanceId + "]", - serviceTemplate); - - final List changedActivities = runPlugins(newTerminationPlan, propMap, csarName); - - String serviceInstanceURLVarName = - this.serviceInstanceHandler.findServiceInstanceUrlVariableName(newTerminationPlan); - - - this.serviceInstanceHandler.appendSetServiceInstanceState(newTerminationPlan, - newTerminationPlan.getBpelMainFlowElement(), - "DELETING", serviceInstanceURLVarName); - - this.serviceInstanceHandler.appendSetServiceInstanceState(newTerminationPlan, - newTerminationPlan.getBpelMainSequenceCallbackInvokeElement(), - "DELETED", serviceInstanceURLVarName); - - this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(newTerminationPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newTerminationPlan), - "ERROR", serviceInstanceURLVarName); - this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(newTerminationPlan, this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newTerminationPlan), "FAILED", this.serviceInstanceHandler.findPlanInstanceUrlVariableName(newTerminationPlan)); - - this.correlationHandler.addCorrellationID(newTerminationPlan); - - this.finalizer.finalize(newTerminationPlan); - - // add for each loop over found node and relation instances to terminate each running - // instance - for (final BPELScope activ : changedActivities) { - if (activ.getNodeTemplate() != null) { - final BPELPlanContext context = - new BPELPlanContext(newTerminationPlan, activ, propMap, newTerminationPlan.getServiceTemplate(), - serviceInstanceURLVarName, serviceInstanceId, serviceTemplateURLVarName, csarName); - this.instanceVarsHandler.appendCountInstancesLogic(context, activ.getNodeTemplate(), - "?state=STARTED&state=CREATED&state=CONFIGURED&serviceInstanceId=$bpelvar[" - + serviceInstanceId + "]"); - } else { - final BPELPlanContext context = - new BPELPlanContext(newTerminationPlan, activ, propMap, newTerminationPlan.getServiceTemplate(), - serviceInstanceURLVarName, serviceInstanceId, serviceTemplateURLVarName, csarName); - this.instanceVarsHandler.appendCountInstancesLogic(context, activ.getRelationshipTemplate(), - "?state=CREATED&state=INITIAL&serviceInstanceId=$bpelvar[" - + serviceInstanceId + "]"); - } - } - - return newTerminationPlan; - - } - - /* - * (non-Javadoc) - * - * @see org.opentosca.planbuilder.IPlanBuilder#buildPlans(java.lang.String, - * org.opentosca.planbuilder.model.tosca.AbstractDefinitions) - */ - @Override - public List buildPlans(final String csarName, final AbstractDefinitions definitions) { - final List plans = new ArrayList<>(); - for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { - - if (!serviceTemplate.hasBuildPlan()) { - BPELTerminationProcessBuilder.LOG.debug("ServiceTemplate {} has no TerminationPlan, generating TerminationPlan", - serviceTemplate.getQName().toString()); - final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); - - if (newBuildPlan != null) { - BPELTerminationProcessBuilder.LOG.debug("Created TerminationPlan " - + newBuildPlan.getBpelProcessElement().getAttribute("name")); - plans.add(newBuildPlan); - } - } else { - BPELTerminationProcessBuilder.LOG.debug("ServiceTemplate {} has TerminationPlan, no generation needed", - serviceTemplate.getQName().toString()); - } - } - return plans; - } - - /** - * This method will execute plugins on each TemplatePlan inside the given plan for termination of - * each node and relation. - * - * @param plan the plan to execute the plugins on - * @param serviceTemplate the serviceTemplate the plan belongs to - * @param propMap a PropertyMapping from NodeTemplate to Properties to BPELVariables - */ - private List runPlugins(final BPELPlan plan, final Property2VariableMapping propMap, String csarName) { - - String serviceInstanceUrl = this.serviceInstanceHandler.findServiceInstanceUrlVariableName(plan); - String serviceInstanceId = this.serviceInstanceHandler.findServiceInstanceIdVarName(plan); - String serviceTemplateUrl = this.serviceInstanceHandler.findServiceTemplateUrlVariableName(plan); - - final List changedActivities = new ArrayList<>(); - for (final BPELScope bpelScope : plan.getTemplateBuildPlans()) { - boolean result = false; - if (bpelScope.getNodeTemplate() != null) { - final AbstractNodeTemplate nodeTemplate = bpelScope.getNodeTemplate(); - final BPELPlanContext context = new BPELPlanContext(plan, bpelScope, propMap, plan.getServiceTemplate(), - serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); - result = this.bpelPluginHandler.handleActivity(context, bpelScope, nodeTemplate); - } else { - AbstractRelationshipTemplate relationshipTempalte = bpelScope.getRelationshipTemplate(); - final BPELPlanContext context = new BPELPlanContext(plan, bpelScope, propMap, plan.getServiceTemplate(), - serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); - result = this.bpelPluginHandler.handleActivity(context, bpelScope, relationshipTempalte); - } - - if (result) { - changedActivities.add(bpelScope); - } - - } - return changedActivities; - } - -} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTransformationProcessBuilder.java b/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTransformationProcessBuilder.java deleted file mode 100644 index 993608108..000000000 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTransformationProcessBuilder.java +++ /dev/null @@ -1,609 +0,0 @@ -package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; - -import java.util.Collection; -import java.util.HashSet; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.core.runtime.CoreException; -import org.opentosca.planbuilder.AbstractTransformingPlanbuilder; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; -import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; -import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.EmptyPropertyToInputHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.ServiceTemplateBoundaryPropertyMappingsToOutputHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.SituationTriggerRegistration; -import org.opentosca.planbuilder.core.bpel.typebasednodehandler.BPELPluginHandler; -import org.opentosca.planbuilder.model.plan.AbstractActivity; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.AbstractTransformationPlan; -import org.opentosca.planbuilder.model.plan.ActivityType; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; - -public class BPELTransformationProcessBuilder extends AbstractTransformingPlanbuilder { - - // class for initializing properties inside the plan - private final PropertyVariableHandler propertyInitializer; - // class for initializing output with boundarydefinitions of a - // serviceTemplate - private final ServiceTemplateBoundaryPropertyMappingsToOutputHandler propertyOutputInitializer; - // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans - - private SimplePlanBuilderServiceInstanceHandler serviceInstanceHandler; - - // class for finalizing build plans (e.g when some template didn't receive - // some provisioning logic and they must be filled with empty elements) - private final BPELFinalizer finalizer; - - private BPELPlanHandler planHandler; - - private BPELPluginHandler bpelPluginHandler = new BPELPluginHandler(); - - private NodeRelationInstanceVariablesHandler nodeRelationInstanceHandler; - - private final EmptyPropertyToInputHandler emptyPropInit = new EmptyPropertyToInputHandler(); - - private CorrelationIDInitializer correlationHandler; - - public BPELTransformationProcessBuilder() { - try { - this.planHandler = new BPELPlanHandler(); - this.serviceInstanceHandler = new SimplePlanBuilderServiceInstanceHandler(); - this.nodeRelationInstanceHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); - this.correlationHandler = new CorrelationIDInitializer(); - } - catch (final ParserConfigurationException e) { - BPELBuildProcessBuilder.LOG.error("Error while initializing BuildPlanHandler", e); - } - // TODO seems ugly - this.propertyInitializer = new PropertyVariableHandler(this.planHandler); - this.propertyOutputInitializer = new ServiceTemplateBoundaryPropertyMappingsToOutputHandler(); - this.finalizer = new BPELFinalizer(); - } - - - /** - * Creates an Adaptation PLan that can change the configuration of a running Service Instance by - * transforming the current state of nodes and relations (sourceNodeTemplates and - * -RelationshipTemplates) to a target configuration (targetNodeTemplates and - * -RelationshipTemplates). - * - * @param csarName the csar of the service template - * @param definitions the definitions document of th service template - * @param serviceTemplateId the id of the serviceTemplate to adapt its service instance - * @param sourceNodeTemplates the nodeTemplates to adapt from - * @param sourceRelationshipTemplates the relationships to adapt from - * @param targetNodeTemplates the target configuration of nodes to adapt to - * @param targetRelationshipTemplates the target configuration of relations to adapt to - * @return a BPEL Plan that is able to adapt an instance from the given current and target - * configurations - */ - public BPELPlan buildPlan(String csarName, AbstractDefinitions definitions, QName serviceTemplateId, - Collection sourceNodeTemplates, - Collection sourceRelationshipTemplates, - Collection targetNodeTemplates, - Collection targetRelationshipTemplates) { - AbstractServiceTemplate serviceTemplate = this.getServiceTemplate(definitions, serviceTemplateId); - - // generate abstract plan - AbstractTransformationPlan adaptationPlan = - this.generateTFOG(csarName, definitions, serviceTemplate, sourceNodeTemplates, sourceRelationshipTemplates, - csarName, definitions, serviceTemplate, targetNodeTemplates, targetRelationshipTemplates); - - - Long id = System.currentTimeMillis(); - - // transform to bpel skeleton - final String processName = - ModelUtils.makeValidNCName(serviceTemplate.getId() + "_adaptationPlan_" + id); - final String processNamespace = serviceTemplate.getTargetNamespace() + "_adaptiationPlan"; - - BPELPlan transformationBPELPlan = - this.planHandler.createEmptyBPELPlan(processNamespace, processName, adaptationPlan, "adapt" + id); - - - - transformationBPELPlan.setTOSCAInterfaceName("OpenTOSCA-Transformation-Interface"); - transformationBPELPlan.setTOSCAOperationname("adapt" + id); - - this.planHandler.initializeBPELSkeleton(transformationBPELPlan, csarName); - // instanceDataAPI handling is done solely trough this extension - this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - transformationBPELPlan); - - // set instance ids for relationships and nodes - this.addNodeRelationInstanceVariables(transformationBPELPlan, serviceTemplate, serviceTemplate); - - // generate variables for properties - final Property2VariableMapping sourcesProp2VarMap = - this.propertyInitializer.initializePropertiesAsVariables(transformationBPELPlan, serviceTemplate, - adaptationPlan.getHandledSourceServiceTemplateNodes(), - adaptationPlan.getHandledSourceServiceTemplateRelations()); - - final Property2VariableMapping targetsProp2VarMap = - this.propertyInitializer.initializePropertiesAsVariables(transformationBPELPlan, serviceTemplate, - adaptationPlan.getHandledTargetServiceTemplateNodes(), - adaptationPlan.getHandledTargetServiceTemplateRelations()); - - - // add correlation id and handling for input and output - this.correlationHandler.addCorrellationID(transformationBPELPlan); - - // service instance handling - String sourceServiceInstancesURL = - this.serviceInstanceHandler.addInstanceDataAPIURLVariable(transformationBPELPlan); - - - String serviceTemplateURL = this.serviceInstanceHandler.addServiceTemplateURLVariable(transformationBPELPlan); - - - String serviceInstanceID = this.serviceInstanceHandler.addServiceInstanceIDVariable(transformationBPELPlan); - - - String serviceInstanceURL = this.serviceInstanceHandler.addServiceInstanceURLVariable(transformationBPELPlan); - - - String planInstanceURL = this.serviceInstanceHandler.addPlanInstanceURLVariable(transformationBPELPlan); - - // handle sourceinstance information, e.g., load instance url/, template url and - // properties - // append reading source service instance from input and setting created - // variables - this.serviceInstanceHandler.addServiceInstanceHandlingFromInput(transformationBPELPlan, - sourceServiceInstancesURL, serviceInstanceURL, - serviceTemplateURL, serviceInstanceID, - planInstanceURL); - - // load nodeTemplate properties from source service instance - Collection terminationScopes = this.getTerminationScopes(transformationBPELPlan); - this.serviceInstanceHandler.appendInitPropertyVariablesFromServiceInstanceData(transformationBPELPlan, - sourcesProp2VarMap, - serviceTemplateURL, - terminationScopes, - serviceTemplate, - "?state=STARTED&state=CREATED&state=CONFIGURED"); - - - - // return created service instance - this.serviceInstanceHandler.appendAssignServiceInstanceIdToOutput(transformationBPELPlan, serviceInstanceID); - - // we need only input for instances that will be created in the target, deleted or migrated node - // instances should never get data from the input - this.emptyPropInit.initializeEmptyPropertiesAsInputParam(this.getProvisioningScopes(transformationBPELPlan), - transformationBPELPlan, sourcesProp2VarMap, - serviceInstanceURL, serviceInstanceID, - serviceTemplateURL, serviceTemplate, csarName); - - for (BPELScope scope : terminationScopes) { - if (scope.getNodeTemplate() != null) { - this.nodeRelationInstanceHandler.addNodeInstanceFindLogic(scope, serviceTemplateURL, - "?state=STARTED&state=CREATED&state=CONFIGURED", - serviceTemplate); - this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(scope, - sourcesProp2VarMap, - serviceTemplate); - } else { - this.nodeRelationInstanceHandler.addRelationInstanceFindLogic(scope, serviceTemplateURL, - "?state=CREATED&state=INITIAL", - serviceTemplate); - - - this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnRelationInstanceID(scope, - sourcesProp2VarMap, - serviceTemplate); - } - } - - for (BPELScope scope : getMigrationScopes(transformationBPELPlan)) { - if (scope.getNodeTemplate() != null) { - this.nodeRelationInstanceHandler.addNodeInstanceFindLogic(scope, serviceTemplateURL, - "?state=STARTED&state=CREATED&state=CONFIGURED", - serviceTemplate); - this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(scope, - sourcesProp2VarMap, - serviceTemplate); - } else { - this.nodeRelationInstanceHandler.addRelationInstanceFindLogic(scope, serviceTemplateURL, - "?state=CREATED&state=INITIAL", - serviceTemplate); - - this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnRelationInstanceID(scope, - sourcesProp2VarMap, - serviceTemplate); - } - } - - this.runPlugins(transformationBPELPlan, sourcesProp2VarMap, targetsProp2VarMap, csarName, serviceTemplate, - serviceInstanceURL, serviceInstanceID, serviceTemplateURL, csarName, serviceTemplate, - serviceInstanceURL, serviceInstanceID, serviceTemplateURL); - - - this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, - transformationBPELPlan.getBpelMainFlowElement(), - "ADAPTING", serviceInstanceURL); - - this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, - transformationBPELPlan.getBpelMainSequenceOutputAssignElement(), - "CREATED", serviceInstanceURL); - - - - this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(transformationBPELPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(transformationBPELPlan), - "ERROR", serviceInstanceURL); - this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(transformationBPELPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(transformationBPELPlan), - "FAILED", - this.serviceInstanceHandler.findPlanInstanceUrlVariableName(transformationBPELPlan)); - - this.finalizer.finalize(transformationBPELPlan); - - // iterate over terminated nodes and create for each loop per instance - for (BPELScope scope : terminationScopes) { - if (scope.getNodeTemplate() != null) { - final BPELPlanContext context = new BPELPlanContext(transformationBPELPlan, scope, sourcesProp2VarMap, - transformationBPELPlan.getServiceTemplate(), serviceInstanceURL, serviceInstanceID, - serviceTemplateURL, csarName); - this.nodeRelationInstanceHandler.appendCountInstancesLogic(context, scope.getNodeTemplate(), - "?state=STARTED&state=CREATED&state=CONFIGURED"); - } else { - final BPELPlanContext context = new BPELPlanContext(transformationBPELPlan, scope, sourcesProp2VarMap, - transformationBPELPlan.getServiceTemplate(), serviceInstanceURL, serviceInstanceID, - serviceTemplateURL, csarName); - this.nodeRelationInstanceHandler.appendCountInstancesLogic(context, scope.getRelationshipTemplate(), - "?state=CREATED&state=INITIAL"); - } - } - - return transformationBPELPlan; - } - - @Override - public BPELPlan buildPlan(String sourceCsarName, AbstractDefinitions sourceDefinitions, - QName sourceServiceTemplateId, String targetCsarName, - AbstractDefinitions targetDefinitions, QName targetServiceTemplateId) { - - AbstractServiceTemplate sourceServiceTemplate = null; - AbstractServiceTemplate targetServiceTemplate = null; - sourceServiceTemplate = this.getServiceTemplate(sourceDefinitions, sourceServiceTemplateId); - targetServiceTemplate = this.getServiceTemplate(targetDefinitions, targetServiceTemplateId); - - // generate abstract plan - AbstractTransformationPlan transformationPlan = - this.generateTFOG(sourceCsarName, sourceDefinitions, sourceServiceTemplate, targetCsarName, - targetDefinitions, targetServiceTemplate); - - - // transform to bpel skeleton - final String processName = ModelUtils.makeValidNCName(sourceServiceTemplate.getId() + "_transformTo_" - + targetServiceTemplate.getId() + "_plan"); - final String processNamespace = sourceServiceTemplate.getTargetNamespace() + "_transformPlan"; - - BPELPlan transformationBPELPlan = - this.planHandler.createEmptyBPELPlan(processNamespace, processName, transformationPlan, "transform"); - - - - transformationBPELPlan.setTOSCAInterfaceName("OpenTOSCA-Transformation-Interface"); - transformationBPELPlan.setTOSCAOperationname("transform"); - - this.planHandler.initializeBPELSkeleton(transformationBPELPlan, sourceCsarName); - // instanceDataAPI handling is done solely trough this extension - this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - transformationBPELPlan); - - // set instance ids for relationships and nodes - this.addNodeRelationInstanceVariables(transformationBPELPlan, sourceServiceTemplate, targetServiceTemplate); - - // generate variables for properties - final Property2VariableMapping sourcePropMap = - this.propertyInitializer.initializePropertiesAsVariables(transformationBPELPlan, sourceServiceTemplate, - transformationPlan.getHandledSourceServiceTemplateNodes(), - transformationPlan.getHandledSourceServiceTemplateRelations()); - final Property2VariableMapping targetPropMap = - this.propertyInitializer.initializePropertiesAsVariables(transformationBPELPlan, targetServiceTemplate, - transformationPlan.getHandledTargetServiceTemplateNodes(), - transformationPlan.getHandledTargetServiceTemplateRelations()); - - // add correlation id and handling for input and output - this.correlationHandler.addCorrellationID(transformationBPELPlan); - - // service instance handling - String sourceServiceInstancesURL = - this.serviceInstanceHandler.addInstanceDataAPIURLVariable(transformationBPELPlan); - String targetServiceInstancesURL = - this.serviceInstanceHandler.addInstanceDataAPIURLVariable(transformationBPELPlan); - String sourceServiceTemplateURL = - this.serviceInstanceHandler.addServiceTemplateURLVariable(transformationBPELPlan); - String targetServiceTemplateURL = - this.serviceInstanceHandler.addServiceTemplateURLVariable(transformationBPELPlan); - String sourceServiceInstanceID = - this.serviceInstanceHandler.addServiceInstanceIDVariable(transformationBPELPlan); - String targetServiceInstanceID = - this.serviceInstanceHandler.addServiceInstanceIDVariable(transformationBPELPlan); - String sourceServiceInstanceURL = - this.serviceInstanceHandler.addServiceInstanceURLVariable(transformationBPELPlan); - String targetServiceInstanceURL = - this.serviceInstanceHandler.addServiceInstanceURLVariable(transformationBPELPlan); - - String planInstanceURL = this.serviceInstanceHandler.addPlanInstanceURLVariable(transformationBPELPlan); - - // handle sourceinstance information, e.g., load instance url/, template url and - // properties - // append reading source service instance from input and setting created - // variables - this.serviceInstanceHandler.addServiceInstanceHandlingFromInput(transformationBPELPlan, - sourceServiceInstancesURL, - sourceServiceInstanceURL, - sourceServiceTemplateURL, - sourceServiceInstanceID, planInstanceURL); - - // load nodeTemplate properties from source service instance - Collection terminationScopes = this.getTerminationScopes(transformationBPELPlan); - this.serviceInstanceHandler.appendInitPropertyVariablesFromServiceInstanceData(transformationBPELPlan, - sourcePropMap, - sourceServiceTemplateURL, - terminationScopes, - sourceServiceTemplate, - "?state=STARTED&state=CREATED&state=CONFIGURED"); - - // handle target service instance information - this.serviceInstanceHandler.initServiceInstancesURLVariableFromAvailableServiceInstanceUrlVar(transformationBPELPlan, - sourceServiceInstancesURL, - targetServiceTemplateId, - targetCsarName, - targetServiceInstancesURL); - // create service instance for target - this.serviceInstanceHandler.appendCreateServiceInstance(transformationBPELPlan, targetServiceInstancesURL, - targetServiceInstanceURL, targetServiceInstanceID, - targetServiceTemplateURL, planInstanceURL, true); - - // return created service instance - this.serviceInstanceHandler.appendAssignServiceInstanceIdToOutput(transformationBPELPlan, - targetServiceInstanceID); - - // we need only input for instances that will be created in the target, deleted or migrated node - // instances should never get data from the input - this.emptyPropInit.initializeEmptyPropertiesAsInputParam(this.getProvisioningScopes(transformationBPELPlan), - transformationBPELPlan, targetPropMap, - targetServiceInstanceURL, targetServiceInstanceID, - targetServiceTemplateURL, targetServiceTemplate, - targetCsarName); - - for (BPELScope scope : terminationScopes) { - if (scope.getNodeTemplate() != null) { - this.nodeRelationInstanceHandler.addNodeInstanceFindLogic(scope, sourceServiceTemplateURL, - "?state=STARTED&state=CREATED&state=CONFIGURED", - sourceServiceTemplate); - this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(scope, sourcePropMap, - sourceServiceTemplate); - } else { - this.nodeRelationInstanceHandler.addRelationInstanceFindLogic(scope, sourceServiceTemplateURL, - "?state=CREATED&state=INITIAL", - sourceServiceTemplate); - - - this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnRelationInstanceID(scope, - sourcePropMap, - sourceServiceTemplate); - } - } - - for (BPELScope scope : getMigrationScopes(transformationBPELPlan)) { - if (scope.getNodeTemplate() != null) { - this.nodeRelationInstanceHandler.addNodeInstanceFindLogic(scope, sourceServiceTemplateURL, - "?state=STARTED&state=CREATED&state=CONFIGURED", - sourceServiceTemplate); - this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(scope, sourcePropMap, - sourceServiceTemplate); - } else { - this.nodeRelationInstanceHandler.addRelationInstanceFindLogic(scope, sourceServiceTemplateURL, - "?state=CREATED&state=INITIAL", - sourceServiceTemplate); - - this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnRelationInstanceID(scope, - sourcePropMap, - sourceServiceTemplate); - } - } - - this.runPlugins(transformationBPELPlan, sourcePropMap, targetPropMap, sourceCsarName, sourceServiceTemplate, - sourceServiceInstanceURL, sourceServiceInstanceID, sourceServiceTemplateURL, targetCsarName, - targetServiceTemplate, targetServiceInstanceURL, targetServiceInstanceID, - targetServiceTemplateURL); - - - this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, - transformationBPELPlan.getBpelMainFlowElement(), - "MIGRATING", sourceServiceInstanceURL); - this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, - transformationBPELPlan.getBpelMainFlowElement(), - "CREATING", targetServiceInstanceURL); - this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, - transformationBPELPlan.getBpelMainSequenceOutputAssignElement(), - "MIGRATED", sourceServiceInstanceURL); - this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, - transformationBPELPlan.getBpelMainSequenceOutputAssignElement(), - "CREATED", targetServiceInstanceURL); - - this.finalizer.finalize(transformationBPELPlan); - - // iterate over terminated nodes and create for each loop per instance - for (BPELScope scope : terminationScopes) { - if (scope.getNodeTemplate() != null) { - final BPELPlanContext context = new BPELPlanContext(transformationBPELPlan, scope, sourcePropMap, - transformationBPELPlan.getServiceTemplate(), sourceServiceInstanceURL, sourceServiceInstanceID, - sourceServiceTemplateURL, sourceCsarName); - this.nodeRelationInstanceHandler.appendCountInstancesLogic(context, scope.getNodeTemplate(), - "?state=STARTED&state=CREATED&state=CONFIGURED"); - } else { - final BPELPlanContext context = new BPELPlanContext(transformationBPELPlan, scope, sourcePropMap, - transformationBPELPlan.getServiceTemplate(), sourceServiceInstanceURL, sourceServiceInstanceID, - sourceServiceTemplateURL, sourceCsarName); - this.nodeRelationInstanceHandler.appendCountInstancesLogic(context, scope.getRelationshipTemplate(), - "?state=CREATED&state=INITIAL"); - } - } - - return transformationBPELPlan; - } - - private Collection getMigrationScopes(BPELPlan plan) { - return this.getScopesByType(plan, ActivityType.MIGRATION); - } - - private Collection getScopesByType(BPELPlan plan, ActivityType type) { - Collection scopes = new HashSet(); - for (AbstractActivity act : plan.getAbstract2BPEL().keySet()) { - if (act.getType().equals(type)) { - scopes.add(plan.getAbstract2BPEL().get(act)); - } - } - return scopes; - } - - private Collection getTerminationScopes(BPELPlan plan) { - return this.getScopesByType(plan, ActivityType.TERMINATION); - } - - - private Collection getProvisioningScopes(BPELPlan plan) { - return this.getScopesByType(plan, ActivityType.PROVISIONING); - } - - private AbstractServiceTemplate getServiceTemplate(AbstractDefinitions defs, QName serviceTemplateId) { - for (AbstractServiceTemplate servTemplate : defs.getServiceTemplates()) { - if (servTemplate.getQName().equals(serviceTemplateId)) { - return servTemplate; - } - } - return null; - } - - private void addNodeRelationInstanceVariables(BPELPlan plan, AbstractServiceTemplate sourceServiceTemplate, - AbstractServiceTemplate targetServiceTemplate) { - this.nodeRelationInstanceHandler.addInstanceIDVarToTemplatePlans(plan, sourceServiceTemplate); - this.nodeRelationInstanceHandler.addInstanceIDVarToTemplatePlans(plan, targetServiceTemplate); - - this.nodeRelationInstanceHandler.addInstanceURLVarToTemplatePlans(plan, sourceServiceTemplate); - this.nodeRelationInstanceHandler.addInstanceURLVarToTemplatePlans(plan, targetServiceTemplate); - - } - - @Override - public List buildPlans(String sourceCsarName, AbstractDefinitions sourceDefinitions, - String targetCsarName, AbstractDefinitions targetDefinitions) { - // TODO Auto-generated method stub - return null; - } - - private void runPlugins(final BPELPlan buildPlan, final Property2VariableMapping sourceServiceTemplateMap, - final Property2VariableMapping targetServiceTemplateMap, String sourceCsarName, - AbstractServiceTemplate sourceServiceTemplate, String sourceServiceInstanceUrl, - String sourceServiceInstanceId, String sourceServiceTemplateUrl, String targetCsarName, - AbstractServiceTemplate targetServiceTemplate, String targetServiceInstanceUrl, - String targetServiceInstanceId, String targetServiceTemplateUrl) { - - for (final BPELScope bpelScope : buildPlan.getTemplateBuildPlans()) { - - if (bpelScope.getNodeTemplate() != null) { - - AbstractActivity activity = bpelScope.getActivity(); - - if (activity.getType().equals(ActivityType.PROVISIONING)) { - final BPELPlanContext context = new BPELPlanContext(buildPlan, bpelScope, targetServiceTemplateMap, - targetServiceTemplate, targetServiceInstanceUrl, targetServiceInstanceId, - targetServiceTemplateUrl, targetCsarName); - this.bpelPluginHandler.handleActivity(context, bpelScope, bpelScope.getNodeTemplate()); - } else if (activity.getType().equals(ActivityType.TERMINATION)) { - final BPELPlanContext context = new BPELPlanContext(buildPlan, bpelScope, sourceServiceTemplateMap, - sourceServiceTemplate, sourceServiceInstanceUrl, sourceServiceInstanceId, - sourceServiceTemplateUrl, sourceCsarName); - this.bpelPluginHandler.handleActivity(context, bpelScope, bpelScope.getNodeTemplate()); - } else if (activity.getType().equals(ActivityType.MIGRATION)) { - - AbstractNodeTemplate sourceNodeTemplate = bpelScope.getNodeTemplate(); - AbstractNodeTemplate targetNodeTemplate = - this.getCorrespondingNode(bpelScope.getNodeTemplate(), - targetServiceTemplate.getTopologyTemplate().getNodeTemplates()); - - - final BPELPlanContext sourceContext = new BPELPlanContext(buildPlan, bpelScope, - sourceServiceTemplateMap, sourceServiceTemplate, sourceServiceInstanceUrl, - sourceServiceInstanceId, sourceServiceTemplateUrl, sourceCsarName); - - final BPELPlanContext targetContext = new BPELPlanContext(buildPlan, bpelScope, - targetServiceTemplateMap, targetServiceTemplate, targetServiceInstanceUrl, - targetServiceInstanceId, targetServiceTemplateUrl, targetCsarName); - - for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { - if (postPhasePlugin.canHandleUpdate(sourceNodeTemplate, targetNodeTemplate)) { - postPhasePlugin.handleUpdate(sourceContext, targetContext, sourceNodeTemplate, - targetNodeTemplate); - } - } - - } - // if this nodeTemplate has the label running (Property: State=Running), skip - // provisioning and just generate instance data handlin - - // generate code for the activity - } else if (bpelScope.getRelationshipTemplate() != null) { - // handling relationshiptemplate - - AbstractActivity activity = bpelScope.getActivity(); - if (activity.getType().equals(ActivityType.PROVISIONING)) { - final BPELPlanContext context = new BPELPlanContext(buildPlan, bpelScope, targetServiceTemplateMap, - targetServiceTemplate, targetServiceInstanceUrl, targetServiceInstanceId, - targetServiceTemplateUrl, targetCsarName); - this.bpelPluginHandler.handleActivity(context, bpelScope, bpelScope.getRelationshipTemplate()); - } else if (activity.getType().equals(ActivityType.TERMINATION)) { - final BPELPlanContext context = new BPELPlanContext(buildPlan, bpelScope, sourceServiceTemplateMap, - sourceServiceTemplate, sourceServiceInstanceUrl, sourceServiceInstanceId, - sourceServiceTemplateUrl, sourceCsarName); - this.bpelPluginHandler.handleActivity(context, bpelScope, bpelScope.getRelationshipTemplate()); - } else if (activity.getType().equals(ActivityType.MIGRATION)) { - - AbstractRelationshipTemplate sourceRelationshipTemplate = bpelScope.getRelationshipTemplate(); - AbstractRelationshipTemplate targetRelationshipTemplate = - this.getCorrespondingEdge(bpelScope.getRelationshipTemplate(), - targetServiceTemplate.getTopologyTemplate() - .getRelationshipTemplates()); - - final BPELPlanContext sourceContext = new BPELPlanContext(buildPlan, bpelScope, - sourceServiceTemplateMap, sourceServiceTemplate, sourceServiceInstanceUrl, - sourceServiceInstanceId, sourceServiceTemplateUrl, sourceCsarName); - - final BPELPlanContext targetContext = new BPELPlanContext(buildPlan, bpelScope, - targetServiceTemplateMap, targetServiceTemplate, targetServiceInstanceUrl, - targetServiceInstanceId, targetServiceTemplateUrl, targetCsarName); - - for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { - if (postPhasePlugin.canHandleUpdate(sourceRelationshipTemplate, targetRelationshipTemplate)) { - postPhasePlugin.handleUpdate(sourceContext, targetContext, sourceRelationshipTemplate, - targetRelationshipTemplate); - } - } - } - - } - - } - } - -} diff --git a/org.opentosca.planbuilder.csarhandler/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.csarhandler/META-INF/MANIFEST.MF deleted file mode 100644 index b2d99d903..000000000 --- a/org.opentosca.planbuilder.csarhandler/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Csarhandler -Bundle-SymbolicName: org.opentosca.planbuilder.csarhandler;singleton:=true -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.osgi.framework;version="1.6.0", - org.slf4j;version="1.6.4" -Export-Package: org.opentosca.planbuilder.csarhandler -Bundle-Activator: org.opentosca.planbuilder.csarhandler.Activator -Bundle-ClassPath: . -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0" -Service-Component: OSGI-INF/* -Bundle-ActivationPolicy: lazy diff --git a/org.opentosca.planbuilder.csarhandler/OSGI-INF/CSARHandlerServiceRegistry.xml b/org.opentosca.planbuilder.csarhandler/OSGI-INF/CSARHandlerServiceRegistry.xml deleted file mode 100644 index a89180020..000000000 --- a/org.opentosca.planbuilder.csarhandler/OSGI-INF/CSARHandlerServiceRegistry.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.planbuilder.csarhandler/build.properties b/org.opentosca.planbuilder.csarhandler/build.properties deleted file mode 100644 index 542153b3a..000000000 --- a/org.opentosca.planbuilder.csarhandler/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ - diff --git a/org.opentosca.planbuilder.csarhandler/pom.xml b/org.opentosca.planbuilder.csarhandler/pom.xml deleted file mode 100644 index cfaaca12c..000000000 --- a/org.opentosca.planbuilder.csarhandler/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.csarhandler - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/Activator.java b/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/Activator.java deleted file mode 100644 index b9f89b5ed..000000000 --- a/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/Activator.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.opentosca.planbuilder.csarhandler; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - protected static BundleContext bundleContext; - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext arg0) throws Exception { - if (Activator.bundleContext == null) { - Activator.bundleContext = arg0; - } - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext arg0) throws Exception { - if (Activator.bundleContext.equals(arg0)) { - Activator.bundleContext = null; - } - } - -} diff --git a/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/CSARHandler.java b/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/CSARHandler.java deleted file mode 100644 index 81fce6375..000000000 --- a/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/CSARHandler.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.opentosca.planbuilder.csarhandler; - -import java.io.File; - -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.csar.CSARContent; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.ICoreFileService; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - *

    - * This class is a small layer over the ICoreFileService of the OpenTOSCA Core - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class CSARHandler { - - final private static Logger LOG = LoggerFactory.getLogger(CSARHandler.class); - - - /** - * Stores a CSAR given as file object - * - * @param file File referencing a CSAR - * @return an Object representing an ID of the stored CSAR, if something went wrong null is returned - * instead - * @throws SystemException - * @throws UserException - */ - public Object storeCSAR(final File file) throws UserException, SystemException { - CSARHandler.LOG.debug("Trying to store csar"); - final ICoreFileService fileService = this.fetchCoreFileService(); - - final CSARID csarId = fileService.storeCSAR(file.toPath()); - if (csarId == null) { - CSARHandler.LOG.warn("Storing CSAR file failed"); - return null; - } - CSARHandler.LOG.info("Storing CSAR file was successful"); - return csarId; - } - - /** - * Deletes all CSARs in the OpenTOSCA Core - */ - public void deleteAllCsars() { - CSARHandler.LOG.info("Deleting all CSAR files"); - final ICoreFileService fileService = this.fetchCoreFileService(); - - try { - fileService.deleteCSARs(); - } - catch (final SystemException e) { - - } - } - - /** - * Returns a CSARContent Object for the given CSARID - * - * @param id a CSARID - * @return the CSARContent for the given CSARID - * @throws UserException is thrown when something inside the OpenTOSCA Core fails - */ - public CSARContent getCSARContentForID(final CSARID id) throws UserException { - LOG.debug("Fetching CSARContent for given ID"); - return this.fetchCoreFileService().getCSAR(id); - } - - private ICoreFileService fetchCoreFileService() { - CSARHandler.LOG.debug("Retrieving bundle context"); - BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext(); - - if (bundleContext == null) { - CSARHandler.LOG.debug("BundleContext from FrameworkUtil is null. Fallback to Activator."); - bundleContext = Activator.bundleContext; - } - - if (bundleContext != null) { - CSARHandler.LOG.debug("Retrieving ServiceReference for ICoreFileService"); - final ServiceReference fileServiceRef = - bundleContext.getServiceReference(ICoreFileService.class.getName()); - CSARHandler.LOG.debug("Retrieving Service for ICoreFileService"); - final ICoreFileService fileService = (ICoreFileService) bundleContext.getService(fileServiceRef); - return fileService; - } else { - LOG.debug("BundleContext still null. Fallback to ServiceRegistry"); - return ServiceRegistry.getCoreFileService(); - } - } - -} diff --git a/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/ServiceRegistry.java b/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/ServiceRegistry.java deleted file mode 100644 index d7388ffbb..000000000 --- a/org.opentosca.planbuilder.csarhandler/src/org/opentosca/planbuilder/csarhandler/ServiceRegistry.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.opentosca.planbuilder.csarhandler; - -import org.opentosca.container.core.service.ICoreFileService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - *

    - * This class is used to bind different services for the CSARHandler - *

    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class ServiceRegistry { - - final private static Logger LOG = LoggerFactory.getLogger(ServiceRegistry.class); - - private static ICoreFileService openTOSCACoreFileService = null; - - - protected void bindOpenTOSCACoreFileService(final ICoreFileService fileService) { - LOG.debug("Binding CoreFileService"); - ServiceRegistry.openTOSCACoreFileService = fileService; - } - - protected void unbindOpenTOSCACoreFileService(final ICoreFileService fileService) { - LOG.debug("Unbinding CoreFileService"); - ServiceRegistry.openTOSCACoreFileService = null; - } - - protected static ICoreFileService getCoreFileService() { - return ServiceRegistry.openTOSCACoreFileService; - } -} diff --git a/org.opentosca.planbuilder.integration/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.integration/META-INF/MANIFEST.MF deleted file mode 100644 index 98af5400c..000000000 --- a/org.opentosca.planbuilder.integration/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA PlanBuilder IntegrationLayer Bundle -Bundle-SymbolicName: org.opentosca.planbuilder.integration -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.opentosca.planbuilder.export, - org.opentosca.planbuilder.importer, - org.opentosca.planbuilder.importer.context.impl, - org.opentosca.planbuilder.integration.layer;uses:="org.opentosca.planbuilder.model.tosca,org.opentosca.planbuilder.model.plan,javax.xml.namespace" -Require-Bundle: org.opentosca.planbuilder;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Import-Package: com.ibm.wsdl, - javax.wsdl;version="1.6.0", - javax.wsdl.factory;version="1.6.0", - javax.wsdl.xml;version="1.6.0", - org.apache.commons.io;version="2.2.0", - org.opentosca.container.core.common, - org.opentosca.container.core.model, - org.opentosca.container.core.model.csar, - org.opentosca.container.core.model.csar.id, - org.opentosca.container.core.next.xml, - org.opentosca.container.core.service, - org.opentosca.planbuilder.csarhandler, - org.osgi.framework;version="1.8.0", - org.slf4j diff --git a/org.opentosca.planbuilder.integration/build.properties b/org.opentosca.planbuilder.integration/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.planbuilder.integration/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.planbuilder.integration/pom.xml b/org.opentosca.planbuilder.integration/pom.xml deleted file mode 100644 index accb35930..000000000 --- a/org.opentosca.planbuilder.integration/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.integration - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/Application.java b/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/Application.java deleted file mode 100644 index 99fca7617..000000000 --- a/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/Application.java +++ /dev/null @@ -1,314 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2017.06.28 at 10:18:28 AM CEST -// - -package org.eclipse.winery.model.selfservice; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlList; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType>
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="csarName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="displayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="version" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    - *         <element name="authors" minOccurs="0">
    - *           <simpleType>
    - *             <list itemType="{http://www.w3.org/2001/XMLSchema}string" />
    - *           </simpleType>
    - *         </element>
    - *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="iconUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="imageUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="options">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="option" type="{http://www.eclipse.org/winery/model/selfservice}ApplicationOption" maxOccurs="unbounded" minOccurs="0"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", - propOrder = {"csarName", "displayName", "version", "authors", "description", "iconUrl", "imageUrl", "options"}) -@XmlRootElement(name = "Application") -public class Application { - - @XmlElement(required = true) - protected String csarName; - @XmlElement(required = true) - protected String displayName; - protected String version; - @XmlList - protected List authors; - @XmlElement(required = true) - protected String description; - @XmlElement(required = true) - protected String iconUrl; - @XmlElement(required = true) - protected String imageUrl; - @XmlElement(required = true) - protected Application.Options options; - - - /** - * Gets the value of the csarName property. - * - * @return possible object is {@link String } - * - */ - public String getCsarName() { - return this.csarName; - } - - /** - * Sets the value of the csarName property. - * - * @param value allowed object is {@link String } - * - */ - public void setCsarName(final String value) { - this.csarName = value; - } - - /** - * Gets the value of the displayName property. - * - * @return possible object is {@link String } - * - */ - public String getDisplayName() { - return this.displayName; - } - - /** - * Sets the value of the displayName property. - * - * @param value allowed object is {@link String } - * - */ - public void setDisplayName(final String value) { - this.displayName = value; - } - - /** - * Gets the value of the version property. - * - * @return possible object is {@link String } - * - */ - public String getVersion() { - return this.version; - } - - /** - * Sets the value of the version property. - * - * @param value allowed object is {@link String } - * - */ - public void setVersion(final String value) { - this.version = value; - } - - /** - * Gets the value of the authors property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the authors property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getAuthors().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } - * - * - */ - public List getAuthors() { - if (this.authors == null) { - this.authors = new ArrayList<>(); - } - return this.authors; - } - - /** - * Gets the value of the description property. - * - * @return possible object is {@link String } - * - */ - public String getDescription() { - return this.description; - } - - /** - * Sets the value of the description property. - * - * @param value allowed object is {@link String } - * - */ - public void setDescription(final String value) { - this.description = value; - } - - /** - * Gets the value of the iconUrl property. - * - * @return possible object is {@link String } - * - */ - public String getIconUrl() { - return this.iconUrl; - } - - /** - * Sets the value of the iconUrl property. - * - * @param value allowed object is {@link String } - * - */ - public void setIconUrl(final String value) { - this.iconUrl = value; - } - - /** - * Gets the value of the imageUrl property. - * - * @return possible object is {@link String } - * - */ - public String getImageUrl() { - return this.imageUrl; - } - - /** - * Sets the value of the imageUrl property. - * - * @param value allowed object is {@link String } - * - */ - public void setImageUrl(final String value) { - this.imageUrl = value; - } - - /** - * Gets the value of the options property. - * - * @return possible object is {@link Application.Options } - * - */ - public Application.Options getOptions() { - return this.options; - } - - /** - * Sets the value of the options property. - * - * @param value allowed object is {@link Application.Options } - * - */ - public void setOptions(final Application.Options value) { - this.options = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="option" type="{http://www.eclipse.org/winery/model/selfservice}ApplicationOption" maxOccurs="unbounded" minOccurs="0"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"option"}) - public static class Options { - - protected List option; - - - /** - * Gets the value of the option property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the option property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getOption().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link ApplicationOption } - * - * - */ - public List getOption() { - if (this.option == null) { - this.option = new ArrayList<>(); - } - return this.option; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/ApplicationOption.java b/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/ApplicationOption.java deleted file mode 100644 index 9daeef4d4..000000000 --- a/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/ApplicationOption.java +++ /dev/null @@ -1,184 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.06.28 at 10:18:28 AM CEST -// - - -package org.eclipse.winery.model.selfservice; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for ApplicationOption complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="ApplicationOption">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="iconUrl" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
    - *         <element name="planServiceName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="planInputMessageUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ApplicationOption", propOrder = {"description", "iconUrl", "planServiceName", "planInputMessageUrl"}) -public class ApplicationOption { - - @XmlElement(required = true) - protected String description; - @XmlElement(required = true) - @XmlSchemaType(name = "anyURI") - protected String iconUrl; - @XmlElement(required = true) - protected String planServiceName; - @XmlElement(required = true) - protected String planInputMessageUrl; - @XmlAttribute(name = "id", required = true) - protected String id; - @XmlAttribute(name = "name", required = true) - protected String name; - - /** - * Gets the value of the description property. - * - * @return possible object is {@link String } - * - */ - public String getDescription() { - return this.description; - } - - /** - * Sets the value of the description property. - * - * @param value allowed object is {@link String } - * - */ - public void setDescription(final String value) { - this.description = value; - } - - /** - * Gets the value of the iconUrl property. - * - * @return possible object is {@link String } - * - */ - public String getIconUrl() { - return this.iconUrl; - } - - /** - * Sets the value of the iconUrl property. - * - * @param value allowed object is {@link String } - * - */ - public void setIconUrl(final String value) { - this.iconUrl = value; - } - - /** - * Gets the value of the planServiceName property. - * - * @return possible object is {@link String } - * - */ - public String getPlanServiceName() { - return this.planServiceName; - } - - /** - * Sets the value of the planServiceName property. - * - * @param value allowed object is {@link String } - * - */ - public void setPlanServiceName(final String value) { - this.planServiceName = value; - } - - /** - * Gets the value of the planInputMessageUrl property. - * - * @return possible object is {@link String } - * - */ - public String getPlanInputMessageUrl() { - return this.planInputMessageUrl; - } - - /** - * Sets the value of the planInputMessageUrl property. - * - * @param value allowed object is {@link String } - * - */ - public void setPlanInputMessageUrl(final String value) { - this.planInputMessageUrl = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/ObjectFactory.java b/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/ObjectFactory.java deleted file mode 100644 index e0d28a2aa..000000000 --- a/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/ObjectFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2014.11.11 at 08:37:59 AM CET -// - - -package org.eclipse.winery.model.selfservice; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.eclipse.winery.model.selfservice package. - *

    - * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.eclipse.winery.model.selfservice - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link Application } - * - */ - public Application createApplication() { - return new Application(); - } - - /** - * Create an instance of {@link ApplicationOption } - * - */ - public ApplicationOption createApplicationOption() { - return new ApplicationOption(); - } - - /** - * Create an instance of {@link Application.Options } - * - */ - public Application.Options createApplicationOptions() { - return new Application.Options(); - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/package-info.java b/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/package-info.java deleted file mode 100644 index 2d2370bac..000000000 --- a/org.opentosca.planbuilder.integration/src/org/eclipse/winery/model/selfservice/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.06.28 at 10:18:28 AM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.eclipse.org/winery/model/selfservice", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.eclipse.winery.model.selfservice; diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/Definitions.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/Definitions.java deleted file mode 100644 index 4150494b6..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/Definitions.java +++ /dev/null @@ -1,44 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType>
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tDefinitions">
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") - -@XmlRootElement(name = "Definitions", namespace = "http://docs.oasis-open.org/tosca/ns/2011/12") -public class Definitions extends TDefinitions { - - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/ObjectFactory.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/ObjectFactory.java deleted file mode 100644 index 195460fbb..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/ObjectFactory.java +++ /dev/null @@ -1,829 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.oasis_open.docs.tosca.ns._2011._12 package. - *

    - * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _Documentation_QNAME = - new QName("http://docs.oasis-open.org/tosca/ns/2011/12", "documentation"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.oasis_open.docs.tosca.ns._2011._12 - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link TPlan.PlanModelReference } - * - */ - public TPlan.PlanModelReference createTPlanPlanModelReference() { - return new TPlan.PlanModelReference(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Capabilities } - * - */ - public TBoundaryDefinitions.Capabilities createTBoundaryDefinitionsCapabilities() { - return new TBoundaryDefinitions.Capabilities(); - } - - /** - * Create an instance of {@link TRelationshipTemplate.SourceElement } - * - */ - public TRelationshipTemplate.SourceElement createTRelationshipTemplateSourceElement() { - return new TRelationshipTemplate.SourceElement(); - } - - /** - * Create an instance of {@link TDeploymentArtifacts } - * - */ - public TDeploymentArtifacts createTDeploymentArtifacts() { - return new TDeploymentArtifacts(); - } - - /** - * Create an instance of {@link TPlan.PlanModel } - * - */ - public TPlan.PlanModel createTPlanPlanModel() { - return new TPlan.PlanModel(); - } - - /** - * Create an instance of {@link TNodeTypeImplementation } - * - */ - public TNodeTypeImplementation createTNodeTypeImplementation() { - return new TNodeTypeImplementation(); - } - - /** - * Create an instance of {@link TImplementationArtifacts } - * - */ - public TImplementationArtifacts createTImplementationArtifacts() { - return new TImplementationArtifacts(); - } - - /** - * Create an instance of {@link TCapabilityType } - * - */ - public TCapabilityType createTCapabilityType() { - return new TCapabilityType(); - } - - /** - * Create an instance of {@link TAppliesTo.NodeTypeReference } - * - */ - public TAppliesTo.NodeTypeReference createTAppliesToNodeTypeReference() { - return new TAppliesTo.NodeTypeReference(); - } - - /** - * Create an instance of {@link TArtifactType } - * - */ - public TArtifactType createTArtifactType() { - return new TArtifactType(); - } - - /** - * Create an instance of {@link TNodeTemplate.Requirements } - * - */ - public TNodeTemplate.Requirements createTNodeTemplateRequirements() { - return new TNodeTemplate.Requirements(); - } - - /** - * Create an instance of {@link TNodeTypeImplementation.DerivedFrom } - * - */ - public TNodeTypeImplementation.DerivedFrom createTNodeTypeImplementationDerivedFrom() { - return new TNodeTypeImplementation.DerivedFrom(); - } - - /** - * Create an instance of {@link TExtension } - * - */ - public TExtension createTExtension() { - return new TExtension(); - } - - /** - * Create an instance of {@link TRelationshipTemplate.TargetElement } - * - */ - public TRelationshipTemplate.TargetElement createTRelationshipTemplateTargetElement() { - return new TRelationshipTemplate.TargetElement(); - } - - /** - * Create an instance of {@link TExportedOperation } - * - */ - public TExportedOperation createTExportedOperation() { - return new TExportedOperation(); - } - - /** - * Create an instance of {@link TDocumentation } - * - */ - public TDocumentation createTDocumentation() { - return new TDocumentation(); - } - - /** - * Create an instance of {@link TRelationshipType.ValidTarget } - * - */ - public TRelationshipType.ValidTarget createTRelationshipTypeValidTarget() { - return new TRelationshipType.ValidTarget(); - } - - /** - * Create an instance of {@link TNodeTemplate.Policies } - * - */ - public TNodeTemplate.Policies createTNodeTemplatePolicies() { - return new TNodeTemplate.Policies(); - } - - /** - * Create an instance of {@link TCapabilityDefinition } - * - */ - public TCapabilityDefinition createTCapabilityDefinition() { - return new TCapabilityDefinition(); - } - - /** - * Create an instance of {@link TArtifactTemplate } - * - */ - public TArtifactTemplate createTArtifactTemplate() { - return new TArtifactTemplate(); - } - - /** - * Create an instance of {@link TRelationshipType.SourceInterfaces } - * - */ - public TRelationshipType.SourceInterfaces createTRelationshipTypeSourceInterfaces() { - return new TRelationshipType.SourceInterfaces(); - } - - /** - * Create an instance of {@link TTopologyTemplate } - * - */ - public TTopologyTemplate createTTopologyTemplate() { - return new TTopologyTemplate(); - } - - /** - * Create an instance of {@link TNodeTemplate } - * - */ - public TNodeTemplate createTNodeTemplate() { - return new TNodeTemplate(); - } - - /** - * Create an instance of {@link TRequiredContainerFeature } - * - */ - public TRequiredContainerFeature createTRequiredContainerFeature() { - return new TRequiredContainerFeature(); - } - - /** - * Create an instance of {@link TExportedOperation.NodeOperation } - * - */ - public TExportedOperation.NodeOperation createTExportedOperationNodeOperation() { - return new TExportedOperation.NodeOperation(); - } - - /** - * Create an instance of {@link TPropertyMapping } - * - */ - public TPropertyMapping createTPropertyMapping() { - return new TPropertyMapping(); - } - - /** - * Create an instance of {@link TPlans } - * - */ - public TPlans createTPlans() { - return new TPlans(); - } - - /** - * Create an instance of {@link TRelationshipTypeImplementation } - * - */ - public TRelationshipTypeImplementation createTRelationshipTypeImplementation() { - return new TRelationshipTypeImplementation(); - } - - /** - * Create an instance of {@link TPlan.OutputParameters } - * - */ - public TPlan.OutputParameters createTPlanOutputParameters() { - return new TPlan.OutputParameters(); - } - - /** - * Create an instance of {@link TOperation.OutputParameters } - * - */ - public TOperation.OutputParameters createTOperationOutputParameters() { - return new TOperation.OutputParameters(); - } - - /** - * Create an instance of {@link TCapability } - * - */ - public TCapability createTCapability() { - return new TCapability(); - } - - /** - * Create an instance of {@link TExportedInterface } - * - */ - public TExportedInterface createTExportedInterface() { - return new TExportedInterface(); - } - - /** - * Create an instance of {@link TRequirementDefinition } - * - */ - public TRequirementDefinition createTRequirementDefinition() { - return new TRequirementDefinition(); - } - - /** - * Create an instance of {@link TRequiredContainerFeatures } - * - */ - public TRequiredContainerFeatures createTRequiredContainerFeatures() { - return new TRequiredContainerFeatures(); - } - - /** - * Create an instance of {@link TArtifactReference } - * - */ - public TArtifactReference createTArtifactReference() { - return new TArtifactReference(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Requirements } - * - */ - public TBoundaryDefinitions.Requirements createTBoundaryDefinitionsRequirements() { - return new TBoundaryDefinitions.Requirements(); - } - - /** - * Create an instance of {@link TImplementationArtifact } - * - */ - public TImplementationArtifact createTImplementationArtifact() { - return new TImplementationArtifact(); - } - - /** - * Create an instance of {@link Definitions } - * - */ - public Definitions createDefinitions() { - return new Definitions(); - } - - /** - * Create an instance of {@link TRelationshipType.TargetInterfaces } - * - */ - public TRelationshipType.TargetInterfaces createTRelationshipTypeTargetInterfaces() { - return new TRelationshipType.TargetInterfaces(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions } - * - */ - public TBoundaryDefinitions createTBoundaryDefinitions() { - return new TBoundaryDefinitions(); - } - - /** - * Create an instance of {@link TRequirementDefinition.Constraints } - * - */ - public TRequirementDefinition.Constraints createTRequirementDefinitionConstraints() { - return new TRequirementDefinition.Constraints(); - } - - /** - * Create an instance of {@link TNodeType.RequirementDefinitions } - * - */ - public TNodeType.RequirementDefinitions createTNodeTypeRequirementDefinitions() { - return new TNodeType.RequirementDefinitions(); - } - - /** - * Create an instance of {@link TPropertyConstraint } - * - */ - public TPropertyConstraint createTPropertyConstraint() { - return new TPropertyConstraint(); - } - - /** - * Create an instance of {@link TTopologyElementInstanceStates.InstanceState } - * - */ - public TTopologyElementInstanceStates.InstanceState createTTopologyElementInstanceStatesInstanceState() { - return new TTopologyElementInstanceStates.InstanceState(); - } - - /** - * Create an instance of {@link TRelationshipTemplate } - * - */ - public TRelationshipTemplate createTRelationshipTemplate() { - return new TRelationshipTemplate(); - } - - /** - * Create an instance of {@link TExtensibleElements } - * - */ - public TExtensibleElements createTExtensibleElements() { - return new TExtensibleElements(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Properties.PropertyMappings } - * - */ - public TBoundaryDefinitions.Properties.PropertyMappings createTBoundaryDefinitionsPropertiesPropertyMappings() { - return new TBoundaryDefinitions.Properties.PropertyMappings(); - } - - /** - * Create an instance of {@link TPlan.InputParameters } - * - */ - public TPlan.InputParameters createTPlanInputParameters() { - return new TPlan.InputParameters(); - } - - /** - * Create an instance of {@link TTopologyElementInstanceStates } - * - */ - public TTopologyElementInstanceStates createTTopologyElementInstanceStates() { - return new TTopologyElementInstanceStates(); - } - - /** - * Create an instance of {@link TRelationshipTypeImplementation.DerivedFrom } - * - */ - public TRelationshipTypeImplementation.DerivedFrom createTRelationshipTypeImplementationDerivedFrom() { - return new TRelationshipTypeImplementation.DerivedFrom(); - } - - /** - * Create an instance of {@link TAppliesTo } - * - */ - public TAppliesTo createTAppliesTo() { - return new TAppliesTo(); - } - - /** - * Create an instance of {@link TPolicyTemplate } - * - */ - public TPolicyTemplate createTPolicyTemplate() { - return new TPolicyTemplate(); - } - - /** - * Create an instance of {@link TNodeType.CapabilityDefinitions } - * - */ - public TNodeType.CapabilityDefinitions createTNodeTypeCapabilityDefinitions() { - return new TNodeType.CapabilityDefinitions(); - } - - /** - * Create an instance of {@link TInterface } - * - */ - public TInterface createTInterface() { - return new TInterface(); - } - - /** - * Create an instance of {@link TTags } - * - */ - public TTags createTTags() { - return new TTags(); - } - - /** - * Create an instance of {@link TRelationshipTemplate.RelationshipConstraints } - * - */ - public TRelationshipTemplate.RelationshipConstraints createTRelationshipTemplateRelationshipConstraints() { - return new TRelationshipTemplate.RelationshipConstraints(); - } - - /** - * Create an instance of {@link TServiceTemplate } - * - */ - public TServiceTemplate createTServiceTemplate() { - return new TServiceTemplate(); - } - - /** - * Create an instance of {@link TRequirement } - * - */ - public TRequirement createTRequirement() { - return new TRequirement(); - } - - /** - * Create an instance of {@link TRelationshipType.ValidSource } - * - */ - public TRelationshipType.ValidSource createTRelationshipTypeValidSource() { - return new TRelationshipType.ValidSource(); - } - - /** - * Create an instance of {@link TOperation } - * - */ - public TOperation createTOperation() { - return new TOperation(); - } - - /** - * Create an instance of {@link TArtifactTemplate.ArtifactReferences } - * - */ - public TArtifactTemplate.ArtifactReferences createTArtifactTemplateArtifactReferences() { - return new TArtifactTemplate.ArtifactReferences(); - } - - /** - * Create an instance of {@link TCondition } - * - */ - public TCondition createTCondition() { - return new TCondition(); - } - - /** - * Create an instance of {@link org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.Properties } - * - */ - public org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.Properties createTEntityTemplateProperties() { - return new org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.Properties(); - } - - /** - * Create an instance of {@link TImplementationArtifacts.ImplementationArtifact } - * - */ - public TImplementationArtifacts.ImplementationArtifact createTImplementationArtifactsImplementationArtifact() { - return new TImplementationArtifacts.ImplementationArtifact(); - } - - /** - * Create an instance of {@link TExportedOperation.Plan } - * - */ - public TExportedOperation.Plan createTExportedOperationPlan() { - return new TExportedOperation.Plan(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Policies } - * - */ - public TBoundaryDefinitions.Policies createTBoundaryDefinitionsPolicies() { - return new TBoundaryDefinitions.Policies(); - } - - /** - * Create an instance of {@link TPlan } - * - */ - public TPlan createTPlan() { - return new TPlan(); - } - - /** - * Create an instance of {@link TConstraint } - * - */ - public TConstraint createTConstraint() { - return new TConstraint(); - } - - /** - * Create an instance of {@link TNodeType } - * - */ - public TNodeType createTNodeType() { - return new TNodeType(); - } - - /** - * Create an instance of {@link TParameter } - * - */ - public TParameter createTParameter() { - return new TParameter(); - } - - /** - * Create an instance of {@link TRequirementRef } - * - */ - public TRequirementRef createTRequirementRef() { - return new TRequirementRef(); - } - - /** - * Create an instance of {@link TImport } - * - */ - public TImport createTImport() { - return new TImport(); - } - - /** - * Create an instance of {@link TDefinitions } - * - */ - public TDefinitions createTDefinitions() { - return new TDefinitions(); - } - - /** - * Create an instance of {@link TPolicyType } - * - */ - public TPolicyType createTPolicyType() { - return new TPolicyType(); - } - - /** - * Create an instance of {@link TCapabilityRef } - * - */ - public TCapabilityRef createTCapabilityRef() { - return new TCapabilityRef(); - } - - /** - * Create an instance of {@link TOperation.InputParameters } - * - */ - public TOperation.InputParameters createTOperationInputParameters() { - return new TOperation.InputParameters(); - } - - /** - * Create an instance of {@link TArtifactReference.Include } - * - */ - public TArtifactReference.Include createTArtifactReferenceInclude() { - return new TArtifactReference.Include(); - } - - /** - * Create an instance of {@link TDeploymentArtifact } - * - */ - public TDeploymentArtifact createTDeploymentArtifact() { - return new TDeploymentArtifact(); - } - - /** - * Create an instance of {@link TExtensions } - * - */ - public TExtensions createTExtensions() { - return new TExtensions(); - } - - /** - * Create an instance of - * {@link org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.PropertyConstraints } - * - */ - public org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.PropertyConstraints createTEntityTemplatePropertyConstraints() { - return new org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.PropertyConstraints(); - } - - /** - * Create an instance of {@link TNodeTemplate.Capabilities } - * - */ - public TNodeTemplate.Capabilities createTNodeTemplateCapabilities() { - return new TNodeTemplate.Capabilities(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Properties } - * - */ - public TBoundaryDefinitions.Properties createTBoundaryDefinitionsProperties() { - return new TBoundaryDefinitions.Properties(); - } - - /** - * Create an instance of {@link TArtifactReference.Exclude } - * - */ - public TArtifactReference.Exclude createTArtifactReferenceExclude() { - return new TArtifactReference.Exclude(); - } - - /** - * Create an instance of {@link TDefinitions.Extensions } - * - */ - public TDefinitions.Extensions createTDefinitionsExtensions() { - return new TDefinitions.Extensions(); - } - - /** - * Create an instance of {@link TRelationshipType } - * - */ - public TRelationshipType createTRelationshipType() { - return new TRelationshipType(); - } - - /** - * Create an instance of - * {@link TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint } - * - */ - public TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint createTRelationshipTemplateRelationshipConstraintsRelationshipConstraint() { - return new TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.Interfaces } - * - */ - public TBoundaryDefinitions.Interfaces createTBoundaryDefinitionsInterfaces() { - return new TBoundaryDefinitions.Interfaces(); - } - - /** - * Create an instance of {@link TNodeType.Interfaces } - * - */ - public TNodeType.Interfaces createTNodeTypeInterfaces() { - return new TNodeType.Interfaces(); - } - - /** - * Create an instance of - * {@link org.oasis_open.docs.tosca.ns._2011._12.TEntityType.PropertiesDefinition } - * - */ - public org.oasis_open.docs.tosca.ns._2011._12.TEntityType.PropertiesDefinition createTEntityTypePropertiesDefinition() { - return new org.oasis_open.docs.tosca.ns._2011._12.TEntityType.PropertiesDefinition(); - } - - /** - * Create an instance of {@link TDefinitions.Types } - * - */ - public TDefinitions.Types createTDefinitionsTypes() { - return new TDefinitions.Types(); - } - - /** - * Create an instance of {@link TPolicy } - * - */ - public TPolicy createTPolicy() { - return new TPolicy(); - } - - /** - * Create an instance of {@link org.oasis_open.docs.tosca.ns._2011._12.TEntityType.DerivedFrom } - * - */ - public org.oasis_open.docs.tosca.ns._2011._12.TEntityType.DerivedFrom createTEntityTypeDerivedFrom() { - return new org.oasis_open.docs.tosca.ns._2011._12.TEntityType.DerivedFrom(); - } - - /** - * Create an instance of {@link TTag } - * - */ - public TTag createTTag() { - return new TTag(); - } - - /** - * Create an instance of {@link TExportedOperation.RelationshipOperation } - * - */ - public TExportedOperation.RelationshipOperation createTExportedOperationRelationshipOperation() { - return new TExportedOperation.RelationshipOperation(); - } - - /** - * Create an instance of {@link TRequirementType } - * - */ - public TRequirementType createTRequirementType() { - return new TRequirementType(); - } - - /** - * Create an instance of {@link TBoundaryDefinitions.PropertyConstraints } - * - */ - public TBoundaryDefinitions.PropertyConstraints createTBoundaryDefinitionsPropertyConstraints() { - return new TBoundaryDefinitions.PropertyConstraints(); - } - - /** - * Create an instance of {@link TCapabilityDefinition.Constraints } - * - */ - public TCapabilityDefinition.Constraints createTCapabilityDefinitionConstraints() { - return new TCapabilityDefinition.Constraints(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link TDocumentation }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://docs.oasis-open.org/tosca/ns/2011/12", name = "documentation") - public JAXBElement createDocumentation(final TDocumentation value) { - return new JAXBElement<>(_Documentation_QNAME, TDocumentation.class, null, value); - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TAppliesTo.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TAppliesTo.java deleted file mode 100644 index 00491748d..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TAppliesTo.java +++ /dev/null @@ -1,136 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tAppliesTo complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tAppliesTo">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="NodeTypeReference" maxOccurs="unbounded">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tAppliesTo", propOrder = {"nodeTypeReference"}) -public class TAppliesTo { - - @XmlElement(name = "NodeTypeReference", required = true) - protected List nodeTypeReference; - - /** - * Gets the value of the nodeTypeReference property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the nodeTypeReference property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getNodeTypeReference().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TAppliesTo.NodeTypeReference } - * - * - */ - public List getNodeTypeReference() { - if (this.nodeTypeReference == null) { - this.nodeTypeReference = new ArrayList<>(); - } - return this.nodeTypeReference; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class NodeTypeReference { - - @XmlAttribute(required = true) - protected QName typeRef; - - /** - * Gets the value of the typeRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getTypeRef() { - return this.typeRef; - } - - /** - * Sets the value of the typeRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setTypeRef(final QName value) { - this.typeRef = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactReference.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactReference.java deleted file mode 100644 index 2cb455d31..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactReference.java +++ /dev/null @@ -1,221 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tArtifactReference complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tArtifactReference">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <choice maxOccurs="unbounded" minOccurs="0">
    - *         <element name="Include">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Exclude">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </choice>
    - *       <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tArtifactReference", propOrder = {"includeOrExclude"}) -public class TArtifactReference { - - @XmlElements({@XmlElement(name = "Exclude", type = TArtifactReference.Exclude.class), - @XmlElement(name = "Include", type = TArtifactReference.Include.class)}) - protected List includeOrExclude; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String reference; - - /** - * Gets the value of the includeOrExclude property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the includeOrExclude property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getIncludeOrExclude().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TArtifactReference.Exclude } - * {@link TArtifactReference.Include } - * - * - */ - public List getIncludeOrExclude() { - if (this.includeOrExclude == null) { - this.includeOrExclude = new ArrayList<>(); - } - return this.includeOrExclude; - } - - /** - * Gets the value of the reference property. - * - * @return possible object is {@link String } - * - */ - public String getReference() { - return this.reference; - } - - /** - * Sets the value of the reference property. - * - * @param value allowed object is {@link String } - * - */ - public void setReference(final String value) { - this.reference = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Exclude { - - @XmlAttribute(required = true) - protected String pattern; - - /** - * Gets the value of the pattern property. - * - * @return possible object is {@link String } - * - */ - public String getPattern() { - return this.pattern; - } - - /** - * Sets the value of the pattern property. - * - * @param value allowed object is {@link String } - * - */ - public void setPattern(final String value) { - this.pattern = value; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Include { - - @XmlAttribute(required = true) - protected String pattern; - - /** - * Gets the value of the pattern property. - * - * @return possible object is {@link String } - * - */ - public String getPattern() { - return this.pattern; - } - - /** - * Sets the value of the pattern property. - * - * @param value allowed object is {@link String } - * - */ - public void setPattern(final String value) { - this.pattern = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactTemplate.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactTemplate.java deleted file mode 100644 index 2e8c3ee49..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactTemplate.java +++ /dev/null @@ -1,163 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tArtifactTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tArtifactTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <sequence>
    - *         <element name="ArtifactReferences" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="ArtifactReference" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactReference" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tArtifactTemplate", propOrder = {"artifactReferences"}) -public class TArtifactTemplate extends TEntityTemplate { - - @XmlElement(name = "ArtifactReferences") - protected TArtifactTemplate.ArtifactReferences artifactReferences; - @XmlAttribute - protected String name; - - /** - * Gets the value of the artifactReferences property. - * - * @return possible object is {@link TArtifactTemplate.ArtifactReferences } - * - */ - public TArtifactTemplate.ArtifactReferences getArtifactReferences() { - return this.artifactReferences; - } - - /** - * Sets the value of the artifactReferences property. - * - * @param value allowed object is {@link TArtifactTemplate.ArtifactReferences } - * - */ - public void setArtifactReferences(final TArtifactTemplate.ArtifactReferences value) { - this.artifactReferences = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="ArtifactReference" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactReference" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"artifactReference"}) - public static class ArtifactReferences { - - @XmlElement(name = "ArtifactReference", required = true) - protected List artifactReference; - - /** - * Gets the value of the artifactReference property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the artifactReference property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getArtifactReference().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TArtifactReference } - * - * - */ - public List getArtifactReference() { - if (this.artifactReference == null) { - this.artifactReference = new ArrayList<>(); - } - return this.artifactReference; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactType.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactType.java deleted file mode 100644 index 9c67e1d0c..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactType.java +++ /dev/null @@ -1,41 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tArtifactType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tArtifactType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tArtifactType") -public class TArtifactType extends TEntityType { - - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TBoolean.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TBoolean.java deleted file mode 100644 index b802fdb26..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TBoolean.java +++ /dev/null @@ -1,61 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tBoolean. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - *

    - * - *

    - * <simpleType name="tBoolean">
    - *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *     <enumeration value="yes"/>
    - *     <enumeration value="no"/>
    - *   </restriction>
    - * </simpleType>
    - * 
    - * - */ -@XmlType(name = "tBoolean") -@XmlEnum -public enum TBoolean { - - @XmlEnumValue("yes") - YES("yes"), @XmlEnumValue("no") - NO("no"); - private final String value; - - TBoolean(final String v) { - this.value = v; - } - - public String value() { - return this.value; - } - - public static TBoolean fromValue(final String v) { - for (final TBoolean c : TBoolean.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TBoundaryDefinitions.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TBoundaryDefinitions.java deleted file mode 100644 index a97501dfa..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TBoundaryDefinitions.java +++ /dev/null @@ -1,695 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tBoundaryDefinitions complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tBoundaryDefinitions">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Properties" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <any namespace='##other'/>
    - *                   <element name="PropertyMappings" minOccurs="0">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    - *                           </sequence>
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="PropertyConstraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Requirements" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementRef" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Capabilities" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityRef" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Policies" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Interfaces" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedInterface" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tBoundaryDefinitions", - propOrder = {"properties", "propertyConstraints", "requirements", "capabilities", "policies", "interfaces"}) -public class TBoundaryDefinitions { - - @XmlElement(name = "Properties") - protected TBoundaryDefinitions.Properties properties; - @XmlElement(name = "PropertyConstraints") - protected TBoundaryDefinitions.PropertyConstraints propertyConstraints; - @XmlElement(name = "Requirements") - protected TBoundaryDefinitions.Requirements requirements; - @XmlElement(name = "Capabilities") - protected TBoundaryDefinitions.Capabilities capabilities; - @XmlElement(name = "Policies") - protected TBoundaryDefinitions.Policies policies; - @XmlElement(name = "Interfaces") - protected TBoundaryDefinitions.Interfaces interfaces; - - /** - * Gets the value of the properties property. - * - * @return possible object is {@link TBoundaryDefinitions.Properties } - * - */ - public TBoundaryDefinitions.Properties getProperties() { - return this.properties; - } - - /** - * Sets the value of the properties property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Properties } - * - */ - public void setProperties(final TBoundaryDefinitions.Properties value) { - this.properties = value; - } - - /** - * Gets the value of the propertyConstraints property. - * - * @return possible object is {@link TBoundaryDefinitions.PropertyConstraints } - * - */ - public TBoundaryDefinitions.PropertyConstraints getPropertyConstraints() { - return this.propertyConstraints; - } - - /** - * Sets the value of the propertyConstraints property. - * - * @param value allowed object is {@link TBoundaryDefinitions.PropertyConstraints } - * - */ - public void setPropertyConstraints(final TBoundaryDefinitions.PropertyConstraints value) { - this.propertyConstraints = value; - } - - /** - * Gets the value of the requirements property. - * - * @return possible object is {@link TBoundaryDefinitions.Requirements } - * - */ - public TBoundaryDefinitions.Requirements getRequirements() { - return this.requirements; - } - - /** - * Sets the value of the requirements property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Requirements } - * - */ - public void setRequirements(final TBoundaryDefinitions.Requirements value) { - this.requirements = value; - } - - /** - * Gets the value of the capabilities property. - * - * @return possible object is {@link TBoundaryDefinitions.Capabilities } - * - */ - public TBoundaryDefinitions.Capabilities getCapabilities() { - return this.capabilities; - } - - /** - * Sets the value of the capabilities property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Capabilities } - * - */ - public void setCapabilities(final TBoundaryDefinitions.Capabilities value) { - this.capabilities = value; - } - - /** - * Gets the value of the policies property. - * - * @return possible object is {@link TBoundaryDefinitions.Policies } - * - */ - public TBoundaryDefinitions.Policies getPolicies() { - return this.policies; - } - - /** - * Sets the value of the policies property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Policies } - * - */ - public void setPolicies(final TBoundaryDefinitions.Policies value) { - this.policies = value; - } - - /** - * Gets the value of the interfaces property. - * - * @return possible object is {@link TBoundaryDefinitions.Interfaces } - * - */ - public TBoundaryDefinitions.Interfaces getInterfaces() { - return this.interfaces; - } - - /** - * Sets the value of the interfaces property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Interfaces } - * - */ - public void setInterfaces(final TBoundaryDefinitions.Interfaces value) { - this.interfaces = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityRef" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"capability"}) - public static class Capabilities { - - @XmlElement(name = "Capability", required = true) - protected List capability; - - /** - * Gets the value of the capability property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the capability property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getCapability().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCapabilityRef } - * - * - */ - public List getCapability() { - if (this.capability == null) { - this.capability = new ArrayList<>(); - } - return this.capability; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedInterface" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"_interface"}) - public static class Interfaces { - - @XmlElement(name = "Interface", required = true) - protected List _interface; - - /** - * Gets the value of the interface property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the interface property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInterface().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TExportedInterface } - * - * - */ - public List getInterface() { - if (this._interface == null) { - this._interface = new ArrayList<>(); - } - return this._interface; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"policy"}) - public static class Policies { - - @XmlElement(name = "Policy", required = true) - protected List policy; - - /** - * Gets the value of the policy property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the policy property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getPolicy().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPolicy } - * - * - */ - public List getPolicy() { - if (this.policy == null) { - this.policy = new ArrayList<>(); - } - return this.policy; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <any namespace='##other'/>
    -     *         <element name="PropertyMappings" minOccurs="0">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    -     *                 </sequence>
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any", "propertyMappings"}) - public static class Properties { - - @XmlAnyElement(lax = true) - protected Object any; - @XmlElement(name = "PropertyMappings") - protected TBoundaryDefinitions.Properties.PropertyMappings propertyMappings; - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - /** - * Gets the value of the propertyMappings property. - * - * @return possible object is {@link TBoundaryDefinitions.Properties.PropertyMappings } - * - */ - public TBoundaryDefinitions.Properties.PropertyMappings getPropertyMappings() { - return this.propertyMappings; - } - - /** - * Sets the value of the propertyMappings property. - * - * @param value allowed object is {@link TBoundaryDefinitions.Properties.PropertyMappings } - * - */ - public void setPropertyMappings(final TBoundaryDefinitions.Properties.PropertyMappings value) { - this.propertyMappings = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    -         *       </sequence>
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"propertyMapping"}) - public static class PropertyMappings { - - @XmlElement(name = "PropertyMapping", required = true) - protected List propertyMapping; - - /** - * Gets the value of the propertyMapping property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the propertyMapping property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -             * getPropertyMapping().add(newItem);
    -             * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPropertyMapping } - * - * - */ - public List getPropertyMapping() { - if (this.propertyMapping == null) { - this.propertyMapping = new ArrayList<>(); - } - return this.propertyMapping; - } - - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"propertyConstraint"}) - public static class PropertyConstraints { - - @XmlElement(name = "PropertyConstraint", required = true) - protected List propertyConstraint; - - /** - * Gets the value of the propertyConstraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the propertyConstraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getPropertyConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPropertyConstraint } - * - * - */ - public List getPropertyConstraint() { - if (this.propertyConstraint == null) { - this.propertyConstraint = new ArrayList<>(); - } - return this.propertyConstraint; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementRef" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"requirement"}) - public static class Requirements { - - @XmlElement(name = "Requirement", required = true) - protected List requirement; - - /** - * Gets the value of the requirement property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the requirement property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getRequirement().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRequirementRef } - * - * - */ - public List getRequirement() { - if (this.requirement == null) { - this.requirement = new ArrayList<>(); - } - return this.requirement; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapability.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapability.java deleted file mode 100644 index f77cd6a68..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapability.java +++ /dev/null @@ -1,65 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tCapability complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCapability">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCapability") -public class TCapability extends TEntityTemplate { - - @XmlAttribute(required = true) - protected String name; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityDefinition.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityDefinition.java deleted file mode 100644 index ca3580bfe..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityDefinition.java +++ /dev/null @@ -1,256 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tCapabilityDefinition complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCapabilityDefinition">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Constraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="capabilityType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="lowerBound" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    - *       <attribute name="upperBound" default="1">
    - *         <simpleType>
    - *           <union>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    - *                 <pattern value="([1-9]+[0-9]*)"/>
    - *               </restriction>
    - *             </simpleType>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *                 <enumeration value="unbounded"/>
    - *               </restriction>
    - *             </simpleType>
    - *           </union>
    - *         </simpleType>
    - *       </attribute>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCapabilityDefinition", propOrder = {"constraints"}) -public class TCapabilityDefinition extends TExtensibleElements { - - @XmlElement(name = "Constraints") - protected TCapabilityDefinition.Constraints constraints; - @XmlAttribute(required = true) - protected String name; - @XmlAttribute(required = true) - protected QName capabilityType; - @XmlAttribute - protected Integer lowerBound; - @XmlAttribute - protected String upperBound; - - /** - * Gets the value of the constraints property. - * - * @return possible object is {@link TCapabilityDefinition.Constraints } - * - */ - public TCapabilityDefinition.Constraints getConstraints() { - return this.constraints; - } - - /** - * Sets the value of the constraints property. - * - * @param value allowed object is {@link TCapabilityDefinition.Constraints } - * - */ - public void setConstraints(final TCapabilityDefinition.Constraints value) { - this.constraints = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the capabilityType property. - * - * @return possible object is {@link QName } - * - */ - public QName getCapabilityType() { - return this.capabilityType; - } - - /** - * Sets the value of the capabilityType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setCapabilityType(final QName value) { - this.capabilityType = value; - } - - /** - * Gets the value of the lowerBound property. - * - * @return possible object is {@link Integer } - * - */ - public int getLowerBound() { - if (this.lowerBound == null) { - return 1; - } else { - return this.lowerBound; - } - } - - /** - * Sets the value of the lowerBound property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setLowerBound(final Integer value) { - this.lowerBound = value; - } - - /** - * Gets the value of the upperBound property. - * - * @return possible object is {@link String } - * - */ - public String getUpperBound() { - if (this.upperBound == null) { - return "1"; - } else { - return this.upperBound; - } - } - - /** - * Sets the value of the upperBound property. - * - * @param value allowed object is {@link String } - * - */ - public void setUpperBound(final String value) { - this.upperBound = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"constraint"}) - public static class Constraints { - - @XmlElement(name = "Constraint", required = true) - protected List constraint; - - /** - * Gets the value of the constraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the constraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TConstraint } - * - * - */ - public List getConstraint() { - if (this.constraint == null) { - this.constraint = new ArrayList<>(); - } - return this.constraint; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityRef.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityRef.java deleted file mode 100644 index df7f2118a..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityRef.java +++ /dev/null @@ -1,91 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tCapabilityRef complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCapabilityRef">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCapabilityRef") -public class TCapabilityRef { - - @XmlAttribute - protected String name; - @XmlAttribute(required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object ref; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the ref property. - * - * @return possible object is {@link Object } - * - */ - public Object getRef() { - return this.ref; - } - - /** - * Sets the value of the ref property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRef(final Object value) { - this.ref = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityType.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityType.java deleted file mode 100644 index d04524907..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityType.java +++ /dev/null @@ -1,41 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tCapabilityType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCapabilityType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCapabilityType") -public class TCapabilityType extends TEntityType { - - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCondition.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCondition.java deleted file mode 100644 index 882fddc30..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TCondition.java +++ /dev/null @@ -1,105 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tCondition complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCondition">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="expressionLanguage" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCondition", propOrder = {"any"}) -public class TCondition { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String expressionLanguage; - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getAny().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - /** - * Gets the value of the expressionLanguage property. - * - * @return possible object is {@link String } - * - */ - public String getExpressionLanguage() { - return this.expressionLanguage; - } - - /** - * Sets the value of the expressionLanguage property. - * - * @param value allowed object is {@link String } - * - */ - public void setExpressionLanguage(final String value) { - this.expressionLanguage = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TConstraint.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TConstraint.java deleted file mode 100644 index e393337f9..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TConstraint.java +++ /dev/null @@ -1,96 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tConstraint complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tConstraint">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' namespace='##other'/>
    - *       </sequence>
    - *       <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tConstraint", propOrder = {"any"}) -@XmlSeeAlso({TPropertyConstraint.class}) -public class TConstraint { - - @XmlAnyElement(lax = true) - protected Object any; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String constraintType; - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } {@link Element } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } {@link Element } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - /** - * Gets the value of the constraintType property. - * - * @return possible object is {@link String } - * - */ - public String getConstraintType() { - return this.constraintType; - } - - /** - * Sets the value of the constraintType property. - * - * @param value allowed object is {@link String } - * - */ - public void setConstraintType(final String value) { - this.constraintType = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDefinitions.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDefinitions.java deleted file mode 100644 index e9e08c9e7..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDefinitions.java +++ /dev/null @@ -1,404 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tDefinitions complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDefinitions">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Extensions" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Import" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImport" maxOccurs="unbounded" minOccurs="0"/>
    - *         <element name="Types" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <choice maxOccurs="unbounded">
    - *           <element name="ServiceTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tServiceTemplate"/>
    - *           <element name="NodeType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeType"/>
    - *           <element name="NodeTypeImplementation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeTypeImplementation"/>
    - *           <element name="RelationshipType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipType"/>
    - *           <element name="RelationshipTypeImplementation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipTypeImplementation"/>
    - *           <element name="RequirementType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementType"/>
    - *           <element name="CapabilityType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityType"/>
    - *           <element name="ArtifactType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactType"/>
    - *           <element name="ArtifactTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactTemplate"/>
    - *           <element name="PolicyType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicyType"/>
    - *           <element name="PolicyTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicyTemplate"/>
    - *         </choice>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="targetNamespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDefinitions", - propOrder = {"extensions", "_import", "types", "serviceTemplateOrNodeTypeOrNodeTypeImplementation"}) -@XmlSeeAlso({Definitions.class}) -public class TDefinitions extends TExtensibleElements { - - @XmlElement(name = "Extensions") - protected TDefinitions.Extensions extensions; - @XmlElement(name = "Import") - protected List _import; - @XmlElement(name = "Types") - protected TDefinitions.Types types; - @XmlElements({@XmlElement(name = "PolicyType", type = TPolicyType.class), - @XmlElement(name = "RelationshipType", type = TRelationshipType.class), - @XmlElement(name = "NodeType", type = TNodeType.class), - @XmlElement(name = "CapabilityType", type = TCapabilityType.class), - @XmlElement(name = "RequirementType", type = TRequirementType.class), - @XmlElement(name = "NodeTypeImplementation", type = TNodeTypeImplementation.class), - @XmlElement(name = "ArtifactType", type = TArtifactType.class), - @XmlElement(name = "PolicyTemplate", type = TPolicyTemplate.class), - @XmlElement(name = "ArtifactTemplate", type = TArtifactTemplate.class), - @XmlElement(name = "RelationshipTypeImplementation", type = TRelationshipTypeImplementation.class), - @XmlElement(name = "ServiceTemplate", type = TServiceTemplate.class)}) - protected List serviceTemplateOrNodeTypeOrNodeTypeImplementation; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute - protected String name; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - - /** - * Gets the value of the extensions property. - * - * @return possible object is {@link TDefinitions.Extensions } - * - */ - public TDefinitions.Extensions getExtensions() { - return this.extensions; - } - - /** - * Sets the value of the extensions property. - * - * @param value allowed object is {@link TDefinitions.Extensions } - * - */ - public void setExtensions(final TDefinitions.Extensions value) { - this.extensions = value; - } - - /** - * Gets the value of the import property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the import property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getImport().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TImport } - * - * - */ - public List getImport() { - if (this._import == null) { - this._import = new ArrayList<>(); - } - return this._import; - } - - /** - * Gets the value of the types property. - * - * @return possible object is {@link TDefinitions.Types } - * - */ - public TDefinitions.Types getTypes() { - return this.types; - } - - /** - * Sets the value of the types property. - * - * @param value allowed object is {@link TDefinitions.Types } - * - */ - public void setTypes(final TDefinitions.Types value) { - this.types = value; - } - - /** - * Gets the value of the serviceTemplateOrNodeTypeOrNodeTypeImplementation property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the serviceTemplateOrNodeTypeOrNodeTypeImplementation - * property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getServiceTemplateOrNodeTypeOrNodeTypeImplementation().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPolicyType } - * {@link TRelationshipType } {@link TNodeType } {@link TCapabilityType } {@link TRequirementType } - * {@link TNodeTypeImplementation } {@link TArtifactType } {@link TPolicyTemplate } - * {@link TArtifactTemplate } {@link TRelationshipTypeImplementation } {@link TServiceTemplate } - * - * - */ - public List getServiceTemplateOrNodeTypeOrNodeTypeImplementation() { - if (this.serviceTemplateOrNodeTypeOrNodeTypeImplementation == null) { - this.serviceTemplateOrNodeTypeOrNodeTypeImplementation = new ArrayList<>(); - } - return this.serviceTemplateOrNodeTypeOrNodeTypeImplementation; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"extension"}) - public static class Extensions { - - @XmlElement(name = "Extension", required = true) - protected List extension; - - /** - * Gets the value of the extension property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the extension property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getExtension().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TExtension } - * - * - */ - public List getExtension() { - if (this.extension == null) { - this.extension = new ArrayList<>(); - } - return this.extension; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class Types { - - @XmlAnyElement(lax = true) - protected List any; - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getAny().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifact.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifact.java deleted file mode 100644 index 4b44cc242..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifact.java +++ /dev/null @@ -1,112 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tDeploymentArtifact complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDeploymentArtifact">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="artifactType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="artifactRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDeploymentArtifact") -public class TDeploymentArtifact extends TExtensibleElements { - - @XmlAttribute(required = true) - protected String name; - @XmlAttribute(required = true) - protected QName artifactType; - @XmlAttribute - protected QName artifactRef; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the artifactType property. - * - * @return possible object is {@link QName } - * - */ - public QName getArtifactType() { - return this.artifactType; - } - - /** - * Sets the value of the artifactType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setArtifactType(final QName value) { - this.artifactType = value; - } - - /** - * Gets the value of the artifactRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getArtifactRef() { - return this.artifactRef; - } - - /** - * Sets the value of the artifactRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setArtifactRef(final QName value) { - this.artifactRef = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifacts.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifacts.java deleted file mode 100644 index 62655f0da..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifacts.java +++ /dev/null @@ -1,77 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tDeploymentArtifacts complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDeploymentArtifacts">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="DeploymentArtifact" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifact" maxOccurs="unbounded"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDeploymentArtifacts", propOrder = {"deploymentArtifact"}) -public class TDeploymentArtifacts { - - @XmlElement(name = "DeploymentArtifact", required = true) - protected List deploymentArtifact; - - /** - * Gets the value of the deploymentArtifact property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the deploymentArtifact property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getDeploymentArtifact().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TDeploymentArtifact } - * - * - */ - public List getDeploymentArtifact() { - if (this.deploymentArtifact == null) { - this.deploymentArtifact = new ArrayList<>(); - } - return this.deploymentArtifact; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDocumentation.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDocumentation.java deleted file mode 100644 index 73ea5bedb..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TDocumentation.java +++ /dev/null @@ -1,131 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlMixed; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tDocumentation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDocumentation">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="source" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDocumentation", propOrder = {"content"}) -public class TDocumentation { - - @XmlMixed - @XmlAnyElement(lax = true) - protected List content; - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String source; - @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") - protected String lang; - - /** - * Gets the value of the content property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the content property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getContent().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } {@link Object } - * {@link Element } - * - * - */ - public List getContent() { - if (this.content == null) { - this.content = new ArrayList<>(); - } - return this.content; - } - - /** - * Gets the value of the source property. - * - * @return possible object is {@link String } - * - */ - public String getSource() { - return this.source; - } - - /** - * Sets the value of the source property. - * - * @param value allowed object is {@link String } - * - */ - public void setSource(final String value) { - this.source = value; - } - - /** - * Gets the value of the lang property. - * - * @return possible object is {@link String } - * - */ - public String getLang() { - return this.lang; - } - - /** - * Sets the value of the lang property. - * - * @param value allowed object is {@link String } - * - */ - public void setLang(final String value) { - this.lang = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityTemplate.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityTemplate.java deleted file mode 100644 index 4cb9d9e5c..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityTemplate.java +++ /dev/null @@ -1,284 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tEntityTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEntityTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Properties" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <any processContents='lax' namespace='##other'/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="PropertyConstraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    - *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEntityTemplate", propOrder = {"properties", "propertyConstraints"}) -@XmlSeeAlso({TArtifactTemplate.class, TPolicyTemplate.class, TNodeTemplate.class, TCapability.class, - TRelationshipTemplate.class, TRequirement.class}) -public abstract class TEntityTemplate extends TExtensibleElements { - - @XmlElement(name = "Properties") - protected TEntityTemplate.Properties properties; - @XmlElement(name = "PropertyConstraints") - protected TEntityTemplate.PropertyConstraints propertyConstraints; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute(required = true) - protected QName type; - - /** - * Gets the value of the properties property. - * - * @return possible object is {@link TEntityTemplate.Properties } - * - */ - public TEntityTemplate.Properties getProperties() { - return this.properties; - } - - /** - * Sets the value of the properties property. - * - * @param value allowed object is {@link TEntityTemplate.Properties } - * - */ - public void setProperties(final TEntityTemplate.Properties value) { - this.properties = value; - } - - /** - * Gets the value of the propertyConstraints property. - * - * @return possible object is {@link TEntityTemplate.PropertyConstraints } - * - */ - public TEntityTemplate.PropertyConstraints getPropertyConstraints() { - return this.propertyConstraints; - } - - /** - * Sets the value of the propertyConstraints property. - * - * @param value allowed object is {@link TEntityTemplate.PropertyConstraints } - * - */ - public void setPropertyConstraints(final TEntityTemplate.PropertyConstraints value) { - this.propertyConstraints = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link QName } - * - */ - public QName getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link QName } - * - */ - public void setType(final QName value) { - this.type = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <any processContents='lax' namespace='##other'/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class Properties { - - @XmlAnyElement(lax = true) - protected Object any; - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } {@link Element } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } {@link Element } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"propertyConstraint"}) - public static class PropertyConstraints { - - @XmlElement(name = "PropertyConstraint", required = true) - protected List propertyConstraint; - - /** - * Gets the value of the propertyConstraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the propertyConstraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getPropertyConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPropertyConstraint } - * - * - */ - public List getPropertyConstraint() { - if (this.propertyConstraint == null) { - this.propertyConstraint = new ArrayList<>(); - } - return this.propertyConstraint; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityType.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityType.java deleted file mode 100644 index f91c03285..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityType.java +++ /dev/null @@ -1,362 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tEntityType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEntityType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    - *         <element name="DerivedFrom" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="PropertiesDefinition" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="element" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *                 <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEntityType", propOrder = {"tags", "derivedFrom", "propertiesDefinition"}) -@XmlSeeAlso({TNodeType.class, TRelationshipType.class, TRequirementType.class, TCapabilityType.class, - TArtifactType.class, TPolicyType.class}) -public abstract class TEntityType extends TExtensibleElements { - - @XmlElement(name = "Tags") - protected TTags tags; - @XmlElement(name = "DerivedFrom") - protected TEntityType.DerivedFrom derivedFrom; - @XmlElement(name = "PropertiesDefinition") - protected TEntityType.PropertiesDefinition propertiesDefinition; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - @XmlAttribute(name = "abstract") - protected TBoolean _abstract; - @XmlAttribute(name = "final") - protected TBoolean _final; - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - - /** - * Gets the value of the tags property. - * - * @return possible object is {@link TTags } - * - */ - public TTags getTags() { - return this.tags; - } - - /** - * Sets the value of the tags property. - * - * @param value allowed object is {@link TTags } - * - */ - public void setTags(final TTags value) { - this.tags = value; - } - - /** - * Gets the value of the derivedFrom property. - * - * @return possible object is {@link TEntityType.DerivedFrom } - * - */ - public TEntityType.DerivedFrom getDerivedFrom() { - return this.derivedFrom; - } - - /** - * Sets the value of the derivedFrom property. - * - * @param value allowed object is {@link TEntityType.DerivedFrom } - * - */ - public void setDerivedFrom(final TEntityType.DerivedFrom value) { - this.derivedFrom = value; - } - - /** - * Gets the value of the propertiesDefinition property. - * - * @return possible object is {@link TEntityType.PropertiesDefinition } - * - */ - public TEntityType.PropertiesDefinition getPropertiesDefinition() { - return this.propertiesDefinition; - } - - /** - * Sets the value of the propertiesDefinition property. - * - * @param value allowed object is {@link TEntityType.PropertiesDefinition } - * - */ - public void setPropertiesDefinition(final TEntityType.PropertiesDefinition value) { - this.propertiesDefinition = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the abstract property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getAbstract() { - if (this._abstract == null) { - return TBoolean.NO; - } else { - return this._abstract; - } - } - - /** - * Sets the value of the abstract property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setAbstract(final TBoolean value) { - this._abstract = value; - } - - /** - * Gets the value of the final property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getFinal() { - if (this._final == null) { - return TBoolean.NO; - } else { - return this._final; - } - } - - /** - * Sets the value of the final property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setFinal(final TBoolean value) { - this._final = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class DerivedFrom { - - @XmlAttribute(required = true) - protected QName typeRef; - - /** - * Gets the value of the typeRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getTypeRef() { - return this.typeRef; - } - - /** - * Sets the value of the typeRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setTypeRef(final QName value) { - this.typeRef = value; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="element" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class PropertiesDefinition { - - @XmlAttribute - protected QName element; - @XmlAttribute - protected QName type; - - /** - * Gets the value of the element property. - * - * @return possible object is {@link QName } - * - */ - public QName getElement() { - return this.element; - } - - /** - * Sets the value of the element property. - * - * @param value allowed object is {@link QName } - * - */ - public void setElement(final QName value) { - this.element = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link QName } - * - */ - public QName getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link QName } - * - */ - public void setType(final QName value) { - this.type = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedInterface.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedInterface.java deleted file mode 100644 index 1b4debaee..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedInterface.java +++ /dev/null @@ -1,103 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tExportedInterface complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExportedInterface">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Operation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedOperation" maxOccurs="unbounded"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExportedInterface", propOrder = {"operation"}) -public class TExportedInterface { - - @XmlElement(name = "Operation", required = true) - protected List operation; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String name; - - /** - * Gets the value of the operation property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the operation property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getOperation().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TExportedOperation } - * - * - */ - public List getOperation() { - if (this.operation == null) { - this.operation = new ArrayList<>(); - } - return this.operation; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedOperation.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedOperation.java deleted file mode 100644 index 7d6481aed..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedOperation.java +++ /dev/null @@ -1,422 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -/** - *

    - * Java class for tExportedOperation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExportedOperation">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <choice>
    - *         <element name="NodeOperation">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="nodeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *                 <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *                 <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="RelationshipOperation">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="relationshipRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *                 <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *                 <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Plan">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="planRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </choice>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExportedOperation", propOrder = {"nodeOperation", "relationshipOperation", "plan"}) -public class TExportedOperation { - - @XmlElement(name = "NodeOperation") - protected TExportedOperation.NodeOperation nodeOperation; - @XmlElement(name = "RelationshipOperation") - protected TExportedOperation.RelationshipOperation relationshipOperation; - @XmlElement(name = "Plan") - protected TExportedOperation.Plan plan; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - - - /** - * Gets the value of the nodeOperation property. - * - * @return possible object is {@link TExportedOperation.NodeOperation } - * - */ - public TExportedOperation.NodeOperation getNodeOperation() { - return this.nodeOperation; - } - - /** - * Sets the value of the nodeOperation property. - * - * @param value allowed object is {@link TExportedOperation.NodeOperation } - * - */ - public void setNodeOperation(final TExportedOperation.NodeOperation value) { - this.nodeOperation = value; - } - - /** - * Gets the value of the relationshipOperation property. - * - * @return possible object is {@link TExportedOperation.RelationshipOperation } - * - */ - public TExportedOperation.RelationshipOperation getRelationshipOperation() { - return this.relationshipOperation; - } - - /** - * Sets the value of the relationshipOperation property. - * - * @param value allowed object is {@link TExportedOperation.RelationshipOperation } - * - */ - public void setRelationshipOperation(final TExportedOperation.RelationshipOperation value) { - this.relationshipOperation = value; - } - - /** - * Gets the value of the plan property. - * - * @return possible object is {@link TExportedOperation.Plan } - * - */ - public TExportedOperation.Plan getPlan() { - return this.plan; - } - - /** - * Sets the value of the plan property. - * - * @param value allowed object is {@link TExportedOperation.Plan } - * - */ - public void setPlan(final TExportedOperation.Plan value) { - this.plan = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="nodeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *       <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *       <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class NodeOperation { - - @XmlAttribute(required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object nodeRef; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String interfaceName; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String operationName; - - - /** - * Gets the value of the nodeRef property. - * - * @return possible object is {@link Object } - * - */ - public Object getNodeRef() { - return this.nodeRef; - } - - /** - * Sets the value of the nodeRef property. - * - * @param value allowed object is {@link Object } - * - */ - public void setNodeRef(final Object value) { - this.nodeRef = value; - } - - /** - * Gets the value of the interfaceName property. - * - * @return possible object is {@link String } - * - */ - public String getInterfaceName() { - return this.interfaceName; - } - - /** - * Sets the value of the interfaceName property. - * - * @param value allowed object is {@link String } - * - */ - public void setInterfaceName(final String value) { - this.interfaceName = value; - } - - /** - * Gets the value of the operationName property. - * - * @return possible object is {@link String } - * - */ - public String getOperationName() { - return this.operationName; - } - - /** - * Sets the value of the operationName property. - * - * @param value allowed object is {@link String } - * - */ - public void setOperationName(final String value) { - this.operationName = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="planRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Plan { - - @XmlAttribute(required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object planRef; - - - /** - * Gets the value of the planRef property. - * - * @return possible object is {@link Object } - * - */ - public Object getPlanRef() { - return this.planRef; - } - - /** - * Sets the value of the planRef property. - * - * @param value allowed object is {@link Object } - * - */ - public void setPlanRef(final Object value) { - this.planRef = value; - } - - } - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="relationshipRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *       <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *       <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class RelationshipOperation { - - @XmlAttribute(required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object relationshipRef; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String interfaceName; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String operationName; - - - /** - * Gets the value of the relationshipRef property. - * - * @return possible object is {@link Object } - * - */ - public Object getRelationshipRef() { - return this.relationshipRef; - } - - /** - * Sets the value of the relationshipRef property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRelationshipRef(final Object value) { - this.relationshipRef = value; - } - - /** - * Gets the value of the interfaceName property. - * - * @return possible object is {@link String } - * - */ - public String getInterfaceName() { - return this.interfaceName; - } - - /** - * Sets the value of the interfaceName property. - * - * @param value allowed object is {@link String } - * - */ - public void setInterfaceName(final String value) { - this.interfaceName = value; - } - - /** - * Gets the value of the operationName property. - * - * @return possible object is {@link String } - * - */ - public String getOperationName() { - return this.operationName; - } - - /** - * Sets the value of the operationName property. - * - * @param value allowed object is {@link String } - * - */ - public void setOperationName(final String value) { - this.operationName = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensibleElements.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensibleElements.java deleted file mode 100644 index 7404b7048..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensibleElements.java +++ /dev/null @@ -1,138 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyAttribute; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tExtensibleElements complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExtensibleElements">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element ref="{http://docs.oasis-open.org/tosca/ns/2011/12}documentation" maxOccurs="unbounded" minOccurs="0"/>
    - *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExtensibleElements", propOrder = {"documentation", "any"}) -@XmlSeeAlso({TImport.class, TServiceTemplate.class, TNodeTypeImplementation.class, - TRelationshipTypeImplementation.class, TOperation.class, TCapabilityDefinition.class, TPlan.class, - TExtension.class, TDeploymentArtifact.class, TExtensions.class, TTopologyTemplate.class, TEntityType.class, - TImplementationArtifact.class, TPolicy.class, TRequirementDefinition.class, TEntityTemplate.class, - TDefinitions.class}) -public class TExtensibleElements { - - protected List documentation; - @XmlAnyElement(lax = true) - protected List any; - @XmlAnyAttribute - private final Map otherAttributes = new HashMap<>(); - - /** - * Gets the value of the documentation property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the documentation property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getDocumentation().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TDocumentation } - * - * - */ - public List getDocumentation() { - if (this.documentation == null) { - this.documentation = new ArrayList<>(); - } - return this.documentation; - } - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getAny().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - /** - * Gets a map that contains attributes that aren't bound to any typed property on this class. - * - *

    - * the map is keyed by the name of the attribute and the value is the string value of the attribute. - * - * the map returned by this method is live, and you can add new attribute by updating the map - * directly. Because of this design, there's no setter. - * - * - * @return always non-null - */ - public Map getOtherAttributes() { - return this.otherAttributes; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtension.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtension.java deleted file mode 100644 index c89bae9d1..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtension.java +++ /dev/null @@ -1,94 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tExtension complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExtension">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="namespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="mustUnderstand" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="yes" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExtension") -public class TExtension extends TExtensibleElements { - - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String namespace; - @XmlAttribute - protected TBoolean mustUnderstand; - - /** - * Gets the value of the namespace property. - * - * @return possible object is {@link String } - * - */ - public String getNamespace() { - return this.namespace; - } - - /** - * Sets the value of the namespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setNamespace(final String value) { - this.namespace = value; - } - - /** - * Gets the value of the mustUnderstand property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getMustUnderstand() { - if (this.mustUnderstand == null) { - return TBoolean.YES; - } else { - return this.mustUnderstand; - } - } - - /** - * Sets the value of the mustUnderstand property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setMustUnderstand(final TBoolean value) { - this.mustUnderstand = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensions.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensions.java deleted file mode 100644 index 3ab4f7075..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensions.java +++ /dev/null @@ -1,78 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tExtensions complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tExtensions">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    - *       </sequence>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tExtensions", propOrder = {"extension"}) -public class TExtensions extends TExtensibleElements { - - @XmlElement(name = "Extension", required = true) - protected List extension; - - /** - * Gets the value of the extension property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the extension property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getExtension().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TExtension } - * - * - */ - public List getExtension() { - if (this.extension == null) { - this.extension = new ArrayList<>(); - } - return this.extension; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifact.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifact.java deleted file mode 100644 index 40b02e3b3..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifact.java +++ /dev/null @@ -1,143 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tImplementationArtifact complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tImplementationArtifact">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="interfaceName" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="operationName" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <attribute name="artifactType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="artifactRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tImplementationArtifact") -@XmlSeeAlso({org.oasis_open.docs.tosca.ns._2011._12.TImplementationArtifacts.ImplementationArtifact.class}) -public class TImplementationArtifact extends TExtensibleElements { - - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String interfaceName; - @XmlAttribute - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String operationName; - @XmlAttribute(required = true) - protected QName artifactType; - @XmlAttribute - protected QName artifactRef; - - /** - * Gets the value of the interfaceName property. - * - * @return possible object is {@link String } - * - */ - public String getInterfaceName() { - return this.interfaceName; - } - - /** - * Sets the value of the interfaceName property. - * - * @param value allowed object is {@link String } - * - */ - public void setInterfaceName(final String value) { - this.interfaceName = value; - } - - /** - * Gets the value of the operationName property. - * - * @return possible object is {@link String } - * - */ - public String getOperationName() { - return this.operationName; - } - - /** - * Sets the value of the operationName property. - * - * @param value allowed object is {@link String } - * - */ - public void setOperationName(final String value) { - this.operationName = value; - } - - /** - * Gets the value of the artifactType property. - * - * @return possible object is {@link QName } - * - */ - public QName getArtifactType() { - return this.artifactType; - } - - /** - * Sets the value of the artifactType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setArtifactType(final QName value) { - this.artifactType = value; - } - - /** - * Gets the value of the artifactRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getArtifactRef() { - return this.artifactRef; - } - - /** - * Sets the value of the artifactRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setArtifactRef(final QName value) { - this.artifactRef = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifacts.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifacts.java deleted file mode 100644 index 08ddc1bc2..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifacts.java +++ /dev/null @@ -1,113 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tImplementationArtifacts complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tImplementationArtifacts">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="ImplementationArtifact" maxOccurs="unbounded">
    - *           <complexType>
    - *             <complexContent>
    - *               <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifact">
    - *                 <anyAttribute processContents='lax' namespace='##other'/>
    - *               </extension>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tImplementationArtifacts", propOrder = {"implementationArtifact"}) -public class TImplementationArtifacts { - - @XmlElement(name = "ImplementationArtifact", required = true) - protected List implementationArtifact; - - /** - * Gets the value of the implementationArtifact property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the implementationArtifact property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getImplementationArtifact().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TImplementationArtifacts.ImplementationArtifact } - * - * - */ - public List getImplementationArtifact() { - if (this.implementationArtifact == null) { - this.implementationArtifact = new ArrayList<>(); - } - return this.implementationArtifact; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifact">
    -     *       <anyAttribute processContents='lax' namespace='##other'/>
    -     *     </extension>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class ImplementationArtifact extends TImplementationArtifact { - - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImport.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImport.java deleted file mode 100644 index 0c720ccdd..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TImport.java +++ /dev/null @@ -1,114 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tImport complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tImport">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="namespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="location" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="importType" use="required" type="{http://docs.oasis-open.org/tosca/ns/2011/12}importedURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tImport") -public class TImport extends TExtensibleElements { - - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String namespace; - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String location; - @XmlAttribute(required = true) - protected String importType; - - /** - * Gets the value of the namespace property. - * - * @return possible object is {@link String } - * - */ - public String getNamespace() { - return this.namespace; - } - - /** - * Sets the value of the namespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setNamespace(final String value) { - this.namespace = value; - } - - /** - * Gets the value of the location property. - * - * @return possible object is {@link String } - * - */ - public String getLocation() { - return this.location; - } - - /** - * Sets the value of the location property. - * - * @param value allowed object is {@link String } - * - */ - public void setLocation(final String value) { - this.location = value; - } - - /** - * Gets the value of the importType property. - * - * @return possible object is {@link String } - * - */ - public String getImportType() { - return this.importType; - } - - /** - * Sets the value of the importType property. - * - * @param value allowed object is {@link String } - * - */ - public void setImportType(final String value) { - this.importType = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TInterface.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TInterface.java deleted file mode 100644 index f74a7fe02..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TInterface.java +++ /dev/null @@ -1,103 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tInterface complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tInterface">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Operation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tOperation" maxOccurs="unbounded"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tInterface", propOrder = {"operation"}) -public class TInterface { - - @XmlElement(name = "Operation", required = true) - protected List operation; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String name; - - /** - * Gets the value of the operation property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the operation property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getOperation().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TOperation } - * - * - */ - public List getOperation() { - if (this.operation == null) { - this.operation = new ArrayList<>(); - } - return this.operation; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTemplate.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTemplate.java deleted file mode 100644 index 0b4619888..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTemplate.java +++ /dev/null @@ -1,439 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tNodeTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tNodeTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <sequence>
    - *         <element name="Requirements" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirement" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Capabilities" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapability" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="Policies" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="DeploymentArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifacts" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="minInstances" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    - *       <attribute name="maxInstances" default="1">
    - *         <simpleType>
    - *           <union>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    - *                 <pattern value="([1-9]+[0-9]*)"/>
    - *               </restriction>
    - *             </simpleType>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *                 <enumeration value="unbounded"/>
    - *               </restriction>
    - *             </simpleType>
    - *           </union>
    - *         </simpleType>
    - *       </attribute>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tNodeTemplate", propOrder = {"requirements", "capabilities", "policies", "deploymentArtifacts"}) -public class TNodeTemplate extends TEntityTemplate { - - @XmlElement(name = "Requirements") - protected TNodeTemplate.Requirements requirements; - @XmlElement(name = "Capabilities") - protected TNodeTemplate.Capabilities capabilities; - @XmlElement(name = "Policies") - protected TNodeTemplate.Policies policies; - @XmlElement(name = "DeploymentArtifacts") - protected TDeploymentArtifacts deploymentArtifacts; - @XmlAttribute - protected String name; - @XmlAttribute - protected Integer minInstances; - @XmlAttribute - protected String maxInstances; - - /** - * Gets the value of the requirements property. - * - * @return possible object is {@link TNodeTemplate.Requirements } - * - */ - public TNodeTemplate.Requirements getRequirements() { - return this.requirements; - } - - /** - * Sets the value of the requirements property. - * - * @param value allowed object is {@link TNodeTemplate.Requirements } - * - */ - public void setRequirements(final TNodeTemplate.Requirements value) { - this.requirements = value; - } - - /** - * Gets the value of the capabilities property. - * - * @return possible object is {@link TNodeTemplate.Capabilities } - * - */ - public TNodeTemplate.Capabilities getCapabilities() { - return this.capabilities; - } - - /** - * Sets the value of the capabilities property. - * - * @param value allowed object is {@link TNodeTemplate.Capabilities } - * - */ - public void setCapabilities(final TNodeTemplate.Capabilities value) { - this.capabilities = value; - } - - /** - * Gets the value of the policies property. - * - * @return possible object is {@link TNodeTemplate.Policies } - * - */ - public TNodeTemplate.Policies getPolicies() { - return this.policies; - } - - /** - * Sets the value of the policies property. - * - * @param value allowed object is {@link TNodeTemplate.Policies } - * - */ - public void setPolicies(final TNodeTemplate.Policies value) { - this.policies = value; - } - - /** - * Gets the value of the deploymentArtifacts property. - * - * @return possible object is {@link TDeploymentArtifacts } - * - */ - public TDeploymentArtifacts getDeploymentArtifacts() { - return this.deploymentArtifacts; - } - - /** - * Sets the value of the deploymentArtifacts property. - * - * @param value allowed object is {@link TDeploymentArtifacts } - * - */ - public void setDeploymentArtifacts(final TDeploymentArtifacts value) { - this.deploymentArtifacts = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the minInstances property. - * - * @return possible object is {@link Integer } - * - */ - public int getMinInstances() { - if (this.minInstances == null) { - return 1; - } else { - return this.minInstances; - } - } - - /** - * Sets the value of the minInstances property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setMinInstances(final Integer value) { - this.minInstances = value; - } - - /** - * Gets the value of the maxInstances property. - * - * @return possible object is {@link String } - * - */ - public String getMaxInstances() { - if (this.maxInstances == null) { - return "1"; - } else { - return this.maxInstances; - } - } - - /** - * Sets the value of the maxInstances property. - * - * @param value allowed object is {@link String } - * - */ - public void setMaxInstances(final String value) { - this.maxInstances = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapability" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"capability"}) - public static class Capabilities { - - @XmlElement(name = "Capability", required = true) - protected List capability; - - /** - * Gets the value of the capability property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the capability property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getCapability().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCapability } - * - * - */ - public List getCapability() { - if (this.capability == null) { - this.capability = new ArrayList<>(); - } - return this.capability; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"policy"}) - public static class Policies { - - @XmlElement(name = "Policy", required = true) - protected List policy; - - /** - * Gets the value of the policy property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the policy property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getPolicy().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPolicy } - * - * - */ - public List getPolicy() { - if (this.policy == null) { - this.policy = new ArrayList<>(); - } - return this.policy; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirement" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"requirement"}) - public static class Requirements { - - @XmlElement(name = "Requirement", required = true) - protected List requirement; - - /** - * Gets the value of the requirement property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the requirement property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getRequirement().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRequirement } - * - * - */ - public List getRequirement() { - if (this.requirement == null) { - this.requirement = new ArrayList<>(); - } - return this.requirement; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeType.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeType.java deleted file mode 100644 index a87f28ad7..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeType.java +++ /dev/null @@ -1,347 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tNodeType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tNodeType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <sequence>
    - *         <element name="RequirementDefinitions" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="RequirementDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementDefinition" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="CapabilityDefinitions" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="CapabilityDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityDefinition" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="InstanceStates" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyElementInstanceStates" minOccurs="0"/>
    - *         <element name="Interfaces" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tNodeType", - propOrder = {"requirementDefinitions", "capabilityDefinitions", "instanceStates", "interfaces"}) -public class TNodeType extends TEntityType { - - @XmlElement(name = "RequirementDefinitions") - protected TNodeType.RequirementDefinitions requirementDefinitions; - @XmlElement(name = "CapabilityDefinitions") - protected TNodeType.CapabilityDefinitions capabilityDefinitions; - @XmlElement(name = "InstanceStates") - protected TTopologyElementInstanceStates instanceStates; - @XmlElement(name = "Interfaces") - protected TNodeType.Interfaces interfaces; - - /** - * Gets the value of the requirementDefinitions property. - * - * @return possible object is {@link TNodeType.RequirementDefinitions } - * - */ - public TNodeType.RequirementDefinitions getRequirementDefinitions() { - return this.requirementDefinitions; - } - - /** - * Sets the value of the requirementDefinitions property. - * - * @param value allowed object is {@link TNodeType.RequirementDefinitions } - * - */ - public void setRequirementDefinitions(final TNodeType.RequirementDefinitions value) { - this.requirementDefinitions = value; - } - - /** - * Gets the value of the capabilityDefinitions property. - * - * @return possible object is {@link TNodeType.CapabilityDefinitions } - * - */ - public TNodeType.CapabilityDefinitions getCapabilityDefinitions() { - return this.capabilityDefinitions; - } - - /** - * Sets the value of the capabilityDefinitions property. - * - * @param value allowed object is {@link TNodeType.CapabilityDefinitions } - * - */ - public void setCapabilityDefinitions(final TNodeType.CapabilityDefinitions value) { - this.capabilityDefinitions = value; - } - - /** - * Gets the value of the instanceStates property. - * - * @return possible object is {@link TTopologyElementInstanceStates } - * - */ - public TTopologyElementInstanceStates getInstanceStates() { - return this.instanceStates; - } - - /** - * Sets the value of the instanceStates property. - * - * @param value allowed object is {@link TTopologyElementInstanceStates } - * - */ - public void setInstanceStates(final TTopologyElementInstanceStates value) { - this.instanceStates = value; - } - - /** - * Gets the value of the interfaces property. - * - * @return possible object is {@link TNodeType.Interfaces } - * - */ - public TNodeType.Interfaces getInterfaces() { - return this.interfaces; - } - - /** - * Sets the value of the interfaces property. - * - * @param value allowed object is {@link TNodeType.Interfaces } - * - */ - public void setInterfaces(final TNodeType.Interfaces value) { - this.interfaces = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="CapabilityDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityDefinition" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"capabilityDefinition"}) - public static class CapabilityDefinitions { - - @XmlElement(name = "CapabilityDefinition", required = true) - protected List capabilityDefinition; - - /** - * Gets the value of the capabilityDefinition property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the capabilityDefinition property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getCapabilityDefinition().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCapabilityDefinition } - * - * - */ - public List getCapabilityDefinition() { - if (this.capabilityDefinition == null) { - this.capabilityDefinition = new ArrayList<>(); - } - return this.capabilityDefinition; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"_interface"}) - public static class Interfaces { - - @XmlElement(name = "Interface", required = true) - protected List _interface; - - /** - * Gets the value of the interface property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the interface property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInterface().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TInterface } - * - * - */ - public List getInterface() { - if (this._interface == null) { - this._interface = new ArrayList<>(); - } - return this._interface; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="RequirementDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementDefinition" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"requirementDefinition"}) - public static class RequirementDefinitions { - - @XmlElement(name = "RequirementDefinition", required = true) - protected List requirementDefinition; - - /** - * Gets the value of the requirementDefinition property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the requirementDefinition property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getRequirementDefinition().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRequirementDefinition } - * - * - */ - public List getRequirementDefinition() { - if (this.requirementDefinition == null) { - this.requirementDefinition = new ArrayList<>(); - } - return this.requirementDefinition; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTypeImplementation.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTypeImplementation.java deleted file mode 100644 index 31964f18b..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTypeImplementation.java +++ /dev/null @@ -1,348 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tNodeTypeImplementation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tNodeTypeImplementation">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    - *         <element name="DerivedFrom" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="nodeTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="RequiredContainerFeatures" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeatures" minOccurs="0"/>
    - *         <element name="ImplementationArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifacts" minOccurs="0"/>
    - *         <element name="DeploymentArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifacts" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="nodeType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tNodeTypeImplementation", propOrder = {"tags", "derivedFrom", "requiredContainerFeatures", - "implementationArtifacts", "deploymentArtifacts"}) -public class TNodeTypeImplementation extends TExtensibleElements { - - @XmlElement(name = "Tags") - protected TTags tags; - @XmlElement(name = "DerivedFrom") - protected TNodeTypeImplementation.DerivedFrom derivedFrom; - @XmlElement(name = "RequiredContainerFeatures") - protected TRequiredContainerFeatures requiredContainerFeatures; - @XmlElement(name = "ImplementationArtifacts") - protected TImplementationArtifacts implementationArtifacts; - @XmlElement(name = "DeploymentArtifacts") - protected TDeploymentArtifacts deploymentArtifacts; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - @XmlAttribute(required = true) - protected QName nodeType; - @XmlAttribute(name = "abstract") - protected TBoolean _abstract; - @XmlAttribute(name = "final") - protected TBoolean _final; - - /** - * Gets the value of the tags property. - * - * @return possible object is {@link TTags } - * - */ - public TTags getTags() { - return this.tags; - } - - /** - * Sets the value of the tags property. - * - * @param value allowed object is {@link TTags } - * - */ - public void setTags(final TTags value) { - this.tags = value; - } - - /** - * Gets the value of the derivedFrom property. - * - * @return possible object is {@link TNodeTypeImplementation.DerivedFrom } - * - */ - public TNodeTypeImplementation.DerivedFrom getDerivedFrom() { - return this.derivedFrom; - } - - /** - * Sets the value of the derivedFrom property. - * - * @param value allowed object is {@link TNodeTypeImplementation.DerivedFrom } - * - */ - public void setDerivedFrom(final TNodeTypeImplementation.DerivedFrom value) { - this.derivedFrom = value; - } - - /** - * Gets the value of the requiredContainerFeatures property. - * - * @return possible object is {@link TRequiredContainerFeatures } - * - */ - public TRequiredContainerFeatures getRequiredContainerFeatures() { - return this.requiredContainerFeatures; - } - - /** - * Sets the value of the requiredContainerFeatures property. - * - * @param value allowed object is {@link TRequiredContainerFeatures } - * - */ - public void setRequiredContainerFeatures(final TRequiredContainerFeatures value) { - this.requiredContainerFeatures = value; - } - - /** - * Gets the value of the implementationArtifacts property. - * - * @return possible object is {@link TImplementationArtifacts } - * - */ - public TImplementationArtifacts getImplementationArtifacts() { - return this.implementationArtifacts; - } - - /** - * Sets the value of the implementationArtifacts property. - * - * @param value allowed object is {@link TImplementationArtifacts } - * - */ - public void setImplementationArtifacts(final TImplementationArtifacts value) { - this.implementationArtifacts = value; - } - - /** - * Gets the value of the deploymentArtifacts property. - * - * @return possible object is {@link TDeploymentArtifacts } - * - */ - public TDeploymentArtifacts getDeploymentArtifacts() { - return this.deploymentArtifacts; - } - - /** - * Sets the value of the deploymentArtifacts property. - * - * @param value allowed object is {@link TDeploymentArtifacts } - * - */ - public void setDeploymentArtifacts(final TDeploymentArtifacts value) { - this.deploymentArtifacts = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - /** - * Gets the value of the nodeType property. - * - * @return possible object is {@link QName } - * - */ - public QName getNodeType() { - return this.nodeType; - } - - /** - * Sets the value of the nodeType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setNodeType(final QName value) { - this.nodeType = value; - } - - /** - * Gets the value of the abstract property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getAbstract() { - if (this._abstract == null) { - return TBoolean.NO; - } else { - return this._abstract; - } - } - - /** - * Sets the value of the abstract property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setAbstract(final TBoolean value) { - this._abstract = value; - } - - /** - * Gets the value of the final property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getFinal() { - if (this._final == null) { - return TBoolean.NO; - } else { - return this._final; - } - } - - /** - * Sets the value of the final property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setFinal(final TBoolean value) { - this._final = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="nodeTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class DerivedFrom { - - @XmlAttribute(required = true) - protected QName nodeTypeImplementationRef; - - /** - * Gets the value of the nodeTypeImplementationRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getNodeTypeImplementationRef() { - return this.nodeTypeImplementationRef; - } - - /** - * Sets the value of the nodeTypeImplementationRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setNodeTypeImplementationRef(final QName value) { - this.nodeTypeImplementationRef = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TOperation.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TOperation.java deleted file mode 100644 index 84264e0a3..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TOperation.java +++ /dev/null @@ -1,260 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - - -/** - *

    - * Java class for tOperation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tOperation">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="InputParameters" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="OutputParameters" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tOperation", propOrder = {"inputParameters", "outputParameters"}) -public class TOperation extends TExtensibleElements { - - @XmlElement(name = "InputParameters") - protected TOperation.InputParameters inputParameters; - @XmlElement(name = "OutputParameters") - protected TOperation.OutputParameters outputParameters; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - - /** - * Gets the value of the inputParameters property. - * - * @return possible object is {@link TOperation.InputParameters } - * - */ - public TOperation.InputParameters getInputParameters() { - return this.inputParameters; - } - - /** - * Sets the value of the inputParameters property. - * - * @param value allowed object is {@link TOperation.InputParameters } - * - */ - public void setInputParameters(final TOperation.InputParameters value) { - this.inputParameters = value; - } - - /** - * Gets the value of the outputParameters property. - * - * @return possible object is {@link TOperation.OutputParameters } - * - */ - public TOperation.OutputParameters getOutputParameters() { - return this.outputParameters; - } - - /** - * Sets the value of the outputParameters property. - * - * @param value allowed object is {@link TOperation.OutputParameters } - * - */ - public void setOutputParameters(final TOperation.OutputParameters value) { - this.outputParameters = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"inputParameter"}) - public static class InputParameters { - - @XmlElement(name = "InputParameter", required = true) - protected List inputParameter; - - /** - * Gets the value of the inputParameter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the inputParameter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInputParameter().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * - */ - public List getInputParameter() { - if (this.inputParameter == null) { - this.inputParameter = new ArrayList<>(); - } - return this.inputParameter; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"outputParameter"}) - public static class OutputParameters { - - @XmlElement(name = "OutputParameter", required = true) - protected List outputParameter; - - /** - * Gets the value of the outputParameter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the outputParameter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getOutputParameter().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * - */ - public List getOutputParameter() { - if (this.outputParameter == null) { - this.outputParameter = new ArrayList<>(); - } - return this.outputParameter; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TParameter.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TParameter.java deleted file mode 100644 index 8f63e7120..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TParameter.java +++ /dev/null @@ -1,114 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tParameter complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tParameter">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="required" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="yes" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tParameter") -public class TParameter { - - @XmlAttribute(required = true) - protected String name; - @XmlAttribute(required = true) - protected String type; - @XmlAttribute - protected TBoolean required; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link String } - * - */ - public String getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link String } - * - */ - public void setType(final String value) { - this.type = value; - } - - /** - * Gets the value of the required property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getRequired() { - if (this.required == null) { - return TBoolean.YES; - } else { - return this.required; - } - } - - /** - * Sets the value of the required property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setRequired(final TBoolean value) { - this.required = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPlan.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPlan.java deleted file mode 100644 index e1c6658a2..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPlan.java +++ /dev/null @@ -1,527 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tPlan complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPlan">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Precondition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCondition" minOccurs="0"/>
    - *         <element name="InputParameters" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="OutputParameters" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <choice>
    - *           <element name="PlanModel">
    - *             <complexType>
    - *               <complexContent>
    - *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                   <sequence>
    - *                     <any processContents='lax' namespace='##other'/>
    - *                   </sequence>
    - *                 </restriction>
    - *               </complexContent>
    - *             </complexType>
    - *           </element>
    - *           <element name="PlanModelReference">
    - *             <complexType>
    - *               <complexContent>
    - *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                   <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *                 </restriction>
    - *               </complexContent>
    - *             </complexType>
    - *           </element>
    - *         </choice>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="planType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="planLanguage" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPlan", - propOrder = {"precondition", "inputParameters", "outputParameters", "planModel", "planModelReference"}) -public class TPlan extends TExtensibleElements { - - @XmlElement(name = "Precondition") - protected TCondition precondition; - @XmlElement(name = "InputParameters") - protected TPlan.InputParameters inputParameters; - @XmlElement(name = "OutputParameters") - protected TPlan.OutputParameters outputParameters; - @XmlElement(name = "PlanModel") - protected TPlan.PlanModel planModel; - @XmlElement(name = "PlanModelReference") - protected TPlan.PlanModelReference planModelReference; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute - protected String name; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String planType; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String planLanguage; - - /** - * Gets the value of the precondition property. - * - * @return possible object is {@link TCondition } - * - */ - public TCondition getPrecondition() { - return this.precondition; - } - - /** - * Sets the value of the precondition property. - * - * @param value allowed object is {@link TCondition } - * - */ - public void setPrecondition(final TCondition value) { - this.precondition = value; - } - - /** - * Gets the value of the inputParameters property. - * - * @return possible object is {@link TPlan.InputParameters } - * - */ - public TPlan.InputParameters getInputParameters() { - return this.inputParameters; - } - - /** - * Sets the value of the inputParameters property. - * - * @param value allowed object is {@link TPlan.InputParameters } - * - */ - public void setInputParameters(final TPlan.InputParameters value) { - this.inputParameters = value; - } - - /** - * Gets the value of the outputParameters property. - * - * @return possible object is {@link TPlan.OutputParameters } - * - */ - public TPlan.OutputParameters getOutputParameters() { - return this.outputParameters; - } - - /** - * Sets the value of the outputParameters property. - * - * @param value allowed object is {@link TPlan.OutputParameters } - * - */ - public void setOutputParameters(final TPlan.OutputParameters value) { - this.outputParameters = value; - } - - /** - * Gets the value of the planModel property. - * - * @return possible object is {@link TPlan.PlanModel } - * - */ - public TPlan.PlanModel getPlanModel() { - return this.planModel; - } - - /** - * Sets the value of the planModel property. - * - * @param value allowed object is {@link TPlan.PlanModel } - * - */ - public void setPlanModel(final TPlan.PlanModel value) { - this.planModel = value; - } - - /** - * Gets the value of the planModelReference property. - * - * @return possible object is {@link TPlan.PlanModelReference } - * - */ - public TPlan.PlanModelReference getPlanModelReference() { - return this.planModelReference; - } - - /** - * Sets the value of the planModelReference property. - * - * @param value allowed object is {@link TPlan.PlanModelReference } - * - */ - public void setPlanModelReference(final TPlan.PlanModelReference value) { - this.planModelReference = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the planType property. - * - * @return possible object is {@link String } - * - */ - public String getPlanType() { - return this.planType; - } - - /** - * Sets the value of the planType property. - * - * @param value allowed object is {@link String } - * - */ - public void setPlanType(final String value) { - this.planType = value; - } - - /** - * Gets the value of the planLanguage property. - * - * @return possible object is {@link String } - * - */ - public String getPlanLanguage() { - return this.planLanguage; - } - - /** - * Sets the value of the planLanguage property. - * - * @param value allowed object is {@link String } - * - */ - public void setPlanLanguage(final String value) { - this.planLanguage = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"inputParameter"}) - public static class InputParameters { - - @XmlElement(name = "InputParameter", required = true) - protected List inputParameter; - - /** - * Gets the value of the inputParameter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the inputParameter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInputParameter().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * - */ - public List getInputParameter() { - if (this.inputParameter == null) { - this.inputParameter = new ArrayList<>(); - } - return this.inputParameter; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"outputParameter"}) - public static class OutputParameters { - - @XmlElement(name = "OutputParameter", required = true) - protected List outputParameter; - - /** - * Gets the value of the outputParameter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the outputParameter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getOutputParameter().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TParameter } - * - * - */ - public List getOutputParameter() { - if (this.outputParameter == null) { - this.outputParameter = new ArrayList<>(); - } - return this.outputParameter; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <any processContents='lax' namespace='##other'/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class PlanModel { - - @XmlAnyElement(lax = true) - protected Object any; - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } {@link Element } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } {@link Element } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class PlanModelReference { - - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String reference; - - /** - * Gets the value of the reference property. - * - * @return possible object is {@link String } - * - */ - public String getReference() { - return this.reference; - } - - /** - * Sets the value of the reference property. - * - * @param value allowed object is {@link String } - * - */ - public void setReference(final String value) { - this.reference = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPlans.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPlans.java deleted file mode 100644 index 0d46e7922..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPlans.java +++ /dev/null @@ -1,103 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for tPlans complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPlans">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="BuildPlan" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPlan" maxOccurs="unbounded"/>
    - *       </sequence>
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPlans", propOrder = {"plan"}) -public class TPlans { - - @XmlElement(name = "Plan", required = true) - protected List plan; - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - - - /** - * Gets the value of the plan property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the plan property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getPlan().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TPlan } - * - * - */ - public List getPlan() { - if (this.plan == null) { - this.plan = new ArrayList<>(); - } - return this.plan; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicy.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicy.java deleted file mode 100644 index 1335eae84..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicy.java +++ /dev/null @@ -1,112 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tPolicy complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPolicy">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="policyType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="policyRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPolicy") -public class TPolicy extends TExtensibleElements { - - @XmlAttribute - protected String name; - @XmlAttribute(required = true) - protected QName policyType; - @XmlAttribute - protected QName policyRef; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the policyType property. - * - * @return possible object is {@link QName } - * - */ - public QName getPolicyType() { - return this.policyType; - } - - /** - * Sets the value of the policyType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setPolicyType(final QName value) { - this.policyType = value; - } - - /** - * Gets the value of the policyRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getPolicyRef() { - return this.policyRef; - } - - /** - * Sets the value of the policyRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setPolicyRef(final QName value) { - this.policyRef = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyTemplate.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyTemplate.java deleted file mode 100644 index 949abfba2..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyTemplate.java +++ /dev/null @@ -1,65 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tPolicyTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPolicyTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPolicyTemplate") -public class TPolicyTemplate extends TEntityTemplate { - - @XmlAttribute - protected String name; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyType.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyType.java deleted file mode 100644 index b9fe75349..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyType.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tPolicyType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPolicyType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <sequence>
    - *         <element name="AppliesTo" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tAppliesTo"/>
    - *       </sequence>
    - *       <attribute name="policyLanguage" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPolicyType", propOrder = {"appliesTo"}) -public class TPolicyType extends TEntityType { - - @XmlElement(name = "AppliesTo", required = true) - protected TAppliesTo appliesTo; - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String policyLanguage; - - /** - * Gets the value of the appliesTo property. - * - * @return possible object is {@link TAppliesTo } - * - */ - public TAppliesTo getAppliesTo() { - return this.appliesTo; - } - - /** - * Sets the value of the appliesTo property. - * - * @param value allowed object is {@link TAppliesTo } - * - */ - public void setAppliesTo(final TAppliesTo value) { - this.appliesTo = value; - } - - /** - * Gets the value of the policyLanguage property. - * - * @return possible object is {@link String } - * - */ - public String getPolicyLanguage() { - return this.policyLanguage; - } - - /** - * Sets the value of the policyLanguage property. - * - * @param value allowed object is {@link String } - * - */ - public void setPolicyLanguage(final String value) { - this.policyLanguage = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyConstraint.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyConstraint.java deleted file mode 100644 index ccf1910ee..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyConstraint.java +++ /dev/null @@ -1,64 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tPropertyConstraint complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPropertyConstraint">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint">
    - *       <attribute name="property" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPropertyConstraint") -public class TPropertyConstraint extends TConstraint { - - @XmlAttribute(required = true) - protected String property; - - /** - * Gets the value of the property property. - * - * @return possible object is {@link String } - * - */ - public String getProperty() { - return this.property; - } - - /** - * Sets the value of the property property. - * - * @param value allowed object is {@link String } - * - */ - public void setProperty(final String value) { - this.property = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyMapping.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyMapping.java deleted file mode 100644 index 8ed912071..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyMapping.java +++ /dev/null @@ -1,114 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tPropertyMapping complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tPropertyMapping">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="serviceTemplatePropertyRef" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="targetObjectRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *       <attribute name="targetPropertyRef" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tPropertyMapping") -public class TPropertyMapping { - - @XmlAttribute(required = true) - protected String serviceTemplatePropertyRef; - @XmlAttribute(required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object targetObjectRef; - @XmlAttribute(required = true) - protected String targetPropertyRef; - - /** - * Gets the value of the serviceTemplatePropertyRef property. - * - * @return possible object is {@link String } - * - */ - public String getServiceTemplatePropertyRef() { - return this.serviceTemplatePropertyRef; - } - - /** - * Sets the value of the serviceTemplatePropertyRef property. - * - * @param value allowed object is {@link String } - * - */ - public void setServiceTemplatePropertyRef(final String value) { - this.serviceTemplatePropertyRef = value; - } - - /** - * Gets the value of the targetObjectRef property. - * - * @return possible object is {@link Object } - * - */ - public Object getTargetObjectRef() { - return this.targetObjectRef; - } - - /** - * Sets the value of the targetObjectRef property. - * - * @param value allowed object is {@link Object } - * - */ - public void setTargetObjectRef(final Object value) { - this.targetObjectRef = value; - } - - /** - * Gets the value of the targetPropertyRef property. - * - * @return possible object is {@link String } - * - */ - public String getTargetPropertyRef() { - return this.targetPropertyRef; - } - - /** - * Sets the value of the targetPropertyRef property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetPropertyRef(final String value) { - this.targetPropertyRef = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTemplate.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTemplate.java deleted file mode 100644 index 627eed9cc..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTemplate.java +++ /dev/null @@ -1,430 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tRelationshipTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRelationshipTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <sequence>
    - *         <element name="SourceElement">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="TargetElement">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="RelationshipConstraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="RelationshipConstraint" maxOccurs="unbounded">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <any processContents='lax' namespace='##other' minOccurs="0"/>
    - *                           </sequence>
    - *                           <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRelationshipTemplate", propOrder = {"sourceElement", "targetElement", "relationshipConstraints"}) -public class TRelationshipTemplate extends TEntityTemplate { - - @XmlElement(name = "SourceElement", required = true) - protected TRelationshipTemplate.SourceElement sourceElement; - @XmlElement(name = "TargetElement", required = true) - protected TRelationshipTemplate.TargetElement targetElement; - @XmlElement(name = "RelationshipConstraints") - protected TRelationshipTemplate.RelationshipConstraints relationshipConstraints; - @XmlAttribute - protected String name; - - /** - * Gets the value of the sourceElement property. - * - * @return possible object is {@link TRelationshipTemplate.SourceElement } - * - */ - public TRelationshipTemplate.SourceElement getSourceElement() { - return this.sourceElement; - } - - /** - * Sets the value of the sourceElement property. - * - * @param value allowed object is {@link TRelationshipTemplate.SourceElement } - * - */ - public void setSourceElement(final TRelationshipTemplate.SourceElement value) { - this.sourceElement = value; - } - - /** - * Gets the value of the targetElement property. - * - * @return possible object is {@link TRelationshipTemplate.TargetElement } - * - */ - public TRelationshipTemplate.TargetElement getTargetElement() { - return this.targetElement; - } - - /** - * Sets the value of the targetElement property. - * - * @param value allowed object is {@link TRelationshipTemplate.TargetElement } - * - */ - public void setTargetElement(final TRelationshipTemplate.TargetElement value) { - this.targetElement = value; - } - - /** - * Gets the value of the relationshipConstraints property. - * - * @return possible object is {@link TRelationshipTemplate.RelationshipConstraints } - * - */ - public TRelationshipTemplate.RelationshipConstraints getRelationshipConstraints() { - return this.relationshipConstraints; - } - - /** - * Sets the value of the relationshipConstraints property. - * - * @param value allowed object is {@link TRelationshipTemplate.RelationshipConstraints } - * - */ - public void setRelationshipConstraints(final TRelationshipTemplate.RelationshipConstraints value) { - this.relationshipConstraints = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="RelationshipConstraint" maxOccurs="unbounded">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <any processContents='lax' namespace='##other' minOccurs="0"/>
    -     *                 </sequence>
    -     *                 <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"relationshipConstraint"}) - public static class RelationshipConstraints { - - @XmlElement(name = "RelationshipConstraint", required = true) - protected List relationshipConstraint; - - /** - * Gets the value of the relationshipConstraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the relationshipConstraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getRelationshipConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint } - * - * - */ - public List getRelationshipConstraint() { - if (this.relationshipConstraint == null) { - this.relationshipConstraint = new ArrayList<>(); - } - return this.relationshipConstraint; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <any processContents='lax' namespace='##other' minOccurs="0"/>
    -         *       </sequence>
    -         *       <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class RelationshipConstraint { - - @XmlAnyElement(lax = true) - protected Object any; - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String constraintType; - - /** - * Gets the value of the any property. - * - * @return possible object is {@link Object } {@link Element } - * - */ - public Object getAny() { - return this.any; - } - - /** - * Sets the value of the any property. - * - * @param value allowed object is {@link Object } {@link Element } - * - */ - public void setAny(final Object value) { - this.any = value; - } - - /** - * Gets the value of the constraintType property. - * - * @return possible object is {@link String } - * - */ - public String getConstraintType() { - return this.constraintType; - } - - /** - * Sets the value of the constraintType property. - * - * @param value allowed object is {@link String } - * - */ - public void setConstraintType(final String value) { - this.constraintType = value; - } - - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class SourceElement { - - @XmlAttribute(required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object ref; - - /** - * Gets the value of the ref property. - * - * @return possible object is {@link Object } - * - */ - public Object getRef() { - return this.ref; - } - - /** - * Sets the value of the ref property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRef(final Object value) { - this.ref = value; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class TargetElement { - - @XmlAttribute(required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object ref; - - /** - * Gets the value of the ref property. - * - * @return possible object is {@link Object } - * - */ - public Object getRef() { - return this.ref; - } - - /** - * Sets the value of the ref property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRef(final Object value) { - this.ref = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipType.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipType.java deleted file mode 100644 index 353f04b87..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipType.java +++ /dev/null @@ -1,427 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tRelationshipType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRelationshipType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <sequence>
    - *         <element name="InstanceStates" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyElementInstanceStates" minOccurs="0"/>
    - *         <element name="SourceInterfaces" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="TargetInterfaces" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="ValidSource" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="ValidTarget" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRelationshipType", propOrder = {"instanceStates", "interfaces", "sourceInterfaces", - "targetInterfaces", "validSource", "validTarget"}) -public class TRelationshipType extends TEntityType { - - @XmlElement(name = "InstanceStates") - protected TTopologyElementInstanceStates instanceStates; - @XmlElement(name = "Interfaces", namespace = "http://www.opentosca.org/winery/extensions/tosca/2013/02/12") - protected TInterfaces interfaces; - @XmlElement(name = "SourceInterfaces") - protected TRelationshipType.SourceInterfaces sourceInterfaces; - @XmlElement(name = "TargetInterfaces") - protected TRelationshipType.TargetInterfaces targetInterfaces; - @XmlElement(name = "ValidSource") - protected TRelationshipType.ValidSource validSource; - @XmlElement(name = "ValidTarget") - protected TRelationshipType.ValidTarget validTarget; - - /** - * Gets the value of the instanceStates property. - * - * @return possible object is {@link TTopologyElementInstanceStates } - * - */ - public TTopologyElementInstanceStates getInstanceStates() { - return this.instanceStates; - } - - /** - * Sets the value of the instanceStates property. - * - * @param value allowed object is {@link TTopologyElementInstanceStates } - * - */ - public void setInstanceStates(final TTopologyElementInstanceStates value) { - this.instanceStates = value; - } - - public TInterfaces getInterfaces() { - return this.interfaces; - } - - public void setInterfaces(final TInterfaces interfaces) { - this.interfaces = interfaces; - } - - /** - * Gets the value of the sourceInterfaces property. - * - * @return possible object is {@link TRelationshipType.SourceInterfaces } - * - */ - public TRelationshipType.SourceInterfaces getSourceInterfaces() { - return this.sourceInterfaces; - } - - /** - * Sets the value of the sourceInterfaces property. - * - * @param value allowed object is {@link TRelationshipType.SourceInterfaces } - * - */ - public void setSourceInterfaces(final TRelationshipType.SourceInterfaces value) { - this.sourceInterfaces = value; - } - - /** - * Gets the value of the targetInterfaces property. - * - * @return possible object is {@link TRelationshipType.TargetInterfaces } - * - */ - public TRelationshipType.TargetInterfaces getTargetInterfaces() { - return this.targetInterfaces; - } - - /** - * Sets the value of the targetInterfaces property. - * - * @param value allowed object is {@link TRelationshipType.TargetInterfaces } - * - */ - public void setTargetInterfaces(final TRelationshipType.TargetInterfaces value) { - this.targetInterfaces = value; - } - - /** - * Gets the value of the validSource property. - * - * @return possible object is {@link TRelationshipType.ValidSource } - * - */ - public TRelationshipType.ValidSource getValidSource() { - return this.validSource; - } - - /** - * Sets the value of the validSource property. - * - * @param value allowed object is {@link TRelationshipType.ValidSource } - * - */ - public void setValidSource(final TRelationshipType.ValidSource value) { - this.validSource = value; - } - - /** - * Gets the value of the validTarget property. - * - * @return possible object is {@link TRelationshipType.ValidTarget } - * - */ - public TRelationshipType.ValidTarget getValidTarget() { - return this.validTarget; - } - - /** - * Sets the value of the validTarget property. - * - * @param value allowed object is {@link TRelationshipType.ValidTarget } - * - */ - public void setValidTarget(final TRelationshipType.ValidTarget value) { - this.validTarget = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"_interface"}) - public static class SourceInterfaces { - - @XmlElement(name = "Interface", required = true) - protected List _interface; - - /** - * Gets the value of the interface property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the interface property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInterface().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TInterface } - * - * - */ - public List getInterface() { - if (this._interface == null) { - this._interface = new ArrayList<>(); - } - return this._interface; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"_interface"}) - public static class TargetInterfaces { - - @XmlElement(name = "Interface", required = true) - protected List _interface; - - /** - * Gets the value of the interface property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the interface property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInterface().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TInterface } - * - * - */ - public List getInterface() { - if (this._interface == null) { - this._interface = new ArrayList<>(); - } - return this._interface; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class ValidSource { - - @XmlAttribute(required = true) - protected QName typeRef; - - /** - * Gets the value of the typeRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getTypeRef() { - return this.typeRef; - } - - /** - * Sets the value of the typeRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setTypeRef(final QName value) { - this.typeRef = value; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class ValidTarget { - - @XmlAttribute(required = true) - protected QName typeRef; - - /** - * Gets the value of the typeRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getTypeRef() { - return this.typeRef; - } - - /** - * Sets the value of the typeRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setTypeRef(final QName value) { - this.typeRef = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTypeImplementation.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTypeImplementation.java deleted file mode 100644 index d51c92830..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTypeImplementation.java +++ /dev/null @@ -1,325 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tRelationshipTypeImplementation complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRelationshipTypeImplementation">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    - *         <element name="DerivedFrom" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="relationshipTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element name="RequiredContainerFeatures" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeatures" minOccurs="0"/>
    - *         <element name="ImplementationArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifacts" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="relationshipType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRelationshipTypeImplementation", - propOrder = {"tags", "derivedFrom", "requiredContainerFeatures", "implementationArtifacts"}) -public class TRelationshipTypeImplementation extends TExtensibleElements { - - @XmlElement(name = "Tags") - protected TTags tags; - @XmlElement(name = "DerivedFrom") - protected TRelationshipTypeImplementation.DerivedFrom derivedFrom; - @XmlElement(name = "RequiredContainerFeatures") - protected TRequiredContainerFeatures requiredContainerFeatures; - @XmlElement(name = "ImplementationArtifacts") - protected TImplementationArtifacts implementationArtifacts; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String name; - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - @XmlAttribute(required = true) - protected QName relationshipType; - @XmlAttribute(name = "abstract") - protected TBoolean _abstract; - @XmlAttribute(name = "final") - protected TBoolean _final; - - /** - * Gets the value of the tags property. - * - * @return possible object is {@link TTags } - * - */ - public TTags getTags() { - return this.tags; - } - - /** - * Sets the value of the tags property. - * - * @param value allowed object is {@link TTags } - * - */ - public void setTags(final TTags value) { - this.tags = value; - } - - /** - * Gets the value of the derivedFrom property. - * - * @return possible object is {@link TRelationshipTypeImplementation.DerivedFrom } - * - */ - public TRelationshipTypeImplementation.DerivedFrom getDerivedFrom() { - return this.derivedFrom; - } - - /** - * Sets the value of the derivedFrom property. - * - * @param value allowed object is {@link TRelationshipTypeImplementation.DerivedFrom } - * - */ - public void setDerivedFrom(final TRelationshipTypeImplementation.DerivedFrom value) { - this.derivedFrom = value; - } - - /** - * Gets the value of the requiredContainerFeatures property. - * - * @return possible object is {@link TRequiredContainerFeatures } - * - */ - public TRequiredContainerFeatures getRequiredContainerFeatures() { - return this.requiredContainerFeatures; - } - - /** - * Sets the value of the requiredContainerFeatures property. - * - * @param value allowed object is {@link TRequiredContainerFeatures } - * - */ - public void setRequiredContainerFeatures(final TRequiredContainerFeatures value) { - this.requiredContainerFeatures = value; - } - - /** - * Gets the value of the implementationArtifacts property. - * - * @return possible object is {@link TImplementationArtifacts } - * - */ - public TImplementationArtifacts getImplementationArtifacts() { - return this.implementationArtifacts; - } - - /** - * Sets the value of the implementationArtifacts property. - * - * @param value allowed object is {@link TImplementationArtifacts } - * - */ - public void setImplementationArtifacts(final TImplementationArtifacts value) { - this.implementationArtifacts = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - /** - * Gets the value of the relationshipType property. - * - * @return possible object is {@link QName } - * - */ - public QName getRelationshipType() { - return this.relationshipType; - } - - /** - * Sets the value of the relationshipType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setRelationshipType(final QName value) { - this.relationshipType = value; - } - - /** - * Gets the value of the abstract property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getAbstract() { - if (this._abstract == null) { - return TBoolean.NO; - } else { - return this._abstract; - } - } - - /** - * Sets the value of the abstract property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setAbstract(final TBoolean value) { - this._abstract = value; - } - - /** - * Gets the value of the final property. - * - * @return possible object is {@link TBoolean } - * - */ - public TBoolean getFinal() { - if (this._final == null) { - return TBoolean.NO; - } else { - return this._final; - } - } - - /** - * Sets the value of the final property. - * - * @param value allowed object is {@link TBoolean } - * - */ - public void setFinal(final TBoolean value) { - this._final = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="relationshipTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class DerivedFrom { - - @XmlAttribute(required = true) - protected QName relationshipTypeImplementationRef; - - /** - * Gets the value of the relationshipTypeImplementationRef property. - * - * @return possible object is {@link QName } - * - */ - public QName getRelationshipTypeImplementationRef() { - return this.relationshipTypeImplementationRef; - } - - /** - * Sets the value of the relationshipTypeImplementationRef property. - * - * @param value allowed object is {@link QName } - * - */ - public void setRelationshipTypeImplementationRef(final QName value) { - this.relationshipTypeImplementationRef = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeature.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeature.java deleted file mode 100644 index 6186ee49e..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeature.java +++ /dev/null @@ -1,66 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tRequiredContainerFeature complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequiredContainerFeature">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="feature" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequiredContainerFeature") -public class TRequiredContainerFeature { - - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String feature; - - /** - * Gets the value of the feature property. - * - * @return possible object is {@link String } - * - */ - public String getFeature() { - return this.feature; - } - - /** - * Sets the value of the feature property. - * - * @param value allowed object is {@link String } - * - */ - public void setFeature(final String value) { - this.feature = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeatures.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeatures.java deleted file mode 100644 index 087f46deb..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeatures.java +++ /dev/null @@ -1,77 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tRequiredContainerFeatures complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequiredContainerFeatures">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="RequiredContainerFeature" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeature" maxOccurs="unbounded"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequiredContainerFeatures", propOrder = {"requiredContainerFeature"}) -public class TRequiredContainerFeatures { - - @XmlElement(name = "RequiredContainerFeature", required = true) - protected List requiredContainerFeature; - - /** - * Gets the value of the requiredContainerFeature property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the requiredContainerFeature property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getRequiredContainerFeature().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRequiredContainerFeature } - * - * - */ - public List getRequiredContainerFeature() { - if (this.requiredContainerFeature == null) { - this.requiredContainerFeature = new ArrayList<>(); - } - return this.requiredContainerFeature; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirement.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirement.java deleted file mode 100644 index f9e6f88a5..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirement.java +++ /dev/null @@ -1,65 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tRequirement complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequirement">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequirement") -public class TRequirement extends TEntityTemplate { - - @XmlAttribute(required = true) - protected String name; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementDefinition.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementDefinition.java deleted file mode 100644 index 20a52a02a..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementDefinition.java +++ /dev/null @@ -1,256 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tRequirementDefinition complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequirementDefinition">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Constraints" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="requirementType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="lowerBound" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    - *       <attribute name="upperBound" default="1">
    - *         <simpleType>
    - *           <union>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    - *                 <pattern value="([1-9]+[0-9]*)"/>
    - *               </restriction>
    - *             </simpleType>
    - *             <simpleType>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *                 <enumeration value="unbounded"/>
    - *               </restriction>
    - *             </simpleType>
    - *           </union>
    - *         </simpleType>
    - *       </attribute>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequirementDefinition", propOrder = {"constraints"}) -public class TRequirementDefinition extends TExtensibleElements { - - @XmlElement(name = "Constraints") - protected TRequirementDefinition.Constraints constraints; - @XmlAttribute(required = true) - protected String name; - @XmlAttribute(required = true) - protected QName requirementType; - @XmlAttribute - protected Integer lowerBound; - @XmlAttribute - protected String upperBound; - - /** - * Gets the value of the constraints property. - * - * @return possible object is {@link TRequirementDefinition.Constraints } - * - */ - public TRequirementDefinition.Constraints getConstraints() { - return this.constraints; - } - - /** - * Sets the value of the constraints property. - * - * @param value allowed object is {@link TRequirementDefinition.Constraints } - * - */ - public void setConstraints(final TRequirementDefinition.Constraints value) { - this.constraints = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the requirementType property. - * - * @return possible object is {@link QName } - * - */ - public QName getRequirementType() { - return this.requirementType; - } - - /** - * Sets the value of the requirementType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setRequirementType(final QName value) { - this.requirementType = value; - } - - /** - * Gets the value of the lowerBound property. - * - * @return possible object is {@link Integer } - * - */ - public int getLowerBound() { - if (this.lowerBound == null) { - return 1; - } else { - return this.lowerBound; - } - } - - /** - * Sets the value of the lowerBound property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setLowerBound(final Integer value) { - this.lowerBound = value; - } - - /** - * Gets the value of the upperBound property. - * - * @return possible object is {@link String } - * - */ - public String getUpperBound() { - if (this.upperBound == null) { - return "1"; - } else { - return this.upperBound; - } - } - - /** - * Sets the value of the upperBound property. - * - * @param value allowed object is {@link String } - * - */ - public void setUpperBound(final String value) { - this.upperBound = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"constraint"}) - public static class Constraints { - - @XmlElement(name = "Constraint", required = true) - protected List constraint; - - /** - * Gets the value of the constraint property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the constraint property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getConstraint().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TConstraint } - * - * - */ - public List getConstraint() { - if (this.constraint == null) { - this.constraint = new ArrayList<>(); - } - return this.constraint; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementRef.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementRef.java deleted file mode 100644 index 12d780ebb..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementRef.java +++ /dev/null @@ -1,91 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tRequirementRef complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequirementRef">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequirementRef") -public class TRequirementRef { - - @XmlAttribute - protected String name; - @XmlAttribute(required = true) - @XmlIDREF - @XmlSchemaType(name = "IDREF") - protected Object ref; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the ref property. - * - * @return possible object is {@link Object } - * - */ - public Object getRef() { - return this.ref; - } - - /** - * Sets the value of the ref property. - * - * @param value allowed object is {@link Object } - * - */ - public void setRef(final Object value) { - this.ref = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementType.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementType.java deleted file mode 100644 index 031d86477..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementType.java +++ /dev/null @@ -1,66 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tRequirementType complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tRequirementType">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    - *       <attribute name="requiredCapabilityType" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tRequirementType") -public class TRequirementType extends TEntityType { - - @XmlAttribute - protected QName requiredCapabilityType; - - /** - * Gets the value of the requiredCapabilityType property. - * - * @return possible object is {@link QName } - * - */ - public QName getRequiredCapabilityType() { - return this.requiredCapabilityType; - } - - /** - * Sets the value of the requiredCapabilityType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setRequiredCapabilityType(final QName value) { - this.requiredCapabilityType = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TServiceTemplate.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TServiceTemplate.java deleted file mode 100644 index 0e00322ab..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TServiceTemplate.java +++ /dev/null @@ -1,238 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlID; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - - -/** - *

    - * Java class for tServiceTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tServiceTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <sequence>
    - *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    - *         <element name="BoundaryDefinitions" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoundaryDefinitions" minOccurs="0"/>
    - *         <element name="TopologyTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyTemplate"/>
    - *         <element name="Plans" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPlans" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    - *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *       <attribute name="substitutableNodeType" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tServiceTemplate", propOrder = {"tags", "boundaryDefinitions", "topologyTemplate", "plans"}) -public class TServiceTemplate extends TExtensibleElements { - - @XmlElement(name = "Tags") - protected TTags tags; - @XmlElement(name = "BoundaryDefinitions") - protected TBoundaryDefinitions boundaryDefinitions; - @XmlElement(name = "TopologyTemplate", required = true) - protected TTopologyTemplate topologyTemplate; - @XmlElement(name = "Plans") - protected TPlans plans; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - @XmlAttribute - protected String name; - @XmlAttribute - @XmlSchemaType(name = "anyURI") - protected String targetNamespace; - @XmlAttribute - protected QName substitutableNodeType; - - /** - * Gets the value of the tags property. - * - * @return possible object is {@link TTags } - * - */ - public TTags getTags() { - return this.tags; - } - - /** - * Sets the value of the tags property. - * - * @param value allowed object is {@link TTags } - * - */ - public void setTags(final TTags value) { - this.tags = value; - } - - /** - * Gets the value of the boundaryDefinitions property. - * - * @return possible object is {@link TBoundaryDefinitions } - * - */ - public TBoundaryDefinitions getBoundaryDefinitions() { - return this.boundaryDefinitions; - } - - /** - * Sets the value of the boundaryDefinitions property. - * - * @param value allowed object is {@link TBoundaryDefinitions } - * - */ - public void setBoundaryDefinitions(final TBoundaryDefinitions value) { - this.boundaryDefinitions = value; - } - - /** - * Gets the value of the topologyTemplate property. - * - * @return possible object is {@link TTopologyTemplate } - * - */ - public TTopologyTemplate getTopologyTemplate() { - return this.topologyTemplate; - } - - /** - * Sets the value of the topologyTemplate property. - * - * @param value allowed object is {@link TTopologyTemplate } - * - */ - public void setTopologyTemplate(final TTopologyTemplate value) { - this.topologyTemplate = value; - } - - /** - * Gets the value of the plans property. - * - * @return possible object is {@link TPlans } - * - */ - public TPlans getPlans() { - return this.plans; - } - - /** - * Sets the value of the plans property. - * - * @param value allowed object is {@link TPlans } - * - */ - public void setPlans(final TPlans value) { - this.plans = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the targetNamespace property. - * - * @return possible object is {@link String } - * - */ - public String getTargetNamespace() { - return this.targetNamespace; - } - - /** - * Sets the value of the targetNamespace property. - * - * @param value allowed object is {@link String } - * - */ - public void setTargetNamespace(final String value) { - this.targetNamespace = value; - } - - /** - * Gets the value of the substitutableNodeType property. - * - * @return possible object is {@link QName } - * - */ - public QName getSubstitutableNodeType() { - return this.substitutableNodeType; - } - - /** - * Sets the value of the substitutableNodeType property. - * - * @param value allowed object is {@link QName } - * - */ - public void setSubstitutableNodeType(final QName value) { - this.substitutableNodeType = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTag.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTag.java deleted file mode 100644 index 7d0d1a212..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTag.java +++ /dev/null @@ -1,87 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tTag complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tTag">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tTag") -public class TTag { - - @XmlAttribute(required = true) - protected String name; - @XmlAttribute(required = true) - protected String value; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - - /** - * Gets the value of the value property. - * - * @return possible object is {@link String } - * - */ - public String getValue() { - return this.value; - } - - /** - * Sets the value of the value property. - * - * @param value allowed object is {@link String } - * - */ - public void setValue(final String value) { - this.value = value; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTags.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTags.java deleted file mode 100644 index 606fb71d4..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTags.java +++ /dev/null @@ -1,77 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tTags complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tTags">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="Tag" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTag" maxOccurs="unbounded"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tTags", propOrder = {"tag"}) -public class TTags { - - @XmlElement(name = "Tag", required = true) - protected List tag; - - /** - * Gets the value of the tag property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the tag property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getTag().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TTag } - * - * - */ - public List getTag() { - if (this.tag == null) { - this.tag = new ArrayList<>(); - } - return this.tag; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyElementInstanceStates.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyElementInstanceStates.java deleted file mode 100644 index b0bfd50c3..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyElementInstanceStates.java +++ /dev/null @@ -1,138 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tTopologyElementInstanceStates complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tTopologyElementInstanceStates">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="InstanceState" maxOccurs="unbounded">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="state" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tTopologyElementInstanceStates", propOrder = {"instanceState"}) -public class TTopologyElementInstanceStates { - - @XmlElement(name = "InstanceState", required = true) - protected List instanceState; - - /** - * Gets the value of the instanceState property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the instanceState property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getInstanceState().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TTopologyElementInstanceStates.InstanceState } - * - * - */ - public List getInstanceState() { - if (this.instanceState == null) { - this.instanceState = new ArrayList<>(); - } - return this.instanceState; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="state" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class InstanceState { - - @XmlAttribute(required = true) - @XmlSchemaType(name = "anyURI") - protected String state; - - /** - * Gets the value of the state property. - * - * @return possible object is {@link String } - * - */ - public String getState() { - return this.state; - } - - /** - * Sets the value of the state property. - * - * @param value allowed object is {@link String } - * - */ - public void setState(final String value) { - this.state = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyTemplate.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyTemplate.java deleted file mode 100644 index 562468cdb..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyTemplate.java +++ /dev/null @@ -1,82 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - - -package org.oasis_open.docs.tosca.ns._2011._12; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tTopologyTemplate complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tTopologyTemplate">
    - *   <complexContent>
    - *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    - *       <choice maxOccurs="unbounded">
    - *         <element name="NodeTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeTemplate"/>
    - *         <element name="RelationshipTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipTemplate"/>
    - *       </choice>
    - *       <anyAttribute processContents='lax' namespace='##other'/>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tTopologyTemplate", propOrder = {"nodeTemplateOrRelationshipTemplate"}) -public class TTopologyTemplate extends TExtensibleElements { - - @XmlElements({@XmlElement(name = "RelationshipTemplate", type = TRelationshipTemplate.class), - @XmlElement(name = "NodeTemplate", type = TNodeTemplate.class)}) - protected List nodeTemplateOrRelationshipTemplate; - - /** - * Gets the value of the nodeTemplateOrRelationshipTemplate property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the nodeTemplateOrRelationshipTemplate property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getNodeTemplateOrRelationshipTemplate().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TRelationshipTemplate } - * {@link TNodeTemplate } - * - * - */ - public List getNodeTemplateOrRelationshipTemplate() { - if (this.nodeTemplateOrRelationshipTemplate == null) { - this.nodeTemplateOrRelationshipTemplate = new ArrayList<>(); - } - return this.nodeTemplateOrRelationshipTemplate; - } - -} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/package-info.java b/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/package-info.java deleted file mode 100644 index 58cc59878..000000000 --- a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.04.02 at 04:58:44 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://docs.oasis-open.org/tosca/ns/2011/12", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.oasis_open.docs.tosca.ns._2011._12; diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/exporters/SimpleFileExporter.java b/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/exporters/SimpleFileExporter.java deleted file mode 100644 index 28e8150e8..000000000 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/exporters/SimpleFileExporter.java +++ /dev/null @@ -1,374 +0,0 @@ -package org.opentosca.planbuilder.export.exporters; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URI; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.WSDLException; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLReader; -import javax.wsdl.xml.WSDLWriter; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.namespace.QName; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.apache.commons.io.FileUtils; -import org.apache.ode.schemas.dd._2007._03.TInvoke; -import org.apache.ode.schemas.dd._2007._03.TProvide; -import org.apache.ode.schemas.dd._2007._03.TService; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.planbuilder.export.Exporter; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.Deploy; -import org.opentosca.planbuilder.model.plan.bpel.GenericWsdlWrapper; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.ibm.wsdl.ServiceImpl; - -/** - *

    - * This class is used to export buildPlans on filesystems - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class SimpleFileExporter { - - private final static Logger LOG = LoggerFactory.getLogger(SimpleFileExporter.class); - - // wrapper class for the rewriting of service names in WSDL's - public class Service2ServiceEntry { - - public QName service0; - public QName service1; - - public Service2ServiceEntry(final QName service0, final QName service1) { - this.service0 = service0; - this.service1 = service1; - } - } - - /** - * Exports the given BuildPlan to the given URI location - * - * @param destination the URI to export to - * @param buildPlan the BuildPlan to export - * @return true iff exporting the BuildPlan was successful - * @throws IOException is thrown when reading/writing the file fails - * @throws JAXBException is thrown when writing with JAXB fails - */ - public boolean export(final URI destination, final BPELPlan buildPlan) throws IOException, JAXBException { - if (!new File(destination).getName().contains("zip")) { - return false; - } - // fetch imported files - final Set importedFiles = buildPlan.getImportedFiles(); - - SimpleFileExporter.LOG.debug("BuildPlan has following files attached"); - for (final File file : importedFiles) { - SimpleFileExporter.LOG.debug(file.getAbsolutePath()); - } - - // fetch import elements - final List importElements = buildPlan.getBpelImportElements(); - - SimpleFileExporter.LOG.debug("BuildPlan has following import elements"); - for (final Element element : importElements) { - SimpleFileExporter.LOG.debug("LocalName: " + element.getLocalName()); - SimpleFileExporter.LOG.debug("location:" + element.getAttribute("location")); - } - - // fetch wsdl - final GenericWsdlWrapper wsdl = buildPlan.getWsdl(); - - // generate temp folder - final File tempDir = this.getFileAccessService().getTemp(); - SimpleFileExporter.LOG.debug("Trying to write files in system temp folder: " + tempDir.getAbsolutePath()); - final File tempFolder = new File(tempDir, Long.toString(System.currentTimeMillis())); - tempFolder.mkdir(); - SimpleFileExporter.LOG.debug("Trying to write files to temp folder: " + tempFolder.getAbsolutePath()); - - final List exportedFiles = new ArrayList<>(); - - // match importedFiles with importElements, to change temporary paths - // inside import elements to relative paths inside the generated zip - for (final File importedFile : importedFiles) { - for (final Element importElement : importElements) { - final String filePath = importedFile.getAbsolutePath(); - final String locationPath = importElement.getAttribute("location"); - SimpleFileExporter.LOG.debug("checking filepath:"); - SimpleFileExporter.LOG.debug(filePath); - SimpleFileExporter.LOG.debug("with: "); - SimpleFileExporter.LOG.debug(locationPath); - if (importedFile.getAbsolutePath().trim().equals(importElement.getAttribute("location").trim())) { - // found the import element for the corresponding file - // get file name - final String fileName = importedFile.getName(); - SimpleFileExporter.LOG.debug("Trying to reset path to: " + fileName); - // change location attribute in import element - importElement.setAttribute("location", fileName); - // copy file to tempdir - final File fileLocationInDir = new File(tempFolder, fileName); - FileUtils.copyFile(importedFile, fileLocationInDir); - - LOG.debug("Adding " + fileLocationInDir + " to files to export"); - exportedFiles.add(fileLocationInDir); - } - } - } - - LOG.debug("Imported files:" + importedFiles); - LOG.debug("Exported files:" + exportedFiles); - - // write deploy.xml - SimpleFileExporter.LOG.debug("Starting marshalling"); - final Deploy deployment = buildPlan.getDeploymentDeskriptor(); - - // rewrite service names in deploy.xml and potential wsdl files - try { - this.rewriteServiceNames(deployment, exportedFiles, buildPlan.getCsarName()); - } - catch (final WSDLException e) { - LOG.warn("Rewriting of Service names failed", e); - } - catch (final FileNotFoundException e) { - LOG.warn("Something went wrong with locating wsdl files that needed to be changed", e); - } - - final File deployXmlFile = new File(tempFolder, "deploy.xml"); - deployXmlFile.createNewFile(); - final JAXBContext jaxbContext = JAXBContext.newInstance(Deploy.class); - final Marshaller m = jaxbContext.createMarshaller(); - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - // output to console uncomment this: m.marshal(deployment, System.out); - m.marshal(deployment, deployXmlFile); - - // save wsdl in tempfolder - final File wsdlFile = new File(tempFolder, wsdl.getFileName()); - FileUtils.writeStringToFile(wsdlFile, wsdl.getFinalizedWsdlAsString()); - - // save bpel file in tempfolder - final File bpelFile = new File(tempFolder, wsdl.getFileName().replace(".wsdl", ".bpel")); - try { - this.writeBPELDocToFile(bpelFile, buildPlan.getBpelDocument()); - } - catch (final TransformerException e) { - SimpleFileExporter.LOG.error("Error while writing BPEL Document to a file", e); - return false; - } - - // package temp dir and move to destination URI - final ServiceReference servRef = FrameworkUtil.getBundle(this.getClass()).getBundleContext() - .getServiceReference(IFileAccessService.class.getName()); - final IFileAccessService service = - (IFileAccessService) FrameworkUtil.getBundle(this.getClass()).getBundleContext().getService(servRef); - service.zip(tempFolder, new File(destination)); - return true; - } - - private class Mapping { - private final QName key; - private final QName val; - - - protected Mapping(final QName key, final QName val) { - this.key = key; - this.val = val; - } - - @Override - public boolean equals(final Object obj) { - - if (obj instanceof Mapping) { - final Mapping map = (Mapping) obj; - return map.key.equals(this.key) && map.val.equals(this.val); - } - - return super.equals(obj); - } - - @Override - public String toString() { - return this.key.toString() + this.val.toString(); - } - } - - private void rewriteServiceNames(final Deploy deploy, final List referencedFiles, - final String csarName) throws WSDLException, FileNotFoundException { - final WSDLFactory factory = WSDLFactory.newInstance(); - final WSDLReader reader = factory.newWSDLReader(); - final WSDLWriter writer = factory.newWSDLWriter(); - - // first fetch all provide and invoke element which aren't using the - // 'client' partnerLink - // single process only - final List invokes = deploy.getProcess().get(0).getInvoke(); - final List provides = deploy.getProcess().get(0).getProvide(); - - // the services and their new name the dd uses, excluding the client - // services, will be added here - final Set invokedServicesToRewrite = new HashSet<>(); - final Set providedServicesToRewrite = new HashSet<>(); - - LOG.debug("Starting to determine services to rewrite"); - LOG.debug("Starting to determine invoked services"); - for (final TInvoke invoke : invokes) { - if (invoke.getPartnerLink().equals("client")) { - continue; - } - - final TService service = invoke.getService(); - final QName serviceName = service.getName(); - - final QName renamedServiceName = new QName(serviceName.getNamespaceURI(), - csarName + serviceName.getLocalPart() + System.currentTimeMillis()); - - LOG.debug("Adding " + serviceName + " to be rewrited to " + renamedServiceName); - invokedServicesToRewrite.add(new Mapping(serviceName, renamedServiceName)); - - service.setName(renamedServiceName); - - invoke.setService(service); - } - - LOG.debug("Starting to determine provided services"); - for (final TProvide provide : provides) { - if (provide.getPartnerLink().equals("client")) { - continue; - } - - final TService service = provide.getService(); - final QName serviceName = service.getName(); - - final QName renamedServiceName = new QName(serviceName.getNamespaceURI(), - csarName + serviceName.getLocalPart() + System.currentTimeMillis()); - - LOG.debug("Adding " + serviceName + " to be rewrited to " + renamedServiceName); - providedServicesToRewrite.add(new Mapping(serviceName, renamedServiceName)); - - service.setName(renamedServiceName); - - provide.setService(service); - } - - this.rewriteServices(invokedServicesToRewrite, writer, reader, referencedFiles); - this.rewriteServices(providedServicesToRewrite, writer, reader, referencedFiles); - - } - - private void rewriteServices(final Set servicesToRewrite, final WSDLWriter writer, final WSDLReader reader, - final List referencedFiles) throws WSDLException, FileNotFoundException { - - LOG.debug("Rewriting service names:"); - LOG.debug("Files referenced:" + referencedFiles); - LOG.debug("Services to rewrite:" + servicesToRewrite); - - for (final Mapping service : servicesToRewrite) { - final QName serviceName = service.key; - for (final File file : referencedFiles) { - if (!file.getAbsolutePath().endsWith(".wsdl")) { - continue; - } - - final Definition def = reader.readWSDL(file.getAbsolutePath()); - - final List servicesToRemove = new ArrayList<>(); - - boolean foundMatch = false; - // fetch defined services - for (final Object obj : def.getAllServices().values()) { - final Service serviceA = (Service) obj; - - if (serviceName.equals(serviceA.getQName())) { - // found wsdl with service we have to rewrite - servicesToRemove.add(serviceA.getQName()); - - final Service newService = new ServiceImpl(); - - for (final Object o : serviceA.getPorts().values()) { - final Port port = (Port) o; - newService.addPort(port); - } - - newService.setQName(service.val); - - def.addService(newService); - foundMatch = true; - } - } - - if (foundMatch) { - for (final QName serviceToRemove : servicesToRemove) { - def.removeService(serviceToRemove); - - } - - writer.writeWSDL(def, new FileOutputStream(file)); - break; - } - } - } - } - - /** - * Returns the FileAccessService of the OpenTOSCA Core - * - * @return the IFileAccessService of the OpenTOSCA Core - */ - private IFileAccessService getFileAccessService() { - final BundleContext ctx = FrameworkUtil.getBundle(Exporter.class).getBundleContext(); - final ServiceReference serviceReference = ctx.getServiceReference(IFileAccessService.class.getName()); - final IFileAccessService service = (IFileAccessService) ctx.getService(serviceReference); - return service; - } - - /** - * Writes the given DOM Document to the location denoted by the given File - * - * @param destination a File denoting the location to export to - * @param doc the Document to export - * @throws TransformerException is thrown when initializing a TransformerFactory or writing the - * Document fails - * @throws FileNotFoundException is thrown when the File denoted by the File Object doesn't exist - */ - private void writeBPELDocToFile(final File destination, final Document doc) throws TransformerException, - FileNotFoundException { - final TransformerFactory tFactory = TransformerFactory.newInstance(); - final Transformer transformer = tFactory.newTransformer(); - - transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); - transformer.setOutputProperty(OutputKeys.METHOD, "xml"); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); - transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); - transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); - - final DOMSource source = new DOMSource(doc); - final StreamResult result = new StreamResult(new FileOutputStream(destination)); - transformer.transform(source, result); - } -} diff --git a/org.opentosca.planbuilder.model/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.model/META-INF/MANIFEST.MF deleted file mode 100644 index 110501409..000000000 --- a/org.opentosca.planbuilder.model/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Context -Bundle-SymbolicName: org.opentosca.planbuilder.model -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.apache.ode.activityrecovery, - org.apache.ode.schemas.dd._2007._03, - org.opentosca.planbuilder.model.plan, - org.opentosca.planbuilder.model.plan.bpel, - org.opentosca.planbuilder.model.tosca, - org.opentosca.planbuilder.model.utils -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.model.plan.bpel, - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.7.10" -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="2.0.0" diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/activityrecovery/FailureHandling.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/activityrecovery/FailureHandling.java deleted file mode 100644 index 556d795f0..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/activityrecovery/FailureHandling.java +++ /dev/null @@ -1,121 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.activityrecovery; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    Java class for anonymous complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType>
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <all>
    - *         <element name="retryFor" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    - *         <element name="retryDelay" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    - *         <element name="faultOnFailure" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *       </all>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - -}) -@XmlRootElement(name = "failureHandling") -public class FailureHandling { - - protected Integer retryFor; - protected Integer retryDelay; - protected Boolean faultOnFailure; - - /** - * Gets the value of the retryFor property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getRetryFor() { - return retryFor; - } - - /** - * Sets the value of the retryFor property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setRetryFor(Integer value) { - this.retryFor = value; - } - - /** - * Gets the value of the retryDelay property. - * - * @return - * possible object is - * {@link Integer } - * - */ - public Integer getRetryDelay() { - return retryDelay; - } - - /** - * Sets the value of the retryDelay property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setRetryDelay(Integer value) { - this.retryDelay = value; - } - - /** - * Gets the value of the faultOnFailure property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isFaultOnFailure() { - return faultOnFailure; - } - - /** - * Sets the value of the faultOnFailure property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setFaultOnFailure(Boolean value) { - this.faultOnFailure = value; - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/activityrecovery/ObjectFactory.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/activityrecovery/ObjectFactory.java deleted file mode 100644 index bc99e4249..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/activityrecovery/ObjectFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.activityrecovery; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.apache.ode.activityrecovery package. - *

    An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.ode.activityrecovery - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link FailureHandling } - * - */ - public FailureHandling createFailureHandling() { - return new FailureHandling(); - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java deleted file mode 100644 index 890737b8c..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java +++ /dev/null @@ -1,172 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.apache.ode.schemas.dd._2007._03 package. - *

    An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _Deploy_QNAME = new QName("http://www.apache.org/ode/schemas/dd/2007/03", "deploy"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.ode.schemas.dd._2007._03 - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link TCleanup } - * - */ - public TCleanup createTCleanup() { - return new TCleanup(); - } - - /** - * Create an instance of {@link TEnableSharing } - * - */ - public TEnableSharing createTEnableSharing() { - return new TEnableSharing(); - } - - /** - * Create an instance of {@link TDeployment } - * - */ - public TDeployment createTDeployment() { - return new TDeployment(); - } - - /** - * Create an instance of {@link TProvide } - * - */ - public TProvide createTProvide() { - return new TProvide(); - } - - /** - * Create an instance of {@link TProcessEvents } - * - */ - public TProcessEvents createTProcessEvents() { - return new TProcessEvents(); - } - - /** - * Create an instance of {@link TService } - * - */ - public TService createTService() { - return new TService(); - } - - /** - * Create an instance of {@link TSchedule } - * - */ - public TSchedule createTSchedule() { - return new TSchedule(); - } - - /** - * Create an instance of {@link TDeployment.Process.MexInterceptors } - * - */ - public TDeployment.Process.MexInterceptors createTDeploymentProcessMexInterceptors() { - return new TDeployment.Process.MexInterceptors(); - } - - /** - * Create an instance of {@link TInvoke.Binding } - * - */ - public TInvoke.Binding createTInvokeBinding() { - return new TInvoke.Binding(); - } - - /** - * Create an instance of {@link TDeployment.Process } - * - */ - public TDeployment.Process createTDeploymentProcess() { - return new TDeployment.Process(); - } - - /** - * Create an instance of {@link TEnableEventList } - * - */ - public TEnableEventList createTEnableEventList() { - return new TEnableEventList(); - } - - /** - * Create an instance of {@link TMexInterceptor } - * - */ - public TMexInterceptor createTMexInterceptor() { - return new TMexInterceptor(); - } - - /** - * Create an instance of {@link TDeployment.Process.Property } - * - */ - public TDeployment.Process.Property createTDeploymentProcessProperty() { - return new TDeployment.Process.Property(); - } - - /** - * Create an instance of {@link TScopeEvents } - * - */ - public TScopeEvents createTScopeEvents() { - return new TScopeEvents(); - } - - /** - * Create an instance of {@link TInvoke } - * - */ - public TInvoke createTInvoke() { - return new TInvoke(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link TDeployment }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", name = "deploy") - public JAXBElement createDeploy(TDeployment value) { - return new JAXBElement(_Deploy_QNAME, TDeployment.class, null, value); - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java deleted file mode 100644 index f37214049..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java +++ /dev/null @@ -1,155 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    Java class for tCleanup complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCleanup">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="category" maxOccurs="unbounded" minOccurs="0">
    - *           <simpleType>
    - *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *               <enumeration value="instance"/>
    - *               <enumeration value="variables"/>
    - *               <enumeration value="messages"/>
    - *               <enumeration value="correlations"/>
    - *               <enumeration value="events"/>
    - *               <enumeration value="all"/>
    - *             </restriction>
    - *           </simpleType>
    - *         </element>
    - *         <element name="filter" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="on">
    - *         <simpleType>
    - *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *             <enumeration value="success"/>
    - *             <enumeration value="failure"/>
    - *             <enumeration value="always"/>
    - *           </restriction>
    - *         </simpleType>
    - *       </attribute>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCleanup", propOrder = { - "category", - "filter" -}) -public class TCleanup { - - @XmlElement(defaultValue = "all") - protected List category; - protected List filter; - @XmlAttribute - protected String on; - - /** - * Gets the value of the category property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the category property. - * - *

    - * For example, to add a new item, do as follows: - *

    -     *    getCategory().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - public List getCategory() { - if (category == null) { - category = new ArrayList(); - } - return this.category; - } - - /** - * Gets the value of the filter property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the filter property. - * - *

    - * For example, to add a new item, do as follows: - *

    -     *    getFilter().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - public List getFilter() { - if (filter == null) { - filter = new ArrayList(); - } - return this.filter; - } - - /** - * Gets the value of the on property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getOn() { - return on; - } - - /** - * Sets the value of the on property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOn(String value) { - this.on = value; - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java deleted file mode 100644 index ce54f5024..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java +++ /dev/null @@ -1,727 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - *

    Java class for tDeployment complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDeployment">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="process" maxOccurs="unbounded" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="property" maxOccurs="unbounded" minOccurs="0">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *                           </sequence>
    - *                           <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                   <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    - *                   <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    - *                   <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    - *                   <element name="mex-interceptors" minOccurs="0">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    - *                           </sequence>
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                   <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    - *                   <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    - *                   <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    - *                 </sequence>
    - *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *                 <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *                 <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDeployment", propOrder = { - "process" -}) -public class TDeployment { - - protected List process; - - /** - * Gets the value of the process property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the process property. - * - *

    - * For example, to add a new item, do as follows: - *

    -     *    getProcess().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TDeployment.Process } - * - * - */ - public List getProcess() { - if (process == null) { - process = new ArrayList(); - } - return this.process; - } - - - /** - *

    Java class for anonymous complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="property" maxOccurs="unbounded" minOccurs="0">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    -     *                 </sequence>
    -     *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *         <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    -     *         <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    -     *         <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    -     *         <element name="mex-interceptors" minOccurs="0">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    -     *                 </sequence>
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    -     *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    -     *         <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    -     *       </sequence>
    -     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *       <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *       <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "active", - "retired", - "inMemory", - "property", - "processEvents", - "provide", - "invoke", - "mexInterceptors", - "type", - "cleanup", - "schedule" - }) - public static class Process { - - @XmlElement(defaultValue = "true") - protected Boolean active; - @XmlElement(defaultValue = "false") - protected Boolean retired; - @XmlElement(name = "in-memory", defaultValue = "false") - protected Boolean inMemory; - protected List property; - @XmlElement(name = "process-events") - protected TProcessEvents processEvents; - protected List provide; - protected List invoke; - @XmlElement(name = "mex-interceptors") - protected TDeployment.Process.MexInterceptors mexInterceptors; - protected QName type; - protected List cleanup; - protected List schedule; - @XmlAttribute(required = true) - protected QName name; - @XmlAttribute - protected String fileName; - @XmlAttribute(name = "bpel11wsdlFileName") - protected String bpel11WsdlFileName; - - /** - * Gets the value of the active property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isActive() { - return active; - } - - /** - * Sets the value of the active property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setActive(Boolean value) { - this.active = value; - } - - /** - * Gets the value of the retired property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isRetired() { - return retired; - } - - /** - * Sets the value of the retired property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setRetired(Boolean value) { - this.retired = value; - } - - /** - * Gets the value of the inMemory property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public Boolean isInMemory() { - return inMemory; - } - - /** - * Sets the value of the inMemory property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setInMemory(Boolean value) { - this.inMemory = value; - } - - /** - * Gets the value of the property property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the property property. - * - *

    - * For example, to add a new item, do as follows: - *

    -         *    getProperty().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TDeployment.Process.Property } - * - * - */ - public List getProperty() { - if (property == null) { - property = new ArrayList(); - } - return this.property; - } - - /** - * Gets the value of the processEvents property. - * - * @return - * possible object is - * {@link TProcessEvents } - * - */ - public TProcessEvents getProcessEvents() { - return processEvents; - } - - /** - * Sets the value of the processEvents property. - * - * @param value - * allowed object is - * {@link TProcessEvents } - * - */ - public void setProcessEvents(TProcessEvents value) { - this.processEvents = value; - } - - /** - * Gets the value of the provide property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the provide property. - * - *

    - * For example, to add a new item, do as follows: - *

    -         *    getProvide().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TProvide } - * - * - */ - public List getProvide() { - if (provide == null) { - provide = new ArrayList(); - } - return this.provide; - } - - /** - * Gets the value of the invoke property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the invoke property. - * - *

    - * For example, to add a new item, do as follows: - *

    -         *    getInvoke().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TInvoke } - * - * - */ - public List getInvoke() { - if (invoke == null) { - invoke = new ArrayList(); - } - return this.invoke; - } - - /** - * Gets the value of the mexInterceptors property. - * - * @return - * possible object is - * {@link TDeployment.Process.MexInterceptors } - * - */ - public TDeployment.Process.MexInterceptors getMexInterceptors() { - return mexInterceptors; - } - - /** - * Sets the value of the mexInterceptors property. - * - * @param value - * allowed object is - * {@link TDeployment.Process.MexInterceptors } - * - */ - public void setMexInterceptors(TDeployment.Process.MexInterceptors value) { - this.mexInterceptors = value; - } - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link QName } - * - */ - public QName getType() { - return type; - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link QName } - * - */ - public void setType(QName value) { - this.type = value; - } - - /** - * Gets the value of the cleanup property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the cleanup property. - * - *

    - * For example, to add a new item, do as follows: - *

    -         *    getCleanup().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TCleanup } - * - * - */ - public List getCleanup() { - if (cleanup == null) { - cleanup = new ArrayList(); - } - return this.cleanup; - } - - /** - * Gets the value of the schedule property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the schedule property. - * - *

    - * For example, to add a new item, do as follows: - *

    -         *    getSchedule().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TSchedule } - * - * - */ - public List getSchedule() { - if (schedule == null) { - schedule = new ArrayList(); - } - return this.schedule; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link QName } - * - */ - public QName getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link QName } - * - */ - public void setName(QName value) { - this.name = value; - } - - /** - * Gets the value of the fileName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getFileName() { - return fileName; - } - - /** - * Sets the value of the fileName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFileName(String value) { - this.fileName = value; - } - - /** - * Gets the value of the bpel11WsdlFileName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getBpel11WsdlFileName() { - return bpel11WsdlFileName; - } - - /** - * Sets the value of the bpel11WsdlFileName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBpel11WsdlFileName(String value) { - this.bpel11WsdlFileName = value; - } - - - /** - *

    Java class for anonymous complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    -         *       </sequence>
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "mexInterceptor" - }) - public static class MexInterceptors { - - @XmlElement(name = "mex-interceptor") - protected List mexInterceptor; - - /** - * Gets the value of the mexInterceptor property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the mexInterceptor property. - * - *

    - * For example, to add a new item, do as follows: - *

    -             *    getMexInterceptor().add(newItem);
    -             * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TMexInterceptor } - * - * - */ - public List getMexInterceptor() { - if (mexInterceptor == null) { - mexInterceptor = new ArrayList(); - } - return this.mexInterceptor; - } - - } - - - /** - *

    Java class for anonymous complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    -         *       </sequence>
    -         *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "any" - }) - public static class Property { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(required = true) - protected QName name; - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - *

    -             *    getAny().add(newItem);
    -             * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link QName } - * - */ - public QName getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link QName } - * - */ - public void setName(QName value) { - this.name = value; - } - - } - - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java deleted file mode 100644 index 2b7f44618..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java +++ /dev/null @@ -1,81 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    Java class for tEnableEventList complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEnableEventList">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="enable-event" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEnableEventList", propOrder = { - "enableEvent" -}) -@XmlSeeAlso({ - TProcessEvents.class, - TScopeEvents.class -}) -public class TEnableEventList { - - @XmlElement(name = "enable-event") - protected List enableEvent; - - /** - * Gets the value of the enableEvent property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the enableEvent property. - * - *

    - * For example, to add a new item, do as follows: - *

    -     *    getEnableEvent().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - public List getEnableEvent() { - if (enableEvent == null) { - enableEvent = new ArrayList(); - } - return this.enableEvent; - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java deleted file mode 100644 index 88b32f9c6..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java +++ /dev/null @@ -1,37 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    Java class for tEnableSharing complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEnableSharing">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEnableSharing") -public class TEnableSharing { - - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java deleted file mode 100644 index d0dbd49e9..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java +++ /dev/null @@ -1,244 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; -import org.apache.ode.activityrecovery.FailureHandling; - - -/** - *

    Java class for tInvoke complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tInvoke">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    - *         <element name="binding" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element ref="{http://ode.apache.org/activityRecovery}failureHandling" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="usePeer2Peer" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tInvoke", propOrder = { - "service", - "binding", - "failureHandling" -}) -public class TInvoke { - - @XmlElement(required = true) - protected TService service; - protected TInvoke.Binding binding; - @XmlElement(namespace = "http://ode.apache.org/activityRecovery") - protected FailureHandling failureHandling; - @XmlAttribute(required = true) - protected String partnerLink; - @XmlAttribute - protected Boolean usePeer2Peer; - - /** - * Gets the value of the service property. - * - * @return - * possible object is - * {@link TService } - * - */ - public TService getService() { - return service; - } - - /** - * Sets the value of the service property. - * - * @param value - * allowed object is - * {@link TService } - * - */ - public void setService(TService value) { - this.service = value; - } - - /** - * Gets the value of the binding property. - * - * @return - * possible object is - * {@link TInvoke.Binding } - * - */ - public TInvoke.Binding getBinding() { - return binding; - } - - /** - * Sets the value of the binding property. - * - * @param value - * allowed object is - * {@link TInvoke.Binding } - * - */ - public void setBinding(TInvoke.Binding value) { - this.binding = value; - } - - /** - * Gets the value of the failureHandling property. - * - * @return - * possible object is - * {@link FailureHandling } - * - */ - public FailureHandling getFailureHandling() { - return failureHandling; - } - - /** - * Sets the value of the failureHandling property. - * - * @param value - * allowed object is - * {@link FailureHandling } - * - */ - public void setFailureHandling(FailureHandling value) { - this.failureHandling = value; - } - - /** - * Gets the value of the partnerLink property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPartnerLink() { - return partnerLink; - } - - /** - * Sets the value of the partnerLink property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPartnerLink(String value) { - this.partnerLink = value; - } - - /** - * Gets the value of the usePeer2Peer property. - * - * @return - * possible object is - * {@link Boolean } - * - */ - public boolean isUsePeer2Peer() { - if (usePeer2Peer == null) { - return true; - } else { - return usePeer2Peer; - } - } - - /** - * Sets the value of the usePeer2Peer property. - * - * @param value - * allowed object is - * {@link Boolean } - * - */ - public void setUsePeer2Peer(Boolean value) { - this.usePeer2Peer = value; - } - - - /** - *

    Java class for anonymous complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Binding { - - @XmlAttribute(required = true) - protected QName name; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link QName } - * - */ - public QName getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link QName } - * - */ - public void setName(QName value) { - this.name = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java deleted file mode 100644 index 18b0f96ab..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java +++ /dev/null @@ -1,73 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * - * Message exchange interceptor configuration. - * - * - *

    Java class for tMexInterceptor complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tMexInterceptor">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="class-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tMexInterceptor", propOrder = { - "className" -}) -public class TMexInterceptor { - - @XmlElement(name = "class-name", required = true) - protected String className; - - /** - * Gets the value of the className property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getClassName() { - return className; - } - - /** - * Sets the value of the className property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setClassName(String value) { - this.className = value; - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java deleted file mode 100644 index 766c20129..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java +++ /dev/null @@ -1,113 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    Java class for tProcessEvents complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tProcessEvents">
    - *   <complexContent>
    - *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    - *       <sequence>
    - *         <element name="scope-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tScopeEvents" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="generate">
    - *         <simpleType>
    - *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *             <enumeration value="all"/>
    - *             <enumeration value="none"/>
    - *           </restriction>
    - *         </simpleType>
    - *       </attribute>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tProcessEvents", propOrder = { - "scopeEvents" -}) -public class TProcessEvents - extends TEnableEventList -{ - - @XmlElement(name = "scope-events") - protected List scopeEvents; - @XmlAttribute - protected String generate; - - /** - * Gets the value of the scopeEvents property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the scopeEvents property. - * - *

    - * For example, to add a new item, do as follows: - *

    -     *    getScopeEvents().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TScopeEvents } - * - * - */ - public List getScopeEvents() { - if (scopeEvents == null) { - scopeEvents = new ArrayList(); - } - return this.scopeEvents; - } - - /** - * Gets the value of the generate property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getGenerate() { - return generate; - } - - /** - * Sets the value of the generate property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setGenerate(String value) { - this.generate = value; - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProvide.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProvide.java deleted file mode 100644 index f2a4848bc..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProvide.java +++ /dev/null @@ -1,124 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    Java class for tProvide complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tProvide">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    - *         <element name="enableSharing" type="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableSharing" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tProvide", propOrder = { - "service", - "enableSharing" -}) -public class TProvide { - - @XmlElement(required = true) - protected TService service; - protected TEnableSharing enableSharing; - @XmlAttribute(required = true) - protected String partnerLink; - - /** - * Gets the value of the service property. - * - * @return - * possible object is - * {@link TService } - * - */ - public TService getService() { - return service; - } - - /** - * Sets the value of the service property. - * - * @param value - * allowed object is - * {@link TService } - * - */ - public void setService(TService value) { - this.service = value; - } - - /** - * Gets the value of the enableSharing property. - * - * @return - * possible object is - * {@link TEnableSharing } - * - */ - public TEnableSharing getEnableSharing() { - return enableSharing; - } - - /** - * Sets the value of the enableSharing property. - * - * @param value - * allowed object is - * {@link TEnableSharing } - * - */ - public void setEnableSharing(TEnableSharing value) { - this.enableSharing = value; - } - - /** - * Gets the value of the partnerLink property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPartnerLink() { - return partnerLink; - } - - /** - * Sets the value of the partnerLink property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPartnerLink(String value) { - this.partnerLink = value; - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java deleted file mode 100644 index f0c7c87cb..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java +++ /dev/null @@ -1,102 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    Java class for tSchedule complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tSchedule">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="when" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tSchedule", propOrder = { - "cleanup" -}) -public class TSchedule { - - protected List cleanup; - @XmlAttribute(required = true) - protected String when; - - /** - * Gets the value of the cleanup property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the cleanup property. - * - *

    - * For example, to add a new item, do as follows: - *

    -     *    getCleanup().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link TCleanup } - * - * - */ - public List getCleanup() { - if (cleanup == null) { - cleanup = new ArrayList(); - } - return this.cleanup; - } - - /** - * Gets the value of the when property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getWhen() { - return when; - } - - /** - * Sets the value of the when property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setWhen(String value) { - this.when = value; - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java deleted file mode 100644 index 04ce11740..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java +++ /dev/null @@ -1,67 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    Java class for tScopeEvents complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tScopeEvents">
    - *   <complexContent>
    - *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tScopeEvents") -public class TScopeEvents - extends TEnableEventList -{ - - @XmlAttribute(required = true) - protected String name; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TService.java b/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TService.java deleted file mode 100644 index ec274363d..000000000 --- a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TService.java +++ /dev/null @@ -1,139 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; -import org.w3c.dom.Element; - - -/** - *

    Java class for tService complex type. - * - *

    The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tService">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="port" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tService", propOrder = { - "any" -}) -public class TService { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(required = true) - protected QName name; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String port; - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - *

    -     *    getAny().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link Element } - * - * - */ - public List getAny() { - if (any == null) { - any = new ArrayList(); - } - return this.any; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link QName } - * - */ - public QName getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link QName } - * - */ - public void setName(QName value) { - this.name = value; - } - - /** - * Gets the value of the port property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPort() { - return port; - } - - /** - * Sets the value of the port property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPort(String value) { - this.port = value; - } - -} diff --git a/org.opentosca.planbuilder.model/build.properties b/org.opentosca.planbuilder.model/build.properties deleted file mode 100644 index c7283b596..000000000 --- a/org.opentosca.planbuilder.model/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - ., \ No newline at end of file diff --git a/org.opentosca.planbuilder.model/pom.xml b/org.opentosca.planbuilder.model/pom.xml deleted file mode 100644 index 15727a968..000000000 --- a/org.opentosca.planbuilder.model/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.model - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/FailureHandling.java b/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/FailureHandling.java deleted file mode 100644 index 74d2a860c..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/FailureHandling.java +++ /dev/null @@ -1,112 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.activityrecovery; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType>
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <all>
    - *         <element name="retryFor" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    - *         <element name="retryDelay" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    - *         <element name="faultOnFailure" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *       </all>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - -}) -@XmlRootElement(name = "failureHandling") -public class FailureHandling { - - protected Integer retryFor; - protected Integer retryDelay; - protected Boolean faultOnFailure; - - /** - * Gets the value of the retryFor property. - * - * @return possible object is {@link Integer } - * - */ - public Integer getRetryFor() { - return this.retryFor; - } - - /** - * Sets the value of the retryFor property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setRetryFor(final Integer value) { - this.retryFor = value; - } - - /** - * Gets the value of the retryDelay property. - * - * @return possible object is {@link Integer } - * - */ - public Integer getRetryDelay() { - return this.retryDelay; - } - - /** - * Sets the value of the retryDelay property. - * - * @param value allowed object is {@link Integer } - * - */ - public void setRetryDelay(final Integer value) { - this.retryDelay = value; - } - - /** - * Gets the value of the faultOnFailure property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isFaultOnFailure() { - return this.faultOnFailure; - } - - /** - * Sets the value of the faultOnFailure property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setFaultOnFailure(final Boolean value) { - this.faultOnFailure = value; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/ObjectFactory.java b/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/ObjectFactory.java deleted file mode 100644 index c52594fa9..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/ObjectFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.activityrecovery; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.apache.ode.activityrecovery package. - *

    - * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.apache.ode.activityrecovery - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link FailureHandling } - * - */ - public FailureHandling createFailureHandling() { - return new FailureHandling(); - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/package-info.java b/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/package-info.java deleted file mode 100644 index c3d8c1544..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/activityrecovery/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://ode.apache.org/activityRecovery", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.apache.ode.activityrecovery; diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java deleted file mode 100644 index 23d4d49d5..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java +++ /dev/null @@ -1,169 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.apache.ode.schemas.dd._2007._03 package. - *

    - * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _Deploy_QNAME = new QName("http://www.apache.org/ode/schemas/dd/2007/03", "deploy"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.apache.ode.schemas.dd._2007._03 - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link TCleanup } - * - */ - public TCleanup createTCleanup() { - return new TCleanup(); - } - - /** - * Create an instance of {@link TEnableSharing } - * - */ - public TEnableSharing createTEnableSharing() { - return new TEnableSharing(); - } - - /** - * Create an instance of {@link TDeployment } - * - */ - public TDeployment createTDeployment() { - return new TDeployment(); - } - - /** - * Create an instance of {@link TProvide } - * - */ - public TProvide createTProvide() { - return new TProvide(); - } - - /** - * Create an instance of {@link TProcessEvents } - * - */ - public TProcessEvents createTProcessEvents() { - return new TProcessEvents(); - } - - /** - * Create an instance of {@link TService } - * - */ - public TService createTService() { - return new TService(); - } - - /** - * Create an instance of {@link TSchedule } - * - */ - public TSchedule createTSchedule() { - return new TSchedule(); - } - - /** - * Create an instance of {@link TDeployment.Process.MexInterceptors } - * - */ - public TDeployment.Process.MexInterceptors createTDeploymentProcessMexInterceptors() { - return new TDeployment.Process.MexInterceptors(); - } - - /** - * Create an instance of {@link TInvoke.Binding } - * - */ - public TInvoke.Binding createTInvokeBinding() { - return new TInvoke.Binding(); - } - - /** - * Create an instance of {@link TDeployment.Process } - * - */ - public TDeployment.Process createTDeploymentProcess() { - return new TDeployment.Process(); - } - - /** - * Create an instance of {@link TEnableEventList } - * - */ - public TEnableEventList createTEnableEventList() { - return new TEnableEventList(); - } - - /** - * Create an instance of {@link TMexInterceptor } - * - */ - public TMexInterceptor createTMexInterceptor() { - return new TMexInterceptor(); - } - - /** - * Create an instance of {@link TDeployment.Process.Property } - * - */ - public TDeployment.Process.Property createTDeploymentProcessProperty() { - return new TDeployment.Process.Property(); - } - - /** - * Create an instance of {@link TScopeEvents } - * - */ - public TScopeEvents createTScopeEvents() { - return new TScopeEvents(); - } - - /** - * Create an instance of {@link TInvoke } - * - */ - public TInvoke createTInvoke() { - return new TInvoke(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link TDeployment }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", name = "deploy") - public JAXBElement createDeploy(final TDeployment value) { - return new JAXBElement<>(_Deploy_QNAME, TDeployment.class, null, value); - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java deleted file mode 100644 index 897a7058b..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java +++ /dev/null @@ -1,150 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tCleanup complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tCleanup">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="category" maxOccurs="unbounded" minOccurs="0">
    - *           <simpleType>
    - *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *               <enumeration value="instance"/>
    - *               <enumeration value="variables"/>
    - *               <enumeration value="messages"/>
    - *               <enumeration value="correlations"/>
    - *               <enumeration value="events"/>
    - *               <enumeration value="all"/>
    - *             </restriction>
    - *           </simpleType>
    - *         </element>
    - *         <element name="filter" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="on">
    - *         <simpleType>
    - *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *             <enumeration value="success"/>
    - *             <enumeration value="failure"/>
    - *             <enumeration value="always"/>
    - *           </restriction>
    - *         </simpleType>
    - *       </attribute>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tCleanup", propOrder = {"category", "filter"}) -public class TCleanup { - - @XmlElement(defaultValue = "all") - protected List category; - protected List filter; - @XmlAttribute - protected String on; - - /** - * Gets the value of the category property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the category property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getCategory().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } - * - * - */ - public List getCategory() { - if (this.category == null) { - this.category = new ArrayList<>(); - } - return this.category; - } - - /** - * Gets the value of the filter property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the filter property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getFilter().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } - * - * - */ - public List getFilter() { - if (this.filter == null) { - this.filter = new ArrayList<>(); - } - return this.filter; - } - - /** - * Gets the value of the on property. - * - * @return possible object is {@link String } - * - */ - public String getOn() { - return this.on; - } - - /** - * Sets the value of the on property. - * - * @param value allowed object is {@link String } - * - */ - public void setOn(final String value) { - this.on = value; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java deleted file mode 100644 index 04e05da0b..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java +++ /dev/null @@ -1,672 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tDeployment complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tDeployment">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="process" maxOccurs="unbounded" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    - *                   <element name="property" maxOccurs="unbounded" minOccurs="0">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *                           </sequence>
    - *                           <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                   <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    - *                   <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    - *                   <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    - *                   <element name="mex-interceptors" minOccurs="0">
    - *                     <complexType>
    - *                       <complexContent>
    - *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                           <sequence>
    - *                             <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    - *                           </sequence>
    - *                         </restriction>
    - *                       </complexContent>
    - *                     </complexType>
    - *                   </element>
    - *                   <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    - *                   <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    - *                   <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    - *                 </sequence>
    - *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *                 <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *                 <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tDeployment", propOrder = {"process"}) -public class TDeployment { - - protected List process; - - /** - * Gets the value of the process property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the process property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getProcess().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TDeployment.Process } - * - * - */ - public List getProcess() { - if (this.process == null) { - this.process = new ArrayList<>(); - } - return this.process; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    -     *         <element name="property" maxOccurs="unbounded" minOccurs="0">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    -     *                 </sequence>
    -     *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *         <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    -     *         <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    -     *         <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    -     *         <element name="mex-interceptors" minOccurs="0">
    -     *           <complexType>
    -     *             <complexContent>
    -     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *                 <sequence>
    -     *                   <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    -     *                 </sequence>
    -     *               </restriction>
    -     *             </complexContent>
    -     *           </complexType>
    -     *         </element>
    -     *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    -     *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    -     *         <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    -     *       </sequence>
    -     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *       <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *       <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"active", "retired", "inMemory", "property", "processEvents", "provide", "invoke", - "mexInterceptors", "type", "cleanup", "schedule"}) - public static class Process { - - @XmlElement(defaultValue = "true") - protected Boolean active; - @XmlElement(defaultValue = "false") - protected Boolean retired; - @XmlElement(name = "in-memory", defaultValue = "false") - protected Boolean inMemory; - protected List property; - @XmlElement(name = "process-events") - protected TProcessEvents processEvents; - protected List provide; - protected List invoke; - @XmlElement(name = "mex-interceptors") - protected TDeployment.Process.MexInterceptors mexInterceptors; - protected QName type; - protected List cleanup; - protected List schedule; - @XmlAttribute(required = true) - protected QName name; - @XmlAttribute - protected String fileName; - @XmlAttribute(name = "bpel11wsdlFileName") - protected String bpel11WsdlFileName; - - /** - * Gets the value of the active property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isActive() { - return this.active; - } - - /** - * Sets the value of the active property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setActive(final Boolean value) { - this.active = value; - } - - /** - * Gets the value of the retired property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isRetired() { - return this.retired; - } - - /** - * Sets the value of the retired property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setRetired(final Boolean value) { - this.retired = value; - } - - /** - * Gets the value of the inMemory property. - * - * @return possible object is {@link Boolean } - * - */ - public Boolean isInMemory() { - return this.inMemory; - } - - /** - * Sets the value of the inMemory property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setInMemory(final Boolean value) { - this.inMemory = value; - } - - /** - * Gets the value of the property property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the property property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getProperty().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TDeployment.Process.Property } - * - * - */ - public List getProperty() { - if (this.property == null) { - this.property = new ArrayList<>(); - } - return this.property; - } - - /** - * Gets the value of the processEvents property. - * - * @return possible object is {@link TProcessEvents } - * - */ - public TProcessEvents getProcessEvents() { - return this.processEvents; - } - - /** - * Sets the value of the processEvents property. - * - * @param value allowed object is {@link TProcessEvents } - * - */ - public void setProcessEvents(final TProcessEvents value) { - this.processEvents = value; - } - - /** - * Gets the value of the provide property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the provide property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getProvide().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TProvide } - * - * - */ - public List getProvide() { - if (this.provide == null) { - this.provide = new ArrayList<>(); - } - return this.provide; - } - - /** - * Gets the value of the invoke property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the invoke property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getInvoke().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TInvoke } - * - * - */ - public List getInvoke() { - if (this.invoke == null) { - this.invoke = new ArrayList<>(); - } - return this.invoke; - } - - /** - * Gets the value of the mexInterceptors property. - * - * @return possible object is {@link TDeployment.Process.MexInterceptors } - * - */ - public TDeployment.Process.MexInterceptors getMexInterceptors() { - return this.mexInterceptors; - } - - /** - * Sets the value of the mexInterceptors property. - * - * @param value allowed object is {@link TDeployment.Process.MexInterceptors } - * - */ - public void setMexInterceptors(final TDeployment.Process.MexInterceptors value) { - this.mexInterceptors = value; - } - - /** - * Gets the value of the type property. - * - * @return possible object is {@link QName } - * - */ - public QName getType() { - return this.type; - } - - /** - * Sets the value of the type property. - * - * @param value allowed object is {@link QName } - * - */ - public void setType(final QName value) { - this.type = value; - } - - /** - * Gets the value of the cleanup property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the cleanup property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getCleanup().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCleanup } - * - * - */ - public List getCleanup() { - if (this.cleanup == null) { - this.cleanup = new ArrayList<>(); - } - return this.cleanup; - } - - /** - * Gets the value of the schedule property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the schedule property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getSchedule().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TSchedule } - * - * - */ - public List getSchedule() { - if (this.schedule == null) { - this.schedule = new ArrayList<>(); - } - return this.schedule; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link QName } - * - */ - public QName getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link QName } - * - */ - public void setName(final QName value) { - this.name = value; - } - - /** - * Gets the value of the fileName property. - * - * @return possible object is {@link String } - * - */ - public String getFileName() { - return this.fileName; - } - - /** - * Sets the value of the fileName property. - * - * @param value allowed object is {@link String } - * - */ - public void setFileName(final String value) { - this.fileName = value; - } - - /** - * Gets the value of the bpel11WsdlFileName property. - * - * @return possible object is {@link String } - * - */ - public String getBpel11WsdlFileName() { - return this.bpel11WsdlFileName; - } - - /** - * Sets the value of the bpel11WsdlFileName property. - * - * @param value allowed object is {@link String } - * - */ - public void setBpel11WsdlFileName(final String value) { - this.bpel11WsdlFileName = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    -         *       </sequence>
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"mexInterceptor"}) - public static class MexInterceptors { - - @XmlElement(name = "mex-interceptor") - protected List mexInterceptor; - - /** - * Gets the value of the mexInterceptor property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the mexInterceptor property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -             * getMexInterceptor().add(newItem);
    -             * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TMexInterceptor } - * - * - */ - public List getMexInterceptor() { - if (this.mexInterceptor == null) { - this.mexInterceptor = new ArrayList<>(); - } - return this.mexInterceptor; - } - - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -         * <complexType>
    -         *   <complexContent>
    -         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -         *       <sequence>
    -         *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    -         *       </sequence>
    -         *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -         *     </restriction>
    -         *   </complexContent>
    -         * </complexType>
    -         * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"any"}) - public static class Property { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(required = true) - protected QName name; - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -             * getAny().add(newItem);
    -             * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link QName } - * - */ - public QName getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link QName } - * - */ - public void setName(final QName value) { - this.name = value; - } - - } - - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java deleted file mode 100644 index f65d5f85b..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java +++ /dev/null @@ -1,79 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tEnableEventList complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEnableEventList">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="enable-event" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEnableEventList", propOrder = {"enableEvent"}) -@XmlSeeAlso({TProcessEvents.class, TScopeEvents.class}) -public class TEnableEventList { - - @XmlElement(name = "enable-event") - protected List enableEvent; - - /** - * Gets the value of the enableEvent property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the enableEvent property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getEnableEvent().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } - * - * - */ - public List getEnableEvent() { - if (this.enableEvent == null) { - this.enableEvent = new ArrayList<>(); - } - return this.enableEvent; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java deleted file mode 100644 index cb4498eb5..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java +++ /dev/null @@ -1,40 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tEnableSharing complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tEnableSharing">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tEnableSharing") -public class TEnableSharing { - - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java deleted file mode 100644 index 55478e35d..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java +++ /dev/null @@ -1,222 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.apache.ode.activityrecovery.FailureHandling; - - -/** - *

    - * Java class for tInvoke complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tInvoke">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    - *         <element name="binding" minOccurs="0">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *         <element ref="{http://ode.apache.org/activityRecovery}failureHandling" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="usePeer2Peer" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tInvoke", propOrder = {"service", "binding", "failureHandling"}) -public class TInvoke { - - @XmlElement(required = true) - protected TService service; - protected TInvoke.Binding binding; - @XmlElement(namespace = "http://ode.apache.org/activityRecovery") - protected FailureHandling failureHandling; - @XmlAttribute(required = true) - protected String partnerLink; - @XmlAttribute - protected Boolean usePeer2Peer; - - /** - * Gets the value of the service property. - * - * @return possible object is {@link TService } - * - */ - public TService getService() { - return this.service; - } - - /** - * Sets the value of the service property. - * - * @param value allowed object is {@link TService } - * - */ - public void setService(final TService value) { - this.service = value; - } - - /** - * Gets the value of the binding property. - * - * @return possible object is {@link TInvoke.Binding } - * - */ - public TInvoke.Binding getBinding() { - return this.binding; - } - - /** - * Sets the value of the binding property. - * - * @param value allowed object is {@link TInvoke.Binding } - * - */ - public void setBinding(final TInvoke.Binding value) { - this.binding = value; - } - - /** - * Gets the value of the failureHandling property. - * - * @return possible object is {@link FailureHandling } - * - */ - public FailureHandling getFailureHandling() { - return this.failureHandling; - } - - /** - * Sets the value of the failureHandling property. - * - * @param value allowed object is {@link FailureHandling } - * - */ - public void setFailureHandling(final FailureHandling value) { - this.failureHandling = value; - } - - /** - * Gets the value of the partnerLink property. - * - * @return possible object is {@link String } - * - */ - public String getPartnerLink() { - return this.partnerLink; - } - - /** - * Sets the value of the partnerLink property. - * - * @param value allowed object is {@link String } - * - */ - public void setPartnerLink(final String value) { - this.partnerLink = value; - } - - /** - * Gets the value of the usePeer2Peer property. - * - * @return possible object is {@link Boolean } - * - */ - public boolean isUsePeer2Peer() { - if (this.usePeer2Peer == null) { - return true; - } else { - return this.usePeer2Peer; - } - } - - /** - * Sets the value of the usePeer2Peer property. - * - * @param value allowed object is {@link Boolean } - * - */ - public void setUsePeer2Peer(final Boolean value) { - this.usePeer2Peer = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Binding { - - @XmlAttribute(required = true) - protected QName name; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link QName } - * - */ - public QName getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link QName } - * - */ - public void setName(final QName value) { - this.name = value; - } - - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java deleted file mode 100644 index 31272d411..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java +++ /dev/null @@ -1,70 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - * - * Message exchange interceptor configuration. - * - * - *

    - * Java class for tMexInterceptor complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tMexInterceptor">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="class-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tMexInterceptor", propOrder = {"className"}) -public class TMexInterceptor { - - @XmlElement(name = "class-name", required = true) - protected String className; - - /** - * Gets the value of the className property. - * - * @return possible object is {@link String } - * - */ - public String getClassName() { - return this.className; - } - - /** - * Sets the value of the className property. - * - * @param value allowed object is {@link String } - * - */ - public void setClassName(final String value) { - this.className = value; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java deleted file mode 100644 index 40ddd515e..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java +++ /dev/null @@ -1,108 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tProcessEvents complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tProcessEvents">
    - *   <complexContent>
    - *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    - *       <sequence>
    - *         <element name="scope-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tScopeEvents" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="generate">
    - *         <simpleType>
    - *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    - *             <enumeration value="all"/>
    - *             <enumeration value="none"/>
    - *           </restriction>
    - *         </simpleType>
    - *       </attribute>
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tProcessEvents", propOrder = {"scopeEvents"}) -public class TProcessEvents extends TEnableEventList { - - @XmlElement(name = "scope-events") - protected List scopeEvents; - @XmlAttribute - protected String generate; - - /** - * Gets the value of the scopeEvents property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the scopeEvents property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getScopeEvents().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TScopeEvents } - * - * - */ - public List getScopeEvents() { - if (this.scopeEvents == null) { - this.scopeEvents = new ArrayList<>(); - } - return this.scopeEvents; - } - - /** - * Gets the value of the generate property. - * - * @return possible object is {@link String } - * - */ - public String getGenerate() { - return this.generate; - } - - /** - * Sets the value of the generate property. - * - * @param value allowed object is {@link String } - * - */ - public void setGenerate(final String value) { - this.generate = value; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TProvide.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TProvide.java deleted file mode 100644 index 5f80d22bf..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TProvide.java +++ /dev/null @@ -1,112 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tProvide complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tProvide">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    - *         <element name="enableSharing" type="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableSharing" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tProvide", propOrder = {"service", "enableSharing"}) -public class TProvide { - - @XmlElement(required = true) - protected TService service; - protected TEnableSharing enableSharing; - @XmlAttribute(required = true) - protected String partnerLink; - - /** - * Gets the value of the service property. - * - * @return possible object is {@link TService } - * - */ - public TService getService() { - return this.service; - } - - /** - * Sets the value of the service property. - * - * @param value allowed object is {@link TService } - * - */ - public void setService(final TService value) { - this.service = value; - } - - /** - * Gets the value of the enableSharing property. - * - * @return possible object is {@link TEnableSharing } - * - */ - public TEnableSharing getEnableSharing() { - return this.enableSharing; - } - - /** - * Sets the value of the enableSharing property. - * - * @param value allowed object is {@link TEnableSharing } - * - */ - public void setEnableSharing(final TEnableSharing value) { - this.enableSharing = value; - } - - /** - * Gets the value of the partnerLink property. - * - * @return possible object is {@link String } - * - */ - public String getPartnerLink() { - return this.partnerLink; - } - - /** - * Sets the value of the partnerLink property. - * - * @param value allowed object is {@link String } - * - */ - public void setPartnerLink(final String value) { - this.partnerLink = value; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java deleted file mode 100644 index 60496415a..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java +++ /dev/null @@ -1,99 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tSchedule complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tSchedule">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="when" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tSchedule", propOrder = {"cleanup"}) -public class TSchedule { - - protected List cleanup; - @XmlAttribute(required = true) - protected String when; - - /** - * Gets the value of the cleanup property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the cleanup property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getCleanup().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link TCleanup } - * - * - */ - public List getCleanup() { - if (this.cleanup == null) { - this.cleanup = new ArrayList<>(); - } - return this.cleanup; - } - - /** - * Gets the value of the when property. - * - * @return possible object is {@link String } - * - */ - public String getWhen() { - return this.when; - } - - /** - * Sets the value of the when property. - * - * @param value allowed object is {@link String } - * - */ - public void setWhen(final String value) { - this.when = value; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java deleted file mode 100644 index 0c943c099..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java +++ /dev/null @@ -1,64 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for tScopeEvents complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tScopeEvents">
    - *   <complexContent>
    - *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </extension>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tScopeEvents") -public class TScopeEvents extends TEnableEventList { - - @XmlAttribute(required = true) - protected String name; - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TService.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TService.java deleted file mode 100644 index 105f94306..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/TService.java +++ /dev/null @@ -1,132 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - - -package org.apache.ode.schemas.dd._2007._03; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAnyElement; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; - -import org.w3c.dom.Element; - - -/** - *

    - * Java class for tService complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="tService">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    - *       </sequence>
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    - *       <attribute name="port" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "tService", propOrder = {"any"}) -public class TService { - - @XmlAnyElement(lax = true) - protected List any; - @XmlAttribute(required = true) - protected QName name; - @XmlAttribute(required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "NCName") - protected String port; - - /** - * Gets the value of the any property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the any property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getAny().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } - * - * - */ - public List getAny() { - if (this.any == null) { - this.any = new ArrayList<>(); - } - return this.any; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link QName } - * - */ - public QName getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link QName } - * - */ - public void setName(final QName value) { - this.name = value; - } - - /** - * Gets the value of the port property. - * - * @return possible object is {@link String } - * - */ - public String getPort() { - return this.port; - } - - /** - * Sets the value of the port property. - * - * @param value allowed object is {@link String } - * - */ - public void setPort(final String value) { - this.port = value; - } - -} diff --git a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/package-info.java b/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/package-info.java deleted file mode 100644 index cc4b1b8d2..000000000 --- a/org.opentosca.planbuilder.model/src/org/apache/ode/schemas/dd/_2007/_03/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2013.05.27 at 03:40:55 PM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.apache.ode.schemas.dd._2007._03; diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/MonitoringActivity.java b/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/MonitoringActivity.java deleted file mode 100644 index a632c12a3..000000000 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/MonitoringActivity.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.opentosca.planbuilder.model.plan; - -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; - -/** - * Copyright 2017 IAAS University of Stuttgart
    - *
    - * - * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class MonitoringActivity extends AbstractActivity { - - - public MonitoringActivity(final String id, final ActivityType type) { - super(id, type); - } - - - -} diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplateProperties.java b/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplateProperties.java deleted file mode 100644 index 7e15e0bf4..000000000 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplateProperties.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.model.tosca; - -import java.util.List; - -/** - *

    - * This class represents TOSCA ServiceTemplate Properties - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public abstract class AbstractServiceTemplateProperties { - - /** - * Returns the PropertyMappings of this ServiceTemplate - * - * @return a List of AbstractPropertyMappings - */ - public abstract List getPropertyMappings(); - - /** - * Returns the Properties of this ServiceTemplate - * - * @return an AbstractProperties of this ServiceTemplate - */ - public abstract AbstractProperties getProperties(); - -} diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/MANIFEST.MF deleted file mode 100644 index 4ea2518c9..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Instancedata Plugins -Bundle-SymbolicName: org.opentosca.planbuilder.postphase.plugin.instancedata -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.container.core.tosca.convention, - org.opentosca.planbuilder.provphase.plugin.invoker.bpel, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.10" -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.planbuilder;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.postphase.plugin.instancedata.Activator diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightDELETE.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightDELETE.xml deleted file mode 100644 index 03e5257e5..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightDELETE.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET.xml deleted file mode 100644 index fc8c9911f..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_Instance_Properties.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_Instance_Properties.xml deleted file mode 100644 index 7357a5d2f..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_Instance_Properties.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml deleted file mode 100644 index 5ee127e65..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml deleted file mode 100644 index 32924b7fe..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml deleted file mode 100644 index 4a253c65b..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml deleted file mode 100644 index edcd68918..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml deleted file mode 100644 index 8c0fa50d8..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml deleted file mode 100644 index 6dd1ba392..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml deleted file mode 100644 index e79d57cd4..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml deleted file mode 100644 index 9f519f0d4..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml deleted file mode 100644 index 58c7fa5b5..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromInputToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromInputToStringVar.xml deleted file mode 100644 index d7f9682db..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromInputToStringVar.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml deleted file mode 100644 index f664f09e1..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml deleted file mode 100644 index bcdef85f5..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml deleted file mode 100644 index 7060c37cd..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml deleted file mode 100644 index 0a6925c14..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/META-INF/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/build.properties b/org.opentosca.planbuilder.postphase.plugin.instancedata/build.properties deleted file mode 100644 index 01e33e777..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/pom.xml b/org.opentosca.planbuilder.postphase.plugin.instancedata/pom.xml deleted file mode 100644 index e17163df7..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.postphase.plugin.instancedata - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/Activator.java b/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/Activator.java deleted file mode 100644 index 81f6a52bc..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.opentosca.planbuilder.postphase.plugin.instancedata; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwarePrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.opentosca.planbuilder.postphase.plugin.instancedata.bpel.BPELInstanceDataPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -public class Activator implements BundleActivator { - - private static BundleContext context; - private ServiceRegistration registration; - private ServiceRegistration registration2; - private BPELInstanceDataPlugin plugin = null; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.plugin = new BPELInstanceDataPlugin(); - this.registration = - Activator.context.registerService(IPlanBuilderPostPhasePlugin.class.getName(), this.plugin, null); - this.registration2 = - Activator.context.registerService(IPlanBuilderPolicyAwarePrePhasePlugin.class.getName(), this.plugin, null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - this.registration2.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Fragments.java b/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Fragments.java deleted file mode 100644 index 219a60367..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Fragments.java +++ /dev/null @@ -1,551 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.postphase.plugin.instancedata.bpel; - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.net.URL; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; -import org.osgi.framework.FrameworkUtil; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - *

    - * This class contains all the BPEL Fragments - *

    - * Copyright 2014 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Fragments { - - private final DocumentBuilderFactory docFactory; - private final DocumentBuilder docBuilder; - - - /** - * Constructor - * - * @throws ParserConfigurationException is thrown when initializing the internal DocumentBuild fails - */ - public Fragments() throws ParserConfigurationException { - this.docFactory = DocumentBuilderFactory.newInstance(); - this.docFactory.setNamespaceAware(true); - this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } - - /** - * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. - * - * @param bpelVarName the variable containing an URL - * @param responseVarName the variable to hold the response - * @return a String containing a BPEL4RESTLight Activity - * @throws IOException is thrown when reading internal files fails - */ - public String createRESTDeleteOnURLBPELVarAsString(final String bpelVarName, - final String responseVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightDELETE.xml"); - // - - final File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath()); - - String template = FileUtils.readFileToString(bpelFragmentFile); - template = template.replace("$urlVarName", bpelVarName); - template = template.replace("$ResponseVarName", responseVarName); - - return template; - } - - /** - * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. - * - * @param bpelVarName the variable containing an URL - * @param responseVarName the variable to hold the response - * @return a String containing a BPEL4RESTLight Activity - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node createRESTDeleteOnURLBPELVarAsNode(final String bpelVarName, - final String responseVarName) throws IOException, SAXException { - final String templateString = createRESTDeleteOnURLBPELVarAsString(bpelVarName, responseVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a BPEL4RESTLight extension activity that sets the instance state of the given - * nodeInstance with the contents of the given string variable - * - * @param instanceURLVar the variable holding the url to the node instance - * @param RequestVarName the variable to take the request body contents from - * @return a String containing a single BPEL extension activity - * @throws IOException is thrown when reading a internal file fails - */ - public String generateBPEL4RESTLightPUTInstanceState(final String instanceURLVar, - final String RequestVarName) throws IOException { - // BPEL4RESTLightPUT_NodeInstance_State_InstanceDataAPI.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4restString = FileUtils.readFileToString(bpel4RestFile); - - bpel4restString = bpel4restString.replace("$instanceURLVar", instanceURLVar); - bpel4restString = bpel4restString.replace("$RequestVarName", RequestVarName); - - return bpel4restString; - } - - public String generateBPEL4RESTLightGETInstanceState(final String instanceURLVar, - final String ResponseVarName) throws IOException { - // BPEL4RESTLightPUT_NodeInstance_State_InstanceDataAPI.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4restString = FileUtils.readFileToString(bpel4RestFile); - - bpel4restString = bpel4restString.replace("$instanceURLVar", instanceURLVar); - bpel4restString = bpel4restString.replace("$ResponseVarName", ResponseVarName); - - return bpel4restString; - } - - public Node generateBPEL4RESTLightGETInstanceStateAsNode(final String instanceURLVar, - final String ResponseVarName) throws SAXException, IOException { - return this.toDom(this.generateBPEL4RESTLightGETInstanceState(instanceURLVar, ResponseVarName)); - } - - private Node toDom(String templateString) throws SAXException, IOException { - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a String containing a BPEL assign that reads the value of a NodeInstance create - * response and writes it into the referenced string variable - * - * @param nodeInstanceURLVarName the string variable to write the data into - * @param nodeInstancePOSTResponseVarName the response variable of a nodeInstance create POST - * @return a String containing a BPEL assign - * @throws IOException is thrown when reading a internal file fails - */ - public String generateAssignFromNodeInstancePOSTResponseToStringVar(final String nodeInstanceURLVarName, - final String nodeInstanceIDVarName, - final String nodeInstancePOSTResponseVarName) throws IOException { - // BPELAssignFromNodeInstancePOSTResponseToStringVar.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPELAssignFromNodeInstancePOSTResponseToStringVar.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpel4RestFile); - - bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", nodeInstanceURLVarName); - bpelAssignString = - bpelAssignString.replaceAll("\\$NodeInstanceResponseVarName", nodeInstancePOSTResponseVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$nodeInstanceIDVar", nodeInstanceIDVarName); - - return bpelAssignString; - } - - /** - * Generates a String containing a BPEL assign that reads the value of a RelationInstance create - * response and writes it into the referenced string variable - * - * @param stringVarName the string variable to write the data into - * @param relationInstancePOSTResponseVarName the response variable of a relationInstance create - * POST - * @return a String containing a BPEL assign - * @throws IOException is thrown when reading a internal file fails - */ - public String generateAssignFromRelationInstancePOSTResponseToStringVar(final String stringVarName, - final String relationInstanceIDVar, - final String relationInstancePOSTResponseVarName) throws IOException { - // BPELAssignFromNodeInstancePOSTResponseToStringVar.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPELAssignFromRelationInstancePOSTResponseToStringVar.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpel4RestFile); - - bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", stringVarName); - bpelAssignString = - bpelAssignString.replaceAll("\\$RelationInstanceResponseVarName", relationInstancePOSTResponseVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$relationInstanceIDVar", relationInstanceIDVar); - - return bpelAssignString; - } - - /** - * Generates a String containing a BPEL4RESTLight extension activity which create a nodeTemplate - * instance on the given serviceTemplate instance - * - * @param serviceInstanceURLVar the variable holding the serviceInstanceUrl - * @param nodeTemplateId the id of the nodeTemplate to instantiate - * @param responseVariableName the variable to store the response into - * @return a String containing a BPEL extension activity - * @throws IOException is thrown when reading the internal file fails - */ - public String generateBPEL4RESTLightNodeInstancePOST(final String serviceInstanceURLVar, - final String serviceInstanceIDVarName, - final String nodeTemplateId, - final String responseVariableName) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4RestString = FileUtils.readFileToString(bpel4RestFile); - - bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceURLVar", serviceInstanceURLVar); - bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceIDVar", serviceInstanceIDVarName); - bpel4RestString = bpel4RestString.replaceAll("\\$nodeTemplateId", nodeTemplateId); - bpel4RestString = bpel4RestString.replaceAll("\\$ResponseVarName", responseVariableName); - - return bpel4RestString; - } - - /** - * Generates a String containing a BPEL4RESTLight extension activity which creates a Relationship - * Template instance on the given Service Template instance - * - * @param serviceInstanceURLVar the variable holding the serviceInstanceUrl - * @param relationshipTemplateId the id of the Relationship Template to instantiate - * @param responseVariableName the variable to store the response into - * @param sourceInstanceIdVarName the variable name of the instance Id of the source node instance - * of the relation to be created - * @param targetInstanceIdVarName the variable name of the instance Id of the target node instance - * of the relation to be created - * @return a String containing a BPEL extension activity - * @throws IOException is thrown when reading the internal file fails - */ - public String generateBPEL4RESTLightRelationInstancePOST(final String serviceInstanceURLVar, - final String relationshipTemplateId, - final String requestVariableName, - final String responseVariableName, - final String sourceInstanceIdVarName, - final String targetInstanceIdVarName, - final String serviceInstanceIdVarName) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4RestString = FileUtils.readFileToString(bpel4RestFile); - - bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceURLVar", serviceInstanceURLVar); - bpel4RestString = bpel4RestString.replaceAll("\\$relationshipTemplateId", relationshipTemplateId); - bpel4RestString = bpel4RestString.replaceAll("\\$RequestVarName", requestVariableName); - bpel4RestString = bpel4RestString.replaceAll("\\$ResponseVarName", responseVariableName); - bpel4RestString = bpel4RestString.replaceAll("\\$sourceInstanceIdVarName", sourceInstanceIdVarName); - bpel4RestString = bpel4RestString.replaceAll("\\$targetInstanceIdVarName", targetInstanceIdVarName); - bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceIdVarName", serviceInstanceIdVarName); - - return bpel4RestString; - } - - public String generateBPEL4RESTLightServiceInstancePOST(final String instanceDataAPIUrlVariableName, - final String csarId, final QName serviceTemplateId, - final String responseVariableName) throws IOException { - // tags in xml snippet: $InstanceDataURLVar, $CSARName, - // $serviceTemplateId, $ResponseVarName - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4RestString = FileUtils.readFileToString(bpel4RestFile); - - bpel4RestString = bpel4RestString.replace("$InstanceDataURLVar", instanceDataAPIUrlVariableName); - bpel4RestString = bpel4RestString.replace("$CSARName", csarId); - bpel4RestString = bpel4RestString.replace("$serviceTemplateId", serviceTemplateId.toString()); - bpel4RestString = bpel4RestString.replace("$ResponseVarName", responseVariableName); - - return bpel4RestString; - } - - public Node generateBPEL4RESTLightServiceInstancePOSTAsNode(final String instanceDataAPIUrlVariableName, - final String csarId, final QName serviceTemplateId, - final String responseVariableName) throws IOException, - SAXException { - final String templateString = - generateBPEL4RESTLightServiceInstancePOST(instanceDataAPIUrlVariableName, csarId, serviceTemplateId, - responseVariableName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateServiceInstanceURLVarAssign(final String serviceInstanceResponseVarName, - final String serviceInstanceURLVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelAssignServiceInstancePOSTResponse.xml"); - final File bpelAssigntFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssigntFile); - // - - bpelAssignString = - bpelAssignString.replace("$assignName", "assignServiceInstance" + System.currentTimeMillis()); - bpelAssignString = bpelAssignString.replace("$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); - bpelAssignString = bpelAssignString.replace("$ServiceInstanceURLVarName", serviceInstanceURLVarName); - return bpelAssignString; - } - - public Node generateServiceInstanceURLVarAssignAsNode(final String serviceInstanceResponseVarName, - final String serviceInstanceURLVarName) throws IOException, - SAXException { - final String templateString = - generateServiceInstanceURLVarAssign(serviceInstanceResponseVarName, serviceInstanceURLVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public Node generateNodeInstancesQueryGETasNode(final String instanceDataUrlVarName, final String responseVarName, - final QName nodeType) throws IOException, SAXException { - final String templateString = - generateNodeInstancePropertiesGET(instanceDataUrlVarName, responseVarName, nodeType); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateInstancePropertiesGET(final String instanceUrlVarName, - final String bpel4RestLightResponseVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightGET_Instance_Properties.xml"); - final File bpel4restLightGETFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4restLightGETString = FileUtils.readFileToString(bpel4restLightGETFile); - // - bpel4restLightGETString = bpel4restLightGETString.replace("$urlVarName", instanceUrlVarName); - bpel4restLightGETString = bpel4restLightGETString.replace("$ResponseVarName", bpel4RestLightResponseVarName); - return bpel4restLightGETString; - } - - public Node generateInstancePropertiesGETAsNode(final String instanceUrlVarName, - final String bpel4RestLightResponseVarName) throws SAXException, - IOException { - final String templateString = generateInstancePropertiesGET(instanceUrlVarName, bpel4RestLightResponseVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateAssignFromNodeInstanceResonseToStringVar(final String stringVarName, - final String nodeInstanceResponseVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelAssignFromNodeInstanceRequestToStringVar.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - // - bpelAssignString = bpelAssignString.replace("$stringVarName", stringVarName); - bpelAssignString = bpelAssignString.replace("$NodeInstanceResponseVarName", nodeInstanceResponseVarName); - return bpelAssignString; - } - - public Node generateAssignFromNodeInstanceResponseToStringVarAsNode(final String stringVarName, - final String nodeInstanceResponseVarName) throws IOException, - SAXException { - final String templateString = - generateAssignFromNodeInstanceResonseToStringVar(stringVarName, nodeInstanceResponseVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateNodeInstancePropertiesGET(final String instanceDataUrlVarName, final String responseVarName, - final QName nodeType) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - - // $InstanceDataURLVar, $ResponseVarName, $nodeType - - bpelAssignString = bpelAssignString.replace("$InstanceDataURLVar", instanceDataUrlVarName); - bpelAssignString = bpelAssignString.replace("$ResponseVarName", responseVarName); - bpelAssignString = bpelAssignString.replace("$nodeType", nodeType.toString()); - return bpelAssignString; - } - - public String generateServiceInstanceRequestToStringVarAssign(final String stringVarName, - final String serviceInstanceResponseVarName, - final int nodeInstanceIndex) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelAssignFromServiceInstanceRequestToStringVar.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - - bpelAssignString = bpelAssignString.replace("$stringVarName", stringVarName); - bpelAssignString = bpelAssignString.replace("$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); - bpelAssignString = bpelAssignString.replace("$nodeInstanceIndex", String.valueOf(nodeInstanceIndex)); - - return bpelAssignString; - } - - public Node generateServiceInstanceRequestToStringVarAssignAsNode(final String stringVarName, - final String serviceInstanceResponseVarName, - final int nodeInstanceIndex) throws IOException, - SAXException { - final String templateString = - generateServiceInstanceRequestToStringVarAssign(stringVarName, serviceInstanceResponseVarName, - nodeInstanceIndex); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateBPEL4RESTLightGET(final String urlVarName, final String responseVarName) throws IOException { - // BPEL4RESTLightGET_ServiceInstance_InstanceDataAPI.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightGET.xml"); - final File bpelServiceInstanceGETFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelServiceInstanceGETString = FileUtils.readFileToString(bpelServiceInstanceGETFile); - - bpelServiceInstanceGETString = bpelServiceInstanceGETString.replace("$urlVarName", urlVarName); - bpelServiceInstanceGETString = bpelServiceInstanceGETString.replace("$ResponseVarName", responseVarName); - return bpelServiceInstanceGETString; - } - - public Node generateBPEL4RESTLightGETAsNode(final String serviceInstanceUrlVarName, - final String responseVarName) throws IOException, SAXException { - final String templateString = generateBPEL4RESTLightGET(serviceInstanceUrlVarName, responseVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateAssignFromInputMessageToStringVariable(final String inputMessageElementLocalName, - final String stringVariableName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelAssignFromInputToStringVar.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - // - bpelAssignString = bpelAssignString.replace("$inputElementLocalName", inputMessageElementLocalName); - bpelAssignString = bpelAssignString.replace("$StringVariableName", stringVariableName); - bpelAssignString = - bpelAssignString.replace("$assignName", "assignFromInputToString" + System.currentTimeMillis()); - return bpelAssignString; - } - - public Node generateAssignFromInputMessageToStringVariableAsNode(final String inputMessageElementLocalName, - final String stringVariableName) throws IOException, - SAXException { - final String templateString = - generateAssignFromInputMessageToStringVariable(inputMessageElementLocalName, stringVariableName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateCopyFromStringVarToAnyTypeVar(final String propertyVarName, - final String nodeInstancePropertyRequestVarName, - final String nodeInstancePropertyLocalName, - final String nodeInstancePropertyNamespace) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelCopyFromPropertyVarToNodeInstanceProperty.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - // - bpelAssignString = bpelAssignString.replace("$PropertyVarName", propertyVarName); - bpelAssignString = - bpelAssignString.replace("$NodeInstancePropertyRequestVarName", nodeInstancePropertyRequestVarName); - bpelAssignString = bpelAssignString.replace("$NodeInstancePropertyLocalName", nodeInstancePropertyLocalName); - bpelAssignString = bpelAssignString.replace("$NodeInstancePropertyNamespace", nodeInstancePropertyNamespace); - return bpelAssignString; - } - - public Node generateCopyFromStringVarToAnyTypeVarAsNode(final String propertyVarName, - final String nodeInstancePropertyRequestVarName, - final String nodeInstancePropertyLocalName, - final String nodeInstancePropertyNamespace) throws IOException, - SAXException { - final String templateString = - generateCopyFromStringVarToAnyTypeVar(propertyVarName, nodeInstancePropertyRequestVarName, - nodeInstancePropertyLocalName, nodeInstancePropertyNamespace); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public Node generateAssignFromPropertyVarToDomMapping(final String nodeInstancePropertyRequestVarName, - final Map propertyVarToDomMapping) throws SAXException, - IOException { - // create empty bpel:assign - final String bpelAssignString = - ""; - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(bpelAssignString)); - final Document doc = this.docBuilder.parse(is); - - final Node assignNode = doc.getFirstChild(); - for (final String propertyVarName : propertyVarToDomMapping.keySet()) { - final Node propertyNode = propertyVarToDomMapping.get(propertyVarName); - Node copyNode = - generateCopyFromStringVarToAnyTypeVarAsNode(propertyVarName, nodeInstancePropertyRequestVarName, - propertyNode.getLocalName(), - propertyNode.getNamespaceURI()); - - copyNode = doc.importNode(copyNode, true); - assignNode.appendChild(copyNode); - } - - return assignNode; - } - - public String generateInstancesBPEL4RESTLightPUT(final String requestVarName, - final String instanceURLVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml"); - final File bpel4RESTLightPUTFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4RESTLightPut = FileUtils.readFileToString(bpel4RESTLightPUTFile); - - // - bpel4RESTLightPut = bpel4RESTLightPut.replace("$RequestVarName", requestVarName); - bpel4RESTLightPut = bpel4RESTLightPut.replace("$instanceURLVar", instanceURLVarName); - return bpel4RESTLightPut; - } - - public Node generateInstancesBPEL4RESTLightPUTAsNode(final String requestVarName, - final String instanceURLVarName) throws IOException, - SAXException { - final String templateString = generateInstancesBPEL4RESTLightPUT(requestVarName, instanceURLVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - -} diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Handler.java b/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Handler.java deleted file mode 100644 index acfad544c..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Handler.java +++ /dev/null @@ -1,1962 +0,0 @@ -package org.opentosca.planbuilder.postphase.plugin.instancedata.bpel; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.core.bpel.handlers.BPELScopeHandler; -import org.opentosca.planbuilder.model.plan.ActivityType; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; -import org.opentosca.planbuilder.model.tosca.AbstractInterface; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.model.tosca.AbstractProperties; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -/** - *

    - * This class contains all logic to append BPEL code which updates the InstanceData of a - * NodeTemplate - *

    - * Copyright 2014 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Handler { - - private Fragments fragments; - private BPELProcessFragments bpelFrags; - private BPELInvokerPlugin invoker; - - private final XPathFactory xPathfactory = XPathFactory.newInstance(); - - private final static Logger LOG = LoggerFactory.getLogger(Handler.class); - - - public Handler() { - - try { - this.fragments = new Fragments(); - this.bpelFrags = new BPELProcessFragments(); - this.invoker = new BPELInvokerPlugin(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - private String createRESTResponseVar(final BPELPlanContext context) { - final String restCallResponseVarName = "bpel4restlightVarResponse" + context.getIdForNames(); - final QName restCallResponseDeclId = - context.importQName(new QName("http://www.w3.org/2001/XMLSchema", "anyType", "xsd")); - if (!context.addGlobalVariable(restCallResponseVarName, BPELPlan.VariableType.TYPE, restCallResponseDeclId)) { - return null; - } - return restCallResponseVarName; - } - - private String createStateVar(final BPELPlanContext context, final String templateId) { - // create state variable inside scope - final String stateVarName = ModelUtils.makeValidNCName(templateId) + "_state_" + context.getIdForNames(); - final QName stringTypeDeclId = - context.importQName(new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); - if (!context.addGlobalVariable(stateVarName, BPELPlan.VariableType.TYPE, stringTypeDeclId)) { - return null; - } - - return stateVarName; - } - - public String createInstanceURLVar(final BPELPlanContext context, final String templateId) { - final String instanceURLVarName = (context.getRelationshipTemplate() == null ? "node" : "relationship") - + "InstanceURL_" + ModelUtils.makeValidNCName(templateId) + "_" + context.getIdForNames(); - final QName stringTypeDeclId = - context.importQName(new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); - if (!context.addGlobalVariable(instanceURLVarName, BPELPlan.VariableType.TYPE, stringTypeDeclId)) { - return null; - } - - return instanceURLVarName; - } - - public String createInstanceIDVar(final BPELPlanContext context, final String templateId) { - final String instanceURLVarName = (context.getRelationshipTemplate() == null ? "node" : "relationship") - + "InstanceID_" + ModelUtils.makeValidNCName(templateId) + "_" + context.getIdForNames(); - final QName stringTypeDeclId = - context.importQName(new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); - if (!context.addGlobalVariable(instanceURLVarName, BPELPlan.VariableType.TYPE, stringTypeDeclId)) { - return null; - } - - return instanceURLVarName; - } - - - - public boolean handleTerminate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { - final boolean hasProps = checkProperties(nodeTemplate.getProperties()); - - final String serviceInstanceVarName = context.getServiceInstanceURLVarName(); - if (serviceInstanceVarName == null) { - return false; - } - - /* - * Pre Phase code - */ - - // create variable for all responses - final String restCallResponseVarName = createRESTResponseVar(context); - - if (restCallResponseVarName == null) { - return false; - } - - // create state variable inside scope - final String stateVarName = createStateVar(context, context.getNodeTemplate().getId()); - - if (stateVarName == null) { - return false; - } - - String nodeInstanceURLVarName = ""; - - if (context.findInstanceURLVar(context.getNodeTemplate().getId(), true) == null) { - // generate String var for nodeInstance URL - nodeInstanceURLVarName = createInstanceURLVar(context, context.getNodeTemplate().getId()); - } else { - nodeInstanceURLVarName = context.findInstanceURLVar(context.getNodeTemplate().getId(), true); - } - - if (nodeInstanceURLVarName == null) { - return false; - } - - // we'll use this later when we determine that the handle Node doesn't - // have lifecycle operations. Without this check all nodes without - // lifecycle (or cloud prov operations) will be in an uninstalled state - String lastSetState = "DELETED"; - - /* - * Prov Phase code - */ - - // fetch all assigns that assign an invoke async operation request - - final Element provisioningPhaseElement = context.getProvisioningPhaseElement(); - final List assignContentElements = fetchInvokerCallAssigns(provisioningPhaseElement); - - // for each assign element we fetch the operation name, determine the - // pre and post states, and append the pre state before the found assign - // and the post state after the receive of the invoker iteraction - for (final Element assignContentElement : assignContentElements) { - - // fetch operationName from literal contents - final String operationName = fetchOperationName(assignContentElement); - // determine pre and post state for operation - final String preState = InstanceStates.getOperationPreState(operationName); - final String postState = InstanceStates.getOperationPostState(operationName); - - if (preState != null) { - - try { - - // assign prestate to state variable - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignNodeStateFor_" - + operationName + "_" + System.currentTimeMillis(), "string('" + preState + "')", stateVarName); - assignNode = context.importNode(assignNode); - lastSetState = preState; - - // assign the state before the assign of the invoker request - // is made - final Node bpelAssignNode = - assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); - bpelAssignNode.getParentNode().insertBefore(assignNode, bpelAssignNode); - - // create REST Put activity - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - - // send the state before the assign of the invoker request - // is made - bpelAssignNode.getParentNode().insertBefore(extActiv, bpelAssignNode); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - if (postState != null) { - try { - // create state assign activity - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = - frag.createAssignXpathQueryToStringVarFragmentAsNode("assignNodeState_" + operationName + "_" - + System.currentTimeMillis(), "string('" + postState + "')", stateVarName); - assignNode = context.importNode(assignNode); - - lastSetState = postState; - - /* - * assign the state after the receiving the response of the - */ - - // fetch assign node - final Node bpelAssignNode = - assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); - - // fetch the variable name which is used as request body - final String reqVarName = fetchRequestVarNameFromInvokerAssign(assignContentElement); - - // from the assign element search for the receive element - // that is witing for the response - final Element invokerReceiveElement = fetchInvokerReceive((Element) bpelAssignNode, reqVarName); - - // insert assign after the receive - assignNode = invokerReceiveElement.getParentNode() - .insertBefore(assignNode, invokerReceiveElement.getNextSibling()); - - // create PUT activity - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - - // insert REST call after the assign - invokerReceiveElement.getParentNode().insertBefore(extActiv, assignNode.getNextSibling()); - - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - } - - // needs property update only if the node has properties - if (hasProps) { - // make a GET on the nodeInstance properties - - try { - // fetch properties - Node nodeInstancePropsGETNode = - this.fragments.generateInstancePropertiesGETAsNode(nodeInstanceURLVarName, restCallResponseVarName); - nodeInstancePropsGETNode = context.importNode(nodeInstancePropsGETNode); - context.getPostPhaseElement().appendChild(nodeInstancePropsGETNode); - } - catch (final SAXException e1) { - e1.printStackTrace(); - return false; - } - catch (final IOException e1) { - e1.printStackTrace(); - return false; - } - - // assign the values from the property variables into REST/HTTP - // Request - // and send - // first build a mapping from property variable names to dom element - final Map propertyVarNameToDOMMapping = - buildMappingsFromVarNameToDomElement(context, nodeTemplate); - try { - // then generate an assign to have code that writes the runtime - // values into the instance data db. - // we use the restCallResponseVarName from the GET before, as it - // has - // proper format - Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, - propertyVarNameToDOMMapping); - assignNode = context.importNode(assignNode); - context.getPostPhaseElement().appendChild(assignNode); - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - - // generate BPEL4RESTLight PUT request to update the instance data - try { - Node bpel4restPUTNode = this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, - nodeInstanceURLVarName); - bpel4restPUTNode = context.importNode(bpel4restPUTNode); - context.getPostPhaseElement().appendChild(bpel4restPUTNode); - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - } - - this.appendStateUpdateToPostPhase(context, nodeInstanceURLVarName, stateVarName, lastSetState); - this.appendFailedStateToFaultHandler(context, nodeInstanceURLVarName); - return true; - } - - public boolean handleTerminate(final BPELPlanContext context, AbstractRelationshipTemplate relationshipTemplate) { - final String restCallResponseVarName = createRESTResponseVar(context); - final String stateVarName = createStateVar(context, relationshipTemplate.getId()); - - String relationInstanceURLVarName = context.findInstanceURLVar(relationshipTemplate.getId(), false); - - // we'll use this later when we determine that the handle Node doesn't - // have lifecycle operations. Without this check all nodes without - // lifecycle (or cloud prov operations) will be in an uninstalled state - String lastSetState = "DELETED"; - - final Element provisioningPhaseElement = context.getProvisioningPhaseElement(); - final List assignContentElements = fetchInvokerCallAssigns(provisioningPhaseElement); - - // for each assign element we fetch the operation name, determine the - // pre and post states, and append the pre state before the found assign - // and the post state after the receive of the invoker iteraction - for (final Element assignContentElement : assignContentElements) { - - // fetch operationName from literal contents - final String operationName = fetchOperationName(assignContentElement); - // determine pre and post state for operation - final String preState = InstanceStates.getOperationPreState(operationName); - final String postState = InstanceStates.getOperationPostState(operationName); - - if (preState != null) { - - try { - - // assign prestate to state variable - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignRelationStateFor_" - + operationName + "_" + System.currentTimeMillis(), "string('" + preState + "')", stateVarName); - assignNode = context.importNode(assignNode); - lastSetState = preState; - - // assign the state before the assign of the invoker request - // is made - final Node bpelAssignNode = - assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); - bpelAssignNode.getParentNode().insertBefore(assignNode, bpelAssignNode); - - // create REST Put activity - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(relationInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - - // send the state before the assign of the invoker request - // is made - bpelAssignNode.getParentNode().insertBefore(extActiv, bpelAssignNode); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - if (postState != null) { - try { - // create state assign activity - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = - frag.createAssignXpathQueryToStringVarFragmentAsNode("assignRelationState_" + operationName + "_" - + System.currentTimeMillis(), "string('" + postState + "')", stateVarName); - assignNode = context.importNode(assignNode); - - lastSetState = postState; - - /* - * assign the state after the receiving the response of the - */ - - // fetch assign node - final Node bpelAssignNode = - assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); - - // fetch the variable name which is used as request body - final String reqVarName = fetchRequestVarNameFromInvokerAssign(assignContentElement); - - // from the assign element search for the receive element - // that is witing for the response - final Element invokerReceiveElement = fetchInvokerReceive((Element) bpelAssignNode, reqVarName); - - // insert assign after the receive - assignNode = invokerReceiveElement.getParentNode() - .insertBefore(assignNode, invokerReceiveElement.getNextSibling()); - - // create PUT activity - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(relationInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - - // insert REST call after the assign - invokerReceiveElement.getParentNode().insertBefore(extActiv, assignNode.getNextSibling()); - - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - } - - // needs property update only if the node has properties - if (this.checkProperties(relationshipTemplate.getProperties())) { - // make a GET on the nodeInstance properties - - try { - // fetch properties - Node nodeInstancePropsGETNode = - this.fragments.generateInstancePropertiesGETAsNode(relationInstanceURLVarName, restCallResponseVarName); - nodeInstancePropsGETNode = context.importNode(nodeInstancePropsGETNode); - context.getPostPhaseElement().appendChild(nodeInstancePropsGETNode); - } - catch (final SAXException e1) { - e1.printStackTrace(); - return false; - } - catch (final IOException e1) { - e1.printStackTrace(); - return false; - } - - // assign the values from the property variables into REST/HTTP - // Request - // and send - // first build a mapping from property variable names to dom element - final Map propertyVarNameToDOMMapping = - buildMappingsFromVarNameToDomElement(context, relationshipTemplate); - try { - // then generate an assign to have code that writes the runtime - // values into the instance data db. - // we use the restCallResponseVarName from the GET before, as it - // has - // proper format - Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, - propertyVarNameToDOMMapping); - assignNode = context.importNode(assignNode); - context.getPostPhaseElement().appendChild(assignNode); - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - - // generate BPEL4RESTLight PUT request to update the instance data - try { - Node bpel4restPUTNode = this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, - relationInstanceURLVarName); - bpel4restPUTNode = context.importNode(bpel4restPUTNode); - context.getPostPhaseElement().appendChild(bpel4restPUTNode); - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - } - - this.appendStateUpdateToPostPhase(context, relationInstanceURLVarName, stateVarName, lastSetState); - this.appendFailedStateToFaultHandler(context, relationInstanceURLVarName); - return true; - } - - public boolean handleUpdate(final BPELPlanContext sourceContext, final BPELPlanContext targetContext, - AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate) { - final boolean hasProps = checkProperties(sourceNodeTemplate.getProperties()); - - /* create new node instance */ - final String targetServiceInstanceUrlVar = targetContext.getServiceInstanceURLVarName(); - final String targetServiceInstanceIdVar = targetContext.getServiceInstanceIDVarName(); - final String targetServiceTemplateUrlVar = targetContext.getServiceTemplateURLVar(); - - final String restCallResponseVar = this.createRESTResponseVar(targetContext); - final String stateVar = this.createStateVar(targetContext, targetNodeTemplate.getId()); - - // create instance at API - try { - final String bpelString = - this.fragments.generateBPEL4RESTLightNodeInstancePOST(targetServiceTemplateUrlVar, - targetServiceInstanceIdVar, - targetNodeTemplate.getId(), restCallResponseVar); - Node createNodeInstanceExActiv = ModelUtils.string2dom(bpelString); - createNodeInstanceExActiv = targetContext.importNode(createNodeInstanceExActiv); - targetContext.getPrePhaseElement().appendChild(createNodeInstanceExActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - final String targetNodeInstanceUrlVar = targetContext.findInstanceURLVar(targetNodeTemplate.getId(), true); - final String targetNodeInstanceIdVar = targetContext.findInstanceIDVar(targetNodeTemplate.getId(), true); - final String sourceNodeInstanceURLVarName = sourceContext.findInstanceURLVar(sourceNodeTemplate.getId(), true); - // save data from response in node instance vars - try { - // save nodeInstance url from response - final String bpelString = - this.fragments.generateAssignFromNodeInstancePOSTResponseToStringVar(targetNodeInstanceUrlVar, - targetNodeInstanceIdVar, - restCallResponseVar); - Node assignNodeInstanceUrl = ModelUtils.string2dom(bpelString); - assignNodeInstanceUrl = targetContext.importNode(assignNodeInstanceUrl); - targetContext.getPrePhaseElement().appendChild(assignNodeInstanceUrl); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - /* load properties and state from old instance to new instance */ - if (hasProps) { - this.appendUpdatePropertiesFromSourceToTarget(sourceContext, sourceNodeTemplate, - sourceNodeInstanceURLVarName, targetNodeInstanceUrlVar, - restCallResponseVar, targetContext.getPostPhaseElement()); - } - - this.appendGetStateToPostPhase(targetContext, sourceNodeInstanceURLVarName, stateVar); - this.appendStateUpdateToPostPhase(targetContext, targetNodeInstanceUrlVar, stateVar); - /* set state of old instance to migrated */ - this.appendStateUpdateToPostPhase(sourceContext, sourceNodeInstanceURLVarName, stateVar, "MIGRATED"); - - this.appendFailedStateToFaultHandler(targetContext, targetNodeInstanceUrlVar); - this.appendFailedStateToFaultHandler(sourceContext, sourceNodeInstanceURLVarName); - return true; - } - - /** - * Appends BPEL Code that updates InstanceData for the given NodeTemplate. Needs initialization code - * on the global level in the plan. This will be checked and appended if needed. - * - * @param context the TemplateContext of the NodeTemplate - * @param nodeTemplate the NodeTemplate to handle - * @return true iff appending all BPEL code was successful - */ - public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { - final boolean hasProps = checkProperties(nodeTemplate.getProperties()); - - final String serviceInstanceVarName = context.getServiceInstanceURLVarName(); - if (serviceInstanceVarName == null) { - return false; - } - - final String serviceInstanceIDVarName = context.getServiceInstanceIDVarName(); - if (serviceInstanceIDVarName == null) { - return false; - } - - final String serviceTemplateUrlVarName = context.getServiceTemplateURLVar(); - if (serviceTemplateUrlVarName == null) { - return false; - } - - /* - * Pre Phase code - */ - - // create variable for all responses - final String restCallResponseVarName = createRESTResponseVar(context); - - if (restCallResponseVarName == null) { - return false; - } - - // create state variable inside scope - final String stateVarName = createStateVar(context, context.getNodeTemplate().getId()); - - if (stateVarName == null) { - return false; - } - - /* - * (i) append bpel code to create the nodeInstance (ii) append bpel code to fetch nodeInstanceURL - */ - - try { - // create bpel extension activity and append - final String bpelString = - this.fragments.generateBPEL4RESTLightNodeInstancePOST(serviceTemplateUrlVarName, - serviceInstanceIDVarName, - context.getNodeTemplate().getId(), - restCallResponseVarName); - Node createNodeInstanceExActiv = ModelUtils.string2dom(bpelString); - createNodeInstanceExActiv = context.importNode(createNodeInstanceExActiv); - context.getPrePhaseElement().appendChild(createNodeInstanceExActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - String nodeInstanceURLVarName = ""; - - if (context.findInstanceURLVar(context.getNodeTemplate().getId(), true) == null) { - // generate String var for nodeInstance URL - nodeInstanceURLVarName = createInstanceURLVar(context, context.getNodeTemplate().getId()); - } else { - nodeInstanceURLVarName = context.findInstanceURLVar(context.getNodeTemplate().getId(), true); - } - - if (nodeInstanceURLVarName == null) { - return false; - } - - String nodeInstanceIDVarName = ""; - - if (context.findInstanceIDVar(context.getNodeTemplate().getId(), true) == null) { - nodeInstanceIDVarName = createInstanceIDVar(context, context.getNodeTemplate().getId()); - } else { - nodeInstanceIDVarName = context.findInstanceIDVar(context.getNodeTemplate().getId(), true); - } - - if (nodeInstanceIDVarName == null) { - return false; - } - - try { - // save nodeInstance url from response - final String bpelString = - this.fragments.generateAssignFromNodeInstancePOSTResponseToStringVar(nodeInstanceURLVarName, - nodeInstanceIDVarName, - restCallResponseVarName); - Node assignNodeInstanceUrl = ModelUtils.string2dom(bpelString); - assignNodeInstanceUrl = context.importNode(assignNodeInstanceUrl); - context.getPrePhaseElement().appendChild(assignNodeInstanceUrl); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // we'll use this later when we determine that the handle Node doesn't - // have lifecycle operations. Without this check all nodes without - // lifecycle (or cloud prov operations) will be in an uninstalled state - String lastSetState = "INITIAL"; - - this.appendStateUpdateToPrePhase(context, nodeInstanceURLVarName, stateVarName, lastSetState); - - /* - * Prov Phase code - */ - - // fetch all assigns that assign an invoke async operation request - - final Element provisioningPhaseElement = context.getProvisioningPhaseElement(); - final List assignContentElements = fetchInvokerCallAssigns(provisioningPhaseElement); - - final List operationNames = new ArrayList<>(); - - // for each assign element we fetch the operation name, determine the - // pre and post states, and append the pre state before the found assign - // and the post state after the receive of the invoker iteraction - for (final Element assignContentElement : assignContentElements) { - - // fetch operationName from literal contents - final String operationName = fetchOperationName(assignContentElement); - operationNames.add(operationName); - // determine pre and post state for operation - final String preState = InstanceStates.getOperationPreState(operationName); - final String postState = InstanceStates.getOperationPostState(operationName); - - if (preState != null) { - - try { - - // assign prestate to state variable - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignNodeStateFor_" - + operationName + "_" + System.currentTimeMillis(), "string('" + preState + "')", stateVarName); - assignNode = context.importNode(assignNode); - lastSetState = preState; - - // assign the state before the assign of the invoker request - // is made - final Node bpelAssignNode = - assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); - bpelAssignNode.getParentNode().insertBefore(assignNode, bpelAssignNode); - - // create REST Put activity - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - - // send the state before the assign of the invoker request - // is made - bpelAssignNode.getParentNode().insertBefore(extActiv, bpelAssignNode); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - if (postState != null) { - try { - // create state assign activity - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = - frag.createAssignXpathQueryToStringVarFragmentAsNode("assignNodeState_" + operationName + "_" - + System.currentTimeMillis(), "string('" + postState + "')", stateVarName); - assignNode = context.importNode(assignNode); - - lastSetState = postState; - - /* - * assign the state after the receiving the response of the - */ - - // fetch assign node - final Node bpelAssignNode = - assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); - - // fetch the variable name which is used as request body - final String reqVarName = fetchRequestVarNameFromInvokerAssign(assignContentElement); - - // from the assign element search for the receive element - // that is witing for the response - final Element invokerReceiveElement = fetchInvokerReceive((Element) bpelAssignNode, reqVarName); - - // insertAfterUpdateProperties(context, nodeTemplate, nodeInstanceURLVarName, - // restCallResponseVarName, - // invokerReceiveElement); - - // insert assign after the receive - assignNode = invokerReceiveElement.getParentNode() - .insertBefore(assignNode, invokerReceiveElement.getNextSibling()); - - // create PUT activity - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - - // insert REST call after the assign - final Element afterElement = - (Element) invokerReceiveElement.getParentNode().insertBefore(extActiv, - assignNode.getNextSibling()); - - if (hasProps) { - appendUpdateProperties(context, nodeTemplate, nodeInstanceURLVarName, restCallResponseVarName, - afterElement.getParentNode()); - } - - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - } - - /* - * Post Phase code - */ - - if (lastSetState.equals("INITIAL") || lastSetState.equals("CONFIGURED")) { - try { - // set state - String nextState = InstanceStates.getNextStableOperationState(lastSetState); - // if this node never was handled by lifecycle ops we just set - // it to started - if (operationNames.isEmpty()) { - nextState = "STARTED"; - } - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignFinalNodeState" - + System.currentTimeMillis(), "string('" + nextState + "')", stateVarName); - assignNode = context.importNode(assignNode); - - // create PUT activity - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - - context.getPostPhaseElement().appendChild(assignNode); - context.getPostPhaseElement().appendChild(extActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - // needs property update only if the node has properties - if (hasProps) { - final Element postPhaseElement = context.getPostPhaseElement(); - // make a GET on the nodeInstance properties - appendUpdateProperties(context, nodeTemplate, nodeInstanceURLVarName, restCallResponseVarName, - postPhaseElement); - } - - // add progression log message - appendProgressionUpdateLogMessage(context, nodeTemplate.getId()); - - this.appendFailedStateToFaultHandler(context, nodeInstanceURLVarName); - - return true; - } - - private void appendGetStateToPrePhase(BPELPlanContext context, String nodeInstanceURLVarName, String stateVarName) { - this.appendGetStateToElement(context, nodeInstanceURLVarName, stateVarName, context.getPrePhaseElement()); - } - - private void appendGetStateToPostPhase(BPELPlanContext context, String instanceUrlVar, String stateVarName) { - this.appendGetStateToElement(context, instanceUrlVar, stateVarName, context.getPostPhaseElement()); - } - - private void appendGetStateToElement(BPELPlanContext context, String instanceURLVar, String stateVarName, Element toAppendAsChild) { - try { - - Node getStateNode = - this.fragments.generateBPEL4RESTLightGETInstanceStateAsNode(instanceURLVar, stateVarName); - getStateNode = context.importNode(getStateNode); - toAppendAsChild.appendChild(getStateNode); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - - } - - private void appendFailedStateToFaultHandler(BPELPlanContext context, String nodeInstanceURLVarName) { - String stateVarName = this.createStateVar(context, context.getTemplateId()); - this.appendStateUpdateAsChild(context, nodeInstanceURLVarName, stateVarName, "ERROR", context.getProvisioningFaultHandlerPhaseElement()); - } - - private void appendStateUpdateToPrePhase(BPELPlanContext context, String nodeInstanceURLVarName, - String stateVarName) { - this.appendStateUpdateFromVarToElement(context, nodeInstanceURLVarName, stateVarName, context.getPrePhaseElement()); - } - - private void appendStateUpdateToPostPhase(BPELPlanContext context, String nodeInstanceURLVarName, - String stateVarName) { - this.appendStateUpdateFromVarToElement(context, nodeInstanceURLVarName, stateVarName, context.getPostPhaseElement()); - } - - private void appendStateUpdateFromVarToElement(BPELPlanContext context, String instanceUrlVar, String stateVarName, Element element) { - try { - - // send state to api - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(instanceUrlVar, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - element.appendChild(extActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - - private void appendStateUpdateToPostPhase(BPELPlanContext context, String nodeRelationInstanceURLVarName, - String stateVarName, String stateToSet) { - this.appendStateUpdateAsChild(context, nodeRelationInstanceURLVarName, stateVarName, stateToSet, context.getPostPhaseElement()); - } - - private void appendStateUpdateToPrePhase(BPELPlanContext context, String nodeInstanceURLVarName, - String stateVarName, String stateToSet) { - this.appendStateUpdateAsChild(context, nodeInstanceURLVarName, stateVarName, stateToSet, context.getPrePhaseElement()); - } - - private void appendStateUpdateAsChild(BPELPlanContext context, String nodeRelationInstanceURLVarName, - String stateVarName, String stateToSet, Element parentElement) { - try { - // update state variable to uninstalled - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = - frag.createAssignXpathQueryToStringVarFragmentAsNode("assignSetNodeState" + System.currentTimeMillis(), - "string('" + stateToSet + "')", stateVarName); - assignNode = context.importNode(assignNode); - parentElement.appendChild(assignNode); - - // send state to api - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeRelationInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - parentElement.appendChild(extActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - } - - private void appendProgressionUpdateLogMessage(final BPELPlanContext context, final String templateId) { - - final int topologySize = context.getNodeTemplates().size() + context.getRelationshipTemplates().size(); - - final String message = "Finished with " + templateId + " of overall topology with steps of " + topologySize; - - this.invoker.addLogActivity(context, message, PlanContext.Phase.POST); - } - - public boolean appendUpdatePropertiesFromSourceToTarget(final BPELPlanContext sourceNodeContext, - final AbstractNodeTemplate nodeTemplate, - final String sourceNodeInstanceURLVarName, - final String targetNodeInstanceUrlVarName, - final String restCallResponseVarName, - final Node appendAsChildElement) { - try { - // fetch properties - Node nodeInstancePropsGETNode = - this.fragments.generateInstancePropertiesGETAsNode(sourceNodeInstanceURLVarName, - restCallResponseVarName); - nodeInstancePropsGETNode = sourceNodeContext.importNode(nodeInstancePropsGETNode); - appendAsChildElement.appendChild(nodeInstancePropsGETNode); - } - catch (final SAXException e1) { - e1.printStackTrace(); - return false; - } - catch (final IOException e1) { - e1.printStackTrace(); - return false; - } - - // assign the values from the property variables into REST/HTTP - // Request - // and send - // first build a mapping from property variable names to dom element - final Map propertyVarNameToDOMMapping = - buildMappingsFromVarNameToDomElement(sourceNodeContext, nodeTemplate); - try { - // then generate an assign to have code that writes the runtime - // values into the instance data db. - // we use the restCallResponseVarName from the GET before, as it - // has - // proper format - Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, - propertyVarNameToDOMMapping); - assignNode = sourceNodeContext.importNode(assignNode); - appendAsChildElement.appendChild(assignNode); - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - - // generate BPEL4RESTLight PUT request to update the instance data - try { - Node bpel4restPUTNode = - this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, - targetNodeInstanceUrlVarName); - bpel4restPUTNode = sourceNodeContext.importNode(bpel4restPUTNode); - appendAsChildElement.appendChild(bpel4restPUTNode); - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - return true; - } - - public boolean appendUpdateProperties(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, - final String nodeInstanceURLVarName, final String restCallResponseVarName, - final Node appendAsChildElement) { - try { - // fetch properties - Node nodeInstancePropsGETNode = - this.fragments.generateInstancePropertiesGETAsNode(nodeInstanceURLVarName, restCallResponseVarName); - nodeInstancePropsGETNode = context.importNode(nodeInstancePropsGETNode); - appendAsChildElement.appendChild(nodeInstancePropsGETNode); - } - catch (final SAXException e1) { - e1.printStackTrace(); - return false; - } - catch (final IOException e1) { - e1.printStackTrace(); - return false; - } - - // assign the values from the property variables into REST/HTTP - // Request - // and send - // first build a mapping from property variable names to dom element - final Map propertyVarNameToDOMMapping = - buildMappingsFromVarNameToDomElement(context, nodeTemplate); - try { - // then generate an assign to have code that writes the runtime - // values into the instance data db. - // we use the restCallResponseVarName from the GET before, as it - // has - // proper format - Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, - propertyVarNameToDOMMapping); - assignNode = context.importNode(assignNode); - appendAsChildElement.appendChild(assignNode); - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - - // generate BPEL4RESTLight PUT request to update the instance data - try { - Node bpel4restPUTNode = this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, - nodeInstanceURLVarName); - bpel4restPUTNode = context.importNode(bpel4restPUTNode); - appendAsChildElement.appendChild(bpel4restPUTNode); - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - return true; - } - - public boolean handleUpdate(final BPELPlanContext sourceContext, final BPELPlanContext targetContext, - AbstractRelationshipTemplate sourceRelationshipTemplate, - AbstractRelationshipTemplate targetRelationshipTemplate) { - - final String targetServiceTemplateUrlVarName = targetContext.getServiceTemplateURLVar(); - final String targetServiceInstanceIdVarName = targetContext.getServiceInstanceIDVarName(); - - // create variable for all responses - final String restCallResponseVarName = createRESTResponseVar(sourceContext); - - final String stateVarName = createStateVar(sourceContext, sourceRelationshipTemplate.getId()); - - // find already available instanceIds from the target nodes (source and target of the relation to - // create - final String targetServiceRelationSourceNodeInstanceIdVar = - targetContext.findInstanceIDVar(targetRelationshipTemplate.getSource().getId(), true); - final String targetServiceRelationTargetNodeInstanceIdVar = - targetContext.findInstanceIDVar(targetRelationshipTemplate.getTarget().getId(), true); - - // if it is a connect to relation that we migrate, the node instances are already migrated, - // therefore we can create the new instance in the connect migration scope - // else only the the target of a hosted/depends on relation is already migrated, we have to wait - // until it source is migrated. therefore we add the creation to the scope of the relation source - // (e.g. Raspian-hostedOn->Raspi3 => create code is added to raspbian) - Element injectionPreElement = null; - Element injectionPostElement = null; - if (ModelUtils.getRelationshipTypeHierarchy(targetRelationshipTemplate.getRelationshipType()) - .contains(Types.connectsToRelationType)) { - injectionPreElement = targetContext.getPrePhaseElement(); - injectionPostElement = targetContext.getPostPhaseElement(); - } else { - // fetch nodeTemplate - final AbstractNodeTemplate sourceNodeTemplate = sourceRelationshipTemplate.getSource(); - injectionPreElement = targetContext.createContext(sourceNodeTemplate, ActivityType.MIGRATION).getPostPhaseElement(); - injectionPostElement = targetContext.createContext(sourceNodeTemplate, ActivityType.MIGRATION).getPostPhaseElement(); - } - - // register request message - final String createRelTInstanceReqVarName = "createRelationshipTemplateRequest" + targetContext.getIdForNames(); - - try { - final File opentoscaApiSchemaFile = this.bpelFrags.getOpenTOSCAAPISchemaFile(); - QName createRelationshipTemplateInstanceRequestQName = - this.bpelFrags.getOpenToscaApiCreateRelationshipTemplateInstanceRequestElementQname(); - targetContext.registerType(createRelationshipTemplateInstanceRequestQName, opentoscaApiSchemaFile); - createRelationshipTemplateInstanceRequestQName = - targetContext.importQName(createRelationshipTemplateInstanceRequestQName); - - targetContext.addGlobalVariable(createRelTInstanceReqVarName, BPELPlan.VariableType.ELEMENT, - createRelationshipTemplateInstanceRequestQName); - } - catch (final IOException e3) { - // TODO Auto-generated catch block - e3.printStackTrace(); - } - - // assign nodeInstanceId to req message and create relationInstance - try { - // create bpel extension activity and append - final String bpelString = - this.fragments.generateBPEL4RESTLightRelationInstancePOST(targetServiceTemplateUrlVarName, - targetRelationshipTemplate.getId(), - createRelTInstanceReqVarName, - restCallResponseVarName, - targetServiceRelationSourceNodeInstanceIdVar, - targetServiceRelationTargetNodeInstanceIdVar, targetServiceInstanceIdVarName); - Node createRelationInstanceExActiv = ModelUtils.string2dom(bpelString); - createRelationInstanceExActiv = targetContext.importNode(createRelationInstanceExActiv); - injectionPreElement.appendChild(createRelationInstanceExActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // store relationinstance url - - final String createdRelationInstanceId = - targetContext.findInstanceIDVar(targetRelationshipTemplate.getId(), false); - final String createRelationInstanceUrl = - targetContext.findInstanceURLVar(targetRelationshipTemplate.getId(), false); - final String oldRelationInstanceUrl = - sourceContext.findInstanceURLVar(sourceRelationshipTemplate.getId(), false); - - - - try { - // save relationInstance url from response - final String bpelString = - this.fragments.generateAssignFromRelationInstancePOSTResponseToStringVar(createRelationInstanceUrl, - createdRelationInstanceId, - restCallResponseVarName); - Node assignRelationInstanceUrl = ModelUtils.string2dom(bpelString); - assignRelationInstanceUrl = targetContext.importNode(assignRelationInstanceUrl); - injectionPreElement.appendChild(assignRelationInstanceUrl); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - /* load properties and state from old instance to new instance */ - if (checkProperties(sourceRelationshipTemplate.getProperties())) { - // make a GET on the nodeInstance properties - - try { - // fetch properties - Node nodeInstancePropsGETNode = - this.fragments.generateInstancePropertiesGETAsNode(oldRelationInstanceUrl, restCallResponseVarName); - nodeInstancePropsGETNode = targetContext.importNode(nodeInstancePropsGETNode); - injectionPostElement.appendChild(nodeInstancePropsGETNode); - } - catch (final SAXException e1) { - e1.printStackTrace(); - return false; - } - catch (final IOException e1) { - e1.printStackTrace(); - return false; - } - - // assign the values from the property variables into REST/HTTP - // Request - // and send - // first build a mapping from property variable names to dom element - final Map propertyVarNameToDOMMapping = - buildMappingsFromVarNameToDomElement(sourceContext, sourceRelationshipTemplate); - try { - // then generate an assign to have code that writes the runtime - // values into the instance data db. - // we use the restCallResponseVarName from the GET before, as it - // has - // proper format - Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, - propertyVarNameToDOMMapping); - assignNode = targetContext.importNode(assignNode); - injectionPostElement.appendChild(assignNode); - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - - // generate BPEL4RESTLight PUT request to update the instance data - try { - Node bpel4restPUTNode = - this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, - createRelationInstanceUrl); - bpel4restPUTNode = targetContext.importNode(bpel4restPUTNode); - injectionPostElement.appendChild(bpel4restPUTNode); - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - } - - - - this.appendGetStateToElement(targetContext, oldRelationInstanceUrl, stateVarName, injectionPostElement); - this.appendStateUpdateFromVarToElement(targetContext, createRelationInstanceUrl, stateVarName, injectionPostElement); - - /* set state of old instance to migrated */ - this.appendStateUpdateAsChild(targetContext, oldRelationInstanceUrl, stateVarName, "MIGRATED", injectionPostElement); - - - return true; - } - - public boolean handleCreate(final BPELPlanContext context, - final AbstractRelationshipTemplate relationshipTemplate) { - - final String serviceInstanceVarName = context.getServiceInstanceURLVarName(); - if (serviceInstanceVarName == null) { - return false; - } - - final String serviceTemplateUrlVarName = context.getServiceTemplateURLVar(); - if (serviceTemplateUrlVarName == null) { - return false; - } - - final String serviceInstanceIdVarName = context.getServiceInstanceIDVarName(); - if(serviceInstanceIdVarName == null) { - return false; - } - - /* - * Pre Phase code - */ - - // create variable for all responses - final String restCallResponseVarName = createRESTResponseVar(context); - - if (restCallResponseVarName == null) { - return false; - } - - // create state variable inside scope - final String stateVarName = createStateVar(context, context.getRelationshipTemplate().getId()); - - if (stateVarName == null) { - return false; - } - - // based on the relatioships baseType we add the logic into different - // phases of relations AND nodes - // connectsTo = own phases - // else = source node phasesl - - Element injectionPreElement = null; - Element injectionPostElement = null; - final String sourceInstanceVarName = - context.findInstanceIDVar(context.getRelationshipTemplate().getSource().getId(), true); - final String targetInstanceVarName = - context.findInstanceIDVar(context.getRelationshipTemplate().getTarget().getId(), true); - - if (ModelUtils.getRelationshipTypeHierarchy(context.getRelationshipTemplate().getRelationshipType()) - .contains(Types.connectsToRelationType)) { - injectionPreElement = context.getPrePhaseElement(); - injectionPostElement = context.getPostPhaseElement(); - } else { - // fetch nodeTemplate - final AbstractNodeTemplate sourceNodeTemplate = context.getRelationshipTemplate().getSource(); - LOG.debug("Trying to create provisioning plan context for sourceNodeTemplate {} of relationshipTemplate {}", sourceNodeTemplate.toString(), context.getRelationshipTemplate().toString()); - - // Right now the knowledge of DEFROST and PROVISIONING activities is to hard of an assumption, if you ask me - BPELPlanContext sourceContext = context.createContext(sourceNodeTemplate,ActivityType.PROVISIONING, ActivityType.DEFROST); - if(sourceContext == null) { - LOG.error("Couldn't create context for sourceNodeTemplate {}" , sourceNodeTemplate.toString()); - return false; - } - injectionPreElement = sourceContext.getPostPhaseElement(); - injectionPostElement = sourceContext.getPostPhaseElement(); - } - - if (injectionPostElement == null | injectionPreElement == null | sourceInstanceVarName == null - | targetInstanceVarName == null) { - return false; - } - - /* - * import request message type and create variable - */ - - final String createRelTInstanceReqVarName = "createRelationshipTemplateRequest" + context.getIdForNames(); - - try { - final File opentoscaApiSchemaFile = this.bpelFrags.getOpenTOSCAAPISchemaFile(); - QName createRelationshipTemplateInstanceRequestQName = - this.bpelFrags.getOpenToscaApiCreateRelationshipTemplateInstanceRequestElementQname(); - context.registerType(createRelationshipTemplateInstanceRequestQName, opentoscaApiSchemaFile); - createRelationshipTemplateInstanceRequestQName = - context.importQName(createRelationshipTemplateInstanceRequestQName); - - context.addGlobalVariable(createRelTInstanceReqVarName, BPELPlan.VariableType.ELEMENT, - createRelationshipTemplateInstanceRequestQName); - } - catch (final IOException e3) { - // TODO Auto-generated catch block - e3.printStackTrace(); - } - - /* - * (i) append bpel code to create the relationInstance (ii) append bpel code to fetch - * relationInstanceURL - */ - - try { - // create bpel extension activity and append - final String bpelString = - this.fragments.generateBPEL4RESTLightRelationInstancePOST(serviceTemplateUrlVarName, - context.getRelationshipTemplate().getId(), - createRelTInstanceReqVarName, - restCallResponseVarName, - sourceInstanceVarName, targetInstanceVarName,serviceInstanceIdVarName); - Node createRelationInstanceExActiv = ModelUtils.string2dom(bpelString); - createRelationInstanceExActiv = context.importNode(createRelationInstanceExActiv); - injectionPreElement.appendChild(createRelationInstanceExActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // generate String var for relationInstance URL - String relationInstanceURLVarName = ""; - if (context.findInstanceURLVar(context.getRelationshipTemplate().getId(), false) == null) { - // generate String var for relationInstance URL - relationInstanceURLVarName = createInstanceURLVar(context, context.getRelationshipTemplate().getId()); - } else { - relationInstanceURLVarName = context.findInstanceURLVar(context.getRelationshipTemplate().getId(), false); - } - - if (relationInstanceURLVarName == null) { - return false; - } - - String relationInstanceIDVarName = ""; - - if (context.findInstanceIDVar(context.getRelationshipTemplate().getId(), false) == null) { - // generate String var for nodeInstance URL - relationInstanceIDVarName = createInstanceIDVar(context, context.getRelationshipTemplate().getId()); - } else { - relationInstanceIDVarName = context.findInstanceIDVar(context.getRelationshipTemplate().getId(), false); - } - - if (relationInstanceIDVarName == null) { - return false; - } - - try { - // save relationInstance data from response - final String bpelString = - this.fragments.generateAssignFromRelationInstancePOSTResponseToStringVar(relationInstanceURLVarName, - relationInstanceIDVarName, - restCallResponseVarName); - Node assignRelationInstanceUrl = ModelUtils.string2dom(bpelString); - assignRelationInstanceUrl = context.importNode(assignRelationInstanceUrl); - injectionPreElement.appendChild(assignRelationInstanceUrl); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // we'll use this later when we determine that the handle Node doesn't - // have lifecycle operations. Without this check all nodes without - // lifecycle (or cloud prov operations) will be in an uninstalled state - final String lastSetState = "INITIAL"; - - try { - // update state variable to uninstalled - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignInitRelationState" - + System.currentTimeMillis(), "string('" + lastSetState + "')", stateVarName); - assignNode = context.importNode(assignNode); - injectionPreElement.appendChild(assignNode); - - // send state to api - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(relationInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - injectionPreElement.appendChild(extActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - - try { - // set state - final BPELProcessFragments frag = new BPELProcessFragments(); - Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode( - "assignFinalNodeState" - + System.currentTimeMillis(), - "string('CREATED')", stateVarName); - assignNode = context.importNode(assignNode); - - // create PUT activity - final String bpelString = - this.fragments.generateBPEL4RESTLightPUTInstanceState(relationInstanceURLVarName, stateVarName); - Node extActiv = ModelUtils.string2dom(bpelString); - extActiv = context.importNode(extActiv); - - injectionPostElement.appendChild(assignNode); - injectionPostElement.appendChild(extActiv); - } - catch (final IOException e2) { - e2.printStackTrace(); - } - catch (final SAXException e) { - e.printStackTrace(); - } - catch (final ParserConfigurationException e) { - e.printStackTrace(); - } - - // needs property update only if the relation has properties - if (checkProperties(relationshipTemplate.getProperties())) { - // make a GET on the nodeInstance properties - - try { - // fetch properties - Node nodeInstancePropsGETNode = - this.fragments.generateInstancePropertiesGETAsNode(relationInstanceURLVarName, - restCallResponseVarName); - nodeInstancePropsGETNode = context.importNode(nodeInstancePropsGETNode); - injectionPostElement.appendChild(nodeInstancePropsGETNode); - } - catch (final SAXException e1) { - e1.printStackTrace(); - return false; - } - catch (final IOException e1) { - e1.printStackTrace(); - return false; - } - - // assign the values from the property variables into REST/HTTP - // Request - // and send - // first build a mapping from property variable names to dom element - final Map propertyVarNameToDOMMapping = - buildMappingsFromVarNameToDomElement(context, relationshipTemplate); - try { - // then generate an assign to have code that writes the runtime - // values into the instance data db. - // we use the restCallResponseVarName from the GET before, as it - // has - // proper format - Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, - propertyVarNameToDOMMapping); - assignNode = context.importNode(assignNode); - injectionPostElement.appendChild(assignNode); - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - - // generate BPEL4RESTLight PUT request to update the instance data - try { - Node bpel4restPUTNode = - this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, - relationInstanceURLVarName); - bpel4restPUTNode = context.importNode(bpel4restPUTNode); - injectionPostElement.appendChild(bpel4restPUTNode); - } - catch (final IOException e) { - e.printStackTrace(); - return false; - } - catch (final SAXException e) { - e.printStackTrace(); - return false; - } - } - - appendProgressionUpdateLogMessage(context, relationshipTemplate.getId()); - - return true; - } - - private Element fetchInvokerReceive(final Element invokerAssign, final String requestVarName) { - - Node sibling = invokerAssign.getNextSibling(); - - while (sibling != null & !sibling.getNodeName().contains("invoke")) { - sibling = sibling.getNextSibling(); - } - - if (sibling.getNodeType() == Node.ELEMENT_NODE - & sibling.getAttributes().getNamedItem("inputVariable").getTextContent().equals(requestVarName)) { - return (Element) sibling.getNextSibling(); - } - - return null; - } - - private String fetchRequestVarNameFromInvokerAssign(final Element assignContentElement) { - String reqVarName = null; - - final Node fromNode = fetchFromNode(assignContentElement); - - final Node toNode = fetchNextNamedNodeRecursively(fromNode, "to"); - - reqVarName = toNode.getAttributes().getNamedItem("variable").getTextContent(); - - return reqVarName; - } - - private Node fetchNextNamedNodeRecursively(final Node node, final String name) { - Node sibling = node.getNextSibling(); - - while (sibling != null & !sibling.getNodeName().contains(name)) { - sibling = sibling.getNextSibling(); - } - - return sibling; - } - - private Node fetchFromNode(final Element assignContentElement) { - Node parent = assignContentElement.getParentNode(); - - while (parent != null & !parent.getNodeName().contains("from")) { - parent = parent.getParentNode(); - } - - return parent; - } - - private String fetchOperationName(final Element assignElement) { - final XPath xpath = this.xPathfactory.newXPath(); - String operationName = null; - - try { - - operationName = (String) xpath.evaluate(".//*[local-name()='OperationName']/node()", assignElement, - XPathConstants.STRING); - } - catch (final XPathExpressionException e) { - e.printStackTrace(); - } - - return operationName; - } - - private List fetchInvokerCallAssigns(final Element provisioningPhaseElement) { - final XPath xpath = this.xPathfactory.newXPath(); - final List assignElements = new ArrayList<>(); - final String xpathQuery = ".//*[local-name()='invokeOperationAsync']"; - try { - final NodeList nodeList = - (NodeList) xpath.evaluate(xpathQuery, provisioningPhaseElement, XPathConstants.NODESET); - - for (int i = 0; i < nodeList.getLength(); i++) { - if (nodeList.item(i).getNodeType() == Node.ELEMENT_NODE) { - assignElements.add((Element) nodeList.item(i)); - } - } - - } - catch (final XPathExpressionException e) { - e.printStackTrace(); - } - - return assignElements; - } - - /** - *

    - * This method is initializing a Map from BpelVariableName to a DomElement of the given Properties - * and Context. - *

    - * - * @param context BPELPlanContext - * @param properties AbstractProperties with proper DOM Element - * @return a Map of BpelVariableName to DOM Node. Maybe null if the mapping is not - * complete, e.g. some bpel variable was not found or the properties weren't parsed right. - */ - private Map buildMappingsFromVarNameToDomElement(final PlanContext context, - AbstractNodeTemplate nodeTemplate) { - final Element propRootElement = nodeTemplate.getProperties().getDOMElement(); - - final Map mapping = new HashMap<>(); - - // get list of child elements - final NodeList childList = propRootElement.getChildNodes(); - - for (int i = 0; i < childList.getLength(); i++) { - final Node child = childList.item(i); - if (child.getNodeType() == Node.ELEMENT_NODE) { - final String propertyName = child.getLocalName(); - final String propVarName = context.getVariableNameOfProperty(nodeTemplate, propertyName); - if(propVarName != null) { - mapping.put(propVarName, child); - } - } - - } - return mapping; - } - - private Map buildMappingsFromVarNameToDomElement(final PlanContext context, - AbstractRelationshipTemplate relationshipTemplate) { - final Element propRootElement = relationshipTemplate.getProperties().getDOMElement(); - - final Map mapping = new HashMap<>(); - - // get list of child elements - final NodeList childList = propRootElement.getChildNodes(); - - for (int i = 0; i < childList.getLength(); i++) { - final Node child = childList.item(i); - if (child.getNodeType() == Node.ELEMENT_NODE) { - final String propertyName = child.getLocalName(); - final String propVarName = context.getVariableNameOfProperty(relationshipTemplate, propertyName); - mapping.put(propVarName, child); - } - - } - return mapping; - } - - /** - *

    - * Checks the given AbstractProperties against following criteria: Nullpointer-Check for properties - * itself and its given DOM Element, followed by whether the dom element has any child elements (if - * not, we have no properties/bpel-variables defined) - *

    - * - * @param properties AbstractProperties of an AbstractNodeTemplate or AbstractRelationshipTemplate - * @return true iff properties and properties.getDomElement() != null and DomElement.hasChildNodes() - * == true - */ - private boolean checkProperties(final AbstractProperties properties) { - if (properties == null) { - return false; - } - - if (properties.getDOMElement() == null) { - return false; - } - - final Element propertiesRootElement = properties.getDOMElement(); - - if (!propertiesRootElement.hasChildNodes()) { - return false; - } - - return true; - } - - public boolean handlePasswordCheck(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { - - // find properties which store passwords - // find their variables - final Collection pwVariables = new ArrayList<>(); - final Collection nodePropertyVariables = context.getPropertyVariables(nodeTemplate); - - for (final Variable var : nodePropertyVariables) { - if (var.getVariableName().contains("Password")) { - pwVariables.add(var); - } - } - - // find runScript method - - final AbstractNodeTemplate node = findRunScriptNode(nodeTemplate); - - if (node == null) { - return false; - } - - final Map inputParams = new HashMap<>(); - - final String cmdStringName = "checkPasswordScript_" + nodeTemplate.getId() + "_" + System.currentTimeMillis(); - final String cmdStringVal = createPlaceHolderPwCheckCmdString(pwVariables); - final Variable cmdVar = context.createGlobalStringVariable(cmdStringName, cmdStringVal); - - final String xPathReplacementCmd = createPlaceholderReplaceingXPath(cmdVar.getVariableName(), pwVariables); - - try { - Node assignPlaceholder = - this.bpelFrags.createAssignXpathQueryToStringVarFragmentAsNode("replacePlaceholdersOfPWCheck" - + System.currentTimeMillis(), xPathReplacementCmd, cmdVar.getVariableName()); - assignPlaceholder = context.importNode(assignPlaceholder); - context.getPrePhaseElement().appendChild(assignPlaceholder); - } - catch (final IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - inputParams.put(new AbstractParameter() { - - @Override - public boolean isRequired() { - // TODO Auto-generated method stub - return false; - } - - @Override - public String getType() { - // TODO Auto-generated method stub - return "xs:String"; - } - - @Override - public String getName() { - // TODO Auto-generated method stub - return "Script"; - } - }, cmdVar); - - final Map outputParams = new HashMap<>(); - - final String outputVarName = "pwCheckResult" + System.currentTimeMillis(); - - final Variable outputVar = context.createGlobalStringVariable(outputVarName, ""); - - outputParams.put(new AbstractParameter() { - - @Override - public boolean isRequired() { - // TODO Auto-generated method stub - return false; - } - - @Override - public String getType() { - // TODO Auto-generated method stub - return "xs:String"; - } - - @Override - public String getName() { - // TODO Auto-generated method stub - return "ScriptResult"; - } - }, outputVar); - - // generate call to method - context.executeOperation(node, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT, inputParams, - outputParams, BPELScopePhaseType.PRE, context.getPrePhaseElement()); - - // check result and eventually throw error - - Node ifTrueThrowError = - this.bpelFrags.createIfTrueThrowsError("contains($" + outputVar.getVariableName() + ",'false')", - new QName("http://opentosca.org/plans/faults", "PasswordWeak")); - ifTrueThrowError = context.importNode(ifTrueThrowError); - context.getPrePhaseElement().appendChild(ifTrueThrowError); - - return true; - } - - private String createPlaceholderReplaceingXPath(final String cmdStringName, - final Collection pwVariables) { - String xpath = "$" + cmdStringName + ","; - - for (final Variable var : pwVariables) { - xpath = "replace(" + xpath; - xpath += "'" + var.getVariableName() + "'," + "$" + var.getVariableName() + ")"; - } - - return xpath; - } - - private String createPlaceHolderPwCheckCmdString(final Collection pwVariables) { - /* - * if echo "$candidate_password" | grep -Eq "$strong_pw_regex"; then echo strong else echo weak fi - */ - String cmdString = ""; - - for (final Variable var : pwVariables) { - cmdString += "if echo \"" + var.getVariableName() - + "\" | grep -Eq \"(?=^.{8,255}$)((?=.*\\d)(?!.*\\s)(?=.*[A-Z])(?=.*[a-z]))^.*\"; then : else echo \"false\" fi;"; - } - - return cmdString; - } - - protected AbstractNodeTemplate findRunScriptNode(final AbstractNodeTemplate nodeTemplate) { - final List infraNodes = new ArrayList<>(); - - ModelUtils.getInfrastructureNodes(nodeTemplate, infraNodes); - - for (final AbstractNodeTemplate node : infraNodes) { - for (final AbstractInterface iface : node.getType().getInterfaces()) { - if (iface.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM) - | iface.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER)) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT) - | op.getName() - .equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_RUNSCRIPT)) { - return node; - } - } - } - } - } - return null; - } -} diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/InstanceStates.java b/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/InstanceStates.java deleted file mode 100644 index 4d71cb7f1..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/InstanceStates.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.opentosca.planbuilder.postphase.plugin.instancedata.bpel; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - */ -public class InstanceStates { - - private static Map operationPreStates; - private static Map operationPostStates; - - static { - operationPreStates = new HashMap<>(); - operationPostStates = new HashMap<>(); - - /* - * INITIAL, CREATING, CREATED, CONFIGURING, CONFIGURED, STARTING, STARTED, STOPPING, STOPPED, - * DELETING, DELETED, ERROR - */ - // left side = operation name - // right side = pre/post state of operation - - // lifecycle - operationPreStates.put("install", "CREATING"); - operationPreStates.put("uninstall", "DELETING"); - operationPreStates.put("configure", "CONFIGURING"); - operationPreStates.put("start", "STARTING"); - operationPreStates.put("stop", "STOPPING"); - - operationPostStates.put("install", "CREATED"); - operationPostStates.put("uninstall", "DELETED"); - operationPostStates.put("configure", "CONFIGURED"); - operationPostStates.put("start", "STARTED"); - operationPostStates.put("stop", "STOPPED"); - - // VM's - operationPreStates.put("createVM", "STARTING"); - operationPreStates.put("waitForAvailability", "STARTING"); - - operationPostStates.put("createVM", "CONFIGURED"); - operationPostStates.put("waitForAvailability", "STARTED"); - - // Docker - operationPreStates.put("startContainer", "STARTING"); - operationPostStates.put("startContainer", "STARTED"); - - operationPreStates.put("removeContainer", "DELETING"); - operationPostStates.put("removeContainer", "DELETED"); - } - - public static String getOperationPreState(final String operationName) { - return operationPreStates.get(operationName); - } - - public static String getOperationPostState(final String operationName) { - return operationPostStates.get(operationName); - } - - public static boolean isStableOperationState(final String state) { - return operationPostStates.containsValue(state); - } - - /** - * Returns the next stable state for the given state. A stable state means that the node isn't in a - * state of modification such as installing, starting, pending, etc.. - * - * The next stable state of e.g., uninstalled would be installed, for installing it would be - * installed, configuring would be configured, etc. - * - * @param state a String containing a lifecycle state - * @return a String containing the next stable state from the given state - */ - public static String getNextStableOperationState(final String state) { - - if (operationPreStates.containsValue(state)) { - /* - * INITIAL, CREATING, CREATED, CONFIGURING, CONFIGURED, STARTING, STARTED, STOPPING, STOPPED, - * DELETING, DELETED, ERROR - */ - // given state is unstable - switch (state) { - case "CREATING": - return "CREATED"; - case "DELETING": - return "DELETED"; - case "CONFIGURING": - return "CONFIGURED"; - case "STARTING": - return "STARTED"; - case "STOPPING": - return "STOPPED"; - case "PENDING": - return "STARTED"; - } - } else if (operationPostStates.containsValue(state)) { - // given state is stable - switch (state) { - case "INITIAL": - return "CREATED"; - case "CREATED": - return "CONFIGURED"; - case "CONFIGURED": - return "STARTED"; - case "STARTED": - return "STARTED"; - case "STOPPED": - return "STOPPED"; - } - } - - return null; - } - -} diff --git a/org.opentosca.planbuilder.postphase.plugin.monitoring/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.postphase.plugin.monitoring/META-INF/MANIFEST.MF deleted file mode 100644 index d22da443d..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.monitoring/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Monitoring Post Phase Plugin -Bundle-SymbolicName: org.opentosca.planbuilder.postphase.plugin.monitoring -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.container.core.tosca.convention, - org.opentosca.planbuilder.provphase.plugin.invoker.bpel, - org.osgi.framework;version="1.3.0" -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.planbuilder;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.postphase.plugin.monitoring.Activator diff --git a/org.opentosca.planbuilder.postphase.plugin.monitoring/build.properties b/org.opentosca.planbuilder.postphase.plugin.monitoring/build.properties deleted file mode 100644 index 01e33e777..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.monitoring/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ diff --git a/org.opentosca.planbuilder.postphase.plugin.monitoring/pom.xml b/org.opentosca.planbuilder.postphase.plugin.monitoring/pom.xml deleted file mode 100644 index f27efde2f..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.monitoring/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.postphase.plugin.monitoring - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.postphase.plugin.monitoring/src/org/opentosca/planbuilder/postphase/plugin/monitoring/Activator.java b/org.opentosca.planbuilder.postphase.plugin.monitoring/src/org/opentosca/planbuilder/postphase/plugin/monitoring/Activator.java deleted file mode 100644 index 5d269b783..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.monitoring/src/org/opentosca/planbuilder/postphase/plugin/monitoring/Activator.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.opentosca.planbuilder.postphase.plugin.monitoring; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.opentosca.planbuilder.postphase.plugin.monitoring.bpel.impl.BPELMonitoringPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -public class Activator implements BundleActivator { - - private static BundleContext context; - private ServiceRegistration registration; - private BPELMonitoringPlugin plugin = null; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.plugin = new BPELMonitoringPlugin(); - this.registration = - Activator.context.registerService(IPlanBuilderPostPhasePlugin.class.getName(), this.plugin, null); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/MANIFEST.MF deleted file mode 100644 index a5ee91314..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Instancedata Plugins -Bundle-SymbolicName: org.opentosca.planbuilder.postphase.plugin.situations -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.container.core.tosca.convention, - org.opentosca.planbuilder.provphase.plugin.invoker.bpel, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.10" -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.planbuilder;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.postphase.plugin.situations.Activator diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightDELETE.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightDELETE.xml deleted file mode 100644 index 03e5257e5..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightDELETE.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET.xml deleted file mode 100644 index fc8c9911f..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_Instance_Properties.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_Instance_Properties.xml deleted file mode 100644 index 7357a5d2f..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_Instance_Properties.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml deleted file mode 100644 index 5ee127e65..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml deleted file mode 100644 index 32924b7fe..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml deleted file mode 100644 index 4a253c65b..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml deleted file mode 100644 index edcd68918..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml deleted file mode 100644 index 8c0fa50d8..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml deleted file mode 100644 index 6dd1ba392..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml deleted file mode 100644 index e79d57cd4..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml deleted file mode 100644 index 9f519f0d4..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml deleted file mode 100644 index 58c7fa5b5..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromInputToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromInputToStringVar.xml deleted file mode 100644 index d7f9682db..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromInputToStringVar.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml deleted file mode 100644 index f664f09e1..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml deleted file mode 100644 index bcdef85f5..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml deleted file mode 100644 index 7060c37cd..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelAssignServiceInstancePOSTResponse.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml b/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml deleted file mode 100644 index 0a6925c14..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/META-INF/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/build.properties b/org.opentosca.planbuilder.postphase.plugin.situations/build.properties deleted file mode 100644 index 01e33e777..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/pom.xml b/org.opentosca.planbuilder.postphase.plugin.situations/pom.xml deleted file mode 100644 index ecf1ec563..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.postphase.plugin.situations - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/Activator.java b/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/Activator.java deleted file mode 100644 index 174e0de90..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/Activator.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.opentosca.planbuilder.postphase.plugin.situations; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.opentosca.planbuilder.postphase.plugin.situations.bpel.BPELSituationPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -public class Activator implements BundleActivator { - - private static BundleContext context; - private ServiceRegistration registration; - private BPELSituationPlugin plugin = null; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.plugin = new BPELSituationPlugin(); - this.registration = - Activator.context.registerService(IPlanBuilderPostPhasePlugin.class.getName(), this.plugin, null); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/Fragments.java b/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/Fragments.java deleted file mode 100644 index d107f4dee..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/Fragments.java +++ /dev/null @@ -1,551 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.postphase.plugin.situations.bpel; - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.net.URL; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; -import org.osgi.framework.FrameworkUtil; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - *

    - * This class contains all the BPEL Fragments - *

    - * Copyright 2014 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Fragments { - - private final DocumentBuilderFactory docFactory; - private final DocumentBuilder docBuilder; - - - /** - * Constructor - * - * @throws ParserConfigurationException is thrown when initializing the internal DocumentBuild fails - */ - public Fragments() throws ParserConfigurationException { - this.docFactory = DocumentBuilderFactory.newInstance(); - this.docFactory.setNamespaceAware(true); - this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } - - /** - * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. - * - * @param bpelVarName the variable containing an URL - * @param responseVarName the variable to hold the response - * @return a String containing a BPEL4RESTLight Activity - * @throws IOException is thrown when reading internal files fails - */ - public String createRESTDeleteOnURLBPELVarAsString(final String bpelVarName, - final String responseVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightDELETE.xml"); - // - - final File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath()); - - String template = FileUtils.readFileToString(bpelFragmentFile); - template = template.replace("$urlVarName", bpelVarName); - template = template.replace("$ResponseVarName", responseVarName); - - return template; - } - - /** - * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. - * - * @param bpelVarName the variable containing an URL - * @param responseVarName the variable to hold the response - * @return a String containing a BPEL4RESTLight Activity - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node createRESTDeleteOnURLBPELVarAsNode(final String bpelVarName, - final String responseVarName) throws IOException, SAXException { - final String templateString = createRESTDeleteOnURLBPELVarAsString(bpelVarName, responseVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a BPEL4RESTLight extension activity that sets the instance state of the given - * nodeInstance with the contents of the given string variable - * - * @param instanceURLVar the variable holding the url to the node instance - * @param RequestVarName the variable to take the request body contents from - * @return a String containing a single BPEL extension activity - * @throws IOException is thrown when reading a internal file fails - */ - public String generateBPEL4RESTLightPUTInstanceState(final String instanceURLVar, - final String RequestVarName) throws IOException { - // BPEL4RESTLightPUT_NodeInstance_State_InstanceDataAPI.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4restString = FileUtils.readFileToString(bpel4RestFile); - - bpel4restString = bpel4restString.replace("$instanceURLVar", instanceURLVar); - bpel4restString = bpel4restString.replace("$RequestVarName", RequestVarName); - - return bpel4restString; - } - - public String generateBPEL4RESTLightGETInstanceState(final String instanceURLVar, - final String ResponseVarName) throws IOException { - // BPEL4RESTLightPUT_NodeInstance_State_InstanceDataAPI.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4restString = FileUtils.readFileToString(bpel4RestFile); - - bpel4restString = bpel4restString.replace("$instanceURLVar", instanceURLVar); - bpel4restString = bpel4restString.replace("$ResponseVarName", ResponseVarName); - - return bpel4restString; - } - - public Node generateBPEL4RESTLightGETInstanceStateAsNode(final String instanceURLVar, - final String ResponseVarName) throws SAXException, IOException { - return this.toDom(this.generateBPEL4RESTLightGETInstanceState(instanceURLVar, ResponseVarName)); - } - - private Node toDom(String templateString) throws SAXException, IOException { - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a String containing a BPEL assign that reads the value of a NodeInstance create - * response and writes it into the referenced string variable - * - * @param nodeInstanceURLVarName the string variable to write the data into - * @param nodeInstancePOSTResponseVarName the response variable of a nodeInstance create POST - * @return a String containing a BPEL assign - * @throws IOException is thrown when reading a internal file fails - */ - public String generateAssignFromNodeInstancePOSTResponseToStringVar(final String nodeInstanceURLVarName, - final String nodeInstanceIDVarName, - final String nodeInstancePOSTResponseVarName) throws IOException { - // BPELAssignFromNodeInstancePOSTResponseToStringVar.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPELAssignFromNodeInstancePOSTResponseToStringVar.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpel4RestFile); - - bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", nodeInstanceURLVarName); - bpelAssignString = - bpelAssignString.replaceAll("\\$NodeInstanceResponseVarName", nodeInstancePOSTResponseVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$nodeInstanceIDVar", nodeInstanceIDVarName); - - return bpelAssignString; - } - - /** - * Generates a String containing a BPEL assign that reads the value of a RelationInstance create - * response and writes it into the referenced string variable - * - * @param stringVarName the string variable to write the data into - * @param relationInstancePOSTResponseVarName the response variable of a relationInstance create - * POST - * @return a String containing a BPEL assign - * @throws IOException is thrown when reading a internal file fails - */ - public String generateAssignFromRelationInstancePOSTResponseToStringVar(final String stringVarName, - final String relationInstanceIDVar, - final String relationInstancePOSTResponseVarName) throws IOException { - // BPELAssignFromNodeInstancePOSTResponseToStringVar.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPELAssignFromRelationInstancePOSTResponseToStringVar.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpel4RestFile); - - bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", stringVarName); - bpelAssignString = - bpelAssignString.replaceAll("\\$RelationInstanceResponseVarName", relationInstancePOSTResponseVarName); - bpelAssignString = bpelAssignString.replaceAll("\\$relationInstanceIDVar", relationInstanceIDVar); - - return bpelAssignString; - } - - /** - * Generates a String containing a BPEL4RESTLight extension activity which create a nodeTemplate - * instance on the given serviceTemplate instance - * - * @param serviceInstanceURLVar the variable holding the serviceInstanceUrl - * @param nodeTemplateId the id of the nodeTemplate to instantiate - * @param responseVariableName the variable to store the response into - * @return a String containing a BPEL extension activity - * @throws IOException is thrown when reading the internal file fails - */ - public String generateBPEL4RESTLightNodeInstancePOST(final String serviceInstanceURLVar, - final String serviceInstanceIDVarName, - final String nodeTemplateId, - final String responseVariableName) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4RestString = FileUtils.readFileToString(bpel4RestFile); - - bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceURLVar", serviceInstanceURLVar); - bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceIDVar", serviceInstanceIDVarName); - bpel4RestString = bpel4RestString.replaceAll("\\$nodeTemplateId", nodeTemplateId); - bpel4RestString = bpel4RestString.replaceAll("\\$ResponseVarName", responseVariableName); - - return bpel4RestString; - } - - /** - * Generates a String containing a BPEL4RESTLight extension activity which creates a Relationship - * Template instance on the given Service Template instance - * - * @param serviceInstanceURLVar the variable holding the serviceInstanceUrl - * @param relationshipTemplateId the id of the Relationship Template to instantiate - * @param responseVariableName the variable to store the response into - * @param sourceInstanceIdVarName the variable name of the instance Id of the source node instance - * of the relation to be created - * @param targetInstanceIdVarName the variable name of the instance Id of the target node instance - * of the relation to be created - * @return a String containing a BPEL extension activity - * @throws IOException is thrown when reading the internal file fails - */ - public String generateBPEL4RESTLightRelationInstancePOST(final String serviceInstanceURLVar, - final String relationshipTemplateId, - final String requestVariableName, - final String responseVariableName, - final String sourceInstanceIdVarName, - final String targetInstanceIdVarName, - final String serviceInstanceIdVarName) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4RestString = FileUtils.readFileToString(bpel4RestFile); - - bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceURLVar", serviceInstanceURLVar); - bpel4RestString = bpel4RestString.replaceAll("\\$relationshipTemplateId", relationshipTemplateId); - bpel4RestString = bpel4RestString.replaceAll("\\$RequestVarName", requestVariableName); - bpel4RestString = bpel4RestString.replaceAll("\\$ResponseVarName", responseVariableName); - bpel4RestString = bpel4RestString.replaceAll("\\$sourceInstanceIdVarName", sourceInstanceIdVarName); - bpel4RestString = bpel4RestString.replaceAll("\\$targetInstanceIdVarName", targetInstanceIdVarName); - bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceIdVarName", serviceInstanceIdVarName); - - return bpel4RestString; - } - - public String generateBPEL4RESTLightServiceInstancePOST(final String instanceDataAPIUrlVariableName, - final String csarId, final QName serviceTemplateId, - final String responseVariableName) throws IOException { - // tags in xml snippet: $InstanceDataURLVar, $CSARName, - // $serviceTemplateId, $ResponseVarName - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml"); - final File bpel4RestFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4RestString = FileUtils.readFileToString(bpel4RestFile); - - bpel4RestString = bpel4RestString.replace("$InstanceDataURLVar", instanceDataAPIUrlVariableName); - bpel4RestString = bpel4RestString.replace("$CSARName", csarId); - bpel4RestString = bpel4RestString.replace("$serviceTemplateId", serviceTemplateId.toString()); - bpel4RestString = bpel4RestString.replace("$ResponseVarName", responseVariableName); - - return bpel4RestString; - } - - public Node generateBPEL4RESTLightServiceInstancePOSTAsNode(final String instanceDataAPIUrlVariableName, - final String csarId, final QName serviceTemplateId, - final String responseVariableName) throws IOException, - SAXException { - final String templateString = - generateBPEL4RESTLightServiceInstancePOST(instanceDataAPIUrlVariableName, csarId, serviceTemplateId, - responseVariableName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateServiceInstanceURLVarAssign(final String serviceInstanceResponseVarName, - final String serviceInstanceURLVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelAssignServiceInstancePOSTResponse.xml"); - final File bpelAssigntFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssigntFile); - // - - bpelAssignString = - bpelAssignString.replace("$assignName", "assignServiceInstance" + System.currentTimeMillis()); - bpelAssignString = bpelAssignString.replace("$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); - bpelAssignString = bpelAssignString.replace("$ServiceInstanceURLVarName", serviceInstanceURLVarName); - return bpelAssignString; - } - - public Node generateServiceInstanceURLVarAssignAsNode(final String serviceInstanceResponseVarName, - final String serviceInstanceURLVarName) throws IOException, - SAXException { - final String templateString = - generateServiceInstanceURLVarAssign(serviceInstanceResponseVarName, serviceInstanceURLVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public Node generateNodeInstancesQueryGETasNode(final String instanceDataUrlVarName, final String responseVarName, - final QName nodeType) throws IOException, SAXException { - final String templateString = - generateNodeInstancePropertiesGET(instanceDataUrlVarName, responseVarName, nodeType); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateInstancePropertiesGET(final String instanceUrlVarName, - final String bpel4RestLightResponseVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightGET_Instance_Properties.xml"); - final File bpel4restLightGETFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4restLightGETString = FileUtils.readFileToString(bpel4restLightGETFile); - // - bpel4restLightGETString = bpel4restLightGETString.replace("$urlVarName", instanceUrlVarName); - bpel4restLightGETString = bpel4restLightGETString.replace("$ResponseVarName", bpel4RestLightResponseVarName); - return bpel4restLightGETString; - } - - public Node generateInstancePropertiesGETAsNode(final String instanceUrlVarName, - final String bpel4RestLightResponseVarName) throws SAXException, - IOException { - final String templateString = generateInstancePropertiesGET(instanceUrlVarName, bpel4RestLightResponseVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateAssignFromNodeInstanceResonseToStringVar(final String stringVarName, - final String nodeInstanceResponseVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelAssignFromNodeInstanceRequestToStringVar.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - // - bpelAssignString = bpelAssignString.replace("$stringVarName", stringVarName); - bpelAssignString = bpelAssignString.replace("$NodeInstanceResponseVarName", nodeInstanceResponseVarName); - return bpelAssignString; - } - - public Node generateAssignFromNodeInstanceResponseToStringVarAsNode(final String stringVarName, - final String nodeInstanceResponseVarName) throws IOException, - SAXException { - final String templateString = - generateAssignFromNodeInstanceResonseToStringVar(stringVarName, nodeInstanceResponseVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateNodeInstancePropertiesGET(final String instanceDataUrlVarName, final String responseVarName, - final QName nodeType) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - - // $InstanceDataURLVar, $ResponseVarName, $nodeType - - bpelAssignString = bpelAssignString.replace("$InstanceDataURLVar", instanceDataUrlVarName); - bpelAssignString = bpelAssignString.replace("$ResponseVarName", responseVarName); - bpelAssignString = bpelAssignString.replace("$nodeType", nodeType.toString()); - return bpelAssignString; - } - - public String generateServiceInstanceRequestToStringVarAssign(final String stringVarName, - final String serviceInstanceResponseVarName, - final int nodeInstanceIndex) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelAssignFromServiceInstanceRequestToStringVar.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - - bpelAssignString = bpelAssignString.replace("$stringVarName", stringVarName); - bpelAssignString = bpelAssignString.replace("$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); - bpelAssignString = bpelAssignString.replace("$nodeInstanceIndex", String.valueOf(nodeInstanceIndex)); - - return bpelAssignString; - } - - public Node generateServiceInstanceRequestToStringVarAssignAsNode(final String stringVarName, - final String serviceInstanceResponseVarName, - final int nodeInstanceIndex) throws IOException, - SAXException { - final String templateString = - generateServiceInstanceRequestToStringVarAssign(stringVarName, serviceInstanceResponseVarName, - nodeInstanceIndex); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateBPEL4RESTLightGET(final String urlVarName, final String responseVarName) throws IOException { - // BPEL4RESTLightGET_ServiceInstance_InstanceDataAPI.xml - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightGET.xml"); - final File bpelServiceInstanceGETFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelServiceInstanceGETString = FileUtils.readFileToString(bpelServiceInstanceGETFile); - - bpelServiceInstanceGETString = bpelServiceInstanceGETString.replace("$urlVarName", urlVarName); - bpelServiceInstanceGETString = bpelServiceInstanceGETString.replace("$ResponseVarName", responseVarName); - return bpelServiceInstanceGETString; - } - - public Node generateBPEL4RESTLightGETAsNode(final String serviceInstanceUrlVarName, - final String responseVarName) throws IOException, SAXException { - final String templateString = generateBPEL4RESTLightGET(serviceInstanceUrlVarName, responseVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateAssignFromInputMessageToStringVariable(final String inputMessageElementLocalName, - final String stringVariableName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelAssignFromInputToStringVar.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - // - bpelAssignString = bpelAssignString.replace("$inputElementLocalName", inputMessageElementLocalName); - bpelAssignString = bpelAssignString.replace("$StringVariableName", stringVariableName); - bpelAssignString = - bpelAssignString.replace("$assignName", "assignFromInputToString" + System.currentTimeMillis()); - return bpelAssignString; - } - - public Node generateAssignFromInputMessageToStringVariableAsNode(final String inputMessageElementLocalName, - final String stringVariableName) throws IOException, - SAXException { - final String templateString = - generateAssignFromInputMessageToStringVariable(inputMessageElementLocalName, stringVariableName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateCopyFromStringVarToAnyTypeVar(final String propertyVarName, - final String nodeInstancePropertyRequestVarName, - final String nodeInstancePropertyLocalName, - final String nodeInstancePropertyNamespace) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BpelCopyFromPropertyVarToNodeInstanceProperty.xml"); - final File bpelAssignFile = new File(FileLocator.toFileURL(url).getPath()); - String bpelAssignString = FileUtils.readFileToString(bpelAssignFile); - // - bpelAssignString = bpelAssignString.replace("$PropertyVarName", propertyVarName); - bpelAssignString = - bpelAssignString.replace("$NodeInstancePropertyRequestVarName", nodeInstancePropertyRequestVarName); - bpelAssignString = bpelAssignString.replace("$NodeInstancePropertyLocalName", nodeInstancePropertyLocalName); - bpelAssignString = bpelAssignString.replace("$NodeInstancePropertyNamespace", nodeInstancePropertyNamespace); - return bpelAssignString; - } - - public Node generateCopyFromStringVarToAnyTypeVarAsNode(final String propertyVarName, - final String nodeInstancePropertyRequestVarName, - final String nodeInstancePropertyLocalName, - final String nodeInstancePropertyNamespace) throws IOException, - SAXException { - final String templateString = - generateCopyFromStringVarToAnyTypeVar(propertyVarName, nodeInstancePropertyRequestVarName, - nodeInstancePropertyLocalName, nodeInstancePropertyNamespace); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public Node generateAssignFromPropertyVarToDomMapping(final String nodeInstancePropertyRequestVarName, - final Map propertyVarToDomMapping) throws SAXException, - IOException { - // create empty bpel:assign - final String bpelAssignString = - ""; - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(bpelAssignString)); - final Document doc = this.docBuilder.parse(is); - - final Node assignNode = doc.getFirstChild(); - for (final String propertyVarName : propertyVarToDomMapping.keySet()) { - final Node propertyNode = propertyVarToDomMapping.get(propertyVarName); - Node copyNode = - generateCopyFromStringVarToAnyTypeVarAsNode(propertyVarName, nodeInstancePropertyRequestVarName, - propertyNode.getLocalName(), - propertyNode.getNamespaceURI()); - - copyNode = doc.importNode(copyNode, true); - assignNode.appendChild(copyNode); - } - - return assignNode; - } - - public String generateInstancesBPEL4RESTLightPUT(final String requestVarName, - final String instanceURLVarName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml"); - final File bpel4RESTLightPUTFile = new File(FileLocator.toFileURL(url).getPath()); - String bpel4RESTLightPut = FileUtils.readFileToString(bpel4RESTLightPUTFile); - - // - bpel4RESTLightPut = bpel4RESTLightPut.replace("$RequestVarName", requestVarName); - bpel4RESTLightPut = bpel4RESTLightPut.replace("$instanceURLVar", instanceURLVarName); - return bpel4RESTLightPut; - } - - public Node generateInstancesBPEL4RESTLightPUTAsNode(final String requestVarName, - final String instanceURLVarName) throws IOException, - SAXException { - final String templateString = generateInstancesBPEL4RESTLightPUT(requestVarName, instanceURLVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - -} diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.postphase.plugin.vinothek/META-INF/MANIFEST.MF deleted file mode 100644 index 0d3fe3f59..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Vinothek Core -Bundle-SymbolicName: org.opentosca.planbuilder.postphase.plugin.vinothek -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.osgi.framework;version="1.3.0" -Bundle-ClassPath: ., - META-INF/resources/ -Export-Package: org.opentosca.planbuilder.postphase.plugin.vinothek.core, - org.opentosca.planbuilder.postphase.plugin.vinothek.core.handler -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.csarhandler;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.postphase.plugin.vinothek.Activator diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/build.properties b/org.opentosca.planbuilder.postphase.plugin.vinothek/build.properties deleted file mode 100644 index e39be7fe4..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/pom.xml b/org.opentosca.planbuilder.postphase.plugin.vinothek/pom.xml deleted file mode 100644 index 2caf70d40..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.postphase.plugin.vinothek - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/Activator.java b/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/Activator.java deleted file mode 100644 index a33759221..000000000 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.planbuilder.postphase.plugin.vinothek; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.opentosca.planbuilder.postphase.plugin.vinothek.bpel.BPELVinothekPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - * - * Copyright 2014 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - nyuuyn@googlemail.com - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - private ServiceRegistration registration; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = Activator.context.registerService(IPlanBuilderPostPhasePlugin.class.getName(), - new BPELVinothekPlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/MANIFEST.MF deleted file mode 100644 index 94436a12a..000000000 --- a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: PlanBuilder Core Plugin for transfering artifacts to a remote machine with ssh -Bundle-SymbolicName: org.opentosca.planbuilder.prephase.plugin.fileupload -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0", - org.opentosca.planbuilder.provphase.plugin.invoker;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.prephase.plugin.fileupload.Activator diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/build.properties b/org.opentosca.planbuilder.prephase.plugin.fileupload/build.properties deleted file mode 100644 index a128724b9..000000000 --- a/org.opentosca.planbuilder.prephase.plugin.fileupload/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - \ No newline at end of file diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/pom.xml b/org.opentosca.planbuilder.prephase.plugin.fileupload/pom.xml deleted file mode 100644 index 17e0fd69b..000000000 --- a/org.opentosca.planbuilder.prephase.plugin.fileupload/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.prephase.plugin.fileupload - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/Activator.java b/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/Activator.java deleted file mode 100644 index cf58b970f..000000000 --- a/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/Activator.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.opentosca.planbuilder.prephase.plugin.fileupload; - -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPrePhasePlugin; -import org.opentosca.planbuilder.prephase.plugin.fileupload.bpel.BPELPrePhasePlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - *

    - * This class is an OSGi Activator for the DA/IA Plugin - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - private static BPELPrePhasePlugin plugin = new BPELPrePhasePlugin(); - private ServiceRegistration iaRegistration; - private ServiceRegistration daRegistration; - - /** - * Returns the BundleContext of this Bundle - * - * @return a BundleContext - */ - static BundleContext getContext() { - return Activator.context; - } - - /** - * {@inheritDoc} - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.iaRegistration = - Activator.context.registerService(IPlanBuilderPrePhaseIAPlugin.class.getName(), Activator.plugin, null); - this.daRegistration = - Activator.context.registerService(IPlanBuilderPrePhasePlugin.class.getName(), Activator.plugin, null); - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - this.iaRegistration.unregister(); - this.daRegistration.unregister(); - Activator.context = null; - - } - -} diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/BPELPrePhasePlugin.java b/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/BPELPrePhasePlugin.java deleted file mode 100644 index 79bd4d634..000000000 --- a/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/BPELPrePhasePlugin.java +++ /dev/null @@ -1,293 +0,0 @@ -package org.opentosca.planbuilder.prephase.plugin.fileupload.bpel; - -import java.util.Collection; -import java.util.HashSet; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractNodeType; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPrePhasePlugin; -import org.opentosca.planbuilder.prephase.plugin.fileupload.bpel.handler.BPELPrePhasePluginHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - *

    - * This class is a PrePhase Plugin for IAs of type - * {http://docs.oasis-open.org/tosca - * /ns/2011/12/ToscaBaseTypes}ScriptArtifact,{http - * ://www.example.com/ToscaTypes}WAR and DAs of type - * {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}ArchiveArtifact - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class BPELPrePhasePlugin implements IPlanBuilderPrePhasePlugin, - IPlanBuilderPrePhaseIAPlugin, IPlanBuilderPrePhaseDAPlugin { - - private final static Logger LOG = LoggerFactory.getLogger(BPELPrePhasePlugin.class); - - private final BPELPrePhasePluginHandler handler = new BPELPrePhasePluginHandler(); - - private static final String PLUGIN_ID = "openTOSCA DA/IA On Linux Plugin v0.1"; - - private static final QName scriptArtifactType = new QName( - "http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ScriptArtifact"); - private static final QName jarArtifactType = new QName("http://opentosca.org/artifacttypes", "JAR"); - private static final QName archiveArtifactType = new QName( - "http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ArchiveArtifact"); - private static final QName bpelArchiveArtifactType = new QName( - "http://docs.oasis-open.org/wsbpel/2.0/process/executable", "BPEL"); - private static final QName warArtifactTypeOld = new QName("http://www.example.com/ToscaTypes", "WAR"); - private static final QName warArtifactType = new QName("http://opentosca.org/artifacttypes", "WAR"); - private static final QName sqlArtifactType = new QName("http://opentosca.org/artifacttypes", "SQLArtifact"); - private static final QName configurationArtifactType = new QName("http://opentosca.org/artifacttypes", - "ConfigurationArtifact"); - private static final QName tdlConfigurationArtifactType = new QName("http://opentosca.org/artifacttypes", - "TDLArtifact"); - - private static final QName ansibleArtifactType = new QName("http://opentosca.org/artifacttypes", "Ansible"); - private static final QName chefArtifactType = new QName("http://opentosca.org/artifacttypes", "Chef"); - private static final QName dockerContainerArtefactTypeOld = new QName("http://opentosca.org/artefacttypes", - "DockerContainerArtefact"); - private static final QName dockerContainerArtefactType = new QName("http://opentosca.org/artifacttypes", - "DockerContainerArtifact"); - private static final QName stateArtifactType = new QName("http://opentosca.org/artifacttypes", "State"); - - /** - * {@inheritDoc} - */ - @Override - public boolean handle(final BPELPlanContext context, final AbstractDeploymentArtifact da, - final AbstractNodeTemplate nodeTemplate) { - - if (da.getArtifactType().equals(this.dockerContainerArtefactType) - || da.getArtifactType().equals(this.dockerContainerArtefactTypeOld)) { - return true; - } - - return this.handler.handle(context, da, nodeTemplate); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean handle(final BPELPlanContext context, final AbstractImplementationArtifact ia, - final AbstractNodeTemplate nodeTemplate) { - final QName type = ia.getArtifactType(); - return type.equals(this.warArtifactType) || type.equals(this.warArtifactTypeOld); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canHandle(final AbstractDeploymentArtifact deploymentArtifact, - final AbstractNodeType infrastructureNodeType) { - for (final QName artType : ModelUtils.getArtifactTypeHierarchy(deploymentArtifact.getArtifactRef())) { - for (final QName nodeType : ModelUtils.getNodeTypeHierarchy(infrastructureNodeType)) { - BPELPrePhasePlugin.LOG.debug("Checking if type: " + artType.toString() - + " and infrastructure nodeType: " + nodeType.toString() + " can be handled"); - - if (isSupportedDeploymentPair(artType, nodeType, true)) { - return true; - } - } - } - - return false; - } - - @Override - public boolean canHandle(final AbstractImplementationArtifact ia, final AbstractNodeType infrastructureNodeType) { - for (final QName artType : ModelUtils.getArtifactTypeHierarchy(ia.getArtifactRef())) { - for (final QName nodeType : ModelUtils.getNodeTypeHierarchy(infrastructureNodeType)) { - BPELPrePhasePlugin.LOG.debug("Checking if type: " + artType.toString() - + " and infrastructure nodeType: " + nodeType.toString() + " can be handled"); - if (isSupportedDeploymentPair(artType, nodeType, false)) { - return true; - } - } - } - - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public String getID() { - return PLUGIN_ID; - } - - /** - * Checks whether this Plugin can handle deploying artifacts of the given - * artfiactType to a given InfrastructureNode of the given - * infrastructureNodeType - * - * @param scriptArtifactType a QName denoting an scriptArtifactType - * @param infrastructureNodeType a QName denoting an infrastructureNodeType - * @param isDA indicates whether this check is on an IA or DA - * with the given artifactType - * @return a Boolean. True if given pair of QName's denotes a pair which this - * plugin can handle - */ - private boolean isSupportedDeploymentPair(final QName artifactType, final QName infrastructureNodeType, - final boolean isDA) { - - if (infrastructureNodeType.equals(Types.dockerEngineNodeType)) { - return false; - } - - if (!isDA - && (BPELPrePhasePlugin.warArtifactType.equals(artifactType) - || BPELPrePhasePlugin.warArtifactTypeOld.equals(artifactType)) - && infrastructureNodeType - .equals(new QName("http://opentosca.org/nodetypes", "TOSCAManagmentInfrastructure"))) { - // WARs are deployed as environment-centric artifacts -> doesn't - // need to be deployed on a node inside the topology, instead we - // install it inside the management infrastructure - return true; - } - - if (!org.opentosca.container.core.tosca.convention.Utils - .isSupportedInfrastructureNodeType(infrastructureNodeType)) { - return false; - } - - boolean isSupportedArtifactType = false; - - if (BPELPrePhasePlugin.jarArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.archiveArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.scriptArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.ansibleArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.chefArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.bpelArchiveArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.warArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.warArtifactTypeOld.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.sqlArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.configurationArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - if (BPELPrePhasePlugin.dockerContainerArtefactTypeOld.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - // if (BPELPrePhasePlugin.dockerContainerArtefactType.equals(artifactType)) { - // isSupportedArtifactType |= true; - // } - - if (BPELPrePhasePlugin.tdlConfigurationArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - // We always support state artifacts. - if (BPELPrePhasePlugin.stateArtifactType.equals(artifactType)) { - isSupportedArtifactType |= true; - } - - // we can deploy on debian nodes (ubuntu, rasbpian, docker containers based on - // debian,..) - - return isSupportedArtifactType; - } - - @Override - public boolean canHandleCreate(final AbstractNodeTemplate nodeTemplate) { - LOG.debug("Checking if DAs of node template {} can be deployed", nodeTemplate.getId()); - // Find infrastructures of this node and check if we can deploy all of its DA's - for (final AbstractDeploymentArtifact da : nodeTemplate.getDeploymentArtifacts()) { - if (getDeployableInfrastructureNode(nodeTemplate, da) == null) { - LOG.warn("DAs of node template {} can't be deployed", nodeTemplate.getId()); - return false; - } - } - LOG.debug("DAs of node template {} can be deployed", nodeTemplate.getId()); - return true; - } - - public AbstractNodeTemplate getDeployableInfrastructureNode(final AbstractNodeTemplate nodeToDeploy, - final AbstractDeploymentArtifact da) { - final Collection infraNodes = new HashSet<>(); - ModelUtils.getInfrastructureNodes(nodeToDeploy, infraNodes); - for (final AbstractNodeTemplate node : infraNodes) { - for (final QName artType : ModelUtils.getArtifactTypeHierarchy(da.getArtifactRef())) { - for (final QName nodeType : ModelUtils.getNodeTypeHierarchy(node.getType())) { - if (isSupportedDeploymentPair(artType, nodeType, true)) { - return node; - } - } - } - } - return null; - } - - @Override - public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { - boolean handle = true; - for (final AbstractDeploymentArtifact da : nodeTemplate.getDeploymentArtifacts()) { - final AbstractNodeTemplate infraNode = getDeployableInfrastructureNode(nodeTemplate, da); - handle &= this.handler.handle(context, da, infraNode); - } - return handle; - } - - @Override - public boolean canHandleCreate(final AbstractRelationshipTemplate relationshipTemplate) { - return false; - } - - @Override - public boolean handleCreate(final BPELPlanContext context, - final AbstractRelationshipTemplate relationshipTemplate) { - return false; - } - - @Override - public int getPriority() { - return 1; - } - -} diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/ResourceHandler.java b/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/ResourceHandler.java deleted file mode 100644 index 3f6901dca..000000000 --- a/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/ResourceHandler.java +++ /dev/null @@ -1,435 +0,0 @@ -package org.opentosca.planbuilder.prephase.plugin.fileupload.bpel.handler; - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.net.URL; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; -import org.osgi.framework.FrameworkUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - *

    - * This class holds all BPEL Fragments and other Artifacts for the ScriptIAOnLinux Plugin - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class ResourceHandler { - - private final static Logger LOG = LoggerFactory.getLogger(ResourceHandler.class); - - private final DocumentBuilderFactory docFactory; - private final DocumentBuilder docBuilder; - - /** - * Constructor - * - * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails - */ - public ResourceHandler() throws ParserConfigurationException { - this.docFactory = DocumentBuilderFactory.newInstance(); - this.docFactory.setNamespaceAware(true); - this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - - } - - /** - * Generates a DOM Node containing a BPEL Fragment that assigns an EC2 Linux RunScript request - * - * @param assignName the name for the assign - * @param prefix the prefix of the EC2 Linux Service - * @param requestVarName the name of the RunScript request variable - * @param serverIpName the name of variable containing an address to a linux machine - * @param inputMessageVarName the name of the BuildPlan input message - * @param script the script to execute on the remote machine - * @return a DOM Node containing a complete BPEL Fragment - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when transforming the internal files to a DOM Node - */ - public Node generateAssignRequestMsgAsNode(final String assignName, final String prefix, - final String requestVarName, final String serverIpName, - final String inputMessageVarName, - final String script) throws IOException, SAXException { - final String templateString = this.generateAssignRequestMsgAsString(assignName, prefix, requestVarName, - serverIpName, inputMessageVarName, script); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a String containing a BPEL Fragment that assigns an EC2 Linux RunScript request - * - * @param assignName the name for the assign - * @param prefix the prefix of the EC2 Linux Service - * @param requestVarName the name of the RunScript request variable - * @param serverIpName the name of variable containing an address to a linux machine - * @param inputMessageVarName the name of the BuildPlan input message - * @param script the script to execute on the remote machine - * @return a String containing a complete BPEL Fragment - * @throws IOException is thrown when reading internal files fails - */ - public String generateAssignRequestMsgAsString(final String assignName, final String prefix, - final String requestVarName, final String serverIpName, - final String inputMessageVarName, - final String script) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("assRunScriptRequest.xml"); - final File bpelfragmentfile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelfragmentfile); - template = template.replace("{assignName}", assignName); - template = template.replace("{prefix}", prefix); - template = template.replace("{requestVarName}", requestVarName); - template = template.replace("{serverIpVarName}", serverIpName); - template = template.replace("{inputMessageVarName}", inputMessageVarName); - template = template.replace("{script}", script); - return template; - } - - /** - * Generates an BPEL Invoke Element as String. - * - * @param invokeName the name attribute of the Invoke Element - * @param partnerLinkName the partnerLink attribute of the invoke - * @param operationName the name of the operation used on the given porttype - * @param portType the porttype to call on - * @param inputVarName the input variable name - * @param outputVarName the output variable name - * @return BPEL Invoke Element as Node - */ - public Node generateInvokeAsNode(final String invokeName, final String partnerLinkName, final String operationname, - final QName portType, final String inputVarName, - final String outputVarName) throws SAXException, IOException { - final String templateString = this.generateInvokeAsString(invokeName, partnerLinkName, operationname, portType, - inputVarName, outputVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates an BPEL Invoke Element as String. - * - * @param invokeName the name attribute of the Invoke Element - * @param partnerLinkName the partnerLink attribute of the invoke - * @param operationName the name of the operation used on the given porttype - * @param portType the porttype to call on - * @param inputVarName the input variable name - * @param outputVarName the output variable name - * @return BPEL Invoke Element as String - */ - public String generateInvokeAsString(final String invokeName, final String partnerLinkName, - final String operationName, final QName portType, final String inputVarName, - final String outputVarName) { - // Example: - // - final String invokeAsString = - ""; - return invokeAsString; - } - - /** - * Returns the WSDL file of the EC2Linux IA WebService - * - * @return a File containing the absolute path to the WSDL file - * @throws IOException is thrown when reading internal files fails - */ - public File getLinuxFileUploadWSDLFile() throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("EC2LinuxIAService.wsdl"); - final File wsdlFile = new File(FileLocator.toFileURL(url).getPath()); - return wsdlFile; - } - - /** - * Returns the openTOSCA References Schema file - * - * @return a File containing the absolute path to the openTOSCA References Schema file - * @throws IOException is thrown when reading internal files fails - */ - public File getOpenToscaReferencesSchema() throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("openTOSCAReferencesSchema.xsd"); - final File xsdFile = new File(FileLocator.toFileURL(url).getPath()); - return xsdFile; - } - - /** - * Returns the WSDL PortType of the EC2Linux IA WebService - * - * @return a QName denoting the PortType of the EC2Linux IA WebService - */ - public QName getPortTypeFromLinuxUploadWSDL() { - return new QName("http://ec2linux.aws.ia.opentosca.org", "EC2LinuxIAService", "ec2linuxport"); - } - - /** - * Returns an XPath Query which contructs a valid String, to GET a File from the openTOSCA API - * - * @param artifactPath a path inside an ArtifactTemplate - * @return a String containing an XPath query - */ - public String getRemoteFilePathString(final String artifactPath) { - ResourceHandler.LOG.debug("Generating XPATH Query for ArtifactPath: " + artifactPath); - final String filePath = - "string(concat($input.payload//*[local-name()='csarEntrypoint']/text(),'/Content/" + artifactPath + "'))"; - return filePath; - } - - /** - *

    - * Returns a DOM Node containing a BPEL Fragment that assigns values to Ec2 Linux FileTransfer - * Request - *

    - * - * @param assignName the name of the assign - * @param requestVarName the name of the FileTransferRequest variable - * @param prefix the prefix for the EC2 Linux Service - * @param serverIpVarName the name of a variable holding an address to a linux machine - * @param planRequestName the name of BuildPlan input variable - * @param remoteFilePath the path of the file to be transfered - * @param remotePath the path for the file to upload unto the linux machine - * @return a DOM Node containing a complete BPEL Fragment - * @throws IOException is thrown if reading internal files fails - * @throws SAXException is thrown if transforming internal files to DOM fails - */ - public Node getRemoteTransferFileAssignAsNode(final String assignName, final String requestVarName, - final String prefix, final String serverIpVarName, - final String planRequestName, final String remoteFilePath, - final String remotePath) throws SAXException, IOException { - final String templateString = - this.getRemoteTransferFileAssignAsString(assignName, requestVarName, prefix, serverIpVarName, - planRequestName, remoteFilePath, remotePath); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - *

    - * Returns a String containing a BPEL Fragment that assigns values to Ec2 Linux RemoteFileTransfer - * Request - *

    - * - * @param assignName the name of the assign - * @param requestVarName the name of the FileTransferRequest variable - * @param prefix the prefix for the EC2 Linux Service - * @param serverIpVarName the name of a variable holding an address to a linux machine - * @param planRequestName the name of BuildPlan input variable - * @param remoteFilePath the path of the file to be transfered - * @param remotePath the path for the file to upload unto the linux machine - * @return a String containing a complete BPEL Fragment - * @throws IOException is thrown if reading internal files fails - */ - public String getRemoteTransferFileAssignAsString(final String assignName, final String requestVarName, - final String prefix, final String serverIpVarName, - final String planRequestName, final String remoteFilePath, - final String remotePath) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("assignRemoteTransferFileRequestFragment.xml"); - final File bpelfragmentfile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelfragmentfile); - template = template.replace("{AssignName}", assignName); - template = template.replace("{RequestVarName}", requestVarName); - template = template.replace("{ServerIpPropVarName}", serverIpVarName); - template = template.replace("{prefix}", prefix); - template = template.replace("{remoteFilePath}", remoteFilePath); - template = template.replace("{remotePath}", remotePath); - template = template.replace("{planRequestName}", planRequestName); - return template; - } - - /** - * - * Returns a DOM Node containing a BPEL Fragment to fetch Data from the openTOSCA ContainerAPI with - * the BPEL4RESTLight Extension - * - * @param csarFileName the file name of the csar the build plan belongs to - * @param responseName the variable name of the response variable - * @param relativeFilePath a relative path on the containerAPI - * @return a DOM Node containing a complete BPEL Fragment - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - * - */ - public Node getRESTExtensionGETAsNode(final String csarFileName, final String responseName, - final String relativeFilePath) throws SAXException, IOException { - final String templateString = this.getRESTExtensionGETAsString(csarFileName, responseName, relativeFilePath); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Returns a String containing a BPEL Fragment to fetch Data from the openTOSCA ContainerAPI with - * the BPEL4RESTLight Extension - * - * @param csarFileName the file name of the csar the build plan belongs to - * @param responseName the variable name of the response variable - * @param relativeFilePath a relative path on the containerAPI - * @return a String containing a complete BPEL Fragment - * @throws IOException is thrown when reading internal files fails - */ - public String getRESTExtensionGETAsString(final String csarFileName, final String responseName, - final String relativeFilePath) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("restExtensionGetFragment.xml"); - final File bpelfragmentfile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelfragmentfile); - template = template.replace("{CSAR_filename}", csarFileName); - template = template.replace("{response_var_name}", responseName); - template = template.replace("{relative_path_to_file}", relativeFilePath); - return template; - } - - /** - * Generates a DOM Node containing a BPEL Fragment that assigns values to an EC2 Linux TransferFile - * request - * - * @param assignName the name for the assign - * @param requestVarName the name of the TranferFile request variable - * @param prefix the prefix of the EC2 Linux Service - * @param serverIpVarName the name of a variable containing an address to a linux machine - * @param planRequestName the name of the BuildPlan input message - * @param localPathVarName a local path of a file on the machine the BuildPlan will be executed - * @param remotePath the remote path where the file must be uploaded to, on the remote machine - * @return a DOM Node containing a complete BPEL Fragment - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when transforming internal data to DOM fails - */ - public Node getTransferFileAssignAsNode(final String assignName, final String requestVarName, final String prefix, - final String serverIpVarName, final String planRequestName, - final String localPathVarName, - final String remotePath) throws IOException, SAXException { - final String templateString = - this.getTransferFileAssignAsString(assignName, requestVarName, prefix, serverIpVarName, planRequestName, - localPathVarName, remotePath); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a String containing a BPEL Fragment that assigns values to an EC2 Linux TransferFile - * request - * - * @param assignName the name for the assign - * @param requestVarName the name of the TranferFile request variable - * @param prefix the prefix of the EC2 Linux Service - * @param serverIpVarName the name of a variable containing an address to a linux machine - * @param planRequestName the name of the BuildPlan input message - * @param localPathVarName a local path of a file on the machine the BuildPlan will be executed - * @param remotePath the remote path where the file must be uploaded to, on the remote machine - * @return a String containing a complete BPEL Fragment - * @throws IOException is thrown when reading internal files fails - */ - public String getTransferFileAssignAsString(final String assignName, final String requestVarName, - final String prefix, final String serverIpVarName, - final String planRequestName, final String localPathVarName, - final String remotePath) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("assignTransferFileRequestFragment.xml"); - final File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelFragmentFile); - template = template.replace("{AssignName}", assignName); - template = template.replace("{RequestVarName}", requestVarName); - template = template.replace("{ServerIpPropVarName}", serverIpVarName); - template = template.replace("{prefix}", prefix); - template = template.replace("{localFilePathVarName}", localPathVarName); - template = template.replace("{remotePath}", remotePath); - template = template.replace("{planRequestName}", planRequestName); - return template; - } - - /** - * Generates a DOM Node containing a BPEL Fragment that invokes an EC2 Linux Service with the - * transferFile operation - * - * @param invokeName the name of the invoke - * @param partnerLinkName the name of the partnerLink - * @param portTypeprefix the prefix of the portType - * @param inputVarName the name of the input variable - * @param outputVarName the name of the output variable - * @param operationName the name of the operation - * @return a DOM Node containing a complete BPEL Fragment - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when transforming internal data to DOM fails - */ - public Node getTransferFileInvokeAsNode(final String invokeName, final String partnerLinkName, - final String portTypeprefix, final String inputVarName, - final String outputVarName, - final String operationName) throws SAXException, IOException { - final String templateString = this.getTransferFileInvokeAsString(invokeName, partnerLinkName, portTypeprefix, - inputVarName, outputVarName, operationName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a String containing a BPEL Fragment that invokes an EC2 Linux Service with the - * transferFile operation - * - * @param invokeName the name of the invoke - * @param partnerLinkName the name of the partnerLink - * @param portTypeprefix the prefix of the portType - * @param inputVarName the name of the input variable - * @param outputVarName the name of the output variable - * @param operationName the name of the operation - * @return a String containing a complete BPEL Fragment - * @throws IOException is thrown when reading internal files fails - */ - public String getTransferFileInvokeAsString(final String invokeName, final String partnerLinkName, - final String portTypeprefix, final String inputVarName, - final String outputVarName, - final String operationName) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("invokeTransferFile.xml"); - final File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelFragmentFile); - template = template.replace("{InvokeName}", invokeName); - template = template.replace("{partnerlinkName}", partnerLinkName); - template = template.replace("{portTypePrefix}", portTypeprefix); - template = template.replace("{inputVarName}", inputVarName); - template = template.replace("{outputVarName}", outputVarName); - template = template.replace("{operation}", operationName); - return template; - } - -} diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/META-INF/MANIFEST.MF deleted file mode 100644 index f506c67df..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Ansibleoperation -Bundle-SymbolicName: org.opentosca.planbuilder.provphase.plugin.ansibleoperation -Bundle-Version: 2.0.0.qualifier -Bundle-Vendor: OpenTosca PlanBuilder Core Ansible Operation Plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Export-Package: org.opentosca.planbuilder.provphase.plugin.ansibleoperation.core, - org.opentosca.planbuilder.provphase.plugin.ansibleoperation.core.handler -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0", - org.opentosca.planbuilder.provphase.plugin.invoker;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.provphase.plugin.ansibleoperation.Activator diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/build.properties b/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/build.properties deleted file mode 100644 index d7869e570..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ \ No newline at end of file diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/pom.xml b/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/pom.xml deleted file mode 100644 index 3fa2b7eb7..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.provphase.plugin.ansibleoperation - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/Activator.java b/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/Activator.java deleted file mode 100644 index 1220d2eb9..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/Activator.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.opentosca.planbuilder.provphase.plugin.ansibleoperation; - -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; -import org.opentosca.planbuilder.provphase.plugin.ansibleoperation.bpel.BPELAnsibleOperationPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - *

    - * This class is the OSGi Activator of the AnsibleOperation Plugin - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - - private final BPELAnsibleOperationPlugin plugin = new BPELAnsibleOperationPlugin(); - - private ServiceRegistration registration; - - /** - * Returns the BundleContext of this Bundle - * - * @return a BundleContext - */ - static BundleContext getContext() { - return Activator.context; - } - - /** - * {@inheritDoc} - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = - Activator.context.registerService(IPlanBuilderProvPhaseOperationPlugin.class.getName(), this.plugin, null); - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - this.registration.unregister(); - Activator.context = null; - } - -} diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/AnsibleOperationPlugin.java b/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/AnsibleOperationPlugin.java deleted file mode 100644 index d54340f93..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/AnsibleOperationPlugin.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.opentosca.planbuilder.provphase.plugin.ansibleoperation.core; - -import javax.xml.namespace.QName; - -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseParamOperationPlugin; -import org.opentosca.planbuilder.plugins.context.PlanContext; - -/** - *

    - * This class implements a ProvPhase Plugin, in particular to enable provisioning with ansible - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * - */ -public abstract class AnsibleOperationPlugin implements IPlanBuilderProvPhaseOperationPlugin, - IPlanBuilderProvPhaseParamOperationPlugin { - - private static final String PLUGIN_ID = "OpenTOSCA ProvPhase AnsibleOperation Plugin v0.1"; - private static final QName ANSIBLE_ARTIFACTTYPE = new QName("http://opentosca.org/artifacttypes", "Ansible"); - - /** - * {@inheritDoc} - */ - @Override - public boolean canHandle(final QName artifactType) { - return AnsibleOperationPlugin.ANSIBLE_ARTIFACTTYPE.equals(artifactType); - } - - /** - * {@inheritDoc} - */ - @Override - public String getID() { - return AnsibleOperationPlugin.PLUGIN_ID; - } -} diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/handler/AnsibleOperationPluginHandler.java b/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/handler/AnsibleOperationPluginHandler.java deleted file mode 100644 index 7454407c0..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/handler/AnsibleOperationPluginHandler.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.opentosca.planbuilder.provphase.plugin.ansibleoperation.core.handler; - -import java.util.Map; - -import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Variable; - -/** - *

    - * This class is contains the logic to add BPEL Fragments, which executes Ansible Playbooks on - * remote machine. The class assumes that the playbook that must be called are already uploaded to - * the appropriate path. For example by the ScriptIAOnLinux Plugin - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * - */ -public interface AnsibleOperationPluginHandler { - - /** - * Adds logic to the Plan to call a Ansible Playbook on a remote machine - * - * @param context the TemplatePlanContext where the logical provisioning operation is called - * @param operation the operation to call - * @param ia the ia that implements the operation - * @return true iff adding BPEL Fragment was successful - */ - public boolean handle(final T templateContext, final AbstractOperation operation, - final AbstractImplementationArtifact ia); - - public boolean handle(final T context, final AbstractOperation operation, final AbstractImplementationArtifact ia, - final Map param2propertyMapping); - -} diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/MANIFEST.MF deleted file mode 100644 index 284d4b1c5..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Core ProvPhase Plugin for the ServiceInvoker -Bundle-SymbolicName: org.opentosca.planbuilder.provphase.plugin.invoker -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Export-Package: org.opentosca.planbuilder.provphase.plugin.invoker.bpel -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.provphase.plugin.invoker.Activator diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/correlationIdCopy.xml b/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/correlationIdCopy.xml deleted file mode 100644 index e8f09c569..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/correlationIdCopy.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/externalParamCopy.xml b/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/externalParamCopy.xml deleted file mode 100644 index 7cd2db796..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/externalParamCopy.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/externalParamCopy2.xml b/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/externalParamCopy2.xml deleted file mode 100644 index 0aada44ec..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/externalParamCopy2.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/internalParamCopy.xml b/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/internalParamCopy.xml deleted file mode 100644 index d48f77a43..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/internalParamCopy.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/nodeInstanceCopy.xml b/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/nodeInstanceCopy.xml deleted file mode 100644 index 5ea2630da..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/nodeInstanceCopy.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/serviceInstanceCopy.xml b/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/serviceInstanceCopy.xml deleted file mode 100644 index b2dc034b3..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/serviceInstanceCopy.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/build.properties b/org.opentosca.planbuilder.provphase.plugin.invoker/build.properties deleted file mode 100644 index 19615f203..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/pom.xml b/org.opentosca.planbuilder.provphase.plugin.invoker/pom.xml deleted file mode 100644 index 18deac9d5..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.provphase.plugin.invoker - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/Activator.java b/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/Activator.java deleted file mode 100644 index 73fd55d7b..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.opentosca.planbuilder.provphase.plugin.invoker; - -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; -import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - *

    - * This class is an OSGi Activator for the Invoker ProvPhase Plugin - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - private ServiceRegistration registration; - - /** - * Returns the BundleContext of this Bundle - * - * @return a BundleContext - */ - public static BundleContext getContext() { - return Activator.context; - } - - /** - * {@inheritDoc} - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = Activator.context.registerService(IPlanBuilderProvPhaseOperationPlugin.class.getName(), - new BPELInvokerPlugin(), null); - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - this.registration.unregister(); - Activator.context = null; - - } - -} diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/ResourceHandler.java b/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/ResourceHandler.java deleted file mode 100644 index b2f0cf73d..000000000 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/ResourceHandler.java +++ /dev/null @@ -1,866 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.provphase.plugin.invoker.bpel.handlers; - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.net.URL; -import java.nio.file.Files; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; -import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.provphase.plugin.invoker.Activator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Copyright 2014 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class ResourceHandler { - - private final static Logger LOG = LoggerFactory.getLogger(ResourceHandler.class); - - private final DocumentBuilderFactory docFactory; - private final DocumentBuilder docBuilder; - private final BPELProcessFragments fragments; - - /** - * Constructor - * - * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails - */ - public ResourceHandler() throws ParserConfigurationException { - this.docFactory = DocumentBuilderFactory.newInstance(); - this.docFactory.setNamespaceAware(true); - this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - this.fragments = new BPELProcessFragments(); - } - - private BundleContext getContext() { - return org.opentosca.planbuilder.provphase.plugin.invoker.Activator.getContext(); - } - - public File createNewTempFile(final File file, final int id) throws IOException { - final File tempFile = - Files.createTempFile(file.getName().split("\\.")[0] + id, "." + file.getName().split("\\.")[1]).toFile(); - - FileUtils.copyFile(file, tempFile); - return tempFile; - } - - /** - * Generates a BPEL If activity that throws the given fault when the given expr evaluates to true at - * runtime - * - * @param xpath1Expr a XPath 1.0 expression as String - * @param faultQName a QName denoting the fault to be thrown when the if evaluates to true - * @return a Node containing a BPEL If Activity - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node generateBPELIfTrueThrowFaultAsNode(final String xpath1Expr, final QName faultQName, final String faultVariableName) throws IOException, - SAXException { - final String templateString = generateBPELIfTrueThrowFaultAsString(xpath1Expr, faultQName, faultVariableName); - return this.transformStringToNode(templateString); - } - - - public Node transformStringToNode(String xmlString) throws SAXException, IOException { - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(xmlString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a BPEL If activity that throws the given fault when the given expr evaluates to true at - * runtime - * - * @param xpath1Expr a XPath 1.0 expression as String - * @param faultQName a QName denoting the fault to be thrown when the if evaluates to true - * @return a String containing a BPEL If Activity - * @throws IOException is thrown when reading internal files fails - */ - public String generateBPELIfTrueThrowFaultAsString(final String xpath1Expr, - final QName faultQName, String faultVariableName) throws IOException { - // - String bpelIfString = this.loadFragmentResourceAsString("ifFaultMessageThrowFault.xml"); - - bpelIfString = bpelIfString.replace("$xpath1Expr", xpath1Expr); - - bpelIfString = bpelIfString.replace("$faultPrefix", faultQName.getPrefix()); - bpelIfString = bpelIfString.replace("$faultLocalName", faultQName.getLocalPart()); - bpelIfString = bpelIfString.replace("$faultNamespace", faultQName.getNamespaceURI()); - bpelIfString = bpelIfString.replace("$faultVariable", faultVariableName); - - return bpelIfString; - } - - private String loadFragmentResourceAsString(final String fileName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getResource(fileName); - final File bpelfragmentfile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelfragmentfile); - return template; - } - - - /** - * Generates a BPEL Copy element to use in BPEL Assigns, which sets the WS-Addressing ReplyTo - * Header for the specified request variable - * - * @param partnerLinkName the name of the BPEL partnerLink that will be used as String - * @param requestVariableName the name of the BPEL Variable used for an asynchronous request as - * String - * @return a String containing a complete BPEL Copy element - * @throws IOException is thrown when reading internal files fails - */ - public String generateAddressingCopy(final String partnerLinkName, - final String requestVariableName) throws IOException { - final URL url = - this.getContext().getBundle().getResource("addressingCopy.xml"); - final File addressingFile = new File(FileLocator.toFileURL(url).getPath()); - String addressingFileString = FileUtils.readFileToString(addressingFile); - /* - * "{partnerLinkName}" "{requestVarName}" - */ - addressingFileString = addressingFileString.replace("{requestVarName}", requestVariableName); - addressingFileString = addressingFileString.replace("{partnerLinkName}", partnerLinkName); - - return addressingFileString; - - } - - /** - * Generates a BPEL Copy element to use in BPEL Assigns, which sets the WS-Addressing ReplyTo - * Header for the specified request variable - * - * @param partnerLinkName the name of the BPEL partnerLink that will be used as String - * @param requestVariableName the name of the BPEL Variable used for an asynchronous request as - * String - * @return a DOM Node containing a complete BPEL Copy element - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal data to DOM fails - */ - public Node generateAddressingCopyAsNode(final String partnerLinkName, - final String requestVariableName) throws IOException, SAXException { - final String addressingCopyString = generateAddressingCopy(partnerLinkName, requestVariableName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(addressingCopyString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a BPEL Copy which sets a dummy WS-Addressing ReplyTo Header on the given request - * variable - * - * @param requestVariableName the name of a BPEL Variable as String - * @return a String containing a complete BPEL Copy element - * @throws IOException is thrown when reading internal files fails - */ - public String generateAddressingInit(final String requestVariableName) throws IOException { - final URL url = - this.getContext().getBundle().getResource("addressingInit.xml"); - final File addressingFile = new File(FileLocator.toFileURL(url).getPath()); - String addressingFileString = FileUtils.readFileToString(addressingFile); - /* - * "{partnerLinkName}" "{requestVarName}" - */ - addressingFileString = addressingFileString.replace("{requestVarName}", requestVariableName); - return addressingFileString; - - } - - /** - * Generates a BPEL Copy which sets a dummy WS-Addressing ReplyTo Header on the given request - * variable - * - * @param requestVariableName the name of a BPEL Variable as String - * @return a DOM Node containing a complete BPEL Copy element - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal data to DOM fails - */ - public Node generateAddressingInitAsNode(final String requestVariableName) throws IOException, SAXException { - final String addressingCopyString = generateAddressingInit(requestVariableName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(addressingCopyString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public Node generateCopyFromExternalParamToInvokerNode(final String requestVarName, final String requestVarPartName, - final String paramName, - final String invokerParamName) throws IOException, - SAXException { - final String addressingCopyString = - generateCopyFromExternalParamToInvokerString(requestVarName, requestVarPartName, paramName, - invokerParamName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(addressingCopyString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - private String generateCopyFromExternalParamToInvokerString(final String requestVarName, - final String requestVarPartName, final String paramName, - final String invokerParamName) throws IOException { - final URL url = this.getContext().getBundle() - .getResource("externalParamCopy2.xml"); - final File copyTemplateFile = new File(FileLocator.toFileURL(url).getPath()); - String copyTemplateString = FileUtils.readFileToString(copyTemplateFile); - - // {paramName}, {requestVarName}, {requestVarPartName} - copyTemplateString = copyTemplateString.replace("{paramName}", paramName); - copyTemplateString = copyTemplateString.replace("{requestVarName}", requestVarName); - copyTemplateString = copyTemplateString.replace("{requestVarPartName}", requestVarPartName); - copyTemplateString = copyTemplateString.replace("{invokerParamName}", invokerParamName); - - return copyTemplateString; - } - - /** - * Generates a BPEL Correlations element to us with BPEL Invoke and Receive elements - * - * @param correlationSetName the name of the correlationSet to use - * @param initiate whether the correlationSet must be initialized or not - * @return a DOM Node containing a complete BPEL Correlations element - * @throws SAXException is thrown when parsing internal data fails - * @throws IOException is thrown when reading internal data fails - */ - public Node generateCorrelationSetsAsNode(final String correlationSetName, - final boolean initiate) throws SAXException, IOException { - final String correlationSetsString = - ""; - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(correlationSetsString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a copy from a partnerLink myRole EPR to a invoker request param such as ReplyTo - * - * @param partnerLinkName the name of the partnerLink to use - * @param invokerRequestVarName the name of the invoker request message - * @param invokerRequestVarPartName the name of the message part of the referenced invoker - * request message variable - * @param invokerParamName the name of the invoker param to assign - * @return a DOM node containing a BPEL copy element - * @throws SAXException is thrown when parsing internal files fail - * @throws IOException is thrown when reading internal files fail - */ - public Node generateEPRMyRoleCopyToInvokerParamAsNode(final String partnerLinkName, - final String invokerRequestVarName, - final String invokerRequestVarPartName, - final String invokerParamName) throws SAXException, - IOException { - final String addressingCopyString = - generateEPRMyRoleCopyToInvokerParamAsString(partnerLinkName, invokerRequestVarName, - invokerRequestVarPartName, invokerParamName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(addressingCopyString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a copy from a partnerLink myRole EPR to a invoker request param such as ReplyTo - * - * @param partnerLinkName the name of the partnerLink to use - * @param invokerRequestVarName the name of the invoker request message - * @param invokerRequestVarPartName the name of the message part of the referenced invoker - * request message variable - * @param invokerParamName the name of the invoker param to assign - * @return a String containing a BPEL copy element - * @throws IOException is thrown when reading internal files fail - */ - public String generateEPRMyRoleCopyToInvokerParamAsString(final String partnerLinkName, - final String invokerRequestVarName, - final String invokerRequestVarPartName, - final String invokerParamName) throws IOException { - final URL url = this.getContext().getBundle() - .getResource("EPRCopyToInvokerReplyTo.xml"); - final File eprCopyFile = new File(FileLocator.toFileURL(url).getPath()); - String eprCopyFileString = FileUtils.readFileToString(eprCopyFile); - - // - eprCopyFileString = eprCopyFileString.replace("{partnerLinkName}", partnerLinkName); - eprCopyFileString = eprCopyFileString.replace("{requestVarName} ", invokerRequestVarName); - eprCopyFileString = eprCopyFileString.replace("{requestVarPartName}", invokerRequestVarPartName); - eprCopyFileString = eprCopyFileString.replace("{invokerParamName}", invokerParamName); - - return eprCopyFileString; - } - - /** - * Generates a DOM Node containing a BPEL invoke element - * - * @param invokeName the name of the invoke as String - * @param partnerLinkName the name of the partnerLink used as String - * @param operationName the name of the WSDL operation as String - * @param portType a QName denoting the WSDL portType - * @param inputVarName the name of the BPEL Variable to use as Input, given as String - * @return a DOM Node containing a complete BPEL Invoke element - */ - public Node generateInvokeAsNode(final String invokeName, final String partnerLinkName, final String operationName, - final QName portType, final String inputVarName) throws SAXException, IOException { - final String invokeString = - generateInvokeAsString(invokeName, partnerLinkName, operationName, portType, inputVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(invokeString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a String containing a BPEL invoke element - * - * @param invokeName the name of the invoke as String - * @param partnerLinkName the name of the partnerLink used as String - * @param operationName the name of the WSDL operation as String - * @param portType a QName denoting the WSDL portType - * @param inputVarName the name of the BPEL Variable to use as Input, given as String - * @return a String containing a complete BPEL Invoke element - */ - public String generateInvokeAsString(final String invokeName, final String partnerLinkName, - final String operationName, final QName portType, final String inputVarName) { - return ""; - } - - public String generateInvokerRequestMessageInitAssignTemplate(final String csarName, final QName serviceTemplateId, - final String serviceInstanceIdVarName, - final String nodeInstanceIdVarName, - final String operationName, final String messageId, - final String requestVarName, - final String requestVarPartName, final String iface, - final boolean isNodeTemplate, final String templateId, - final Map internalExternalProps) throws IOException { - final URL url = this.getContext().getBundle() - .getResource("assignInvokerAsyncMessage.xml"); - final File assignTemplateFile = new File(FileLocator.toFileURL(url).getPath()); - String assignTemplateString = FileUtils.readFileToString(assignTemplateFile); - - /* - * String values must replace: {csarName}, {serviceTemplateNS}, {serviceTemplateLocalName}, - * {operationName}, {messageID}, {requestVarName}, {requestVarPartName} - * - * These must be xml snippets again -> more complicated: {copies} {interface}, {templateID}, - * {paramsMap}, - */ - - // first the easy ones - assignTemplateString = assignTemplateString.replace("{csarName}", csarName); - assignTemplateString = assignTemplateString.replace("{serviceInstanceID}", ""); - assignTemplateString = assignTemplateString.replace("{planCorrelation}", ""); - - if (nodeInstanceIdVarName != null) { - assignTemplateString = assignTemplateString.replace("{nodeInstanceID}", ""); - } else { - assignTemplateString = - assignTemplateString.replace("{nodeInstanceID}", ""); - } - assignTemplateString = assignTemplateString.replace("{serviceTemplateNS}", serviceTemplateId.getNamespaceURI()); - assignTemplateString = - assignTemplateString.replace("{serviceTemplateLocalName}", serviceTemplateId.getLocalPart()); - assignTemplateString = assignTemplateString.replace("{operationName}", operationName); - assignTemplateString = assignTemplateString.replace("{messageID}", messageId); - assignTemplateString = assignTemplateString.replace("{requestVarName}", requestVarName); - assignTemplateString = assignTemplateString.replace("{requestVarPartName}", requestVarPartName); - - if (iface != null) { - final String ifaceString = "" + iface + ""; - assignTemplateString = assignTemplateString.replace("{interface}", ifaceString); - } else { - assignTemplateString = assignTemplateString.replace("{interface}", ""); - } - - String templateString = ""; - if (isNodeTemplate) { - templateString = "" + templateId + ""; - } else { - templateString = "" + templateId + ""; - } - - assignTemplateString = assignTemplateString.replace("{templateID}", templateString); - - assignTemplateString = - assignTemplateString.replace("{paramsMap}", generateServiceInvokerParamsMap(internalExternalProps)); - - // add copy elements to the assign according to the given map of - // parameters - for (final String propertyName : internalExternalProps.keySet()) { - if (internalExternalProps.get(propertyName) == null) { - // parameter is external, fetch value from plan input message - String copyString = - generateServiceInvokerExternalParamCopyString(requestVarName, requestVarPartName, propertyName); - copyString = copyString.replace("", ""); - assignTemplateString = assignTemplateString.replace("{copies}", copyString + "{copies}"); - } else { - // parameter is internal, fetch value from bpel variable - String copyString = - generateServiceInvokerInternalParamCopyString(internalExternalProps.get(propertyName) - .getVariableName(), - requestVarName, requestVarPartName, propertyName); - copyString = copyString.replace("", ""); - assignTemplateString = assignTemplateString.replace("{copies}", copyString + "{copies}"); - } - } - - // assign correlation id - String correlationIdCopyString = generateCorrelationIdCopy(requestVarName, requestVarPartName); - correlationIdCopyString = correlationIdCopyString.replace("", ""); - assignTemplateString = assignTemplateString.replace("{copies}", correlationIdCopyString + "{copies}"); - - // assign serviceInstanceID - String serviceInstanceCopyString = - generateServiceInstanceIDCopy(serviceInstanceIdVarName, requestVarName, requestVarPartName); - serviceInstanceCopyString = serviceInstanceCopyString.replace("", ""); - assignTemplateString = assignTemplateString.replace("{copies}", serviceInstanceCopyString + "{copies}"); - - if (nodeInstanceIdVarName != null) { - String nodeInstanceCopyString = - generateNodeInstanceIdCopy(nodeInstanceIdVarName, requestVarName, requestVarPartName); - nodeInstanceCopyString = nodeInstanceCopyString.replace("", ""); - assignTemplateString = assignTemplateString.replace("{copies}", nodeInstanceCopyString + "{copies}"); - } - - assignTemplateString = assignTemplateString.replace("{copies}", ""); - - // TODO REPLACE THIS PART - - ResourceHandler.LOG.debug("Generated Invoker Operation Call:"); - ResourceHandler.LOG.debug(assignTemplateString); - return assignTemplateString; - } - - public Node generateInvokerRequestMessageInitAssignTemplateAsNode(final String csarName, - final QName serviceTemplateId, - final String serviceInstanceIdVarName, - final String nodeInstanceIdVarName, - final String operationName, - final String messageId, - final String requestVarName, - final String requestVarPartName, - final String iface, final boolean isNodeTemplate, - final String templateId, - final Map internalExternalProps) throws IOException, - SAXException { - final String templateString = - generateInvokerRequestMessageInitAssignTemplate(csarName, serviceTemplateId, serviceInstanceIdVarName, - nodeInstanceIdVarName, operationName, messageId, - requestVarName, requestVarPartName, iface, isNodeTemplate, - templateId, internalExternalProps); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a BPEL Copy which sets the MessageId of an Invoker Message Body to a given prefix - * and the current date - * - * @param requestVariableName the name of the request variable with an invoker message body - * @param requestVariabelPartName the name of the part which has the invoker message body - * @param messageIdPrefix a prefix to be used inside the message id - * @return a String containing a BPEL copy element - * @throws IOException is thrown when reading internal files fails - */ - public String generateMessageIdInit(final String requestVariableName, final String requestVariabelPartName, - final String messageIdPrefix) throws IOException { - final URL url = - this.getContext().getBundle().getResource("initMessageId.xml"); - final File initMessageIdFile = new File(FileLocator.toFileURL(url).getPath()); - String initMessageIdFileString = FileUtils.readFileToString(initMessageIdFile); - - // - initMessageIdFileString = initMessageIdFileString.replace("{requestVarName}", requestVariableName); - initMessageIdFileString = initMessageIdFileString.replace("{requestVarPartName}", requestVariabelPartName); - initMessageIdFileString = initMessageIdFileString.replace("{messageIdPrefix}", messageIdPrefix); - return initMessageIdFileString; - } - - /** - * Generates a BPEL Copy which sets the MessageId of an Invoker Message Body to a given prefix - * and the current date - * - * @param requestVariableName the name of the request variable with an invoker message body - * @param requestVariabelPartName the name of the part which has the invoker message body - * @param messageIdPrefix a prefix to be used inside the message id - * @return a DOM Node containing a BPEL copy element - * @throws IOException is thrown when reading internal files fails - * @throws SAXException is thrown when parsing internal files fails - */ - public Node generateMessageIdInitAsNode(final String requestVariableName, final String requestVariabelPartName, - final String messageIdPrefix) throws IOException, SAXException { - final String addressingCopyString = - generateMessageIdInit(requestVariableName, requestVariabelPartName, messageIdPrefix); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(addressingCopyString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a BPEL Receive Element - * - * @param receiveName a name for the receive as String - * @param partnerLinkName the name of a BPEL partnerLink as String - * @param operationName the name of a WSDL operation as String - * @param portType the reference to a WSDL portType as QName - * @param variableName a name of a BPEL Variable as String - * @return a DOM Node containing a complete BPEL Receive element - * @throws SAXException is thrown when parsing internal data to DOM - * @throws IOException is thrown when reading internal files fails - */ - public Node generateReceiveAsNode(final String receiveName, final String partnerLinkName, - final String operationName, final QName portType, - final String variableName) throws SAXException, IOException { - final String receiveString = - ""; - /* - * - */ - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(receiveString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - public String generateReplyToCopy(final String partnerLinkName, final String requestVarName, - final String requestVarPartName, final String paramName) throws IOException { - final URL url = - this.getContext().getBundle().getResource("copyReplyTo.xml"); - final File copyTemplateFile = new File(FileLocator.toFileURL(url).getPath()); - String copyTemplateString = FileUtils.readFileToString(copyTemplateFile); - - // {paramName}, {partnerLinkName}, {requestVarName}, - // {requestVarPartName} - copyTemplateString = copyTemplateString.replace("{paramName}", paramName); - copyTemplateString = copyTemplateString.replace("{partnerLinkName}", partnerLinkName); - copyTemplateString = copyTemplateString.replace("{requestVarName}", requestVarName); - copyTemplateString = copyTemplateString.replace("{requestVarPartName}", requestVarPartName); - - return copyTemplateString; - } - - public Node generateReplyToCopyAsNode(final String partnerLinkName, final String requestVarName, - final String requestVarPartName, - final String paramName) throws IOException, SAXException { - final String addressingCopyString = - generateReplyToCopy(partnerLinkName, requestVarName, requestVarPartName, paramName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(addressingCopyString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates an BPEL Assign Element as String, which reads Response Message Data into internal - * PropertyVariables - * - * @param variableName the Response Message variable name - * @param part the part name of response message - * @param toscaWsdlMappings Mappings from TOSCA Output Parameters to WSDL Response message - * Elements - * @param paramPropertyMappings Mappings from TOSCA Output Parameters to Properties - * @param assignName the name attribute of the assign - * @param MessageDeclId the XML Schema Declaration of the Response Message as QName - * @return BPEL Assign Element as DOM Node - */ - public Node generateResponseAssignAsNode(final String variableName, final String part, - final Map paramPropertyMappings, final String assignName, - final QName MessageDeclId, final String planOutputMsgName, - final String planOutputMsgPartName) throws SAXException, IOException { - final String templateString = - generateResponseAssignAsString(variableName, part, paramPropertyMappings, assignName, MessageDeclId, - planOutputMsgName, planOutputMsgPartName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates an BPEL Assign Element as String, which reads Response Message Data into internal - * PropertyVariables - * - * @param variableName the Response Message variable name - * @param part the part name of response message - * @param toscaWsdlMappings Mappings from TOSCA Output Parameters to WSDL Response message - * Elements - * @param paramPropertyMappings Mappings from TOSCA Output Parameters to Properties - * @param assignName the name attribute of the assign - * @param MessageDeclId the XML Schema Declaration of the Response Message as QName - * @return BPEL Assign Element as String - */ - public String generateResponseAssignAsString(final String variableName, final String part, - final Map paramPropertyMappings, - final String assignName, final QName MessageDeclId, - final String planOutputMsgName, final String planOutputMsgPartName) { - String assignAsString = - ""; - - for (final String toscaParam : paramPropertyMappings.keySet()) { - final Variable propWrapper = paramPropertyMappings.get(toscaParam); - if (propWrapper == null) { - - final String internalCopyString = - ""; - final String internalQueryString = - ""; - final String internalToString = ""; - final String internalQueryStringToOutput = - ""; - assignAsString += internalCopyString; - assignAsString += internalQueryString; - assignAsString += internalToString; - assignAsString += internalQueryStringToOutput; - - } else { - // interal parameter, assign response message element value to - // internal property variable - - final String internalCopyString = - ""; - final String internalQueryString = - ""; - final String internalToString = - ""; - assignAsString += internalCopyString; - assignAsString += internalQueryString; - assignAsString += internalToString; - } - } - assignAsString += ""; - ResourceHandler.LOG.debug("Generated following assign element:"); - ResourceHandler.LOG.debug(assignAsString); - return assignAsString; - } - - /** - * Generates a BPEL Copy snippet from a single variable to a invoker message body, where the - * value of the variable is added as ServiceInstanceID to the invoker message. - * - * @param bpelVarName the Name of the BPEL variable to use - * @param requestVarName the name of the request variable holding a invoker request - * @param requestVarPartName the name of part inside the invoker request message - * @return a String containing a BPEL copy element - * @throws IOException when the reading of an internal file fails - * @throws SAXException when parsing the internal file fails - */ - public Node generateServiceInstanceCopyAsNode(final String bpelVarName, final String requestVarName, - final String requestVarPartName) throws IOException, SAXException { - final String serviceInstanceCopyString = - generateServiceInstanceIDCopy(bpelVarName, requestVarName, requestVarPartName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(serviceInstanceCopyString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Generates a BPEL Copy snippet from the plan input message 'CorrelationID' property to the - * invoker message - * - * @param requestVarName the name of the request variable holding a invoker request - * @param requestVarPartName the name of part inside the invoker request message - * @return a String containing a BPEL copy element - * @throws IOException when reading internal files fails - */ - private String generateCorrelationIdCopy(final String requestVarName, - final String requestVarPartName) throws IOException { - LOG.debug("Starting to load correlationIDCopy.xml"); - final URL url = this.getContext().getBundle() - .getResource("correlationIdCopy.xml"); - LOG.debug("URL inside OSGI framework to load xml: " + url); - final File correlationIdCopy = new File(FileLocator.toFileURL(url).getPath()); - LOG.debug("Loaded XML file: " + correlationIdCopy); - String correlationIdCopyString = FileUtils.readFileToString(correlationIdCopy); - correlationIdCopyString = correlationIdCopyString.replace("{requestVarName}", requestVarName); - correlationIdCopyString = correlationIdCopyString.replace("{requestVarPartName}", requestVarPartName); - - return correlationIdCopyString; - } - - /** - * Generates a BPEL Copy snippet from a single variable to a invoker message body, where the - * value of the variable is added as ServiceInstanceID to the invoker message. - * - * @param bpelVarName the Name of the BPEL variable to use - * @param requestVarName the name of the request variable holding a invoker request - * @param requestVarPartName the name of part inside the invoker request message - * @return a String containing a BPEL copy element - * @throws IOException when reading internal files fail - */ - public String generateServiceInstanceIDCopy(final String bpelVarName, final String requestVarName, - final String requestVarPartName) throws IOException { - final URL url = this.getContext().getBundle() - .getResource("serviceInstanceCopy.xml"); - final File serviceInstanceCopy = new File(FileLocator.toFileURL(url).getPath()); - String serviceInstanceCopyString = FileUtils.readFileToString(serviceInstanceCopy); - - serviceInstanceCopyString = serviceInstanceCopyString.replace("{bpelVarName}", bpelVarName); - serviceInstanceCopyString = serviceInstanceCopyString.replace("{requestVarName}", requestVarName); - serviceInstanceCopyString = serviceInstanceCopyString.replace("{requestVarPartName}", requestVarPartName); - - return serviceInstanceCopyString; - } - - public String generateNodeInstanceIdCopy(final String bpelVarName, final String requestVarName, - final String requestVarPartName) throws IOException { - final URL url = - this.getContext().getBundle().getResource("nodeInstanceCopy.xml"); - final File serviceInstanceCopy = new File(FileLocator.toFileURL(url).getPath()); - String serviceInstanceCopyString = FileUtils.readFileToString(serviceInstanceCopy); - - serviceInstanceCopyString = serviceInstanceCopyString.replace("{bpelVarName}", bpelVarName); - serviceInstanceCopyString = serviceInstanceCopyString.replace("{requestVarName}", requestVarName); - serviceInstanceCopyString = serviceInstanceCopyString.replace("{requestVarPartName}", requestVarPartName); - - return serviceInstanceCopyString; - } - - public Node generateNodeInstanceIdCopyAsNode(final String bpelVarName, final String requestVarName, - final String requestVarPartName) throws IOException, SAXException { - final String nodeInstanceCopyString = - generateNodeInstanceIdCopy(bpelVarName, requestVarName, requestVarPartName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(nodeInstanceCopyString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - - private String generateServiceInvokerExternalParamCopyString(final String requestVarName, - final String requestVarPartName, - final String paramName) throws IOException { - final URL url = this.getContext().getBundle() - .getResource("externalParamCopy.xml"); - final File copyTemplateFile = new File(FileLocator.toFileURL(url).getPath()); - String copyTemplateString = FileUtils.readFileToString(copyTemplateFile); - - // {paramName}, {requestVarName}, {requestVarPartName} - copyTemplateString = copyTemplateString.replace("{paramName}", paramName); - copyTemplateString = copyTemplateString.replace("{requestVarName}", requestVarName); - copyTemplateString = copyTemplateString.replace("{requestVarPartName}", requestVarPartName); - - return copyTemplateString; - } - - private String generateServiceInvokerInternalParamCopyString(final String bpelVarName, final String requestVarName, - final String requestVarPartName, - final String paramName) throws IOException { - final URL url = this.getContext().getBundle() - .getResource("internalParamCopy.xml"); - final File copyTemplateFile = new File(FileLocator.toFileURL(url).getPath()); - String copyTemplateString = FileUtils.readFileToString(copyTemplateFile); - - // {bpelVarName}, {requestVarName}, {requestVarPartName}, {paramName} - copyTemplateString = copyTemplateString.replace("{bpelVarName}", bpelVarName); - copyTemplateString = copyTemplateString.replace("{requestVarName}", requestVarName); - copyTemplateString = copyTemplateString.replace("{requestVarPartName}", requestVarPartName); - copyTemplateString = copyTemplateString.replace("{paramName}", paramName); - return copyTemplateString; - } - - private String generateServiceInvokerParamsMap(final Map internalExternalProps) { - String paramsMapString = ""; - for (final String key : internalExternalProps.keySet()) { - paramsMapString += - "" + key + "value"; - } - paramsMapString += ""; - return paramsMapString; - } - - public String getServiceInvokerAsyncRequestMessagePart() { - return "invokeOperationAsync"; - } - - public QName getServiceInvokerAsyncRequestMessageType() { - return new QName("http://siserver.org/wsdl", "invokeOperationAsyncMessage"); - } - - public QName getServiceInvokerAsyncRequestXSDType() { - return new QName("http://siserver.org/schema", "invokeOperationAsync"); - } - - public String getServiceInvokerAsyncResponseMessagePart() { - return "invokeResponse"; - } - - public QName getServiceInvokerAsyncResponseMessageType() { - return new QName("http://siserver.org/wsdl", "invokeResponse"); - } - - public QName getServiceInvokerAsyncResponseXSDType() { - return new QName("http://siserver.org/schema", "invokeResponse"); - } - - public QName getServiceInvokerCallbackPortType() { - return new QName("http://siserver.org/wsdl", "CallbackPortType"); - } - - public QName getServiceInvokerPortType() { - return new QName("http://siserver.org/wsdl", "InvokePortType"); - } - - public File getServiceInvokerWSDLFile(final File invokerXsdFile, final int id) throws IOException { - final URL url = this.getContext().getBundle().getResource("invoker.wsdl"); - final File wsdlFile = new File(FileLocator.toFileURL(url).getPath()); - - final File tempFile = createNewTempFile(wsdlFile, id); - - final String fileName = invokerXsdFile.getName(); - - FileUtils.write(tempFile, FileUtils.readFileToString(tempFile).replaceAll("invoker.xsd", fileName)); - - return tempFile; - } - - public File getServiceInvokerXSDFile(final int id) throws IOException { - final URL url = this.getContext().getBundle().getResource("invoker.xsd"); - final File xsdFile = new File(FileLocator.toFileURL(url).getPath()); - final File tempFile = createNewTempFile(xsdFile, id); - return tempFile; - - } - -} diff --git a/org.opentosca.planbuilder.selection.plugin.firstavailable/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.selection.plugin.firstavailable/META-INF/MANIFEST.MF deleted file mode 100644 index b676a91ee..000000000 --- a/org.opentosca.planbuilder.selection.plugin.firstavailable/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Selection Core Plugin First Available -Bundle-SymbolicName: org.opentosca.planbuilder.selection.plugin.firstavailable -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.osgi.framework;version="1.3.0" -Bundle-ClassPath: . -Require-Bundle: org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Export-Package: org.opentosca.planbuilder.selection.plugin.firstavailable.core -Bundle-Activator: org.opentosca.planbuilder.selection.plugin.firstavailable.Activator diff --git a/org.opentosca.planbuilder.selection.plugin.firstavailable/build.properties b/org.opentosca.planbuilder.selection.plugin.firstavailable/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.planbuilder.selection.plugin.firstavailable/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.planbuilder.selection.plugin.firstavailable/pom.xml b/org.opentosca.planbuilder.selection.plugin.firstavailable/pom.xml deleted file mode 100644 index 1b54b363e..000000000 --- a/org.opentosca.planbuilder.selection.plugin.firstavailable/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.selection.plugin.firstavailable - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/Activator.java b/org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/Activator.java deleted file mode 100644 index 79360f26d..000000000 --- a/org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/Activator.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.opentosca.planbuilder.selection.plugin.firstavailable; - -import org.opentosca.planbuilder.plugins.typebased.IScalingPlanBuilderSelectionPlugin; -import org.opentosca.planbuilder.selection.plugin.firstavailable.bpel.BPELFirstAvailablePlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration registration; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = Activator.context.registerService(IScalingPlanBuilderSelectionPlugin.class.getName(), - new BPELFirstAvailablePlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.selection.plugin.input/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.selection.plugin.input/META-INF/MANIFEST.MF deleted file mode 100644 index d62783c08..000000000 --- a/org.opentosca.planbuilder.selection.plugin.input/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Selection Core Plugin Input -Bundle-SymbolicName: org.opentosca.planbuilder.selection.plugin.input -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.osgi.framework;version="1.3.0" -Bundle-ClassPath: . -Require-Bundle: org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Export-Package: org.opentosca.planbuilder.selection.plugin.input.core -Bundle-Activator: org.opentosca.planbuilder.selection.plugin.input.Activator diff --git a/org.opentosca.planbuilder.selection.plugin.input/build.properties b/org.opentosca.planbuilder.selection.plugin.input/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.planbuilder.selection.plugin.input/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.planbuilder.selection.plugin.input/pom.xml b/org.opentosca.planbuilder.selection.plugin.input/pom.xml deleted file mode 100644 index 1d067e019..000000000 --- a/org.opentosca.planbuilder.selection.plugin.input/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.selection.plugin.input - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/Activator.java b/org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/Activator.java deleted file mode 100644 index c6ea9daf7..000000000 --- a/org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/Activator.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.opentosca.planbuilder.selection.plugin.input; - -import org.opentosca.planbuilder.plugins.typebased.IScalingPlanBuilderSelectionPlugin; -import org.opentosca.planbuilder.selection.plugin.input.bpel.BPELSelectionInputPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration registration; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = Activator.context.registerService(IScalingPlanBuilderSelectionPlugin.class.getName(), - new BPELSelectionInputPlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/META-INF/MANIFEST.MF deleted file mode 100644 index d77a0ed46..000000000 --- a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Selection Core Plugin First Available -Bundle-SymbolicName: org.opentosca.planbuilder.selection.plugin.mosquitto.workload -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.osgi.framework;version="1.3.0" -Bundle-ClassPath: . -Require-Bundle: org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Export-Package: org.opentosca.planbuilder.selection.plugin.mosquitto.workload.core -Bundle-Activator: org.opentosca.planbuilder.selection.plugin.mosquitto.workload.Activator diff --git a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/build.properties b/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/pom.xml b/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/pom.xml deleted file mode 100644 index 304c8b02d..000000000 --- a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.selection.plugin.mosquitto.workload - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/Activator.java b/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/Activator.java deleted file mode 100644 index 115b8c38a..000000000 --- a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/Activator.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.opentosca.planbuilder.selection.plugin.mosquitto.workload; - -import org.opentosca.planbuilder.plugins.typebased.IScalingPlanBuilderSelectionPlugin; -import org.opentosca.planbuilder.selection.plugin.mosquitto.workload.bpel.BPELMosquittoSelectionPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration registration; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = Activator.context.registerService(IScalingPlanBuilderSelectionPlugin.class.getName(), - new BPELMosquittoSelectionPlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.service/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.service/META-INF/MANIFEST.MF deleted file mode 100644 index cc7d8320c..000000000 --- a/org.opentosca.planbuilder.service/META-INF/MANIFEST.MF +++ /dev/null @@ -1,36 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: PlanBuilder REST Service -Bundle-SymbolicName: org.opentosca.planbuilder.service -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: io.swagger.annotations;version="1.5.7.SNAPSHOT", - javax.servlet;version="2.5.0", - javax.ws.rs;version="1.1.1", - javax.ws.rs.core;version="1.1.1", - org.apache.commons.io;version="2.2.0", - org.apache.http;version="4.2.1", - org.apache.http.client;version="4.2.0", - org.apache.http.client.entity;version="4.2.0", - org.apache.http.entity;version="4.3.3", - org.apache.http.entity.mime;version="4.2.0", - org.apache.http.entity.mime.content;version="4.2.0", - org.apache.http.message;version="4.3.3", - org.apache.ode.schemas.dd._2007._03, - org.glassfish.jersey.servlet;version="2.22.2", - org.json.simple, - org.osgi.framework;version="1.6.0", - org.osgi.service.component;version="1.1.0", - org.osgi.service.http;version="1.2.1", - org.slf4j;version="1.7.5" -Bundle-Activator: org.opentosca.planbuilder.service.Activator -Service-Component: OSGI-INF/* -Export-Package: org.eclipse.winery.model.selfservice, - org.opentosca.planbuilder.service, - org.opentosca.planbuilder.service.model, - org.opentosca.planbuilder.service.resources -Bundle-ActivationPolicy: lazy -Require-Bundle: org.opentosca.container.core;bundle-version="1.0.0", - org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.integration;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0" diff --git a/org.opentosca.planbuilder.service/OSGI-INF/HTTPcomponent.xml b/org.opentosca.planbuilder.service/OSGI-INF/HTTPcomponent.xml deleted file mode 100644 index 661f02813..000000000 --- a/org.opentosca.planbuilder.service/OSGI-INF/HTTPcomponent.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/org.opentosca.planbuilder.service/OSGI-INF/OpenTOSCACoreFilecomponent.xml b/org.opentosca.planbuilder.service/OSGI-INF/OpenTOSCACoreFilecomponent.xml deleted file mode 100644 index 4062198d1..000000000 --- a/org.opentosca.planbuilder.service/OSGI-INF/OpenTOSCACoreFilecomponent.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/org.opentosca.planbuilder.service/OSGI-INF/OpenTOSCAHTTPcomponent.xml b/org.opentosca.planbuilder.service/OSGI-INF/OpenTOSCAHTTPcomponent.xml deleted file mode 100644 index 85ac03354..000000000 --- a/org.opentosca.planbuilder.service/OSGI-INF/OpenTOSCAHTTPcomponent.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/org.opentosca.planbuilder.service/build.properties b/org.opentosca.planbuilder.service/build.properties deleted file mode 100644 index 686be4f32..000000000 --- a/org.opentosca.planbuilder.service/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/ diff --git a/org.opentosca.planbuilder.service/pom.xml b/org.opentosca.planbuilder.service/pom.xml deleted file mode 100644 index a5e7bd517..000000000 --- a/org.opentosca.planbuilder.service/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.service - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/Application.java b/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/Application.java deleted file mode 100644 index 99fca7617..000000000 --- a/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/Application.java +++ /dev/null @@ -1,314 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) -// Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source -// schema. -// Generated on: 2017.06.28 at 10:18:28 AM CEST -// - -package org.eclipse.winery.model.selfservice; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlList; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType>
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="csarName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="displayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="version" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    - *         <element name="authors" minOccurs="0">
    - *           <simpleType>
    - *             <list itemType="{http://www.w3.org/2001/XMLSchema}string" />
    - *           </simpleType>
    - *         </element>
    - *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="iconUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="imageUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="options">
    - *           <complexType>
    - *             <complexContent>
    - *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *                 <sequence>
    - *                   <element name="option" type="{http://www.eclipse.org/winery/model/selfservice}ApplicationOption" maxOccurs="unbounded" minOccurs="0"/>
    - *                 </sequence>
    - *               </restriction>
    - *             </complexContent>
    - *           </complexType>
    - *         </element>
    - *       </sequence>
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", - propOrder = {"csarName", "displayName", "version", "authors", "description", "iconUrl", "imageUrl", "options"}) -@XmlRootElement(name = "Application") -public class Application { - - @XmlElement(required = true) - protected String csarName; - @XmlElement(required = true) - protected String displayName; - protected String version; - @XmlList - protected List authors; - @XmlElement(required = true) - protected String description; - @XmlElement(required = true) - protected String iconUrl; - @XmlElement(required = true) - protected String imageUrl; - @XmlElement(required = true) - protected Application.Options options; - - - /** - * Gets the value of the csarName property. - * - * @return possible object is {@link String } - * - */ - public String getCsarName() { - return this.csarName; - } - - /** - * Sets the value of the csarName property. - * - * @param value allowed object is {@link String } - * - */ - public void setCsarName(final String value) { - this.csarName = value; - } - - /** - * Gets the value of the displayName property. - * - * @return possible object is {@link String } - * - */ - public String getDisplayName() { - return this.displayName; - } - - /** - * Sets the value of the displayName property. - * - * @param value allowed object is {@link String } - * - */ - public void setDisplayName(final String value) { - this.displayName = value; - } - - /** - * Gets the value of the version property. - * - * @return possible object is {@link String } - * - */ - public String getVersion() { - return this.version; - } - - /** - * Sets the value of the version property. - * - * @param value allowed object is {@link String } - * - */ - public void setVersion(final String value) { - this.version = value; - } - - /** - * Gets the value of the authors property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the authors property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -     * getAuthors().add(newItem);
    -     * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link String } - * - * - */ - public List getAuthors() { - if (this.authors == null) { - this.authors = new ArrayList<>(); - } - return this.authors; - } - - /** - * Gets the value of the description property. - * - * @return possible object is {@link String } - * - */ - public String getDescription() { - return this.description; - } - - /** - * Sets the value of the description property. - * - * @param value allowed object is {@link String } - * - */ - public void setDescription(final String value) { - this.description = value; - } - - /** - * Gets the value of the iconUrl property. - * - * @return possible object is {@link String } - * - */ - public String getIconUrl() { - return this.iconUrl; - } - - /** - * Sets the value of the iconUrl property. - * - * @param value allowed object is {@link String } - * - */ - public void setIconUrl(final String value) { - this.iconUrl = value; - } - - /** - * Gets the value of the imageUrl property. - * - * @return possible object is {@link String } - * - */ - public String getImageUrl() { - return this.imageUrl; - } - - /** - * Sets the value of the imageUrl property. - * - * @param value allowed object is {@link String } - * - */ - public void setImageUrl(final String value) { - this.imageUrl = value; - } - - /** - * Gets the value of the options property. - * - * @return possible object is {@link Application.Options } - * - */ - public Application.Options getOptions() { - return this.options; - } - - /** - * Sets the value of the options property. - * - * @param value allowed object is {@link Application.Options } - * - */ - public void setOptions(final Application.Options value) { - this.options = value; - } - - - /** - *

    - * Java class for anonymous complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    -     * <complexType>
    -     *   <complexContent>
    -     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    -     *       <sequence>
    -     *         <element name="option" type="{http://www.eclipse.org/winery/model/selfservice}ApplicationOption" maxOccurs="unbounded" minOccurs="0"/>
    -     *       </sequence>
    -     *     </restriction>
    -     *   </complexContent>
    -     * </complexType>
    -     * 
    - * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = {"option"}) - public static class Options { - - protected List option; - - - /** - * Gets the value of the option property. - * - *

    - * This accessor method returns a reference to the live list, not a snapshot. Therefore any - * modification you make to the returned list will be present inside the JAXB object. This is why - * there is not a set method for the option property. - * - *

    - * For example, to add a new item, do as follows: - * - *

    -         * getOption().add(newItem);
    -         * 
    - * - * - *

    - * Objects of the following type(s) are allowed in the list {@link ApplicationOption } - * - * - */ - public List getOption() { - if (this.option == null) { - this.option = new ArrayList<>(); - } - return this.option; - } - - } - -} diff --git a/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/ApplicationOption.java b/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/ApplicationOption.java deleted file mode 100644 index 9daeef4d4..000000000 --- a/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/ApplicationOption.java +++ /dev/null @@ -1,184 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.06.28 at 10:18:28 AM CEST -// - - -package org.eclipse.winery.model.selfservice; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

    - * Java class for ApplicationOption complex type. - * - *

    - * The following schema fragment specifies the expected content contained within this class. - * - *

    - * <complexType name="ApplicationOption">
    - *   <complexContent>
    - *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    - *       <sequence>
    - *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="iconUrl" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
    - *         <element name="planServiceName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *         <element name="planInputMessageUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    - *       </sequence>
    - *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    - *     </restriction>
    - *   </complexContent>
    - * </complexType>
    - * 
    - * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ApplicationOption", propOrder = {"description", "iconUrl", "planServiceName", "planInputMessageUrl"}) -public class ApplicationOption { - - @XmlElement(required = true) - protected String description; - @XmlElement(required = true) - @XmlSchemaType(name = "anyURI") - protected String iconUrl; - @XmlElement(required = true) - protected String planServiceName; - @XmlElement(required = true) - protected String planInputMessageUrl; - @XmlAttribute(name = "id", required = true) - protected String id; - @XmlAttribute(name = "name", required = true) - protected String name; - - /** - * Gets the value of the description property. - * - * @return possible object is {@link String } - * - */ - public String getDescription() { - return this.description; - } - - /** - * Sets the value of the description property. - * - * @param value allowed object is {@link String } - * - */ - public void setDescription(final String value) { - this.description = value; - } - - /** - * Gets the value of the iconUrl property. - * - * @return possible object is {@link String } - * - */ - public String getIconUrl() { - return this.iconUrl; - } - - /** - * Sets the value of the iconUrl property. - * - * @param value allowed object is {@link String } - * - */ - public void setIconUrl(final String value) { - this.iconUrl = value; - } - - /** - * Gets the value of the planServiceName property. - * - * @return possible object is {@link String } - * - */ - public String getPlanServiceName() { - return this.planServiceName; - } - - /** - * Sets the value of the planServiceName property. - * - * @param value allowed object is {@link String } - * - */ - public void setPlanServiceName(final String value) { - this.planServiceName = value; - } - - /** - * Gets the value of the planInputMessageUrl property. - * - * @return possible object is {@link String } - * - */ - public String getPlanInputMessageUrl() { - return this.planInputMessageUrl; - } - - /** - * Sets the value of the planInputMessageUrl property. - * - * @param value allowed object is {@link String } - * - */ - public void setPlanInputMessageUrl(final String value) { - this.planInputMessageUrl = value; - } - - /** - * Gets the value of the id property. - * - * @return possible object is {@link String } - * - */ - public String getId() { - return this.id; - } - - /** - * Sets the value of the id property. - * - * @param value allowed object is {@link String } - * - */ - public void setId(final String value) { - this.id = value; - } - - /** - * Gets the value of the name property. - * - * @return possible object is {@link String } - * - */ - public String getName() { - return this.name; - } - - /** - * Sets the value of the name property. - * - * @param value allowed object is {@link String } - * - */ - public void setName(final String value) { - this.name = value; - } - -} diff --git a/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/ObjectFactory.java b/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/ObjectFactory.java deleted file mode 100644 index e0d28a2aa..000000000 --- a/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/ObjectFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, vJAXB 2.1.10 in JDK 6 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2014.11.11 at 08:37:59 AM CET -// - - -package org.eclipse.winery.model.selfservice; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each Java content interface and Java element interface - * generated in the org.eclipse.winery.model.selfservice package. - *

    - * An ObjectFactory allows you to programatically construct new instances of the Java representation - * for XML content. The Java representation of XML content can consist of schema derived interfaces - * and classes representing the binding of schema type definitions, element declarations and model - * groups. Factory methods for each of these are provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for - * package: org.eclipse.winery.model.selfservice - * - */ - public ObjectFactory() {} - - /** - * Create an instance of {@link Application } - * - */ - public Application createApplication() { - return new Application(); - } - - /** - * Create an instance of {@link ApplicationOption } - * - */ - public ApplicationOption createApplicationOption() { - return new ApplicationOption(); - } - - /** - * Create an instance of {@link Application.Options } - * - */ - public Application.Options createApplicationOptions() { - return new Application.Options(); - } - -} diff --git a/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/package-info.java b/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/package-info.java deleted file mode 100644 index 2d2370bac..000000000 --- a/org.opentosca.planbuilder.service/src/org/eclipse/winery/model/selfservice/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference -// Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2017.06.28 at 10:18:28 AM CEST -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.eclipse.org/winery/model/selfservice", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.eclipse.winery.model.selfservice; diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Activator.java b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Activator.java deleted file mode 100644 index a057571f4..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.service; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * Copyright 2015 IAAS University of Stuttgart
    - *
    - * - *

    - * Activator class for the PlanBuilder Service - *

    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/PlanBuilderService.java b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/PlanBuilderService.java deleted file mode 100644 index cef79cd01..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/PlanBuilderService.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.service; - -import java.util.HashSet; -import java.util.Set; - -import javax.ws.rs.core.Application; - -import org.opentosca.planbuilder.service.resources.RootResource; -import org.opentosca.planbuilder.service.resources.TaskResource; - -/** - * Copyright 2015 IAAS University of Stuttgart
    - *
    - * - *

    - * Main entry class for the PlanBuilder Service - *

    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class PlanBuilderService extends Application { - - @Override - public Set> getClasses() { - - final Set> s = new HashSet<>(); - - // add root resource - s.add(RootResource.class); - s.add(TaskResource.class); - - return s; - } - -} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/RunningTasks.java b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/RunningTasks.java deleted file mode 100644 index a43f6921f..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/RunningTasks.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.service; - -import java.util.HashMap; -import java.util.Map; - -import org.opentosca.planbuilder.service.model.PlanGenerationState; - -/** - * Copyright 2015 IAAS University of Stuttgart
    - *
    - * - *

    - * Simple implementation for storing the tasks generated by the PlanBuilder service - *

    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class RunningTasks { - - public static Map tasks = new HashMap<>(); - - public static String generateId() { - final String newId = String.valueOf(System.currentTimeMillis()); - if (RunningTasks.tasks.containsKey(newId)) { - return RunningTasks.generateId(); - } else { - return newId; - } - } -} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/ServiceRegistry.java b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/ServiceRegistry.java deleted file mode 100644 index 6f9218dab..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/ServiceRegistry.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.service; - -import java.util.Dictionary; -import java.util.Hashtable; - -import org.glassfish.jersey.servlet.ServletContainer; -import org.opentosca.container.core.service.ICoreFileService; -import org.opentosca.container.core.service.IHTTPService; -import org.osgi.service.http.HttpService; - -/** - * Copyright 2015 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class ServiceRegistry { - - private static IHTTPService openToscaHttpService = null; - private static ICoreFileService openToscaCoreFileService = null; - - - public static IHTTPService getHTTPService() { - return ServiceRegistry.openToscaHttpService; - } - - public static ICoreFileService getCoreFileService() { - return ServiceRegistry.openToscaCoreFileService; - } - - protected void bindOpenToscaHttpService(final IHTTPService httpService) { - ServiceRegistry.openToscaHttpService = httpService; - } - - protected void unbindOpenToscaHttpService(final IHTTPService httpService) { - ServiceRegistry.openToscaHttpService = null; - } - - protected void bindOpenToscaCoreFileService(final ICoreFileService coreFileService) { - ServiceRegistry.openToscaCoreFileService = coreFileService; - } - - protected void unbindOpenToscaCoreFileService(final ICoreFileService coreFileService) { - ServiceRegistry.openToscaCoreFileService = null; - } - - protected void bindHttpService(final HttpService httpService) { - - final Dictionary initParams = new Hashtable<>(); - initParams.put("javax.ws.rs.Application", PlanBuilderService.class.getName()); - // initParams.put("com.sun.jersey.api.json.POJOMappingFeature", - // "true"); - - // TODO: Temporary workaround - // This is a workaround related to issue JERSEY-2093; grizzly - // (1.9.5) - final ClassLoader classLoader = this.getClass().getClassLoader(); - final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); - try { - Thread.currentThread().setContextClassLoader(classLoader); - httpService.registerServlet("/planbuilder", new ServletContainer(), initParams, null); - } - catch (final Exception ex) { - ex.printStackTrace(); - - } - finally { - Thread.currentThread().setContextClassLoader(contextClassLoader); - } - } - - protected void unbindHttpService(final HttpService httpService) { - httpService.unregister("/planbuilder"); - } - -} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/TaskWorkerRunnable.java b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/TaskWorkerRunnable.java deleted file mode 100644 index 64042eadd..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/TaskWorkerRunnable.java +++ /dev/null @@ -1,413 +0,0 @@ -package org.opentosca.planbuilder.service; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import javax.xml.namespace.QName; - -import org.apache.commons.io.FileUtils; -import org.apache.http.HeaderElement; -import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.NameValuePair; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.entity.EntityBuilder; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.entity.mime.content.ContentBody; -import org.apache.http.entity.mime.content.FileBody; -import org.apache.http.entity.mime.content.StringBody; -import org.apache.http.message.BasicHeader; -import org.json.simple.JSONObject; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.IHTTPService; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.service.Util.SelfServiceOptionWrapper; -import org.opentosca.planbuilder.service.model.PlanGenerationState; -import org.opentosca.planbuilder.service.model.PlanGenerationState.PlanGenerationStates; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Copyright 2015 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class TaskWorkerRunnable implements Runnable { - - private final PlanGenerationState state; - - final private static Logger LOG = LoggerFactory.getLogger(TaskWorkerRunnable.class); - - - public TaskWorkerRunnable(final PlanGenerationState state) { - this.state = state; - } - - public PlanGenerationState getState() { - return this.state; - } - - public static String read(final InputStream input) throws IOException { - try (BufferedReader buffer = new BufferedReader(new InputStreamReader(input))) { - return buffer.lines().collect(Collectors.joining("\n")); - } - } - - @Override - @SuppressWarnings("unchecked") - public void run() { - - LOG.debug("Starting to download CSAR"); - this.state.currentState = PlanGenerationState.PlanGenerationStates.CSARDOWNLOADING; - // download csar - final IHTTPService openToscaHttpService = ServiceRegistry.getHTTPService(); - - if (openToscaHttpService == null) { - this.state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; - this.state.currentMessage = "Couldn't aquire internal HTTP Service to download CSAR"; - LOG.error("Couldn't aquire internal HTTP Service to download CSAR"); - return; - } - CSARID csarId = null; - InputStream csarInputStream = null; - try { - LOG.debug("Downloading CSAR " + this.state.getCsarUrl()); - - final Map headers = new HashMap<>(); - - headers.put("Accept", "application/zip"); - - final HttpResponse csarResponse = openToscaHttpService.Get(this.state.getCsarUrl().toString(), headers); - - csarInputStream = csarResponse.getEntity().getContent(); - - - String fileName = null; - for (final org.apache.http.Header header : csarResponse.getAllHeaders()) { - if (header.getName().contains("Content-Disposition")) { - for (final HeaderElement elem : header.getElements()) { - if (elem.getName().equals("attachment")) { - for (final NameValuePair nameValuePair : elem.getParameters()) { - if (nameValuePair.getName().equals("filename")) { - fileName = nameValuePair.getValue(); - } - } - } - } - - } - } - - if (fileName == null) { - // robustness hack (*g*) - fileName = this.state.getCsarUrl().toString().replace("?csar", ""); - if (fileName.endsWith("/")) { - fileName = fileName.substring(0, fileName.length() - 1); - } - fileName = fileName.substring(fileName.lastIndexOf("/") + 1); - } - - this.state.currentState = PlanGenerationStates.CSARDOWNLOADED; - this.state.currentMessage = "Downloaded CSAR"; - LOG.debug("CSAR download finished"); - - if (fileName == null) { - LOG.debug("CSAR Filename couldn't be determined"); - this.state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; - this.state.currentMessage = "CSAR Filename couldn't be determined"; - return; - } - - fileName = fileName.replace(".csar", "") + ".planbuilder" + System.currentTimeMillis() + ".csar"; - // generate plan (assumption: the send csar contains only one - // topologytemplate => only one buildPlan will be generated - LOG.debug("Storing CSAR"); - csarId = Util.storeCSAR(fileName, csarInputStream); - } - catch (final ClientProtocolException e) { - this.state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; - this.state.currentMessage = "Couldn't download CSAR"; - LOG.error("Couldn't download CSAR"); - return; - } - catch (final IOException e) { - this.state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; - this.state.currentMessage = "Couldn't download CSAR"; - LOG.error("Couldn't download CSAR"); - return; - } - - if (csarInputStream == null) { - this.state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; - this.state.currentMessage = "Couldn't download CSAR"; - LOG.error("Couldn't download CSAR"); - return; - } - - if (csarId != null) { - this.state.currentState = PlanGenerationStates.PLANGENERATING; - this.state.currentMessage = "Generating Plan"; - LOG.debug("Starting to generate Plan"); - } else { - this.state.currentState = PlanGenerationStates.CSARDOWNLOADFAILED; - this.state.currentMessage = "Couldn't store CSAR"; - LOG.error("Couldn't store CSAR"); - Util.deleteCSAR(csarId); - return; - } - - final List buildPlans = Util.startPlanBuilder(csarId); - - if (buildPlans.size() <= 0) { - this.state.currentState = PlanGenerationStates.PLANGENERATIONFAILED; - this.state.currentMessage = "No plans could be generated"; - Util.deleteCSAR(csarId); - LOG.error("No plans could be generated"); - return; - } - - this.state.currentState = PlanGenerationStates.PLANSGENERATED; - this.state.currentMessage = "Stored and generated Plans"; - LOG.debug("Stored and generated Plans"); - - final Map plansToUpload = new HashMap<>(); - - for (final AbstractPlan buildPlan : buildPlans) { - final File planTmpFile = Util.writePlan2TmpFolder((BPELPlan) buildPlan); - plansToUpload.put((BPELPlan) buildPlan, planTmpFile); - } - - LOG.debug("Plans to upload: " + buildPlans.size()); - - for (final AbstractPlan buildPlan : plansToUpload.keySet()) { - - // write to tmp dir, only generating one plan - final File planTmpFile = plansToUpload.get(buildPlan); - - final List inputParameters = ((BPELPlan) buildPlan).getWsdl().getInputMessageLocalNames(); - final List outputParameters = ((BPELPlan) buildPlan).getWsdl().getOuputMessageLocalNames(); - - final JSONObject obj = new JSONObject(); - - obj.put("name", QName.valueOf(buildPlan.getId()).getLocalPart()); - obj.put("planType", buildPlan.getType().getString()); - obj.put("planLanguage", BPELPlan.bpelNamespace); - - final HashMap> inputParams = new HashMap<>(); - inputParams.put("inputParameter", createParameters(inputParameters)); - obj.put("inputParameters", inputParams); - - final HashMap> outputParams = new HashMap<>(); - outputParams.put("outputParameter", createParameters(outputParameters)); - obj.put("outputParameters", outputParams); - - final HttpEntity ent = - EntityBuilder.create().setText(obj.toJSONString()).setContentType(ContentType.APPLICATION_JSON).build(); - - HttpResponse createPlanResponse = null; - try { - createPlanResponse = openToscaHttpService.Post(getState().getPostUrl().toString(), ent, - new BasicHeader("Accept", "application/json"), - new BasicHeader("Content-Type", "application/json")); - } - catch (final Exception e) { - this.state.currentState = PlanGenerationStates.PLANSENDINGFAILED; - this.state.currentMessage = - "Couldn't send plan. Server send status " + createPlanResponse.getStatusLine().getStatusCode(); - LOG.error("[{}] {}", this.state.currentState, this.state.currentMessage); - Util.deleteCSAR(csarId); - return; - } - - final org.apache.http.Header planLocationHeader = createPlanResponse.getHeaders("Location")[0]; - - String planLocation = planLocationHeader.getValue(); - // Remove trailing slash - if (planLocation.endsWith("/")) { - planLocation = planLocation.substring(0, planLocation.length() - 1); - } - - try { - - this.state.currentState = PlanGenerationStates.PLANSENDING; - this.state.currentMessage = "Sending Plan"; - LOG.debug("Sending Plan"); - - // send file - final FileBody bin = new FileBody(planTmpFile); - final ContentBody cb = bin; - final MultipartEntityBuilder mpEntity = MultipartEntityBuilder.create(); - mpEntity.addPart("file", cb); - - final HttpResponse uploadResponse = openToscaHttpService.Put(planLocation + "/file", mpEntity.build()); - if (uploadResponse.getStatusLine().getStatusCode() >= 300) { - // we assume ,if the status code ranges from 300 to 5xx , that - // an error occured - this.state.currentState = PlanGenerationStates.PLANSENDINGFAILED; - this.state.currentMessage = - "Couldn't send plan. Server send status " + uploadResponse.getStatusLine().getStatusCode(); - Util.deleteCSAR(csarId); - LOG.error("Couldn't send plan. Server send status " - + uploadResponse.getStatusLine().getStatusCode()); - return; - } - - - try { - LOG.debug("Starting to send Options"); - this.state.currentState = PlanGenerationStates.OPTIONSENDING; - this.state.currentMessage = "Sending SelfService Option"; - - final URL optionsUrl = new URL(this.state.getCsarUrl(), "selfserviceportal/options/"); - LOG.debug("Sending options to " + optionsUrl.toString()); - - final SelfServiceOptionWrapper option = Util.generateSelfServiceOption((BPELPlan) buildPlan); - - LOG.debug("Sending the following option: " + option.toString()); - - // send plan back - final MultipartEntityBuilder multipartBuilder = MultipartEntityBuilder.create(); - - try { - multipartBuilder.addPart("name", - new StringBody(option.option.getName(), ContentType.TEXT_PLAIN)); - multipartBuilder.addPart("description", new StringBody(option.option.getDescription(), - ContentType.TEXT_PLAIN)); - multipartBuilder.addPart("planServiceName", new StringBody(option.option.getPlanServiceName(), - ContentType.TEXT_PLAIN)); - multipartBuilder.addPart("planInputMessage", new StringBody( - FileUtils.readFileToString(option.planInputMessageFile), ContentType.TEXT_PLAIN)); - } - catch (final UnsupportedEncodingException e1) { - this.state.currentState = PlanGenerationStates.OPTIONSENDINGFAILED; - this.state.currentMessage = "Couldn't generate option to send to winery"; - Util.deleteCSAR(csarId); - LOG.error("Couldn't generate option request to " + optionsUrl.toString()); - return; - } - - // TODO here we should send a default image, instead of the - // message.. - final FileBody fileBody = new FileBody(option.planInputMessageFile); - final ContentBody contentBody = fileBody; - multipartBuilder.addPart("file", contentBody); - - final HttpResponse optionsResponse = - openToscaHttpService.Post(optionsUrl.toString(), multipartBuilder.build()); - - if (optionsResponse.getStatusLine().getStatusCode() >= 300) { - // we assume ,if the status code ranges from 300 to 5xx , that - // an error occured - this.state.currentState = PlanGenerationStates.OPTIONSENDINGFAILED; - this.state.currentMessage = "Couldn't send option to winery. Response: \n StatusCode: " - + optionsResponse.getStatusLine().getStatusCode() + " \n Reason Phrase: \n" - + optionsResponse.getStatusLine().getReasonPhrase(); - Util.deleteCSAR(csarId); - return; - } else { - this.state.currentState = PlanGenerationStates.OPTIONSENT; - this.state.currentMessage = "Sent option. Everythings okay."; - } - } - catch (final MalformedURLException e) { - this.state.currentState = PlanGenerationStates.OPTIONSENDINGFAILED; - this.state.currentMessage = "Couldn't send option to winery."; - Util.deleteCSAR(csarId); - return; - } - catch (final IOException e) { - this.state.currentState = PlanGenerationStates.OPTIONSENDINGFAILED; - this.state.currentMessage = "Couldn't send option to winery."; - Util.deleteCSAR(csarId); - return; - } - - this.state.currentState = PlanGenerationStates.PLANSSENT; - this.state.currentMessage = "Sent plan."; - LOG.debug("Sent plan."); - } - catch (final ClientProtocolException e) { - this.state.currentState = PlanGenerationStates.PLANSENDINGFAILED; - this.state.currentMessage = "Couldn't send plan."; - Util.deleteCSAR(csarId); - LOG.error("Couldn't send plan."); - return; - } - catch (final IOException e) { - this.state.currentState = PlanGenerationStates.PLANSENDINGFAILED; - this.state.currentMessage = "Couldn't send plan."; - Util.deleteCSAR(csarId); - LOG.error("Couldn't send plan."); - return; - } - } - this.state.currentState = PlanGenerationStates.FINISHED; - this.state.currentMessage = "Plans where successfully sent."; - Util.deleteCSAR(csarId); - } - - private List createParameters(final List parameters) { - return parameters.stream().map(p -> new ParameterTupel(p, "xsd:string", "NO")).collect(Collectors.toList()); - } - - private static class ParameterTupel { - - private String name; - private String type; - private String required; - - public ParameterTupel() { - - } - - public ParameterTupel(final String name, final String type, final String required) { - this.name = name; - this.type = type; - this.required = required; - } - - public String getName() { - return this.name; - } - - public void setName(final String name) { - this.name = name; - } - - public String getType() { - return this.type; - } - - public void setType(final String type) { - this.type = type; - } - - public String getRequired() { - return this.required; - } - - public void setRequired(final String required) { - this.required = required; - } - - @Override - public String toString() { - return "{ \"name\": \"" + this.name + "\", \"type\": \"" + this.type + "\", \"required\": \"" - + this.required + "\" }"; - } - } -} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Util.java b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Util.java deleted file mode 100644 index 6a0b125e5..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Util.java +++ /dev/null @@ -1,278 +0,0 @@ -package org.opentosca.planbuilder.service; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.JAXBException; -import javax.xml.namespace.QName; - -import org.apache.commons.io.FileUtils; -import org.apache.http.NameValuePair; -import org.apache.ode.schemas.dd._2007._03.TProvide; -import org.eclipse.winery.model.selfservice.ApplicationOption; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.planbuilder.export.Exporter; -import org.opentosca.planbuilder.export.VinothekKnownParameters; -import org.opentosca.planbuilder.importer.Importer; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.Deploy; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; - -/** - * Copyright 2015 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Util { - - public static class SelfServiceOptionWrapper { - - public ApplicationOption option; - public File planInputMessageFile; - - - public SelfServiceOptionWrapper(final ApplicationOption option, final File planInputMessageFile) { - this.option = option; - this.planInputMessageFile = planInputMessageFile; - } - - @Override - public String toString() { - return "SelfServiceOption Id: " + this.option.getId() + " Name: " + this.option.getName(); - } - } - - private static class NameValuePairUtils implements NameValuePair { - - private final String name; - private final String value; - - - public NameValuePairUtils(final String name, final String value) { - this.name = name; - this.value = value; - } - - @Override - public String getName() { - return this.name; - } - - @Override - public String getValue() { - return this.value; - } - } - - - public static NameValuePair createNameValuePair(final String name, final String value) { - return new Util.NameValuePairUtils(name, value); - } - - /** - * Generates for the given CSAR (denoted by it's id) BuildPlans - * - * @param csarId the Id of the CSAR to generate plans for - * @return a List of BuildPlans containing the generated BuildPlans - */ - public static List startPlanBuilder(final CSARID csarId) { - final Importer planBuilderImporter = new Importer(); - final List plans = new ArrayList<>(); - try { - final AbstractDefinitions defs = - planBuilderImporter.createContext(ServiceRegistry.getCoreFileService().getCSAR(csarId)); - plans.addAll(planBuilderImporter.buildPlans(defs, csarId.getFileName())); - } - catch (final SystemException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final UserException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return plans; - } - - public static void deleteCSAR(final CSARID csarId) { - try { - ServiceRegistry.getCoreFileService().deleteCSAR(csarId); - } - catch (final SystemException e) { - e.printStackTrace(); - } - catch (final UserException e) { - e.printStackTrace(); - } - } - - /** - * Stores the given InputStream under the given file name - * - * @param fileName the file name to store the csar under - * @param uploadedInputStream an InputStream to the csar file to store - * @return the CSARID of the stored CSAR - */ - public static CSARID storeCSAR(final String fileName, final InputStream uploadedInputStream) { - final File tmpDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") - + Long.toString(System.currentTimeMillis())); - tmpDir.mkdir(); - - final File uploadFile = new File(tmpDir.getAbsoluteFile() + System.getProperty("file.separator") + fileName); - - OutputStream out; - - try { - out = new FileOutputStream(uploadFile); - int read = 0; - final byte[] bytes = new byte[1024]; - - while ((read = uploadedInputStream.read(bytes)) != -1) { - out.write(bytes, 0, read); - } - - uploadedInputStream.close(); - - out.flush(); - out.close(); - - return ServiceRegistry.getCoreFileService().storeCSAR(uploadFile.toPath()); - } - catch (final FileNotFoundException e) { - e.printStackTrace(); - return null; - } - catch (final IOException e) { - e.printStackTrace(); - return null; - } - catch (final UserException e) { - e.printStackTrace(); - return null; - } - catch (final SystemException e) { - e.printStackTrace(); - return null; - } - - } - - public static SelfServiceOptionWrapper generateSelfServiceOption(final BPELPlan buildPlan) throws IOException { - final String id = String.valueOf(System.currentTimeMillis()); - final ApplicationOption option = new ApplicationOption(); - - final File tmpDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") - + Long.toString(System.currentTimeMillis())); - tmpDir.mkdir(); - - final File planInputMessageFile = new File(tmpDir, "plan.input.default." + id + ".xml"); - - option.setName(Util.getBuildPlanServiceName(buildPlan.getDeploymentDeskriptor()).getLocalPart()); - option.setId(id); - option.setIconUrl(""); - option.setDescription("N/A"); - option.setPlanServiceName(Util.getBuildPlanServiceName(buildPlan.getDeploymentDeskriptor()).getLocalPart()); - option.setPlanInputMessageUrl("plan.input.default." + id + ".xml"); - Util.writePlanInputMessageInstance(buildPlan, planInputMessageFile); - - return new SelfServiceOptionWrapper(option, planInputMessageFile); - } - - /** - * Writes given BuildPlan to temporary folder. - * - * @param buildPlan a BuildPlan - * @return a File denoting the export location - */ - public static File writePlan2TmpFolder(final BPELPlan buildPlan) { - final Exporter planBuilderExporter = new Exporter(); - final File tmpDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") - + Long.toString(System.currentTimeMillis())); - tmpDir.mkdir(); - - final File uploadFile = new File(tmpDir.getAbsoluteFile() + System.getProperty("file.separator") - + buildPlan.getBpelProcessElement().getAttribute("name") + ".zip"); - - try { - planBuilderExporter.exportToPlanFile(uploadFile.toURI(), buildPlan); - } - catch (final IOException e) { - e.printStackTrace(); - return null; - } - catch (final JAXBException e) { - e.printStackTrace(); - return null; - } - - return uploadFile; - } - - public static String getStacktrace(final Exception e) { - final StringWriter sw = new StringWriter(); - final PrintWriter pw = new PrintWriter(sw); - e.printStackTrace(pw); - return sw.toString(); - } - - private static QName getBuildPlanServiceName(final Deploy deploy) { - // generated buildplans have only one process! - for (final TProvide provide : deploy.getProcess().get(0).getProvide()) { - // "client" is a convention - if (provide.getPartnerLink().equals("client")) { - return provide.getService().getName(); - } - } - return null; - } - - private static void writePlanInputMessageInstance(final BPELPlan buildPlan, final File xmlFile) throws IOException { - final String messageNs = buildPlan.getWsdl().getTargetNamespace(); - final String requestMessageLocalName = buildPlan.getWsdl().getRequestMessageLocalName(); - final List inputParamNames = buildPlan.getWsdl().getInputMessageLocalNames(); - - final VinothekKnownParameters paramMappings = new VinothekKnownParameters(); - final String soapMessagePrefix = Util.createPrefixPartOfSoapMessage(messageNs, requestMessageLocalName); - final String soapMessageSuffix = Util.createSuffixPartOfSoapMessage(requestMessageLocalName); - - String soapMessage = soapMessagePrefix; - for (final String inputParamName : inputParamNames) { - soapMessage += paramMappings.createXmlElement(inputParamName); - } - soapMessage += soapMessageSuffix; - - FileUtils.write(xmlFile, soapMessage); - } - - private static String createPrefixPartOfSoapMessage(final String namespace, final String messageBodyRootLocalName) { - final String soapEnvelopePrefix = - "%CALLBACK-URL%" - + namespace - + "/initiate%CORRELATION-ID%"; - return soapEnvelopePrefix; - } - - private static String createSuffixPartOfSoapMessage(final String messageBodyRootLocalName) { - final String soapEnvelopeSuffix = ""; - return soapEnvelopeSuffix; - } - - -} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Util.java.orig b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Util.java.orig deleted file mode 100644 index 6d64c9446..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/Util.java.orig +++ /dev/null @@ -1,289 +0,0 @@ -package org.opentosca.planbuilder.service; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.JAXBException; -import javax.xml.namespace.QName; - -import org.apache.commons.io.FileUtils; -import org.apache.http.NameValuePair; -import org.apache.ode.schemas.dd._2007._03.TProvide; -import org.eclipse.winery.model.selfservice.ApplicationOption; -import org.opentosca.container.core.common.SystemException; -import org.opentosca.container.core.common.UserException; -import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.planbuilder.export.Exporter; -import org.opentosca.planbuilder.export.VinothekKnownParameters; -import org.opentosca.planbuilder.importer.Importer; -import org.opentosca.planbuilder.model.plan.TOSCAPlan; -import org.opentosca.planbuilder.model.plan.Deploy; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; - -/** - * Copyright 2015 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class Util { - - public static class SelfServiceOptionWrapper { - - public ApplicationOption option; - public File planInputMessageFile; - - - public SelfServiceOptionWrapper(final ApplicationOption option, final File planInputMessageFile) { - this.option = option; - this.planInputMessageFile = planInputMessageFile; - } - } - - private static class NameValuePairUtils implements NameValuePair { - - private final String name; - private final String value; - - - public NameValuePairUtils(final String name, final String value) { - this.name = name; - this.value = value; - } - - @Override - public String getName() { - return this.name; - } - - @Override - public String getValue() { - return this.value; - } - } - - - public static NameValuePair createNameValuePair(final String name, final String value) { - return new Util.NameValuePairUtils(name, value); - } - - /** - * Generates for the given CSAR (denoted by it's id) BuildPlans - * - * @param csarId the Id of the CSAR to generate plans for - * @return a List of BuildPlans containing the generated BuildPlans - */ -<<<<<<< HEAD - public static List startPlanBuilder(final CSARID csarId) { - final Importer planBuilderImporter = new Importer(); - final List plans = new ArrayList<>(); -======= - public static List startPlanBuilder(CSARID csarId) { - Importer planBuilderImporter = new Importer(); - List plans = new ArrayList(); ->>>>>>> master - try { - final AbstractDefinitions defs = planBuilderImporter.createContext(ServiceRegistry.getCoreFileService().getCSAR(csarId)); - - for (final AbstractServiceTemplate serviceTemplate : defs.getServiceTemplates()) { - plans.add(planBuilderImporter.buildPlan(defs, csarId.getFileName(), serviceTemplate.getQName())); - } - - } catch (final SystemException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (final UserException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return plans; - } - - public static void deleteCSAR(final CSARID csarId) { - try { - ServiceRegistry.getCoreFileService().deleteCSAR(csarId); - } catch (final SystemException e) { - e.printStackTrace(); - } catch (final UserException e) { - e.printStackTrace(); - } - } - - /** - * Stores the given InputStream under the given file name - * - * @param fileName the file name to store the csar under - * @param uploadedInputStream an InputStream to the csar file to store - * @return the CSARID of the stored CSAR - */ - public static CSARID storeCSAR(final String fileName, final InputStream uploadedInputStream) { - final File tmpDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + Long.toString(System.currentTimeMillis())); - tmpDir.mkdir(); - - final File uploadFile = new File(tmpDir.getAbsoluteFile() + System.getProperty("file.separator") + fileName); - - OutputStream out; - - try { - out = new FileOutputStream(uploadFile); - int read = 0; - final byte[] bytes = new byte[1024]; - - while ((read = uploadedInputStream.read(bytes)) != -1) { - out.write(bytes, 0, read); - } - - uploadedInputStream.close(); - - out.flush(); - out.close(); - - return ServiceRegistry.getCoreFileService().storeCSAR(uploadFile.toPath()); - } catch (final FileNotFoundException e) { - e.printStackTrace(); - return null; - } catch (final IOException e) { - e.printStackTrace(); - return null; - } catch (final UserException e) { - e.printStackTrace(); - return null; - } catch (final SystemException e) { - e.printStackTrace(); - return null; - } - - } -<<<<<<< HEAD - - public static SelfServiceOptionWrapper generateSelfServiceOption(final BuildPlan buildPlan) throws IOException { - final String id = String.valueOf(System.currentTimeMillis()); - final ApplicationOption option = new ApplicationOption(); - - final File tmpDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + Long.toString(System.currentTimeMillis())); -======= - - public static SelfServiceOptionWrapper generateSelfServiceOption(TOSCAPlan buildPlan) throws IOException { - String id = String.valueOf(System.currentTimeMillis()); - ApplicationOption option = new ApplicationOption(); - - File tmpDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + Long.toString(System.currentTimeMillis())); ->>>>>>> master - tmpDir.mkdir(); - - final File planInputMessageFile = new File(tmpDir, "plan.input.default." + id + ".xml"); - - option.setName("Default_PlanBuilderGenerated"); - option.setId(id); - option.setIconUrl(""); - option.setDescription("N/A"); - option.setPlanServiceName(Util.getBuildPlanServiceName(buildPlan.getDeploymentDeskriptor()).getLocalPart()); - option.setPlanInputMessageUrl("plan.input.default." + id + ".xml"); - Util.writePlanInputMessageInstance(buildPlan, planInputMessageFile); - - return new SelfServiceOptionWrapper(option, planInputMessageFile); - } - - /** - * Writes given BuildPlan to temporary folder. - * - * @param buildPlan a BuildPlan - * @return a File denoting the export location - */ -<<<<<<< HEAD - public static File writePlan2TmpFolder(final BuildPlan buildPlan) { - final Exporter planBuilderExporter = new Exporter(); - final File tmpDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + Long.toString(System.currentTimeMillis())); -======= - public static File writePlan2TmpFolder(TOSCAPlan buildPlan) { - Exporter planBuilderExporter = new Exporter(); - File tmpDir = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + Long.toString(System.currentTimeMillis())); ->>>>>>> master - tmpDir.mkdir(); - - final File uploadFile = new File(tmpDir.getAbsoluteFile() + System.getProperty("file.separator") + buildPlan.getBpelProcessElement().getAttribute("name") + ".zip"); - - try { - planBuilderExporter.export(uploadFile.toURI(), buildPlan); - } catch (final IOException e) { - e.printStackTrace(); - return null; - } catch (final JAXBException e) { - e.printStackTrace(); - return null; - } - - return uploadFile; - } - - public static String getStacktrace(final Exception e) { - final StringWriter sw = new StringWriter(); - final PrintWriter pw = new PrintWriter(sw); - e.printStackTrace(pw); - return sw.toString(); - } - - private static QName getBuildPlanServiceName(final Deploy deploy) { - // generated buildplans have only one process! - for (final TProvide provide : deploy.getProcess().get(0).getProvide()) { - // "client" is a convention - if (provide.getPartnerLink().equals("client")) { - return provide.getService().getName(); - } - } - return null; - } -<<<<<<< HEAD - - private static void writePlanInputMessageInstance(final BuildPlan buildPlan, final File xmlFile) throws IOException { - final String messageNs = buildPlan.getWsdl().getTargetNamespace(); - final String requestMessageLocalName = buildPlan.getWsdl().getRequestMessageLocalName(); - final List inputParamNames = buildPlan.getWsdl().getInputMessageLocalNames(); - - final VinothekKnownParameters paramMappings = new VinothekKnownParameters(); - final String soapMessagePrefix = Util.createPrefixPartOfSoapMessage(messageNs, requestMessageLocalName); - final String soapMessageSuffix = Util.createSuffixPartOfSoapMessage(requestMessageLocalName); - -======= - - private static void writePlanInputMessageInstance(TOSCAPlan buildPlan, File xmlFile) throws IOException { - String messageNs = buildPlan.getWsdl().getTargetNamespace(); - String requestMessageLocalName = buildPlan.getWsdl().getRequestMessageLocalName(); - List inputParamNames = buildPlan.getWsdl().getInputMessageLocalNames(); - - VinothekKnownParameters paramMappings = new VinothekKnownParameters(); - String soapMessagePrefix = Util.createPrefixPartOfSoapMessage(messageNs, requestMessageLocalName); - String soapMessageSuffix = Util.createSuffixPartOfSoapMessage(requestMessageLocalName); - ->>>>>>> master - String soapMessage = soapMessagePrefix; - for (final String inputParamName : inputParamNames) { - soapMessage += paramMappings.createXmlElement(inputParamName); - } - soapMessage += soapMessageSuffix; - - FileUtils.write(xmlFile, soapMessage); - } - - private static String createPrefixPartOfSoapMessage(final String namespace, final String messageBodyRootLocalName) { - final String soapEnvelopePrefix = "%CALLBACK-URL%" + namespace + "/initiate%CORRELATION-ID%"; - return soapEnvelopePrefix; - } - - private static String createSuffixPartOfSoapMessage(final String messageBodyRootLocalName) { - final String soapEnvelopeSuffix = ""; - return soapEnvelopeSuffix; - } - -} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/resources/RootResource.java b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/resources/RootResource.java deleted file mode 100644 index a1594fa99..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/resources/RootResource.java +++ /dev/null @@ -1,138 +0,0 @@ -package org.opentosca.planbuilder.service.resources; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.core.UriInfo; - -import org.opentosca.planbuilder.service.RunningTasks; -import org.opentosca.planbuilder.service.TaskWorkerRunnable; -import org.opentosca.planbuilder.service.Util; -import org.opentosca.planbuilder.service.model.GeneratePlanForTopology; -import org.opentosca.planbuilder.service.model.PlanGenerationState; - -/** - * - * Copyright 2015 IAAS University of Stuttgart
    - *
    - *

    - * PlanBuilder Service RESTful Rootresource - *

    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -@Path("/") -public class RootResource { - - @Context - UriInfo uriInfo; - - - @GET - @Produces("text/html") - public Response getRootPage() { - return Response.ok("

    Hello to the PlanBuilder Service.

    To use the PlanBuilder Service send a POST Request with the following example body:

    ") - .build(); - } - - @Path("async/{taskId}") - public TaskResource getTask(@PathParam("taskId") final String taskId) { - if (RunningTasks.tasks.containsKey(taskId)) { - return new TaskResource(RunningTasks.tasks.get(taskId)); - } else { - return null; - } - - } - - @POST - @Consumes("application/xml") - @Produces("application/xml") - @Path("async") - public Response generateBuildPlanAsync(final GeneratePlanForTopology generatePlanForTopology) { - - URL csarURL = null; - URL planPostURL = null; - - try { - csarURL = new URL(generatePlanForTopology.CSARURL); - planPostURL = new URL(generatePlanForTopology.PLANPOSTURL); - } - catch (final MalformedURLException e) { - return Response.status(Status.BAD_REQUEST).entity(Util.getStacktrace(e)).build(); - } - - final PlanGenerationState newTaskState = new PlanGenerationState(csarURL, planPostURL); - - final String newId = RunningTasks.generateId(); - RunningTasks.tasks.put(newId, newTaskState); - - new Thread(new TaskWorkerRunnable(newTaskState)).start(); - - return Response.created(URI.create(this.uriInfo.getAbsolutePath() + "/" + newId)).build(); - } - - /** - *

    - * Given the paramaters CSARURL and PLANPOSTURL in the request, this method does the following:
    - * - Check whether the given parameters are URL's
    - * - Download the CSAR denoted by the CSARURL parameter
    - * - Load the CSAR into the OpenTOSCA Core
    - * - Generate BuildPlans for the given CSAR
    - * - Send the the first generated BuildPlan to the given PLANPOSTURL using a HTTP POST - *

    - * - * @param generatePlanForTopology a wrapper class for the parameters CSARURL and PLANPOSTURL - * @return a HTTP Response appropriate to the situation (e.g. error, success,..) - */ - @POST - @Consumes("application/xml") - @Produces("application/xml") - @Path("sync") - public Response generateBuildPlanSync(final GeneratePlanForTopology generatePlanForTopology) { - - URL csarURL = null; - URL planPostURL = null; - - try { - csarURL = new URL(generatePlanForTopology.CSARURL); - planPostURL = new URL(generatePlanForTopology.PLANPOSTURL); - } - catch (final MalformedURLException e) { - return Response.status(Status.BAD_REQUEST).entity(Util.getStacktrace(e)).build(); - } - - final PlanGenerationState newTaskState = new PlanGenerationState(csarURL, planPostURL); - - final String newId = RunningTasks.generateId(); - RunningTasks.tasks.put(newId, newTaskState); - - final TaskWorkerRunnable worker = new TaskWorkerRunnable(newTaskState); - - worker.run(); - - // if the worker run is finished, we're either in a failed state or - // everything worked - switch (worker.getState().currentState) { - case CSARDOWNLOADFAILED: - return Response.status(Status.INTERNAL_SERVER_ERROR).entity(worker.getState()).build(); - case PLANGENERATIONFAILED: - return Response.status(Status.INTERNAL_SERVER_ERROR).entity(worker.getState()).build(); - case PLANSENDINGFAILED: - return Response.status(Status.INTERNAL_SERVER_ERROR).entity(worker.getState()).build(); - default: - return Response.ok().entity(worker.getState()).build(); - } - } -} diff --git a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/resources/TaskResource.java b/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/resources/TaskResource.java deleted file mode 100644 index b9c4f1bbb..000000000 --- a/org.opentosca.planbuilder.service/src/org/opentosca/planbuilder/service/resources/TaskResource.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.opentosca.planbuilder.service.resources; - -import javax.ws.rs.GET; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Response; - -import org.opentosca.planbuilder.service.model.PlanGenerationState; - - -/** - * Copyright 2015 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class TaskResource { - - private final PlanGenerationState state; - - public TaskResource(final PlanGenerationState state) { - this.state = state; - } - - @GET - @Produces("application/xml") - public Response getTaskState() { - return Response.ok(this.state).build(); - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.type.plugin.connectsto/META-INF/MANIFEST.MF deleted file mode 100644 index 8f0c095f5..000000000 --- a/org.opentosca.planbuilder.type.plugin.connectsto/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Core ConnectsTo Plugin -Bundle-SymbolicName: org.opentosca.planbuilder.type.plugin.connectsto -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Export-Package: org.opentosca.planbuilder.type.plugin.connectsto.core, - org.opentosca.planbuilder.type.plugin.connectsto.core.handler -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.type.plugin.connectsto.Activator diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/build.properties b/org.opentosca.planbuilder.type.plugin.connectsto/build.properties deleted file mode 100644 index e39be7fe4..000000000 --- a/org.opentosca.planbuilder.type.plugin.connectsto/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/pom.xml b/org.opentosca.planbuilder.type.plugin.connectsto/pom.xml deleted file mode 100644 index 9da4bddb5..000000000 --- a/org.opentosca.planbuilder.type.plugin.connectsto/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.type.plugin.connectsto - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/Activator.java b/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/Activator.java deleted file mode 100644 index 677d556eb..000000000 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/Activator.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.connectsto; - -import java.util.ArrayList; -import java.util.List; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.opentosca.planbuilder.type.plugin.connectsto.bpel.BPELConfigureRelationsPlugin; -import org.opentosca.planbuilder.type.plugin.connectsto.bpel.BPELConnectsToPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - - private final List> registrations = new ArrayList<>(); - - static BundleContext getContext() { - return Activator.context; - } - - @Override - public void start(final BundleContext bundleContext) throws Exception { - context = bundleContext; - this.registrations.add(bundleContext.registerService(IPlanBuilderTypePlugin.class.getName(), - new BPELConnectsToPlugin(), null)); - this.registrations.add(bundleContext.registerService(IPlanBuilderTypePlugin.class.getName(), - new BPELConfigureRelationsPlugin(), null)); - - } - - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registrations.forEach(e -> e.unregister()); - } -} diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/Constants.java b/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/Constants.java deleted file mode 100644 index 3246a2930..000000000 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/Constants.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.connectsto.bpel; - -import javax.xml.namespace.QName; - -/** - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public final class Constants { - - // the relationshipType this plugin can handle - public static final QName MOSQUITTOC_CONNECTS_TO_RELATIONSHIP_TYPE = - new QName("http://opentosca.org/relationshiptypes", "MosquittoConnectsTo"); - - // the target nodes of the relationshiptTypes must be a stack of topic and - // mosquitto - public static final QName TOPIC_NODE_TYPE = new QName("http://opentosca.org/nodetypes", "Topic"); - public static final QName MOSQUITTO_NODE_TYPE = new QName("http://opentosca.org/nodetypes", "Mosquitto_3.1"); - -} diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConnectsToPluginHandler.java b/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConnectsToPluginHandler.java deleted file mode 100644 index 033177484..000000000 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConnectsToPluginHandler.java +++ /dev/null @@ -1,386 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.connectsto.bpel.handler; - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.net.URL; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.tosca.AbstractInterface; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.type.plugin.connectsto.core.handler.ConnectsToPluginHandler; -import org.osgi.framework.FrameworkUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class BPELConnectsToPluginHandler implements ConnectsToPluginHandler { - - private final static Logger LOG = LoggerFactory.getLogger(BPELConnectsToPluginHandler.class); - - private final DocumentBuilderFactory docFactory; - private final DocumentBuilder docBuilder; - - /** - * Constructor - * - * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails - */ - public BPELConnectsToPluginHandler() throws ParserConfigurationException { - this.docFactory = DocumentBuilderFactory.newInstance(); - this.docFactory.setNamespaceAware(true); - this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } - - /** - * Executes the connectTo operation on the given connectToNode NodeTemplate, the parameters for the - * operation will be searched starting from the opposite NodeTemplate. - * - * Additionally it is possible to search properties which start with "SOURCE_" or "TARGET_" on the - * source/target NodeTemplate. - * - * @param templateContext the context of this operation call - * @param connectToNode a Node Template with a connectTo operation - * @param sourceParameterNode the source node template of the connectsTo relationship - * @param targetParameterNode the target node template of the connectsTo relationship - */ - private boolean executeConnectsTo(final BPELPlanContext templateContext, final AbstractNodeTemplate connectToNode, - final AbstractNodeTemplate sourceParameterNode, - final AbstractNodeTemplate targetParameterNode) { - // fetch the connectsTo Operation of the source node and it's parameters - AbstractInterface connectsToIface = null; - AbstractOperation connectsToOp = null; - Map param2propertyMapping = null; - for (final AbstractInterface iface : connectToNode.getType().getInterfaces()) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_CONNECTTO)) { - // find properties that match the params on the target nodes' stack or prefixed - // properties at the source stack - BPELConnectsToPluginHandler.LOG.debug("Found connectTo operation. Searching for matching parameters in the properties."); - param2propertyMapping = findInputParameters(templateContext, op, connectToNode, sourceParameterNode, - targetParameterNode); - - // check if all input params (or at least all required input params) can be matched with properties - if (param2propertyMapping.size() != op.getInputParameters().size() - && !allRequiredParamsAreMatched(op.getInputParameters(), param2propertyMapping)) { - BPELConnectsToPluginHandler.LOG.info("Didn't find necessary matchings from parameter to property. Can't initialize connectsTo relationship."); - } else { - // executable operation found - connectsToIface = iface; - connectsToOp = op; - break; - } - } - } - if (connectsToOp != null) { - break; - } - } - - // no connectTo operation found with matching parameters - if (connectsToOp == null) { - BPELConnectsToPluginHandler.LOG.debug("No executable connectTo operation found."); - return false; - } - - // execute the connectTo operation with the found parameters - BPELConnectsToPluginHandler.LOG.debug("Adding connectTo operation execution to build plan."); - final Boolean result = templateContext.executeOperation(connectToNode, connectsToIface.getName(), - connectsToOp.getName(), param2propertyMapping); - BPELConnectsToPluginHandler.LOG.debug("Result from adding operation: " + result); - - return true; - - } - - /** - * Checks if all required input params have a matching property - * - * @param inputParameters of the connectsTo operation - * @param param2propertyMapping mapping between inputParameters and matched properties - * @return true, if all required input params have a matching property. Otherwise, false. - */ - private boolean allRequiredParamsAreMatched(final List inputParameters, - final Map param2propertyMapping) { - for (final AbstractParameter inputParam : inputParameters) { - if (inputParam.isRequired() && !param2propertyMapping.containsKey(inputParam)) { - return false; - } - } - return true; - } - - /** - * Search the input parameters for a given connectTo operation. - * - * @param templateContext the context of the operation - * @param connectsToOp the connectTo operation object - * @param connectToNode the node which tries to establish the connection - * @param sourceParameterNode the source node of the relationship - * @param targetParameterNode the target node of the relationship - * @return the Map which contains all found input parameters - */ - private Map findInputParameters(final BPELPlanContext templateContext, - final AbstractOperation connectsToOp, - final AbstractNodeTemplate connectToNode, - final AbstractNodeTemplate sourceParameterNode, - final AbstractNodeTemplate targetParameterNode) { - final Map param2propertyMapping = new HashMap<>(); - - // search on the opposite side of the connectToNode NodeTemplate for default parameters - AbstractNodeTemplate parametersRootNode; - if (sourceParameterNode.equals(connectToNode)) { - parametersRootNode = targetParameterNode; - } else { - parametersRootNode = sourceParameterNode; - } - - // search the input parameters in the properties - for (final AbstractParameter param : connectsToOp.getInputParameters()) { - // search parameter in the RelationshipTemplate properties - final Variable var = - templateContext.getPropertyVariable(templateContext.getRelationshipTemplate(), param.getName()); - - if (var != null) { - param2propertyMapping.put(param, var); - } else { - // search for prefixed parameters - if (param.getName().startsWith("SOURCE_")) { - final String unprefixedParam = param.getName().substring(7); - final Variable property = - searchPropertyInStack(templateContext, sourceParameterNode, unprefixedParam); - if (property != null) { - param2propertyMapping.put(param, property); - } - } - - if (param.getName().startsWith("TARGET_")) { - final String unprefixedParam = param.getName().substring(7); - final Variable property = - searchPropertyInStack(templateContext, targetParameterNode, unprefixedParam); - if (property != null) { - param2propertyMapping.put(param, property); - } - } - - // search for default parameters at opposite NodeTemplate - if (!param2propertyMapping.containsKey(param)) { - if (!org.opentosca.container.core.tosca.convention.Utils.isSupportedVirtualMachineIPProperty(param.getName())) { - // search for property with exact name - final Variable property = - searchPropertyInStack(templateContext, parametersRootNode, param.getName()); - if (property != null) { - param2propertyMapping.put(param, property); - } - } else { - // search for IP property with different names - for (final String paramName : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineIPPropertyNames()) { - final Variable property = - searchPropertyInStack(templateContext, parametersRootNode, paramName); - if (property != null) { - param2propertyMapping.put(param, property); - break; - } - } - } - } - } - } - return param2propertyMapping; - } - - /** - * Search for a property with a certain name on the stack of a node template. - * - * @param templateContext the context of the operation - * @param currentNode the node which is part of the stack - * @param propName the name of the property - * @return the property if found, null otherwise - */ - private Variable searchPropertyInStack(final PlanContext templateContext, AbstractNodeTemplate currentNode, - final String propName) { - while (currentNode != null) { - final Variable property = templateContext.getPropertyVariable(currentNode, propName); - if (property != null) { - return property; - } else { - currentNode = fetchNodeConnectedWithHostedOn(currentNode); - } - } - return null; - } - - /** - * Returns the first node found connected trough a hostedOn relation - * - * @param nodeTemplate the node which is a possible source of an hostedOn relation - * @return an AbstractNodeTemplate which is a target of an hostedOn relation. Null if the given - * nodeTemplate isn't connected to as a source to a hostedOn relation - */ - private AbstractNodeTemplate fetchNodeConnectedWithHostedOn(final AbstractNodeTemplate nodeTemplate) { - for (final AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { - if (ModelUtils.getRelationshipTypeHierarchy(relation.getRelationshipType()) - .contains(Types.hostedOnRelationType)) { - return relation.getTarget(); - } - } - return null; - } - - private String getInterface(final AbstractNodeTemplate nodeTemplate, final String operationName) { - for (final AbstractInterface iface : nodeTemplate.getType().getInterfaces()) { - for (final AbstractOperation op : iface.getOperations()) { - if (op.getName().equals(operationName)) { - return iface.getName(); - } - } - } - return null; - } - - @Override - public boolean handle(final BPELPlanContext templateContext) { - final AbstractRelationshipTemplate relationTemplate = templateContext.getRelationshipTemplate(); - final AbstractNodeTemplate sourceNodeTemplate = relationTemplate.getSource(); - final AbstractNodeTemplate targetNodeTemplate = relationTemplate.getTarget(); - - // if the target has connectTo we execute it - if (hasOperation(targetNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_CONNECTTO)) { - // if we can stop and start the node and it is not defined as non interruptive, stop it - if (!hasInterface(targetNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE) - && startAndStopAvailable(targetNodeTemplate)) { - final String ifaceName = - getInterface(targetNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP); - templateContext.executeOperation(targetNodeTemplate, ifaceName, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP, null); - } - - // connectTo - executeConnectsTo(templateContext, targetNodeTemplate, sourceNodeTemplate, targetNodeTemplate); - - // start the node again - if (!hasInterface(targetNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE) - && startAndStopAvailable(targetNodeTemplate)) { - templateContext.executeOperation(targetNodeTemplate, - getInterface(targetNodeTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START), - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START, null); - } - } - - // if the source has connectTo we execute it - if (hasOperation(sourceNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_CONNECTTO)) { - - // if we can stop and start the node and it is not defined as non interruptive, stop it - if (!hasInterface(sourceNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE) - && startAndStopAvailable(sourceNodeTemplate)) { - templateContext.executeOperation(sourceNodeTemplate, - getInterface(sourceNodeTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP), - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP, null); - } - - // connectTo - executeConnectsTo(templateContext, sourceNodeTemplate, sourceNodeTemplate, targetNodeTemplate); - - // start the node again - if (!hasInterface(sourceNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE) - && startAndStopAvailable(sourceNodeTemplate)) { - templateContext.executeOperation(sourceNodeTemplate, - getInterface(sourceNodeTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START), - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START, null); - } - } - - return true; - } - - private boolean startAndStopAvailable(final AbstractNodeTemplate nodeTemplate) { - return hasOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP) - & hasOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START); - } - - private boolean hasInterface(final AbstractNodeTemplate nodeTemplate, final String interfaceName) { - return nodeTemplate.getType().getInterfaces().stream().filter(inter -> inter.getName().equals(interfaceName)) - .findFirst().isPresent(); - } - - private boolean hasOperation(final AbstractNodeTemplate nodeTemplate, final String operationName) { - return nodeTemplate.getType().getInterfaces().stream().flatMap(inter -> inter.getOperations().stream()) - .filter(op -> op.getName().equals(operationName)).findFirst().isPresent(); - } - - /** - * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String - * variable. - * - * @param assignName the name of the BPEL assign - * @param csarEntryXpathQuery the csarEntryPoint XPath query - * @param stringVarName the variable to load the queries results into - * @return a DOM Node representing a BPEL assign element - * @throws IOException is thrown when loading internal bpel fragments fails - * @throws SAXException is thrown when parsing internal format into DOM fails - */ - public Node loadAssignXpathQueryToStringVarFragmentAsNode(final String assignName, final String xpath2Query, - final String stringVarName) throws IOException, - SAXException { - final String templateString = - loadAssignXpathQueryToStringVarFragmentAsString(assignName, xpath2Query, stringVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String - * variable. - * - * @param assignName the name of the BPEL assign - * @param xpath2Query the csarEntryPoint XPath query - * @param stringVarName the variable to load the queries results into - * @return a String containing a BPEL Assign element - * @throws IOException is thrown when reading the BPEL fragment form the resources fails - */ - public String loadAssignXpathQueryToStringVarFragmentAsString(final String assignName, final String xpath2Query, - final String stringVarName) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("assignStringVarWithXpath2Query.xml"); - final File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelFragmentFile); - template = template.replace("{AssignName}", assignName); - template = template.replace("{xpath2query}", xpath2Query); - template = template.replace("{stringVarName}", stringVarName); - return template; - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.type.plugin.dockercontainer/META-INF/MANIFEST.MF deleted file mode 100644 index 22511050f..000000000 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Core DockerContainerTypePlugin -Bundle-SymbolicName: org.opentosca.planbuilder.type.plugin.dockercontainer -Bundle-Version: 2.0.0.qualifier -Bundle-Vendor: OpenTOSCA -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.opentosca.planbuilder.plugins.utils, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Export-Package: org.opentosca.planbuilder.type.plugin.dockercontainer.core, - org.opentosca.planbuilder.type.plugin.dockercontainer.core.handler -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0", - org.opentosca.planbuilder.provphase.plugin.invoker;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.type.plugin.dockercontainer.Activator diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/build.properties b/org.opentosca.planbuilder.type.plugin.dockercontainer/build.properties deleted file mode 100644 index a128724b9..000000000 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - \ No newline at end of file diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/pom.xml b/org.opentosca.planbuilder.type.plugin.dockercontainer/pom.xml deleted file mode 100644 index e6148542a..000000000 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.type.plugin.dockercontainer - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/Activator.java b/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/Activator.java deleted file mode 100644 index acd864b9c..000000000 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/Activator.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.dockercontainer; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.opentosca.planbuilder.type.plugin.dockercontainer.bpel.BPELDockerContainerTypePlugin; -import org.opentosca.planbuilder.type.plugin.dockercontainer.bpel.BPELOpenMTCDockerContainerTypePlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration registrationDockerContainerPlugin; - private ServiceRegistration registrationOpenMTCDockerContainerPlugin; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registrationDockerContainerPlugin = - Activator.context.registerService(IPlanBuilderTypePlugin.class.getName(), - new BPELDockerContainerTypePlugin(), null); - this.registrationOpenMTCDockerContainerPlugin = - Activator.context.registerService(IPlanBuilderTypePlugin.class.getName(), - new BPELOpenMTCDockerContainerTypePlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registrationDockerContainerPlugin.unregister(); - this.registrationOpenMTCDockerContainerPlugin.unregister(); - - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELDockerContainerTypePlugin.java b/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELDockerContainerTypePlugin.java deleted file mode 100644 index 847913c77..000000000 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELDockerContainerTypePlugin.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.dockercontainer.bpel; - -import java.util.Collection; -import java.util.HashSet; - -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.type.plugin.dockercontainer.bpel.handler.BPELDockerContainerTypePluginHandler; -import org.opentosca.planbuilder.type.plugin.dockercontainer.core.DockerContainerTypePlugin; - -/** - *

    - * This class represents a generic plugin to install a PhpModule on Apache HTTP Server with the - * OpenTOSCA Container Invoker Service - *

    - * Copyright 2014 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public class BPELDockerContainerTypePlugin extends DockerContainerTypePlugin { - - private final BPELDockerContainerTypePluginHandler handler = new BPELDockerContainerTypePluginHandler(); - - @Override - public boolean handleCreate(final BPELPlanContext templateContext, AbstractNodeTemplate nodeTemplate) { - - boolean check = false; - if (this.canHandleCreate(nodeTemplate)) { - check =this.handler.handleCreate(templateContext); - } - - - if(check) { - templateContext.addUsedOperation(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER); - } - - return check; - } - - @Override - public boolean handleCreate(BPELPlanContext templateContext, AbstractRelationshipTemplate relationshipTemplate) { - return false; - } - - @Override - public Collection getCreateDependencies(AbstractNodeTemplate nodeTemplate) { - Collection deps = new HashSet(); - deps.add(this.getDockerEngineNode(nodeTemplate)); - return deps; - } - - @Override - public Collection getTerminateDependencies(AbstractNodeTemplate nodeTemplate) { - return null; - } - - @Override - public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemplate nodeTemplate) { - boolean check = false; - if (this.canHandleTerminate(nodeTemplate)) { - check =this.handler.handleTerminate(templateContext); - } - - if(check) { - templateContext.addUsedOperation(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER); - } - - return check; - } - - @Override - public boolean handleTerminate(BPELPlanContext templateContext, AbstractRelationshipTemplate relationshipTemplate) { - // never handles relationshipTemplates - return false; - } - - - @Override - public boolean canHandleTerminate(AbstractRelationshipTemplate relationshipTemplate) { - // never handles relationshipTemplates - return false; - } - - @Override - public int getPriority() { - // specific first than generic handling - return 0; - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.hardware/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.type.plugin.hardware/META-INF/MANIFEST.MF deleted file mode 100644 index 517933d61..000000000 --- a/org.opentosca.planbuilder.type.plugin.hardware/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Type Plugin for hardware provisioning -Bundle-SymbolicName: org.opentosca.planbuilder.type.plugin.hardware -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.opentosca.planbuilder.provphase.plugin.invoker.bpel, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.type.plugin.hardware.Activator diff --git a/org.opentosca.planbuilder.type.plugin.hardware/build.properties b/org.opentosca.planbuilder.type.plugin.hardware/build.properties deleted file mode 100644 index e39be7fe4..000000000 --- a/org.opentosca.planbuilder.type.plugin.hardware/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - diff --git a/org.opentosca.planbuilder.type.plugin.hardware/pom.xml b/org.opentosca.planbuilder.type.plugin.hardware/pom.xml deleted file mode 100644 index 2cb29a67d..000000000 --- a/org.opentosca.planbuilder.type.plugin.hardware/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.type.plugin.hardware - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.type.plugin.hardware/src/org/opentosca/planbuilder/type/plugin/hardware/Activator.java b/org.opentosca.planbuilder.type.plugin.hardware/src/org/opentosca/planbuilder/type/plugin/hardware/Activator.java deleted file mode 100644 index 4e456ad37..000000000 --- a/org.opentosca.planbuilder.type.plugin.hardware/src/org/opentosca/planbuilder/type/plugin/hardware/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.hardware; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration registration; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = - Activator.context.registerService(IPlanBuilderTypePlugin.class.getName(), new HardwarePlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/META-INF/MANIFEST.MF deleted file mode 100644 index 379962a88..000000000 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: MosquittoConnectsTo Core Plugin -Bundle-SymbolicName: org.opentosca.planbuilder.type.plugin.mosquittoconnectsto -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.opentosca.planbuilder.plugins.utils, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Export-Package: org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.core, - org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.core.handler -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0", - org.opentosca.planbuilder.provphase.plugin.invoker;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.Activator diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/build.properties b/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/build.properties deleted file mode 100644 index e39be7fe4..000000000 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/pom.xml b/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/pom.xml deleted file mode 100644 index 318f8437b..000000000 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.type.plugin.mosquittoconnectsto - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/Activator.java b/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/Activator.java deleted file mode 100644 index c938eca88..000000000 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.mosquittoconnectsto; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.bpel.BPELConnectsToTypePlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration registration; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = Activator.context.registerService(IPlanBuilderTypePlugin.class.getName(), - new BPELConnectsToTypePlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/handler/BPELConnectsToPluginHandler.java b/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/handler/BPELConnectsToPluginHandler.java deleted file mode 100644 index 4118892eb..000000000 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/handler/BPELConnectsToPluginHandler.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.bpel.handler; - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; -import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.plugins.utils.PluginUtils; -import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; -import org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.core.handler.ConnectsToTypePluginHandler; -import org.osgi.framework.FrameworkUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class BPELConnectsToPluginHandler implements ConnectsToTypePluginHandler { - - private final static Logger LOG = LoggerFactory.getLogger(BPELConnectsToPluginHandler.class); - private final BPELInvokerPlugin invokerPlugin = new BPELInvokerPlugin(); - - private final DocumentBuilderFactory docFactory; - private final DocumentBuilder docBuilder; - - /** - * Constructor - * - * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails - */ - public BPELConnectsToPluginHandler() throws ParserConfigurationException { - this.docFactory = DocumentBuilderFactory.newInstance(); - this.docFactory.setNamespaceAware(true); - this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - - } - - @Override - public boolean handle(final BPELPlanContext templateContext) { - final AbstractRelationshipTemplate relationTemplate = templateContext.getRelationshipTemplate(); - - // fetch topic - final Variable topicName = templateContext.getPropertyVariable(relationTemplate.getTarget(), "Name"); - - /* fetch ip of mosquitto */ - Variable mosquittoVmIp = null; - - // find infrastructure nodes of mosquitto - List infrastructureNodes = new ArrayList<>(); - ModelUtils.getInfrastructureNodes(relationTemplate.getTarget(), infrastructureNodes); - - ModelUtils.getNodesFromNodeToSink(relationTemplate.getTarget(), infrastructureNodes); - - for (final AbstractNodeTemplate infraNode : infrastructureNodes) { - - for (final String ipPropName : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineIPPropertyNames()) { - // fetch mosquitto ip - if (templateContext.getPropertyVariable(infraNode, ipPropName) != null) { - mosquittoVmIp = templateContext.getPropertyVariable(infraNode, ipPropName); - break; - } - - } - - if (mosquittoVmIp != null) { - break; - } - } - - /* fetch user, key, ip and ubuntuTemplateId of client stack */ - PropertyVariable clientVmIp = null; - PropertyVariable clientVmUser = null; - PropertyVariable clientVmPass = null; - String ubuntuTemplateId = null; - - infrastructureNodes = new ArrayList<>(); - ModelUtils.getInfrastructureNodes(relationTemplate.getSource(), infrastructureNodes); - - for (final AbstractNodeTemplate infraNode : infrastructureNodes) { - - for (final String ipPropName : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineIPPropertyNames()) { - if (templateContext.getPropertyVariable(infraNode, ipPropName) != null) { - clientVmIp = templateContext.getPropertyVariable(infraNode, ipPropName); - break; - } - - } - - for (final String loginNameProp : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineLoginUserNamePropertyNames()) { - if (templateContext.getPropertyVariable(infraNode, loginNameProp) != null) { - ubuntuTemplateId = infraNode.getId(); - clientVmUser = templateContext.getPropertyVariable(infraNode, loginNameProp); - } - } - - for (final String loginPwProp : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineLoginPasswordPropertyNames()) { - if (templateContext.getPropertyVariable(infraNode, loginPwProp) != null) { - ubuntuTemplateId = infraNode.getId(); - clientVmPass = templateContext.getPropertyVariable(infraNode, loginPwProp); - } - - } - } - - /* create skript */ - // the script itself - final String bashCommand = - "echo \"topicName = hostName\" > $(find ~ -maxdepth 1 -path \"*.csar\")/mosquitto_connections.txt;"; - - // add it as a var to the plan - final Variable bashCommandVariable = - templateContext.createGlobalStringVariable("addMosquittoConnection", bashCommand); - - // create bpel query which replaces topicName and hostName with real - // values - final String xpathQuery = "replace(replace($" + bashCommandVariable.getVariableName() + ",'topicName',$" - + topicName.getVariableName() + "),'hostName',$" + mosquittoVmIp.getVariableName() + ")"; - - // create bpel assign with created query - try { - // create assign and append - Node assignNode = loadAssignXpathQueryToStringVarFragmentAsNode("assignValuesToAddConnection" - + System.currentTimeMillis(), xpathQuery, bashCommandVariable.getVariableName()); - assignNode = templateContext.importNode(assignNode); - templateContext.getProvisioningPhaseElement().appendChild(assignNode); - } - catch (final IOException e) { - BPELConnectsToPluginHandler.LOG.error("Couldn't load fragment from file", e); - return false; - } - catch (final SAXException e) { - BPELConnectsToPluginHandler.LOG.error("Couldn't parse fragment to DOM", e); - return false; - } - - /* add logic to execute script on client machine */ - final Map runScriptRequestInputParams = new HashMap<>(); - - runScriptRequestInputParams.put("VMIP", clientVmIp); - - // these two are requested from the input message if they are not set - if (!PluginUtils.isVariableValueEmpty(clientVmUser)) { - runScriptRequestInputParams.put("VMUserName", clientVmUser); - } else { - runScriptRequestInputParams.put("VMUserName", null); - } - - if (!PluginUtils.isVariableValueEmpty(clientVmPass)) { - runScriptRequestInputParams.put("VMPrivateKey", clientVmPass); - } else { - runScriptRequestInputParams.put("VMPrivateKey", null); - } - - runScriptRequestInputParams.put("Script", bashCommandVariable); - - this.invokerPlugin.handle(templateContext, ubuntuTemplateId, true, "runScript", - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, runScriptRequestInputParams, - new HashMap(), templateContext.getProvisioningPhaseElement()); - - return true; - } - - /** - * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String - * variable. - * - * @param assignName the name of the BPEL assign - * @param csarEntryXpathQuery the csarEntryPoint XPath query - * @param stringVarName the variable to load the queries results into - * @return a DOM Node representing a BPEL assign element - * @throws IOException is thrown when loading internal bpel fragments fails - * @throws SAXException is thrown when parsing internal format into DOM fails - */ - public Node loadAssignXpathQueryToStringVarFragmentAsNode(final String assignName, final String xpath2Query, - final String stringVarName) throws IOException, - SAXException { - final String templateString = - loadAssignXpathQueryToStringVarFragmentAsString(assignName, xpath2Query, stringVarName); - final InputSource is = new InputSource(); - is.setCharacterStream(new StringReader(templateString)); - final Document doc = this.docBuilder.parse(is); - return doc.getFirstChild(); - } - - /** - * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String - * variable. - * - * @param assignName the name of the BPEL assign - * @param xpath2Query the csarEntryPoint XPath query - * @param stringVarName the variable to load the queries results into - * @return a String containing a BPEL Assign element - * @throws IOException is thrown when reading the BPEL fragment form the resources fails - */ - public String loadAssignXpathQueryToStringVarFragmentAsString(final String assignName, final String xpath2Query, - final String stringVarName) throws IOException { - // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("assignStringVarWithXpath2Query.xml"); - final File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelFragmentFile); - template = template.replace("{AssignName}", assignName); - template = template.replace("{xpath2query}", xpath2Query); - template = template.replace("{stringVarName}", stringVarName); - return template; - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.type.plugin.patternbased/META-INF/MANIFEST.MF deleted file mode 100644 index 674d08559..000000000 --- a/org.opentosca.planbuilder.type.plugin.patternbased/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Type Plugin for Patternbased provisioning -Bundle-SymbolicName: org.opentosca.planbuilder.type.plugin.patternbased -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.opentosca.planbuilder.provphase.plugin.invoker.bpel, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.type.plugin.patternbased.Activator diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/build.properties b/org.opentosca.planbuilder.type.plugin.patternbased/build.properties deleted file mode 100644 index e39be7fe4..000000000 --- a/org.opentosca.planbuilder.type.plugin.patternbased/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/pom.xml b/org.opentosca.planbuilder.type.plugin.patternbased/pom.xml deleted file mode 100644 index 1e641bb36..000000000 --- a/org.opentosca.planbuilder.type.plugin.patternbased/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.type.plugin.patternbased - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/Activator.java b/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/Activator.java deleted file mode 100644 index 5f2dda2f3..000000000 --- a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.patternbased; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.opentosca.planbuilder.type.plugin.patternbased.bpel.PatternBasedPlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration registration; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = - Activator.context.registerService(IPlanBuilderTypePlugin.class.getName(), new PatternBasedPlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.platforms/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.type.plugin.platforms/META-INF/MANIFEST.MF deleted file mode 100644 index 63725a76d..000000000 --- a/org.opentosca.planbuilder.type.plugin.platforms/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Type Plugin for Platform provisioning -Bundle-SymbolicName: org.opentosca.planbuilder.type.plugin.platforms -Bundle-Version: 2.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.opentosca.planbuilder.provphase.plugin.invoker.bpel, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.type.plugin.platforms.Activator diff --git a/org.opentosca.planbuilder.type.plugin.platforms/build.properties b/org.opentosca.planbuilder.type.plugin.platforms/build.properties deleted file mode 100644 index e39be7fe4..000000000 --- a/org.opentosca.planbuilder.type.plugin.platforms/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ - diff --git a/org.opentosca.planbuilder.type.plugin.platforms/pom.xml b/org.opentosca.planbuilder.type.plugin.platforms/pom.xml deleted file mode 100644 index bd5c4219c..000000000 --- a/org.opentosca.planbuilder.type.plugin.platforms/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.type.plugin.platforms - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.type.plugin.platforms/src/org/opentosca/planbuilder/type/plugin/platforms/Activator.java b/org.opentosca.planbuilder.type.plugin.platforms/src/org/opentosca/planbuilder/type/plugin/platforms/Activator.java deleted file mode 100644 index 6d63d4ced..000000000 --- a/org.opentosca.planbuilder.type.plugin.platforms/src/org/opentosca/planbuilder/type/plugin/platforms/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.platforms; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -/** - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class Activator implements BundleActivator { - - private static BundleContext context; - - private ServiceRegistration registration; - - static BundleContext getContext() { - return Activator.context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext ) - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = - Activator.context.registerService(IPlanBuilderTypePlugin.class.getName(), new PlatformPlugin(), null); - - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - Activator.context = null; - this.registration.unregister(); - } - -} diff --git a/org.opentosca.planbuilder.type.plugin.ubuntuvm/META-INF/MANIFEST.MF b/org.opentosca.planbuilder.type.plugin.ubuntuvm/META-INF/MANIFEST.MF deleted file mode 100644 index 35f68051e..000000000 --- a/org.opentosca.planbuilder.type.plugin.ubuntuvm/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OpenTOSCA Core Ubuntu VM Plugin -Bundle-SymbolicName: org.opentosca.planbuilder.type.plugin.ubuntuvm -Bundle-Version: 2.0.0.qualifier -Bundle-Vendor: OpenTOSCA -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.apache.commons.io;version="2.2.0", - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.typebased, - org.opentosca.planbuilder.plugins.utils, - org.osgi.framework;version="1.3.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: ., - META-INF/resources/ -Export-Package: org.opentosca.planbuilder.type.plugin.ubuntuvm, - org.opentosca.planbuilder.type.plugin.ubuntuvm.bpel -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0", - org.opentosca.planbuilder.core.bpel;bundle-version="2.0.0", - org.opentosca.planbuilder.provphase.plugin.invoker;bundle-version="2.0.0" -Bundle-Activator: org.opentosca.planbuilder.type.plugin.ubuntuvm.Activator diff --git a/org.opentosca.planbuilder.type.plugin.ubuntuvm/build.properties b/org.opentosca.planbuilder.type.plugin.ubuntuvm/build.properties deleted file mode 100644 index 4a04a5809..000000000 --- a/org.opentosca.planbuilder.type.plugin.ubuntuvm/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - .,\ - META-INF/resources/ diff --git a/org.opentosca.planbuilder.type.plugin.ubuntuvm/pom.xml b/org.opentosca.planbuilder.type.plugin.ubuntuvm/pom.xml deleted file mode 100644 index 12323913f..000000000 --- a/org.opentosca.planbuilder.type.plugin.ubuntuvm/pom.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder.type.plugin.ubuntuvm - eclipse-plugin - - diff --git a/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/Activator.java b/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/Activator.java deleted file mode 100644 index 8d2ff46e0..000000000 --- a/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/Activator.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.ubuntuvm; - -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwareTypePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.opentosca.planbuilder.type.plugin.ubuntuvm.bpel.BPELUbuntuVmTypePlugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - private final BPELUbuntuVmTypePlugin plugin = new BPELUbuntuVmTypePlugin(); - - private ServiceRegistration registration; - private ServiceRegistration registration2; - - /** - * Returns the BundleContext of this Plugin - * - * @return a BundleContext - */ - static BundleContext getContext() { - return Activator.context; - } - - /** - * {@inheritDoc} - */ - @Override - public void start(final BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - this.registration = - Activator.context.registerService(IPlanBuilderTypePlugin.class.getName(), this.plugin, null); - this.registration2 = - Activator.context.registerService(IPlanBuilderPolicyAwareTypePlugin.class.getName(), this.plugin, null); - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(final BundleContext bundleContext) throws Exception { - this.registration.unregister(); - this.registration2.unregister(); - Activator.context = null; - } -} diff --git a/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePlugin.java b/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePlugin.java deleted file mode 100644 index 96a29e2f4..000000000 --- a/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePlugin.java +++ /dev/null @@ -1,365 +0,0 @@ -package org.opentosca.planbuilder.type.plugin.ubuntuvm.bpel; - -import javax.xml.namespace.QName; - -import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.container.core.tosca.convention.Utils; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicy; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwareTypePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - *

    - * This class represents a generic plugin containing bpel logic to start a - * virtual machine instance with the OpenTOSCA Container Invoker Service - *

    - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public class BPELUbuntuVmTypePlugin - implements IPlanBuilderTypePlugin, IPlanBuilderPolicyAwareTypePlugin { - private static final Logger LOG = LoggerFactory.getLogger(BPELUbuntuVmTypePlugin.class); - private final BPELUbuntuVmTypePluginHandler handler = new BPELUbuntuVmTypePluginHandler(); - - private static final String PLUGIN_ID = "OpenTOSCA PlanBuilder VM and Cloud Provider Declarative Type Plugin"; - - public static final QName noPublicAccessPolicyType = new QName("http://opentosca.org/policytypes", - "NoPublicAccessPolicy"); - public static final QName publicAccessPolicyType = new QName("http://opentosca.org/policytypes", - "PublicAccessPolicy"); - public static final QName onlyModeledPortsPolicyType = new QName("http://opentosca.org/policytypes", - "OnlyModeledPortsPolicyType"); - - /** - * {@inheritDoc} - */ - @Override - public boolean canHandleCreate(final AbstractNodeTemplate nodeTemplate) { - return allDependenciesAreMet(nodeTemplate); - } - - @Override - public boolean canHandleTerminate(final AbstractNodeTemplate nodeTemplate) { - return allDependenciesAreMet(nodeTemplate); - } - - private boolean allDependenciesAreMet(final AbstractNodeTemplate nodeTemplate) { - if (nodeTemplate == null) { - BPELUbuntuVmTypePlugin.LOG.debug("NodeTemplate is null"); - } - if (nodeTemplate.getType() == null) { - BPELUbuntuVmTypePlugin.LOG.debug("NodeTemplate NodeType is null. NodeTemplate Id:" + nodeTemplate.getId()); - } - if (nodeTemplate.getType().getId() == null) { - BPELUbuntuVmTypePlugin.LOG.debug("NodeTemplate NodeType id is null"); - } - // this plugin can handle all referenced nodeTypes - if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) { - return true; - } else if (Utils.isSupportedVMNodeType(nodeTemplate.getType().getId())) { - // checking if this vmNode is connected to a nodeTemplate of Type - // cloud provider (ec2, openstack) or docker engine, if not this - // plugin can't handle - // this node - for (final AbstractRelationshipTemplate relationshipTemplate : nodeTemplate.getOutgoingRelations()) { - if (Utils.isSupportedCloudProviderNodeType(relationshipTemplate.getTarget().getType().getId()) - | Utils.isSupportedDockerEngineNodeType(relationshipTemplate.getTarget().getType().getId())) { - return true; - } - } - return false; - } else if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) { - // checking whether this GENERIC ubuntu NodeTemplate is connected to - // a VM - // Node, after this checking whether the VM Node is connected to a - // EC2 Node - - // check for generic UbuntuNodeType - if (nodeTemplate.getType().getId().equals(Types.ubuntuNodeType)) { - // here we check for a 3 node stack ubuntu -> vm -> cloud - // provider(ec2,openstack) - return checkIfConnectedToVMandCloudProvider(nodeTemplate); - } else { - - // here we assume that a specific ubuntu image is selected as - // the nodeType e.g. ubuntu13.10server NodeType - // so we check only for a cloud provider - return checkIfConnectedToCloudProvider(nodeTemplate); - } - - } else { - return false; - } - } - - /* - * (non-Javadoc) - * - * @see - * org.opentosca.planbuilder.core.plugins.IPlanBuilderPolicyAwareTypePlugin# - * canHandlePolicyAware(org.opentosca.planbuilder.model.tosca. - * AbstractNodeTemplate) - */ - @Override - public boolean canHandlePolicyAwareCreate(final AbstractNodeTemplate nodeTemplate) { - boolean canHandle = this.canHandleCreate(nodeTemplate); - - for (final AbstractPolicy policy : nodeTemplate.getPolicies()) { - if (policy.getType().getId().equals(this.noPublicAccessPolicyType) - | policy.getType().getId().equals(this.publicAccessPolicyType)) { - if (policy.getProperties() != null - && policy.getProperties().getDOMElement().getLocalName().equals("SecurityGroup")) { - canHandle &= true; - } - } else if (policy.getType().getId().equals(this.onlyModeledPortsPolicyType)) { - canHandle &= true; - } else { - // ALL policies must be supported - canHandle &= false; - } - } - - return canHandle; - - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canHandleCreate(final AbstractRelationshipTemplate relationshipTemplate) { - // this plugin doesn't handle relations - return false; - } - - @Override - public boolean canHandleTerminate(final AbstractRelationshipTemplate relationshipTemplate) { - // never handles a relationship - return false; - } - - /** - *

    - * Checks whether the given NodeTemplate is connected to another node of some - * Cloud Provider NodeType - *

    - * - * @param nodeTemplate any AbstractNodeTemplate - * @return true iff connected to Cloud Provider Node - */ - private boolean checkIfConnectedToCloudProvider(final AbstractNodeTemplate nodeTemplate) { - for (final AbstractRelationshipTemplate relationshipTemplate : nodeTemplate.getOutgoingRelations()) { - if (Utils.isSupportedCloudProviderNodeType(relationshipTemplate.getTarget().getType().getId())) { - return true; - } - } - return false; - } - - /** - *

    - * Checks whether there is a path from the given NodeTemplate of length 3 with - * the following nodes:
    - * The NodeTemplate itself
    - * A NodeTemplate of type {http://opentosca.org/types/declarative}VM
    - * A NodeTemplate of type {http://opentosca.org/types/declarative}EC2 or - * OpenStack - *

    - * - * @param nodeTemplate any AbstractNodeTemplate - * @return true if the there exists a path from the given NodeTemplate to a - * Cloud Provider node, else false - */ - private boolean checkIfConnectedToVMandCloudProvider(final AbstractNodeTemplate nodeTemplate) { - for (final AbstractRelationshipTemplate relationshipTemplate : nodeTemplate.getOutgoingRelations()) { - if (relationshipTemplate.getTarget().getType().getId().equals(Types.vmNodeType)) { - if (checkIfConnectedToCloudProvider(relationshipTemplate.getTarget())) { - return true; - } - } - } - return false; - } - - @Override - public String getID() { - return BPELUbuntuVmTypePlugin.PLUGIN_ID; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean handleCreate(final BPELPlanContext templateContext, final AbstractNodeTemplate nodeTemplate) { - BPELUbuntuVmTypePlugin.LOG.debug("Checking if nodeTemplate " + nodeTemplate.getId() + " can be handled"); - - // cloudprovider node is handled by doing nothing - if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) { - return true; - } - - // docker engine node is handled by doing nothing - if (Utils.isSupportedDockerEngineNodeType(nodeTemplate.getType().getId())) { - return true; - } - - // when infrastructure node arrives start handling - if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) { - // check if this node is connected to a cloud provider node type, if - // true -> append code - for (final AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { - if (Utils.isSupportedCloudProviderNodeType(relation.getTarget().getType().getId())) { - final QName nodeType = relation.getTarget().getType().getId(); - if (nodeType.equals(Types.openStackLiberty12NodeType) - || nodeType.equals(Types.openStackTrainNodeType) - || nodeType.equals(Types.vmWareVsphere55NodeType) - || nodeType.equals(Types.amazonEc2NodeType) - || nodeType.getNamespaceURI() - .equals(Types.openStackLiberty12NodeTypeGenerated.getNamespaceURI()) - && (nodeType.getLocalPart() - .startsWith(Types.openStackLiberty12NodeTypeGenerated.getLocalPart()) - || nodeType.getLocalPart() - .startsWith(Types.openStackTrainNodeType.getLocalPart()))) { - // bit hacky now, but until the nodeType cleanup is - // finished this should be enough right now - return this.handler.handleCreateWithCloudProviderInterface(templateContext, nodeTemplate); - } else if (relation.getTarget().getType().getId().equals(Types.localHypervisor)) { - return this.handler.handleWithLocalCloudProviderInterface(templateContext, nodeTemplate); - } else { - return this.handler.handle(templateContext, nodeTemplate); - } - } - } - return true; - } - return false; - } - - @Override - public boolean handlePolicyAwareCreate(final BPELPlanContext templateContext) { - final AbstractNodeTemplate nodeTemplate = templateContext.getNodeTemplate(); - if (nodeTemplate == null) { - return false; - } - - BPELUbuntuVmTypePlugin.LOG.debug("Checking if nodeTemplate " + nodeTemplate.getId() + " can be handled"); - - // cloudprovider node is handled by doing nothing - if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) { - return true; - } - - // docker engine node is handled by doing nothing - if (Utils.isSupportedDockerEngineNodeType(nodeTemplate.getType().getId())) { - return true; - } - - // when infrastructure node arrives start handling - if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) { - // check if this node is connected to a cloud provider node type, if - // true -> append code - for (final AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { - if (Utils.isSupportedCloudProviderNodeType(relation.getTarget().getType().getId())) { - final QName nodeType = relation.getTarget().getType().getId(); - if (nodeType.equals(Types.openStackLiberty12NodeType) - || nodeType.equals(Types.openStackTrainNodeType) - || nodeType.equals(Types.vmWareVsphere55NodeType) - || nodeType.equals(Types.amazonEc2NodeType) - || nodeType.getNamespaceURI() - .equals(Types.openStackLiberty12NodeTypeGenerated.getNamespaceURI()) - && (nodeType.getLocalPart() - .startsWith(Types.openStackLiberty12NodeTypeGenerated.getLocalPart()) - || nodeType.getLocalPart() - .startsWith(Types.openStackTrainNodeType.getLocalPart()))) { - // bit hacky now, but until the nodeType cleanup is - // finished this should be enough right now - return this.handler.handleCreateWithCloudProviderInterface(templateContext, nodeTemplate); - } else if (relation.getTarget().getType().getId().equals(Types.localHypervisor)) { - return this.handler.handleWithLocalCloudProviderInterface(templateContext, nodeTemplate); - } else { - return this.handler.handle(templateContext, nodeTemplate); - } - } - } - return true; - } - return false; - } - - @Override - public boolean handleTerminate(final BPELPlanContext templateContext, final AbstractNodeTemplate nodeTemplate) { - BPELUbuntuVmTypePlugin.LOG.debug("Checking if nodeTemplate " + nodeTemplate.getId() + " can be handled"); - - // cloudprovider node is handled by doing nothing - if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) { - return true; - } - - // docker engine node is handled by doing nothing - if (Utils.isSupportedDockerEngineNodeType(nodeTemplate.getType().getId())) { - return true; - } - - // when infrastructure node arrives start handling - if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) { - // check if this node is connected to a cloud provider node type, if - // true -> append code - for (final AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { - if (Utils.isSupportedCloudProviderNodeType(relation.getTarget().getType().getId())) { - final QName nodeType = relation.getTarget().getType().getId(); - if (nodeType.equals(Types.openStackLiberty12NodeType) - || nodeType.equals(Types.openStackTrainNodeType) - || nodeType.equals(Types.vmWareVsphere55NodeType) - || nodeType.equals(Types.amazonEc2NodeType) - || nodeType.getNamespaceURI() - .equals(Types.openStackLiberty12NodeTypeGenerated.getNamespaceURI()) - && (nodeType.getLocalPart() - .startsWith(Types.openStackLiberty12NodeTypeGenerated.getLocalPart()) - || nodeType.getLocalPart() - .startsWith(Types.openStackTrainNodeType.getLocalPart()))) { - // bit hacky now, but until the nodeType cleanup is - // finished this should be enough right now - return this.handler.handleTerminateWithCloudProviderInterface(templateContext, nodeTemplate, - templateContext.getProvisioningPhaseElement()); - } else if (relation.getTarget().getType().getId().equals(Types.localHypervisor)) { - return this.handler.handleWithLocalCloudProviderInterface(templateContext, nodeTemplate); - } else { - return this.handler.handle(templateContext, nodeTemplate); - } - } - } - return true; - } - return false; - - } - - @Override - public boolean handleCreate(final BPELPlanContext templateContext, - final AbstractRelationshipTemplate relationshipTemplate) { - // never handles a relationship - return false; - } - - @Override - public boolean handleTerminate(final BPELPlanContext templateContext, - final AbstractRelationshipTemplate relationshipTemplate) { - // never handles a relationship - return false; - } - - @Override - public int getPriority() { - // - return 0; - } - -} diff --git a/org.opentosca.planbuilder/.DS_Store b/org.opentosca.planbuilder/.DS_Store new file mode 100644 index 000000000..b3c899925 Binary files /dev/null and b/org.opentosca.planbuilder/.DS_Store differ diff --git a/org.opentosca.planbuilder/META-INF/MANIFEST.MF b/org.opentosca.planbuilder/META-INF/MANIFEST.MF deleted file mode 100644 index 8b6471277..000000000 --- a/org.opentosca.planbuilder/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Planbuilder is a bundle which builds plans from ba.context.AbstractDefinitions -Bundle-SymbolicName: org.opentosca.planbuilder -Bundle-Version: 2.0.0.qualifier -Test-Suite: org.opentosca.planbuilder.test.PlanBuilderTestSuite -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: javax.wsdl;version="1.6.0", - javax.wsdl.factory;version="1.6.0", - javax.wsdl.xml;version="1.6.0", - org.apache.commons.io;version="2.2.0", - org.apache.ode.activityrecovery, - org.apache.ode.schemas.dd._2007._03, - org.eclipse.core.runtime;common=split;version="[3.1.0,4.0.0)", - org.osgi.framework;version="1.6.0", - org.slf4j;version="1.7.5" -Bundle-ClassPath: . -Export-Package: org.opentosca.planbuilder, - org.opentosca.planbuilder.plugins.artifactbased, - org.opentosca.planbuilder.plugins.context, - org.opentosca.planbuilder.plugins.registry, - org.opentosca.planbuilder.plugins.typebased, - org.opentosca.planbuilder.plugins.utils -Require-Bundle: org.opentosca.container.core.tosca;bundle-version="1.0.0", - org.opentosca.planbuilder.model;bundle-version="1.0.0" -Bundle-ActivationPolicy: lazy -Bundle-Activator: org.opentosca.planbuilder.plugins.activator.Activator diff --git a/org.opentosca.planbuilder/build.properties b/org.opentosca.planbuilder/build.properties deleted file mode 100644 index a12d47e56..000000000 --- a/org.opentosca.planbuilder/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -source.. = src/ -bin.includes = META-INF/,\ - . diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/pom.xml new file mode 100644 index 000000000..38f2feae3 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.core.bpel + + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + wsdl4j + wsdl4j + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/BPELScopeBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/BPELScopeBuilder.java new file mode 100644 index 000000000..e94ed2935 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/BPELScopeBuilder.java @@ -0,0 +1,895 @@ +package org.opentosca.planbuilder.core.bpel.artifactbasednodehandler; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.inject.Inject; + +import org.opentosca.planbuilder.core.bpel.tosca.handlers.TOSCAManagementInfrastructureNodeTemplate; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPlugin; +import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractInterface; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTypeImplementation; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + *

    + * This Class represents the low-level algorithm for the concept in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans fuer OpenTOSCA. This + * includes selecting a implementation (NodeTypeImplementation,Relationship..) where all artifacts (IA, DA) and the + * operations of the template (Node and Relation) can be used for calling a chain/list/.. of TOSCA operations. All + * complete possibilities of calls based on the selected Node Type Implementation are hold inside a OperationChain + * Object. And can be selected to be generated by the determined operations and handling plugins. + * + *

    + * Copyright 2017 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +@Component +public class BPELScopeBuilder { + + final static Logger LOG = LoggerFactory.getLogger(BPELScopeBuilder.class); + + private final PluginRegistry pluginRegistry; + + @Inject + public BPELScopeBuilder(PluginRegistry pluginRegistry) { + this.pluginRegistry = pluginRegistry; + } + + /** + *

    + * Filters IA and DA Candidates inside the given ProvisioningChain. Filtering means if there are IA and DACandidates + * which don't operate on the same Template Implementation they are deleted. + *

    + * + * @param chain a ProvisioningChain to filter + */ + private void filterIncompatibleIADACandidates(final OperationChain chain) { + final Map compatibleCandidates = new HashMap<>(); + for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { + for (final DANodeTypeImplCandidate daCandidate : chain.daCandidates) { + if (iaCandidate.nodeImpl.getName().equals(daCandidate.impl.getName())) { + compatibleCandidates.put(iaCandidate, daCandidate); + } + } + } + chain.daCandidates = new ArrayList<>(); + chain.iaCandidates = new ArrayList<>(); + + for (final IANodeTypeImplCandidate key : compatibleCandidates.keySet()) { + chain.iaCandidates.add(key); + chain.daCandidates.add(compatibleCandidates.get(key)); + } + } + + /** + * Creates a ProvisioningChain for the given RelationshipTemplate. + * + * @param relationshipTemplate an AbstractRelationshipTemplate which should be provisioned + * @param forSource determines whether provisioning is handle on the SourceInterface (set to true) or + * TargetInterface + * @return a ProvisioningChain with complete provisioning Candidates + */ + public OperationChain createOperationChain(final AbstractRelationshipTemplate relationshipTemplate, + final boolean forSource) { + // get implementations + final List relationshipTypeImpls = + relationshipTemplate.getImplementations(); + + if (relationshipTypeImpls.isEmpty()) { + return null; + } + + // init chain + final OperationChain chain = new OperationChain(relationshipTemplate); + + // calculate infraNodes + final List infraNodes = new ArrayList<>(); + + ModelUtils.getInfrastructureNodes(relationshipTemplate, infraNodes, forSource); + + // check for IA Plugins + final List> iaPlugins = pluginRegistry.getIaPlugins(); + + calculateBestImplementationRelationIACandidates(relationshipTypeImpls, iaPlugins, infraNodes, + chain, forSource); + + // check for prov plugins + final List> provPlugins = + pluginRegistry.getProvPlugins(); + + calculateProvPlugins(chain, provPlugins); + + filterIADACandidatesRelations(chain); + + reorderProvCandidates(chain); + + return chain; + } + + /** + * TODO: We assume that IAs are already provisinoned on IA engine + * + * @return OperationChain + */ + public OperationChain createOperationCall(final AbstractRelationshipTemplate relationshipTemplate, + final String interfaceName, final String operationName) { + + final List impls = relationshipTemplate.getImplementations(); + if (impls.isEmpty()) { + LOG.warn("No implementations available for RelationshipTemplate {} , can't generate Provisioning logic", + relationshipTemplate.getId()); + return null; + } + + final OperationChain chain = new OperationChain(relationshipTemplate); + chain.provCandidates = new ArrayList<>(); + + final List> provPlugins = + pluginRegistry.getProvPlugins(); + + for (final AbstractRelationshipTypeImplementation impl : impls) { + final OperationNodeTypeImplCandidate provCandidate = new OperationNodeTypeImplCandidate(); + for (final AbstractImplementationArtifact ia : impl.getImplementationArtifacts()) { + for (final IPlanBuilderProvPhaseOperationPlugin plugin : provPlugins) { + if (plugin.canHandle(ia.getArtifactType()) + && getOperationForIa(chain.relationshipTemplate, ia, operationName) != null) { + provCandidate.add(getOperationForIa(chain.relationshipTemplate, ia, + operationName), + ia, plugin); + } + } + } + chain.provCandidates.add(provCandidate); + } + return chain; + } + + /** + * Creates a complete ProvisioningChain for the given NodeTemplate + * + * @param nodeTemplate an AbstractNodeTemplate to create a ProvisioningChain for + * @return a complete ProvisioningChain + */ + public OperationChain createOperationCall(final AbstractNodeTemplate nodeTemplate, + final String interfaceName, final String operationName) { + // get nodetype implementations + final List nodeTypeImpls = nodeTemplate.getImplementations(); + + if (nodeTypeImpls.isEmpty()) { + LOG.warn("No implementations available for NodeTemplate {} , can't generate Provisioning logic", + nodeTemplate.getId()); + return null; + } + + final OperationChain chain = new OperationChain(nodeTemplate); + + // calculate infrastructure nodes + final List infraNodes = new ArrayList<>(); + ModelUtils.getInfrastructureNodes(nodeTemplate, infraNodes); + + // we'll add here a dummy infra node, representing the management + // infrastructure of the tosca engine (WAR IA's implementing tosca + // operation,..) + infraNodes.add(new TOSCAManagementInfrastructureNodeTemplate()); + + // check for IA Plugins + final List> iaPlugins = pluginRegistry.getIaPlugins(); + + LOG.debug("Calculating best IA candidates for nodeTemplate {} ", nodeTemplate.getId()); + // calculate nodeImpl candidates where all IAs of each can be + // provisioned + calculateBestImplementationIACandidates(nodeTypeImpls, iaPlugins, infraNodes, chain, + interfaceName, operationName); + for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { + final int length = iaCandidate.ias.size(); + for (int i = 0; i < length; i++) { + final AbstractImplementationArtifact ia = iaCandidate.ias.get(i); + final AbstractNodeTemplate infraNode = iaCandidate.infraNodes.get(i); + final IPlanBuilderPlugin plugin = iaCandidate.plugins.get(i); + LOG.debug("Found IA {} for deployment on the InfraNode {} with the Plugin {}", + ia.getName(), infraNode.getId(), plugin.getID()); + } + } + + // check for prov plugins + final List> provPlugins = + pluginRegistry.getProvPlugins(); + + // search for prov plugins according to the chosen IA provisionings in + // the chain + calculateProvPlugins(chain, provPlugins, interfaceName, operationName); + + // filter ia and da candidates where the operations can't be executed + filterIADACandidates(chain); + + // order provisioning candidates + reorderProvCandidates(chain); + + // TODO consistency plugins + final List array = new ArrayList<>(); + + array.add(operationName); + // select provisioning + selectProvisioning(chain, array); + + return chain; + } + + /** + * Creates a complete ProvisioningChain for the given NodeTemplate + * + * @param nodeTemplate an AbstractNodeTemplate to create a ProvisioningChain for + * @return a complete ProvisioningChain + */ + public OperationChain createOperationChain(final AbstractNodeTemplate nodeTemplate, final List operationNames) { + // get nodetype implementations + final List nodeTypeImpls = nodeTemplate.getImplementations(); + + if (nodeTypeImpls.isEmpty()) { + LOG.warn("No implementations available for NodeTemplate {} , can't generate Provisioning logic", + nodeTemplate.getId()); + return null; + } + + final OperationChain chain = new OperationChain(nodeTemplate); + + // calculate infrastructure nodes + final List infraNodes = new ArrayList<>(); + ModelUtils.getInfrastructureNodes(nodeTemplate, infraNodes); + + // we'll add here a dummy infra node, representing the management + // infrastructure of the tosca engine (WAR IA's implementing tosca + // operation,..) + infraNodes.add(new TOSCAManagementInfrastructureNodeTemplate()); + + // check for IA Plugins + final List> iaPlugins = pluginRegistry.getIaPlugins(); + + LOG.debug("Calculating best IA candidates for nodeTemplate {} ", nodeTemplate.getId()); + // calculate nodeImpl candidates where all IAs of each can be + // provisioned + calculateBestImplementationIACandidates(nodeTypeImpls, iaPlugins, infraNodes, chain); + for (final IANodeTypeImplCandidate wrapper : chain.iaCandidates) { + final int length = wrapper.ias.size(); + for (int i = 0; i < length; i++) { + final AbstractImplementationArtifact ia = wrapper.ias.get(i); + final AbstractNodeTemplate infraNode = wrapper.infraNodes.get(i); + final IPlanBuilderPlugin plugin = wrapper.plugins.get(i); + LOG.debug("Found IA {} for deployment on the InfraNode {} with the Plugin {}", + ia.getName(), infraNode.getId(), plugin.getID()); + } + } + + // check for DA Plugins + final List> daPlugins = pluginRegistry.getDaPlugins(); + + // calculate nodeImpl candidates where all DAs of each can be + // provisioned + calculateBestImplementationDACandidates(nodeTemplate, nodeTypeImpls, daPlugins, infraNodes, + chain); + for (final DANodeTypeImplCandidate wrapper : chain.daCandidates) { + final int length = wrapper.das.size(); + for (int i = 0; i < length; i++) { + final AbstractDeploymentArtifact da = wrapper.das.get(i); + final AbstractNodeTemplate infraNode = wrapper.infraNodes.get(i); + final IPlanBuilderPlugin plugin = wrapper.plugins.get(i); + LOG.debug("Found DA {} for deployment on the InfraNode {} with the Plugin {}", + da.getName(), infraNode.getId(), plugin.getID()); + } + } + + // filter for nodeTypeImpl Candidates where both DAs and IAs can + // be provisioned + filterIncompatibleIADACandidates(chain); + + // check for prov plugins + final List> provPlugins = + pluginRegistry.getProvPlugins(); + + // search for prov plugins according to the chosen IA provisionings in + // the chain + calculateProvPlugins(chain, provPlugins); + + // filter ia and da candidates where the operations can't be executed + filterIADACandidates(chain); + + // order provisioning candidates + reorderProvCandidates(chain); + + // TODO consistency plugins + + // select provisioning + selectProvisioning(chain, operationNames); + + return chain; + } + + /** + * Reorders the IA/ProvCandidates inside the given ProvisioningChain, so that a correct order is enforced + * + * @param chain a ProvisioningChain + */ + private void reorderProvCandidates(final OperationChain chain) { + // ia candidates and da candidates in the chains are already ordered + // accordingly + final List reorderedList = new ArrayList<>(); + for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { + final int iaCandidateSize = iaCandidate.ias.size(); + for (final OperationNodeTypeImplCandidate provCandidate : chain.provCandidates) { + for (final AbstractImplementationArtifact iaCandidateIa : iaCandidate.ias) { + for (final AbstractImplementationArtifact provCandidateIa : provCandidate.ias) { + if (iaCandidateIa.equals(provCandidateIa)) { + reorderedList.add(provCandidate); + break; + } + } + } + } + } + + chain.provCandidates = reorderedList; + } + + /** + * Filters IA and ProvCandidates which aren't generated from the same Template Implementation + * + * @param chain a ProvisioningChain + */ + private void filterIADACandidatesRelations(final OperationChain chain) { + if (chain.provCandidates.size() != chain.iaCandidates.size()) { + final List iaCandidatesToRemove = new ArrayList<>(); + final Set provCandidatesWithMatch = new HashSet<>(); + for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { + final int iaCandidateSize = iaCandidate.ias.size(); + OperationNodeTypeImplCandidate match = null; + for (final OperationNodeTypeImplCandidate provCandidate : chain.provCandidates) { + int count = 0; + for (final AbstractImplementationArtifact iaCandidateIa : iaCandidate.ias) { + for (final AbstractImplementationArtifact procCandidateIa : provCandidate.ias) { + if (iaCandidateIa.equals(procCandidateIa)) { + count++; + } + } + } + if (count == iaCandidateSize) { + match = provCandidate; + } + } + if (match == null && !chain.provCandidates.isEmpty()) { + iaCandidatesToRemove.add(iaCandidate); + } else { + if (match != null) { + provCandidatesWithMatch.add(match); + } + } + } + if (!iaCandidatesToRemove.isEmpty()) { + // we need to remove ia and da candidates accordingly, because + // we didn't found matchin operation candidates for them + for (final IANodeTypeImplCandidate iaCandidateToRemove : iaCandidatesToRemove) { + final int index = chain.iaCandidates.indexOf(iaCandidateToRemove); + chain.iaCandidates.remove(index); + } + } + + if (!provCandidatesWithMatch.isEmpty()) { + // remove all prov candidates which weren't matched to some ia + // candidate + chain.provCandidates = new ArrayList<>(); + for (final OperationNodeTypeImplCandidate matchedCandidate : provCandidatesWithMatch) { + chain.provCandidates.add(matchedCandidate); + } + } + } + } + + /** + * Filters DA/IA Candidates where no OperationCandidates could be found + * + * @param chain a ProvisioningChain + */ + private void filterIADACandidates(final OperationChain chain) { + if (chain.provCandidates.size() != chain.iaCandidates.size()) { + // search for ia/da-Candidates where no operation candidate could be + // found + final List iaCandidatesToRemove = new ArrayList<>(); + final Set provCandidatesWithMatch = new HashSet<>(); + for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { + final int iaCandidateSize = iaCandidate.ias.size(); + OperationNodeTypeImplCandidate match = null; + for (final OperationNodeTypeImplCandidate provCandidate : chain.provCandidates) { + int count = 0; + for (final AbstractImplementationArtifact iaCandidateIa : iaCandidate.ias) { + for (final AbstractImplementationArtifact provCandidateIa : provCandidate.ias) { + if (iaCandidateIa.equals(provCandidateIa)) { + count++; + } + } + } + if (count == iaCandidateSize) { + match = provCandidate; + } + } + if (match == null && !chain.provCandidates.isEmpty()) { + iaCandidatesToRemove.add(iaCandidate); + } else { + if (match != null) { + provCandidatesWithMatch.add(match); + } + } + } + + if (!iaCandidatesToRemove.isEmpty()) { + // we need to remove ia and da candidates accordingly, because + // we didn't found matchin operation candidates for them + for (final IANodeTypeImplCandidate iaCandidateToRemove : iaCandidatesToRemove) { + final int index = chain.iaCandidates.indexOf(iaCandidateToRemove); + chain.iaCandidates.remove(index); + chain.daCandidates.remove(index); + } + } + + if (!provCandidatesWithMatch.isEmpty()) { + // remove all prov candidates which weren't matched to some ia + // candidate + chain.provCandidates = new ArrayList<>(); + for (final OperationNodeTypeImplCandidate matchedCandidate : provCandidatesWithMatch) { + chain.provCandidates.add(matchedCandidate); + } + } + } + } + + private void selectProvisioning(final OperationChain chain, final List operationNames) { + // TODO just select the first ia candidate, da candidate and prov candidate for now + // Selection should determine a minimal provisioning. + // Minimal= min{|IACandidates| + |DACandidates| + |ProvPhaseOperations|} + + // select first candidate set where the provisioning candidate uses the given operations + + int selectedCandidateSet = -1; + for (int i = 0; i < chain.provCandidates.size(); i++) { + + for (final AbstractOperation op : chain.provCandidates.get(i).ops) { + if (operationNames.contains(op.getName())) { + selectedCandidateSet = i; + break; + } + } + if (selectedCandidateSet != -1) { + break; + } + } + + if (selectedCandidateSet != -1) { + chain.selectedCandidateSet = selectedCandidateSet; + } + } + + /** + * Calculates which Provisioning can be used for Provisioining according to the given IA/DACandidates inside the + * given ProvisioningChain + * + * @param chain a ProvisioningChain with set DA/IACandidates + * @param provPlugins a List of ProvPhaseOperationPlugins + */ + private void calculateProvPlugins(final OperationChain chain, + final List> provPlugins, + final String interfaceName, final String operationName) { + final List candidates = new ArrayList<>(); + for (final IANodeTypeImplCandidate iaCandidate : chain.iaCandidates) { + final OperationNodeTypeImplCandidate provCandidate = new OperationNodeTypeImplCandidate(); + for (final AbstractImplementationArtifact ia : iaCandidate.ias) { + if (!ia.getInterfaceName().trim().equals(interfaceName.trim())) { + continue; + } + if (ia.getOperationName() != null && !ia.getOperationName().trim().equals(operationName.trim())) { + continue; + } + for (final IPlanBuilderProvPhaseOperationPlugin plugin : provPlugins) { + if (chain.nodeTemplate != null) { + if (plugin.canHandle(ia.getArtifactType()) + && getOperationForIa(chain.nodeTemplate, ia) != null) { + + provCandidate.add(getOperationForIa(chain.nodeTemplate, ia), ia, plugin); + } + } else { + if (plugin.canHandle(ia.getArtifactType()) + && getOperationForIa(chain.relationshipTemplate, ia) != null) { + provCandidate.add(getOperationForIa(chain.relationshipTemplate, ia), ia, + plugin); + } + } + } + } + if (chain.nodeTemplate != null) { + if (provCandidate.isValid(chain.nodeTemplate, interfaceName, operationName)) { + candidates.add(provCandidate); + } + } else { + if (provCandidate.isValid(chain.relationshipTemplate)) { + candidates.add(provCandidate); + } + } + } + chain.provCandidates = candidates; + } + + /** + * Calculates which Provisioning can be used for Provisioining according to the given IA/DACandidates inside the + * given ProvisioningChain + * + * @param chain a ProvisioningChain with set DA/IACandidates + * @param provPlugins a List of ProvPhaseOperationPlugins + */ + private void calculateProvPlugins(final OperationChain chain, + final List> provPlugins) { + final List candidates = new ArrayList<>(); + for (final IANodeTypeImplCandidate candidate : chain.iaCandidates) { + final OperationNodeTypeImplCandidate provCandidate = new OperationNodeTypeImplCandidate(); + for (final AbstractImplementationArtifact ia : candidate.ias) { + for (final IPlanBuilderProvPhaseOperationPlugin plugin : provPlugins) { + if (chain.nodeTemplate != null) { + if (plugin.canHandle(ia.getArtifactType()) + && getOperationForIa(chain.nodeTemplate, ia) != null) { + + provCandidate.add(getOperationForIa(chain.nodeTemplate, ia), ia, plugin); + } + } else { + if (plugin.canHandle(ia.getArtifactType()) + && getOperationForIa(chain.relationshipTemplate, ia) != null) { + provCandidate.add(getOperationForIa(chain.relationshipTemplate, ia), ia, + plugin); + } + } + } + } + if (chain.nodeTemplate != null) { + if (provCandidate.isValid(chain.nodeTemplate)) { + candidates.add(provCandidate); + } + } else { + if (provCandidate.isValid(chain.relationshipTemplate)) { + candidates.add(provCandidate); + } + } + } + chain.provCandidates = candidates; + } + + /** + * Returns the Operation which is implemented by the given IA + * + * @param nodeTemplate an AbstractNodeTemplate + * @param ia an AbstractImplementationArtifact + * @return AbstractOperation of the NodeTemplate if the given IA implements it, else null + */ + private AbstractOperation getOperationForIa(final AbstractNodeTemplate nodeTemplate, + final AbstractImplementationArtifact ia) { + + if (ia.getInterfaceName() != null & ia.getOperationName() == null) { + return new InterfaceDummy(nodeTemplate, ia); + } + + for (final AbstractInterface iface : nodeTemplate.getType().getInterfaces()) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(ia.getOperationName())) { + return op; + } + } + } + return null; + } + + /** + * Returns the Operation which is implemented by the given IA + * + * @param relationshipTemplate an AbstractRelationshipTemplate + * @param ia an AbstractImplementationArtifact + * @return AbstractOperation of the RelationshipTemplate if the given IA implements it, else null + */ + private AbstractOperation getOperationForIa(final AbstractRelationshipTemplate relationshipTemplate, + final AbstractImplementationArtifact ia) { + return getOperationForIa(relationshipTemplate, ia, ia.getOperationName()); + } + + private AbstractOperation getOperationForIa(final AbstractRelationshipTemplate relationshipTemplate, + final AbstractImplementationArtifact ia, + final String operationNameFallback) { + String name = ia.getOperationName(); + if (name == null) { + name = operationNameFallback; + } + + for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getSourceInterfaces()) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(name)) { + return op; + } + } + } + for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getTargetInterfaces()) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(name)) { + return op; + } + } + } + for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getInterfaces()) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(name)) { + return op; + } + } + } + return null; + } + + /** + * Calculates correct mappings of the given NodeTypeImplementations, PrePhaseDAPlugins and InfrastructureNodes for + * the given ProvisioningChain + * + * @param impls a List of NodeTypeImplementations + * @param plugins a List of PrePhaseDAPlugins + * @param infraNodes a List of InfrastructureNode of the NodeTemplate the NodeTypeImplementations belong to + * @param chain a ProvisioningChain where the candidates are added to + */ + private void calculateBestImplementationDACandidates(final AbstractNodeTemplate nodeTemplate, + final List impls, + final List> plugins, + final List infraNodes, + final OperationChain chain) { + final List candidates = new ArrayList<>(); + + for (final AbstractNodeTypeImplementation impl : impls) { + LOG.debug("Checking DAs of NodeTypeImpl {} and NodeTemplate {}", impl.getName(), + nodeTemplate.getId()); + final DANodeTypeImplCandidate candidate = new DANodeTypeImplCandidate(nodeTemplate, impl); + + final List effectiveDAs = + calculateEffectiveDAs(nodeTemplate, impl); + + for (final AbstractDeploymentArtifact da : effectiveDAs) { + LOG.debug("Checking whether DA {} can be deployed", da.getName()); + for (final AbstractNodeTemplate infraNode : infraNodes) { + LOG.debug("Checking if DA {} can be deployed on InfraNode {}", da.getName(), + infraNode.getId()); + for (final IPlanBuilderPrePhaseDAPlugin plugin : plugins) { + LOG.debug("Checking with Plugin {}", plugin.getID()); + if (plugin.canHandle(da, infraNode.getType())) { + LOG.debug("Adding Plugin, can handle DA on InfraNode"); + candidate.add(da, infraNode, plugin); + } + } + } + } + if (candidate.isValid()) { + LOG.debug("Generated Candidate was valid, adding to all Candidates"); + candidates.add(candidate); + } else { + LOG.debug("Generated Candidate was invalid, don't add to all Candidates"); + } + } + chain.daCandidates = candidates; + } + + /** + * Searches for NodeTypeImplementations where all IA's can be provisioned by some plugin in the system. + * + * @param impls all implementations of single nodetype + * @param plugins all plugins possibly capable of working with the ia's contained in a nodetypeImplementation + * @param infraNodes all infrastructure nodes of the nodetemplate the nodetypeimplementations originate from + * @return a list of Wrapper class Object which contain information of which ia is provisioned on which + * infrastructure by which plugin + */ + private void calculateBestImplementationIACandidates(final List impls, + final List> plugins, + final List infraNodes, + final OperationChain chain, final String interfaceName, + final String operationName) { + + final List candidates = new ArrayList<>(); + // cycle through all implementations + for (final AbstractNodeTypeImplementation impl : impls) { + final IANodeTypeImplCandidate candidate = new IANodeTypeImplCandidate(impl); + // match the ias of the implementation with the infrastructure nodes + for (final AbstractImplementationArtifact ia : impl.getImplementationArtifacts()) { + if (!ia.getInterfaceName().trim().equals(interfaceName.trim())) { + continue; + } + if (ia.getOperationName() != null && !ia.getOperationName().trim().equals(operationName.trim())) { + continue; + } + + LOG.debug("Checking whether IA {} can be deployed on a specific Infrastructure Node", + ia.getName()); + for (final AbstractNodeTemplate infraNode : infraNodes) { + // check if any plugin can handle installing the ia on the + // infraNode + for (final IPlanBuilderPrePhaseIAPlugin plugin : plugins) { + if (plugin.canHandle(ia, infraNode.getType())) { + candidate.add(ia, infraNode, plugin); + } + } + } + } + // check if all ias of the implementation can be provisioned + if (candidate.isValid(interfaceName, operationName)) { + candidates.add(candidate); + LOG.debug("IA Candidate is valid, adding to candidate list"); + } else { + LOG.debug("IA Candidate is invalid, discarding candidate"); + } + } + chain.iaCandidates = candidates; + } + + /** + * Searches for NodeTypeImplementations where all IA's can be provisioned by some plugin in the system. + * + * @param impls all implementations of single nodetype + * @param plugins all plugins possibly capable of working with the ia's contained in a nodetypeImplementation + * @param infraNodes all infrastructure nodes of the nodetemplate the nodetypeimplementations originate from + * @return a list of Wrapper class Object which contain information of which ia is provisioned on which + * infrastructure by which plugin + */ + private void calculateBestImplementationIACandidates(final List impls, + final List> plugins, + final List infraNodes, + final OperationChain chain) { + + final List candidates = new ArrayList<>(); + // cycle through all implementations + for (final AbstractNodeTypeImplementation impl : impls) { + final IANodeTypeImplCandidate candidate = new IANodeTypeImplCandidate(impl); + // match the ias of the implementation with the infrastructure nodes + for (final AbstractImplementationArtifact ia : impl.getImplementationArtifacts()) { + LOG.debug("Checking whether IA {} can be deployed on a specific Infrastructure Node", + ia.getName()); + for (final AbstractNodeTemplate infraNode : infraNodes) { + // check if any plugin can handle installing the ia on the + // infraNode + for (final IPlanBuilderPrePhaseIAPlugin plugin : plugins) { + if (plugin.canHandle(ia, infraNode.getType())) { + candidate.add(ia, infraNode, plugin); + } + } + } + } + // check if all ias of the implementation can be provisioned + if (candidate.isValid()) { + candidates.add(candidate); + LOG.debug("IA Candidate is valid, adding to candidate list"); + } else { + LOG.debug("IA Candidate is invalid, discarding candidate"); + } + } + chain.iaCandidates = candidates; + } + + /** + * Checks whether the IA implements a SourceInterfaceOperation + * + * @param ia the IA to check with + * @param relationshipTemplate the RelationshipTemplate to check with + * @return true if the IA implements a Operation inside a SourceInterface of the RelationshipTemplate + */ + private boolean checkIfIaImplementsSrcIface(final AbstractImplementationArtifact ia, + final AbstractRelationshipTemplate relationshipTemplate) { + + for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getSourceInterfaces()) { + if (iface.getName().equals(ia.getInterfaceName())) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(ia.getOperationName())) { + return true; + } + } + } + } + return false; + } + + /** + * Calculates correct mappings for the given RelationshipTypeImplementations with the given Plugins and InfraNodes + * + * @param impls a List of RelationshipTypeImplementation + * @param plugins a List of PrePhaseIAPlugins + * @param infraNodes a List of InfrastructureNodes which belong to the RelationshipTemplate the given Implementation + * belong to + * @param chain a ProvisioningChain to save the results + * @param forSource whether the calculation is done for the SourceInterface or for the TargetInterface + */ + private void calculateBestImplementationRelationIACandidates(final List impls, + final List> plugins, + final List infraNodes, + final OperationChain chain, + final boolean forSource) { + final List candidates = new ArrayList<>(); + for (final AbstractRelationshipTypeImplementation impl : impls) { + final IANodeTypeImplCandidate candidate = new IANodeTypeImplCandidate(impl); + for (final AbstractImplementationArtifact ia : impl.getImplementationArtifacts()) { + if (forSource) { + // check if ia implements source interfaces + if (!checkIfIaImplementsSrcIface(ia, chain.relationshipTemplate)) { + continue; + } + } else { + if (checkIfIaImplementsSrcIface(ia, chain.relationshipTemplate)) { + continue; + } + } + + for (final AbstractNodeTemplate infraNode : infraNodes) { + for (final IPlanBuilderPrePhaseIAPlugin plugin : plugins) { + if (plugin.canHandle(ia, infraNode.getType())) { + candidate.add(ia, infraNode, plugin); + } + } + } + } + if (candidate.isValid()) { + candidates.add(candidate); + } + } + chain.iaCandidates = candidates; + } + + /** + * Calculates a list of DA's containing an effective set of DA combining the DA's from the given NodeImplementation + * and NodeTemplates according to the TOSCA specification. + * + * @param nodeTemplate the NodeTemplate the NodeImplementations belongs to + * @param nodeImpl a NodeTypeImplementation for the given NodeTemplate + * @return a possibly empty list of AbstractDeploymentArtifacts + */ + static List calculateEffectiveDAs(final AbstractNodeTemplate nodeTemplate, + final AbstractNodeTypeImplementation nodeImpl) { + final List effectiveDAs = new ArrayList<>(); + + final List nodeImplDAs = nodeImpl.getDeploymentArtifacts(); + final List nodeTemplateDAs = nodeTemplate.getDeploymentArtifacts(); + + for (final AbstractDeploymentArtifact templateDa : nodeTemplateDAs) { + boolean overridesDA = false; + int daIndex = -1; + for (int i = 0; i < nodeImplDAs.size(); i++) { + final AbstractDeploymentArtifact nodeImplDa = nodeImplDAs.get(i); + + if (nodeImplDa.getName().equals(templateDa.getName()) + & nodeImplDa.getArtifactType().equals(nodeImplDa.getArtifactType())) { + overridesDA = true; + daIndex = i; + } + } + + if (overridesDA) { + nodeImplDAs.remove(daIndex); + } + } + + effectiveDAs.addAll(nodeTemplateDAs); + effectiveDAs.addAll(nodeImplDAs); + + return effectiveDAs; + } +} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/DANodeTypeImplCandidate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/DANodeTypeImplCandidate.java similarity index 83% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/DANodeTypeImplCandidate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/DANodeTypeImplCandidate.java index db5506b68..5e6bbf072 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/DANodeTypeImplCandidate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/DANodeTypeImplCandidate.java @@ -3,31 +3,29 @@ import java.util.ArrayList; import java.util.List; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPrePhasePlugin; /** *

    - * This Class represents a Mapping of DA's of an Implementation Plugins which can handle that with - * matching InfrastructureNode + * This Class represents a Mapping of DA's of an Implementation Plugins which can handle that with matching + * InfrastructureNode *

    - * + *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ class DANodeTypeImplCandidate { AbstractNodeTypeImplementation impl; - private final AbstractNodeTemplate nodeTemplate; List das = new ArrayList<>(); List infraNodes = new ArrayList<>(); List plugins = new ArrayList<>(); + private final AbstractNodeTemplate nodeTemplate; /** * Constructor determines which NodeTypeImplementation is used @@ -42,9 +40,9 @@ class DANodeTypeImplCandidate { /** * Adds a mapping from DA to NodeTemplate with a PrePhaseDAPlugin * - * @param da the DeploymentArtifact which should be provisioned + * @param da the DeploymentArtifact which should be provisioned * @param nodeTemplate an InfrastructureNode on which the DA should be deployed - * @param plugin the PrePhaseDAPlugin which can deploy the DA unto the given NodeTemplate + * @param plugin the PrePhaseDAPlugin which can deploy the DA unto the given NodeTemplate */ void add(final AbstractDeploymentArtifact da, final AbstractNodeTemplate nodeTemplate, final IPlanBuilderPrePhaseDAPlugin plugin) { diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/IANodeTypeImplCandidate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/IANodeTypeImplCandidate.java similarity index 95% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/IANodeTypeImplCandidate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/IANodeTypeImplCandidate.java index 64ceee990..91b82e7a1 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/IANodeTypeImplCandidate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/IANodeTypeImplCandidate.java @@ -3,11 +3,11 @@ import java.util.ArrayList; import java.util.List; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTypeImplementation; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; /** *

    @@ -17,16 +17,16 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ class IANodeTypeImplCandidate { AbstractNodeTypeImplementation nodeImpl; - private AbstractRelationshipTypeImplementation relationImpl; List ias = new ArrayList<>(); List infraNodes = new ArrayList<>(); List plugins = new ArrayList<>(); + private AbstractRelationshipTypeImplementation relationImpl; + /** * Constructor for a NodeTypeImplementation * @@ -48,9 +48,9 @@ class IANodeTypeImplCandidate { /** * Adds a mapping from IA to InfrastructureNode with a PrePhaseIAPlugin * - * @param ia the IA to deploy + * @param ia the IA to deploy * @param nodeTemplate the InfrastructureNode to deploy the IA on - * @param plugin the PrePhaseIAPlugin which can deploy the IA unto the InfrastructureNode + * @param plugin the PrePhaseIAPlugin which can deploy the IA unto the InfrastructureNode */ void add(final AbstractImplementationArtifact ia, final AbstractNodeTemplate nodeTemplate, final IPlanBuilderPrePhaseIAPlugin plugin) { @@ -154,5 +154,4 @@ boolean isValid(final String interfaceName, final String operationName) { return true; } } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/InterfaceDummy.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/InterfaceDummy.java similarity index 97% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/InterfaceDummy.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/InterfaceDummy.java index d1e748e73..ecafc79d3 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/InterfaceDummy.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/InterfaceDummy.java @@ -10,11 +10,9 @@ import org.opentosca.planbuilder.model.tosca.AbstractParameter; /** - * As some IAs may implement a whole interface we mock the matching of these kind of IAs with this - * dummy class + * As some IAs may implement a whole interface we mock the matching of these kind of IAs with this dummy class * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ class InterfaceDummy extends AbstractOperation { @@ -34,7 +32,6 @@ public AbstractOperation getOperation(final String opName) { return op; } } - } } return null; @@ -81,5 +78,4 @@ public AbstractInterface getInterface() { // TODO Auto-generated method stub return null; } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationChain.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationChain.java similarity index 87% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationChain.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationChain.java index 20843dcf9..285a561a6 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationChain.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationChain.java @@ -6,7 +6,12 @@ import java.util.Map; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseParamOperationPlugin; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; import org.opentosca.planbuilder.model.tosca.AbstractInterface; @@ -14,25 +19,17 @@ import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseParamOperationPlugin; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Variable; import org.w3c.dom.Element; /** *

    - * This Class is a wrapper class for the other wrapper classes - * (IACandidateWrapper,DACandidateWrapper,..). The class also represents if there are complete - * provisioning possible with the available template implementations. + * This Class is a wrapper class for the other wrapper classes (IACandidateWrapper,DACandidateWrapper,..). The class + * also represents if there are complete provisioning possible with the available template implementations. *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class OperationChain { @@ -72,15 +69,13 @@ public class OperationChain { /** *

    - * Executes the first found DACandidate to provision DA's with the appropiate plugins set in the - * candidate + * Executes the first found DACandidate to provision DA's with the appropiate plugins set in the candidate *

    * - * @param context a BPELPlanContext which is initialized for either a NodeTemplate or - * RelationshipTemplate this ProvisioningChain belongs to - * @return returns false only when execution of a plugin inside the DACandidate failed, else true. - * There may be no IACandidate available, because there is no need for DA's to provision. In - * this case true is also returned. + * @param context a TemplatePlanContext which is initialized for either a NodeTemplate or RelationshipTemplate this + * ProvisioningChain belongs to + * @return returns false only when execution of a plugin inside the DACandidate failed, else true. There may be no + * DACandidate available, because there is no need for DA's to provision. In this case true is also returned. */ public boolean executeDAProvisioning(final BPELPlanContext context) { boolean check = true; @@ -98,15 +93,13 @@ public boolean executeDAProvisioning(final BPELPlanContext context) { /** *

    - * Executes the first found IACandidate to provision IA's with the appropiate plugins set in the - * candidate + * Executes the first found IACandidate to provision IA's with the appropiate plugins set in the candidate *

    * - * @param context a BPELPlanContext which is initialized for either a NodeTemplate or - * RelationshipTemplate this ProvisioningChain belongs to - * @return returns false only when execution of a plugin inside the IACandidate failed, else true. - * There may be no IACandidate available, because there is no need for IA's to provision. In - * this case true is also returned. + * @param context a BPELPlanContext which is initialized for either a NodeTemplate or RelationshipTemplate this + * ProvisioningChain belongs to + * @return returns false only when execution of a plugin inside the IACandidate failed, else true. There may be no + * IACandidate available, because there is no need for IA's to provision. In this case true is also returned. */ public boolean executeIAProvisioning(final PlanContext context) { boolean check = true; @@ -124,19 +117,19 @@ public boolean executeIAProvisioning(final PlanContext context) { /** *

    - * Executes the first found ProvisioningCandidate to execute provisioning operations with the - * appropiate plugins set in the candidate + * Executes the first found ProvisioningCandidate to execute provisioning operations with the appropiate plugins set + * in the candidate *

    * *

    * Info: A ProvisioningCandidate may not have an appropiate order of operations set *

    * - * @param context a BPELPlanContext which is initialized for either a NodeTemplate or - * RelationshipTemplate this ProvisioningChain belongs to - * @return returns false only when execution of a plugin inside the ProvisioningCandidate failed, - * else true. There may be no ProvisioningCandidate available, because there is no need for - * operation to call. In this case true is also returned. + * @param context a BPELPlanContext which is initialized for either a NodeTemplate or RelationshipTemplate this + * ProvisioningChain belongs to + * @return returns false only when execution of a plugin inside the ProvisioningCandidate failed, else true. There + * may be no ProvisioningCandidate available, because there is no need for operation to call. In this case true is + * also returned. */ public boolean executeOperationProvisioning(final BPELPlanContext context) { boolean check = true; @@ -154,16 +147,15 @@ public boolean executeOperationProvisioning(final BPELPlanContext context) { /** *

    - * Executes the first found ProvisioningCandidate to execute provisioning operations with the - * appropiate plugins set in the candidate. The order of calling each operation provisioning is - * represented in the given list of strings + * Executes the first found ProvisioningCandidate to execute provisioning operations with the appropiate plugins set + * in the candidate. The order of calling each operation provisioning is represented in the given list of strings *

    * - * @param context a BPELPlanContext which is initialized for either a NodeTemplate or - * RelationshipTemplate this ProvisioningChain belongs to - * @return returns false only when execution of a plugin inside the ProvisioningCandidate failed, - * else true. There may be no ProvisioningCandidate available, because there is no need for - * operation to call. In this case true is also returned. + * @param context a BPELPlanContext which is initialized for either a NodeTemplate or RelationshipTemplate this + * ProvisioningChain belongs to + * @return returns false only when execution of a plugin inside the ProvisioningCandidate failed, else true. There + * may be no ProvisioningCandidate available, because there is no need for operation to call. In this case true is + * also returned. */ public boolean executeOperationProvisioning(final BPELPlanContext context, final List operationNames) { boolean check = true; @@ -254,11 +246,9 @@ public boolean executeOperationProvisioning(final BPELPlanContext context, final } } } - } } return checkCount == operationNames.size(); - } public boolean executeOperationProvisioning(final BPELPlanContext context, final List operationNames, @@ -322,16 +312,14 @@ public boolean executeOperationProvisioning(final BPELPlanContext context, final } else { final AbstractOperation dummyOp = this.createDummyOperation(opName, op); if (paramPlugin.handle(context, dummyOp, ia, param2propertyMapping, - param2propertyOutputMapping)) { + param2propertyOutputMapping)) { checkCount++; } } } - } } return checkCount == operationNames.size(); - } public List getDAsOfCandidate(final int candidateIndex) { @@ -340,7 +328,8 @@ public List getDAsOfCandidate(final int candidateInd public boolean executeOperationProvisioning(final BPELPlanContext context, final List operationNames, final Map param2propertyMapping, - final Map param2propertyOutputMapping, Element elementToAppendTo) { + final Map param2propertyOutputMapping, + final Element elementToAppendTo) { int checkCount = 0; if (!this.provCandidates.isEmpty()) { final OperationNodeTypeImplCandidate provCandidate = this.provCandidates.get(this.selectedCandidateSet); @@ -398,20 +387,19 @@ public boolean executeOperationProvisioning(final BPELPlanContext context, final } else { final AbstractOperation dummyOp = this.createDummyOperation(opName, op); if (paramPlugin.handle(context, dummyOp, ia, param2propertyMapping, param2propertyOutputMapping, - elementToAppendTo)) { + elementToAppendTo)) { checkCount++; } } } - } } return checkCount == operationNames.size(); - } public boolean executeOperationProvisioning(final BPELPlanContext context, final List operationNames, - final Map param2propertyMapping, Element elementToAppendTo) { + final Map param2propertyMapping, + final Element elementToAppendTo) { int checkCount = 0; if (!this.provCandidates.isEmpty()) { final OperationNodeTypeImplCandidate provCandidate = this.provCandidates.get(this.selectedCandidateSet); @@ -454,15 +442,13 @@ public boolean executeOperationProvisioning(final BPELPlanContext context, final } } } - } } return checkCount == operationNames.size(); - } - + private AbstractOperation createDummyOperation(String opName, AbstractOperation op) { - return new AbstractOperation() { + return new AbstractOperation() { private final String operationName = opName; private final InterfaceDummy iface = (InterfaceDummy) op; diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationNodeTypeImplCandidate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationNodeTypeImplCandidate.java similarity index 89% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationNodeTypeImplCandidate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationNodeTypeImplCandidate.java index 6be664351..a3c4c1f58 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationNodeTypeImplCandidate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/artifactbasednodehandler/OperationNodeTypeImplCandidate.java @@ -3,24 +3,23 @@ import java.util.ArrayList; import java.util.List; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; import org.opentosca.planbuilder.model.tosca.AbstractInterface; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; /** *

    - * This Class is a wrapper for operations that provision a particular template. This is realized by - * a mapping between operations, IA's and ProvPhasePlugins + * This Class is a wrapper for operations that provision a particular template. This is realized by a mapping between + * operations, IA's and ProvPhasePlugins *

    - * + *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ class OperationNodeTypeImplCandidate { @@ -35,10 +34,9 @@ class OperationNodeTypeImplCandidate { * Adds a mapping for a operation, an IA and ProvPhasePlugin *

    * - * @param op an AbstractOperation of Template - * @param ia an AbstractImplementationArtifact which implements the given operation - * @param plugin a ProvPhasePlugin that can execute on the given Operation and - * ImplementationArtifact + * @param op an AbstractOperation of Template + * @param ia an AbstractImplementationArtifact which implements the given operation + * @param plugin a ProvPhasePlugin that can execute on the given Operation and ImplementationArtifact */ void add(final AbstractOperation op, final AbstractImplementationArtifact ia, final IPlanBuilderProvPhaseOperationPlugin plugin) { @@ -49,8 +47,7 @@ void add(final AbstractOperation op, final AbstractImplementationArtifact ia, /** *

    - * Checks if any Interface of the given NodeTemplate can be executed completely by this - * ProvisioningCandidate + * Checks if any Interface of the given NodeTemplate can be executed completely by this ProvisioningCandidate *

    * * @param nodeTemplate an AbtractNodeTemplate @@ -92,8 +89,7 @@ boolean isValid(final AbstractNodeTemplate nodeTemplate, final String interfaceN /** *

    - * Checks if any Interface of the given NodeTemplate can be executed completely by this - * ProvisioningCandidate + * Checks if any Interface of the given NodeTemplate can be executed completely by this ProvisioningCandidate *

    * * @param nodeTemplate an AbtractNodeTemplate @@ -127,7 +123,7 @@ boolean isValid(final AbstractNodeTemplate nodeTemplate) { if (op instanceof InterfaceDummy) { final String ifaceName = ((InterfaceDummy) op).getIA().getInterfaceName(); for (final AbstractInterface iface : ((InterfaceDummy) op).getNodeTemplate().getType() - .getInterfaces()) { + .getInterfaces()) { if (iface.getName().equals(ifaceName)) { operationsToImplementCount += iface.getOperations().size(); } @@ -156,16 +152,15 @@ boolean isValid(final AbstractNodeTemplate nodeTemplate) { * SourceInterface *

    * - * @param relationshipTemplate an AbstractRelationshipTemplate to check it Interfaces with the - * Mappings - * @return true if the Mappings are valid for a Source- or TargetInterface of the given - * RelationshipTemplate, else false + * @param relationshipTemplate an AbstractRelationshipTemplate to check it Interfaces with the Mappings + * @return true if the Mappings are valid for a Source- or TargetInterface of the given RelationshipTemplate, else + * false */ boolean isValid(final AbstractRelationshipTemplate relationshipTemplate) { BPELScopeBuilder.LOG.debug("Checking if the selected provisioning for relationshipTemplate {}", - relationshipTemplate.getId()); + relationshipTemplate.getId()); BPELScopeBuilder.LOG.debug(" with type {} is valid whether on the source or target interface", - relationshipTemplate.getRelationshipType().getId().toString()); + relationshipTemplate.getRelationshipType().getId().toString()); // check if any source interface matches the selected prov plugins for (final AbstractInterface iface : relationshipTemplate.getRelationshipType().getSourceInterfaces()) { final int interfaceSize = iface.getOperations().size(); @@ -204,5 +199,4 @@ boolean isValid(final AbstractRelationshipTemplate relationshipTemplate) { } return false; } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/context/BPELPlanContext.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/context/BPELPlanContext.java similarity index 80% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/context/BPELPlanContext.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/context/BPELPlanContext.java index 084261734..a408e19af 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/context/BPELPlanContext.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/context/BPELPlanContext.java @@ -1,6 +1,7 @@ package org.opentosca.planbuilder.core.bpel.context; import java.io.File; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -8,10 +9,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Objects; -import java.util.Set; -import javax.swing.event.ListSelectionEvent; import javax.wsdl.Definition; import javax.wsdl.Port; import javax.wsdl.PortType; @@ -27,8 +25,11 @@ import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.OperationChain; import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; import org.opentosca.planbuilder.core.bpel.handlers.BPELScopeHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.AbstractServiceInstanceHandler; import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.plan.ActivityType; import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; @@ -37,42 +38,33 @@ import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; import org.opentosca.planbuilder.model.plan.bpel.GenericWsdlWrapper; import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference; -import org.opentosca.planbuilder.model.tosca.AbstractInterface; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractNodeType; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; /** *

    - * This class is used for all Plugins. All acitions on TemplateBuildPlans and BuildPlans should be - * done with the operations of this class. It is basically a Facade to Template and its - * TemplateBuildPlan + * This class is used for all Plugins. All acitions on TemplateBuildPlans and BuildPlans should be done with the + * operations of this class. It is basically a Facade to Template and its TemplateBuildPlan *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELPlanContext extends PlanContext { - private final static Logger LOG = LoggerFactory.getLogger(BPELPlanContext.class); private final BPELScope templateBuildPlan; + private final BPELScopeBuilder scopeBuilder; private BPELPlanHandler buildPlanHandler; @@ -82,51 +74,44 @@ public class BPELPlanContext extends PlanContext { private NodeRelationInstanceVariablesHandler nodeRelationInstanceHandler; - - /** * Constructor * - * @param templateBuildPlan the TemplateBuildPlan of a Template - * @param serviceTemplateName the name of the ServiceTemplate where the Template of the context - * originates - * @param map a PropertyMap containing mappings for all Template properties of the TopologyTemplate - * the ServiceTemplate has + * @param serviceTemplateName the name of the ServiceTemplate where the Template of the context originates + * @param templateBuildPlan the TemplateBuildPlan of a Template + * @param map a PropertyMap containing mappings for all Template properties of the TopologyTemplate */ - public BPELPlanContext(final BPELPlan plan, final BPELScope templateBuildPlan, final Property2VariableMapping map, + public BPELPlanContext(BPELScopeBuilder scopeBuilder, final BPELPlan plan, final BPELScope templateBuildPlan, final Property2VariableMapping map, final AbstractServiceTemplate serviceTemplate, String serviceInstanceURLVarName, String serviceInstanceIDVarName, String serviceTemplateURLVarName, String csarFileName) { - super(plan, serviceTemplate, map, serviceInstanceURLVarName, serviceInstanceIDVarName, - serviceTemplateURLVarName, csarFileName); + super(plan, serviceTemplate, map, serviceInstanceURLVarName, serviceInstanceIDVarName, serviceTemplateURLVarName, csarFileName); + this.scopeBuilder = scopeBuilder; this.templateBuildPlan = templateBuildPlan; this.bpelTemplateHandler = new BPELScopeHandler(); try { this.buildPlanHandler = new BPELPlanHandler(); this.bpelProcessHandler = new BPELPlanHandler(); this.nodeRelationInstanceHandler = new NodeRelationInstanceVariablesHandler(this.bpelProcessHandler); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { BPELPlanContext.LOG.warn("Coulnd't initialize internal handlers", e); } - } - public void addUsedOperation(AbstractOperation operation, AbstractOperation compensationOperation) { - this.templateBuildPlan.addUsedOperation(operation, compensationOperation); + this.templateBuildPlan.addUsedOperation(operation, compensationOperation); } - + public boolean addUsedOperation(String interfaceName, String operationName, String compensationInterfaceName, String compensationOperationName) { AbstractOperation op = this.templateBuildPlan.getBuildPlan().getDefinitions().findOperation(interfaceName, operationName); AbstractOperation compensationOp = this.templateBuildPlan.getBuildPlan().getDefinitions().findOperation(compensationInterfaceName, compensationOperationName); - if(op != null) { + if (op != null) { this.addUsedOperation(op, compensationOp); return true; } else { return false; - } + } } - + public Map getUsedOperations() { return this.templateBuildPlan.getUsedOperations(); } @@ -134,16 +119,14 @@ public Map getUsedOperations() { // TODO Refactor methods up to the BPEL specific methods /** + * Looks for a Property with the same localName as the given String. The search is on either the Infrastructure on + * the Source or Target of the Template this TemplateContext belongs to. * - * Looks for a Property with the same localName as the given String. The search is on either the - * Infrastructure on the Source or Target of the Template this TemplateContext belongs to. - * - * @param propertyName a String - * @param directionSink whether to look in direction of the sinks or sources (If Template is - * NodeTemplate) or to search on the Source-/Target-Interface (if template is - * RelationshipTemplate) - * @return a Variable Object with TemplateId and Name, if null the whole Infrastructure has no - * Property with the specified localName + * @param propertyName a String + * @param directionSink whether to look in direction of the sinks or sources (If Template is NodeTemplate) or to + * search on the Source-/Target-Interface (if template is RelationshipTemplate) + * @return a Variable Object with TemplateId and Name, if null the whole Infrastructure has no Property with the + * specified localName */ public PropertyVariable getPropertyVariable(final String propertyName, final boolean directionSink) { final List infraNodes = new ArrayList<>(); @@ -165,7 +148,6 @@ public PropertyVariable getPropertyVariable(final String propertyName, final boo } for (final AbstractNodeTemplate infraNode : infraNodes) { - for (PropertyVariable var : this.propertyMap.getNodePropertyVariables(this.serviceTemplate, infraNode)) { if (var.getPropertyName().equals(propertyName)) { return var; @@ -179,7 +161,6 @@ public PropertyVariable getPropertyVariable(final String propertyName, final boo * Returns the variable name of the first occurence of a property with the given Property name of * InfrastructureNodes * - * @param propertyName * @return a String containing the variable name, else null */ public String getVariableNameOfInfraNodeProperty(final String propertyName) { @@ -198,7 +179,6 @@ public String getTemplateId() { } else { return getRelationshipTemplate().getId(); } - } public Element getEventHandlersElement() { @@ -223,18 +203,18 @@ public boolean isRelationshipTemplate() { return this.templateBuildPlan.getRelationshipTemplate() != null ? true : false; } - public Variable getVariable(String varName) { + public static Variable getVariable(String varName) { return new Variable(varName); } public String findInstanceURLVar(final String templateId, final boolean isNode) { return this.nodeRelationInstanceHandler.findInstanceUrlVarName(this.templateBuildPlan.getBuildPlan(), - this.serviceTemplate, templateId, isNode); + this.serviceTemplate, templateId, isNode); } public String findInstanceIDVar(final String templateId, final boolean isNode) { return this.nodeRelationInstanceHandler.findInstanceIdVarName(this.serviceTemplate, templateId, isNode, - getMainVariableNames()); + getMainVariableNames()); } /** @@ -260,10 +240,9 @@ public boolean addStringValueToPlanResponse(final String localName) { /** * Adds a variable to the TemplateBuildPlan of the template this context belongs to * - * @param name the name of the variable - * @param variableType sets if this variable is a Message variable or simple BPEL variable + * @param name the name of the variable + * @param variableType sets if this variable is a Message variable or simple BPEL variable * @param declarationId the XSD Type of the variable - * @return */ public boolean addVariable(final String name, final BPELPlan.VariableType variableType, QName declarationId) { declarationId = importNamespace(declarationId); @@ -288,37 +267,36 @@ public boolean appendToInitSequence(final Node node) { return true; } + /** + * creates a context with the current context as it's parent scope using the given node template and activity types + * as input + */ public BPELPlanContext createContext(final AbstractNodeTemplate nodeTemplate, ActivityType... activityType) { LOG.debug("Trying to create {} plan context for nodeTemplate {}", activityType, nodeTemplate); for (BPELScope scope : this.templateBuildPlan.getBuildPlan().getTemplateBuildPlans()) { if (scope.getNodeTemplate() != null && scope.getNodeTemplate().equals(nodeTemplate) && Arrays.asList(activityType).contains(scope.getActivity().getType())) { LOG.debug("Found scope of nodeTemplate"); - return new BPELPlanContext((BPELPlan) this.plan, scope, this.propertyMap, this.serviceTemplate, + return new BPELPlanContext(this.scopeBuilder, (BPELPlan) this.plan, scope, this.propertyMap, this.serviceTemplate, this.serviceInstanceURLVarName, this.serviceInstanceIDVarName, this.serviceTemplateURLVarName, this.csarFileName); } } - - - return null; } - - /** * Generates a bpel string variable with the given name + "_" + randomPositiveInt. * * @param variableName String containing a name - * @param initVal the value for the variable, if null the value will be empty + * @param initVal the value for the variable, if null the value will be empty * @return a TemplatePropWrapper containing the generated Id for the variable */ public Variable createGlobalStringVariable(final String variableName, final String initVal) { final String varName = variableName + "_" + getIdForNames(); boolean check = this.buildPlanHandler.addStringVariable(varName, this.templateBuildPlan.getBuildPlan()); check &= this.buildPlanHandler.assignInitValueToVariable(varName, initVal == null ? "" : initVal, - this.templateBuildPlan.getBuildPlan()); + this.templateBuildPlan.getBuildPlan()); if (check) { return new Variable(varName); } else { @@ -329,17 +307,16 @@ public Variable createGlobalStringVariable(final String variableName, final Stri /** * Executes the operation of the given NodeTemplate * - * @param nodeTemplate the NodeTemplate the operation belongs to - * @param operationName the name of the operation to execute - * @param param2variableMapping If a Map of Parameter to Variable is given this will be used for the - * operation call + * @param nodeTemplate the NodeTemplate the operation belongs to + * @param operationName the name of the operation to execute + * @param param2variableMapping If a Map of Parameter to Variable is given this will be used for the operation call * @return true if appending logic to execute the operation at runtime was successfull */ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final String interfaceName, final String operationName, final Map param2variableMapping) { - final OperationChain chain = BPELScopeBuilder.createOperationCall(nodeTemplate, interfaceName, operationName); + final OperationChain chain = scopeBuilder.createOperationCall(nodeTemplate, interfaceName, operationName); if (chain == null) { return false; } @@ -357,7 +334,7 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S // create context from this context and set the given nodeTemplate as // the node for the scope - final BPELPlanContext context = new BPELPlanContext((BPELPlan) this.plan, this.templateBuildPlan, + final BPELPlanContext context = new BPELPlanContext(this.scopeBuilder, (BPELPlan) this.plan, this.templateBuildPlan, this.propertyMap, this.serviceTemplate, this.serviceInstanceURLVarName, this.serviceInstanceIDVarName, this.serviceTemplateURLVarName, this.csarFileName); @@ -380,25 +357,33 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S return true; } + /** + * Returns a set of nodes that will be provisioned in the plan of this context + */ + public Collection getNodesInCreation() { + Collection activities = this.templateBuildPlan.getBuildPlan().getActivites(); + Collection result = new HashSet(); + for (AbstractActivity activity : activities) { + if ((activity instanceof NodeTemplateActivity) && + (activity.getType().equals(ActivityType.PROVISIONING) || activity.getType().equals(ActivityType.MIGRATION))) { + result.add(((NodeTemplateActivity) activity).getNodeTemplate()); + } + } + return result; + } + public Variable createVariableWithRandomValue() { final String varName = "randomVar" + getIdForNames(); boolean check = this.buildPlanHandler.addStringVariable(varName, this.templateBuildPlan.getBuildPlan()); check &= this.buildPlanHandler.assignInitValueToVariable(varName, String.valueOf(System.currentTimeMillis()), - this.templateBuildPlan.getBuildPlan()); - if (check) { - return new Variable(varName); - } else { - return null; - - } - + this.templateBuildPlan.getBuildPlan()); + return check ? new Variable(varName) : null; } /** * Returns alls InfrastructureEdges of the Template this context belongs to * - * @return a List of AbstractRelationshipTemplate which are InfrastructureEdges of the template this - * context handles + * @return a List of AbstractRelationshipTemplate which are InfrastructureEdges of the template this context handles */ public List getInfrastructureEdges() { final List infraEdges = new ArrayList<>(); @@ -419,8 +404,7 @@ public List getInfrastructureEdges() { /** * Returns all InfrastructureNodes of the Template this context belongs to * - * @return a List of AbstractNodeTemplate which are InfrastructureNodeTemplate of the template this - * context handles + * @return a List of AbstractNodeTemplate which are InfrastructureNodeTemplate of the template this context handles */ public List getInfrastructureNodes() { final List infrastructureNodes = new ArrayList<>(); @@ -434,7 +418,6 @@ public List getInfrastructureNodes() { } else { ModelUtils.getInfrastructureNodes(template, infrastructureNodes, false); } - } return infrastructureNodes; } @@ -442,10 +425,8 @@ public List getInfrastructureNodes() { /** * Returns all InfrastructureNodes of the Template this context belongs to * - * @param forSource whether to look for InfrastructureNodes along the Source relations or Target - * relations - * @return a List of AbstractNodeTemplate which are InfrastructureNodeTemplate of the template this - * context handles + * @param forSource whether to look for InfrastructureNodes along the Source relations or Target relations + * @return a List of AbstractNodeTemplate which are InfrastructureNodeTemplate of the template this context handles */ public List getInfrastructureNodes(final boolean forSource) { final List infrastructureNodes = new ArrayList<>(); @@ -461,8 +442,8 @@ public List getInfrastructureNodes(final boolean forSource /** * Returns the localNames defined inside the input message of the buildPlan this context belongs to * - * @return a List of Strings representing the XML localNames of the elements inside the input - * message of the buildPlan this context belongs to + * @return a List of Strings representing the XML localNames of the elements inside the input message of the + * buildPlan this context belongs to */ public List getInputMessageElementNames() { return this.templateBuildPlan.getBuildPlan().getWsdl().getInputMessageLocalNames(); @@ -489,7 +470,7 @@ public boolean executeOperation(final AbstractRelationshipTemplate relationshipT } final OperationChain chain = - BPELScopeBuilder.createOperationCall(relationshipTemplate, interfaceName, operationName); + scopeBuilder.createOperationCall(relationshipTemplate, interfaceName, operationName); if (chain == null) { return false; } @@ -500,7 +481,7 @@ public boolean executeOperation(final AbstractRelationshipTemplate relationshipT final AbstractRelationshipTemplate relationBackup = this.templateBuildPlan.getRelationshipTemplate(); final AbstractNodeTemplate nodeBackup = this.templateBuildPlan.getNodeTemplate(); - final BPELPlanContext context = new BPELPlanContext((BPELPlan) this.plan, this.templateBuildPlan, + final BPELPlanContext context = new BPELPlanContext(this.scopeBuilder, (BPELPlan) this.plan, this.templateBuildPlan, this.propertyMap, this.serviceTemplate, this.serviceInstanceURLVarName, this.serviceInstanceIDVarName, this.serviceTemplateURLVarName, this.csarFileName); @@ -520,7 +501,7 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S final Map param2propertyMapping, final Map param2propertyOutputMapping, final BPELScopePhaseType phase, Element elementToAppendTo) { - final OperationChain chain = BPELScopeBuilder.createOperationCall(nodeTemplate, interfaceName, operationName); + final OperationChain chain = scopeBuilder.createOperationCall(nodeTemplate, interfaceName, operationName); if (chain == null) { return false; } @@ -538,7 +519,7 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S // create context from this context and set the given nodeTemplate as // the node for the scope - final BPELPlanContext context = new BPELPlanContext((BPELPlan) this.plan, this.templateBuildPlan, + final BPELPlanContext context = new BPELPlanContext(this.scopeBuilder, (BPELPlan) this.plan, this.templateBuildPlan, this.propertyMap, this.serviceTemplate, this.serviceInstanceURLVarName, this.serviceInstanceIDVarName, this.serviceTemplateURLVarName, this.csarFileName); @@ -550,13 +531,11 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S */ if (param2propertyMapping == null) { chain.executeOperationProvisioning(context, opNames); + } else if (param2propertyOutputMapping == null) { + chain.executeOperationProvisioning(context, opNames, param2propertyMapping, elementToAppendTo); } else { - if (param2propertyOutputMapping == null) { - chain.executeOperationProvisioning(context, opNames, param2propertyMapping, elementToAppendTo); - } else { - chain.executeOperationProvisioning(context, opNames, param2propertyMapping, param2propertyOutputMapping, - elementToAppendTo); - } + chain.executeOperationProvisioning(context, opNames, param2propertyMapping, param2propertyOutputMapping, + elementToAppendTo); } // re-set the orginal configuration of the templateBuildPlan @@ -564,7 +543,6 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S this.templateBuildPlan.setRelationshipTemplate(relationBackup); return true; - } public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final String interfaceName, @@ -572,7 +550,7 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S final Map param2propertyMapping, final Map param2propertyOutputMapping) { - final OperationChain chain = BPELScopeBuilder.createOperationCall(nodeTemplate, interfaceName, operationName); + final OperationChain chain = scopeBuilder.createOperationCall(nodeTemplate, interfaceName, operationName); if (chain == null) { return false; } @@ -590,7 +568,7 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S // create context from this context and set the given nodeTemplate as // the node for the scope - final BPELPlanContext context = new BPELPlanContext((BPELPlan) this.plan, this.templateBuildPlan, + final BPELPlanContext context = new BPELPlanContext(this.scopeBuilder, (BPELPlan) this.plan, this.templateBuildPlan, this.propertyMap, this.serviceTemplate, this.serviceInstanceURLVarName, this.serviceInstanceIDVarName, this.serviceTemplateURLVarName, this.csarFileName); @@ -602,13 +580,10 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S */ if (param2propertyMapping == null) { chain.executeOperationProvisioning(context, opNames); + } else if (param2propertyOutputMapping == null) { + chain.executeOperationProvisioning(context, opNames, param2propertyMapping); } else { - if (param2propertyOutputMapping == null) { - chain.executeOperationProvisioning(context, opNames, param2propertyMapping); - } else { - chain.executeOperationProvisioning(context, opNames, param2propertyMapping, - param2propertyOutputMapping); - } + chain.executeOperationProvisioning(context, opNames, param2propertyMapping, param2propertyOutputMapping); } // re-set the orginal configuration of the templateBuildPlan @@ -618,23 +593,6 @@ public boolean executeOperation(final AbstractNodeTemplate nodeTemplate, final S return true; } - /** - * Returns a set of nodes that will be provisioned in the plan of this context - * - * @return - */ - public Collection getNodesInCreation() { - Collection activities = this.templateBuildPlan.getBuildPlan().getActivites(); - Collection result = new HashSet(); - for (AbstractActivity activity : activities) { - if ((activity instanceof NodeTemplateActivity) && (activity.getType().equals(ActivityType.PROVISIONING) - || activity.getType().equals(ActivityType.MIGRATION))) { - result.add(((NodeTemplateActivity) activity).getNodeTemplate()); - } - } - return result; - } - /** * Returns the NodeTemplate of this BPELPlanContext * @@ -662,8 +620,6 @@ public String getPlanResponseMessageName() { return "output"; } - - /** * Returns the ProvPhase Element of the TemplateBuildPlan this context belongs to * @@ -675,15 +631,16 @@ public Element getProvisioningPhaseElement() { /** * Returns the Provisioning Phase Sequence Element of the Compensation scope of this context - * - * @return a Element which is a bpel sequence + * + * @return an Element which is a bpel sequence */ public Element getProvisioningCompensationPhaseElement() { return this.templateBuildPlan.getBpelCompensationHandlerScope().getBpelSequenceProvisioningPhaseElement(); } - + /** * Returns a BPEL sequence element which is used as the main fault handler sequence of this scope + * * @return a DOM Element which is a BPEL sequence activity */ public Element getProvisioningFaultHandlerPhaseElement() { @@ -700,25 +657,26 @@ public AbstractRelationshipTemplate getRelationshipTemplate() { } // All BPEL related methods + /** * Adds a copy element to the main assign element of the buildPlan this context belongs to * * @param inputRequestLocalName the localName inside the input request message - * @param internalVariable an internalVariable of this buildPlan + * @param internalVariable an internalVariable of this buildPlan * @return true iff adding the copy was successful, else false */ public boolean addAssignFromInput2VariableToMainAssign(final String inputRequestLocalName, final Variable internalVariable) { return this.bpelProcessHandler.assignVariableValueFromInput(internalVariable.getVariableName(), - inputRequestLocalName, - this.templateBuildPlan.getBuildPlan()); + inputRequestLocalName, + this.templateBuildPlan.getBuildPlan()); } /** * Adds a correlationSet with the specified property * * @param correlationSetName the name for the correlationSet - * @param propertyName the property to use inside the correlationSet + * @param propertyName the property to use inside the correlationSet * @return true if adding the correlation set was successful, else false */ public boolean addCorrelationSet(final String correlationSetName, final String propertyName) { @@ -728,7 +686,7 @@ public boolean addCorrelationSet(final String correlationSetName, final String p public boolean addGlobalVariable(final String name, final BPELPlan.VariableType variableType, QName declarationId) { declarationId = importNamespace(declarationId); return this.bpelProcessHandler.addVariable(name, variableType, declarationId, - this.templateBuildPlan.getBuildPlan()); + this.templateBuildPlan.getBuildPlan()); } /** @@ -740,16 +698,16 @@ public boolean addGlobalVariable(final String name, final BPELPlan.VariableType public boolean addNamespaceToBPELDoc(final QName qname) { return this.bpelProcessHandler.addNamespaceToBPELDoc(qname.getPrefix(), qname.getNamespaceURI(), - this.templateBuildPlan.getBuildPlan()); + this.templateBuildPlan.getBuildPlan()); } /** * Adds a partnerLink to the TemplateBuildPlan of the Template this context handles * - * @param partnerLinkName the name of the partnerLink - * @param partnerLinkType the name of the partnerLinkType - * @param myRole the name of a role inside the partnerLinkType for the myRole - * @param partnerRole the name of a role inside ther partnerLinkType for the partnerRole + * @param partnerLinkName the name of the partnerLink + * @param partnerLinkType the name of the partnerLinkType + * @param myRole the name of a role inside the partnerLinkType for the myRole + * @param partnerRole the name of a role inside ther partnerLinkType for the partnerRole * @param initializePartnerRole whether the partnerRole should be initialized * @return true if adding the partnerLink was successful, else false */ @@ -763,33 +721,32 @@ public boolean addPartnerLinkToTemplateScope(final String partnerLinkName, final new QName(this.templateBuildPlan.getBuildPlan().getProcessNamespace(), partnerLinkType, "tns"); check &= addPLtoDeploy(partnerLinkName, partnerLinkType); check &= this.bpelTemplateHandler.addPartnerLink(partnerLinkName, partnerType, myRole, partnerRole, - initializePartnerRole, this.templateBuildPlan); + initializePartnerRole, this.templateBuildPlan); return check; } /** - * Adds a partnerlinkType to the BuildPlan, which can be used for partnerLinks in the - * TemplateBuildPlan + * Adds a partnerlinkType to the BuildPlan, which can be used for partnerLinks in the TemplateBuildPlan * * @param partnerLinkTypeName the name of the partnerLinkType - * @param roleName the name of the 1st role - * @param portType the portType of the partnerLinkType + * @param roleName the name of the 1st role + * @param portType the portType of the partnerLinkType * @return true if adding the partnerLinkType was successful, else false */ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String roleName, QName portType) { portType = importNamespace(portType); return this.bpelProcessHandler.addPartnerLinkType(partnerLinkTypeName, roleName, portType, - this.templateBuildPlan.getBuildPlan()); + this.templateBuildPlan.getBuildPlan()); } /** * Adds a partnerLinkType to the BuildPlan which can be used for partnerLinks in TemplateBuildPlans * * @param partnerLinkTypeName the name of the partnerLinkTypes - * @param role1Name the name of the 1st role - * @param portType1 the 1st portType - * @param role2Name the name of the 2nd role - * @param portType2 the 2nd porType + * @param role1Name the name of the 1st role + * @param portType1 the 1st portType + * @param role2Name the name of the 2nd role + * @param portType2 the 2nd porType * @return true if adding the partnerLinkType was successful, else false */ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String role1Name, QName portType1, @@ -797,7 +754,7 @@ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String portType1 = importNamespace(portType1); portType2 = importNamespace(portType2); return this.bpelProcessHandler.addPartnerLinkType(partnerLinkTypeName, role1Name, portType1, role2Name, - portType2, this.templateBuildPlan.getBuildPlan()); + portType2, this.templateBuildPlan.getBuildPlan()); } /** @@ -814,23 +771,20 @@ private boolean addPLtoDeploy(final String partnerLinkName, final String partner // get porttypes inside partnerlinktype final QName portType1 = wsdl.getPortType1FromPartnerLinkType(partnerLinkType); final QName portType2 = wsdl.getPortType2FromPartnerLinkType(partnerLinkType); - final List wsdlFiles = getWSDLFiles(); - for (final File wsdlFile : wsdlFiles) { + final List wsdlFiles = getWSDLFiles(); + for (final Path wsdlFile : wsdlFiles) { try { // TODO: in both if blocks we make huge assumptions with the - // get(0)'s, as a wsdl file can have multiple services with - // given portTypes + // get(0)'s, as a wsdl file can have multiple services with + // given portTypes // if we only have one portType in the partnerLink, we just add // a invoke if (portType1 != null & portType2 == null && containsPortType(portType1, wsdlFile)) { - // List ports = - // this.getPortsInWSDLFileForPortType(portTypeToAdd, - // wsdlFile); final List services = getServicesInWSDLFile(wsdlFile, portType1); final List ports = this.getPortsFromService(services.get(0), portType1); this.buildPlanHandler.addInvokeToDeploy(partnerLinkName, services.get(0).getQName(), - ports.get(0).getName(), buildPlan); + ports.get(0).getName(), buildPlan); } // if two porttypes are used in this partnerlink, the first @@ -842,20 +796,18 @@ && containsPortType(portType1, wsdlFile) & containsPortType(portType2, wsdlFile) final List services = getServicesInWSDLFile(wsdlFile, portType1); final List ports = this.getPortsFromService(services.get(0), portType1); this.buildPlanHandler.addProvideToDeploy(partnerLinkName, services.get(0).getQName(), - ports.get(0).getName(), buildPlan); + ports.get(0).getName(), buildPlan); // portType2 resembles a service to invoke final List outboundServices = getServicesInWSDLFile(wsdlFile, portType2); final List outboundPorts = this.getPortsFromService(outboundServices.get(0), portType2); this.buildPlanHandler.addInvokeToDeploy(partnerLinkName, outboundServices.get(0).getQName(), - outboundPorts.get(0).getName(), buildPlan); + outboundPorts.get(0).getName(), buildPlan); } - } - catch (final WSDLException e) { + } catch (final WSDLException e) { BPELPlanContext.LOG.error("Error while reading WSDL data", e); return false; } - } return true; } @@ -877,16 +829,16 @@ public QName addProperty(final String propertyName, final QName propertyType) { * Adds a Property Alias for the given Property into the BuildPlan WSDL * * @param propertyName the name of the property - * @param messageType the type of the Message to make an Alias for - * @param partName the part name of the Message - * @param query the query to the Element inside the Message + * @param messageType the type of the Message to make an Alias for + * @param partName the part name of the Message + * @param query the query to the Element inside the Message * @return true if adding property alias was successful, else false */ public boolean addPropertyAlias(final String propertyName, final QName messageType, final String partName, final String query) { final QName importedQName = importNamespace(messageType); return this.templateBuildPlan.getBuildPlan().getWsdl().addPropertyAlias(propertyName, partName, importedQName, - query); + query); } /** @@ -895,14 +847,14 @@ public boolean addPropertyAlias(final String propertyName, final QName messageTy * @param portType the portType to check with * @param wsdlFile the WSDL File to check in * @return true if the portType is declared in the given WSDL file - * @throws WSDLException is thrown when either the given File is not a WSDL File or initializing the - * WSDL Factory failed + * @throws WSDLException is thrown when either the given File is not a WSDL File or initializing the WSDL Factory + * failed */ - public boolean containsPortType(final QName portType, final File wsdlFile) throws WSDLException { + public boolean containsPortType(final QName portType, final Path wsdlFile) throws WSDLException { final WSDLFactory factory = WSDLFactory.newInstance(); final WSDLReader reader = factory.newWSDLReader(); reader.setFeature("javax.wsdl.verbose", false); - final Definition wsdlInstance = reader.readWSDL(wsdlFile.getAbsolutePath()); + final Definition wsdlInstance = reader.readWSDL(wsdlFile.toAbsolutePath().toString()); final Map portTypes = wsdlInstance.getAllPortTypes(); for (final Object key : portTypes.keySet()) { final PortType portTypeInWsdl = (PortType) portTypes.get(key); @@ -914,8 +866,6 @@ public boolean containsPortType(final QName portType, final File wsdlFile) throw return false; } - - /** * Creates an element with given namespace and localName for the BuildPlan Document * @@ -927,8 +877,6 @@ public Element createElement(final String namespace, final String localName) { return this.templateBuildPlan.getBpelDocument().createElementNS(namespace, localName); } - - /** * Returns the WSDL Ports of the given WSDL Service * @@ -947,7 +895,7 @@ private List getPortsFromService(final Service service) { /** * Returns the WSDL Ports of the given WSDL Service, that have binding with the given WSDL PortType * - * @param service the WSDL Service + * @param service the WSDL Service * @param portType the PortType which the Bindings of the Ports implement * @return a List of Port which belong to the service and have a Binding with the given PortType */ @@ -969,8 +917,7 @@ private List getPortsFromService(final Service service, final QName portTy * @param portType the portType to use * @param wsdlFile the WSDL File to look in * @return a List of Port which implement the given PortType - * @throws WSDLException is thrown when the given File is not a WSDL File or initializing the WSDL - * Factory failed + * @throws WSDLException is thrown when the given File is not a WSDL File or initializing the WSDL Factory failed */ public List getPortsInWSDLFileForPortType(final QName portType, final File wsdlFile) throws WSDLException { final List wsdlPorts = new ArrayList<>(); @@ -1012,8 +959,6 @@ public Element getPrePhaseElement() { return this.templateBuildPlan.getBpelSequencePrePhaseElement(); } - - /** * Returns the Services inside the given WSDL file which implement the given portType * @@ -1022,13 +967,13 @@ public Element getPrePhaseElement() { * @return a List of Service which implement the given portType * @throws WSDLException is thrown when the WSDLFactory to read the WSDL can't be initialized */ - private List getServicesInWSDLFile(final File wsdlFile, final QName portType) throws WSDLException { + private List getServicesInWSDLFile(final Path wsdlFile, final QName portType) throws WSDLException { final List servicesInWsdl = new ArrayList<>(); final WSDLFactory factory = WSDLFactory.newInstance(); final WSDLReader reader = factory.newWSDLReader(); reader.setFeature("javax.wsdl.verbose", false); - final Definition wsdlInstance = reader.readWSDL(wsdlFile.getAbsolutePath()); + final Definition wsdlInstance = reader.readWSDL(wsdlFile.toAbsolutePath().toString()); final Map services = wsdlInstance.getAllServices(); for (final Object key : services.keySet()) { final Service service = (Service) services.get(key); @@ -1045,12 +990,11 @@ private List getServicesInWSDLFile(final File wsdlFile, final QName por return servicesInWsdl; } - /** * Returns the name of the TemplateBuildPlan this BPELPlanContext belongs to * - * @return a String containing a Name for the TemplateBuildPlan consisting of the Id of the - * NodeTemplate processed in that plan + * @return a String containing a Name for the TemplateBuildPlan consisting of the Id of the NodeTemplate processed + * in that plan */ public String getTemplateBuildPlanName() { return this.templateBuildPlan.getBpelScopeElement().getAttribute("name"); @@ -1061,11 +1005,11 @@ public String getTemplateBuildPlanName() { * * @return a List of File which have the ending ".wsdl" */ - private List getWSDLFiles() { - final List wsdlFiles = new ArrayList<>(); + private List getWSDLFiles() { + final List wsdlFiles = new ArrayList<>(); final BPELPlan buildPlan = this.templateBuildPlan.getBuildPlan(); - for (final File file : buildPlan.getImportedFiles()) { - if (file.getName().endsWith(".wsdl")) { + for (final Path file : buildPlan.getImportedFiles()) { + if (file.getFileName().toString().endsWith(".wsdl")) { wsdlFiles.add(file); } } @@ -1077,9 +1021,8 @@ private List getWSDLFiles() { * * @param qname a QName to import * @return the QName with set prefix - * @deprecated Use - * {@link org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler#importNamespace(org.opentosca.planbuilder.core.bpel.context.BPELPlanContext,QName)} - * instead + * @deprecated Use {@link org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler#importNamespace(org.opentosca.planbuilder.core.bpel.context.BPELPlanContext, + * QName)} instead */ @Deprecated public QName importNamespace(final QName qname) { @@ -1106,62 +1049,60 @@ public QName importQName(final QName qname) { return importNamespace(qname); } - - /** * Registers the given namespace as extension inside the BuildPlan * - * @param namespace the namespace of the extension + * @param namespace the namespace of the extension * @param mustUnderstand the mustUnderstand attribute * @return true if adding was successful, else false */ public boolean registerExtension(final String namespace, final boolean mustUnderstand) { return this.buildPlanHandler.registerExtension(namespace, mustUnderstand, - this.templateBuildPlan.getBuildPlan()); + this.templateBuildPlan.getBuildPlan()); } /** * Registers a portType which is declared inside the given AbstractArtifactReference * * @param portType the portType to register - * @param ref ArtifactReference where the portType is declared + * @param ref ArtifactReference where the portType is declared * @return a QName for the registered PortType with a set prefix */ public QName registerPortType(final QName portType, final AbstractArtifactReference ref) { return this.registerPortType(portType, this.templateBuildPlan.getBuildPlan().getDefinitions() - .getAbsolutePathOfArtifactReference(ref)); + .getAbsolutePathOfArtifactReference(ref).toPath()); } /** * Registers a portType with the associated WSDL File in the BuildPlan * - * @param portType the portType to register + * @param portType the portType to register * @param wsdlDefinitionsFile the WSDL file where the portType is declared * @return a QName for portType with set prefix etc. after registration within the BuildPlan */ - public QName registerPortType(QName portType, final File wsdlDefinitionsFile) { + public QName registerPortType(QName portType, final Path wsdlDefinitionsFile) { portType = importNamespace(portType); boolean check = true; // import wsdl into plan wsdl check &= this.templateBuildPlan.getBuildPlan().getWsdl() - .addImportElement("http://schemas.xmlsoap.org/wsdl/", portType.getNamespaceURI(), - portType.getPrefix(), + .addImportElement("http://schemas.xmlsoap.org/wsdl/", portType.getNamespaceURI(), + portType.getPrefix(), - wsdlDefinitionsFile.getAbsolutePath()); + wsdlDefinitionsFile.toAbsolutePath().toString()); if (!check && this.templateBuildPlan.getBuildPlan().getWsdl() - .isImported(portType, wsdlDefinitionsFile.getAbsolutePath())) { + .isImported(portType, wsdlDefinitionsFile.toAbsolutePath().toString())) { // check if already imported check = true; } // import wsdl into bpel plan check &= - this.buildPlanHandler.addImportToBpel(portType.getNamespaceURI(), wsdlDefinitionsFile.getAbsolutePath(), - "http://schemas.xmlsoap.org/wsdl/", - this.templateBuildPlan.getBuildPlan()); + this.buildPlanHandler.addImportToBpel(portType.getNamespaceURI(), wsdlDefinitionsFile.toAbsolutePath().toString(), + "http://schemas.xmlsoap.org/wsdl/", + this.templateBuildPlan.getBuildPlan()); - if (!check && this.buildPlanHandler.hasImport(portType.getNamespaceURI(), wsdlDefinitionsFile.getAbsolutePath(), - "http://schemas.xmlsoap.org/wsdl/", - this.templateBuildPlan.getBuildPlan())) { + if (!check && this.buildPlanHandler.hasImport(portType.getNamespaceURI(), wsdlDefinitionsFile.toAbsolutePath().toString(), + "http://schemas.xmlsoap.org/wsdl/", + this.templateBuildPlan.getBuildPlan())) { check = true; } @@ -1173,18 +1114,18 @@ public QName registerPortType(QName portType, final File wsdlDefinitionsFile) { /** * Registers XML Schema Types in the given BPEL Plan * - * @param type QName of the XML Schema Type + * @param type QName of the XML Schema Type * @param xmlSchemaFile file where the type is declared in * @return true if registered type successful, else false */ - public boolean registerType(final QName type, final File xmlSchemaFile) { + public boolean registerType(final QName type, final Path xmlSchemaFile) { boolean check = true; // add as imported file to plan check &= this.buildPlanHandler.addImportedFile(xmlSchemaFile, this.templateBuildPlan.getBuildPlan()); // import type inside bpel file - check &= this.buildPlanHandler.addImportToBpel(type.getNamespaceURI(), xmlSchemaFile.getAbsolutePath(), - "http://www.w3.org/2001/XMLSchema", - this.templateBuildPlan.getBuildPlan()); + check &= this.buildPlanHandler.addImportToBpel(type.getNamespaceURI(), xmlSchemaFile.toAbsolutePath().toString(), + "http://www.w3.org/2001/XMLSchema", + this.templateBuildPlan.getBuildPlan()); return check; } } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/fragments/BPELProcessFragments.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/fragments/BPELProcessFragments.java new file mode 100644 index 000000000..ed50bab05 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/fragments/BPELProcessFragments.java @@ -0,0 +1,1093 @@ +package org.opentosca.planbuilder.core.bpel.fragments; + +import java.io.IOException; +import java.io.StringReader; +import java.net.URL; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.common.file.ResourceAccess; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractPolicy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.Text; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de + */ +@Component +public class BPELProcessFragments { + + private final static Logger LOG = LoggerFactory.getLogger(BPELProcessFragments.class); + + private final DocumentBuilderFactory docFactory; + private final DocumentBuilder docBuilder; + + /** + * Constructor + * + * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails + */ + public BPELProcessFragments() throws ParserConfigurationException { + this.docFactory = DocumentBuilderFactory.newInstance(); + this.docFactory.setNamespaceAware(true); + this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } + + public Node transformStringToNode(String xmlString) throws SAXException, IOException { + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(xmlString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String createAssignVarWithLiteral(final String literal, final String varName, + final String intent) throws IOException { + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/assignVarWithLiteral.xml")); + template = template.replaceAll("\\$literal", literal); + template = template.replaceAll("\\$VarName", varName); + template = template.replaceAll("\\$intent", intent); + return template; + } + + public Node createAssignTransformXmltoString(final BPELPlan plan, final String xmlVar, final String stringVar, + final Element elementToAppendBefore, String rootElementName) throws IOException, + SAXException { + final String xpathQuery1 = "ode:dom-to-string(\\$" + xmlVar + "/*[local-name()='" + rootElementName + "'])"; + final String xpathQuery2 = "\\$" + stringVar; + + Node assign = + this.createAssignVarToVarWithXpathQueriesAsNode("transformXMLtoStringVar", xmlVar, null, + stringVar, null, xpathQuery1, xpathQuery2, + "Transforms one xml var to a string var as ODE sets a an xml element as wrapper around complex type when using the rest extension.", + new QName( + "http://www.apache.org/ode/type/extension", + "ode", "ode")); + + return assign; + } + + public Node createAssignVarWithLiteralAsNode(final String literal, final String varName, + final String intent) throws IOException, SAXException { + final String templateString = createAssignVarWithLiteral(literal, varName, intent); + return this.transformStringToNode(templateString); + } + + /** + * Create a BPEL assign that copies the NodeInstanceURL from a NodeInstances Query (See {@link + * #createRESTExtensionGETForNodeInstanceDataAsNode(String, String, String, String)} + * + * @param assignName the name of the assign + * @param stringVarName the name of the xsd:string variable to write the NodeInstanceId into + * @param nodeInstanceResponseVarName the instanceDataAPI response to fetch the NodeInstanceId from + * @return a Node containing a BPEL assign activity + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node createAssign2FetchNodeInstanceIDFromInstanceDataAPIResponseAsNode(final String assignName, + final String stringVarName, + final String nodeInstanceResponseVarName) throws SAXException, + IOException { + final String templateString = + createAssign2FetchNodeInstanceIDFromInstanceDataAPIResponseAsString(assignName, stringVarName, + nodeInstanceResponseVarName); + return this.transformStringToNode(templateString); + } + + public Node createAssignVarToVarWithXpathQueryAsNode(final String assignName, final String fromVarName, + final String toVarName, + final String xpathQuery) throws IOException, SAXException { + final String templateString = + createAssignVarToVarWithXPathQuery(assignName, fromVarName, toVarName, xpathQuery); + return this.transformStringToNode(templateString); + } + + public String createAssignAndPostSituationMonitor(Map> situationPolicies, + Map policy2IdMap, String serviceTemplateInstanceUrlVarName, String anyVarName, String requestVarName) throws IOException { + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPELMonitoringSituation.xml")); + + String situationIdRequestBody = ""; + String copyFromInputToRequestBody = ""; + + /* + * + + + + + + + */ + + for (AbstractNodeTemplate node : situationPolicies.keySet()) { + String nodeTemplateId = node.getId(); + List policies = new ArrayList(situationPolicies.get(node)); + + situationIdRequestBody += "" + nodeTemplateId + ""; + for (int i = 0; i < policies.size(); i++) { + AbstractPolicy policy = policies.get(i); + String inputLocalName = policy2IdMap.get(policy); + + situationIdRequestBody += ""; + copyFromInputToRequestBody += ""; + } + situationIdRequestBody += ""; + } + +// for(int i = 0; i < situationIdInputLocalNames.size() ; i++) { +// String inputLocalName = situationIdInputLocalNames.get(i); +// situationIdRequestBody += ""; +// +// +// copyFromInputToRequestBody += ""; +// } + + template = template.replace("$SituationIds", situationIdRequestBody); + template = template.replace("$situationIdFromInputCopies", copyFromInputToRequestBody); + template = template.replace("$anyVar", anyVarName); + template = template.replace("$requestVar", requestVarName); + template = template.replace("$urlVarName", serviceTemplateInstanceUrlVarName); + + return template; + } + + public Node createAssignAndPostSituationMonitorAsNode(Map> situationPolicies, + Map policy2IdMap, String serviceTemplateInstanceUrlVarName, String anyVarName, String requestVarName) throws SAXException, IOException { + final String templateString = this.createAssignAndPostSituationMonitor(situationPolicies, policy2IdMap, serviceTemplateInstanceUrlVarName, anyVarName, requestVarName); + return this.transformStringToNode(templateString); + } + + public String createAssignVarToVarWithXPathQuery(final String assignName, final String fromVarName, + final String toVarName, + final String xpathQuery) throws IOException { + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/assignVarFromVarWithXpath2Query.xml")); + template = template.replaceAll("\\$assignName", assignName); + template = template.replaceAll("\\$fromVarName", fromVarName); + template = template.replaceAll("\\$toVarName", toVarName); + template = template.replace("$xpath2query", xpathQuery); + return template; + } + + public Node createHTTPPOST(final String urlVarName, final String requestVarName, + final String responseVarName) throws IOException, SAXException { + String template = + ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml")); + template = template.replaceAll("\\$InstanceDataURLVar", urlVarName); + template = template.replaceAll("\\$RequestVarName", requestVarName); + template = template.replaceAll("\\$ResponseVarName", responseVarName); + return this.transformStringToNode(template); + } + + public Node createHTTPPOST(final String urlVarName, final String responseVarName) throws IOException, SAXException { + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml")); + template = template.replaceAll("\\$InstanceDataURLVar", urlVarName); + template = template.replaceAll("\\$ResponseVarName", responseVarName); + return this.transformStringToNode(template); + } + + public String createAssignVarToVarWithXpathQueries(final String assignName, final String fromVarName, + final String part1, final String toVarName, final String part2, + final String xpathQuery1, final String xpathQuery2, + final String intent, final QName extension) throws IOException { + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/assignVarFromVarWithXpath2Queries.xml")); + template = template.replaceAll("\\$assignName", assignName); + template = template.replaceAll("\\$fromVarName", fromVarName); + template = template.replaceAll("\\$toVarName", toVarName); + template = template.replace("$xpath2query1", xpathQuery1); + if (part1 != null) { + template = template.replaceAll("\\$part1", "part=\"" + part1 + "\""); + } else { + template = template.replaceAll("\\$part1", ""); + } + template = template.replace("$xpath2query2", xpathQuery2); + + if (part2 != null) { + template = template.replaceAll("\\$part2", "part=\"" + part2 + "\""); + } else { + template = template.replaceAll("\\$part2", ""); + } + template = template.replaceAll("\\$intent", intent); + + if (extension != null) { + template = + template.replaceAll("\\$extension", + "xmlns:" + extension.getPrefix() + "=\"" + extension.getNamespaceURI() + "\""); + } else { + template = template.replaceAll("\\$extension", ""); + } + return template; + } + + public Node createAssignVarToVarWithXpathQueriesAsNode(final String assignName, final String fromVarName, + final String part1, final String toVarName, + final String part2, final String xpathQuery1, + final String xpathQuery2, final String intent, + final QName extension) throws IOException, SAXException { + final String templateString = + createAssignVarToVarWithXpathQueries(assignName, fromVarName, part1, toVarName, part2, xpathQuery1, + xpathQuery2, intent, extension); + return this.transformStringToNode(templateString); + } + + /** + * Create a BPEL assign that copies the NodeInstanceURL from a NodeInstances Query (See {@link + * #createRESTExtensionGETForNodeInstanceDataAsNode(String, String, String, String)} + * + * @param assignName the name of the assign + * @param stringVarName the name of the xsd:string variable to write the NodeInstanceId into + * @param nodeInstanceResponseVarName the instanceDataAPI response to fetch the NodeInstanceId from + * @return a String containing a BPEL assign activity + * @throws IOException is thrown when reading internal files fails + */ + public String createAssign2FetchNodeInstanceIDFromInstanceDataAPIResponseAsString(final String assignName, + final String stringVarName, + final String nodeInstanceResponseVarName) throws IOException { + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelAssignFromNodeInstanceRequestToStringVar.xml")); + template = template.replace("$assignName", assignName); + template = template.replace("$stringVarName", stringVarName); + template = template.replace("$NodeInstanceResponseVarName", nodeInstanceResponseVarName); + return template; + } + + /** + * Creates a BPEL assign activity that reads the property values from a NodeInstance Property response and sets the + * given variables + * + * @param assignName the name of the assign activity + * @param nodeInstancePropertyResponseVarName the name of the variable holding the property data + * @param propElement2BpelVarNameMap a Map from DOM Elements (representing Node Properties) to BPEL + * variable names + * @return a Node containing a BPEL assign activity + * @throws IOException is thrown when reading internal files fail + * @throws SAXException is thrown when parsing internal files fail + */ + public Node createAssignFromInstancePropertyToBPELVariableAsNode(final String assignName, + final String nodeInstancePropertyResponseVarName, + final Map propElement2BpelVarNameMap) throws IOException, + SAXException { + final String templateString = + createAssignFromInstancePropertyToBPELVariableAsString(assignName, nodeInstancePropertyResponseVarName, + propElement2BpelVarNameMap); + return this.transformStringToNode(templateString); + } + + /** + * Creates a BPEL assign activity that reads the property values from a NodeInstance Property response and sets the + * given variables + * + * @param assignName the name of the assign activity + * @param nodeInstancePropertyResponseVarName the name of the variable holding the property data + * @param propElement2BpelVarNameMap a Map from DOM Elements (representing Node Properties) to BPEL + * variable names + * @return a String containing a BPEL assign activity + * @throws IOException is thrown when reading internal files fail + */ + public String createAssignFromInstancePropertyToBPELVariableAsString(final String assignName, + final String nodeInstancePropertyResponseVarName, + final Map propElement2BpelVarNameMap) throws IOException { + final String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelCopyFromPropertyVarToNodeInstanceProperty.xml")); + + String assignString = + ""; + + // + for (final Element propElement : propElement2BpelVarNameMap.keySet()) { + String copyString = template.replace("$PropertyVarName", propElement2BpelVarNameMap.get(propElement)); + copyString = copyString.replace("$NodeInstancePropertyRequestVarName", nodeInstancePropertyResponseVarName); + copyString = copyString.replace("$NodeInstancePropertyLocalName", propElement.getLocalName()); + copyString = copyString.replace("$NodeInstancePropertyNamespace", propElement.getNamespaceURI()); + assignString += copyString; + } + + assignString += ""; + + BPELProcessFragments.LOG.debug("Generated following assign string:"); + BPELProcessFragments.LOG.debug(assignString); + + return assignString; + } + + public String createAssignSelectFirstRelationInstanceFromResponse(final String referencesResponseVarName, final String resultVarName) throws IOException { + String bpelAssignString = + ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelAssignSelectFromRelationInstancesRequestToStringVar.xml")); + + bpelAssignString = + bpelAssignString.replaceAll("\\$assignName", "assignSelectFirstReference" + System.currentTimeMillis()); + bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", resultVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$NodeInstancesResponseVarName", referencesResponseVarName); + return bpelAssignString; + } + + public Node createAssignSelectFirstRelationInstanceFromResponseAsNode(final String referencesResponseVarName, final String resultVarName) throws SAXException, IOException { + final String templateString = this.createAssignSelectFirstRelationInstanceFromResponse(referencesResponseVarName, resultVarName); + return this.transformStringToNode(templateString); + } + + public String createAssignSelectFirstNodeInstanceAndAssignToStringVar(final String referencesResponseVarName, + final String stringVarName) throws IOException { + // BpelAssignSelectFromNodeInstancesRequestToStringVar.xml + // + String bpelAssignString = + ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelAssignSelectFromNodeInstancesRequestToStringVar.xml")); + + bpelAssignString = + bpelAssignString.replaceAll("\\$assignName", "assignSelectFirstReference" + System.currentTimeMillis()); + bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", stringVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$NodeInstancesResponseVarName", referencesResponseVarName); + return bpelAssignString; + } + + public Node createAssignSelectFirstNodeInstanceAndAssignToStringVarAsNode(final String referencesResponseVarName, + final String stringVarName) throws IOException, + SAXException { + final String templateString = + createAssignSelectFirstNodeInstanceAndAssignToStringVar(referencesResponseVarName, stringVarName); + return this.transformStringToNode(templateString); + } + + public Node createIfTrueThrowsError(final String xpath, final QName faultName) { + final Document doc = this.docBuilder.newDocument(); + + final Element ifElement = doc.createElementNS(BPELPlan.bpelNamespace, "if"); + + final Element conditionElement = doc.createElementNS(BPELPlan.bpelNamespace, "condition"); + + conditionElement.setAttribute("expressionLanguage", BPELPlan.xpath2Namespace); + + final Text textSectionValue = doc.createTextNode(xpath); + conditionElement.appendChild(textSectionValue); + + ifElement.appendChild(conditionElement); + + final Element throwElement = doc.createElementNS(BPELPlan.bpelNamespace, "throw"); + + final String nsPrefix = "ns" + System.currentTimeMillis(); + + throwElement.setAttribute("xmlns:" + nsPrefix, faultName.getNamespaceURI()); + + throwElement.setAttribute("faultName", nsPrefix + ":" + faultName.getLocalPart()); + + ifElement.appendChild(throwElement); + + return ifElement; + } + + public Node createWaitForCondition(String xpathExpr, String durationExpression) throws IOException, SAXException { + String templateString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPELWaitTillTrue.xml")); + + templateString = templateString.replace("$xpath1Expr", xpathExpr); + templateString = templateString.replace("$durationexpression", durationExpression); + + return this.transformStringToNode(templateString); + } + + /** + * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String variable. + * + * @param assignName the name of the BPEL assign + * @param xpath2Query the xPath query + * @param stringVarName the variable to load the queries results into + * @return a DOM Node representing a BPEL assign element + * @throws IOException is thrown when loading internal bpel fragments fails + * @throws SAXException is thrown when parsing internal format into DOM fails + */ + public Node createAssignXpathQueryToStringVarFragmentAsNode(final String assignName, final String xpath2Query, + final String stringVarName) throws IOException, + SAXException { + final String templateString = + createAssignXpathQueryToStringVarFragmentAsString(assignName, xpath2Query, stringVarName); + return this.transformStringToNode(templateString); + } + + /** + * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String variable. + * + * @param assignName the name of the BPEL assign + * @param xpath2Query the csarEntryPoint XPath query + * @param stringVarName the variable to load the queries results into + * @return a String containing a BPEL Assign element + * @throws IOException is thrown when reading the BPEL fragment form the resources fails + */ + public String createAssignXpathQueryToStringVarFragmentAsString(final String assignName, final String xpath2Query, + final String stringVarName) throws IOException { + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/assignStringVarWithXpath2Query.xml")); + template = template.replace("{AssignName}", assignName); + template = template.replace("{xpath2query}", xpath2Query); + template = template.replace("{stringVarName}", stringVarName); + return template; + } + + public Node createBPEL4RESTLightNodeInstancesGETAsNode(final String nodeTemplateId, + final String serviceInstanceIdVarName, + final String responseVarName) throws IOException, + SAXException { + final String templateString = + createBPEL4RESTLightNodeInstancesGETAsString(nodeTemplateId, serviceInstanceIdVarName, responseVarName); + return this.transformStringToNode(templateString); + } + + public String createBPEL4RESTLightNodeInstancesGETAsString(final String nodeTemplateId, + final String serviceInstanceIdVarName, + final String responseVarName) throws IOException { + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightGET_NodeInstances_InstanceDataAPI.xml")); + template = template.replace("$serviceInstanceURLVar", serviceInstanceIdVarName); + template = template.replace("$ResponseVarName", responseVarName); + template = template.replace("$nodeTemplateId", nodeTemplateId); + return template; + } + + public String createBPEL4RESTLightPlanInstanceLOGsPOST(final String urlVarName, + final String stringVarNameWithLogContent, + final String unassignedLogReqMessage) throws IOException { + // BPEL4RESTLightPOST_PlanInstance_Logs.xml + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightPOST_PlanInstance_Logs.xml")); + template = template.replaceAll("\\$urlVarName", urlVarName); + template = template.replaceAll("\\$requestVar", unassignedLogReqMessage); + template = template.replaceAll("\\$contentStringVar", stringVarNameWithLogContent); + return template; + } + + public Node createBPEL4RESTLightPlanInstanceLOGsPOSTAsNode(final String urlVarName, + final String stringVarNameWithLogContent, + final String unassignedLogReqMessage) throws IOException, + SAXException { + final String templateString = + createBPEL4RESTLightPlanInstanceLOGsPOST(urlVarName, stringVarNameWithLogContent, unassignedLogReqMessage); + return this.transformStringToNode(templateString); + } + + public String createBPEL4RESTLightPUTState(final String instanceURLVarName, + final String requestVarName) throws IOException { + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightPUTInstanceState.xml")); + template = template.replace("$urlVarName", instanceURLVarName); + template = template.replace("$requestVar", requestVarName); + return template; + } + + public Node createBPEL4RESTLightPutStateAsNode(final String instanceURLVarName, + final String requestVarName) throws IOException, SAXException { + final String templateString = createBPEL4RESTLightPUTState(instanceURLVarName, requestVarName); + return this.transformStringToNode(templateString); + } + + public Node createBPEL4RESTLightRelationInstancesGETAsNode(final String relationshipTemplateId, + final String serviceInstanceIdVarName, + final String responseVarName) throws IOException, + SAXException { + final String templateString = + createBPEL4RESTLightRelationInstancesGETAsString(relationshipTemplateId, serviceInstanceIdVarName, + responseVarName); + return this.transformStringToNode(templateString); + } + + public String createBPEL4RESTLightRelationInstancesGETAsString(final String relationshipTemplateId, + final String serviceInstanceIdVarName, + final String responseVarName) throws IOException { + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightGET_RelationInstances_InstanceDataAPI.xml")); + template = template.replace("$serviceInstanceURLVar", serviceInstanceIdVarName); + template = template.replace("$ResponseVarName", responseVarName); + template = template.replace("relationshipTemplateId", relationshipTemplateId); + return template; + } + + public Node createBPEL4RESTLightRelationInstancesTargetNodeInstanceQueryGETAsNode(final String serviceInstanceIdVarName, + final String relationshipTemplateId, + final String responseVarName, + final String nodeInstanceIdVarName) throws IOException, + SAXException { + final String templateString = + createBPEL4RESTLightRelationInstancesTargetNodeInstanceQueryGETAsString(serviceInstanceIdVarName, + relationshipTemplateId, + responseVarName, + nodeInstanceIdVarName); + return this.transformStringToNode(templateString); + } + + public String createBPEL4RESTLightRelationInstancesTargetNodeInstanceQueryGETAsString(final String serviceTemplateUrlVarName, + final String relationshipTemplateId, + final String responseVarName, + final String nodeInstanceIdVarName) throws IOException { + // BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml + // + String template = + ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml")); + + // + + template = template.replace("$ServiceTemplateURLVarKeyword", serviceTemplateUrlVarName); + template = template.replace("$relationshipTemplateId", relationshipTemplateId); + template = template.replace("$ResponseVarName", responseVarName); + template = template.replace("$nodeInstanceIdVarName", nodeInstanceIdVarName); + return template; + } + + /** + * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. + * + * @param bpelVarName the variable containing an URL + * @param responseVarName the variable to hold the response + * @return a String containing a BPEL4RESTLight Activity + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node createRESTDeleteOnURLBPELVarAsNode(final String bpelVarName, + final String responseVarName) throws IOException, SAXException { + final String templateString = createRESTDeleteOnURLBPELVarAsString(bpelVarName, responseVarName); + return this.transformStringToNode(templateString); + } + + /** + * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. + * + * @param bpelVarName the variable containing an URL + * @param responseVarName the variable to hold the response + * @return a String containing a BPEL4RESTLight Activity + * @throws IOException is thrown when reading internal files fails + */ + public String createRESTDeleteOnURLBPELVarAsString(final String bpelVarName, + final String responseVarName) throws IOException { + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightDELETE.xml")); + template = template.replace("$urlVarName", bpelVarName); + template = template.replace("$ResponseVarName", responseVarName); + return template; + } + + /** + * Creates a Node containing a BPEL fragment which uses the BPELRESTExtension to fetch the InstanceData from an + * OpenTOSCA Container instanceDataAPI + * + * @param serviceTemplateUrlVar the name of the variable holding an URL to a serviceTemplate + * @param responseVarName the name of the variable holding the response of the request (must be xsd:anyType) + * @param templateId the id of the template the instance belongs to + * @return a Node containing a BPEL Fragment + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node createRESTExtensionGETForNodeInstanceDataAsNode(final String serviceTemplateUrlVar, + final String responseVarName, final String templateId, + final String query) throws SAXException, IOException { + final String templateString = + createRESTExtensionGETForNodeInstanceDataAsString(serviceTemplateUrlVar, responseVarName, templateId, + query); + return this.transformStringToNode(templateString); + } + + /** + * Creates a String containing a BPEL fragment which uses the BPELRESTExtension to fetch the InstanceData from an + * OpenTOSCA Container instanceDataAPI + * + * @param serviceTemplateUrlVar the name of the variable holding an URL to a serviceTemplate + * @param responseVarName the name of the variable holding the response of the request (must be xsd:anyType) + * @param templateId the id of the template the instance belongs to + * @return a String containing a BPEL Fragment + * @throws IOException is thrown when reading internal files fails + */ + public String createRESTExtensionGETForNodeInstanceDataAsString(final String serviceTemplateUrlVar, + final String responseVarName, + final String templateId, + final String query) throws IOException { + // + + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml")); + template = template.replaceAll("\\$InstanceDataURLVar", serviceTemplateUrlVar); + template = template.replaceAll("\\$ResponseVarName", responseVarName); + template = template.replaceAll("\\$templateId", templateId); + + if (query != null) { + template = template.replace("?query", query); + } else { + template = template.replace("?query", ""); + } + + return template; + } + + public Node createRESTExtensionGETForRelationInstanceDataAsNode(final String serviceTemplateUrlVar, + final String responseVarName, + final String templateId, + final String query) throws SAXException, IOException { + final String templateString = + createRESTExtensionGETForRelationInstanceDataAsString(serviceTemplateUrlVar, responseVarName, templateId, + query); + return this.transformStringToNode(templateString); + } + + public String createRESTExtensionGETForRelationInstanceDataAsString(final String serviceTemplateUrlVar, + final String responseVarName, + final String templateId, + final String query) throws IOException { + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightGET_RelationInstance_InstanceDataAPI.xml")); + template = template.replaceAll("\\$InstanceDataURLVar", serviceTemplateUrlVar); + template = template.replaceAll("\\$ResponseVarName", responseVarName); + template = template.replaceAll("\\$templateId", templateId); + + if (query != null) { + template = template.replace("?query", query); + } else { + template = template.replace("?query", ""); + } + + return template; + } + + /** + * Creates a RESTExtension GET to fetch properties of NodeInstance + * + * @param nodeInstanceIDUrl the name of the variable holding the address to the nodeInstance + * @param responseVarName the name of the variable to store the response into + * @return a Node containing a BPEL RESTExtension Activity + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node createRESTExtensionGETForInstancePropertiesAsNode(final String nodeInstanceIDUrl, + final String responseVarName) throws IOException, + SAXException { + final String templateString = + createRESTExtensionGETForInstancePropertiesAsString(nodeInstanceIDUrl, responseVarName); + return this.transformStringToNode(templateString); + } + + /** + * Creates a RESTExtension GET to fetch properties of NodeInstance + * + * @param nodeInstanceIDUrl the name of the variable holding the address to the nodeInstance + * @param responseVarName the name of the variable to store the response into + * @return a String containing a BPEL RESTExtension Activity + * @throws IOException is thrown when reading internal files fails + */ + public String createRESTExtensionGETForInstancePropertiesAsString(final String nodeInstanceIDUrl, + final String responseVarName) throws IOException { + // + String template = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightGET_NodeInstance_Properties.xml")); + template = template.replace("$urlVarName", nodeInstanceIDUrl); + template = template.replace("$ResponseVarName", responseVarName); + + return template; + } + + /** + * Returns an XPath Query which contructs a valid String, to GET a File from the openTOSCA API + * + * @param artifactPath a path inside an ArtifactTemplate + * @return a String containing an XPath query + */ + public String createXPathQueryForURLRemoteFilePath(final String artifactPath) { + BPELProcessFragments.LOG.debug("Generating XPATH Query for ArtifactPath: " + artifactPath); + final String filePath = + "string(concat(substring-before($input.payload//*[local-name()='instanceDataAPIUrl']/text(),'/servicetemplates'),'/content/" + + artifactPath + "'))"; + return filePath; + } + + public String generateServiceInstanceRequestMessageAssign(final String inputMessageElementLocalName, + final String anyElementariableName) throws IOException { + String bpelAssignString = + ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelAssignServiceInstanceCorrelationIdPOSTRequest.xml")); + // + bpelAssignString = bpelAssignString.replaceAll("\\$inputElementLocalName", inputMessageElementLocalName); + bpelAssignString = bpelAssignString.replaceAll("\\$StringVariableName", anyElementariableName); + bpelAssignString = + bpelAssignString.replaceAll("\\$assignName", + "assignServiceInstanceCreateRequest" + System.currentTimeMillis()); + return bpelAssignString; + } + + public Node generateServiceInstanceRequestMessageAssignAsNode(final String inputMessageElementLocalName, + final String anyElementariableName) throws IOException, + SAXException { + final String templateString = + generateServiceInstanceRequestMessageAssign(inputMessageElementLocalName, anyElementariableName); + return this.transformStringToNode(templateString); + } + + /** + * Generates an assign activity that fetches the value of the input message and writes it into a string variable + * + * @param inputMessageElementLocalName the localName of the element inside the input message + * @param stringVariableName the name of the variable to assign the value to + * @return a String containing a BPEL assign activity + * @throws IOException is thrown when reading internal files fail + */ + public String generateAssignFromInputMessageToStringVariable(final String inputMessageElementLocalName, + final String stringVariableName) throws IOException { + String bpelAssignString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelAssignFromInputToStringVar.xml")); + // + bpelAssignString = bpelAssignString.replace("$inputElementLocalName", inputMessageElementLocalName); + bpelAssignString = bpelAssignString.replace("$StringVariableName", stringVariableName); + bpelAssignString = + bpelAssignString.replace("$assignName", "assignFromInputToString" + System.currentTimeMillis()); + return bpelAssignString; + } + + /** + * Generates an assign activity that fetches the value of the input message and writes it into a string variable + * + * @param inputMessageElementLocalName the localName of the element inside the input message + * @param stringVariableName the name of the variable to assign the value to + * @return a Node containing a BPEL assign activity + * @throws IOException is thrown when reading internal files fail + * @throws SAXException is thrown when parsing internal files fail + */ + public Node generateAssignFromInputMessageToStringVariableAsNode(final String inputMessageElementLocalName, + final String stringVariableName) throws IOException, + SAXException { + final String templateString = + generateAssignFromInputMessageToStringVariable(inputMessageElementLocalName, stringVariableName); + return this.transformStringToNode(templateString); + } + + public String generateBPEL4RESTLightGETonURL(final String urlVarName, + final String responseVarName) throws IOException { + String bpelAssignString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightGET_URL_ApplicationXML.xml")); + // + bpelAssignString = bpelAssignString.replace("$ResponseVarName", responseVarName); + bpelAssignString = bpelAssignString.replace("$urlVar", urlVarName); + return bpelAssignString; + } + + public Node generateBPEL4RESTLightGETonURLAsNode(final String urlVarName, + final String reponseVarName) throws IOException, SAXException { + final String templateString = generateBPEL4RESTLightGETonURL(urlVarName, reponseVarName); + return this.transformStringToNode(templateString); + } + + /** + * Generates a BPEL POST at the given InstanceDataAPI with the given ServiceTemplate id to create a Service + * Instance + * + * @param instanceDataAPIUrlVariableName the name of the variable holding the address to the instanceDataAPI + * @param csarId the name of the csar the serviceTemplate belongs to + * @param serviceTemplateId the id of the serviceTemplate + * @param responseVariableName a name of an anyType variable to save the response into + * @return a String containing a BPEL4RESTLight POST extension activity + * @throws IOException is thrown when reading internal files fail + */ + public String generateBPEL4RESTLightServiceInstancePOST(final String instanceDataAPIUrlVariableName, + final String csarId, final QName serviceTemplateId, + final String responseVariableName) throws IOException { + // tags in xml snippet: $InstanceDataURLVar, $CSARName, + // $serviceTemplateId, $ResponseVarName + + String bpel4RestString = + ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml")); + + bpel4RestString = bpel4RestString.replace("$InstanceDataURLVar", instanceDataAPIUrlVariableName); + bpel4RestString = bpel4RestString.replace("$CSARName", csarId); + bpel4RestString = bpel4RestString.replace("$serviceTemplateId", serviceTemplateId.toString()); + bpel4RestString = bpel4RestString.replace("$ResponseVarName", responseVariableName); + + return bpel4RestString; + } + + public Path getOpenTOSCAAPISchemaFile() throws IOException { + final URL url = getClass().getClassLoader().getResource("schemas/opentoscaapischema.xsd"); + ResourceAccess resource = new ResourceAccess(url); + return resource.resolvedPath(); + } + + public QName getOpenToscaApiCorrelationElementQname() { + return new QName("http://opentosca.org/api", "correlationID"); + } + + public QName getOpenToscaApiCreateRelationshipTemplateInstanceRequestElementQname() { + return new QName("http://opentosca.org/api", "CreateRelationshipTemplateInstanceRequest"); + } + + public QName getOpenToscaApiLogMsgReqElementQName() { + return new QName("http://opentosca.org/api", "log"); + } + + /** + * Generates a BPEL POST at the given InstanceDataAPI with the given ServiceTemplate id to create a Service + * Instance + * + * @param instanceDataAPIUrlVariableName the name of the variable holding the address to the instanceDataAPI + * @param responseVariableName a name of an anyType variable to save the response into + * @return a String containing a BPEL4RESTLight POST extension activity + * @throws IOException is thrown when reading internal files fail + */ + public String generateBPEL4RESTLightServiceInstancePOST(final String instanceDataAPIUrlVariableName, + final String requestVariableName, + final String responseVariableName) throws IOException { + // tags in xml snippet: $InstanceDataURLVar, $CSARName, + // $serviceTemplateId, $ResponseVarName + String bpel4RestString = + ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml")); + + bpel4RestString = bpel4RestString.replace("$InstanceDataURLVar", instanceDataAPIUrlVariableName); + bpel4RestString = bpel4RestString.replace("$RequestVarName", requestVariableName); + bpel4RestString = bpel4RestString.replace("$ResponseVarName", responseVariableName); + + return bpel4RestString; + } + + /** + * Generates a BPEL POST at the given InstanceDataAPI with the given ServiceTemplate id to create a Service + * Instance + * + * @param instanceDataAPIUrlVariableName the name of the variable holding the address to the instanceDataAPI + * @param csarId the name of the csar the serviceTemplate belongs to + * @param serviceTemplateId the id of the serviceTemplate + * @param responseVariableName a name of an anyType variable to save the response into + * @return a Node containing a BPEL4RESTLight POST extension activity + * @throws IOException is thrown when reading internal files fail + * @throws SAXException is thrown when parsing internal files fail + */ + public Node generateBPEL4RESTLightServiceInstancePOSTAsNode(final String instanceDataAPIUrlVariableName, + final String csarId, final QName serviceTemplateId, + final String responseVariableName) throws IOException, + SAXException { + final String templateString = + this.generateBPEL4RESTLightServiceInstancePOST(instanceDataAPIUrlVariableName, csarId, serviceTemplateId, + responseVariableName); + return this.transformStringToNode(templateString); + } + + /** + * Generates a BPEL POST at the given InstanceDataAPI with the given ServiceTemplate id to create a Service + * Instance + * + * @param instanceDataAPIUrlVariableName the name of the variable holding the address to the instanceDataAPI + * @param requestVariableName a name of an anyType variable to take the request content from + * @param responseVariableName a name of an anyType variable to save the response into + * @return a Node containing a BPEL4RESTLight POST extension activity + * @throws IOException is thrown when reading internal files fail + * @throws SAXException is thrown when parsing internal files fail + */ + public Node generateBPEL4RESTLightServiceInstancePOSTAsNode(final String instanceDataAPIUrlVariableName, + final String requestVariableName, + final String responseVariableName) throws IOException, + SAXException { + final String templateString = + this.generateBPEL4RESTLightServiceInstancePOST(instanceDataAPIUrlVariableName, requestVariableName, + responseVariableName); + return this.transformStringToNode(templateString); + } + + /** + * Generates a BPEL If activity that throws the given fault when the given expr evaluates to true at runtime + * + * @param xpath1Expr a XPath 1.0 expression as String + * @param faultQName a QName denoting the fault to be thrown when the if evaluates to true + * @return a Node containing a BPEL If Activity + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node generateBPELIfTrueThrowFaultAsNode(final String xpath1Expr, final QName faultQName) throws IOException, + SAXException { + final String templateString = generateBPELIfTrueThrowFaultAsString(xpath1Expr, faultQName); + return this.transformStringToNode(templateString); + } + + /** + * Generates a BPEL If activity that throws the given fault when the given expr evaluates to true at runtime + * + * @param xpath1Expr a XPath 1.0 expression as String + * @param faultQName a QName denoting the fault to be thrown when the if evaluates to true + * @return a String containing a BPEL If Activity + * @throws IOException is thrown when reading internal files fails + */ + public String generateBPELIfTrueThrowFaultAsString(final String xpath1Expr, + final QName faultQName) throws IOException { + // + String bpelIfString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BPELIfTrueThrowFault.xml")); + + bpelIfString = bpelIfString.replace("$xpath1Expr", xpath1Expr); + + bpelIfString = bpelIfString.replace("$faultPrefix", faultQName.getLocalPart()); + bpelIfString = bpelIfString.replace("$faultLocalName", faultQName.getLocalPart()); + + return bpelIfString; + } + + /** + * Generates an Assign Acitivity that writes the content of a Strig variable into the first element specified by + * prefix and localname + * + * @param variableName the name of the string variable to take the value from + * @param outputVarName the name of the output message variable + * @param outputVarPartName the name of the part inside the message variable + * @param outputVarLocalName the localName of the element inside the message part + * @return a DOM Node containing a BPEL Assign Activity + * @throws IOException is thrown when reading internal files fail + * @throws SAXException is thrown when parsing internal files fail + */ + public Node generateCopyFromStringVarToOutputVariableAsNode(final String variableName, final String outputVarName, + final String outputVarPartName, + final String outputVarLocalName) throws IOException, + SAXException { + final String templateString = + generateCopyFromStringVarToOutputVariableAsString(variableName, outputVarName, outputVarPartName, + outputVarLocalName); + return this.transformStringToNode(templateString); + } + + /** + * Generates an Assign Activity that writes the content of a String variable into the first element specified by + * prefix and localname + * + * @param variableName the name of the string variable to take the value from + * @param outputVarName the name of the output message variable + * @param outputVarPartName the name of the part inside the message variable + * @param outputVarLocalName the localname of the element inside the message part + * @return a String containing a BPEL assign activitiy + * @throws IOException is thrown when reading internal files fail + */ + public String generateCopyFromStringVarToOutputVariableAsString(final String variableName, + final String outputVarName, + final String outputVarPartName, + final String outputVarLocalName) throws IOException { + // BpelAssignOutputVarFromStringVariable.xml + // + String bpelAssignString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelCopyOutputVarFromStringVariable.xml")); + bpelAssignString = bpelAssignString.replace("${variableName}", variableName); + bpelAssignString = bpelAssignString.replace("${outputVarName}", outputVarName); + bpelAssignString = bpelAssignString.replace("${outputVarPartName}", outputVarPartName); + bpelAssignString = bpelAssignString.replace("${outputVarLocalName}", outputVarLocalName); + return bpelAssignString; + } + + /** + * Generates a BPEL assign that sets serviceInstanceURL, ID and serviceTemplate URL from the given + * serviceTemplateInstance POST response message + * + * @param serviceInstanceResponseVarName the varariable name of the POST response message + * @param serviceInstanceURLVarName the varariable name to save the serviceTemplateInstance URL + * @param serviceTemplateInstancesURLVar the variable name that holds the serviceTemplateInstances URL + * @param serviceTemplateURLVarName the variable name to save the serviceTemplate URL in + * @return a DOM Node containing a BPEL assign activity + * @throws IOException is thrown when reading internal files fail + * @throws SAXException is thrown when parsing internal files fail + */ + public Node generateServiceInstanceDataVarsAssignForBuildPlansAsNode(final String serviceInstanceResponseVarName, + final String serviceInstanceURLVarName, + final String serviceTemplateInstancesURLVar, + final String serviceInstanceIdVarName, + final String serviceTemplateURLVarName, + final String serviceInstanceCorrelationIdVarName, + final String planName, + final String buildPlanUrlVarName) throws IOException, + SAXException { + final String templateString = + generateServiceInstanceDataVarsAssignForBuildPlansAsString(serviceInstanceResponseVarName, + serviceInstanceURLVarName, + serviceTemplateInstancesURLVar, + serviceInstanceIdVarName, + serviceTemplateURLVarName, + serviceInstanceCorrelationIdVarName, planName, + buildPlanUrlVarName); + return this.transformStringToNode(templateString); + } + + /** + * Generates a BPEL assign that retrieves the URL/ID of a serviceInstance POST response + * + * @param serviceInstanceResponseVarName the var name of the POST response + * @param serviceInstanceURLVarName the var name to save the URL/ID into + * @return a String containing a BPEL assign activity + * @throws IOException is thrown when reading internal files fail + */ + + public String generateServiceInstanceDataVarsAssignForBuildPlansAsString(final String serviceInstanceResponseVarName, + final String serviceInstanceURLVarName, + final String serviceTemplateInstancesURLVar, + final String serviceInstanceIdVarName, + final String serviceTemplateURLVarName, + final String serviceInstanceCorrelationIdVarName, + final String planName, + final String buildPlanUrlVarName) throws IOException { + // + String bpelAssignString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelAssignServiceInstancePOSTResponse.xml")); + bpelAssignString = + bpelAssignString.replaceAll("\\$assignName", "assignServiceInstance" + System.currentTimeMillis()); + bpelAssignString = + bpelAssignString.replaceAll("\\$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$ServiceInstanceURLVarName", serviceInstanceURLVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$ServiceInstanceIDVarName", serviceInstanceIdVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$serviceTemplateURLVarName", serviceTemplateURLVarName); + bpelAssignString = + bpelAssignString.replaceAll("\\$serviceTemplateInstancesURLVar", serviceTemplateInstancesURLVar); + bpelAssignString = + bpelAssignString.replaceAll("\\$ServiceInstanceCorrelationID", serviceInstanceCorrelationIdVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$planName", planName); + bpelAssignString = bpelAssignString.replaceAll("\\$planInstanceURL", buildPlanUrlVarName); + + return bpelAssignString; + } + + public Node generateServiceInstanceDataVarsAssignForManagementPlansAsNode(final String serviceInstanceResponseVarName, + final String serviceInstanceURLVarName, + final String serviceTemplateInstancesURLVar, + final String serviceInstanceIdVarName, + final String serviceTemplateURLVarName, + final String serviceInstanceCorrelationIdVarName, + final String planName, + final String buildPlanUrlVarName) throws IOException, + SAXException { + final String templateString = + generateServiceInstanceDataVarsAssignForManagementPlansAsString(serviceInstanceResponseVarName, + serviceInstanceURLVarName, + serviceTemplateInstancesURLVar, + serviceInstanceIdVarName, + serviceTemplateURLVarName, + serviceInstanceCorrelationIdVarName, + planName, buildPlanUrlVarName); + return this.transformStringToNode(templateString); + } + + public String generateServiceInstanceDataVarsAssignForManagementPlansAsString(final String serviceInstanceResponseVarName, + final String serviceInstanceURLVarName, + final String serviceTemplateInstancesURLVar, + final String serviceInstanceIdVarName, + final String serviceTemplateURLVarName, + final String serviceInstanceCorrelationIdVarName, + final String planName, + final String buildPlanUrlVarName) throws IOException { + // + String bpelAssignString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("core-bpel/BpelAssignServiceInstancePOSTResponse2.xml")); + bpelAssignString = + bpelAssignString.replaceAll("\\$assignName", "assignServiceInstance" + System.currentTimeMillis()); + bpelAssignString = + bpelAssignString.replaceAll("\\$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$ServiceInstanceURLVarName", serviceInstanceURLVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$ServiceInstanceIDVarName", serviceInstanceIdVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$serviceTemplateURLVarName", serviceTemplateURLVarName); + bpelAssignString = + bpelAssignString.replaceAll("\\$serviceTemplateInstancesURLVar", serviceTemplateInstancesURLVar); + bpelAssignString = + bpelAssignString.replaceAll("\\$ServiceInstanceCorrelationID", serviceInstanceCorrelationIdVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$planName", planName); + bpelAssignString = bpelAssignString.replaceAll("\\$planInstanceURL", buildPlanUrlVarName); + + return bpelAssignString; + } +} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELFinalizer.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELFinalizer.java similarity index 89% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELFinalizer.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELFinalizer.java index 8939f9b8b..f856a0332 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELFinalizer.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELFinalizer.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -14,7 +13,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import org.opentosca.planbuilder.model.plan.AbstractPlan.Link; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; import org.slf4j.Logger; @@ -28,15 +26,14 @@ /** *

    - * This class is used to finalize BPEL BuildPlans. For example when BPEL Scopes and their Sequences - * don't have any sub-elements they must be filled with empty elements, otherwise the plan isn't - * valid to the specification and a BPEL Engine won't allow the process to be deployed. + * This class is used to finalize BPEL BuildPlans. For example when BPEL Scopes and their Sequences don't have any + * sub-elements they must be filled with empty elements, otherwise the plan isn't valid to the specification and a BPEL + * Engine won't allow the process to be deployed. *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELFinalizer { @@ -54,8 +51,7 @@ public BPELFinalizer() { this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); this.buildPlanHandler = new BPELPlanHandler(); this.scopeHandler = new BPELScopeHandler(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { BPELFinalizer.LOG.error("Initializing factories and handlers failed", e); } } @@ -80,8 +76,8 @@ private List calcTopologicalOrdering(final List templateBu } /** - * Finalizes the given BuildPlan. Finalizing here means, that possible invalid parts of the plan are - * made vaid against the specification + * Finalizes the given BuildPlan. Finalizing here means, that possible invalid parts of the plan are made vaid + * against the specification * * @param buildPlan the BuildPlan to finalize */ @@ -122,7 +118,6 @@ public void finalize(final BPELPlan buildPlan) { childElement.setPrefix("tns"); literalElement.appendChild(childElement); } - } buildPlan.getBpelMainSequencePropertyAssignElement().appendChild(copy); @@ -132,11 +127,9 @@ public void finalize(final BPELPlan buildPlan) { Node addressingCopy = generateWSAddressingOutputAssign(); addressingCopy = buildPlan.getBpelDocument().importNode(addressingCopy, true); buildPlan.getBpelMainSequenceOutputAssignElement().appendChild(addressingCopy); - } - catch (final SAXException e) { + } catch (final SAXException e) { BPELFinalizer.LOG.error("Generating BPEL Copy element to enable callback with WS-Addressing failed", e); - } - catch (final IOException e) { + } catch (final IOException e) { BPELFinalizer.LOG.error("Generating BPEL Copy element to enable callback with WS-Addressing failed", e); } @@ -159,18 +152,14 @@ public void finalize(final BPELPlan buildPlan) { if (buildPlan.getBpelFaultHandlersElement().getChildNodes().getLength() == 0) { buildPlan.getBpelDocument().removeChild(buildPlan.getBpelFaultHandlersElement()); } else { - this.buildPlanHandler.getMainCatchAllFaultHandlerSequenceElement(buildPlan).appendChild(buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "compensate")); + this.buildPlanHandler.getMainCatchAllFaultHandlerSequenceElement(buildPlan).appendChild(buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, + "compensate")); this.buildPlanHandler.getMainCatchAllFaultHandlerSequenceElement(buildPlan) - .appendChild(buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "rethrow")); + .appendChild(buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, + "rethrow")); } - - - } - private void finalizeBPELScope(final BPELPlan buildPlan, final BPELScope templateBuildPlan) { // check if any phase of this templatebuildplan has no child // elements, if it's empty, add an empty activity @@ -221,7 +210,7 @@ private void finalizeBPELScope(final BPELPlan buildPlan, final BPELScope templat } final Element joinCondition = buildPlan.getBpelDocument().createElementNS("http://docs.oasis-open.org/wsbpel/2.0/process/executable", - "joinCondition"); + "joinCondition"); joinCondition.setTextContent(condition); targets.insertBefore(joinCondition, targets.getFirstChild()); } @@ -256,12 +245,12 @@ private void finalizeBPELScope(final BPELPlan buildPlan, final BPELScope templat } /** - * Generates a BPEL copy element for the output message of a BuildPlan, which sets the callback with - * WS-Addressing Headers + * Generates a BPEL copy element for the output message of a BuildPlan, which sets the callback with WS-Addressing + * Headers * * @return a DOM Node containing a complete BPEL Copy Element * @throws SAXException if parsing the internal String fails - * @throws IOException if parsing the internal String fails + * @throws IOException if parsing the internal String fails */ private Node generateWSAddressingOutputAssign() throws SAXException, IOException { final String copyString = @@ -298,15 +287,15 @@ private boolean hasUnmarkedNode(final Map mar } /** - * Transforms the Scopes inside the Flow Element of the given buildPlan, so that the overall - * provisioning is executed sequentially Info: This method assumes that the given BuildPlan - * contains a single sink inside the flow + * Transforms the Scopes inside the Flow Element of the given buildPlan, so that the overall provisioning is + * executed sequentially Info: This method assumes that the given BuildPlan contains a single sink inside the + * flow * * @param buildPlan the BuildPlan to transform to sequential provisioning */ public void makeSequential(final BPELPlan buildPlan) { BPELFinalizer.LOG.debug("Starting to transform BuildPlan {} to sequential provsioning", - buildPlan.getBpelProcessElement().getAttribute("name")); + buildPlan.getBpelProcessElement().getAttribute("name")); final List templateBuildPlans = buildPlan.getTemplateBuildPlans(); final List sequentialOrder = calcTopologicalOrdering(templateBuildPlans); @@ -342,7 +331,6 @@ public void makeSequential(final BPELPlan buildPlan) { target = source; } } - } private void visitTopologicalOrdering(final BPELScope templateBuildPlan, @@ -372,7 +360,6 @@ private void visitTopologicalOrdering(final BPELScope templateBuildPlan, *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ private class TopologicalSortMarking { diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELPlanHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELPlanHandler.java similarity index 82% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELPlanHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELPlanHandler.java index b63c5f133..f4214c233 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELPlanHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELPlanHandler.java @@ -1,15 +1,14 @@ package org.opentosca.planbuilder.core.bpel.handlers; -import java.io.File; import java.io.IOException; import java.io.StringReader; +import java.nio.file.Path; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import javax.xml.crypto.dom.DOMURIReference; import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -21,20 +20,18 @@ import org.apache.ode.schemas.dd._2007._03.TProcessEvents; import org.apache.ode.schemas.dd._2007._03.TProvide; import org.apache.ode.schemas.dd._2007._03.TService; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; -import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; -import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.plan.AbstractPlan.Link; +import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; +import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan.VariableType; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; import org.opentosca.planbuilder.model.plan.bpel.Deploy; import org.opentosca.planbuilder.model.plan.bpel.GenericWsdlWrapper; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.CDATASection; @@ -47,15 +44,13 @@ /** *

    - * This class is a part of the facade, which is used to work on a BuildPlan. This is class in - * particular is responsible for the handling of various XML related actions on the whole BPEL - * process + * This class is a part of the facade, which is used to work on a BuildPlan. This is class in particular is responsible + * for the handling of various XML related actions on the whole BPEL process *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELPlanHandler { @@ -71,8 +66,7 @@ public class BPELPlanHandler { /** * Default Constructor * - * @throws ParserConfigurationException is thrown when the interal DOM Builders couldn't be - * initialized + * @throws ParserConfigurationException is thrown when the interal DOM Builders couldn't be initialized */ public BPELPlanHandler() throws ParserConfigurationException { this.documentBuilderFactory = DocumentBuilderFactory.newInstance(); @@ -105,17 +99,13 @@ public Node importNode(final BPELPlan plan, final Node node) { public String addGlobalStringVariable(final String varNamePrefix, final BPELPlan plan) { final String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; - String xsdPrefix = null; - boolean addedNamespace = false; - - while (!addedNamespace) { + String xsdPrefix = null; + do { xsdPrefix = "xsd" + System.currentTimeMillis(); - addedNamespace = addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan); - } + } while (!addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan)); String varName = varNamePrefix + System.currentTimeMillis(); - final QName stringXsdDeclQName = new QName(xsdNamespace, "string", xsdPrefix); boolean added = addVariable(varName, BPELPlan.VariableType.TYPE, stringXsdDeclQName, plan); @@ -123,21 +113,20 @@ public String addGlobalStringVariable(final String varNamePrefix, final BPELPlan varName = varNamePrefix + System.currentTimeMillis(); added = addVariable(varName, BPELPlan.VariableType.TYPE, stringXsdDeclQName, plan); } - return varName; } /** - * Adds a BPEL copy element given as String to the last assign of the BuildPlan. Note that the - * string given must be valid + * Adds a BPEL copy element given as String to the last assign of the BuildPlan. Note that the string given must be + * valid * * @param copyElementString a valid string of a BPEL copy element - * @param buildPlan the BuildPlan to add the BPEL copy element to + * @param buildPlan the BuildPlan to add the BPEL copy element to * @return true if adding the string was successful, else false */ public boolean addCopyStringToOutputAssign(final String copyElementString, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add following copy to outputassign of BuildPlan {}", copyElementString, - buildPlan.getBpelProcessElement().getAttribute("name")); + buildPlan.getBpelProcessElement().getAttribute("name")); try { final InputSource is = new InputSource(); is.setCharacterStream(new StringReader(copyElementString)); @@ -150,32 +139,29 @@ public boolean addCopyStringToOutputAssign(final String copyElementString, final final Element outputAssignElement = buildPlan.getBpelMainSequenceOutputAssignElement(); outputAssignElement.insertBefore(copyElement, outputAssignElement.getFirstChild()); } - } - catch (final SAXException e) { + } catch (final SAXException e) { BPELPlanHandler.LOG.error("Failed adding copy to output assign", e); return false; - } - catch (final IOException e) { + } catch (final IOException e) { BPELPlanHandler.LOG.error("Failed adding copy to output assign", e); return false; } BPELPlanHandler.LOG.debug("Adding copy was successful"); return true; - } /** * Adds an Extension Element to the given BuildPlan * - * @param namespace the namespace of the extension + * @param namespace the namespace of the extension * @param mustUnderstand sets if the extensions must be understood or not - * @param buildPlan the BuildPlan to add extension to + * @param buildPlan the BuildPlan to add extension to * @return true if adding the extension was successful, else false */ public boolean addExtension(final String namespace, final boolean mustUnderstand, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add extension {} with mustUnderstand {} to BuildPlan {}", namespace, - String.valueOf(mustUnderstand), - buildPlan.getBpelProcessElement().getAttribute("name")); + String.valueOf(mustUnderstand), + buildPlan.getBpelProcessElement().getAttribute("name")); if (hasExtension(namespace, buildPlan)) { BPELPlanHandler.LOG.warn("Adding extension failed"); return false; @@ -193,28 +179,28 @@ public boolean addExtension(final String namespace, final boolean mustUnderstand /** * Registers and imports a file on a global level into the given BuildPlan * - * @param file the file with absolute location to add on a global level + * @param file the file with absolute location to add on a global level * @param buildPlan the BuildPlan to add the file to * @return true if adding the file was successful, else false */ - public boolean addImportedFile(final File file, final BPELPlan buildPlan) { + public boolean addImportedFile(final Path file, final BPELPlan buildPlan) { return buildPlan.addImportedFile(file); } /** * Adds an ImportElement to the given BuildPlan * - * @param namespace the namespace of the Import - * @param location the location of the document to import + * @param namespace the namespace of the Import + * @param location the location of the document to import * @param importType the type of the import - * @param buildPlan the BuildPlan to add the Import to + * @param buildPlan the BuildPlan to add the Import to * @return true if adding the ImportElement was successful, else false */ public boolean addImports(final String namespace, final String location, final BPELPlan.ImportType importType, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add Import with namespace {}, location {} and importType {} to BuildPlan {}", - namespace, location, importType, - buildPlan.getBpelProcessElement().getAttribute("name")); + namespace, location, importType, + buildPlan.getBpelProcessElement().getAttribute("name")); if (this.hasImport(namespace, location, importType, buildPlan)) { BPELPlanHandler.LOG.warn("Failed adding Import"); @@ -243,17 +229,17 @@ public boolean addImports(final String namespace, final String location, final B /** * Adds an import to the given BuildPlan * - * @param namespace the namespace of the import - * @param location the location attribute of the import + * @param namespace the namespace of the import + * @param location the location attribute of the import * @param importType the importType of the import - * @param buildPlan the BuildPlan to add the import to + * @param buildPlan the BuildPlan to add the import to * @return true if adding the import was successful, else false */ public boolean addImportToBpel(final String namespace, final String location, final String importType, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Adding import with namespace {}, location {} and importType to BuildPlan {}", - namespace, location, importType, - buildPlan.getBpelProcessElement().getAttribute("name")); + namespace, location, importType, + buildPlan.getBpelProcessElement().getAttribute("name")); if (importType.equals(BPELPlan.ImportType.WSDL.toString())) { return addImports(namespace, location, BPELPlan.ImportType.WSDL, buildPlan); } else if (importType.equals(BPELPlan.ImportType.XSD.toString())) { @@ -272,29 +258,29 @@ public boolean addImportToBpel(final String namespace, final String location, fi */ public boolean addIntegerVariable(final String name, final BPELPlan plan) { return addVariable(name, BPELPlan.VariableType.TYPE, - new QName("http://www.w3.org/2001/XMLSchema", "integer", "xsd"), plan); + new QName("http://www.w3.org/2001/XMLSchema", "integer", "xsd"), plan); } /** * Adds an invoke element to the deployment deskriptor of the given BuildPlan * * @param partnerLinkName the name of the partnerLink the invoke will use - * @param serviceName the name of the service that will be invoked - * @param portName the port of the invoke - * @param buildPlan the BuildPlan to add the invoke to + * @param serviceName the name of the service that will be invoked + * @param portName the port of the invoke + * @param buildPlan the BuildPlan to add the invoke to * @return true if adding the invoke to the deployment deskriptor was successful, else false */ public boolean addInvokeToDeploy(final String partnerLinkName, final QName serviceName, final String portName, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Adding invoke with partnerLink {}, service {} and port {} to BuildPlan {}", - partnerLinkName, serviceName.toString(), portName, - buildPlan.getBpelProcessElement().getAttribute("name")); + partnerLinkName, serviceName.toString(), portName, + buildPlan.getBpelProcessElement().getAttribute("name")); for (final TInvoke inv : buildPlan.getDeploymentDeskriptor().getProcess().get(0).getInvoke()) { if (inv.getPartnerLink().equals(partnerLinkName)) { BPELPlanHandler.LOG.warn("Adding invoke for partnerLink {}, serviceName {} and portName {} failed, there is already a partnerLink with the same Name", - partnerLinkName, serviceName.toString(), portName); + partnerLinkName, serviceName.toString(), portName); return false; } } @@ -316,16 +302,16 @@ public boolean addInvokeToDeploy(final String partnerLinkName, final QName servi } /** - * Adds a link with the given name to the given BuildPlan. Note that links can be added to BPEL - * flow's without using it in the elements of the flow. + * Adds a link with the given name to the given BuildPlan. Note that links can be added to BPEL flow's without using + * it in the elements of the flow. * - * @param linkName the name of the link to set + * @param linkName the name of the link to set * @param buildPlan the BuildPlan to add the link * @return true if adding the link was successful, else false */ public boolean addLink(final String linkName, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add link {} to BuildPlan {}", linkName, - buildPlan.getBpelProcessElement().getAttribute("name")); + buildPlan.getBpelProcessElement().getAttribute("name")); if (hasLink(linkName, buildPlan)) { BPELPlanHandler.LOG.warn("Adding link failed"); @@ -344,43 +330,36 @@ public boolean addLink(final String linkName, final BPELPlan buildPlan) { /** * Adds a namespace declaration into the given BuildPlan * - * @param prefix the prefix to use for the namespace + * @param prefix the prefix to use for the namespace * @param namespace the namespace * @param buildPlan the BuildPlan to set the namespace to * @return true if the namespace isn't alread used, else false */ public boolean addNamespaceToBPELDoc(final String prefix, final String namespace, final BPELPlan buildPlan) { - BPELPlanHandler.LOG.debug("Adding namespace {} to BuildPlan {}", namespace, - buildPlan.getBpelProcessElement().getAttribute("name")); + BPELPlanHandler.LOG.debug("Adding namespace {} to BuildPlan {}", namespace, buildPlan.getBpelProcessElement().getAttribute("name")); buildPlan.getBpelProcessElement().setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" + prefix, namespace); - - String test2 = buildPlan.getBpelProcessElement().getAttribute("xmlns:" + prefix); - if (!test2.isEmpty()) { - return true; - } else { - return false; - } + return !test2.isEmpty(); } /** * Adds a Partnerlink to the given BuildPlan * - * @param partnerLinkName the name to use for the PartnerLink - * @param partnerLinkType the type of the PartnerLink (must be already set) - * @param myRole the role of the process inside this partnerLink - * @param partnerRole the role of the called entity inside this partnerLink + * @param partnerLinkName the name to use for the PartnerLink + * @param partnerLinkType the type of the PartnerLink (must be already set) + * @param myRole the role of the process inside this partnerLink + * @param partnerRole the role of the called entity inside this partnerLink * @param initializePartnerRole whether to set initializePartnerRole to 'yes' or 'no' - * @param buildPlan the BuildPlan to add the partnerLink to + * @param buildPlan the BuildPlan to add the partnerLink to * @return true if adding the PartnerLink was successful, else false */ public boolean addPartnerLink(final String partnerLinkName, final QName partnerLinkType, final String myRole, final String partnerRole, final boolean initializePartnerRole, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add partnerLink {} with type {}, myRole {}, partnerRole {} and initializePartnerRole {} to BuildPlan {}", - partnerLinkName, partnerLinkType.toString(), myRole, partnerRole, - String.valueOf(initializePartnerRole), - buildPlan.getBpelProcessElement().getAttribute("name")); + partnerLinkName, partnerLinkType.toString(), myRole, partnerRole, + String.valueOf(initializePartnerRole), + buildPlan.getBpelProcessElement().getAttribute("name")); if (hasPartnerLink(partnerLinkName, buildPlan)) { BPELPlanHandler.LOG.warn("Failed to add partnerLink"); return false; @@ -390,7 +369,7 @@ public boolean addPartnerLink(final String partnerLinkName, final QName partnerL buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, "partnerLink"); partnerLinkElement.setAttribute("name", partnerLinkName); partnerLinkElement.setAttribute("partnerLinkType", - partnerLinkType.getPrefix() + ":" + partnerLinkType.getLocalPart()); + partnerLinkType.getPrefix() + ":" + partnerLinkType.getLocalPart()); partnerLinkElement.setAttribute("myRole", myRole); if (partnerRole != null && !partnerRole.equals("")) { partnerLinkElement.setAttribute("partnerRole", partnerRole); @@ -408,16 +387,16 @@ public boolean addPartnerLink(final String partnerLinkName, final QName partnerL * Adds a partnerLinkType which only has one portType (e.g. syncronous) * * @param partnerLinkTypeName the name for the partnerLinkType - * @param roleName the roleName of the Process - * @param portType the PortType used in the PartnerLink - * @param buildPlan the BuildPlan to add the PartnerLinkType to + * @param roleName the roleName of the Process + * @param portType the PortType used in the PartnerLink + * @param buildPlan the BuildPlan to add the PartnerLinkType to * @return true if adding partnerLink was successful, else false */ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String roleName, final QName portType, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add partnerLinkType {} with roleName {} and portType {} to BuildPlan {}", - partnerLinkTypeName, roleName, portType.toString(), - buildPlan.getBpelProcessElement().getAttribute("name")); + partnerLinkTypeName, roleName, portType.toString(), + buildPlan.getBpelProcessElement().getAttribute("name")); return buildPlan.getWsdl().addPartnerLinkType(partnerLinkTypeName, roleName, portType); } @@ -425,40 +404,40 @@ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String * Adds a partnerLinkType which has to PortType (e.g. asynchronous callback) * * @param partnerLinkTypeName the name for the partnerLinkType - * @param roleName1 the name for the first role - * @param portType1 the portType of the first role - * @param roleName2 the name for the second role - * @param portType2 the portType for second role - * @param buildPlan the BuildPlan to add the partnerLinkType to + * @param roleName1 the name for the first role + * @param portType1 the portType of the first role + * @param roleName2 the name for the second role + * @param portType2 the portType for second role + * @param buildPlan the BuildPlan to add the partnerLinkType to * @return true if adding the partnerLinkType was successful, else false */ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String roleName1, final QName portType1, final String roleName2, final QName portType2, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add partnerLinkType {} with roleName1 {}, portType1 {}, roleName2 {} and portType2 {} to BuildPlan {}", - partnerLinkTypeName, roleName1, portType1.toString(), roleName2, portType2.toString(), - buildPlan.getBpelProcessElement().getAttribute("name")); + partnerLinkTypeName, roleName1, portType1.toString(), roleName2, portType2.toString(), + buildPlan.getBpelProcessElement().getAttribute("name")); return buildPlan.getWsdl().addPartnerLinkType(partnerLinkTypeName, roleName1, portType1, roleName2, portType2); } public boolean addStringVariable(final String name, final BPELPlan plan) { return addVariable(name, BPELPlan.VariableType.TYPE, - new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd"), plan); + new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd"), plan); } /** * Adds a provide element to the deployment deskriptor of the given BuildPlan * * @param partnerLinkName the name of the partnerlink the provide uses - * @param serviceName the service name the provide uses - * @param portName the port name the provide uses - * @param buildPlan the BuildPlan to add the provide to + * @param serviceName the service name the provide uses + * @param portName the port name the provide uses + * @param buildPlan the BuildPlan to add the provide to * @return true if adding the provide to the deployment deskriptor was successful, else false */ public boolean addProvideToDeploy(final String partnerLinkName, final QName serviceName, final String portName, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add provide with partnerLink {}, service {} and port {} to BuildPlan {}", - partnerLinkName, serviceName.toString(), portName, - buildPlan.getBpelProcessElement().getAttribute("name")); + partnerLinkName, serviceName.toString(), portName, + buildPlan.getBpelProcessElement().getAttribute("name")); for (final TProvide inv : buildPlan.getDeploymentDeskriptor().getProcess().get(0).getProvide()) { if (inv.getPartnerLink().equals(partnerLinkName)) { BPELPlanHandler.LOG.warn("Adding provide failed"); @@ -479,50 +458,48 @@ public boolean addProvideToDeploy(final String partnerLinkName, final QName serv buildPlan.getDeploymentDeskriptor().getProcess().get(0).getProvide().add(provide); BPELPlanHandler.LOG.debug("Adding provide was successful"); return true; - } /** * Adds a Element of type string to the RequestMessage of the given BuildPlan * * @param elementName the localName of the element - * @param buildPlan the BuildPlan to add the element to + * @param buildPlan the BuildPlan to add the element to * @return true if adding the element to RequestMessage was successful, else false */ public boolean addStringElementToPlanRequest(final String elementName, final BPELPlan buildPlan) { return buildPlan.getWsdl() - .addElementToRequestMessage(elementName, - new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); + .addElementToRequestMessage(elementName, + new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); } /** * Adds a element of type string to the ResponseMessage of the given BuildPlan * * @param elementName the localName of the element - * @param buildPlan the BuildPlan to add the element to + * @param buildPlan the BuildPlan to add the element to * @return true if adding the element to the ResponseMessage was successful, else false */ public boolean addStringElementToPlanResponse(final String elementName, final BPELPlan buildPlan) { return buildPlan.getWsdl() - .addElementToResponseMessage(elementName, - new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); + .addElementToResponseMessage(elementName, + new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); } /** * Adds the given variable to the process of the given buildplan * - * @param name the name of the variable - * @param variableType the type of the variable, e.g. MessageType - * @param declarationId the QName of the schema declaration, e.g. {ownSchema}Local. Note: Prefix - * must be set. - * @param buildPlan the buildPlan to add the variable to + * @param name the name of the variable + * @param variableType the type of the variable, e.g. MessageType + * @param declarationId the QName of the schema declaration, e.g. {ownSchema}Local. Note: Prefix must be set. + * @param buildPlan the buildPlan to add the variable to * @return true if adding a variable to the plan was successful */ public boolean addVariable(final String name, final BPELPlan.VariableType variableType, final QName declarationId, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add variable {} with type {} and declarationId {} to Plan {}", name, - variableType, declarationId.toString(), - buildPlan.getBpelProcessElement().getAttribute("name")); + variableType, declarationId.toString(), + buildPlan.getBpelProcessElement().getAttribute("name")); if (hasVariable(name, buildPlan)) { BPELPlanHandler.LOG.warn("Adding variable failed, as it is already declared"); return false; @@ -536,7 +513,7 @@ public boolean addVariable(final String name, final BPELPlan.VariableType variab switch (variableType) { case MESSAGE: variableElement.setAttribute("messageType", - declarationId.getPrefix() + ":" + declarationId.getLocalPart()); + declarationId.getPrefix() + ":" + declarationId.getLocalPart()); break; case TYPE: variableElement.setAttribute("type", declarationId.getPrefix() + ":" + declarationId.getLocalPart()); @@ -544,7 +521,7 @@ public boolean addVariable(final String name, final BPELPlan.VariableType variab case ELEMENT: variableElement.setAttribute("element", declarationId.getPrefix() + ":" + declarationId.getLocalPart()); break; - default:; + default: break; } @@ -558,19 +535,18 @@ public boolean addVariable(final String name, final BPELPlan.VariableType variab } /** - * Adds a copy from a String variable to the specified Element inside the output message of the - * given BuildPlan + * Adds a copy from a String variable to the specified Element inside the output message of the given BuildPlan * - * @param variableName the variableName of the given BuildPlan the value should be assigned from + * @param variableName the variableName of the given BuildPlan the value should be assigned from * @param outputElementName the Element LocalName inside the outputMessage of the BuildPlan - * @param buildPlan the BuildPlan to add the copy to + * @param buildPlan the BuildPlan to add the copy to * @return true if adding the copy was successful, else false */ public boolean assginOutputWithVariableValue(final String variableName, final String outputElementName, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add copy from variable {} to element {} of OutputMessage of BuildPlan {}", - variableName, outputElementName, - buildPlan.getBpelProcessElement().getAttribute("name")); + variableName, outputElementName, + buildPlan.getBpelProcessElement().getAttribute("name")); final Element outputAssignElement = buildPlan.getBpelMainSequenceOutputAssignElement(); // create copy elements final Element copyElement = buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, "copy"); @@ -600,18 +576,17 @@ public boolean assginOutputWithVariableValue(final String variableName, final St } /** - * Assigns a String value to a variable inside the assign of the main sequence of the given - * buildplan + * Assigns a String value to a variable inside the assign of the main sequence of the given buildplan * - * @param variableName the variableName of the variable to set + * @param variableName the variableName of the variable to set * @param variableValue the value to set - * @param buildPlan the buildPlan where this has to happen + * @param buildPlan the buildPlan where this has to happen * @return true */ public boolean assignInitValueToVariable(final String variableName, final String variableValue, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Trying to add assign of variable {} with value {} to BuildPlan {}", variableName, - variableValue, buildPlan.getBpelProcessElement().getAttribute("name")); + variableValue, buildPlan.getBpelProcessElement().getAttribute("name")); final Element propertyAssignElement = buildPlan.getBpelMainSequencePropertyAssignElement(); // create copy element final Element copyElement = buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, "copy"); @@ -632,14 +607,13 @@ public boolean assignInitValueToVariable(final String variableName, final String /** *

    - * Assigns a value of a variable from the given input request element inside the main entry assign - * of the given buildPlan. + * Assigns a value of a variable from the given input request element inside the main entry assign of the given + * buildPlan. *

    * - * @param variableName the name of the variable the value should be assigned - * @param inputVariableLocalName the localName of the element inside the input message of the given - * buildPlan - * @param buildPlan the buildPlan to work with + * @param variableName the name of the variable the value should be assigned + * @param inputVariableLocalName the localName of the element inside the input message of the given buildPlan + * @param buildPlan the buildPlan to work with * @return true iff adding the assign was successful */ public boolean assignVariableValueFromInput(final String variableName, final String inputVariableLocalName, @@ -685,17 +659,16 @@ public boolean assignVariableValueFromInput(final String variableName, final Str public BPELPlan createEmptyBPELPlan(final String processNamespace, final String processName, final AbstractPlan abstractPlan, final String inputOperationName) { BPELPlanHandler.LOG.debug("Creating BuildPlan for ServiceTemplate {}", - abstractPlan.getServiceTemplate().getQName().toString()); + abstractPlan.getServiceTemplate().getQName().toString()); final BPELPlan buildPlan = new BPELPlan(abstractPlan.getId(), abstractPlan.getType(), abstractPlan.getDefinitions(), - abstractPlan.getServiceTemplate(), abstractPlan.getActivites(), abstractPlan.getLinks());; + abstractPlan.getServiceTemplate(), abstractPlan.getActivites(), abstractPlan.getLinks()); // init wsdl doc try { buildPlan.setProcessWsdl(new GenericWsdlWrapper(abstractPlan.getType(), inputOperationName)); - } - catch (final IOException e) { + } catch (final IOException e) { BPELPlanHandler.LOG.error("Internal error while initializing WSDL for BuildPlan", e); } @@ -711,16 +684,17 @@ public BPELPlan createEmptyBPELPlan(final String processNamespace, final String // add import for the process wsdl addImports(processNamespace, buildPlan.getWsdl().getFileName(), BPELPlan.ImportType.WSDL, buildPlan); - // add partnerlink to the process. note/FIXME?: the partnerlinktype of - // the process itself is alread initialized with setting the name of the - // process wsdl + // add partnerlink to the process. + // FIXME/NOTE?: the partnerlinktype of + // the process itself is alread initialized with setting the name of the + // process wsdl // // e.g. addPartnerLink("client", new QName(processNamespace, processName, "tns"), processName + "Provider", - processName + "Requester", true, buildPlan); + processName + "Requester", true, buildPlan); // add input and output variables // @@ -738,9 +712,9 @@ public BPELPlan createEmptyBPELPlan(final String processNamespace, final String // messageType="tns:bamoodlebuildplanResponseMessage" /> addVariable("input", BPELPlan.VariableType.MESSAGE, - new QName(processNamespace, processName + "RequestMessage", "tns"), buildPlan); + new QName(processNamespace, processName + "RequestMessage", "tns"), buildPlan); addVariable("output", BPELPlan.VariableType.MESSAGE, - new QName(processNamespace, processName + "ResponseMessage", "tns"), buildPlan); + new QName(processNamespace, processName + "ResponseMessage", "tns"), buildPlan); // set the receive and callback invoke elements // getRelationshipTemplatePlans(final BPELPlan buildPlan) { /** * Returns a TemplateBuildPlan which handles the Template with the given id * - * @param id the id of template inside a TopologyTemplate + * @param id the id of template inside a TopologyTemplate * @param buildPlan the BuildPlan to look in * @return a TemplateBuildPlan if it handles a Template with the given id, else null */ @@ -905,8 +879,8 @@ private boolean hasExtension(final String namespace, final BPELPlan buildPlan) { * Checks whether an ImportElement is already add * * @param namespace the namespace of the import - * @param location the location of the import - * @param type the type of the import + * @param location the location of the import + * @param type the type of the import * @param buildPlan the BuildPlan to check on * @return true if the BuildPlan already has the specified import, else false */ @@ -942,10 +916,10 @@ public boolean hasImport(final String namespace, final String location, final BP /** * Returns if the given import is already imported in the given BuildPlan * - * @param namespace the namespace of the import - * @param location the location of the import + * @param namespace the namespace of the import + * @param location the location of the import * @param importType the importType of the import - * @param buildPlan the BuildPlan to look inside for the import + * @param buildPlan the BuildPlan to look inside for the import * @return true if the import is already present in the given BuildPlan, else false */ public boolean hasImport(final String namespace, final String location, final String importType, @@ -962,7 +936,7 @@ public boolean hasImport(final String namespace, final String location, final St /** * Checks whether the given BuildPlan has a link with the given name * - * @param linkName the name of the link to check with + * @param linkName the name of the link to check with * @param buildPlan the BuildPlan to check for the link * @return true if the BuildPlan has a link with the given name, else false */ @@ -973,7 +947,7 @@ private boolean hasLink(final String linkName, final BPELPlan buildPlan) { /** * Checks whether the given BuildPlan has partnerLink with the given name * - * @param name the name of the partnerLink + * @param name the name of the partnerLink * @param buildPlan the BuildPlan to check in * @return true if the BuildPlan has partnerLink with the given name */ @@ -984,7 +958,7 @@ private boolean hasPartnerLink(final String name, final BPELPlan buildPlan) { /** * Checks whether the given BuildPlan has a variable with the given name * - * @param name the name of the variable + * @param name the name of the variable * @param buildPlan the BuildPlan to check in * @return true if the given BuildPlan has a variable with the given name, else false */ @@ -1006,23 +980,23 @@ public void initializeBPELSkeleton(final BPELPlan plan, final String csarName) { abstract2bpelMap.put(ntActivity, newEmpty3SequenceScopeBPELActivity); final BPELScope newFaultHandlerScope = - this.bpelScopeHandler.createTemplateBuildPlan(ntActivity, plan, "fault"); + this.bpelScopeHandler.createTemplateBuildPlan(ntActivity, plan, "fault"); newEmpty3SequenceScopeBPELActivity.setBpelFaultHandlerScope(newFaultHandlerScope); - + final BPELScope newCompensationHandlerScope = - this.bpelScopeHandler.createTemplateBuildPlan(ntActivity, plan, "compensation"); + this.bpelScopeHandler.createTemplateBuildPlan(ntActivity, plan, "compensation"); newEmpty3SequenceScopeBPELActivity.setBpelCompensationHandlerScope(newCompensationHandlerScope); } else if (activity instanceof RelationshipTemplateActivity) { final RelationshipTemplateActivity rtActivity = (RelationshipTemplateActivity) activity; newEmpty3SequenceScopeBPELActivity = this.bpelScopeHandler.createTemplateBuildPlan(rtActivity, plan, ""); plan.addTemplateBuildPlan(newEmpty3SequenceScopeBPELActivity); abstract2bpelMap.put(rtActivity, newEmpty3SequenceScopeBPELActivity); - + final BPELScope newFaultHandlerScope = - this.bpelScopeHandler.createTemplateBuildPlan(rtActivity, plan, "fault"); + this.bpelScopeHandler.createTemplateBuildPlan(rtActivity, plan, "fault"); newEmpty3SequenceScopeBPELActivity.setBpelFaultHandlerScope(newFaultHandlerScope); - final BPELScope newCompensationHandlerScope = + BPELScope newCompensationHandlerScope = this.bpelScopeHandler.createTemplateBuildPlan(rtActivity, plan, "compensation"); newEmpty3SequenceScopeBPELActivity.setBpelCompensationHandlerScope(newCompensationHandlerScope); } @@ -1045,23 +1019,21 @@ private void initializeConnectionsAsLinkInBPELPlan(final BPELPlan plan) { final String linkName = "connection_" + (source.getNodeTemplate() != null ? source.getNodeTemplate().getId() - : source.getRelationshipTemplate().getId()) + : source.getRelationshipTemplate().getId()) + "_" + (target.getNodeTemplate() != null ? target.getNodeTemplate().getId() - : target.getRelationshipTemplate().getId()); + : target.getRelationshipTemplate().getId()); addLink(linkName, plan); this.bpelScopeHandler.connect(source, target, linkName); - } } - /** - * adds the given BPEL XML to the main fault handler as a catch with the given faultName, if - * faultName is null append it to the main catchAll - * + * adds the given BPEL XML to the main fault handler as a catch with the given faultName, if faultName is null + * append it to the main catchAll + * * @param bpelToAppend bpel xml as DOM Element - * @param faultName a QName for the fault the catch block is working with + * @param faultName a QName for the fault the catch block is working with * @return true iff adding the code was successful */ public boolean appendToMainFaultHandler(Element bpelToAppend, QName faultName, BPELPlan plan) { @@ -1083,12 +1055,10 @@ public boolean appendToMainFaultHandler(Element bpelToAppend, QName faultName, B return true; } - public Element getMainCatchAllFaultHandlerSequenceElement(BPELPlan plan) { return (Element) plan.getBpelFaultHandlersElement().getElementsByTagName("catchAll").item(0).getFirstChild(); } - public boolean assignInitValueToVariable(Variable var, String value, BPELPlan plan) { return assignInitValueToVariable(var.getVariableName(), value, plan); } @@ -1103,30 +1073,28 @@ public void initializeXMLElements(final BPELPlan newBuildPlan) { // initialize processElement and append to document newBuildPlan.setBpelProcessElement(newBuildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "process")); + "process")); newBuildPlan.getBpelProcessElement().setAttribute("suppressJoinFailure", "no"); - + newBuildPlan.getBpelDocument().appendChild(newBuildPlan.getBpelProcessElement()); - // declare xml schema namespace newBuildPlan.getBpelProcessElement().setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xsd", - "http://www.w3.org/2001/XMLSchema"); + "http://www.w3.org/2001/XMLSchema"); // init import files list - newBuildPlan.setImportedFiles(new HashSet()); + newBuildPlan.setImportedFiles(new HashSet()); // initialize and append extensions element to process newBuildPlan.setBpelExtensionsElement(newBuildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "extensions")); + "extensions")); newBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelExtensionsElement()); // init and append imports element newBuildPlan.setBpelImportElements(new ArrayList()); newBuildPlan.setBpelFaultHandlersElement(newBuildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "faultHandlers")); - + "faultHandlers")); newBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelFaultHandlersElement()); @@ -1139,8 +1107,8 @@ public void initializeXMLElements(final BPELPlan newBuildPlan) { newBuildPlan.getBpelFaultHandlersElement().appendChild(catchAll); // TODO this is here to not to forget that the imports elements aren't - // attached, cause there are none and import elements aren't nested in a - // list element + // attached, cause there are none and import elements aren't nested in a + // list element // // this.bpelImportsElement = this.bpelProcessDocument.createElementNS( // BuildPlan.bpelNamespace, "imports"); @@ -1148,56 +1116,56 @@ public void initializeXMLElements(final BPELPlan newBuildPlan) { // init and append partnerlink element newBuildPlan.setBpelPartnerLinksElement(newBuildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "partnerLinks")); + "partnerLinks")); newBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelPartnerLinksElement()); // initialize and append variables element newBuildPlan.setBpelProcessVariablesElement(newBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, "variables")); + .createElementNS(BPELPlan.bpelNamespace, "variables")); newBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelProcessVariablesElement()); // init and append main sequence to process element newBuildPlan.setBpelMainSequenceElement(newBuildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "sequence")); + "sequence")); newBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelMainSequenceElement()); // init and append main sequence receive element to main sequence // element newBuildPlan.setBpelMainSequenceReceiveElement(newBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, "receive")); + .createElementNS(BPELPlan.bpelNamespace, "receive")); newBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequenceReceiveElement()); // init and append main sequence property assign element to main // sequence element newBuildPlan.setBpelMainSequencePropertyAssignElement(newBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "assign")); - newBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequencePropertyAssignElement()); - + .createElementNS(BPELPlan.bpelNamespace, + "assign")); + newBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequencePropertyAssignElement()); + // init and append main sequence flow element to main sequence element newBuildPlan.setBpelMainFlowElement(newBuildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "flow")); - + "flow")); + newBuildPlan.getBpelMainFlowElement().setAttribute("suppressJoinFailure", "no"); - + newBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainFlowElement()); // init and append flow links element newBuildPlan.setBpelMainFlowLinksElement(newBuildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, - "links")); + "links")); newBuildPlan.getBpelMainFlowElement().appendChild(newBuildPlan.getBpelMainFlowLinksElement()); // init and append output assign element newBuildPlan.setBpelMainSequenceOutputAssignElement(newBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "assign")); + .createElementNS(BPELPlan.bpelNamespace, + "assign")); newBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequenceOutputAssignElement()); // init and append main sequence callback invoke element to main // sequence element newBuildPlan.setBpelMainSequenceCallbackInvokeElement(newBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "invoke")); + .createElementNS(BPELPlan.bpelNamespace, + "invoke")); newBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequenceCallbackInvokeElement()); } @@ -1205,7 +1173,7 @@ public void initializeXMLElements(final BPELPlan newBuildPlan) { * Checks whether the variable given by name is initialized at the beginning of the plan * * @param variableName the name of the variable to check for - * @param buildPlan the BuildPlan to check in + * @param buildPlan the BuildPlan to check in * @return true if there is a copy element inside the main assign element of the given BuildPlan */ public boolean isVariableInitialized(final String variableName, final BPELPlan buildPlan) { @@ -1230,9 +1198,9 @@ public boolean isVariableInitialized(final String variableName, final BPELPlan b /** * Registers an extension in the given BuildPlan * - * @param namespace the namespace of the extension + * @param namespace the namespace of the extension * @param mustUnderstand sets if the extension must be understood - * @param buildPlan the BuildPlan to add to the given BuildPlan + * @param buildPlan the BuildPlan to add to the given BuildPlan * @return true if adding the extension was successful, else false */ public boolean registerExtension(final String namespace, final boolean mustUnderstand, final BPELPlan buildPlan) { @@ -1242,7 +1210,7 @@ public boolean registerExtension(final String namespace, final boolean mustUnder /** * Removes a link with given name from the given BuildPlan * - * @param link the name of the link to remove + * @param link the name of the link to remove * @param buildPlan the BuildPlan to remove the link from */ public void removeLink(final String link, final BPELPlan buildPlan) { @@ -1255,24 +1223,22 @@ public void removeLink(final String link, final BPELPlan buildPlan) { if (children.item(i).getAttributes().getNamedItem("name").getTextContent().equals(link)) { toRemove = children.item(i); } - } if (toRemove != null) { buildPlan.getBpelMainFlowLinksElement().removeChild(toRemove); } - } /** * Sets the given element with the given attribute and value * - * @param element the Element to set - * @param attrName the attribute name to set + * @param element the Element to set + * @param attrName the attribute name to set * @param attrValue the value for the attribute */ public void setAttribute(final Element element, final String attrName, final String attrValue) { BPELPlanHandler.LOG.debug("Setting attribute {} with value {} on Element {}", attrName, attrValue, - element.getLocalName()); + element.getLocalName()); // TODO check why this method is here element.setAttribute(attrName, attrValue); } @@ -1281,7 +1247,7 @@ public void setAttribute(final Element element, final String attrName, final Str * Sets the name and namespace of the given buildPlan * * @param namespace the namespace to set - * @param name the name to set + * @param name the name to set * @param buildPlan the buildPlan to change */ public void setId(final String namespace, final String name, final BPELPlan buildPlan) { @@ -1297,12 +1263,12 @@ public void setId(final String namespace, final String name, final BPELPlan buil * Sets ID's on the WSDL of the given BuildPlan * * @param namespace the namespace for the WSDL - * @param name the name for the WSDL + * @param name the name for the WSDL * @param buildPlan the BuildPlan to work on */ public void setWsdlId(final String namespace, final String name, final BPELPlan buildPlan) { BPELPlanHandler.LOG.debug("Setting name {} and namespace {} of WSDL of BuildPlan {}", name, namespace, - buildPlan.getBpelProcessElement().getAttribute("name")); + buildPlan.getBpelProcessElement().getAttribute("name")); final GenericWsdlWrapper wsdl = buildPlan.getWsdl(); wsdl.setId(namespace, name); } @@ -1311,7 +1277,7 @@ public void setWsdlId(final String namespace, final String name, final BPELPlan * Imports the given QName Namespace into the BuildPlan * * @param bpelPlanContext TODO - * @param qname a QName to import + * @param qname a QName to import * @return the QName with set prefix */ public QName importNamespace(final QName qname, final BPELPlan plan) { @@ -1355,7 +1321,6 @@ public QName importNamespace(final QName qname, final BPELPlan plan) { plan.namespaceMap.put(prefix, namespace); addNamespaceToBPELDoc(prefix, namespace, plan); - } else { if (prefix == null || prefix.isEmpty()) { // generate new prefix @@ -1377,5 +1342,4 @@ public String createAnyTypeVar(final BPELPlan plan) { this.addVariable(varName, VariableType.TYPE, new QName(xsdNamespace, "anyType", xsdPrefix), plan); return varName; } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELScopeHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELScopeHandler.java similarity index 79% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELScopeHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELScopeHandler.java index 411fdf16f..0b4d0c7d9 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/BPELScopeHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/BPELScopeHandler.java @@ -9,8 +9,6 @@ import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,14 +19,13 @@ /** *

    - * This class is part of the Facade to handle actions on BuildPlans. This particular class handle - * XML related operations on TemplateBuildPlans + * This class is part of the Facade to handle actions on BuildPlans. This particular class handle XML related operations + * on TemplateBuildPlans *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELScopeHandler { @@ -51,15 +48,15 @@ private static void removeAllChildNodes(final Node node) { * Adds the given correlation to the given TemplateBuildPlan * * @param correlationSetName the name of the correlationSet - * @param propertyName the property the correlationSet works on - * @param templateBuildPlan the TemplateBuildPlan to add the correlationSet to + * @param propertyName the property the correlationSet works on + * @param templateBuildPlan the TemplateBuildPlan to add the correlationSet to * @return true if adding CorrelationSet was successful, else false */ public boolean addCorrelationSet(final String correlationSetName, final String propertyName, final BPELScope templateBuildPlan) { BPELScopeHandler.LOG.debug("Trying to add correlationSet {} with property {} to templateBuildPlan {}", - correlationSetName, propertyName, - templateBuildPlan.getBpelScopeElement().getAttribute("name")); + correlationSetName, propertyName, + templateBuildPlan.getBpelScopeElement().getAttribute("name")); if (this.hasCorrelationSet(correlationSetName, templateBuildPlan)) { BPELScopeHandler.LOG.warn("Failed adding correlationSet"); return false; @@ -77,22 +74,22 @@ public boolean addCorrelationSet(final String correlationSetName, final String p /** * Adds a partnerLink to the given TemplateBuildPlan * - * @param partnerLinkName the name of the partnerLink - * @param partnerLinkType the partnerLinkType which must be already set in the BuildPlan of the - * TemplateBuildPlan - * @param myRole the 1st role of this partnerLink - * @param partnerRole the 2nd role this partnerLink + * @param partnerLinkName the name of the partnerLink + * @param partnerLinkType the partnerLinkType which must be already set in the BuildPlan of the + * TemplateBuildPlan + * @param myRole the 1st role of this partnerLink + * @param partnerRole the 2nd role this partnerLink * @param initializePartnerRole whether to initialize the partnerRole - * @param templateBuildPlan the TemplateBuildPlan to add the partnerLink to + * @param templateBuildPlan the TemplateBuildPlan to add the partnerLink to * @return true if setting partnerLink was successful, else false */ public boolean addPartnerLink(final String partnerLinkName, final QName partnerLinkType, final String myRole, final String partnerRole, final boolean initializePartnerRole, final BPELScope templateBuildPlan) { BPELScopeHandler.LOG.debug("Trying to add partnerLink {} with partnerLinkType {}, myRole {}, partnerRole {} and initializePartnerRole {} on TemplateBuildPlan {}", - partnerLinkName, partnerLinkType.toString(), myRole, partnerRole, - String.valueOf(initializePartnerRole), - templateBuildPlan.getBpelScopeElement().getAttribute("name")); + partnerLinkName, partnerLinkType.toString(), myRole, partnerRole, + String.valueOf(initializePartnerRole), + templateBuildPlan.getBpelScopeElement().getAttribute("name")); if (this.hasPartnerlink(partnerLinkName, templateBuildPlan)) { BPELScopeHandler.LOG.warn("Failed to add partnerLink"); return false; @@ -103,7 +100,7 @@ public boolean addPartnerLink(final String partnerLinkName, final QName partnerL partnerLinkElement.setAttribute("name", partnerLinkName); partnerLinkElement.setAttribute("partnerLinkType", - partnerLinkType.getPrefix() + ":" + partnerLinkType.getLocalPart()); + partnerLinkType.getPrefix() + ":" + partnerLinkType.getLocalPart()); if (myRole != null) { partnerLinkElement.setAttribute("myRole", myRole); } @@ -121,13 +118,13 @@ public boolean addPartnerLink(final String partnerLinkName, final QName partnerL /** * Adds a link as a Source to the given TemplateBuildPlan * - * @param linkName the name of the link to use + * @param linkName the name of the link to use * @param templateBuildPlan the TemplateBuildPlan to add the Link to * @return true if adding the Link was successful, else false */ public boolean addSource(final String linkName, final BPELScope templateBuildPlan) { BPELScopeHandler.LOG.debug("Trying to add link {} as source to TemplateBuildPlan {}", linkName, - templateBuildPlan.getBpelScopeElement().getAttribute("name")); + templateBuildPlan.getBpelScopeElement().getAttribute("name")); if (this.hasSource(linkName, templateBuildPlan)) { BPELScopeHandler.LOG.warn("Failed to add link as source"); return false; @@ -144,13 +141,13 @@ public boolean addSource(final String linkName, final BPELScope templateBuildPla /** * Adds link as a target to the given TemplateBuildPlan * - * @param linkName the name of the link + * @param linkName the name of the link * @param templateBuildPlan the TemplateBuildPlan to add the link to * @return true if adding link was successful, else false */ public boolean addTarget(final String linkName, final BPELScope templateBuildPlan) { BPELScopeHandler.LOG.debug("Trying to add link {} as target to TemplateBuildPlan {}", linkName, - templateBuildPlan.getBpelScopeElement().getAttribute("name")); + templateBuildPlan.getBpelScopeElement().getAttribute("name")); if (this.hasTarget(linkName, templateBuildPlan)) { BPELScopeHandler.LOG.warn("Failed adding link as target"); return false; @@ -167,17 +164,17 @@ public boolean addTarget(final String linkName, final BPELScope templateBuildPla /** * Adds a variable to the given TemplateBuildPlan * - * @param name the name of the variable - * @param variableType the type of the variable - * @param declarationId the QName of the XML complexType of the variable + * @param name the name of the variable + * @param variableType the type of the variable + * @param declarationId the QName of the XML complexType of the variable * @param templateBuildPlan the TemplateBuildPlan to add the variable to * @return true if adding variable was successful, else false */ public boolean addVariable(final String name, final BPELPlan.VariableType variableType, final QName declarationId, final BPELScope templateBuildPlan) { BPELScopeHandler.LOG.debug("Trying to add variable {} with of type {} and XML Schematype {} to TemplateBuildPlan {}", - name, variableType, declarationId.toString(), - templateBuildPlan.getBpelScopeElement().getAttribute("name")); + name, variableType, declarationId.toString(), + templateBuildPlan.getBpelScopeElement().getAttribute("name")); if (this.hasVariable(name, templateBuildPlan)) { BPELScopeHandler.LOG.warn("Failed adding variable"); return false; @@ -192,12 +189,12 @@ public boolean addVariable(final String name, final BPELPlan.VariableType variab switch (variableType) { case MESSAGE: variableElement.setAttribute("messageType", - declarationId.getPrefix() + ":" + declarationId.getLocalPart()); + declarationId.getPrefix() + ":" + declarationId.getLocalPart()); break; case TYPE: variableElement.setAttribute("type", declarationId.getPrefix() + ":" + declarationId.getLocalPart()); break; - default:; + default: break; } @@ -213,15 +210,15 @@ public boolean addVariable(final String name, final BPELPlan.VariableType variab /** * Connects two TemplateBuildPlans (which are basically bpel scopes) with the given link * - * @param source the TemplateBuildPlan which should be a source of the link - * @param target the TemplateBuildPlan which should be a target of the link + * @param source the TemplateBuildPlan which should be a source of the link + * @param target the TemplateBuildPlan which should be a target of the link * @param linkName the name of the link used to connect the two templates * @return true if connections between templates was sucessfully created, else false */ public boolean connect(final BPELScope source, final BPELScope target, final String linkName) { BPELScopeHandler.LOG.debug("Trying to connect TemplateBuildPlan {} as source with TemplateBuildPlan {} as target", - source.getBpelScopeElement().getAttribute("name"), - target.getBpelScopeElement().getAttribute("name")); + source.getBpelScopeElement().getAttribute("name"), + target.getBpelScopeElement().getAttribute("name")); boolean check = true; // if everything was successfully added return true check &= this.addSource(linkName, source); @@ -229,21 +226,17 @@ public boolean connect(final BPELScope source, final BPELScope target, final Str return check; } - - public BPELScope createTemplateBuildPlan(final NodeTemplateActivity nodeTemplateActivity, final BPELPlan buildPlan, String namePrefix) { final BPELScope newTemplateBuildPlan = new BPELScope(nodeTemplateActivity); this.initializeXMLElements(newTemplateBuildPlan, buildPlan); this.setName(this.getNCNameFromString(((namePrefix == null || namePrefix.isEmpty()) ? "" : namePrefix + "_") - + nodeTemplateActivity.getNodeTemplate().getId()) + "_" + nodeTemplateActivity.getType(), - newTemplateBuildPlan); + + nodeTemplateActivity.getNodeTemplate().getId()) + "_" + nodeTemplateActivity.getType(), + newTemplateBuildPlan); newTemplateBuildPlan.setNodeTemplate(nodeTemplateActivity.getNodeTemplate()); return newTemplateBuildPlan; } - - public BPELScope createTemplateBuildPlan(final RelationshipTemplateActivity relationshipTemplateActivity, final BPELPlan buildPlan, String namePrefix) { @@ -256,14 +249,11 @@ public BPELScope createTemplateBuildPlan(final RelationshipTemplateActivity rela return newTemplateBuildPlan; } - - /** * Returns the names of the links declared in the sources element of the given TemplateBuildPlan * * @param template the TemplateBuildPlan to fetch the names from - * @return a List of String representing Links inside the sources element of the given - * TemplateBuildPlan + * @return a List of String representing Links inside the sources element of the given TemplateBuildPlan */ public List getLinksInSources(final BPELScope template) { final List sourcesLinkNames = new ArrayList<>(); @@ -286,8 +276,7 @@ public List getLinksInSources(final BPELScope template) { * Returns the names of the links declared in the targets element of the given TemplateBuildPlan * * @param template the TemplateBuildPlan to fetch the names from - * @return a List of Strings representing Links inside the targets element of the given - * TemplateBuildPlan + * @return a List of Strings representing Links inside the targets element of the given TemplateBuildPlan */ public List getLinksInTarget(final BPELScope template) { final List targetsLinkNames = new ArrayList<>(); @@ -388,21 +377,20 @@ public List getVariableNames(final BPELScope templatePlan) { * Checks whether the given TemplateBuildPlan has the given correlationSet * * @param correlationSetName the name of the correlationSet to check for - * @param templateBuildPlan the TemplateBuildPlan to check on + * @param templateBuildPlan the TemplateBuildPlan to check on * @return true if the correlationSet is declared in the TemplateBuildPlan */ private boolean hasCorrelationSet(final String correlationSetName, final BPELScope templateBuildPlan) { return ModelUtils.hasChildElementWithAttribute(templateBuildPlan.getBpelCorrelationSets(), "name", - correlationSetName); + correlationSetName); } /** * Checks whether the given partnerLinkName is already used in the given TemplateBuildPlan * - * @param name the name of the partnerLink to check with + * @param name the name of the partnerLink to check with * @param templateBuildPlan the TemplateBuildPlan to check on - * @return true if the given TemplateBuildPlan already has a partnerLink with the given name, else - * false + * @return true if the given TemplateBuildPlan already has a partnerLink with the given name, else false */ private boolean hasPartnerlink(final String name, final BPELScope templateBuildPlan) { return ModelUtils.hasChildElementWithAttribute(templateBuildPlan.getBpelPartnerLinksElement(), "name", name); @@ -411,7 +399,7 @@ private boolean hasPartnerlink(final String name, final BPELScope templateBuildP /** * Checks whether the given link is a source in the given TemplateBuildPlan * - * @param name the name of the link to check with + * @param name the name of the link to check with * @param templateBuildPlan the TemplateBuildPlan to check on * @return true if the given link is declared as source in the given TemplateBuildPlan */ @@ -422,7 +410,7 @@ public boolean hasSource(final String name, final BPELScope templateBuildPlan) { /** * Checks whether the given link is a target in the given TemplateBuildPlan * - * @param name the name of the link to check with + * @param name the name of the link to check with * @param templateBuildPlan the TemplateBuildPlan to check on * @return true if the given link is declared as target in the given TemplateBuildPlan */ @@ -433,7 +421,7 @@ public boolean hasTarget(final String name, final BPELScope templateBuildPlan) { /** * Checks whether the given variableName is already used in the given TemplateBuildPlan * - * @param name the name of the variable to check + * @param name the name of the variable to check * @param templateBuildPlan the TemplateBuildPlan to check on * @return true if the variableName is already used, else false */ @@ -445,7 +433,7 @@ private boolean hasVariable(final String name, final BPELScope templateBuildPlan * Initializes XML Elements of the given TemplateBuildPlan and connects it to the given BuildPlan * * @param newTemplateBuildPlan the TemplateBuildPlan to initialize - * @param buildPlan the BuildPlan to connect to TemplateBuildPlan to + * @param buildPlan the BuildPlan to connect to TemplateBuildPlan to */ public void initializeXMLElements(final BPELScope newTemplateBuildPlan, final BPELPlan buildPlan) { // set the build plan of the new template buildplan @@ -453,75 +441,74 @@ public void initializeXMLElements(final BPELScope newTemplateBuildPlan, final BP // initialize bpelScopeElement and append to flow newTemplateBuildPlan.setBpelScopeElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, "scope")); + .createElementNS(BPELPlan.bpelNamespace, "scope")); // info: append to flow element of the buildplan newTemplateBuildPlan.getBuildPlan().getBpelMainFlowElement() - .appendChild(newTemplateBuildPlan.getBpelScopeElement()); + .appendChild(newTemplateBuildPlan.getBpelScopeElement()); // initialize bpelTargetsElement and append to scope newTemplateBuildPlan.setBpelTargetsElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "targets")); + .createElementNS(BPELPlan.bpelNamespace, + "targets")); newTemplateBuildPlan.getBpelScopeElement().appendChild(newTemplateBuildPlan.getBpelTargetsElement()); // initialize bpelSourcesElement and append to scope newTemplateBuildPlan.setBpelSourcesElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "sources")); + .createElementNS(BPELPlan.bpelNamespace, + "sources")); newTemplateBuildPlan.getBpelScopeElement().appendChild(newTemplateBuildPlan.getBpelSourcesElement()); // init bpelPartnerLinksElement append to scope newTemplateBuildPlan.setBpelPartnerLinks(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "partnerLinks")); + .createElementNS(BPELPlan.bpelNamespace, + "partnerLinks")); newTemplateBuildPlan.getBpelScopeElement().appendChild(newTemplateBuildPlan.getBpelPartnerLinksElement()); // init bpelVariablesElement and append to scope newTemplateBuildPlan.setBpelVariablesElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "variables")); + .createElementNS(BPELPlan.bpelNamespace, + "variables")); newTemplateBuildPlan.getBpelScopeElement().appendChild(newTemplateBuildPlan.getBpelVariablesElement()); // init bpelCorrelationSetsElement and append to scope newTemplateBuildPlan.setBpelCorrelationSets(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "correlationSets")); + .createElementNS(BPELPlan.bpelNamespace, + "correlationSets")); newTemplateBuildPlan.getBpelScopeElement().appendChild(newTemplateBuildPlan.getBpelCorrelationSets()); // initialize bpelMainSequenceElement and append to scope newTemplateBuildPlan.setBpelMainSequenceElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "sequence")); + .createElementNS(BPELPlan.bpelNamespace, + "sequence")); newTemplateBuildPlan.getBpelScopeElement().appendChild(newTemplateBuildPlan.getBpelMainSequenceElement()); // initialize bpelSequencePrePhaseElement and append to mainsequence newTemplateBuildPlan.setBpelSequencePrePhaseElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "sequence")); + .createElementNS(BPELPlan.bpelNamespace, + "sequence")); newTemplateBuildPlan.getBpelMainSequenceElement() - .appendChild(newTemplateBuildPlan.getBpelSequencePrePhaseElement()); + .appendChild(newTemplateBuildPlan.getBpelSequencePrePhaseElement()); // initialize bpelSequenceProvisioningPhaseElement and append to // mainsequence newTemplateBuildPlan.setBpelSequenceProvisioningPhaseElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "sequence")); + .createElementNS(BPELPlan.bpelNamespace, + "sequence")); newTemplateBuildPlan.getBpelMainSequenceElement() - .appendChild(newTemplateBuildPlan.getBpelSequenceProvisioningPhaseElement()); + .appendChild(newTemplateBuildPlan.getBpelSequenceProvisioningPhaseElement()); // initialize bpelSequencePostPhaseElement and append to scope newTemplateBuildPlan.setBpelSequencePostPhaseElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "sequence")); + .createElementNS(BPELPlan.bpelNamespace, + "sequence")); newTemplateBuildPlan.getBpelMainSequenceElement() - .appendChild(newTemplateBuildPlan.getBpelSequencePostPhaseElement()); + .appendChild(newTemplateBuildPlan.getBpelSequencePostPhaseElement()); newTemplateBuildPlan.setBpelEventHandlersElement(newTemplateBuildPlan.getBpelDocument() - .createElementNS(BPELPlan.bpelNamespace, - "eventHandlers")); + .createElementNS(BPELPlan.bpelNamespace, + "eventHandlers")); newTemplateBuildPlan.getBpelScopeElement().appendChild(newTemplateBuildPlan.getBpelEventHandlersElement()); - } /** @@ -545,8 +532,8 @@ public boolean isRelationshipTemplatePlan(final BPELScope template) { } /** - * Removes all connections the given TemplateBuildPlan contains. All source/target relations are - * removed from the given TemplateBuildPlan + * Removes all connections the given TemplateBuildPlan contains. All source/target relations are removed from the + * given TemplateBuildPlan * * @param template the TemplateBuildPlan to remove its relations */ @@ -583,7 +570,7 @@ public void removeTargets(final BPELScope template) { /** * Sets the name of the TemplateBuildPlan * - * @param name the name to set + * @param name the name to set * @param templateBuildPlan the TemplateBuildPlan to set the name for */ public void setName(final String name, final BPELScope templateBuildPlan) { diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/CorrelationIDInitializer.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/CorrelationIDInitializer.java similarity index 93% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/CorrelationIDInitializer.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/CorrelationIDInitializer.java index a50a6c20c..12d3e27ee 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/handlers/CorrelationIDInitializer.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/handlers/CorrelationIDInitializer.java @@ -26,8 +26,7 @@ public CorrelationIDInitializer() { this.docFactory = DocumentBuilderFactory.newInstance(); this.docFactory.setNamespaceAware(true); this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { e.printStackTrace(); } } @@ -47,12 +46,10 @@ public void addCorrellationID(final BPELPlan buildPlan) { final Node mainSequenceNode = flowElement.getParentNode(); mainSequenceNode.insertBefore(assignNode, flowElement); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/AbstractServiceInstanceHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/AbstractServiceInstanceHandler.java similarity index 90% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/AbstractServiceInstanceHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/AbstractServiceInstanceHandler.java index bae9c77e3..7bc01611a 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/AbstractServiceInstanceHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/AbstractServiceInstanceHandler.java @@ -54,7 +54,6 @@ public String getLowestId(Collection ids, String keyword) { return lowestId; } - public Collection findServiceInstanceVarNames(final BPELPlanHandler bpelplanHandler, final BPELPlan plan, String keyword) { Collection serviceInstanceVariableNames = new HashSet(); @@ -102,12 +101,12 @@ public String addServiceTemplateURLVariable(BPELPlan plan) { public String addServiceInstanceIDVariable(BPELPlan plan) { return this.bpelProcessHandler.addGlobalStringVariable(ServiceInstanceIDVarKeyword + System.currentTimeMillis(), - plan); + plan); } public String addPlanInstanceURLVariable(BPELPlan plan) { return this.bpelProcessHandler.addGlobalStringVariable(PlanInstanceURLVarKeyword + System.currentTimeMillis(), - plan); + plan); } public String addServiceInstanceURLVariable(BPELPlan plan) { @@ -133,18 +132,15 @@ public void addAssignServiceInstanceIdVarFromServiceInstanceURLVar(final BPELPla try { Node assignFragment = this.fragments.createAssignVarToVarWithXpathQueryAsNode("assignServiceInstanceIDFromServiceInstanceURl" - + System.currentTimeMillis(), serviceInstanceURLVarName, serviceInstanceIDVarName, - "tokenize(//*,'/')[last()]"); + + System.currentTimeMillis(), serviceInstanceURLVarName, serviceInstanceIDVarName, + "tokenize(//*,'/')[last()]"); assignFragment = plan.getBpelDocument().importNode(assignFragment, true); appendToInitSequence(assignFragment, plan); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } - } /** @@ -165,14 +161,14 @@ protected boolean appendToInitSequence(final Node node, final BPELPlan buildPlan } /** - * Adds an element with the given varName to the input message of the given plan and adds logic - * assign the input value to an internal variable with the given varName. + * Adds an element with the given varName to the input message of the given plan and adds logic assign the input + * value to an internal variable with the given varName. * - * @param plan a plan to add the logic to - * @param inputLocalName a name to use inside the input message and as name for the global string - * variable where the value will be added to. - * @return a String containing the generated Variable Name of the Variable holding the value from - * the input at runtime + * @param plan a plan to add the logic to + * @param inputLocalName a name to use inside the input message and as name for the global string variable where the + * value will be added to. + * @return a String containing the generated Variable Name of the Variable holding the value from the input at + * runtime */ protected String appendAssignFromInputToVariable(final BPELPlan plan, final String inputLocalName, String variableName) { @@ -187,12 +183,10 @@ protected String appendAssignFromInputToVariable(final BPELPlan plan, final Stri assignNode = plan.getBpelDocument().importNode(assignNode, true); appendToInitSequence(assignNode, plan); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); return null; - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); return null; } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/EmptyPropertyToInputHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/EmptyPropertyToInputHandler.java similarity index 83% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/EmptyPropertyToInputHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/EmptyPropertyToInputHandler.java index 5c39e9ba8..55732d209 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/EmptyPropertyToInputHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/EmptyPropertyToInputHandler.java @@ -1,21 +1,20 @@ package org.opentosca.planbuilder.core.bpel.tosca.handlers; import java.io.IOException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import javax.xml.parsers.ParserConfigurationException; +import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.xml.sax.SAXException; @@ -25,22 +24,26 @@ *
    * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class EmptyPropertyToInputHandler { + private final BPELScopeBuilder scopeBuilder; + + public EmptyPropertyToInputHandler(BPELScopeBuilder scopeBuilder) { + this.scopeBuilder = scopeBuilder; + } + /** - * Adds an element to the plan input with the given namen and assign at runtime the value to the - * given variable + * Adds an element to the plan input with the given namen and assign at runtime the value to the given variable * - * @param buildPlan the plan to add the logic to + * @param buildPlan the plan to add the logic to * @param propLocalName the name of the element added to the input - * @param var the variable to assign the value to - * @param context a context for the manipulation + * @param var the variable to assign the value to + * @param context a context for the manipulation */ private void addToPlanInput(final BPELPlan buildPlan, final String propLocalName, final Variable var, final BPELPlanContext context) { - + // add to input context.addStringValueToPlanRequest(propLocalName); @@ -48,12 +51,11 @@ private void addToPlanInput(final BPELPlan buildPlan, final String propLocalName // variable final String bpelCopy = generateCopyFromInputToVariableAsString(createLocalNameXpathQuery(propLocalName), - createBPELVariableXpathQuery(var.getVariableName())); + createBPELVariableXpathQuery(var.getVariableName())); try { final Node bpelCopyNode = ModelUtils.string2dom(bpelCopy); appendToInitSequence(bpelCopyNode, buildPlan); - } - catch (ParserConfigurationException | SAXException | IOException e) { + } catch (ParserConfigurationException | SAXException | IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -88,7 +90,7 @@ private String createLocalNameXpathQuery(final String localName) { /** * Generates a bpel copy element that queries from the plan input message to some xpath query * - * @param inputQuery the query to a local element inside the input message + * @param inputQuery the query to a local element inside the input message * @param variableQuery the query to set the value for * @return a String containing a bpel copy */ @@ -112,8 +114,8 @@ public void initializeEmptyPropertiesAsInputParam(final BPELPlan buildPlan, fina String serviceTemplateUrl, AbstractServiceTemplate serviceTemplate, String csarName) { this.initializeEmptyPropertiesAsInputParam(buildPlan.getTemplateBuildPlans(), buildPlan, propMap, - serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, - serviceTemplate, csarName); + serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, + serviceTemplate, csarName); } public void initializeEmptyPropertiesAsInputParam(final Collection bpelActivities, final BPELPlan plan, @@ -124,10 +126,9 @@ public void initializeEmptyPropertiesAsInputParam(final Collection bp if (templatePlan.getNodeTemplate() != null) { final AbstractNodeTemplate nodeTemplate = templatePlan.getNodeTemplate(); - final BPELPlanContext context = new BPELPlanContext(plan,templatePlan, propMap, plan.getServiceTemplate(), + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, plan, templatePlan, propMap, plan.getServiceTemplate(), serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); - if (propMap.getNodePropertyVariables(serviceTemplate, nodeTemplate).isEmpty()) { // nodeTemplate doesn't have props defined continue; @@ -144,7 +145,5 @@ public void initializeEmptyPropertiesAsInputParam(final Collection bp } } } - } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeInstanceSelector.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeInstanceSelector.java similarity index 79% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeInstanceSelector.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeInstanceSelector.java index 1ccabfe32..e97de6eda 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeInstanceSelector.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeInstanceSelector.java @@ -12,13 +12,13 @@ import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan.VariableType; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -29,7 +29,6 @@ *
    * * @author Kálmán Képes - kepeskn@iaas.uni-stuttgart.de - * */ public class NodeInstanceSelector { @@ -42,8 +41,7 @@ public NodeInstanceSelector() { this.bpelFragments = new BPELProcessFragments(); this.bpelProcessHandler = new BPELPlanHandler(); this.serviceInstanceInitializer = new SimplePlanBuilderServiceInstanceHandler(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -76,16 +74,14 @@ public void selectNodeInstances(final Map nodes, final BPELPlan plan, final Property2VariableMapping propMap, AbstractServiceTemplate serviceTemplate) { @@ -178,8 +167,7 @@ public void addNodeInstanceUpdate(final Set nodes, final B try { nodeInstanceIDVarName = new NodeRelationInstanceVariablesHandler( this.bpelProcessHandler).findInstanceUrlVarName(plan, serviceTemplate, nodeTemplate.getId(), true); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -189,7 +177,7 @@ public void addNodeInstanceUpdate(final Set nodes, final B } this.addNodeInstanceUpdate(nodeTemplate, plan, propMap, nodeInstanceIDVarName, - instanceDataAPIResponseVarName, serviceTemplate); + instanceDataAPIResponseVarName, serviceTemplate); } } @@ -201,7 +189,7 @@ private String createRESTResponseVar(final BPELPlan plan) { // create Response Variable for interaction final String instanceDataAPIResponseVarName = "instanceDataAPIResponseVariable" + System.currentTimeMillis(); this.bpelProcessHandler.addVariable(instanceDataAPIResponseVarName, VariableType.TYPE, - new QName(xsdNamespace, "anyType", xsdPrefix), plan); + new QName(xsdNamespace, "anyType", xsdPrefix), plan); return instanceDataAPIResponseVarName; } @@ -219,15 +207,13 @@ public void addNodeInstanceUpdate(final AbstractNodeTemplate nodeTemplate, final try { Node nodeInstancePropertiesGETNode = this.bpelFragments.createRESTExtensionGETForInstancePropertiesAsNode(nodeInstanceIDVarName, - instanceDataAPIResponseVarName); + instanceDataAPIResponseVarName); nodeInstancePropertiesGETNode = plan.getBpelDocument().importNode(nodeInstancePropertiesGETNode, true); plan.getBpelMainSequenceElement().appendChild(nodeInstancePropertiesGETNode); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } @@ -245,7 +231,6 @@ public void addNodeInstanceUpdate(final AbstractNodeTemplate nodeTemplate, final element2BpelVarNameMap.put(childElement, var.getVariableName()); } } - } } @@ -255,14 +240,10 @@ public void addNodeInstanceUpdate(final AbstractNodeTemplate nodeTemplate, final + System.currentTimeMillis(), instanceDataAPIResponseVarName, element2BpelVarNameMap); assignPropertiesToVariables = plan.getBpelDocument().importNode(assignPropertiesToVariables, true); plan.getBpelMainSequenceElement().appendChild(assignPropertiesToVariables); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } - } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeRelationInstanceVariablesHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeRelationInstanceVariablesHandler.java similarity index 81% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeRelationInstanceVariablesHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeRelationInstanceVariablesHandler.java index c772b106a..8ea585a3a 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeRelationInstanceVariablesHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/NodeRelationInstanceVariablesHandler.java @@ -13,6 +13,10 @@ import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; import org.opentosca.planbuilder.core.bpel.handlers.BPELScopeHandler; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan.VariableType; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; @@ -20,10 +24,6 @@ import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -32,7 +32,6 @@ /** * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class NodeRelationInstanceVariablesHandler { @@ -72,7 +71,6 @@ public boolean addIfNullAbortCheck(final BPELPlan plan, final Property2VariableM public boolean addIfNullAbortCheck(final BPELScope templatePlan, final Property2VariableMapping propMap, AbstractServiceTemplate serviceTemplate) { - for (PropertyVariable var : propMap.getNodePropertyVariables(serviceTemplate, templatePlan.getNodeTemplate())) { final String bpelVarName = var.getVariableName(); // as the variables are there and only possibly empty we just check @@ -83,12 +81,10 @@ public boolean addIfNullAbortCheck(final BPELScope templatePlan, final Property2 Node bpelIf = this.bpelFragments.generateBPELIfTrueThrowFaultAsNode(xpathQuery, propertyEmptyFault); bpelIf = templatePlan.getBpelDocument().importNode(bpelIf, true); templatePlan.getBpelSequencePrePhaseElement().appendChild(bpelIf); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); return false; - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); return false; } @@ -98,13 +94,12 @@ public boolean addIfNullAbortCheck(final BPELScope templatePlan, final Property2 } /** - * Fetches the correct nodeInstanceID link for the given TemplatePlan and sets the value inside a - * NodeInstanceID bpel variable + * Fetches the correct nodeInstanceID link for the given TemplatePlan and sets the value inside a NodeInstanceID + * bpel variable * - * @param templatePlan a templatePlan with set variable with name NodeInstanceID + * @param templatePlan a templatePlan with set variable with name NodeInstanceID * @param serviceTemplateUrlVarName the name of the variable holding the url to the serviceTemplate - * @param instanceDataUrlVarName the name of the variable holding the url to the instanceDataAPI - * @return + * @param instanceDataUrlVarName the name of the variable holding the url to the instanceDataAPI */ public boolean addNodeInstanceFindLogic(final BPELScope templatePlan, final String serviceTemplateUrlVarName, final String query, AbstractServiceTemplate serviceTemplate) { @@ -119,22 +114,20 @@ public boolean addNodeInstanceFindLogic(final BPELScope templatePlan, final Stri // create Response Variable for interaction final String instanceDataAPIResponseVarName = "instanceDataAPIResponseVariable" + System.currentTimeMillis(); this.bpelTemplateScopeHandler.addVariable(instanceDataAPIResponseVarName, VariableType.TYPE, - new QName(xsdNamespace, "anyType", xsdPrefix), templatePlan); + new QName(xsdNamespace, "anyType", xsdPrefix), templatePlan); // find nodeInstance with query at instanceDataAPI try { Node nodeInstanceGETNode = this.bpelFragments.createRESTExtensionGETForNodeInstanceDataAsNode(serviceTemplateUrlVarName, - instanceDataAPIResponseVarName, - templatePlan.getNodeTemplate() - .getId(), - query); + instanceDataAPIResponseVarName, + templatePlan.getNodeTemplate() + .getId(), + query); nodeInstanceGETNode = templatePlan.getBpelDocument().importNode(nodeInstanceGETNode, true); templatePlan.getBpelSequencePrePhaseElement().appendChild(nodeInstanceGETNode); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); } @@ -144,24 +137,22 @@ public boolean addNodeInstanceFindLogic(final BPELScope templatePlan, final Stri try { Node assignNodeInstanceIDFromInstanceDataAPIQueryResponse = this.bpelFragments.createAssignSelectFirstNodeInstanceAndAssignToStringVarAsNode(instanceDataAPIResponseVarName, - instanceIDVarName); + instanceIDVarName); assignNodeInstanceIDFromInstanceDataAPIQueryResponse = templatePlan.getBpelDocument().importNode(assignNodeInstanceIDFromInstanceDataAPIQueryResponse, true); templatePlan.getBpelSequencePrePhaseElement() - .appendChild(assignNodeInstanceIDFromInstanceDataAPIQueryResponse); - } - catch (final SAXException e) { + .appendChild(assignNodeInstanceIDFromInstanceDataAPIQueryResponse); + } catch (final SAXException e) { e.printStackTrace(); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); } return true; } - + public boolean addRelationInstanceFindLogic(final BPELScope templatePlan, final String serviceTemplateUrlVarName, - final String query, AbstractServiceTemplate serviceTemplate) { + final String query, AbstractServiceTemplate serviceTemplate) { if (templatePlan.getRelationshipTemplate() == null) { throw new RuntimeException("Can't create instance find logic only for relations"); } @@ -172,22 +163,20 @@ public boolean addRelationInstanceFindLogic(final BPELScope templatePlan, final // create Response Variable for interaction final String instanceDataAPIResponseVarName = "instanceDataAPIResponseVariable" + System.currentTimeMillis(); this.bpelTemplateScopeHandler.addVariable(instanceDataAPIResponseVarName, VariableType.TYPE, - new QName(xsdNamespace, "anyType", xsdPrefix), templatePlan); + new QName(xsdNamespace, "anyType", xsdPrefix), templatePlan); // find relationInstance with query at instanceDataAPI try { Node relationInstanceGETNode = this.bpelFragments.createRESTExtensionGETForRelationInstanceDataAsNode(serviceTemplateUrlVarName, - instanceDataAPIResponseVarName, - templatePlan.getRelationshipTemplate() - .getId(), - query); + instanceDataAPIResponseVarName, + templatePlan.getRelationshipTemplate() + .getId(), + query); relationInstanceGETNode = templatePlan.getBpelDocument().importNode(relationInstanceGETNode, true); templatePlan.getBpelSequencePrePhaseElement().appendChild(relationInstanceGETNode); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); } @@ -196,36 +185,33 @@ public boolean addRelationInstanceFindLogic(final BPELScope templatePlan, final // fetch nodeInstanceID from nodeInstance query try { Node assignNodeInstanceIDFromInstanceDataAPIQueryResponse = - this.bpelFragments.createAssignSelectFirstRelationInstanceFromResponseAsNode(instanceDataAPIResponseVarName, instanceIDVarName); + this.bpelFragments.createAssignSelectFirstRelationInstanceFromResponseAsNode(instanceDataAPIResponseVarName, instanceIDVarName); assignNodeInstanceIDFromInstanceDataAPIQueryResponse = templatePlan.getBpelDocument().importNode(assignNodeInstanceIDFromInstanceDataAPIQueryResponse, true); templatePlan.getBpelSequencePrePhaseElement() - .appendChild(assignNodeInstanceIDFromInstanceDataAPIQueryResponse); - } - catch (final SAXException e) { + .appendChild(assignNodeInstanceIDFromInstanceDataAPIQueryResponse); + } catch (final SAXException e) { e.printStackTrace(); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); } - return true; + return true; } public boolean addInstanceIDVarToTemplatePlans(final BPELPlan plan, AbstractServiceTemplate serviceTemplate) { boolean check = true; - - for(AbstractNodeTemplate node : serviceTemplate.getTopologyTemplate().getNodeTemplates()) { + + for (AbstractNodeTemplate node : serviceTemplate.getTopologyTemplate().getNodeTemplates()) { check &= addInstanceIDVarToPlan(node, plan, serviceTemplate); } - - for(AbstractRelationshipTemplate relation : serviceTemplate.getTopologyTemplate().getRelationshipTemplates()) { + + for (AbstractRelationshipTemplate relation : serviceTemplate.getTopologyTemplate().getRelationshipTemplates()) { check &= addInstanceIDVarToPlan(relation, plan, serviceTemplate); } - + return check; } - private boolean addInstanceIDVarToPlan(AbstractNodeTemplate nodeTemplate, BPELPlan plan, AbstractServiceTemplate serviceTemplate) { String templateId = nodeTemplate.getId(); @@ -233,66 +219,35 @@ private boolean addInstanceIDVarToPlan(AbstractNodeTemplate nodeTemplate, BPELPl final String xsdPrefix = "xsd" + System.currentTimeMillis(); final String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan); - - + instanceIdVarName += "_" + ModelUtils.makeValidNCName(serviceTemplate.getQName().toString()) + "_" + ModelUtils.makeValidNCName(templateId) + "_" + System.currentTimeMillis(); return this.bpelProcessHandler.addVariable(instanceIdVarName, VariableType.TYPE, - new QName(xsdNamespace, "string", xsdPrefix), - plan); + new QName(xsdNamespace, "string", xsdPrefix), + plan); } - + private boolean addInstanceIDVarToPlan(AbstractRelationshipTemplate relationshipTemplate, BPELPlan plan, AbstractServiceTemplate serviceTemplate) { String templateId = relationshipTemplate.getId(); String instanceIdVarName = relationInstanceIDVarKeyword; final String xsdPrefix = "xsd" + System.currentTimeMillis(); final String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan); - - + instanceIdVarName += "_" + ModelUtils.makeValidNCName(serviceTemplate.getQName().toString()) + "_" + ModelUtils.makeValidNCName(templateId) + "_" + System.currentTimeMillis(); return this.bpelProcessHandler.addVariable(instanceIdVarName, VariableType.TYPE, - new QName(xsdNamespace, "string", xsdPrefix), - plan); + new QName(xsdNamespace, "string", xsdPrefix), + plan); } - - private boolean addInstanceURLVarToTemplatePlan(BPELPlan plan, final AbstractNodeTemplate nodeTemplate, - AbstractServiceTemplate serviceTemplate){ - - String templateId = nodeTemplate.getId(); - String instanceUrlVarName = nodeInstanceURLVarKeyword; - boolean addNamespace = false; - String xsdPrefix = null; - final String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; - - while (!addNamespace) { - - xsdPrefix = "xsd" + System.currentTimeMillis(); - addNamespace = - this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan); - } - - - - - instanceUrlVarName += "_" + ModelUtils.makeValidNCName(serviceTemplate.getQName().toString()) + "_" - + ModelUtils.makeValidNCName(templateId) + "_" + System.currentTimeMillis(); - - return this.bpelProcessHandler.addVariable(instanceUrlVarName, VariableType.TYPE, - new QName(xsdNamespace, "string", xsdPrefix), - plan); - } - - private boolean addInstanceURLVarToTemplatePlan(BPELPlan plan, final AbstractRelationshipTemplate relationshipTemplate, - AbstractServiceTemplate serviceTemplate){ - - String templateId = relationshipTemplate.getId(); - String instanceUrlVarName = relationInstanceURLVarKeyword; + AbstractServiceTemplate serviceTemplate) { + + String templateId = nodeTemplate.getId(); + String instanceUrlVarName = nodeInstanceURLVarKeyword; boolean addNamespace = false; String xsdPrefix = null; final String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; @@ -304,34 +259,53 @@ private boolean addInstanceURLVarToTemplatePlan(BPELPlan plan, final AbstractRel this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan); } - - + instanceUrlVarName += "_" + ModelUtils.makeValidNCName(serviceTemplate.getQName().toString()) + "_" + + ModelUtils.makeValidNCName(templateId) + "_" + System.currentTimeMillis(); + + return this.bpelProcessHandler.addVariable(instanceUrlVarName, VariableType.TYPE, + new QName(xsdNamespace, "string", xsdPrefix), + plan); + } + + private boolean addInstanceURLVarToTemplatePlan(BPELPlan plan, final AbstractRelationshipTemplate relationshipTemplate, + AbstractServiceTemplate serviceTemplate) { + + String templateId = relationshipTemplate.getId(); + String instanceUrlVarName = relationInstanceURLVarKeyword; + boolean addNamespace = false; + String xsdPrefix = null; + final String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; + + while (!addNamespace) { + + xsdPrefix = "xsd" + System.currentTimeMillis(); + addNamespace = + this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan); + } instanceUrlVarName += "_" + ModelUtils.makeValidNCName(serviceTemplate.getQName().toString()) + "_" + ModelUtils.makeValidNCName(templateId) + "_" + System.currentTimeMillis(); return this.bpelProcessHandler.addVariable(instanceUrlVarName, VariableType.TYPE, - new QName(xsdNamespace, "string", xsdPrefix), - plan); + new QName(xsdNamespace, "string", xsdPrefix), + plan); } /** * Adds a NodeInstanceID Variable to each TemplatePlan inside the given Plan * * @param plan a plan with TemplatePlans - * @return */ public boolean addInstanceURLVarToTemplatePlans(final BPELPlan plan, AbstractServiceTemplate serviceTemplate) { boolean check = true; - - for(AbstractRelationshipTemplate relation : serviceTemplate.getTopologyTemplate().getRelationshipTemplates()) { + + for (AbstractRelationshipTemplate relation : serviceTemplate.getTopologyTemplate().getRelationshipTemplates()) { check &= addInstanceURLVarToTemplatePlan(plan, relation, serviceTemplate); } - - for(AbstractNodeTemplate node : serviceTemplate.getTopologyTemplate().getNodeTemplates()) { + + for (AbstractNodeTemplate node : serviceTemplate.getTopologyTemplate().getNodeTemplates()) { check &= addInstanceURLVarToTemplatePlan(plan, node, serviceTemplate); } - return check; } @@ -344,13 +318,13 @@ public boolean addNodeInstanceFindLogic(final BPELPlan plan, final String queryF for (final BPELScope templatePlan : plan.getTemplateBuildPlans()) { if (templatePlan.getNodeTemplate() != null) { check &= addNodeInstanceFindLogic(templatePlan, serviceTemplateUrlVarName, queryForNodeInstances, - serviceTemplate); + serviceTemplate); } } return check; } - + public boolean addRelationInstanceFindLogic(final BPELPlan plan, final String queryForRelationInstances, AbstractServiceTemplate serviceTemplate) { boolean check = true; @@ -359,7 +333,7 @@ public boolean addRelationInstanceFindLogic(final BPELPlan plan, final String qu for (final BPELScope templatePlan : plan.getTemplateBuildPlans()) { if (templatePlan.getRelationshipTemplate() != null) { check &= addRelationInstanceFindLogic(templatePlan, serviceTemplateUrlVarName, queryForRelationInstances, - serviceTemplate); + serviceTemplate); } } @@ -367,10 +341,10 @@ public boolean addRelationInstanceFindLogic(final BPELPlan plan, final String qu } /** - * Adds logic to fetch property data from the instanceDataAPI with the nodeInstanceID variable. The - * property data is then assigned to appropriate BPEL variables of the given plan. + * Adds logic to fetch property data from the instanceDataAPI with the nodeInstanceID variable. The property data is + * then assigned to appropriate BPEL variables of the given plan. * - * @param plan a plan containing templatePlans with set nodeInstanceID variables + * @param plan a plan containing templatePlans with set nodeInstanceID variables * @param propMap a Mapping from NodeTemplate Properties to BPEL Variables * @return true if adding logic described above was successful */ @@ -386,7 +360,7 @@ public boolean addPropertyVariableUpdateBasedOnNodeInstanceID(final BPELPlan pla } return check; } - + public boolean addPropertyVariableUpdateBasedOnRelationInstanceID(final BPELPlan plan, final Property2VariableMapping propMap, AbstractServiceTemplate serviceTemplate) { boolean check = true; for (final BPELScope templatePlan : plan.getTemplateBuildPlans()) { @@ -399,7 +373,7 @@ public boolean addPropertyVariableUpdateBasedOnRelationInstanceID(final BPELPlan } public boolean addPropertyVariableUpdateBasedOnRelationInstanceID(final BPELScope templatePlan, final Property2VariableMapping propMap, AbstractServiceTemplate serviceTemplate) { - // check if everything is available + // check if everything is available if (templatePlan.getRelationshipTemplate() == null) { return false; } @@ -422,21 +396,19 @@ public boolean addPropertyVariableUpdateBasedOnRelationInstanceID(final BPELScop // create Response Variable for interaction final String instanceDataAPIResponseVarName = "instanceDataAPIResponseVariable" + System.currentTimeMillis(); this.bpelTemplateScopeHandler.addVariable(instanceDataAPIResponseVarName, VariableType.TYPE, - new QName(xsdNamespace, "anyType", xsdPrefix), templatePlan); + new QName(xsdNamespace, "anyType", xsdPrefix), templatePlan); // fetch properties from nodeInstance try { Node nodeInstancePropertiesGETNode = this.bpelFragments.createRESTExtensionGETForInstancePropertiesAsNode(instanceIdVarName, - instanceDataAPIResponseVarName); + instanceDataAPIResponseVarName); nodeInstancePropertiesGETNode = templatePlan.getBpelDocument().importNode(nodeInstancePropertiesGETNode, true); templatePlan.getBpelSequencePrePhaseElement().appendChild(nodeInstancePropertiesGETNode); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } @@ -463,23 +435,21 @@ public boolean addPropertyVariableUpdateBasedOnRelationInstanceID(final BPELScop + System.currentTimeMillis(), instanceDataAPIResponseVarName, element2BpelVarNameMap); assignPropertiesToVariables = templatePlan.getBpelDocument().importNode(assignPropertiesToVariables, true); templatePlan.getBpelSequencePrePhaseElement().appendChild(assignPropertiesToVariables); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } return true; } - + /** - * Adds logic to fetch property data from the instanceDataAPI with the nodeInstanceID variable. The - * property data is then assigned to appropriate BPEL Variables of the given templatePlan. + * Adds logic to fetch property data from the instanceDataAPI with the nodeInstanceID variable. The property data is + * then assigned to appropriate BPEL Variables of the given templatePlan. * * @param templatePlan a TemplatePlan of a NodeTemplate that has properties - * @param propMap a Mapping from NodeTemplate Properties to BPEL Variables + * @param propMap a Mapping from NodeTemplate Properties to BPEL Variables * @return true if adding logic described above was successful */ public boolean addPropertyVariableUpdateBasedOnNodeInstanceID(final BPELScope templatePlan, @@ -508,21 +478,19 @@ public boolean addPropertyVariableUpdateBasedOnNodeInstanceID(final BPELScope te // create Response Variable for interaction final String instanceDataAPIResponseVarName = "instanceDataAPIResponseVariable" + System.currentTimeMillis(); this.bpelTemplateScopeHandler.addVariable(instanceDataAPIResponseVarName, VariableType.TYPE, - new QName(xsdNamespace, "anyType", xsdPrefix), templatePlan); + new QName(xsdNamespace, "anyType", xsdPrefix), templatePlan); // fetch properties from nodeInstance try { Node nodeInstancePropertiesGETNode = this.bpelFragments.createRESTExtensionGETForInstancePropertiesAsNode(instanceIdVarName, - instanceDataAPIResponseVarName); + instanceDataAPIResponseVarName); nodeInstancePropertiesGETNode = templatePlan.getBpelDocument().importNode(nodeInstancePropertiesGETNode, true); templatePlan.getBpelSequencePrePhaseElement().appendChild(nodeInstancePropertiesGETNode); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } @@ -549,11 +517,9 @@ public boolean addPropertyVariableUpdateBasedOnNodeInstanceID(final BPELScope te + System.currentTimeMillis(), instanceDataAPIResponseVarName, element2BpelVarNameMap); assignPropertiesToVariables = templatePlan.getBpelDocument().importNode(assignPropertiesToVariables, true); templatePlan.getBpelSequencePrePhaseElement().appendChild(assignPropertiesToVariables); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } @@ -578,21 +544,19 @@ public boolean addPropertyVariableUpdateBasedOnNodeInstanceID(final BPELPlanCont final String instanceDataAPIResponseVarName = "instanceDataAPIResponseVariable" + System.currentTimeMillis(); context.addVariable(instanceDataAPIResponseVarName, VariableType.TYPE, - new QName(xsdNamespace, "anyType", xsdPrefix)); + new QName(xsdNamespace, "anyType", xsdPrefix)); // fetch properties from nodeInstance try { Node nodeInstancePropertiesGETNode = this.bpelFragments.createRESTExtensionGETForInstancePropertiesAsNode(instanceIdVarName, - instanceDataAPIResponseVarName); + instanceDataAPIResponseVarName); nodeInstancePropertiesGETNode = context.importNode(nodeInstancePropertiesGETNode); context.getPrePhaseElement().appendChild(nodeInstancePropertiesGETNode); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } @@ -617,11 +581,9 @@ public boolean addPropertyVariableUpdateBasedOnNodeInstanceID(final BPELPlanCont + System.currentTimeMillis(), instanceDataAPIResponseVarName, element2BpelVarNameMap); assignPropertiesToVariables = context.importNode(assignPropertiesToVariables); context.getPrePhaseElement().appendChild(assignPropertiesToVariables); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } @@ -654,24 +616,22 @@ public String appendCountInstancesLogic(final BPELPlanContext context, final Abs Node getNodeInstancesREST = this.bpelFragments.createRESTExtensionGETForRelationInstanceDataAsNode(SimplePlanBuilderServiceInstanceHandler.getServiceTemplateURLVariableName(context.getMainVariableNames()), - responseVarName, - relationshipTemplate.getId(), query); + responseVarName, + relationshipTemplate.getId(), query); getNodeInstancesREST = context.importNode(getNodeInstancesREST); templateMainSequeceNode.appendChild(getNodeInstancesREST); Node assignCounter = this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignInstanceCount_" - + relationshipTemplate.getId() + "_" + context.getIdForNames(), responseVarName, - counterVariable.getVariableName(), - "count(//*[local-name()='RelationshipTemplateInstance'])"); + + relationshipTemplate.getId() + "_" + context.getIdForNames(), responseVarName, + counterVariable.getVariableName(), + "count(//*[local-name()='RelationshipTemplateInstance'])"); assignCounter = context.importNode(assignCounter); templateMainSequeceNode.appendChild(assignCounter); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -690,7 +650,6 @@ public String appendCountInstancesLogic(final BPELPlanContext context, final Abs forEachScopeElement.appendChild(cloneCorreElement); templateMainScopeNode.removeChild(correlationSets); - } final Element sequenceElement = context.createElement(BPELPlan.bpelNamespace, "sequence"); @@ -708,7 +667,7 @@ public String appendCountInstancesLogic(final BPELPlanContext context, final Abs return null; } - + public String appendCountInstancesLogic(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, final String query) { @@ -735,24 +694,22 @@ public String appendCountInstancesLogic(final BPELPlanContext context, final Abs Node getNodeInstancesREST = this.bpelFragments.createRESTExtensionGETForNodeInstanceDataAsNode(SimplePlanBuilderServiceInstanceHandler.getServiceTemplateURLVariableName(context.getMainVariableNames()), - responseVarName, - nodeTemplate.getId(), query); + responseVarName, + nodeTemplate.getId(), query); getNodeInstancesREST = context.importNode(getNodeInstancesREST); templateMainSequeceNode.appendChild(getNodeInstancesREST); Node assignCounter = this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignInstanceCount_" - + nodeTemplate.getId() + "_" + context.getIdForNames(), responseVarName, - counterVariable.getVariableName(), - "count(//*[local-name()='NodeTemplateInstance'])"); + + nodeTemplate.getId() + "_" + context.getIdForNames(), responseVarName, + counterVariable.getVariableName(), + "count(//*[local-name()='NodeTemplateInstance'])"); assignCounter = context.importNode(assignCounter); templateMainSequeceNode.appendChild(assignCounter); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -771,18 +728,17 @@ public String appendCountInstancesLogic(final BPELPlanContext context, final Abs forEachScopeElement.appendChild(cloneCorreElement); templateMainScopeNode.removeChild(correlationSets); - } - - if(((Element) templateMainScopeNode).getElementsByTagName("compensationHandler").getLength() != 0) { + + if (((Element) templateMainScopeNode).getElementsByTagName("compensationHandler").getLength() != 0) { final Element compensationHandler = (Element) ((Element) templateMainScopeNode).getElementsByTagName("compensationHandler").item(0); - + final Node cloneCompensationHandler = compensationHandler.cloneNode(true); - + forEachScopeElement.appendChild(cloneCompensationHandler); templateMainScopeNode.removeChild(compensationHandler); } - + final Element sequenceElement = context.createElement(BPELPlan.bpelNamespace, "sequence"); sequenceElement.appendChild(context.importNode(context.getPrePhaseElement().cloneNode(true))); @@ -855,7 +811,7 @@ public Element createForEachActivity(final BPELPlanContext context, final String public String findInstanceUrlVarName(final BPELPlan plan, AbstractServiceTemplate serviceTemplate, final String templateId, final boolean isNode) { return this.findInstanceUrlVarName(serviceTemplate, this.bpelProcessHandler.getMainVariableNames(plan), - templateId, isNode); + templateId, isNode); } public String findInstanceUrlVarName(final BPELScope templatePlan, AbstractServiceTemplate serviceTemplate) { @@ -871,7 +827,6 @@ public String findInstanceUrlVarName(final BPELScope templatePlan, AbstractServi return this.findInstanceUrlVarName(templatePlan.getBuildPlan(), serviceTemplate, templateId, isNode); } - private String findInstanceUrlVarName(AbstractServiceTemplate serviceTemplate, final List varNames, final String templateId, final boolean isNode) { final String instanceURLVarName = (isNode ? nodeInstanceURLVarKeyword : relationInstanceURLVarKeyword) + "_" @@ -897,6 +852,4 @@ public String findInstanceIdVarName(AbstractServiceTemplate serviceTemplate, fin } return null; } - - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/PropertyVariableHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/PropertyVariableHandler.java similarity index 89% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/PropertyVariableHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/PropertyVariableHandler.java index d5d966727..ea691274d 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/PropertyVariableHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/PropertyVariableHandler.java @@ -3,13 +3,13 @@ import java.util.Collection; import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; @@ -23,20 +23,19 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class PropertyVariableHandler { private final static Logger LOG = LoggerFactory.getLogger(PropertyVariableHandler.class); - private final BPELPlanHandler planHandler; - private final static String TOSCAPROPERTYSUFFIX = "toscaProperty"; + private final BPELPlanHandler planHandler; + /** * Constructor * - * @param planHandler a BuildPlanHandler for the class + * @param planHandler a BuildPlanHandler for the class * @param templateHandler a TemplateBuildPlanHandler for the class */ public PropertyVariableHandler(final BPELPlanHandler planHandler) { @@ -44,18 +43,17 @@ public PropertyVariableHandler(final BPELPlanHandler planHandler) { } /** - * Initializes the BuildPlan with variables for Template Properties and returns the Mappings for the - * Properties and variables + * Initializes the BuildPlan with variables for Template Properties and returns the Mappings for the Properties and + * variables * * @param buildPlan the BuildPlan to initialize - * @return a PropertyMap which holds mappings from Template to Template Property and BuildPlan - * variable + * @return a PropertyMap which holds mappings from Template to Template Property and BuildPlan variable */ public Property2VariableMapping initializePropertiesAsVariables(final BPELPlan buildPlan, final AbstractServiceTemplate serviceTemplate) { return this.initializePropertiesAsVariables(buildPlan, serviceTemplate, - serviceTemplate.getTopologyTemplate().getNodeTemplates(), - serviceTemplate.getTopologyTemplate().getRelationshipTemplates()); + serviceTemplate.getTopologyTemplate().getNodeTemplates(), + serviceTemplate.getTopologyTemplate().getRelationshipTemplates()); } public Property2VariableMapping initializePropertiesAsVariables(final BPELPlan plan, @@ -78,7 +76,7 @@ public Property2VariableMapping initializePropertiesAsVariables(final BPELPlan p /** * Initializes Properties inside the given PropertyMap of the given TemplateBuildPlan * - * @param map a PropertyMap to save the mappings to + * @param map a PropertyMap to save the mappings to * @param templatePlan the TemplateBuildPlan to initialize its properties */ public void initializePropertiesAsVariables(final Property2VariableMapping map, final BPELScope templatePlan, @@ -92,10 +90,9 @@ public void initializePropertiesAsVariables(final Property2VariableMapping map, } /** - * Initializes Property variables and mappings for a TemplateBuildPlan which handles a - * RelationshipTemplate + * Initializes Property variables and mappings for a TemplateBuildPlan which handles a RelationshipTemplate * - * @param map the PropertyMap to save the result to + * @param map the PropertyMap to save the result to * @param templatePlan a TemplateBuildPlan which handles a RelationshipTemplate */ private void initPropsAsVarsInRelationship(final Property2VariableMapping map, final BPELScope templatePlan, @@ -123,7 +120,7 @@ private void initPropsAsVarsInRelationship(final Property2VariableMapping map, f for (int j = 0; j < propertyElement.getChildNodes().item(i).getChildNodes().getLength(); j++) { if (propertyElement.getChildNodes().item(i).getChildNodes().item(j) - .getNodeType() == Node.TEXT_NODE) { + .getNodeType() == Node.TEXT_NODE) { value += propertyElement.getChildNodes().item(i).getChildNodes().item(j).getNodeValue(); } } @@ -139,7 +136,6 @@ private void initPropsAsVarsInRelationship(final Property2VariableMapping map, f } else { this.planHandler.assignInitValueToVariable(propVarName, "", templatePlan.getBuildPlan()); } - } } } @@ -162,7 +158,7 @@ private String createPropertyVariableName(final AbstractServiceTemplate serviceT /** * Initializes Property variables for the given TemplateBuildPlan which handles a NodeTemplate * - * @param map a PropertyMap to save the result/mappings to + * @param map a PropertyMap to save the result/mappings to * @param templatePlan a TemplateBuildPlan which handles a NodeTemplate */ private void initPropsAsVarsInNode(final Property2VariableMapping map, final BPELScope templatePlan, @@ -179,7 +175,6 @@ private void initPropsAsVarsInNode(final Property2VariableMapping map, final BPE final String propName = propertyElement.getChildNodes().item(i).getLocalName(); String propVarName = this.createPropertyVariableName(serviceTemplate, nodeTemplate, propName); - while (!this.planHandler.addStringVariable(propVarName, templatePlan.getBuildPlan())) { propVarName = this.createPropertyVariableName(serviceTemplate, nodeTemplate, propName); } @@ -190,7 +185,7 @@ private void initPropsAsVarsInNode(final Property2VariableMapping map, final BPE for (int j = 0; j < propertyElement.getChildNodes().item(i).getChildNodes().getLength(); j++) { if (propertyElement.getChildNodes().item(i).getChildNodes().item(j) - .getNodeType() == Node.TEXT_NODE) { + .getNodeType() == Node.TEXT_NODE) { value += propertyElement.getChildNodes().item(i).getChildNodes().item(j).getNodeValue(); } } @@ -203,5 +198,4 @@ private void initPropsAsVarsInNode(final Property2VariableMapping map, final BPE } } } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/ServiceTemplateBoundaryPropertyMappingsToOutputHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/ServiceTemplateBoundaryPropertyMappingsToOutputHandler.java similarity index 81% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/ServiceTemplateBoundaryPropertyMappingsToOutputHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/ServiceTemplateBoundaryPropertyMappingsToOutputHandler.java index 024d1ace3..00787c785 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/ServiceTemplateBoundaryPropertyMappingsToOutputHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/ServiceTemplateBoundaryPropertyMappingsToOutputHandler.java @@ -2,9 +2,7 @@ import java.util.ArrayList; import java.util.List; -import java.util.Map; -import javax.xml.namespace.QName; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; @@ -12,6 +10,8 @@ import javax.xml.xpath.XPathFactory; import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.tosca.AbstractBoundaryDefinitions; import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; @@ -21,8 +21,6 @@ import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplateProperties; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; @@ -31,15 +29,14 @@ /** *

    - * This Class is responsible for fetching BoundaryDefinitions mappings and initialize the BuildPlan - * with appropiate assigns to return property values to the BuildPlan caller + * This Class is responsible for fetching BoundaryDefinitions mappings and initialize the BuildPlan with appropiate + * assigns to return property values to the BuildPlan caller *

    - * + *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class ServiceTemplateBoundaryPropertyMappingsToOutputHandler { @@ -48,14 +45,12 @@ public class ServiceTemplateBoundaryPropertyMappingsToOutputHandler { /** *

    - * This class is a wrapper, which holds a mapping from ServiceTemplate Property, Template and - * Template Property + * This class is a wrapper, which holds a mapping from ServiceTemplate Property, Template and Template Property *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ private class ServiceTemplatePropertyToPropertyMapping { @@ -66,14 +61,14 @@ private class ServiceTemplatePropertyToPropertyMapping { * Adds a mapping from ServiceTemplate Property, Template and Template Property * * @param serviceTemplatePropertyLocalName the localName of a serviceTemplate property - * @param templateId the template Id - * @param templatePropertyLocalName the localName of a template id + * @param templateId the template Id + * @param templatePropertyLocalName the localName of a template id */ protected void addMapping(final String serviceTemplatePropertyLocalName, final String templateId, final String templatePropertyLocalName) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.debug("Adding ServiceTemplate Property Mapping, serviceTemplate property localName {}, templateId {} and template property localName {}", - serviceTemplatePropertyLocalName, - templateId, templatePropertyLocalName); + serviceTemplatePropertyLocalName, + templateId, templatePropertyLocalName); if (this.internalArray.length == 1) { // nothing stored inside array yet this.internalArray[0][0] = serviceTemplatePropertyLocalName; @@ -105,7 +100,7 @@ private void printInternalArray() { */ protected void removeServiceTemplatePropertyMapping(final String serviceTemplatePropertyName) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.debug("Removin ServiceTemplate Property Mapping for serviceTemplate Property {}", - serviceTemplatePropertyName); + serviceTemplatePropertyName); for (int index = 0; index < this.internalArray.length; index++) { if (this.internalArray[index][0] != null && this.internalArray[index][0].equals(serviceTemplatePropertyName)) { @@ -178,20 +173,19 @@ private void increaseArraySize() { } this.internalArray = newArray; } - } /** *

    - * Initializes the response message of the given BuildPlan according to the given - * BoundaryDefinitions inside the given Definitions document + * Initializes the response message of the given BuildPlan according to the given BoundaryDefinitions inside the + * given Definitions document *

    * - * @param definitions the Definitions document to look for BoundaryDefinitions for and contains the - * ServiceTemplate the BuildPlan belongs to - * @param buildPlan a initialized BuildPlan - * @param propMap a PropMap which contains the names of the different template property variables - * inside the plan + * @param definitions the Definitions document to look for BoundaryDefinitions for and contains the ServiceTemplate + * the BuildPlan belongs to + * @param buildPlan a initialized BuildPlan + * @param propMap a PropMap which contains the names of the different template property variables inside the + * plan */ public void initializeBuildPlanOutput(final AbstractDefinitions definitions, final BPELPlan buildPlan, final Property2VariableMapping propMap, @@ -202,17 +196,15 @@ public void initializeBuildPlanOutput(final AbstractDefinitions definitions, fin return; } initializeAssignOutput(buildPlan, propMap, mapping, serviceTemplate); - } /** - * Generates a copy with a literal value to the outputmessage of the given BuildPlan. The literal - * consists of the mappings given, where the propertyMap is used identify the propertyVariables - * inside the buildPlan + * Generates a copy with a literal value to the outputmessage of the given BuildPlan. The literal consists of the + * mappings given, where the propertyMap is used identify the propertyVariables inside the buildPlan * * @param buildPlan the BuildPlan to add the copy to - * @param propMap a PropertyMap containing the variable names of the properties - * @param mapping the mappings from serviceTemplate Properties to template properties + * @param propMap a PropertyMap containing the variable names of the properties + * @param mapping the mappings from serviceTemplate Properties to template properties */ private void initializeAssignOutput(final BPELPlan buildPlan, final Property2VariableMapping propMap, final ServiceTemplatePropertyToPropertyMapping mapping, @@ -238,10 +230,10 @@ private void initializeAssignOutput(final BPELPlan buildPlan, final Property2Var if (isConcatQuery(templatePropertyName)) { processHandler.addCopyStringToOutputAssign(generateCopyFromQueryToOutputAsString(templatePropertyName, - "//*[local-name()='" - + serviceTemplatePropertyName - + "']"), - buildPlan); + "//*[local-name()='" + + serviceTemplatePropertyName + + "']"), + buildPlan); } else { final String templateId = mapping.getTemplateId(serviceTemplatePropertyName); if (templateId == null) { @@ -255,7 +247,7 @@ private void initializeAssignOutput(final BPELPlan buildPlan, final Property2Var if (var.getPropertyName().equals(templatePropertyName)) { assigned = true; processHandler.assginOutputWithVariableValue(var.getVariableName(), - serviceTemplatePropertyName, buildPlan); + serviceTemplatePropertyName, buildPlan); } } @@ -270,20 +262,18 @@ private void initializeAssignOutput(final BPELPlan buildPlan, final Property2Var for (final String failedServiceTempProp : failedServiceTemplateProperties) { mapping.removeServiceTemplatePropertyMapping(failedServiceTempProp); } - - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.error("Couldn't initialize a Handler, BuildPlan OutputMessage may be empty", - e); + e); return; } } /** - * Generates a copy element with from and to elements as String. The given mapping controls what the - * from will assign to the outputmessage + * Generates a copy element with from and to elements as String. The given mapping controls what the from will + * assign to the outputmessage * - * @param mapping the ServiceTemplate Property to Template Property mappings + * @param mapping the ServiceTemplate Property to Template Property mappings * @param buildPlan the BuildPlan to generate the copy for * @return a String containing a valid BPEL Copy Element */ @@ -297,13 +287,10 @@ private String generateCopyFromQueryToOutputAsString(final String fromQuery, fin return copyString; } - /** - * Calculates the ServiceTemplate Property to Template Property mappings for the given - * ServiceTemplate + * Calculates the ServiceTemplate Property to Template Property mappings for the given ServiceTemplate * * @param buildPlanServiceTemplate a ServiceTemplate - * @param propMap * @return a Mapping from ServiceTemplate properties to Template properties */ private ServiceTemplatePropertyToPropertyMapping getMappings(final AbstractServiceTemplate buildPlanServiceTemplate, @@ -313,8 +300,8 @@ private ServiceTemplatePropertyToPropertyMapping getMappings(final AbstractServi final AbstractBoundaryDefinitions boundaryDefinitions = buildPlanServiceTemplate.getBoundaryDefinitions(); if (boundaryDefinitions == null) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.warn("No BoundaryDefinitions in ServiceTemplate {} found. Output of BuildPlan maybe empty.", - buildPlanServiceTemplate.getQName() - .toString()); + buildPlanServiceTemplate.getQName() + .toString()); return null; } @@ -370,7 +357,6 @@ private ServiceTemplatePropertyToPropertyMapping getMappings(final AbstractServi isConcatQuery = true; templatePropLocalName = injectBPELVariables(propertyMapping.getTargetPropertyRef(), propMap, buildPlanServiceTemplate); - } else { Element templateElement = null; @@ -384,16 +370,16 @@ private ServiceTemplatePropertyToPropertyMapping getMappings(final AbstractServi if (templateElement == null) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.warn("Referenced Template {} in ServiceTemplate {} has no Properties defined, continueing with other PropertyMapping", - templateId, - buildPlanServiceTemplate.getQName() - .toString()); + templateId, + buildPlanServiceTemplate.getQName() + .toString()); continue; } ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.debug("Adding Mapping for ServiceTemplateProperty {}, TemplateId {} and TemplateProperty {}", - serviceTemplatePropLocalName, - templateId, - templateElement.getLocalName()); + serviceTemplatePropLocalName, + templateId, + templateElement.getLocalName()); templatePropLocalName = getTemplatePropertyLocalName(templateElement, propertyMapping.getTargetPropertyRef()); @@ -401,27 +387,26 @@ private ServiceTemplatePropertyToPropertyMapping getMappings(final AbstractServi if (templatePropLocalName == null) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.warn("Referenced Template {} in ServiceTemplate {} has no Properties defined, continueing with other PropertyMapping", - templateId, - buildPlanServiceTemplate.getQName() - .toString()); + templateId, + buildPlanServiceTemplate.getQName() + .toString()); continue; } if (serviceTemplatePropLocalName == null) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.warn("Couldn't find Property Element for ServiceTemplate {} , continueing with other PropertyMapping", - buildPlanServiceTemplate.getQName() - .toString()); + buildPlanServiceTemplate.getQName() + .toString()); continue; } if (!isConcatQuery && templateId == null) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.warn("targetObjectRef for ServiceTemplate {} not set, continueing with other PropertyMapping", - buildPlanServiceTemplate.getQName() - .toString()); + buildPlanServiceTemplate.getQName() + .toString()); continue; } mappingWrapper.addMapping(serviceTemplatePropLocalName, templateId, templatePropLocalName); - } return mappingWrapper; @@ -513,18 +498,17 @@ private boolean isConcatQuery(final String xPathQuery) { } /** - * Returns the localName of an element which is referenced by the XPath expression inside the - * PropertyMappings + * Returns the localName of an element which is referenced by the XPath expression inside the PropertyMappings * * @param serviceTemplatePropElement the first element inside the Properties Element - * @param xpathExpr an XPath Expression + * @param xpathExpr an XPath Expression * @return a localName when the XPath expression returned exactly one Node, else null */ private String getTemplatePropertyLocalName(final Element serviceTemplatePropElement, final String xpathExpr) { try { final XPath xPath = XPathFactory.newInstance().newXPath(); ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.debug("Executing XPath Expression {} on Node {}", - xpathExpr, serviceTemplatePropElement); + xpathExpr, serviceTemplatePropElement); final NodeList nodes = (NodeList) xPath.evaluate(xpathExpr, serviceTemplatePropElement, XPathConstants.NODESET); @@ -534,14 +518,12 @@ private String getTemplatePropertyLocalName(final Element serviceTemplatePropEle return node.getLocalName(); } else { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.error("XPath expression {} on Element {} returned multiple Nodes", - xpathExpr, serviceTemplatePropElement); + xpathExpr, serviceTemplatePropElement); return null; } - - } - catch (final XPathExpressionException e1) { + } catch (final XPathExpressionException e1) { ServiceTemplateBoundaryPropertyMappingsToOutputHandler.LOG.error("XPath Expression for serviceTemplatePropetyRef isn't valid", - e1); + e1); } return null; } @@ -550,7 +532,7 @@ private String getTemplatePropertyLocalName(final Element serviceTemplatePropEle * Returns an AbstractNodeTemplate of the given serviceTemplate and TemplateId * * @param serviceTemplate the ServiceTemplate to search in - * @param templateId the Id of the Template + * @param templateId the Id of the Template * @return an AbstractNodeTemplate with the specified Id, else null */ private AbstractNodeTemplate getNodeTemplate(final AbstractServiceTemplate serviceTemplate, @@ -567,18 +549,17 @@ private AbstractNodeTemplate getNodeTemplate(final AbstractServiceTemplate servi * Returns an AbstractRelationshipTemplate of the given serviceTemplate and TemplateId * * @param serviceTemplate the ServiceTemplate to search in - * @param templateId the If of the template to search for + * @param templateId the If of the template to search for * @return an AbstractRelationshipTemplate with the specified Id, else null */ private AbstractRelationshipTemplate getRelationshipTemplate(final AbstractServiceTemplate serviceTemplate, final String templateId) { for (final AbstractRelationshipTemplate relationshipTemplate : serviceTemplate.getTopologyTemplate() - .getRelationshipTemplates()) { + .getRelationshipTemplates()) { if (relationshipTemplate.getId().equals(templateId)) { return relationshipTemplate; } } return null; } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/SimplePlanBuilderServiceInstanceHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/SimplePlanBuilderServiceInstanceHandler.java similarity index 75% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/SimplePlanBuilderServiceInstanceHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/SimplePlanBuilderServiceInstanceHandler.java index d388e622c..1f7d6f2be 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/SimplePlanBuilderServiceInstanceHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/SimplePlanBuilderServiceInstanceHandler.java @@ -1,41 +1,30 @@ package org.opentosca.planbuilder.core.bpel.tosca.handlers; -import java.io.File; import java.io.IOException; -import java.io.StringReader; import java.net.URLEncoder; +import java.nio.file.Path; import java.util.Collection; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; import org.xml.sax.SAXException; /** - * - * Appends init code to the given BuildPlan to instantiate a serviceInstance at the responsible - * OpenTOSCA Container + * Appends init code to the given BuildPlan to instantiate a serviceInstance at the responsible OpenTOSCA Container * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class SimplePlanBuilderServiceInstanceHandler extends AbstractServiceInstanceHandler { @@ -43,6 +32,15 @@ public SimplePlanBuilderServiceInstanceHandler() throws ParserConfigurationExcep super(); } + public static String getServiceTemplateURLVariableName(final Collection varNames) { + for (final String varName : varNames) { + if (varName.contains(SimplePlanBuilderServiceInstanceHandler.ServiceTemplateURLVarKeyword)) { + return varName; + } + } + return null; + } + public String findServiceInstanceIdVarName(final BPELPlan plan) { return getLowestId(findServiceInstanceIdVarNames(this.bpelProcessHandler, plan), ServiceInstanceIDVarKeyword); } @@ -57,7 +55,7 @@ public String findInstanceDataAPIUrlVariableName(final BPELPlan plan) { public String findServiceInstancesUrlVariableName(final BPELPlan plan) { return getLowestId(findServiceInstancesURLVarName(this.bpelProcessHandler, plan), - ServiceInstancesURLVarKeyword); + ServiceInstancesURLVarKeyword); } public String findServiceTemplateUrlVariableName(final BPELPlan plan) { @@ -81,15 +79,6 @@ public String getServiceTemplateURLVariableName(final BPELPlan plan) { return getLowestId(findServiceTemplateURLVarName(this.bpelProcessHandler, plan), ServiceTemplateURLVarKeyword); } - public static String getServiceTemplateURLVariableName(final Collection varNames) { - for (final String varName : varNames) { - if (varName.contains(SimplePlanBuilderServiceInstanceHandler.ServiceTemplateURLVarKeyword)) { - return varName; - } - } - return null; - } - public void addServiceInstanceHandlingFromInput(final BPELPlan plan, String serviceInstancesUrlVarName, String serviceInstanceURLVarName, String serviceTemplateUrlVarName, String serviceInstanceIdVarName, String planInstanceURLVarName) { @@ -104,14 +93,14 @@ public void addServiceInstanceHandlingFromInput(final BPELPlan plan, String serv addAssignServiceTemplateURLVariable(plan, serviceInstancesUrlVarName, serviceTemplateUrlVarName); addAssignServiceInstanceIdVarFromServiceInstanceURLVar(plan, serviceInstanceURLVarName, - serviceInstanceIdVarName); + serviceInstanceIdVarName); addAssignManagementPlanInstanceUrlVariable(plan, planInstanceURLVarName, serviceInstanceURLVarName); } /** - * Sets the main variables such as ServiceInstanceID, ServiceTemplateURL for management plans and - * add code to initialize the variables based on the input instanceDataAPI and serviceInstanceURL + * Sets the main variables such as ServiceInstanceID, ServiceTemplateURL for management plans and add code to + * initialize the variables based on the input instanceDataAPI and serviceInstanceURL * * @param plan a plan */ @@ -131,22 +120,22 @@ public void addServiceInstanceHandlingFromInput(final BPELPlan plan) { String serviceInstanceIdVarName = this.addServiceInstanceIDVariable(plan); addAssignServiceInstanceIdVarFromServiceInstanceURLVar(plan, serviceInstanceURLVarName, - serviceInstanceIdVarName); + serviceInstanceIdVarName); String planInstanceURLVarName = this.addPlanInstanceURLVariable(plan); addAssignManagementPlanInstanceUrlVariable(plan, planInstanceURLVarName, serviceInstanceURLVarName); } /** - * Adds code to initialize serviceInstance at the given instance data API and sets the given service - * instance variables with the created serviceInstance - * - * @param plan the plan to add the code to + * Adds code to initialize serviceInstance at the given instance data API and sets the given service instance + * variables with the created serviceInstance + * + * @param plan the plan to add the code to * @param instanceDataAPIVariableName the variable to hold the instance data api url - * @param serviceInstanceUrlVarName the variable to hold the serviceInstanceUrl - * @param serviceInstanceIdVarName the variable to hold the serviceInstanceId - * @param serviceTemplateUrlVarName the variable to hold the serviceTemplateUrl - * @param planInstanceUrlVarName the variable to hold the planInstance + * @param serviceInstanceUrlVarName the variable to hold the serviceInstanceUrl + * @param serviceInstanceIdVarName the variable to hold the serviceInstanceId + * @param serviceTemplateUrlVarName the variable to hold the serviceTemplateUrl + * @param planInstanceUrlVarName the variable to hold the planInstance */ public void appendCreateServiceInstance(final BPELPlan plan, String instanceDataAPIVariableName, final String serviceInstanceUrlVarName, @@ -155,8 +144,8 @@ public void appendCreateServiceInstance(final BPELPlan plan, String instanceData boolean isManagementPlan) { appendServiceInstanceInitCode(plan, instanceDataAPIVariableName, serviceInstanceUrlVarName, - serviceInstanceIdVarName, serviceTemplateUrlVarName, planInstanceUrlVarName, - isManagementPlan); + serviceInstanceIdVarName, serviceTemplateUrlVarName, planInstanceUrlVarName, + isManagementPlan); } public void appendAssignServiceInstanceIdToOutput(BPELPlan plan, String serviceInstanceIdVarName) { @@ -164,9 +153,8 @@ public void appendAssignServiceInstanceIdToOutput(BPELPlan plan, String serviceI } /** - * Appends logic to handle instanceDataAPI interaction. Adds instanceDataAPI element into input - * message. At runtime saves the input value into a global variable and creates a serviceInstance - * for the plan. + * Appends logic to handle instanceDataAPI interaction. Adds instanceDataAPI element into input message. At runtime + * saves the input value into a global variable and creates a serviceInstance for the plan. * * @param plan a plan */ @@ -183,37 +171,37 @@ public void appendCreateServiceInstanceVarsAndAnitializeWithInstanceDataAPI(fina final String serviceTemplateUrlVarName = this.addServiceTemplateURLVariable(plan); final String planInstanceUrlVarName = this.addPlanInstanceURLVariable(plan); boolean isManagementPlan = false; - if (plan.getType().equals(PlanType.MANAGE)) { + if (plan.getType().equals(PlanType.MANAGEMENT)) { isManagementPlan = true; } appendServiceInstanceInitCode(plan, instanceDataAPIVarName, serviceInstanceUrlVarName, serviceInstanceIdVarName, - serviceTemplateUrlVarName, planInstanceUrlVarName, isManagementPlan); + serviceTemplateUrlVarName, planInstanceUrlVarName, isManagementPlan); String serviceInstanceVarName = getLowestId(findServiceInstanceIdVarNames(bpelProcessHandler, plan), ServiceInstanceURLVarKeyword); addAssignOutputWithServiceInstanceId(plan, serviceInstanceVarName); } - + public boolean appendSetServiceInstanceStateAsChild(final BPELPlan plan, final Element insertAsChild, - final String state, String urlVarName) { + final String state, String urlVarName) { final String xsdNamespace = "http://www.w3.org/2001/XMLSchema"; final String xsdPrefix = "xsd" + System.currentTimeMillis(); this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan); // generate any type variable for REST call response - final String restCallResponseVarName = "bpel4restlightVarResponse_setServiceInstanceState_"+state+ "_" + System.currentTimeMillis(); + final String restCallResponseVarName = "bpel4restlightVarResponse_setServiceInstanceState_" + state + "_" + System.currentTimeMillis(); final QName rescalResponseVarDeclId = new QName(xsdNamespace, "anyType", xsdPrefix); if (!this.bpelProcessHandler.addVariable(restCallResponseVarName, BPELPlan.VariableType.TYPE, - rescalResponseVarDeclId, plan)) { + rescalResponseVarDeclId, plan)) { return false; } - final String restCallRequestVarName = "bpel4restlightVarRequest_setServiceInstanceState_"+ state +"_" + System.currentTimeMillis(); + final String restCallRequestVarName = "bpel4restlightVarRequest_setServiceInstanceState_" + state + "_" + System.currentTimeMillis(); final QName rescalRequestVarDeclId = new QName(xsdNamespace, "string", xsdPrefix); if (!this.bpelProcessHandler.addVariable(restCallRequestVarName, BPELPlan.VariableType.TYPE, - rescalRequestVarDeclId, plan)) { + rescalRequestVarDeclId, plan)) { return false; } @@ -222,16 +210,13 @@ public boolean appendSetServiceInstanceStateAsChild(final BPELPlan plan, final E try { Node assignRequestWithStateNode = this.fragments.createAssignXpathQueryToStringVarFragmentAsNode(assignName, "string('" + state + "')", - restCallRequestVarName); + restCallRequestVarName); assignRequestWithStateNode = plan.getBpelDocument().importNode(assignRequestWithStateNode, true); insertAsChild.appendChild(assignRequestWithStateNode); - - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -249,19 +234,16 @@ public boolean appendSetServiceInstanceStateAsChild(final BPELPlan plan, final E Node setInstanceStateRequestNode = this.fragments.createBPEL4RESTLightPutStateAsNode(urlVarName, restCallRequestVarName); setInstanceStateRequestNode = plan.getBpelDocument().importNode(setInstanceStateRequestNode, true); - insertAsChild.appendChild(setInstanceStateRequestNode); - } - catch (final IOException e) { + insertAsChild.appendChild(setInstanceStateRequestNode); + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; - } public boolean appendSetServiceInstanceState(final BPELPlan plan, final Element insertBeforeElement, @@ -272,19 +254,19 @@ public boolean appendSetServiceInstanceState(final BPELPlan plan, final Element this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix, xsdNamespace, plan); // generate any type variable for REST call response - final String restCallResponseVarName = "bpel4restlightVarResponse_setServiceInstanceState_"+state+ "_" + System.currentTimeMillis(); + final String restCallResponseVarName = "bpel4restlightVarResponse" + System.currentTimeMillis(); final QName rescalResponseVarDeclId = new QName(xsdNamespace, "anyType", xsdPrefix); if (!this.bpelProcessHandler.addVariable(restCallResponseVarName, BPELPlan.VariableType.TYPE, - rescalResponseVarDeclId, plan)) { + rescalResponseVarDeclId, plan)) { return false; } - final String restCallRequestVarName = "bpel4restlightVarRequest_setServiceInstanceState_"+ state +"_" + System.currentTimeMillis(); + final String restCallRequestVarName = "bpel4restlightVarRequest" + System.currentTimeMillis(); final QName rescalRequestVarDeclId = new QName(xsdNamespace, "string", xsdPrefix); if (!this.bpelProcessHandler.addVariable(restCallRequestVarName, BPELPlan.VariableType.TYPE, - rescalRequestVarDeclId, plan)) { + rescalRequestVarDeclId, plan)) { return false; } @@ -293,15 +275,13 @@ public boolean appendSetServiceInstanceState(final BPELPlan plan, final Element try { Node assignRequestWithStateNode = this.fragments.createAssignXpathQueryToStringVarFragmentAsNode(assignName, "string('" + state + "')", - restCallRequestVarName); + restCallRequestVarName); assignRequestWithStateNode = plan.getBpelDocument().importNode(assignRequestWithStateNode, true); insertBeforeElement.getParentNode().insertBefore(assignRequestWithStateNode, insertBeforeElement); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -319,12 +299,10 @@ public boolean appendSetServiceInstanceState(final BPELPlan plan, final Element this.fragments.createBPEL4RESTLightPutStateAsNode(serviceInstanceURLVarName, restCallRequestVarName); setInstanceStateRequestNode = plan.getBpelDocument().importNode(setInstanceStateRequestNode, true); insertBeforeElement.getParentNode().insertBefore(setInstanceStateRequestNode, insertBeforeElement); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -346,7 +324,7 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan final QName rescalResponseVarDeclId = new QName(xsdNamespace, "anyType", xsdPrefix); if (!this.bpelProcessHandler.addVariable(restCallResponseVarName, BPELPlan.VariableType.TYPE, - rescalResponseVarDeclId, plan)) { + rescalResponseVarDeclId, plan)) { return false; } @@ -355,7 +333,7 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan final QName tempNodeInstanceIDVarDeclId = new QName(xsdNamespace, "string", xsdPrefix); if (!this.bpelProcessHandler.addVariable(tempNodeInstanceIDVarName, BPELPlan.VariableType.TYPE, - tempNodeInstanceIDVarDeclId, plan)) { + tempNodeInstanceIDVarDeclId, plan)) { return false; } @@ -364,7 +342,7 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan final QName tempNodeInstancePropertiesVarDeclId = new QName(xsdNamespace, "anyType", xsdPrefix); if (!this.bpelProcessHandler.addVariable(tempNodeInstancePropertiesVarName, BPELPlan.VariableType.TYPE, - tempNodeInstancePropertiesVarDeclId, plan)) { + tempNodeInstancePropertiesVarDeclId, plan)) { return false; } @@ -386,18 +364,16 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan try { Node nodeInstanceGETNode = this.fragments.createRESTExtensionGETForNodeInstanceDataAsNode(serviceTemplateUrlVarName, - restCallResponseVarName, - templatePlan.getNodeTemplate() - .getId(), - query); + restCallResponseVarName, + templatePlan.getNodeTemplate() + .getId(), + query); nodeInstanceGETNode = templatePlan.getBpelDocument().importNode(nodeInstanceGETNode, true); plan.getBpelMainFlowElement().getParentNode().insertBefore(nodeInstanceGETNode, - plan.getBpelMainFlowElement()); - } - catch (final SAXException e) { + plan.getBpelMainFlowElement()); + } catch (final SAXException e) { e.printStackTrace(); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); } @@ -405,17 +381,15 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan try { Node assignNodeInstanceIDFromInstanceDataAPIQueryResponse = this.fragments.createAssignSelectFirstNodeInstanceAndAssignToStringVarAsNode(restCallResponseVarName, - tempNodeInstanceIDVarName); + tempNodeInstanceIDVarName); assignNodeInstanceIDFromInstanceDataAPIQueryResponse = templatePlan.getBpelDocument().importNode(assignNodeInstanceIDFromInstanceDataAPIQueryResponse, - true); + true); plan.getBpelMainFlowElement().getParentNode() .insertBefore(assignNodeInstanceIDFromInstanceDataAPIQueryResponse, plan.getBpelMainFlowElement()); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); } @@ -423,17 +397,14 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan try { Node nodeInstancePropertiesGETNode = this.fragments.createRESTExtensionGETForInstancePropertiesAsNode(tempNodeInstanceIDVarName, - restCallResponseVarName); + restCallResponseVarName); nodeInstancePropertiesGETNode = templatePlan.getBpelDocument().importNode(nodeInstancePropertiesGETNode, true); plan.getBpelMainFlowElement().getParentNode().insertBefore(nodeInstancePropertiesGETNode, - plan.getBpelMainFlowElement()); - - } - catch (final IOException e) { + plan.getBpelMainFlowElement()); + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } @@ -447,7 +418,7 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan final Element childElement = (Element) propChildNodes.item(index); // find bpelVariable for (PropertyVariable var : propMap.getNodePropertyVariables(serviceTemplate, - templatePlan.getNodeTemplate())) { + templatePlan.getNodeTemplate())) { if (var.getPropertyName().equals(childElement.getLocalName())) { element2BpelVarNameMap.put(childElement, var.getVariableName()); } @@ -462,12 +433,10 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan assignPropertiesToVariables = templatePlan.getBpelDocument().importNode(assignPropertiesToVariables, true); plan.getBpelMainFlowElement().getParentNode().insertBefore(assignPropertiesToVariables, - plan.getBpelMainFlowElement()); - } - catch (final IOException e) { + plan.getBpelMainFlowElement()); + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } } @@ -479,7 +448,7 @@ public boolean appendInitPropertyVariablesFromServiceInstanceData(final BPELPlan String serviceTemplateUrlVarName, AbstractServiceTemplate serviceTemplate, String query) { return this.appendInitPropertyVariablesFromServiceInstanceData(plan, propMap, serviceTemplateUrlVarName, - plan.getTemplateBuildPlans(), serviceTemplate, query); + plan.getTemplateBuildPlans(), serviceTemplate, query); } private void addAssignServiceTemplateURLVariable(final BPELPlan plan, String serviceInstancesUrlVarName, @@ -497,12 +466,10 @@ private void addAssignServiceTemplateURLVariable(final BPELPlan plan, String ser + System.currentTimeMillis(), xpath2Query, serviceTemplateUrlVariableName); assignFragment = plan.getBpelDocument().importNode(assignFragment, true); appendToInitSequence(assignFragment, plan); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -525,12 +492,10 @@ private void addAssignManagementPlanInstanceUrlVariable(final BPELPlan plan, Str + System.currentTimeMillis(), xpath2Query, planInstanceUrlVarName); assignFragment = plan.getBpelDocument().importNode(assignFragment, true); appendToInitSequence(assignFragment, plan); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -546,30 +511,26 @@ private void addAssignOutputWithServiceInstanceId(final BPELPlan plan, String se try { Node copyNode = this.fragments.generateCopyFromStringVarToOutputVariableAsNode(serviceInstanceVarName, "output", - "payload", "instanceId"); + "payload", "instanceId"); copyNode = plan.getBpelDocument().importNode(copyNode, true); plan.getBpelMainSequenceOutputAssignElement().appendChild(copyNode); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } - } /** - * Generates code to create service instance at the instance data api based on the given plan with - * the referenced service instance variables - * - * @param plan the plan to add the code to + * Generates code to create service instance at the instance data api based on the given plan with the referenced + * service instance variables + * + * @param plan the plan to add the code to * @param instanceDataAPIUrlVarName the variable storing the url to the instance data api * @param serviceInstanceUrlVarName the variable for storing the serviceInstanceUrl - * @param serviceInstanceIdVarName the variable for storing the serviceInstanceId + * @param serviceInstanceIdVarName the variable for storing the serviceInstanceId * @param serviceTemplateUrlVarName the variable for storing the serviceTemplateUrl - * @param planInstanceUrlVarName the variable for storing the planinstanceUrl - * @return + * @param planInstanceUrlVarName the variable for storing the planinstanceUrl */ private void appendServiceInstanceInitCode(final BPELPlan plan, final String instanceDataAPIUrlVarName, String serviceInstanceUrlVarName, String serviceInstanceIdVarName, @@ -584,15 +545,13 @@ private void appendServiceInstanceInitCode(final BPELPlan plan, final String ins new QName("http://www.w3.org/2001/XMLSchema", "anyType", "xsd" + System.currentTimeMillis()); try { - final File schemaFile = this.fragments.getOpenTOSCAAPISchemaFile(); + final Path schemaFile = this.fragments.getOpenTOSCAAPISchemaFile(); final QName correlationIdElementSchemaQname = this.fragments.getOpenToscaApiCorrelationElementQname(); this.bpelProcessHandler.addImportedFile(schemaFile, plan); this.bpelProcessHandler.addImportToBpel(correlationIdElementSchemaQname.getNamespaceURI(), - schemaFile.getAbsolutePath(), "http://www.w3.org/2001/XMLSchema", - plan); - - } - catch (final IOException e2) { + schemaFile.toAbsolutePath().toString(), "http://www.w3.org/2001/XMLSchema", + plan); + } catch (final IOException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } @@ -605,35 +564,33 @@ private void appendServiceInstanceInitCode(final BPELPlan plan, final String ins requestVariableQName = this.bpelProcessHandler.importNamespace(requestVariableQName, plan); this.bpelProcessHandler.addNamespaceToBPELDoc(responseVariableQName.getPrefix(), - responseVariableQName.getNamespaceURI(), plan); + responseVariableQName.getNamespaceURI(), plan); this.bpelProcessHandler.addNamespaceToBPELDoc(requestVariableQName.getPrefix(), - requestVariableQName.getNamespaceURI(), plan); + requestVariableQName.getNamespaceURI(), plan); - final String restCallResponseVarName = "bpel4restlightVarResponse_appendServiceInstanceInit" + System.currentTimeMillis(); + final String restCallResponseVarName = "bpel4restlightVarResponse" + System.currentTimeMillis(); if (!this.bpelProcessHandler.addVariable(restCallResponseVarName, BPELPlan.VariableType.TYPE, - responseVariableQName, plan)) { + responseVariableQName, plan)) { throw new RuntimeException("Couldn't create REST response variable"); } - final String restCallRequestVarName = "bpel4restlightVarRequest_appendServiceInstanceInit" + System.currentTimeMillis(); + final String restCallRequestVarName = "bpel4restlightVarRequest" + System.currentTimeMillis(); if (!this.bpelProcessHandler.addVariable(restCallRequestVarName, BPELPlan.VariableType.ELEMENT, - requestVariableQName, plan)) { + requestVariableQName, plan)) { throw new RuntimeException("Couldn't create REST request variable"); } try { Node assignRestRequestNode = this.fragments.generateServiceInstanceRequestMessageAssignAsNode("CorrelationID", - restCallRequestVarName); + restCallRequestVarName); assignRestRequestNode = plan.getBpelDocument().importNode(assignRestRequestNode, true); appendToInitSequence(assignRestRequestNode, plan); - } - catch (final IOException e1) { + } catch (final IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); - } - catch (final SAXException e1) { + } catch (final SAXException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } @@ -641,15 +598,13 @@ private void appendServiceInstanceInitCode(final BPELPlan plan, final String ins try { Node serviceInstancePOSTNode = this.fragments.generateBPEL4RESTLightServiceInstancePOSTAsNode(instanceDataAPIUrlVarName, - restCallRequestVarName, - restCallResponseVarName); + restCallRequestVarName, + restCallResponseVarName); serviceInstancePOSTNode = plan.getBpelDocument().importNode(serviceInstancePOSTNode, true); appendToInitSequence(serviceInstancePOSTNode, plan); - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); } @@ -679,41 +634,39 @@ private void appendServiceInstanceInitCode(final BPELPlan plan, final String ins this.bpelProcessHandler.addGlobalStringVariable("ServiceInstanceCorrelationID", plan); Node assignCorr = this.fragments.generateAssignFromInputMessageToStringVariableAsNode("CorrelationID", - serviceInstanceCorrelationIdVarName); + serviceInstanceCorrelationIdVarName); assignCorr = plan.getBpelDocument().importNode(assignCorr, true); appendToInitSequence(assignCorr, plan); Node serviceInstanceURLAssignNode = null; if (isManagementPlan) { serviceInstanceURLAssignNode = this.fragments.generateServiceInstanceDataVarsAssignForManagementPlansAsNode(restCallResponseVarName, - serviceInstanceUrlVarName, - instanceDataAPIUrlVarName, - serviceInstanceIdVarName, - serviceTemplateUrlVarName, - serviceInstanceCorrelationIdVarName, - planName, - planInstanceUrlVarName); + serviceInstanceUrlVarName, + instanceDataAPIUrlVarName, + serviceInstanceIdVarName, + serviceTemplateUrlVarName, + serviceInstanceCorrelationIdVarName, + planName, + planInstanceUrlVarName); serviceInstanceURLAssignNode = plan.getBpelDocument().importNode(serviceInstanceURLAssignNode, true); } else { serviceInstanceURLAssignNode = this.fragments.generateServiceInstanceDataVarsAssignForBuildPlansAsNode(restCallResponseVarName, - serviceInstanceUrlVarName, - instanceDataAPIUrlVarName, - serviceInstanceIdVarName, - serviceTemplateUrlVarName, - serviceInstanceCorrelationIdVarName, - planName, - planInstanceUrlVarName); + serviceInstanceUrlVarName, + instanceDataAPIUrlVarName, + serviceInstanceIdVarName, + serviceTemplateUrlVarName, + serviceInstanceCorrelationIdVarName, + planName, + planInstanceUrlVarName); serviceInstanceURLAssignNode = plan.getBpelDocument().importNode(serviceInstanceURLAssignNode, true); } appendToInitSequence(serviceInstanceURLAssignNode, plan); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -728,28 +681,22 @@ public void initServiceInstancesURLVariableFromAvailableServiceInstanceUrlVar(BP + "),'csars'),'csars/','" + csarName + "','/servicetemplates/','" + URLEncoder.encode(URLEncoder.encode(serviceTemplateId.toString())) + "','/instances')"; try { - - Node assignServiceInstancesUrl = this.fragments.createAssignVarToVarWithXpathQueryAsNode("createTargetServiceInstancesUrl", - availableServiceInstanceUrlVar, - targetServiceInstancesUrlVar, xpathQuery1); + availableServiceInstanceUrlVar, + targetServiceInstancesUrlVar, xpathQuery1); // this.fragments.createAssignVarToVarWithXpathQueriesAsNode( // "createTargetServiceInstancesUrl", availableServiceInstanceUrlVar, null, // targetServiceInstanceUrlVar, null, xpathQuery1, xpathQuery2, // "Create ServiceInstancesURL for the target", null); assignServiceInstancesUrl = plan.getBpelDocument().importNode(assignServiceInstancesUrl, true); appendToInitSequence(assignServiceInstancesUrl, plan); - } - catch (IOException e) { + } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (SAXException e) { + } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } - } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/SituationTriggerRegistration.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/SituationTriggerRegistration.java similarity index 83% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/SituationTriggerRegistration.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/SituationTriggerRegistration.java index 574d10f3b..78cb82045 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/SituationTriggerRegistration.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/SituationTriggerRegistration.java @@ -178,7 +178,6 @@ public void setInputParameters(final List> input private final BPELPlanHandler handler; private SimplePlanBuilderServiceInstanceHandler serviceInstanceHandler; - public SituationTriggerRegistration() throws ParserConfigurationException { this.fragments = new BPELProcessFragments(); this.handler = new BPELPlanHandler(); @@ -211,13 +210,11 @@ public boolean handle(final AbstractServiceTemplate serviceTemplate, final BPELP final String situationIdVarName = this.handler.addGlobalStringVariable("SituationId_" + i + "_var", plan); appendAssignSituationIdFromInputToSituationIdVar(plan, inputName, i, situationIdVarName, - plan.getBpelMainFlowElement()); + plan.getBpelMainFlowElement()); situationIdVarNames.add(situationIdVarName); } else { // TODO Add Selection of SituationId } - - } // TODO set serviceInstanceId @@ -225,10 +222,9 @@ public boolean handle(final AbstractServiceTemplate serviceTemplate, final BPELP // fetch serviceInstance from buildPlan final String serviceInstanceIdVar = this.serviceInstanceHandler.findServiceInstanceIdVarName(plan); appendAssignServiceInstanceIdFromServiceInstanceIdVar(plan, serviceInstanceIdVar, varName, - plan.getBpelMainFlowElement()); + plan.getBpelMainFlowElement()); } - // optional TODO set nodeInstance selection // create REST call @@ -240,29 +236,25 @@ public boolean handle(final AbstractServiceTemplate serviceTemplate, final BPELP final String situationsAPIVar = this.handler.addGlobalStringVariable(situationsAPIVarName, plan); appendAssignSituationsAPIURLVar(plan, "input", "payload", situationsAPI, situationsAPIVar, - plan.getBpelMainFlowElement()); + plan.getBpelMainFlowElement()); final String stringReqVar = this.handler.addGlobalStringVariable("situationRegistrationStringVar" + System.currentTimeMillis(), - plan); + plan); appendAssignTransformXmltoString(plan, varName, stringReqVar, plan.getBpelMainFlowElement(), "SituationTrigger"); appendAssignRESTPOST(plan, situationsAPIVar, stringReqVar, - this.handler.addGlobalStringVariable("SituationRegistrationResponse", plan), - plan.getBpelMainFlowElement()); + this.handler.addGlobalStringVariable("SituationRegistrationResponse", plan), + plan.getBpelMainFlowElement()); } - - } - catch (final XPathExpressionException e) { + } catch (final XPathExpressionException e) { e.printStackTrace(); return false; - } - catch (final IOException e) { + } catch (final IOException e) { e.printStackTrace(); return false; - } - catch (final SAXException e) { + } catch (final SAXException e) { e.printStackTrace(); return false; } @@ -271,18 +263,18 @@ public boolean handle(final AbstractServiceTemplate serviceTemplate, final BPELP } public void appendAssignTransformXmltoString(final BPELPlan plan, final String xmlVar, final String stringVar, - final Element elementToAppendBefore, String rootElementName) throws IOException, - SAXException { - final String xpathQuery1 = "ode:dom-to-string(\\$" + xmlVar + "/*[local-name()='"+rootElementName+ "'])"; + final Element elementToAppendBefore, String rootElementName) throws IOException, + SAXException { + final String xpathQuery1 = "ode:dom-to-string(\\$" + xmlVar + "/*[local-name()='" + rootElementName + "'])"; final String xpathQuery2 = "\\$" + stringVar; Node assign = this.fragments.createAssignVarToVarWithXpathQueriesAsNode("transformXMLtoStringVar", xmlVar, null, - stringVar, null, xpathQuery1, xpathQuery2, - "Transforms one xml var to a string var as ODE sets a an xml element as wrapper around complex type when using the rest extension.", - new QName( - "http://www.apache.org/ode/type/extension", - "ode", "ode")); + stringVar, null, xpathQuery1, xpathQuery2, + "Transforms one xml var to a string var as ODE sets a an xml element as wrapper around complex type when using the rest extension.", + new QName( + "http://www.apache.org/ode/type/extension", + "ode", "ode")); assign = this.handler.importNode(plan, assign); elementToAppendBefore.getParentNode().insertBefore(assign, elementToAppendBefore); } @@ -304,30 +296,28 @@ private void appendAssignSituationsAPIURLVar(final BPELPlan plan, final String v final String xpathQuery2 = "\\$" + situationsAPIVarName; Node assign = this.fragments.createAssignVarToVarWithXpathQueriesAsNode("AssignSituationsAPIUrl", varName, partName, - situationsAPIVarName, null, xpathQuery1, - xpathQuery2, - "Assigns the SituationsAPIURL from Input to the designated Variable", - null); + situationsAPIVarName, null, xpathQuery1, + xpathQuery2, + "Assigns the SituationsAPIURL from Input to the designated Variable", + null); assign = this.handler.importNode(plan, assign); elementToAppendBefore.getParentNode().insertBefore(assign, elementToAppendBefore); - - } private void appendAssignServiceInstanceIdFromServiceInstanceIdVar(final BPELPlan plan, final String serviceInstanceIdVarName, final String situationTriggerReqVarName, final Element elementToAppendBefore) throws IOException, - SAXException { + SAXException { final String xpathQuery1 = "text()"; final String xpathQuery2 = "//*[local-name()='ServiceInstanceId']"; Node assign = this.fragments.createAssignVarToVarWithXpathQueriesAsNode("assignSituationTriggerReqWithServiceInstanceID", - serviceInstanceIdVarName, null, - situationTriggerReqVarName, null, xpathQuery1, - xpathQuery2, - "Assign the ServiceInstanceID of SituationTrigger Request from ServiceInstanceID inside this BuildPlan", - null); + serviceInstanceIdVarName, null, + situationTriggerReqVarName, null, xpathQuery1, + xpathQuery2, + "Assign the ServiceInstanceID of SituationTrigger Request from ServiceInstanceID inside this BuildPlan", + null); assign = this.handler.importNode(plan, assign); elementToAppendBefore.getParentNode().insertBefore(assign, elementToAppendBefore); @@ -336,22 +326,20 @@ private void appendAssignServiceInstanceIdFromServiceInstanceIdVar(final BPELPla private void appendAssignSituationIdFromInputToSituationIdVar(final BPELPlan plan, final String inputFieldName, final int situationIndex, final String varName, final Element elementToAppendBefore) throws IOException, - SAXException { + SAXException { final String xpathQuery1 = "//*[local-name()='" + inputFieldName + "']/text()"; final String xpathQuery2 = "text()"; Node assignNode = this.fragments.createAssignVarToVarWithXpathQueriesAsNode("AssignSituationIdFromInputToVar", "input", - "payload", varName, null, xpathQuery1, - xpathQuery2, - "Assigning the SituationId of a SituationTrigger based on the input variable to situationId Variable", - null); - + "payload", varName, null, xpathQuery1, + xpathQuery2, + "Assigning the SituationId of a SituationTrigger based on the input variable to situationId Variable", + null); assignNode = this.handler.importNode(plan, assignNode); elementToAppendBefore.getParentNode().insertBefore(assignNode, elementToAppendBefore); - } private void appendAssignSituationidFromInput(final BPELPlan plan, final String inputFieldName, @@ -364,16 +352,14 @@ private void appendAssignSituationidFromInput(final BPELPlan plan, final String Node assignNode = this.fragments.createAssignVarToVarWithXpathQueriesAsNode("AssignSituationIdFromInput", "input", "payload", - situationTriggerRequestVar, null, xpathQuery1, - xpathQuery2, - "Assigning the SituationId of a SituationTrigger based on the input variable", - null); - + situationTriggerRequestVar, null, xpathQuery1, + xpathQuery2, + "Assigning the SituationId of a SituationTrigger based on the input variable", + null); assignNode = this.handler.importNode(plan, assignNode); elementToAppendBefore.getParentNode().insertBefore(assignNode, elementToAppendBefore); - } private void appendAssignLiteralVariable(final BPELPlan plan, final String xmlLiteral, final String varName, @@ -381,13 +367,11 @@ private void appendAssignLiteralVariable(final BPELPlan plan, final String xmlLi final QName anyDecl = new QName("http://www.w3.org/2001/XMLSchema", "anyType", "xsd"); this.handler.importNamespace(anyDecl, plan); - - this.handler.addVariable(varName, VariableType.TYPE, anyDecl, plan); Node node = this.fragments.createAssignVarWithLiteralAsNode(xmlLiteral, varName, - "Appending the initial xml body of a situationtrigger which will be used for registering such a trigger"); + "Appending the initial xml body of a situationtrigger which will be used for registering such a trigger"); node = this.handler.importNode(plan, node); elementToAppendBefore.getParentNode().insertBefore(node, elementToAppendBefore); @@ -443,8 +427,7 @@ public boolean canHandle(final AbstractServiceTemplate serviceTemplate, final BP List triggers = new ArrayList<>(); try { triggers = parseSituationTriggers(serviceTemplate); - } - catch (final XPathExpressionException e) { + } catch (final XPathExpressionException e) { e.printStackTrace(); } @@ -487,7 +470,7 @@ private Element getPropertiesSafely(final AbstractServiceTemplate serviceTemplat if (serviceTemplate.getBoundaryDefinitions().getProperties() != null) { if (serviceTemplate.getBoundaryDefinitions().getProperties().getProperties() != null) { if (serviceTemplate.getBoundaryDefinitions().getProperties().getProperties() - .getDOMElement() != null) { + .getDOMElement() != null) { return serviceTemplate.getBoundaryDefinitions().getProperties().getProperties().getDOMElement(); } } @@ -519,31 +502,30 @@ private SituationTrigger parseSituationTrigger(final Element situationTriggerEle final String onActivation = getNodeContent(queryNodeSet(situationTriggerElement, - SituationTrigger.xpath_query_situationtrigger_onActivation).item(0)); + SituationTrigger.xpath_query_situationtrigger_onActivation).item(0)); final String isSingleInstance = getNodeContent(queryNodeSet(situationTriggerElement, - SituationTrigger.xpath_query_situationtrigger_isSingleInstance).item(0)); + SituationTrigger.xpath_query_situationtrigger_isSingleInstance).item(0)); final String serviceInstanceId = getNodeContent(queryNodeSet(situationTriggerElement, - SituationTrigger.xpath_query_situationtrigger_serviceInstanceId).item(0)); + SituationTrigger.xpath_query_situationtrigger_serviceInstanceId).item(0)); NodeList nodeInstanceIdList = null; if ((nodeInstanceIdList = queryNodeSet(situationTriggerElement, - SituationTrigger.xpath_query_situationtrigger_nodeInstanceId)).getLength() != 0) { + SituationTrigger.xpath_query_situationtrigger_nodeInstanceId)).getLength() != 0) { final String nodeInstanceId = getNodeContent(nodeInstanceIdList.item(0)); trigger.setNodeInstanceId(nodeInstanceId); } final String interfaceName = getNodeContent(queryNodeSet(situationTriggerElement, - SituationTrigger.xpath_query_situationtrigger_interfaceName).item(0)); + SituationTrigger.xpath_query_situationtrigger_interfaceName).item(0)); final String operationName = getNodeContent(queryNodeSet(situationTriggerElement, - SituationTrigger.xpath_query_situationtrigger_operationName).item(0)); + SituationTrigger.xpath_query_situationtrigger_operationName).item(0)); final List> inputParameters = parseParameters(situationTriggerElement, SituationTrigger.xpath_query_situationtrigger_inputParameters); - trigger.setSituations(situations); trigger.setOnActivation(Boolean.valueOf(onActivation)); trigger.setSingelInstance(Boolean.valueOf(isSingleInstance)); @@ -570,8 +552,6 @@ private List> parseParameters(final Element situ getNodeContent(queryNodeSet(parameterNodes.item(i), "//*[local-name()='Type']").item(0)); parameters.add(new Triplet<>(name, val, type)); } - - return parameters; } @@ -582,10 +562,10 @@ private List parseSituations(final NodeList situationElements) throws final Element situationElement = (Element) situationElements.item(i); final String situationTemplateId = getNodeContent(queryNodeSet(situationElement, - SituationTrigger.xpath_query_situations_situationTemplateId).item(0)); + SituationTrigger.xpath_query_situations_situationTemplateId).item(0)); final String thingId = getNodeContent(queryNodeSet(situationElement, - SituationTrigger.xpath_query_situations_thingId).item(0)); + SituationTrigger.xpath_query_situations_thingId).item(0)); situations.add(new Situation(situationTemplateId, thingId, Boolean.valueOf(situationElement.getAttribute("fromInput")))); } @@ -597,6 +577,4 @@ private List parseSituations(final NodeList situationElements) throws private String getNodeContent(final Node node) { return node.getTextContent(); } - - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/TOSCAManagementInfrastructureNodeTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/TOSCAManagementInfrastructureNodeTemplate.java similarity index 96% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/TOSCAManagementInfrastructureNodeTemplate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/TOSCAManagementInfrastructureNodeTemplate.java index 6a07a15bd..7082c3d2d 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/TOSCAManagementInfrastructureNodeTemplate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/TOSCAManagementInfrastructureNodeTemplate.java @@ -23,7 +23,6 @@ * This class represents the TOSCA Management Infrastructure as a NodeTemplate. * * @author kalman.kepes@iaas.uni-stuttgart.de - * */ public class TOSCAManagementInfrastructureNodeTemplate extends AbstractNodeTemplate { @@ -183,5 +182,4 @@ public int getMinInstances() { public List getPolicies() { return new ArrayList<>(); } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/TransformationPlanBuilderServiceInstanceHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/TransformationPlanBuilderServiceInstanceHandler.java similarity index 99% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/TransformationPlanBuilderServiceInstanceHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/TransformationPlanBuilderServiceInstanceHandler.java index 32e8a263c..983d32a12 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/tosca/handlers/TransformationPlanBuilderServiceInstanceHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/tosca/handlers/TransformationPlanBuilderServiceInstanceHandler.java @@ -8,5 +8,4 @@ public TransformationPlanBuilderServiceInstanceHandler() throws ParserConfigurat super(); // TODO Auto-generated constructor stub } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasednodehandler/BPELPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasednodehandler/BPELPluginHandler.java similarity index 87% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasednodehandler/BPELPluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasednodehandler/BPELPluginHandler.java index 791030a84..b4392c721 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasednodehandler/BPELPluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasednodehandler/BPELPluginHandler.java @@ -5,26 +5,35 @@ import java.util.List; import java.util.Map; +import javax.inject.Inject; + import org.opentosca.container.core.tosca.convention.Interfaces; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPrePhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.plugins.registry.PluginRegistry; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +@Component public class BPELPluginHandler { - final static Logger LOG = LoggerFactory.getLogger(BPELPluginHandler.class); - protected final PluginRegistry pluginRegistry = new PluginRegistry(); + private static final Logger LOG = LoggerFactory.getLogger(BPELPluginHandler.class); + private final PluginRegistry pluginRegistry; + + @Inject + public BPELPluginHandler(PluginRegistry pluginRegistry) { + this.pluginRegistry = pluginRegistry; + } public boolean handleActivity(final BPELPlanContext context, final BPELScope bpelScope, final AbstractNodeTemplate nodeTemplate) { @@ -64,22 +73,16 @@ public boolean handleActivity(final BPELPlanContext context, final BPELScope bpe return result; } - private boolean handleTerminationActivity(final BPELPlanContext context, final BPELScope bpelScope, final AbstractRelationshipTemplate relationshipTemplate) { boolean result = true; - - // generate code for the termination, e.g., call install, start or create - // methods + // generate code for the termination, e.g., call install, start or create methods final IPlanBuilderTypePlugin plugin = this.pluginRegistry.findTypePluginForTermination(relationshipTemplate); if (plugin != null) { - LOG.info("Handling RelationshipTemplate {} with type plugin {}", relationshipTemplate.getId(), - plugin.getID()); + LOG.info("Handling RelationshipTemplate {} with type plugin {}", relationshipTemplate.getId(), plugin.getID()); result &= plugin.handleTerminate(context, relationshipTemplate); - } else { - LOG.info("Couldn't handle RelationshipTemplate {} with type plugin", relationshipTemplate.getId()); - + LOG.warn("Couldn't handle RelationshipTemplate {} with type plugin", relationshipTemplate.getId()); } for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { @@ -91,7 +94,6 @@ private boolean handleTerminationActivity(final BPELPlanContext context, final B return result; } - private boolean handleTerminationActivity(final BPELPlanContext context, final BPELScope bpelScope, final AbstractNodeTemplate nodeTemplate) { boolean result = true; @@ -102,10 +104,8 @@ private boolean handleTerminationActivity(final BPELPlanContext context, final B if (plugin != null) { LOG.info("Handling NodeTemplate {} with type plugin {}", nodeTemplate.getId(), plugin.getID()); result &= plugin.handleTerminate(context, nodeTemplate); - } else { - LOG.info("Couldn't handle NodeTemplate {} with type plugin", nodeTemplate.getId()); - + LOG.warn("Couldn't handle NodeTemplate {} with type plugin", nodeTemplate.getId()); } for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { @@ -134,7 +134,7 @@ private boolean handleProvisioningActivity(final BPELPlanContext context, final if (plugin != null) { LOG.info("Handling NodeTemplate {} with type plugin {}", nodeTemplate.getId(), plugin.getID()); result &= plugin.handleCreate(context, nodeTemplate); - } else { + } else { LOG.info("Couldn't handle NodeTemplate {} with type plugin", nodeTemplate.getId()); } @@ -180,7 +180,7 @@ private boolean handleDefrostActivity(final BPELPlanContext context, final BPELS final AbstractOperation defrostOp = ModelUtils.getOperationOfNode(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_DEFREEZE); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_DEFREEZE); // generate code for the pre handling, e.g., upload DAs for (final IPlanBuilderPrePhasePlugin prePlugin : this.pluginRegistry.getPrePlugins()) { @@ -193,7 +193,8 @@ private boolean handleDefrostActivity(final BPELPlanContext context, final BPELS LOG.debug("Defrost on NodeTemplate {} needs the following input parameters:", nodeTemplate.getName()); for (final AbstractParameter param : defrostOp.getInputParameters()) { LOG.debug("Input param: {}", param.getName()); - found: for (final AbstractNodeTemplate nodeForMatching : nodesForMatching) { + found: + for (final AbstractNodeTemplate nodeForMatching : nodesForMatching) { for (final String propName : ModelUtils.getPropertyNames(nodeForMatching)) { if (param.getName().equals(propName)) { param2propertyMapping.put(param, context.getPropertyVariable(nodeForMatching, propName)); @@ -203,16 +204,16 @@ private boolean handleDefrostActivity(final BPELPlanContext context, final BPELS } } LOG.debug("Found {} of {} input parameters.", param2propertyMapping.size(), - defrostOp.getInputParameters().size()); + defrostOp.getInputParameters().size()); result &= context.executeOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_DEFREEZE, - param2propertyMapping, null); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_DEFREEZE, + param2propertyMapping, null); // generate code the post handling, e.g., update instance data, logs etc. for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { LOG.info("Checking if post plugin {} is suited for handling {}", postPhasePlugin.getID(), - nodeTemplate.getName()); + nodeTemplate.getName()); if (postPhasePlugin.canHandleCreate(context, bpelScope.getNodeTemplate())) { LOG.info("Handling NodeTemplate {} with post plugin {}", nodeTemplate.getId(), postPhasePlugin.getID()); result &= postPhasePlugin.handleCreate(context, bpelScope.getNodeTemplate()); diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBackupManagementProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBackupManagementProcessBuilder.java new file mode 100644 index 000000000..5e553aee4 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBackupManagementProcessBuilder.java @@ -0,0 +1,359 @@ +package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; + +import java.io.IOException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.tosca.convention.Interfaces; +import org.opentosca.planbuilder.core.AbstractManagementFeaturePlanBuilder; +import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; +import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; +import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; +import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.model.plan.AbstractPlan; +import org.opentosca.planbuilder.model.plan.ActivityType; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELScope; +import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; +import org.opentosca.planbuilder.model.tosca.AbstractParameter; +import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +/** + *

    + * This process builder creates a backup management plan if one of the NodeTemplates in the topology is of a type that + * defines the freeze interface. + *

    + *

    + * Copyright 2019 IAAS University of Stuttgart
    + *
    + */ +public class BPELBackupManagementProcessBuilder extends AbstractManagementFeaturePlanBuilder { + + private final static Logger LOG = LoggerFactory.getLogger(BPELBackupManagementProcessBuilder.class); + // class for initializing properties inside the build plan + private final PropertyVariableHandler propertyInitializer; + // class for finalizing build plans (e.g when some template didn't receive + // some provisioning logic and they must be filled with empty elements) + private final BPELFinalizer finalizer; + // handler for abstract buildplan operations + public BPELPlanHandler planHandler; + // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans + private SimplePlanBuilderServiceInstanceHandler serviceInstanceVarsHandler; + // adds nodeInstanceIDs to each templatePlan + private NodeRelationInstanceVariablesHandler instanceVarsHandler; + private BPELProcessFragments bpelFragments; + + private CorrelationIDInitializer correlationHandler; + + /** + *

    + * Default Constructor + *

    + */ + public BPELBackupManagementProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + try { + this.planHandler = new BPELPlanHandler(); + this.serviceInstanceVarsHandler = new SimplePlanBuilderServiceInstanceHandler(); + this.instanceVarsHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); + this.bpelFragments = new BPELProcessFragments(); + this.correlationHandler = new CorrelationIDInitializer(); + } catch (final ParserConfigurationException e) { + LOG.error("Error while initializing BuildPlanHandler", e); + } + this.propertyInitializer = new PropertyVariableHandler(this.planHandler); + this.finalizer = new BPELFinalizer(); + } + + /* + * (non-Javadoc) + * + * @see org.opentosca.planbuilder.IPlanBuilder#buildPlan(java.lang.String, + * org.opentosca.planbuilder.model.tosca.AbstractDefinitions, javax.xml.namespace.QName) + */ + @Override + public BPELPlan buildPlan(final String csarName, final AbstractDefinitions definitions, + final AbstractServiceTemplate serviceTemplate) { + LOG.debug("Creating Backup Management Plan..."); + + if (Objects.isNull(serviceTemplate)) { + LOG.error("Unable to generate Backup Plan with ServiceTempolate equal to null."); + return null; + } + + final String processName = ModelUtils.makeValidNCName(serviceTemplate.getId() + "_backupManagementPlan"); + final String processNamespace = serviceTemplate.getTargetNamespace() + "_backupManagementPlan"; + + final AbstractPlan abstractBackupPlan = + generateMOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, ActivityType.BACKUP, true); + + LOG.debug("Generated the following abstract backup plan: "); + LOG.debug(abstractBackupPlan.toString()); + + abstractBackupPlan.setType(PlanType.MANAGEMENT); + final BPELPlan newBackupPlan = + this.planHandler.createEmptyBPELPlan(processNamespace, processName, abstractBackupPlan, "backup"); + + this.planHandler.initializeBPELSkeleton(newBackupPlan, csarName); + + newBackupPlan.setTOSCAInterfaceName("OpenTOSCA-Management-Feature-Interface"); + newBackupPlan.setTOSCAOperationname("backup"); + + this.instanceVarsHandler.addInstanceURLVarToTemplatePlans(newBackupPlan, serviceTemplate); + this.instanceVarsHandler.addInstanceIDVarToTemplatePlans(newBackupPlan, serviceTemplate); + + final Property2VariableMapping propMap = + this.propertyInitializer.initializePropertiesAsVariables(newBackupPlan, serviceTemplate); + + // initialize instanceData handling + this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, + newBackupPlan); + this.serviceInstanceVarsHandler.addServiceInstanceHandlingFromInput(newBackupPlan); + + final String serviceTemplateURLVarName = + this.serviceInstanceVarsHandler.getServiceTemplateURLVariableName(newBackupPlan); + + this.serviceInstanceVarsHandler.appendInitPropertyVariablesFromServiceInstanceData(newBackupPlan, propMap, + serviceTemplateURLVarName, + serviceTemplate, null); + + // fetch all node instances that are running + this.instanceVarsHandler.addNodeInstanceFindLogic(newBackupPlan, + "?state=STARTED&state=CREATED&state=CONFIGURED", + serviceTemplate); + this.instanceVarsHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(newBackupPlan, propMap, + serviceTemplate); + + try { + appendGenerateStatefulServiceTemplateLogic(newBackupPlan); + } catch (final IOException e) { + e.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } + + runPlugins(newBackupPlan, propMap, csarName); + + this.correlationHandler.addCorrellationID(newBackupPlan); + + this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newBackupPlan, + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newBackupPlan), + "ERROR", + this.serviceInstanceVarsHandler.findServiceInstanceUrlVariableName(newBackupPlan)); + this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newBackupPlan, + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newBackupPlan), + "FAILED", + this.serviceInstanceVarsHandler.findPlanInstanceUrlVariableName(newBackupPlan)); + + String planInstanceUrlVarName = this.serviceInstanceVarsHandler.findPlanInstanceUrlVariableName(newBackupPlan); + this.serviceInstanceVarsHandler.appendSetServiceInstanceState(newBackupPlan, + newBackupPlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceVarsHandler.appendSetServiceInstanceState(newBackupPlan, + newBackupPlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + + this.finalizer.finalize(newBackupPlan); + + LOG.debug("Created Plan:"); + LOG.debug(ModelUtils.getStringFromDoc(newBackupPlan.getBpelDocument())); + + return newBackupPlan; + } + + private void runPlugins(final BPELPlan plan, final Property2VariableMapping propMap, final String csarName) { + + final String statefulServiceTemplateUrlVarName = findStatefulServiceTemplateUrlVar(plan); + + final String serviceInstanceUrl = this.serviceInstanceVarsHandler.findServiceInstanceUrlVariableName(plan); + final String serviceInstanceId = this.serviceInstanceVarsHandler.findServiceInstanceIdVarName(plan); + final String serviceTemplateUrl = this.serviceInstanceVarsHandler.findServiceTemplateUrlVariableName(plan); + + for (final BPELScope templatePlan : plan.getTemplateBuildPlans()) { + final BPELPlanContext context = new BPELPlanContext(new BPELScopeBuilder(pluginRegistry), plan, templatePlan, propMap, plan.getServiceTemplate(), + serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); + + // only handle NodeTemplates of type with save state interface + final AbstractNodeTemplate nodeTemplate = templatePlan.getNodeTemplate(); + if (Objects.nonNull(nodeTemplate) + && Objects.nonNull(ModelUtils.getInterfaceOfNode(nodeTemplate, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE))) { + LOG.debug("Adding backup logic for NodeTemplate {}", nodeTemplate.getName()); + + final String saveStateUrlVarName = + this.planHandler.addGlobalStringVariable("nodeTemplateStateSaveURL", plan); + + final String xpathQuery = "concat($" + statefulServiceTemplateUrlVarName + + ",'/topologytemplate/nodetemplates/" + nodeTemplate.getId() + "/state')"; + try { + Node assignSaveStateURL = + this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignNodeTemplate" + + nodeTemplate.getId() + "state" + System.currentTimeMillis(), + statefulServiceTemplateUrlVarName, + saveStateUrlVarName, xpathQuery); + assignSaveStateURL = context.importNode(assignSaveStateURL); + context.getPrePhaseElement().appendChild(assignSaveStateURL); + } catch (final IOException e) { + e.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } + + final AbstractOperation freezeOp = + ModelUtils.getOperationOfNode(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE); + if (Objects.nonNull(freezeOp)) { + final Variable saveStateUrlVar = BPELPlanContext.getVariable(saveStateUrlVarName); + + final Map inputs = new HashMap<>(); + + // retrieve input parameters from all nodes which are downwards in the same topology stack + final List nodesForMatching = new ArrayList<>(); + ModelUtils.getNodesFromNodeToSink(nodeTemplate, nodesForMatching); + + LOG.debug("Backup on NodeTemplate {} needs the following input parameters:", + nodeTemplate.getName()); + for (final AbstractParameter param : freezeOp.getInputParameters()) { + LOG.debug("Input param: {}", param.getName()); + found: + for (final AbstractNodeTemplate nodeForMatching : nodesForMatching) { + for (final String propName : ModelUtils.getPropertyNames(nodeForMatching)) { + if (param.getName().equals(propName)) { + inputs.put(param, context.getPropertyVariable(nodeForMatching, propName)); + break found; + } + } + } + } + + // add special parameter with winery URL + inputs.put(getSaveStateParameter(freezeOp), saveStateUrlVar); + + LOG.debug("Found {} of {} input parameters.", inputs.size(), freezeOp.getInputParameters().size()); + + context.executeOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE, inputs); + } + } + } + } + + @Override + public List buildPlans(final String csarName, final AbstractDefinitions definitions) { + LOG.info("Building the Backup Management Plans"); + final List plans = new ArrayList<>(); + for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { + + if (containsManagementInterface(serviceTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE)) { + LOG.debug("ServiceTemplate {} contains NodeTypes with defined backup interface.", + serviceTemplate.getName()); + final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); + if (Objects.nonNull(newBuildPlan)) { + LOG.debug("Created Backup Management Plan " + + newBuildPlan.getBpelProcessElement().getAttribute("name")); + plans.add(newBuildPlan); + } + } else { + LOG.debug("No backup interface defined in ServiceTemplate {}", serviceTemplate.getName()); + } + } + return plans; + } + + private void appendGenerateStatefulServiceTemplateLogic(final BPELPlan plan) throws IOException, SAXException { + final QName serviceTemplateId = plan.getServiceTemplate().getQName(); + + this.planHandler.addStringElementToPlanRequest(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT, + plan); + + // var to save serviceTemplate url on storage service + final String statefulServiceTemplateVarName = + this.planHandler.addGlobalStringVariable("statefulServiceTemplateUrl" + System.currentTimeMillis(), plan); + final String responseVarName = this.planHandler.createAnyTypeVar(plan); + + // assign variable with the original service template url + Node assignStatefuleServiceTemplateStorageVar = + this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignServiceTemplateStorageUrl" + + System.currentTimeMillis(), "input", statefulServiceTemplateVarName, + "concat(//*[local-name()='" + + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT + + "']/text(),'/servicetemplates/" + + URLEncoder.encode(URLEncoder.encode(serviceTemplateId.getNamespaceURI(), + "UTF-8"), + "UTF-8") + + "','/" + serviceTemplateId.getLocalPart() + + "','/createnewstatefulversion')"); + assignStatefuleServiceTemplateStorageVar = + plan.getBpelDocument().importNode(assignStatefuleServiceTemplateStorageVar, true); + plan.getBpelMainSequenceElement().insertBefore(assignStatefuleServiceTemplateStorageVar, + plan.getBpelMainSequencePropertyAssignElement()); + + // create append POST for creating a stateful service template version + Node createStatefulServiceTemplatePOST = + this.bpelFragments.createHTTPPOST(statefulServiceTemplateVarName, responseVarName); + + createStatefulServiceTemplatePOST = plan.getBpelDocument().importNode(createStatefulServiceTemplatePOST, true); + + plan.getBpelMainSequenceElement().insertBefore(createStatefulServiceTemplatePOST, + plan.getBpelMainSequencePropertyAssignElement()); + + // read response and assign url of created stateful service template query the localname from the + // response + final String xpathQuery1 = + "concat(substring-before($" + statefulServiceTemplateVarName + ",'" + serviceTemplateId.getLocalPart() + + "'),encode-for-uri(encode-for-uri(//*[local-name()='QName']/*[local-name()='localname']/text())))"; + + // query original service template url without the last path fragment(/service template localname) + final String xpathQuery2 = "string($" + statefulServiceTemplateVarName + ")"; + Node assignCreatedStatefulServiceTemplate = + this.bpelFragments.createAssignVarToVarWithXpathQueriesAsNode("assignCreatedStatefuleServiceTemplateUrl", + responseVarName, null, + statefulServiceTemplateVarName, null, + xpathQuery1, xpathQuery2, + "change the url from original service template to stateful", + null); + + assignCreatedStatefulServiceTemplate = + plan.getBpelDocument().importNode(assignCreatedStatefulServiceTemplate, true); + plan.getBpelMainSequenceElement().insertBefore(assignCreatedStatefulServiceTemplate, + plan.getBpelMainSequencePropertyAssignElement()); + } + + private String findStatefulServiceTemplateUrlVar(final BPELPlan plan) { + return this.planHandler.getMainVariableNames(plan).stream() + .filter(varName -> varName.contains("statefulServiceTemplateUrl")).findFirst() + .orElse(null); + } + + private AbstractParameter getSaveStateParameter(final AbstractOperation op) { + return op.getInputParameters().stream() + .filter(param -> param.getName() + .equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT)) + .findFirst().orElse(null); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBuildProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBuildProcessBuilder.java new file mode 100644 index 000000000..9c315001e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELBuildProcessBuilder.java @@ -0,0 +1,279 @@ +package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.planbuilder.core.AbstractBuildPlanBuilder; +import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; +import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; +import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.EmptyPropertyToInputHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.ServiceTemplateBoundaryPropertyMappingsToOutputHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.SituationTriggerRegistration; +import org.opentosca.planbuilder.core.bpel.typebasednodehandler.BPELPluginHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.opentosca.planbuilder.model.plan.AbstractPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELScope; +import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + *

    + * This Class represents the high-level algorithm of the concept in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans fuer OpenTOSCA. It + * is responsible for generating the Build Plan Skeleton and assign plugins to handle the different templates inside a + * TopologyTemplate. + *

    + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public class BPELBuildProcessBuilder extends AbstractBuildPlanBuilder { + + final static Logger LOG = LoggerFactory.getLogger(BPELBuildProcessBuilder.class); + + // class for initializing properties inside the plan + private final PropertyVariableHandler propertyInitializer; + // class for initializing output with boundarydefinitions of a + // serviceTemplate + private final ServiceTemplateBoundaryPropertyMappingsToOutputHandler propertyOutputInitializer; + private final BPELScopeBuilder scopeBuilder; + // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans + + private SimplePlanBuilderServiceInstanceHandler serviceInstanceInitializer; + + private CorrelationIDInitializer correlationHandler; + + private SituationTriggerRegistration sitRegistrationPlugin; + + // class for finalizing build plans (e.g when some template didn't receive + // some provisioning logic and they must be filled with empty elements) + private final BPELFinalizer finalizer; + + private BPELPlanHandler planHandler; + + private BPELPluginHandler bpelPluginHandler; + + private NodeRelationInstanceVariablesHandler nodeRelationInstanceHandler; + + private final EmptyPropertyToInputHandler emptyPropInit; + + /** + *

    + * Default Constructor + *

    + */ + public BPELBuildProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + this.bpelPluginHandler = new BPELPluginHandler(pluginRegistry); + this.scopeBuilder = new BPELScopeBuilder(pluginRegistry); + this.emptyPropInit = new EmptyPropertyToInputHandler(scopeBuilder); + try { + this.planHandler = new BPELPlanHandler(); + this.serviceInstanceInitializer = new SimplePlanBuilderServiceInstanceHandler(); + this.nodeRelationInstanceHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); + this.sitRegistrationPlugin = new SituationTriggerRegistration(); + this.correlationHandler = new CorrelationIDInitializer(); + } catch (final ParserConfigurationException e) { + LOG.error("Error while initializing BuildPlanHandler", e); + } + // TODO seems ugly + this.propertyInitializer = new PropertyVariableHandler(this.planHandler); + this.propertyOutputInitializer = new ServiceTemplateBoundaryPropertyMappingsToOutputHandler(); + this.finalizer = new BPELFinalizer(); + } + + /* + * (non-Javadoc) + * + * @see org.opentosca.planbuilder.IPlanBuilder#buildPlan(java.lang.String, + * org.opentosca.planbuilder.model.tosca.AbstractDefinitions, javax.xml.namespace.QName) + */ + @Override + public BPELPlan buildPlan(final String csarName, final AbstractDefinitions definitions, + final AbstractServiceTemplate serviceTemplate) { + // create empty plan from servicetemplate and add definitions + String namespace; + if (serviceTemplate.getTargetNamespace() != null) { + namespace = serviceTemplate.getTargetNamespace(); + } else { + namespace = definitions.getTargetNamespace(); + } + + if (namespace.equals(serviceTemplate.getQName().getNamespaceURI()) + && serviceTemplate.getId().equals(serviceTemplate.getQName().getLocalPart())) { + + final String processName = ModelUtils.makeValidNCName(serviceTemplate.getId() + "_buildPlan"); + final String processNamespace = serviceTemplate.getTargetNamespace() + "_buildPlan"; + + final AbstractPlan buildPlan = + this.generatePOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate); + + LOG.debug("Generated the following abstract prov plan: "); + LOG.debug(buildPlan.toString()); + + final BPELPlan newBuildPlan = + this.planHandler.createEmptyBPELPlan(processNamespace, processName, buildPlan, "initiate"); + + newBuildPlan.setTOSCAInterfaceName("OpenTOSCA-Lifecycle-Interface"); + newBuildPlan.setTOSCAOperationname("initiate"); + + this.planHandler.initializeBPELSkeleton(newBuildPlan, csarName); + + this.nodeRelationInstanceHandler.addInstanceURLVarToTemplatePlans(newBuildPlan, serviceTemplate); + this.nodeRelationInstanceHandler.addInstanceIDVarToTemplatePlans(newBuildPlan, serviceTemplate); + + // newBuildPlan.setCsarName(csarName); + + this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, + newBuildPlan); + + final Property2VariableMapping propMap = + this.propertyInitializer.initializePropertiesAsVariables(newBuildPlan, serviceTemplate); + // init output + this.propertyOutputInitializer.initializeBuildPlanOutput(definitions, newBuildPlan, propMap, + serviceTemplate); + + // instanceDataAPI handling is done solely trough this extension + + // initialize instanceData handling + this.serviceInstanceInitializer.appendCreateServiceInstanceVarsAndAnitializeWithInstanceDataAPI(newBuildPlan); + + String serviceInstanceUrl = + this.serviceInstanceInitializer.findServiceInstanceUrlVariableName(newBuildPlan); + String serviceInstanceID = this.serviceInstanceInitializer.findServiceInstanceIdVarName(newBuildPlan); + String serviceTemplateUrl = + this.serviceInstanceInitializer.findServiceTemplateUrlVariableName(newBuildPlan); + + this.emptyPropInit.initializeEmptyPropertiesAsInputParam(newBuildPlan, propMap, serviceInstanceUrl, + serviceInstanceID, serviceTemplateUrl, + serviceTemplate, csarName); + + runPlugins(newBuildPlan, propMap, serviceInstanceUrl, serviceInstanceID, serviceTemplateUrl, csarName); + + this.correlationHandler.addCorrellationID(newBuildPlan); + + this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, + newBuildPlan.getBpelMainFlowElement(), + "CREATING", serviceInstanceUrl); + this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, + newBuildPlan.getBpelMainSequenceOutputAssignElement(), + "CREATED", serviceInstanceUrl); + + this.serviceInstanceInitializer.appendSetServiceInstanceStateAsChild(newBuildPlan, this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newBuildPlan), "ERROR", serviceInstanceUrl); + this.serviceInstanceInitializer.appendSetServiceInstanceStateAsChild(newBuildPlan, this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newBuildPlan), "FAILED", this.serviceInstanceInitializer.findPlanInstanceUrlVariableName(newBuildPlan)); + + String planInstanceUrlVarName = this.serviceInstanceInitializer.findPlanInstanceUrlVariableName(newBuildPlan); + this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, + newBuildPlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, + newBuildPlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + + this.sitRegistrationPlugin.handle(serviceTemplate, newBuildPlan); + + this.finalizer.finalize(newBuildPlan); + return newBuildPlan; + } + + LOG.warn("Couldn't create BuildPlan for ServiceTemplate {} in Definitions {} of CSAR {}", + serviceTemplate.getQName().toString(), definitions.getId(), csarName); + return null; + } + + /* + * (non-Javadoc) + * + * @see org.opentosca.planbuilder.IPlanBuilder#buildPlans(java.lang.String, + * org.opentosca.planbuilder.model.tosca.AbstractDefinitions) + */ + @Override + public List buildPlans(final String csarName, final AbstractDefinitions definitions) { + final List plans = new ArrayList<>(); + for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { + + if (!serviceTemplate.hasBuildPlan()) { + LOG.debug("ServiceTemplate {} has no BuildPlan, generating BuildPlan", + serviceTemplate.getQName().toString()); + final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); + + if (newBuildPlan != null) { + LOG.debug("Created BuildPlan " + + newBuildPlan.getBpelProcessElement().getAttribute("name")); + plans.add(newBuildPlan); + } + } else { + LOG.debug("ServiceTemplate {} has BuildPlan, no generation needed", + serviceTemplate.getQName().toString()); + } + } + return plans; + } + + /** + *

    + * This method assigns plugins to the already initialized BuildPlan and its TemplateBuildPlans. First there will be + * checked if any generic plugin can handle a template of the TopologyTemplate + *

    + * + * @param buildPlan a BuildPlan which is already initialized + * @param map a PropertyMap which contains mappings from Template to Property and to variable name of inside + * the BuildPlan + */ + private void runPlugins(final BPELPlan buildPlan, final Property2VariableMapping map, + final String serviceInstanceUrl, final String serviceInstanceID, + final String serviceTemplateUrl, final String csarFileName) { + for (final BPELScope bpelScope : buildPlan.getTemplateBuildPlans()) { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, map, buildPlan.getServiceTemplate(), + serviceInstanceUrl, serviceInstanceID, serviceTemplateUrl, csarFileName); + if (bpelScope.getNodeTemplate() != null) { + + final AbstractNodeTemplate nodeTemplate = bpelScope.getNodeTemplate(); + + // if this nodeTemplate has the label running (Property: State=Running), skip + // provisioning and just generate instance data handling + // extended check for OperatingSystem node type + if (isRunning(nodeTemplate) + || nodeTemplate.getType().getName().equals(Types.abstractOperatingSystemNodeType.getLocalPart())) { + LOG.debug("Skipping the provisioning of NodeTemplate " + + bpelScope.getNodeTemplate().getId() + " beacuse state=running is set."); + for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { + if (postPhasePlugin.canHandleCreate(context, bpelScope.getNodeTemplate())) { + postPhasePlugin.handleCreate(context, bpelScope.getNodeTemplate()); + } + } + continue; + } + + // generate code for the activity + this.bpelPluginHandler.handleActivity(context, bpelScope, nodeTemplate); + } else if (bpelScope.getRelationshipTemplate() != null) { + // handling relationshiptemplate + final AbstractRelationshipTemplate relationshipTemplate = bpelScope.getRelationshipTemplate(); + + this.bpelPluginHandler.handleActivity(context, bpelScope, relationshipTemplate); + } + } + } +} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELDefrostProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELDefrostProcessBuilder.java similarity index 77% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELDefrostProcessBuilder.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELDefrostProcessBuilder.java index 0852ee39a..c34518be4 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELDefrostProcessBuilder.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELDefrostProcessBuilder.java @@ -7,8 +7,10 @@ import javax.xml.namespace.QName; import javax.xml.parsers.ParserConfigurationException; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.planbuilder.AbstractDefrostPlanBuilder; +import org.opentosca.planbuilder.core.AbstractDefrostPlanBuilder; +import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; @@ -19,8 +21,10 @@ import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; import org.opentosca.planbuilder.core.bpel.typebasednodehandler.BPELPluginHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; @@ -30,43 +34,38 @@ import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class BPELDefrostProcessBuilder extends AbstractDefrostPlanBuilder { private final static Logger LOG = LoggerFactory.getLogger(BPELDefrostProcessBuilder.class); - - // handler for abstract buildplan operations - private BPELPlanHandler planHandler; - // class for initializing properties inside the build plan private final PropertyVariableHandler propertyInitializer; + // class for finalizing build plans (e.g when some template didn't receive + // some provisioning logic and they must be filled with empty elements) + private final BPELFinalizer finalizer; + private final EmptyPropertyToInputHandler emptyPropInit; + private final BPELPluginHandler bpelPluginHandler; + // handler for abstract buildplan operations + private BPELPlanHandler planHandler; // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans private SimplePlanBuilderServiceInstanceHandler serviceInstanceInitializer; // adds nodeInstanceIDs to each templatePlan private NodeRelationInstanceVariablesHandler instanceVarsHandler; - // class for finalizing build plans (e.g when some template didn't receive - // some provisioning logic and they must be filled with empty elements) - private final BPELFinalizer finalizer; - - private final EmptyPropertyToInputHandler emptyPropInit = new EmptyPropertyToInputHandler(); - - private final BPELPluginHandler bpelPluginHandler = new BPELPluginHandler(); - private CorrelationIDInitializer correlationHandler; - public BPELDefrostProcessBuilder() { + public BPELDefrostProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + bpelPluginHandler = new BPELPluginHandler(pluginRegistry); + emptyPropInit = new EmptyPropertyToInputHandler(new BPELScopeBuilder(pluginRegistry)); try { this.planHandler = new BPELPlanHandler(); this.serviceInstanceInitializer = new SimplePlanBuilderServiceInstanceHandler(); this.instanceVarsHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); new BPELProcessFragments(); this.correlationHandler = new CorrelationIDInitializer(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { BPELDefrostProcessBuilder.LOG.error("Error while initializing BuildPlanHandler", e); } this.propertyInitializer = new PropertyVariableHandler(this.planHandler); @@ -80,7 +79,7 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin if (!this.isDefrostable(serviceTemplate)) { BPELDefrostProcessBuilder.LOG.warn("Couldn't create DeFreezePlan for ServiceTemplate {} in Definitions {} of CSAR {}", - serviceTemplate.getQName().toString(), definitions.getId(), csarName); + serviceTemplate.getQName().toString(), definitions.getId(), csarName); return null; } @@ -107,20 +106,18 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin // instanceDataAPI handling is done solely trough this extension this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - newDefreezePlan); + newDefreezePlan); // initialize instanceData handling this.serviceInstanceInitializer.appendCreateServiceInstanceVarsAndAnitializeWithInstanceDataAPI(newDefreezePlan); - final String serviceInstanceUrl = - this.serviceInstanceInitializer.findServiceInstanceUrlVariableName(newDefreezePlan); + final String serviceInstanceUrl = this.serviceInstanceInitializer.findServiceInstanceUrlVariableName(newDefreezePlan); final String serviceInstanceId = this.serviceInstanceInitializer.findServiceInstanceIdVarName(newDefreezePlan); - final String serviceTemplateUrl = - this.serviceInstanceInitializer.findServiceTemplateUrlVariableName(newDefreezePlan); + final String serviceTemplateUrl = this.serviceInstanceInitializer.findServiceTemplateUrlVariableName(newDefreezePlan); this.emptyPropInit.initializeEmptyPropertiesAsInputParam(newDefreezePlan, propMap, serviceInstanceUrl, - serviceInstanceId, serviceTemplateUrl, serviceTemplate, - csarName); + serviceInstanceId, serviceTemplateUrl, serviceTemplate, + csarName); runPlugins(newDefreezePlan, propMap, serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); @@ -130,17 +127,26 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin this.serviceInstanceInitializer.findServiceInstanceUrlVariableName(newDefreezePlan); this.serviceInstanceInitializer.appendSetServiceInstanceState(newDefreezePlan, - newDefreezePlan.getBpelMainFlowElement(), - "CREATING", serviceInstanceURLVarName); + newDefreezePlan.getBpelMainFlowElement(), + "CREATING", serviceInstanceURLVarName); this.serviceInstanceInitializer.appendSetServiceInstanceState(newDefreezePlan, - newDefreezePlan.getBpelMainSequenceOutputAssignElement(), - "CREATED", serviceInstanceURLVarName); - + newDefreezePlan.getBpelMainSequenceOutputAssignElement(), + "CREATED", serviceInstanceURLVarName); + this.serviceInstanceInitializer.appendSetServiceInstanceStateAsChild(newDefreezePlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newDefreezePlan), - "ERROR", serviceInstanceURLVarName); + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newDefreezePlan), + "ERROR", serviceInstanceURLVarName); this.serviceInstanceInitializer.appendSetServiceInstanceStateAsChild(newDefreezePlan, this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newDefreezePlan), "FAILED", this.serviceInstanceInitializer.findPlanInstanceUrlVariableName(newDefreezePlan)); - + + String planInstanceUrlVarName = this.serviceInstanceInitializer.findPlanInstanceUrlVariableName(newDefreezePlan); + this.serviceInstanceInitializer.appendSetServiceInstanceState(newDefreezePlan, + newDefreezePlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceInitializer.appendSetServiceInstanceState(newDefreezePlan, + newDefreezePlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + this.finalizer.finalize(newDefreezePlan); BPELDefrostProcessBuilder.LOG.debug("Created Plan:"); @@ -160,7 +166,8 @@ private boolean isDefrostable(final AbstractServiceTemplate serviceTemplate) { } private boolean isDefrostable(final AbstractNodeTemplate nodeTemplate) { - return Objects.nonNull(getLoadStateOperation(nodeTemplate)) && hasFreezeableComponentPolicy(nodeTemplate); + return Objects.nonNull(this.getLoadStateOperation(nodeTemplate)) + && this.hasFreezeableComponentPolicy(nodeTemplate); } private AbstractInterface getLoadStateInterface(final AbstractNodeTemplate nodeTemplate) { @@ -175,7 +182,7 @@ private AbstractInterface getLoadStateInterface(final AbstractNodeTemplate nodeT } private AbstractOperation getLoadStateOperation(final AbstractNodeTemplate nodeTemplate) { - final AbstractInterface iface = getLoadStateInterface(nodeTemplate); + final AbstractInterface iface = this.getLoadStateInterface(nodeTemplate); if (iface != null) { for (final AbstractOperation op : iface.getOperations()) { if (!op.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_DEFREEZE)) { @@ -188,23 +195,19 @@ private AbstractOperation getLoadStateOperation(final AbstractNodeTemplate nodeT return null; } - private void runPlugins(final BPELPlan buildPlan, final Property2VariableMapping map, - final String serviceInstanceUrl, final String serviceInstanceID, + private void runPlugins(final BPELPlan buildPlan, final Property2VariableMapping propMap, + final String serviceInstanceUrl, final String serviceInstanceId, final String serviceTemplateUrl, final String csarFileName) { - for (final BPELScope bpelScope : buildPlan.getTemplateBuildPlans()) { - final BPELPlanContext context = - new BPELPlanContext(buildPlan, bpelScope, map, buildPlan.getServiceTemplate(), serviceInstanceUrl, - serviceInstanceID, serviceTemplateUrl, csarFileName); + final BPELPlanContext context = new BPELPlanContext(new BPELScopeBuilder(pluginRegistry), buildPlan, bpelScope, propMap, buildPlan.getServiceTemplate(), serviceInstanceUrl, + serviceInstanceId, serviceTemplateUrl, csarFileName); if (bpelScope.getNodeTemplate() != null) { final AbstractNodeTemplate nodeTemplate = bpelScope.getNodeTemplate(); - // if this nodeTemplate has the label running (Property: State=Running), skip - // provisioning and just generate instance data handling if (isRunning(nodeTemplate)) { BPELBuildProcessBuilder.LOG.debug("Skipping the provisioning of NodeTemplate " - + bpelScope.getNodeTemplate().getId() + " beacuse state=running is set."); + + nodeTemplate.getId() + " beacuse state=running is set."); for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { if (postPhasePlugin.canHandleCreate(context, bpelScope.getNodeTemplate())) { postPhasePlugin.handleCreate(context, bpelScope.getNodeTemplate()); @@ -212,14 +215,13 @@ private void runPlugins(final BPELPlan buildPlan, final Property2VariableMapping } continue; } - // generate code for the activity this.bpelPluginHandler.handleActivity(context, bpelScope, nodeTemplate); } else if (bpelScope.getRelationshipTemplate() != null) { - // handling relationshiptemplate + // handle relationshiptemplate final AbstractRelationshipTemplate relationshipTemplate = bpelScope.getRelationshipTemplate(); - this.bpelPluginHandler.handleActivity(context, bpelScope, relationshipTemplate); + bpelPluginHandler.handleActivity(context, bpelScope, relationshipTemplate); } } } @@ -235,7 +237,7 @@ public List buildPlans(final String csarName, final AbstractDefini } BPELDefrostProcessBuilder.LOG.debug("ServiceTemplate {} has no DefreezePlan, generating a new plan", - serviceTemplate.getQName().toString()); + serviceTemplate.getQName().toString()); final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); if (newBuildPlan != null) { diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELFreezeProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELFreezeProcessBuilder.java new file mode 100644 index 000000000..afd531625 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELFreezeProcessBuilder.java @@ -0,0 +1,470 @@ +package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; + +import java.io.IOException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.core.tosca.convention.Interfaces; +import org.opentosca.planbuilder.core.AbstractFreezePlanBuilder; +import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; +import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; +import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; +import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.opentosca.planbuilder.model.plan.AbstractPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELScope; +import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; +import org.opentosca.planbuilder.model.tosca.AbstractInterface; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; +import org.opentosca.planbuilder.model.tosca.AbstractParameter; +import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +/** + * @author Jan Ruthardt - st107755@stud.uni-stuttgart.de + */ +public class BPELFreezeProcessBuilder extends AbstractFreezePlanBuilder { + + private final static Logger LOG = LoggerFactory.getLogger(BPELFreezeProcessBuilder.class); + // class for initializing properties inside the build plan + private final PropertyVariableHandler propertyInitializer; + // class for finalizing build plans (e.g when some template didn't receive + // some provisioning logic and they must be filled with empty elements) + private final BPELFinalizer finalizer; + // handler for abstract buildplan operations + public BPELPlanHandler planHandler; + // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans + private SimplePlanBuilderServiceInstanceHandler serviceInstanceVarsHandler; + // adds nodeInstanceIDs to each templatePlan + private NodeRelationInstanceVariablesHandler instanceVarsHandler; + private BPELProcessFragments bpelFragments; + + private CorrelationIDInitializer correlationHandler; + + /** + *

    + * Default Constructor + *

    + */ + public BPELFreezeProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + try { + this.planHandler = new BPELPlanHandler(); + this.serviceInstanceVarsHandler = new SimplePlanBuilderServiceInstanceHandler(); + this.instanceVarsHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); + this.bpelFragments = new BPELProcessFragments(); + this.correlationHandler = new CorrelationIDInitializer(); + } catch (final ParserConfigurationException e) { + LOG.error("Error while initializing BuildPlanHandler", e); + } + this.propertyInitializer = new PropertyVariableHandler(this.planHandler); + this.finalizer = new BPELFinalizer(); + } + + /* + * (non-Javadoc) + * + * @see org.opentosca.planbuilder.IPlanBuilder#buildPlan(java.lang.String, + * org.opentosca.planbuilder.model.tosca.AbstractDefinitions, javax.xml.namespace.QName) + */ + @Override + public BPELPlan buildPlan(final String csarName, final AbstractDefinitions definitions, + final AbstractServiceTemplate serviceTemplate) { + LOG.info("Creating Freeze Plan..."); + + if (!this.isStateful(serviceTemplate)) { + LOG.warn("Couldn't create FreezePlan for ServiceTemplate {} in Definitions {} of CSAR {}", + serviceTemplate.getQName().toString(), definitions.getId(), csarName); + return null; + } + + final String processName = ModelUtils.makeValidNCName(serviceTemplate.getId() + "_freezePlan"); + final String processNamespace = serviceTemplate.getTargetNamespace() + "_freezePlan"; + + // we take the overall flow of an termination plan, basically with the goal of + // saving state from the top to the bottom + final AbstractPlan newAbstractBackupPlan = + generateFOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate); + + newAbstractBackupPlan.setType(PlanType.TERMINATION); + final BPELPlan newFreezePlan = + this.planHandler.createEmptyBPELPlan(processNamespace, processName, newAbstractBackupPlan, "freeze"); + + this.planHandler.initializeBPELSkeleton(newFreezePlan, csarName); + + newFreezePlan.setTOSCAInterfaceName("OpenTOSCA-Stateful-Lifecycle-Interface"); + newFreezePlan.setTOSCAOperationname("freeze"); + + this.instanceVarsHandler.addInstanceURLVarToTemplatePlans(newFreezePlan, serviceTemplate); + this.instanceVarsHandler.addInstanceIDVarToTemplatePlans(newFreezePlan, serviceTemplate); + + final Property2VariableMapping propMap = + this.propertyInitializer.initializePropertiesAsVariables(newFreezePlan, serviceTemplate); + + // instanceDataAPI handling is done solely trough this extension + this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, + newFreezePlan); + + // initialize instanceData handling, add + // instanceDataAPI/serviceInstanceID into input, add global + // variables to hold the value for plugins + this.serviceInstanceVarsHandler.addServiceInstanceHandlingFromInput(newFreezePlan); + final String serviceTemplateURLVarName = + this.serviceInstanceVarsHandler.getServiceTemplateURLVariableName(newFreezePlan); + this.serviceInstanceVarsHandler.appendInitPropertyVariablesFromServiceInstanceData(newFreezePlan, propMap, + serviceTemplateURLVarName, + serviceTemplate, + "?state=STARTED&state=CREATED&state=CONFIGURED"); + + // fetch all nodeinstances that are running + this.instanceVarsHandler.addNodeInstanceFindLogic(newFreezePlan, + "?state=STARTED&state=CREATED&state=CONFIGURED", + serviceTemplate); + this.instanceVarsHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(newFreezePlan, propMap, + serviceTemplate); + + try { + appendGenerateStatefulServiceTemplateLogic(newFreezePlan); + } catch (final IOException e) { + e.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } + + runPlugins(newFreezePlan, propMap, csarName); + + final String serviceInstanceURLVarName = + this.serviceInstanceVarsHandler.findServiceInstanceUrlVariableName(newFreezePlan); + this.serviceInstanceVarsHandler.appendSetServiceInstanceState(newFreezePlan, + newFreezePlan.getBpelMainSequenceOutputAssignElement(), + "DELETED", serviceInstanceURLVarName); + + this.correlationHandler.addCorrellationID(newFreezePlan); + + this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newFreezePlan, + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newFreezePlan), + "ERROR", serviceInstanceURLVarName); + this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newFreezePlan, this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newFreezePlan), "FAILED", this.serviceInstanceVarsHandler.findPlanInstanceUrlVariableName(newFreezePlan)); + + String planInstanceUrlVarName = this.serviceInstanceVarsHandler.findPlanInstanceUrlVariableName(newFreezePlan); + this.serviceInstanceVarsHandler.appendSetServiceInstanceState(newFreezePlan, + newFreezePlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceVarsHandler.appendSetServiceInstanceState(newFreezePlan, + newFreezePlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + + this.finalizer.finalize(newFreezePlan); + + // add for each loop over found node instances to terminate each running + // instance + /* + * for (final BPELScope activ : changedActivities) { if (activ.getNodeTemplate() != null) { + * final BPELPlanContext context = new BPELPlanContext(activ, propMap, + * newTerminationPlan.getServiceTemplate()); + * this.instanceVarsHandler.appendCountInstancesLogic(context, activ.getNodeTemplate(), + * "?state=STARTED&state=CREATED&state=CONFIGURED"); } } + */ + + LOG.debug("Created Plan:"); + LOG.debug(ModelUtils.getStringFromDoc(newFreezePlan.getBpelDocument())); + + return newFreezePlan; + } + + @Override + public List buildPlans(final String csarName, final AbstractDefinitions definitions) { + LOG.info("Building the Freeze Plans"); + final List plans = new ArrayList<>(); + for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { + if (!this.isStateful(serviceTemplate)) { + continue; + } + + LOG.debug("ServiceTemplate {} has no Freeze Plan, generating Freeze Plan", + serviceTemplate.getQName().toString()); + final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); + + if (newBuildPlan != null) { + LOG.debug("Created Freeze Plan " + newBuildPlan.getBpelProcessElement().getAttribute("name")); + plans.add(newBuildPlan); + } + } + return plans; + } + + private boolean isStateful(final AbstractServiceTemplate serviceTemplate) { + return serviceTemplate.getTopologyTemplate().getNodeTemplates().stream() + .filter(node -> isStateful(node)).findFirst().isPresent(); + } + + private boolean isStateful(final AbstractNodeTemplate nodeTemplate) { + return hasSaveStateInterface(nodeTemplate) && hasStatefulComponentPolicy(nodeTemplate); + } + + private boolean hasSaveStateInterface(final AbstractNodeTemplate nodeTemplate) { + final AbstractOperation op = getSaveStateOperation(nodeTemplate); + return Objects.nonNull(op) && Objects.nonNull(getSaveStateParameter(op)); + } + + private AbstractInterface getSaveStateInterface(final AbstractNodeTemplate nodeTemplate) { + return nodeTemplate.getType().getInterfaces().stream() + .filter(iface -> iface.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE)) + .findFirst().orElse(null); + } + + private AbstractOperation getSaveStateOperation(final AbstractNodeTemplate nodeTemplate) { + final AbstractInterface iface = getSaveStateInterface(nodeTemplate); + if (iface != null) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE)) { + return op; + } + } + } + return null; + } + + private AbstractParameter getSaveStateParameter(final AbstractOperation op) { + return op.getInputParameters().stream() + .filter(param -> param.getName() + .equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT)) + .findFirst().orElse(null); + } + + private String findStatefulServiceTemplateUrlVar(final BPELPlan plan) { + return this.planHandler.getMainVariableNames(plan).stream() + .filter(varName -> varName.contains("statefulServiceTemplateUrl")).findFirst() + .orElse(null); + } + + private void appendGenerateStatefulServiceTemplateLogic(final BPELPlan plan) throws IOException, SAXException { + final QName serviceTemplateId = plan.getServiceTemplate().getQName(); + + this.planHandler.addStringElementToPlanRequest(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT, + plan); + + // var to save serviceTemplate url on storage service + final String statefulServiceTemplateVarName = + this.planHandler.addGlobalStringVariable("statefulServiceTemplateUrl" + System.currentTimeMillis(), plan); + final String responseVarName = this.planHandler.createAnyTypeVar(plan); + + // assign variable with the original service template url + Node assignStatefuleServiceTemplateStorageVar = + this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignServiceTemplateStorageUrl" + + System.currentTimeMillis(), "input", statefulServiceTemplateVarName, + "concat(//*[local-name()='" + + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE_MANDATORY_PARAM_ENDPOINT + + "']/text(),'/servicetemplates/" + + URLEncoder.encode(URLEncoder.encode(serviceTemplateId.getNamespaceURI(), + "UTF-8"), + "UTF-8") + + "','/" + serviceTemplateId.getLocalPart() + + "','/createnewstatefulversion')"); + assignStatefuleServiceTemplateStorageVar = + plan.getBpelDocument().importNode(assignStatefuleServiceTemplateStorageVar, true); + plan.getBpelMainSequenceElement().insertBefore(assignStatefuleServiceTemplateStorageVar, + plan.getBpelMainSequencePropertyAssignElement()); + + // create append POST for creating a stateful service template version + Node createStatefulServiceTemplatePOST = + this.bpelFragments.createHTTPPOST(statefulServiceTemplateVarName, responseVarName); + + createStatefulServiceTemplatePOST = plan.getBpelDocument().importNode(createStatefulServiceTemplatePOST, true); + + plan.getBpelMainSequenceElement().insertBefore(createStatefulServiceTemplatePOST, + plan.getBpelMainSequencePropertyAssignElement()); + + // read response and assign url of created stateful service template + // query the localname from the response + final String xpathQuery1 = + "concat(substring-before($" + statefulServiceTemplateVarName + ",'" + serviceTemplateId.getLocalPart() + + "'),encode-for-uri(encode-for-uri(//*[local-name()='QName']/*[local-name()='localname']/text())))"; + // query original service template url without the last path fragment(/service + // template localname) + final String xpathQuery2 = "string($" + statefulServiceTemplateVarName + ")"; + Node assignCreatedStatefulServiceTemplate = + this.bpelFragments.createAssignVarToVarWithXpathQueriesAsNode("assignCreatedStatefuleServiceTemplateUrl", + responseVarName, null, + statefulServiceTemplateVarName, null, + xpathQuery1, xpathQuery2, + "change the url from original service template to stateful", + null); + + assignCreatedStatefulServiceTemplate = + plan.getBpelDocument().importNode(assignCreatedStatefulServiceTemplate, true); + plan.getBpelMainSequenceElement().insertBefore(assignCreatedStatefulServiceTemplate, + plan.getBpelMainSequencePropertyAssignElement()); + } + + /** + * This Methods Finds out if a Service Template Container a freeze method and then creats a freeze plan out of this + * method + * + * @param plan the plan to execute the plugins on + * @param serviceTemplate the serviceTemplate the plan belongs to + * @param propMap a PropertyMapping from NodeTemplate to Properties to BPELVariables + */ + private List runPlugins(final BPELPlan plan, final Property2VariableMapping propMap, + final String csarName) { + + final List changedActivities = new ArrayList<>(); + + final String statefulServiceTemplateUrlVarName = findStatefulServiceTemplateUrlVar(plan); + + final String serviceInstanceUrl = this.serviceInstanceVarsHandler.findServiceInstanceUrlVariableName(plan); + final String serviceInstanceId = this.serviceInstanceVarsHandler.findServiceInstanceIdVarName(plan); + final String serviceTemplateUrl = this.serviceInstanceVarsHandler.findServiceTemplateUrlVariableName(plan); + + for (final BPELScope templatePlan : plan.getTemplateBuildPlans()) { + final BPELPlanContext context = new BPELPlanContext(new BPELScopeBuilder(pluginRegistry), plan, templatePlan, propMap, plan.getServiceTemplate(), + serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); + if (templatePlan.getNodeTemplate() != null) { + + // create a context for the node + + final AbstractNodeTemplate nodeTemplate = templatePlan.getNodeTemplate(); + + // TODO add termination logic + + /* + * generic save state code + */ + if (this.isStateful(nodeTemplate)) { + + final String saveStateUrlVarName = + this.planHandler.addGlobalStringVariable("nodeTemplateStateSaveURL", plan); + + final String xpathQuery = "concat($" + statefulServiceTemplateUrlVarName + + ",'/topologytemplate/nodetemplates/" + nodeTemplate.getId() + "/state')"; + try { + Node assignSaveStateURL = + this.bpelFragments.createAssignVarToVarWithXpathQueryAsNode("assignNodeTemplate" + + nodeTemplate.getId() + "state" + System.currentTimeMillis(), + statefulServiceTemplateUrlVarName, + saveStateUrlVarName, + xpathQuery); + assignSaveStateURL = context.importNode(assignSaveStateURL); + context.getPrePhaseElement().appendChild(assignSaveStateURL); + } catch (final IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (final SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + final Variable saveStateUrlVar = BPELPlanContext.getVariable(saveStateUrlVarName); + + final Map inputs = new HashMap<>(); + + inputs.put(getSaveStateParameter(getSaveStateOperation(nodeTemplate)), saveStateUrlVar); + + context.executeOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_STATE_FREEZE, inputs); + } + + if (org.opentosca.container.core.tosca.convention.Utils.isSupportedVMNodeType(templatePlan.getNodeTemplate() + .getType() + .getId())) { + + // fetch infrastructure node (cloud provider) + final List infraNodes = context.getInfrastructureNodes(); + for (final AbstractNodeTemplate infraNode : infraNodes) { + if (org.opentosca.container.core.tosca.convention.Utils.isSupportedCloudProviderNodeType(infraNode.getType() + .getId())) { + // append logic to call terminateVM method on the node + + context.executeOperation(infraNode, + org.opentosca.container.core.tosca.convention.Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER, + org.opentosca.container.core.tosca.convention.Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER_TERMINATEVM, + null); + + changedActivities.add(templatePlan); + } + } + } else { + + if (!isDockerContainer(context.getNodeTemplate())) { + continue; + } + + // fetch infrastructure node (cloud provider) + final List nodes = new ArrayList<>(); + ModelUtils.getNodesFromNodeToSink(context.getNodeTemplate(), nodes); + + for (final AbstractNodeTemplate node : nodes) { + if (org.opentosca.container.core.tosca.convention.Utils.isSupportedDockerEngineNodeType(node.getType() + .getId())) { + context.executeOperation(node, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER, + null); + changedActivities.add(templatePlan); + } + } + } + + for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { + if (postPhasePlugin.canHandleCreate(context, nodeTemplate)) { + postPhasePlugin.handleCreate(context, nodeTemplate); + } + } + } + } + + return changedActivities; + } + + private boolean isDockerContainer(final AbstractNodeTemplate nodeTemplate) { + if (nodeTemplate.getProperties() == null) { + return false; + } + final Element propertyElement = nodeTemplate.getProperties().getDOMElement(); + final NodeList childNodeList = propertyElement.getChildNodes(); + + int check = 0; + boolean foundDockerImageProp = false; + for (int index = 0; index < childNodeList.getLength(); index++) { + if (childNodeList.item(index).getNodeType() != Node.ELEMENT_NODE) { + continue; + } + if (childNodeList.item(index).getLocalName().equals("ContainerPort")) { + check++; + } else if (childNodeList.item(index).getLocalName().equals("Port")) { + check++; + } else if (childNodeList.item(index).getLocalName().equals("ImageID")) { + foundDockerImageProp = true; + } + } + + if (check != 2) { + return false; + } + return true; + } +} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELPolicyAwareBuildProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELPolicyAwareBuildProcessBuilder.java similarity index 75% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELPolicyAwareBuildProcessBuilder.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELPolicyAwareBuildProcessBuilder.java index f07fda0bd..cdb367c47 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELPolicyAwareBuildProcessBuilder.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELPolicyAwareBuildProcessBuilder.java @@ -15,7 +15,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import org.opentosca.planbuilder.AbstractBuildPlanBuilder; +import org.opentosca.planbuilder.core.AbstractBuildPlanBuilder; import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.OperationChain; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; @@ -27,6 +27,14 @@ import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; import org.opentosca.planbuilder.core.bpel.tosca.handlers.ServiceTemplateBoundaryPropertyMappingsToOutputHandler; import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPolicyAwarePostPhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPolicyAwarePrePhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPolicyAwareTypePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPrePhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELScope; @@ -35,30 +43,21 @@ import org.opentosca.planbuilder.model.tosca.AbstractPolicy; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwarePostPhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwarePrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwareTypePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** *

    - * This Class represents the high-level algorithm of the concept in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans fuer - * OpenTOSCA. It is responsible for generating the Build Plan Skeleton and assign plugins to - * handle the different templates inside a TopologyTemplate. + * This Class represents the high-level algorithm of the concept in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans fuer OpenTOSCA. It + * is responsible for generating the Build Plan Skeleton and assign plugins to handle the different templates inside a + * TopologyTemplate. *

    - * + *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELPolicyAwareBuildProcessBuilder extends AbstractBuildPlanBuilder { @@ -79,28 +78,29 @@ public class BPELPolicyAwareBuildProcessBuilder extends AbstractBuildPlanBuilder private final List opNames = new ArrayList<>(); private BPELPlanHandler planHandler; - + private final BPELScopeBuilder scopeBuilder; private NodeRelationInstanceVariablesHandler instanceInit; private CorrelationIDInitializer correlationHandler; - private final EmptyPropertyToInputHandler emptyPropInit = new EmptyPropertyToInputHandler(); + private final EmptyPropertyToInputHandler emptyPropInit; /** *

    * Default Constructor *

    */ - public BPELPolicyAwareBuildProcessBuilder() { + public BPELPolicyAwareBuildProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + scopeBuilder = new BPELScopeBuilder(pluginRegistry); + emptyPropInit = new EmptyPropertyToInputHandler(scopeBuilder); try { this.planHandler = new BPELPlanHandler(); this.serviceInstanceHandler = new SimplePlanBuilderServiceInstanceHandler(); this.instanceInit = new NodeRelationInstanceVariablesHandler(this.planHandler); this.correlationHandler = new CorrelationIDInitializer(); - - } - catch (final ParserConfigurationException e) { - BPELPolicyAwareBuildProcessBuilder.LOG.error("Error while initializing BuildPlanHandler", e); + } catch (final ParserConfigurationException e) { + LOG.error("Error while initializing BuildPlanHandler", e); } // TODO seems ugly this.propertyInitializer = new PropertyVariableHandler(this.planHandler); @@ -146,7 +146,7 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin // buildplan // for (AbstractNodeTemplate nodeTemplate : // serviceTemplate.getTopologyTemplate().getNodeTemplates()) { - // BPELScopeActivity newTemplate = + // BPELScope newTemplate = // this.templateHandler.createTemplateBuildPlan(nodeTemplate, // newBuildPlan); // newTemplate.setNodeTemplate(nodeTemplate); @@ -156,7 +156,7 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin // for (AbstractRelationshipTemplate relationshipTemplate : // serviceTemplate.getTopologyTemplate().getRelationshipTemplates()) // { - // BPELScopeActivity newTemplate = + // BPELScope newTemplate = // this.templateHandler.createTemplateBuildPlan(relationshipTemplate, // newBuildPlan); // newTemplate.setRelationshipTemplate(relationshipTemplate); @@ -167,7 +167,7 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin // this.initializeDependenciesInBuildPlan(newBuildPlan); this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - newBuildPlan); + newBuildPlan); final Property2VariableMapping propMap = this.propertyInitializer.initializePropertiesAsVariables(newBuildPlan, serviceTemplate); @@ -179,14 +179,13 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin // initialize instanceData handling this.serviceInstanceHandler.appendCreateServiceInstanceVarsAndAnitializeWithInstanceDataAPI(newBuildPlan); - String serviceInstanceUrl = this.serviceInstanceHandler.findServiceInstanceUrlVariableName(newBuildPlan); String serviceInstanceId = this.serviceInstanceHandler.findServiceInstanceIdVarName(newBuildPlan); String serviceTemplateUrl = this.serviceInstanceHandler.findServiceTemplateUrlVariableName(newBuildPlan); this.emptyPropInit.initializeEmptyPropertiesAsInputParam(newBuildPlan, propMap, serviceInstanceUrl, - serviceInstanceId, serviceTemplateUrl, serviceTemplate, - csarName); + serviceInstanceId, serviceTemplateUrl, serviceTemplate, + csarName); runPlugins(newBuildPlan, propMap, serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); @@ -194,16 +193,24 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin String serviceInstanceURLVarName = this.serviceInstanceHandler.findServiceInstanceUrlVariableName(newBuildPlan); this.serviceInstanceHandler.appendSetServiceInstanceState(newBuildPlan, newBuildPlan.getBpelMainFlowElement(), - "CREATING", serviceInstanceURLVarName); + "CREATING", serviceInstanceURLVarName); this.serviceInstanceHandler.appendSetServiceInstanceState(newBuildPlan, - newBuildPlan.getBpelMainSequenceOutputAssignElement(), - "CREATED", serviceInstanceURLVarName); + newBuildPlan.getBpelMainSequenceOutputAssignElement(), + "CREATED", serviceInstanceURLVarName); + + String planInstanceUrlVarName = this.serviceInstanceHandler.findPlanInstanceUrlVariableName(newBuildPlan); + this.serviceInstanceHandler.appendSetServiceInstanceState(newBuildPlan, + newBuildPlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceHandler.appendSetServiceInstanceState(newBuildPlan, + newBuildPlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); this.finalizer.finalize(newBuildPlan); - BPELPolicyAwareBuildProcessBuilder.LOG.debug("Created BuildPlan:"); - BPELPolicyAwareBuildProcessBuilder.LOG.debug(getStringFromDoc(newBuildPlan.getBpelDocument())); + LOG.debug("Created BuildPlan:"); + LOG.debug(getStringFromDoc(newBuildPlan.getBpelDocument())); return newBuildPlan; - } /* @@ -218,18 +225,18 @@ public List buildPlans(final String csarName, final AbstractDefini for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { if (!serviceTemplate.hasBuildPlan()) { - BPELPolicyAwareBuildProcessBuilder.LOG.debug("ServiceTemplate {} has no BuildPlan, generating BuildPlan", - serviceTemplate.toString()); + LOG.debug("ServiceTemplate {} has no BuildPlan, generating BuildPlan", + serviceTemplate.toString()); final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); if (newBuildPlan != null) { - BPELPolicyAwareBuildProcessBuilder.LOG.debug("Created BuildPlan " + LOG.debug("Created BuildPlan " + newBuildPlan.getBpelProcessElement().getAttribute("name")); plans.add(newBuildPlan); } } else { - BPELPolicyAwareBuildProcessBuilder.LOG.debug("ServiceTemplate {} has BuildPlan, no generation needed", - serviceTemplate.getQName().toString()); + LOG.debug("ServiceTemplate {} has BuildPlan, no generation needed", + serviceTemplate.getQName().toString()); } } return plans; @@ -237,25 +244,24 @@ public List buildPlans(final String csarName, final AbstractDefini /** *

    - * This method assigns plugins to the already initialized BuildPlan and its TemplateBuildPlans. - * First there will be checked if any generic plugin can handle a template of the TopologyTemplate + * This method assigns plugins to the already initialized BuildPlan and its TemplateBuildPlans. First there will be + * checked if any generic plugin can handle a template of the TopologyTemplate *

    * * @param buildPlan a BuildPlan which is alread initialized - * @param map a PropertyMap which contains mappings from Template to Property and to variable name - * of inside the BuidlPlan + * @param map a PropertyMap which contains mappings from Template to Property and to variable name of inside + * the BuidlPlan */ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapping map, String serviceInstanceUrl, String serviceInstanceId, String serviceTemplateUrl, String csarName) { - for (final BPELScope templatePlan : buildPlan.getTemplateBuildPlans()) { boolean handled = false; if (templatePlan.getNodeTemplate() != null) { // handling nodetemplate final AbstractNodeTemplate nodeTemplate = templatePlan.getNodeTemplate(); - BPELPolicyAwareBuildProcessBuilder.LOG.debug("Trying to handle NodeTemplate " + nodeTemplate.getId()); - final BPELPlanContext context = new BPELPlanContext(buildPlan,templatePlan, map, buildPlan.getServiceTemplate(), + LOG.debug("Trying to handle NodeTemplate " + nodeTemplate.getId()); + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, buildPlan, templatePlan, map, buildPlan.getServiceTemplate(), serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); // check if we have a generic plugin to handle the template // Note: if a generic plugin fails during execution the @@ -270,12 +276,12 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp if (nodeTemplate.getPolicies().isEmpty()) { final IPlanBuilderTypePlugin plugin = this.pluginRegistry.findTypePluginForCreation(nodeTemplate); if (plugin != null) { - BPELPolicyAwareBuildProcessBuilder.LOG.info("Handling NodeTemplate {} with type plugin {}", - nodeTemplate.getId(), plugin.getID()); + LOG.info("Handling NodeTemplate {} with type plugin {}", + nodeTemplate.getId(), plugin.getID()); handled = plugin.handleCreate(context, nodeTemplate); } else { - BPELPolicyAwareBuildProcessBuilder.LOG.warn("Can't handle NodeTemplate {} with type plugin", - nodeTemplate.getId()); + LOG.warn("Can't handle NodeTemplate {} with type plugin", + nodeTemplate.getId()); } for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { @@ -288,15 +294,15 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp final IPlanBuilderPolicyAwareTypePlugin policyPlugin = this.pluginRegistry.findPolicyAwareTypePluginForCreation(nodeTemplate); if (policyPlugin == null) { - BPELPolicyAwareBuildProcessBuilder.LOG.debug("Handling NodeTemplate {} with ProvisioningChain", - nodeTemplate.getId()); - final OperationChain chain = BPELScopeBuilder.createOperationChain(nodeTemplate, this.opNames); + LOG.debug("Handling NodeTemplate {} with ProvisioningChain", + nodeTemplate.getId()); + final OperationChain chain = new BPELScopeBuilder(pluginRegistry).createOperationChain(nodeTemplate, this.opNames); if (chain == null) { - BPELPolicyAwareBuildProcessBuilder.LOG.warn("Couldn't create ProvisioningChain for NodeTemplate {}", - nodeTemplate.getId()); + LOG.warn("Couldn't create ProvisioningChain for NodeTemplate {}", + nodeTemplate.getId()); } else { - BPELPolicyAwareBuildProcessBuilder.LOG.debug("Created ProvisioningChain for NodeTemplate {}", - nodeTemplate.getId()); + LOG.debug("Created ProvisioningChain for NodeTemplate {}", + nodeTemplate.getId()); final List policies = nodeTemplate.getPolicies(); final Map> compatiblePrePlugins = @@ -309,7 +315,7 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp for (final IPlanBuilderPolicyAwarePrePhasePlugin policyPrePhasePlugin : this.pluginRegistry.getPolicyAwarePrePhasePlugins()) { if (policyPrePhasePlugin.canHandlePolicyAwareCreate(nodeTemplate, policy)) { compatiblePrePlugins.put(policy, - (IPlanBuilderPolicyAwarePrePhasePlugin) policyPrePhasePlugin); + (IPlanBuilderPolicyAwarePrePhasePlugin) policyPrePhasePlugin); matched = true; break; } @@ -322,7 +328,7 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp for (final IPlanBuilderPolicyAwarePostPhasePlugin policyPostPhasePlugin : this.pluginRegistry.getPolicyAwarePostPhasePlugins()) { if (policyPostPhasePlugin.canHandle(nodeTemplate, policy)) { compatiblePostPlugins.put(policy, - (IPlanBuilderPolicyAwarePostPhasePlugin) policyPostPhasePlugin); + (IPlanBuilderPolicyAwarePostPhasePlugin) policyPostPhasePlugin); matched = true; break; } @@ -336,7 +342,7 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp for (final AbstractPolicy policy : compatiblePrePlugins.keySet()) { compatiblePrePlugins.get(policy).handlePolicyAwareCreate(context, nodeTemplate, - policy); + policy); } for (final AbstractPolicy policy : compatiblePostPlugins.keySet()) { @@ -347,11 +353,10 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp chain.executeDAProvisioning(context); chain.executeOperationProvisioning(context, this.opNames); } - } } else { - BPELPolicyAwareBuildProcessBuilder.LOG.info("Handling NodeTemplate {} with generic policy aware plugin", - nodeTemplate.getId()); + LOG.info("Handling NodeTemplate {} with generic policy aware plugin", + nodeTemplate.getId()); handled = policyPlugin.handlePolicyAwareCreate(context); } @@ -360,7 +365,6 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp handled = postPhasePlugin.handleCreate(context, nodeTemplate); } } - } if (!handled) { @@ -369,7 +373,7 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp } else { // handling relationshiptemplate final AbstractRelationshipTemplate relationshipTemplate = templatePlan.getRelationshipTemplate(); - final BPELPlanContext context = new BPELPlanContext(buildPlan,templatePlan, map, buildPlan.getServiceTemplate(), + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, buildPlan, templatePlan, map, buildPlan.getServiceTemplate(), serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); // check if we have a generic plugin to handle the template @@ -378,14 +382,13 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp // TODO implement fallback if (canGenericPluginHandle(relationshipTemplate)) { - BPELPolicyAwareBuildProcessBuilder.LOG.info("Handling RelationshipTemplate {} with generic plugin", - relationshipTemplate.getId()); + LOG.info("Handling RelationshipTemplate {} with generic plugin", + relationshipTemplate.getId()); IPlanBuilderTypePlugin plugin = this.pluginRegistry.findTypePluginForCreation(relationshipTemplate); handled = this.pluginRegistry.handleCreateWithTypePlugin(context, relationshipTemplate, plugin); - } else { - BPELPolicyAwareBuildProcessBuilder.LOG.debug("Couldn't handle RelationshipTemplate {} with type plugin", - relationshipTemplate.getId()); + LOG.debug("Couldn't handle RelationshipTemplate {} with type plugin", + relationshipTemplate.getId()); } for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { @@ -404,22 +407,21 @@ private boolean runPlugins(final BPELPlan buildPlan, final Property2VariableMapp *

    * * @param relationshipTemplate an AbstractRelationshipTemplate denoting a RelationshipTemplate - * @return true if there is any generic plugin which can handle the given RelationshipTemplate, else - * false + * @return true if there is any generic plugin which can handle the given RelationshipTemplate, else false */ private boolean canGenericPluginHandle(final AbstractRelationshipTemplate relationshipTemplate) { for (final IPlanBuilderTypePlugin plugin : this.pluginRegistry.getTypePlugins()) { if (plugin.canHandleCreate(relationshipTemplate)) { - BPELPolicyAwareBuildProcessBuilder.LOG.info("Found GenericPlugin {} thath can handle RelationshipTemplate {}", - plugin.getID(), relationshipTemplate.getId()); + LOG.info("Found GenericPlugin {} thath can handle RelationshipTemplate {}", + plugin.getID(), relationshipTemplate.getId()); return true; } } return false; } - // TODO delete this method, or add to utils. is pretty much copied from the - // net + // TODO delete this method, or add to utils. is pretty much copied from the net + /** *

    * Converts the given DOM Document to a String @@ -443,11 +445,9 @@ public String getStringFromDoc(final org.w3c.dom.Document doc) { transformer.transform(domSource, result); writer.flush(); return writer.toString(); - } - catch (final TransformerException ex) { - BPELPolicyAwareBuildProcessBuilder.LOG.error("Couldn't transform DOM Document to a String", ex); + } catch (final TransformerException ex) { + LOG.error("Couldn't transform DOM Document to a String", ex); return null; } } - } diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELScaleOutProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELScaleOutProcessBuilder.java similarity index 86% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELScaleOutProcessBuilder.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELScaleOutProcessBuilder.java index c6bcf4ad3..112759920 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELScaleOutProcessBuilder.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELScaleOutProcessBuilder.java @@ -11,11 +11,10 @@ import javax.xml.parsers.ParserConfigurationException; import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.AbstractScaleOutPlanBuilder; -import org.opentosca.planbuilder.ScalingPlanDefinition; -import org.opentosca.planbuilder.ScalingPlanDefinition.AnnotatedAbstractNodeTemplate; +import org.opentosca.planbuilder.core.AbstractScaleOutPlanBuilder; +import org.opentosca.planbuilder.core.ScalingPlanDefinition; +import org.opentosca.planbuilder.core.ScalingPlanDefinition.AnnotatedAbstractNodeTemplate; import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; -import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.OperationChain; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; @@ -25,6 +24,13 @@ import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPrePhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IScalingPlanBuilderSelectionPlugin; import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.plan.AbstractPlan.Link; @@ -37,12 +43,6 @@ import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.tosca.AbstractTopologyTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.opentosca.planbuilder.plugins.typebased.IScalingPlanBuilderSelectionPlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Node; @@ -53,7 +53,6 @@ *
    * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class BPELScaleOutProcessBuilder extends AbstractScaleOutPlanBuilder { @@ -68,29 +67,32 @@ public class BPELScaleOutProcessBuilder extends AbstractScaleOutPlanBuilder { private NodeRelationInstanceVariablesHandler instanceInitializer; - // class for finalizing build plans (e.g when some template didn't receive // some provisioning logic and they must be filled with empty elements) private final BPELFinalizer finalizer; private BPELPlanHandler planHandler; - private final EmptyPropertyToInputHandler emptyPropInit = new EmptyPropertyToInputHandler(); + private final EmptyPropertyToInputHandler emptyPropInit; // accepted operations for provisioning private final List opNames = new ArrayList<>(); private CorrelationIDInitializer correlationHandler; - public BPELScaleOutProcessBuilder() { + private final BPELScopeBuilder scopeBuilder; + + public BPELScaleOutProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + this.scopeBuilder = new BPELScopeBuilder(pluginRegistry); + this.emptyPropInit = new EmptyPropertyToInputHandler(scopeBuilder); try { this.planHandler = new BPELPlanHandler(); this.serviceInstanceHandler = new SimplePlanBuilderServiceInstanceHandler(); this.instanceInitializer = new NodeRelationInstanceVariablesHandler(this.planHandler); this.correlationHandler = new CorrelationIDInitializer(); - } - catch (final ParserConfigurationException e) { - BPELScaleOutProcessBuilder.LOG.error("Error while initializing BuildPlanHandler", e); + } catch (final ParserConfigurationException e) { + LOG.error("Error while initializing BuildPlanHandler", e); } this.propertyInitializer = new PropertyVariableHandler(this.planHandler); @@ -141,7 +143,6 @@ private void addRecursiveInstanceSelection(final BPELPlan plan, final Property2V "recursiveSelection_NodeInstance_" + nodeTemplate.getId() + System.currentTimeMillis() + "_Response"; nodeContext.addVariable(responseVarName, BPELPlan.VariableType.TYPE, anyTypeDeclId); - final String serviceTemplateUrlVarName = serviceInstanceHandler.getServiceTemplateURLVariableName(plan); // fetch relationInstance data @@ -149,23 +150,20 @@ private void addRecursiveInstanceSelection(final BPELPlan plan, final Property2V // createBPEL4RESTLightRelationInstancesTargetNodeInstanceQueryGETAsNode Node fetchNodeInstanceData = new BPELProcessFragments().createRESTExtensionGETForNodeInstanceDataAsNode(serviceTemplateUrlVarName, - responseVarName, - nodeTemplate.getId(), - "source=$bpelvar[$" - + relationInstanceVarName - + "]"); + responseVarName, + nodeTemplate.getId(), + "source=$bpelvar[$" + + relationInstanceVarName + + "]"); fetchNodeInstanceData = nodeContext.importNode(fetchNodeInstanceData); nodeContext.getPrePhaseElement().appendChild(fetchNodeInstanceData); - } - catch (final IOException e1) { + } catch (final IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); - } - catch (final SAXException e1) { + } catch (final SAXException e1) { // TODO Auto-generated catch block e1.printStackTrace(); - } - catch (final ParserConfigurationException e1) { + } catch (final ParserConfigurationException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } @@ -183,16 +181,13 @@ private void addRecursiveInstanceSelection(final BPELPlan plan, final Property2V + System.currentTimeMillis(), responseVarName, nodeInstanceVarName, xpathQuery); queryNodeInstanceUrl = nodeContext.importNode(queryNodeInstanceUrl); nodeContext.getPrePhaseElement().appendChild(queryNodeInstanceUrl); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -211,7 +206,7 @@ private void addRecursiveInstanceSelection(final BPELPlan plan, final Property2V this.createContext(relationshipTemplate.getTarget(), plan, map, csarFileName); final String nodeTemplateInstanceVarName = this.instanceInitializer.findInstanceUrlVarName(plan, serviceTemplate, - relationshipTemplate.getTarget().getId(), true); + relationshipTemplate.getTarget().getId(), true); final String serviceInstanceIdVarName = this.serviceInstanceHandler.getServiceTemplateURLVariableName(plan); @@ -233,21 +228,18 @@ private void addRecursiveInstanceSelection(final BPELPlan plan, final Property2V try { Node requestRelationInstance = new BPELProcessFragments().createBPEL4RESTLightRelationInstancesTargetNodeInstanceQueryGETAsNode(serviceTemplateUrlVarName, - relationshipTemplate.getId(), - responseVarName, - nodeTemplateInstanceVarName); + relationshipTemplate.getId(), + responseVarName, + nodeTemplateInstanceVarName); requestRelationInstance = relationContext.importNode(requestRelationInstance); relationContext.getPrePhaseElement().appendChild(requestRelationInstance); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -259,16 +251,13 @@ private void addRecursiveInstanceSelection(final BPELPlan plan, final Property2V try { new BPELProcessFragments().createAssignXpathQueryToStringVarFragmentAsNode("recursiveSelection_fetchRelationInstance" + System.currentTimeMillis(), xpathQuery, relationshipTemplateInstanceVarName); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -295,8 +284,6 @@ public List buildScalingPlans(final String csarName, final AbstractDef final QName serviceTemplateId) { final List scalingPlans = new ArrayList<>(); - - final AbstractServiceTemplate serviceTemplate = getServiceTemplate(definitions, serviceTemplateId); if (serviceTemplate == null) { @@ -322,7 +309,7 @@ public List buildScalingPlans(final String csarName, final AbstractDef final String processNamespace = serviceTemplate.getTargetNamespace() + "_scalingPlan"; final AbstractPlan abstractScaleOutPlan = generateSOG(new QName(processNamespace, processName).toString(), - definitions, serviceTemplate, scalingPlanDefinition); + definitions, serviceTemplate, scalingPlanDefinition); printGraph(abstractScaleOutPlan); @@ -339,12 +326,10 @@ public List buildScalingPlans(final String csarName, final AbstractDef // instanceDataAPI handling is done solely trough this extension this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - bpelScaleOutProcess); + bpelScaleOutProcess); this.serviceInstanceHandler.addServiceInstanceHandlingFromInput(bpelScaleOutProcess); - - this.instanceInitializer.addInstanceURLVarToTemplatePlans(bpelScaleOutProcess, serviceTemplate); this.instanceInitializer.addInstanceIDVarToTemplatePlans(bpelScaleOutProcess, serviceTemplate); @@ -369,22 +354,22 @@ public List buildScalingPlans(final String csarName, final AbstractDef this.serviceInstanceHandler.findServiceTemplateUrlVariableName(bpelScaleOutProcess); this.emptyPropInit.initializeEmptyPropertiesAsInputParam(provScopeActivities, bpelScaleOutProcess, propMap, - serviceInstanceUrl, serviceInstanceId, - serviceTemplateUrl, serviceTemplate, csarName); + serviceInstanceUrl, serviceInstanceId, + serviceTemplateUrl, serviceTemplate, csarName); this.runProvisioningLogicGeneration(bpelScaleOutProcess, propMap, scalingPlanDefinition.nodeTemplates, - scalingPlanDefinition.relationshipTemplates, serviceInstanceUrl, - serviceInstanceId, serviceTemplateUrl, csarName); + scalingPlanDefinition.relationshipTemplates, serviceInstanceUrl, + serviceInstanceId, serviceTemplateUrl, csarName); // add generic instance selection for (final AbstractRelationshipTemplate relationshipTemplate : scalingPlanDefinition.relationshipTemplatesRecursiveSelection) { this.addRecursiveInstanceSelection(bpelScaleOutProcess, propMap, relationshipTemplate, serviceTemplate, - csarName); + csarName); } for (final AbstractNodeTemplate nodeTemplate : scalingPlanDefinition.nodeTemplatesRecursiveSelection) { this.addRecursiveInstanceSelection(bpelScaleOutProcess, propMap, nodeTemplate, serviceTemplate, - csarName); + csarName); } for (final AnnotatedAbstractNodeTemplate stratNodeTemplate : scalingPlanDefinition.selectionStrategy2BorderNodes) { @@ -392,9 +377,9 @@ public List buildScalingPlans(final String csarName, final AbstractDef if (selectionPlugin != null) { final BPELScope scope = this.planHandler.getTemplateBuildPlanById(stratNodeTemplate.getId(), bpelScaleOutProcess); - selectionPlugin.handle(new BPELPlanContext(bpelScaleOutProcess,scope, propMap, serviceTemplate, serviceInstanceUrl, - serviceInstanceId, serviceTemplateUrl, csarName), stratNodeTemplate, - new ArrayList<>(stratNodeTemplate.getAnnotations())); + selectionPlugin.handle(new BPELPlanContext(scopeBuilder, bpelScaleOutProcess, scope, propMap, serviceTemplate, serviceInstanceUrl, + serviceInstanceId, serviceTemplateUrl, csarName), stratNodeTemplate, + new ArrayList<>(stratNodeTemplate.getAnnotations())); } } @@ -405,15 +390,21 @@ public List buildScalingPlans(final String csarName, final AbstractDef } this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(bpelScaleOutProcess, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(bpelScaleOutProcess), - "ERROR", serviceInstanceUrl); + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(bpelScaleOutProcess), + "ERROR", serviceInstanceUrl); this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(bpelScaleOutProcess, this.planHandler.getMainCatchAllFaultHandlerSequenceElement(bpelScaleOutProcess), "FAILED", this.serviceInstanceHandler.findPlanInstanceUrlVariableName(bpelScaleOutProcess)); - - this.finalizer.finalize(bpelScaleOutProcess); + String planInstanceUrlVarName = this.serviceInstanceHandler.findPlanInstanceUrlVariableName(bpelScaleOutProcess); + this.serviceInstanceHandler.appendSetServiceInstanceState(bpelScaleOutProcess, + bpelScaleOutProcess.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); - scalingPlans.add(bpelScaleOutProcess); + this.serviceInstanceHandler.appendSetServiceInstanceState(bpelScaleOutProcess, + bpelScaleOutProcess.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + this.finalizer.finalize(bpelScaleOutProcess); + scalingPlans.add(bpelScaleOutProcess); } return scalingPlans; @@ -433,7 +424,7 @@ public BPELPlanContext createContext(final AbstractNodeTemplate nodeTemplate, fi String serviceInstanceId = this.serviceInstanceHandler.findServiceInstanceIdVarName(plan); String serviceTemplateUrl = this.serviceInstanceHandler.findServiceTemplateUrlVariableName(plan); - return new BPELPlanContext(plan,this.planHandler.getTemplateBuildPlanById(nodeTemplate.getId(), plan), map, + return new BPELPlanContext(scopeBuilder, plan, this.planHandler.getTemplateBuildPlanById(nodeTemplate.getId(), plan), map, plan.getServiceTemplate(), serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarFileName); } @@ -444,7 +435,7 @@ public BPELPlanContext createContext(final AbstractRelationshipTemplate relation String serviceInstanceId = this.serviceInstanceHandler.findServiceInstanceIdVarName(plan); String serviceTemplateUrl = this.serviceInstanceHandler.findServiceTemplateUrlVariableName(plan); - return new BPELPlanContext(plan,this.planHandler.getTemplateBuildPlanById(relationshipTemplate.getId(), plan), map, + return new BPELPlanContext(scopeBuilder, plan, this.planHandler.getTemplateBuildPlanById(relationshipTemplate.getId(), plan), map, plan.getServiceTemplate(), serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarFileName); } @@ -552,7 +543,6 @@ private List fetchScalingPlansDefinitions(final AbstractT scalingPlanDefinitions.add(new ScalingPlanDefinition(scalingPlanName, topology, nodeTemplates, relationshipTemplates, selectionStrategy2BorderNodes)); } - } return scalingPlanDefinitions; @@ -664,7 +654,6 @@ private void printGraph(final AbstractPlan abstractScaleOutPlan) { LOG.debug("(" + srcId + ", " + trgtId + ")"); } - } private void runProvisioningLogicGeneration(final BPELPlan plan, final AbstractNodeTemplate nodeTemplate, @@ -673,7 +662,7 @@ private void runProvisioningLogicGeneration(final BPELPlan plan, final AbstractN String csarFileName) { // handling nodetemplate final BPELPlanContext context = - new BPELPlanContext(plan,this.planHandler.getTemplateBuildPlanById(nodeTemplate.getId(), plan), map, + new BPELPlanContext(scopeBuilder, plan, this.planHandler.getTemplateBuildPlanById(nodeTemplate.getId(), plan), map, plan.getServiceTemplate(), serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarFileName); // check if we have a generic plugin to handle the template // Note: if a generic plugin fails during execution the @@ -688,13 +677,11 @@ private void runProvisioningLogicGeneration(final BPELPlan plan, final AbstractN final IPlanBuilderTypePlugin plugin = this.pluginRegistry.findTypePluginForCreation(nodeTemplate); if (plugin != null) { - - BPELScaleOutProcessBuilder.LOG.info("Handling NodeTemplate {} with type plugin {}", nodeTemplate.getId(), - plugin.getID()); + LOG.info("Handling NodeTemplate {} with type plugin {}", nodeTemplate.getId(), + plugin.getID()); plugin.handleCreate(context, nodeTemplate); - } else { - BPELScaleOutProcessBuilder.LOG.debug("Can't handle NodeTemplate {} with type plugin", nodeTemplate.getId()); + LOG.debug("Can't handle NodeTemplate {} with type plugin", nodeTemplate.getId()); } for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { @@ -716,14 +703,13 @@ private void runProvisioningLogicGeneration(final BPELPlan plan, // TemplateBuildPlan is broken here! // TODO implement fallback if (this.pluginRegistry.findTypePluginForCreation(relationshipTemplate) != null) { - BPELScaleOutProcessBuilder.LOG.info("Handling RelationshipTemplate {} with type plugin", - relationshipTemplate.getId()); + LOG.info("Handling RelationshipTemplate {} with type plugin", + relationshipTemplate.getId()); IPlanBuilderTypePlugin plugin = this.pluginRegistry.findTypePluginForCreation(relationshipTemplate); this.pluginRegistry.handleCreateWithTypePlugin(context, relationshipTemplate, plugin); - } else { - BPELScaleOutProcessBuilder.LOG.debug("Couldn't handle RelationshipTemplate {} with type plugin", - relationshipTemplate.getId()); + LOG.debug("Couldn't handle RelationshipTemplate {} with type plugin", + relationshipTemplate.getId()); } for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { @@ -740,7 +726,7 @@ private void runProvisioningLogicGeneration(final BPELPlan plan, final Property2 String serviceTemplateUrl, String csarFileName) { for (final AbstractNodeTemplate node : nodeTemplates) { this.runProvisioningLogicGeneration(plan, node, map, serviceInstanceUrl, serviceInstanceId, - serviceTemplateUrl, csarFileName); + serviceTemplateUrl, csarFileName); } for (final AbstractRelationshipTemplate relation : relationshipTemplates) { this.runProvisioningLogicGeneration(plan, relation, map, csarFileName); @@ -761,5 +747,4 @@ private Map transformSelectionStrategyListToMap(final List - * This Class represents the high-level algorithm of the concept in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans fuer - * OpenTOSCA. It is responsible for generating the Build Plan Skeleton and assign plugins to - * handle the different templates inside a TopologyTemplate. + * This Class represents the high-level algorithm of the concept in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans fuer OpenTOSCA. It + * is responsible for generating the Build Plan Skeleton and assign plugins to handle the different templates inside a + * TopologyTemplate. *

    - * + *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELSituationAwareBuildProcessBuilder extends AbstractBuildPlanBuilder { @@ -86,11 +75,11 @@ public class BPELSituationAwareBuildProcessBuilder extends AbstractBuildPlanBuil private BPELPlanHandler planHandler; - private BPELPluginHandler bpelPluginHandler = new BPELPluginHandler(); + private BPELPluginHandler bpelPluginHandler; private NodeRelationInstanceVariablesHandler nodeRelationInstanceHandler; - private final EmptyPropertyToInputHandler emptyPropInit = new EmptyPropertyToInputHandler(); + private final EmptyPropertyToInputHandler emptyPropInit; private BPELProcessFragments fragments; @@ -99,7 +88,11 @@ public class BPELSituationAwareBuildProcessBuilder extends AbstractBuildPlanBuil * Default Constructor *

    */ - public BPELSituationAwareBuildProcessBuilder() { + @Inject + public BPELSituationAwareBuildProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + bpelPluginHandler = new BPELPluginHandler(pluginRegistry); + emptyPropInit = new EmptyPropertyToInputHandler(new BPELScopeBuilder(pluginRegistry)); try { this.planHandler = new BPELPlanHandler(); this.serviceInstanceInitializer = new SimplePlanBuilderServiceInstanceHandler(); @@ -108,9 +101,8 @@ public BPELSituationAwareBuildProcessBuilder() { this.correlationHandler = new CorrelationIDInitializer(); this.fragments = new BPELProcessFragments(); this.propertyInitializer = new PropertyVariableHandler(this.planHandler); - } - catch (final ParserConfigurationException e) { - BPELSituationAwareBuildProcessBuilder.LOG.error("Error while initializing BuildPlanHandler, couldn't initialize internal parser", e); + } catch (final ParserConfigurationException e) { + BPELSituationAwareBuildProcessBuilder.LOG.error("Error while initializing BuildPlanHandler, couldn't initialize internal parser", e); } // TODO seems ugly this.propertyOutputInitializer = new ServiceTemplateBoundaryPropertyMappingsToOutputHandler(); @@ -128,7 +120,6 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin final AbstractServiceTemplate serviceTemplate) { // create empty plan from servicetemplate and add definitions - String namespace; if (serviceTemplate.getTargetNamespace() != null) { namespace = serviceTemplate.getTargetNamespace(); @@ -167,20 +158,18 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin this.planHandler.initializeBPELSkeleton(newBuildPlan, csarName); - this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - newBuildPlan); + newBuildPlan); final Property2VariableMapping propMap = this.propertyInitializer.initializePropertiesAsVariables(newBuildPlan, serviceTemplate); // init output this.propertyOutputInitializer.initializeBuildPlanOutput(definitions, newBuildPlan, propMap, - serviceTemplate); + serviceTemplate); // initialize instanceData handling this.serviceInstanceInitializer.appendCreateServiceInstanceVarsAndAnitializeWithInstanceDataAPI(newBuildPlan); - String serviceInstanceUrl = this.serviceInstanceInitializer.findServiceInstanceUrlVariableName(newBuildPlan); @@ -188,8 +177,8 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin this.correlationHandler.addCorrellationID(newBuildPlan); this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, - newBuildPlan.getBpelMainSequenceOutputAssignElement(), - "CREATED", serviceInstanceUrl); + newBuildPlan.getBpelMainSequenceOutputAssignElement(), + "CREATED", serviceInstanceUrl); for (String inputLocalName : policy2IdMap.values()) { this.planHandler.addStringElementToPlanRequest(inputLocalName, newBuildPlan); } @@ -203,24 +192,30 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin this.fragments.createAssignAndPostSituationMonitorAsNode(situationPolicies, policy2IdMap, serviceInstanceUrl, anyVarName, requestVarName); createSituationMonitorNode = this.planHandler.importNode(newBuildPlan, createSituationMonitorNode); newBuildPlan.getBpelMainSequenceElement().appendChild(createSituationMonitorNode); - - } - catch (SAXException e) { + } catch (SAXException e) { LOG.error("Couldn't parse XML file", e); return null; - } - catch (IOException e) { + } catch (IOException e) { LOG.error("Couldn't read file", e); return null; } + String planInstanceUrlVarName = this.serviceInstanceInitializer.findPlanInstanceUrlVariableName(newBuildPlan); + this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, + newBuildPlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceInitializer.appendSetServiceInstanceState(newBuildPlan, + newBuildPlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + this.finalizer.finalize(newBuildPlan); return newBuildPlan; } BPELSituationAwareBuildProcessBuilder.LOG.warn("Couldn't create BuildPlan for ServiceTemplate {} in Definitions {} of CSAR {}", - serviceTemplate.getQName().toString(), definitions.getId(), - csarName); + serviceTemplate.getQName().toString(), definitions.getId(), + csarName); return null; } @@ -237,7 +232,7 @@ public List buildPlans(final String csarName, final AbstractDefini if (!serviceTemplate.hasBuildPlan()) { BPELSituationAwareBuildProcessBuilder.LOG.debug("ServiceTemplate {} has no BuildPlan, generating BuildPlan", - serviceTemplate.getQName().toString()); + serviceTemplate.getQName().toString()); final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); if (newBuildPlan != null) { @@ -247,14 +242,12 @@ public List buildPlans(final String csarName, final AbstractDefini } } else { BPELSituationAwareBuildProcessBuilder.LOG.debug("ServiceTemplate {} has BuildPlan, no generation needed", - serviceTemplate.getQName().toString()); + serviceTemplate.getQName().toString()); } } return plans; } - - private Map nodePolicyToId(Map> situationPolicies) { Map nodePolicyToIdMap = new HashMap(); @@ -285,5 +278,4 @@ private Map> getSituationPolici } return nodeToPolicies; } - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTerminationProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTerminationProcessBuilder.java new file mode 100644 index 000000000..7ca235937 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTerminationProcessBuilder.java @@ -0,0 +1,247 @@ +package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.planbuilder.core.AbstractTerminationPlanBuilder; +import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; +import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; +import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; +import org.opentosca.planbuilder.core.bpel.typebasednodehandler.BPELPluginHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.model.plan.AbstractPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELScope; +import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de + */ +public class BPELTerminationProcessBuilder extends AbstractTerminationPlanBuilder { + + private final static Logger LOG = LoggerFactory.getLogger(BPELTerminationProcessBuilder.class); + + // handler for abstract buildplan operations + private BPELPlanHandler planHandler; + + // class for initializing properties inside the build plan + private final PropertyVariableHandler propertyInitializer; + // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans + private SimplePlanBuilderServiceInstanceHandler serviceInstanceHandler; + // adds nodeInstanceIDs to each templatePlan + private NodeRelationInstanceVariablesHandler instanceVarsHandler; + // class for finalizing build plans (e.g when some template didn't receive + // some provisioning logic and they must be filled with empty elements) + private final BPELFinalizer finalizer; + + private final BPELPluginHandler bpelPluginHandler; + private final BPELScopeBuilder scopeBuilder; + + private CorrelationIDInitializer correlationHandler; + + public BPELTerminationProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + this.bpelPluginHandler = new BPELPluginHandler(pluginRegistry); + this.scopeBuilder = new BPELScopeBuilder(pluginRegistry); + try { + this.planHandler = new BPELPlanHandler(); + this.serviceInstanceHandler = new SimplePlanBuilderServiceInstanceHandler(); + this.instanceVarsHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); + this.correlationHandler = new CorrelationIDInitializer(); + } catch (final ParserConfigurationException e) { + LOG.error("Error while initializing BuildPlanHandler", e); + } + this.propertyInitializer = new PropertyVariableHandler(this.planHandler); + this.finalizer = new BPELFinalizer(); + } + + /* + * (non-Javadoc) + * + * @see org.opentosca.planbuilder.IPlanBuilder#buildPlan(java.lang.String, + * org.opentosca.planbuilder.model.tosca.AbstractDefinitions, javax.xml.namespace.QName) + */ + @Override + public BPELPlan buildPlan(final String csarName, final AbstractDefinitions definitions, + final AbstractServiceTemplate serviceTemplate) { + + final String processName = ModelUtils.makeValidNCName(serviceTemplate.getId() + "_terminationPlan"); + final String processNamespace = serviceTemplate.getTargetNamespace() + "_terminationPlan"; + + final AbstractPlan newAbstractTerminationPlan = + generateTOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate); + + final BPELPlan newTerminationPlan = + this.planHandler.createEmptyBPELPlan(processNamespace, processName, newAbstractTerminationPlan, + "terminate"); + + newTerminationPlan.setTOSCAInterfaceName("OpenTOSCA-Lifecycle-Interface"); + newTerminationPlan.setTOSCAOperationname("terminate"); + + this.planHandler.initializeBPELSkeleton(newTerminationPlan, csarName); + + this.instanceVarsHandler.addInstanceURLVarToTemplatePlans(newTerminationPlan, serviceTemplate); + this.instanceVarsHandler.addInstanceIDVarToTemplatePlans(newTerminationPlan, serviceTemplate); + + final Property2VariableMapping propMap = + this.propertyInitializer.initializePropertiesAsVariables(newTerminationPlan, serviceTemplate); + + // instanceDataAPI handling is done solely trough this extension + this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, + newTerminationPlan); + + // initialize instanceData handling, add + // instanceDataAPI/serviceInstanceID into input, add global + // variables to hold the value for plugins + this.serviceInstanceHandler.addServiceInstanceHandlingFromInput(newTerminationPlan); + String serviceTemplateURLVarName = + this.serviceInstanceHandler.getServiceTemplateURLVariableName(newTerminationPlan); + + String serviceInstanceId = this.serviceInstanceHandler.findServiceInstanceIdVarName(newTerminationPlan); + + this.serviceInstanceHandler.appendInitPropertyVariablesFromServiceInstanceData(newTerminationPlan, propMap, + serviceTemplateURLVarName, + serviceTemplate, "?state=STARTED&state=CREATED&state=CONFIGURED"); + + // fetch all nodeinstances that are running + this.instanceVarsHandler.addNodeInstanceFindLogic(newTerminationPlan, + "?state=STARTED&state=CREATED&state=CONFIGURED&serviceInstanceId=$bpelvar[" + serviceInstanceId + "]", + serviceTemplate); + this.instanceVarsHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(newTerminationPlan, propMap, + serviceTemplate); + + this.instanceVarsHandler.addRelationInstanceFindLogic(newTerminationPlan, "?state=CREATED&state=INITIAL&serviceInstanceId=$bpelvar[" + serviceInstanceId + "]", + serviceTemplate); + + final List changedActivities = runPlugins(newTerminationPlan, propMap, csarName); + + String serviceInstanceURLVarName = + this.serviceInstanceHandler.findServiceInstanceUrlVariableName(newTerminationPlan); + + this.serviceInstanceHandler.appendSetServiceInstanceState(newTerminationPlan, + newTerminationPlan.getBpelMainFlowElement(), + "DELETING", serviceInstanceURLVarName); + + this.serviceInstanceHandler.appendSetServiceInstanceState(newTerminationPlan, + newTerminationPlan.getBpelMainSequenceCallbackInvokeElement(), + "DELETED", serviceInstanceURLVarName); + + this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(newTerminationPlan, + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newTerminationPlan), + "ERROR", serviceInstanceURLVarName); + this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(newTerminationPlan, this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newTerminationPlan), "FAILED", this.serviceInstanceHandler.findPlanInstanceUrlVariableName(newTerminationPlan)); + + this.correlationHandler.addCorrellationID(newTerminationPlan); + + String planInstanceUrlVarName = this.serviceInstanceHandler.findPlanInstanceUrlVariableName(newTerminationPlan); + this.serviceInstanceHandler.appendSetServiceInstanceState(newTerminationPlan, + newTerminationPlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceHandler.appendSetServiceInstanceState(newTerminationPlan, + newTerminationPlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + + this.finalizer.finalize(newTerminationPlan); + + // add for each loop over found node and relation instances to terminate each running + // instance + for (final BPELScope activ : changedActivities) { + if (activ.getNodeTemplate() != null) { + final BPELPlanContext context = + new BPELPlanContext(scopeBuilder, newTerminationPlan, activ, propMap, newTerminationPlan.getServiceTemplate(), + serviceInstanceURLVarName, serviceInstanceId, serviceTemplateURLVarName, csarName); + this.instanceVarsHandler.appendCountInstancesLogic(context, activ.getNodeTemplate(), + "?state=STARTED&state=CREATED&state=CONFIGURED&serviceInstanceId=$bpelvar[" + serviceInstanceId + "]"); + } else { + final BPELPlanContext context = + new BPELPlanContext(scopeBuilder, newTerminationPlan, activ, propMap, newTerminationPlan.getServiceTemplate(), + serviceInstanceURLVarName, serviceInstanceId, serviceTemplateURLVarName, csarName); + this.instanceVarsHandler.appendCountInstancesLogic(context, activ.getRelationshipTemplate(), + "?state=CREATED&state=INITIAL&serviceInstanceId=$bpelvar[" + serviceInstanceId + "]"); + } + } + + return newTerminationPlan; + } + + /* + * (non-Javadoc) + * + * @see org.opentosca.planbuilder.IPlanBuilder#buildPlans(java.lang.String, + * org.opentosca.planbuilder.model.tosca.AbstractDefinitions) + */ + @Override + public List buildPlans(final String csarName, final AbstractDefinitions definitions) { + final List plans = new ArrayList<>(); + for (final AbstractServiceTemplate serviceTemplate : definitions.getServiceTemplates()) { + + if (!serviceTemplate.hasBuildPlan()) { + LOG.debug("ServiceTemplate {} has no TerminationPlan, generating TerminationPlan", + serviceTemplate.getQName().toString()); + final BPELPlan newBuildPlan = buildPlan(csarName, definitions, serviceTemplate); + + if (newBuildPlan != null) { + LOG.debug("Created TerminationPlan " + + newBuildPlan.getBpelProcessElement().getAttribute("name")); + plans.add(newBuildPlan); + } + } else { + LOG.debug("ServiceTemplate {} has TerminationPlan, no generation needed", + serviceTemplate.getQName().toString()); + } + } + return plans; + } + + /** + * This method will execute plugins on each TemplatePlan inside the given plan for termination of each node and + * relation. + * + * @param plan the plan to execute the plugins on + * @param serviceTemplate the serviceTemplate the plan belongs to + * @param propMap a PropertyMapping from NodeTemplate to Properties to BPELVariables + */ + private List runPlugins(final BPELPlan plan, final Property2VariableMapping propMap, String csarName) { + + String serviceInstanceUrl = this.serviceInstanceHandler.findServiceInstanceUrlVariableName(plan); + String serviceInstanceId = this.serviceInstanceHandler.findServiceInstanceIdVarName(plan); + String serviceTemplateUrl = this.serviceInstanceHandler.findServiceTemplateUrlVariableName(plan); + + final List changedActivities = new ArrayList<>(); + for (final BPELScope bpelScope : plan.getTemplateBuildPlans()) { + boolean result = false; + if (bpelScope.getNodeTemplate() != null) { + final AbstractNodeTemplate nodeTemplate = bpelScope.getNodeTemplate(); + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, plan, bpelScope, propMap, plan.getServiceTemplate(), + serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); + result = this.bpelPluginHandler.handleActivity(context, bpelScope, nodeTemplate); + } else { + AbstractRelationshipTemplate relationshipTempalte = bpelScope.getRelationshipTemplate(); + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, plan, bpelScope, propMap, plan.getServiceTemplate(), + serviceInstanceUrl, serviceInstanceId, serviceTemplateUrl, csarName); + result = this.bpelPluginHandler.handleActivity(context, bpelScope, relationshipTempalte); + } + + if (result) { + changedActivities.add(bpelScope); + } + } + return changedActivities; + } +} diff --git a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTestManagementProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTestManagementProcessBuilder.java similarity index 82% rename from org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTestManagementProcessBuilder.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTestManagementProcessBuilder.java index 343ef9718..ffffef864 100644 --- a/org.opentosca.planbuilder.core.bpel/src/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTestManagementProcessBuilder.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTestManagementProcessBuilder.java @@ -10,8 +10,10 @@ import javax.xml.namespace.QName; import javax.xml.parsers.ParserConfigurationException; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.container.core.tosca.convention.Interfaces; -import org.opentosca.planbuilder.AbstractManagementFeaturePlanBuilder; +import org.opentosca.planbuilder.core.AbstractManagementFeaturePlanBuilder; +import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; @@ -20,8 +22,10 @@ import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; import org.opentosca.planbuilder.core.bpel.typebasednodehandler.BPELPluginHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; import org.opentosca.planbuilder.model.plan.ActivityType; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan.VariableType; @@ -34,60 +38,51 @@ import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.Property2VariableMapping; -import org.opentosca.planbuilder.plugins.context.Variable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** *

    - * This process builder creates a test management plan if one of the NodeTemplates in the topology - * is of a type that defines the test interface. + * This process builder creates a test management plan if one of the NodeTemplates in the topology is of a type that + * defines the test interface. *

    - * + *

    * Copyright 2019 IAAS University of Stuttgart
    *
    */ public class BPELTestManagementProcessBuilder extends AbstractManagementFeaturePlanBuilder { private final static Logger LOG = LoggerFactory.getLogger(BPELTestManagementProcessBuilder.class); - + // class for finalizing build plans (e.g when some template didn't receive + // some provisioning logic and they must be filled with empty elements) + private final BPELFinalizer finalizer; + // class for initializing properties inside the build plan + private final PropertyVariableHandler propertyInitializer; + private final BPELPluginHandler bpelPluginHandler; // handler for abstract buildplan operations public BPELPlanHandler planHandler; - // adds nodeInstanceIDs to each templatePlan private NodeRelationInstanceVariablesHandler instanceVarsHandler; - - // class for finalizing build plans (e.g when some template didn't receive - // some provisioning logic and they must be filled with empty elements) - private final BPELFinalizer finalizer; - // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans private SimplePlanBuilderServiceInstanceHandler serviceInstanceVarsHandler; - - // class for initializing properties inside the build plan - private final PropertyVariableHandler propertyInitializer; - private SimplePlanBuilderServiceInstanceHandler serviceInstanceInitializer; - private CorrelationIDInitializer correlationHandler; - private final BPELPluginHandler bpelPluginHandler = new BPELPluginHandler(); - /** *

    * Default Constructor *

    */ - public BPELTestManagementProcessBuilder() { + public BPELTestManagementProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + bpelPluginHandler = new BPELPluginHandler(pluginRegistry); try { this.planHandler = new BPELPlanHandler(); this.serviceInstanceInitializer = new SimplePlanBuilderServiceInstanceHandler(); this.instanceVarsHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); this.serviceInstanceVarsHandler = new SimplePlanBuilderServiceInstanceHandler(); this.correlationHandler = new CorrelationIDInitializer(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { LOG.error("Error while initializing TestPlanHandler", e); } this.propertyInitializer = new PropertyVariableHandler(this.planHandler); @@ -110,12 +105,12 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin final AbstractPlan abstractTestPlan = generateMOG(new QName(processNamespace, processName).toString(), definitions, serviceTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_TEST, ActivityType.TEST, false); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_TEST, ActivityType.TEST, false); LOG.debug("Generated the following abstract test plan: "); LOG.debug(abstractTestPlan.toString()); - abstractTestPlan.setType(PlanType.MANAGE); + abstractTestPlan.setType(PlanType.MANAGEMENT); final BPELPlan newTestPlan = this.planHandler.createEmptyBPELPlan(processNamespace, processName, abstractTestPlan, "test"); @@ -132,13 +127,13 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin // initialize instanceData handling this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, - newTestPlan); + newTestPlan); this.serviceInstanceVarsHandler.addServiceInstanceHandlingFromInput(newTestPlan); final String serviceTemplateURLVarName = this.serviceInstanceVarsHandler.getServiceTemplateURLVariableName(newTestPlan); this.serviceInstanceVarsHandler.appendInitPropertyVariablesFromServiceInstanceData(newTestPlan, propMap, - serviceTemplateURLVarName, - serviceTemplate, null); + serviceTemplateURLVarName, + serviceTemplate, null); final String serviceInstanceUrl = this.serviceInstanceInitializer.findServiceInstanceUrlVariableName(newTestPlan); @@ -147,22 +142,31 @@ public BPELPlan buildPlan(final String csarName, final AbstractDefinitions defin this.serviceInstanceInitializer.findServiceTemplateUrlVariableName(newTestPlan); this.instanceVarsHandler.addNodeInstanceFindLogic(newTestPlan, - "?state=STARTED&state=CREATED&state=CONFIGURED", - serviceTemplate); + "?state=STARTED&state=CREATED&state=CONFIGURED", + serviceTemplate); this.instanceVarsHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(newTestPlan, propMap, serviceTemplate); runPlugins(newTestPlan, propMap, serviceInstanceUrl, serviceInstanceID, serviceTemplateUrl, csarName); this.correlationHandler.addCorrellationID(newTestPlan); - + this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newTestPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newTestPlan), - "ERROR", serviceInstanceUrl); + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newTestPlan), + "ERROR", serviceInstanceUrl); this.serviceInstanceVarsHandler.appendSetServiceInstanceStateAsChild(newTestPlan, - this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newTestPlan), - "FAILED", - this.serviceInstanceVarsHandler.findPlanInstanceUrlVariableName(newTestPlan)); - + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(newTestPlan), + "FAILED", + this.serviceInstanceVarsHandler.findPlanInstanceUrlVariableName(newTestPlan)); + + String planInstanceUrlVarName = this.serviceInstanceInitializer.findPlanInstanceUrlVariableName(newTestPlan); + this.serviceInstanceInitializer.appendSetServiceInstanceState(newTestPlan, + newTestPlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceInitializer.appendSetServiceInstanceState(newTestPlan, + newTestPlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + this.finalizer.finalize(newTestPlan); LOG.debug("Created Plan:"); @@ -179,7 +183,7 @@ public List buildPlans(final String csarName, final AbstractDefini if (containsManagementInterface(serviceTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_TEST)) { LOG.debug("ServiceTemplate {} contains NodeTypes with defined test interface.", - serviceTemplate.getName()); + serviceTemplate.getName()); final BPELPlan newTestPlan = buildPlan(csarName, definitions, serviceTemplate); if (Objects.nonNull(newTestPlan)) { LOG.debug("Created Test Management Plan " @@ -198,7 +202,7 @@ private void runPlugins(final BPELPlan testPlan, final Property2VariableMapping final String serviceTemplateUrl, final String csarFileName) { for (final BPELScope bpelScope : testPlan.getTemplateBuildPlans()) { - final BPELPlanContext context = new BPELPlanContext(testPlan, bpelScope, map, testPlan.getServiceTemplate(), + final BPELPlanContext context = new BPELPlanContext(new BPELScopeBuilder(pluginRegistry), testPlan, bpelScope, map, testPlan.getServiceTemplate(), serviceInstanceUrl, serviceInstanceID, serviceTemplateUrl, csarFileName); if (Objects.nonNull(bpelScope.getNodeTemplate())) { @@ -214,7 +218,7 @@ private void runPlugins(final BPELPlan testPlan, final Property2VariableMapping ModelUtils.getNodesFromNodeToSink(nodeTemplate, nodesForMatching); LOG.debug("NodeTemplate {} has {} test operations defined.", nodeTemplate.getName(), - testInterface.getOperations().size()); + testInterface.getOperations().size()); for (final AbstractOperation testOperation : testInterface.getOperations()) { final Map inputMapping = new HashMap<>(); @@ -222,10 +226,11 @@ private void runPlugins(final BPELPlan testPlan, final Property2VariableMapping // search for input parameters in the topology stack LOG.debug("Test {} on NodeTemplate {} needs the following input parameters:", - testOperation.getName(), nodeTemplate.getName()); + testOperation.getName(), nodeTemplate.getName()); for (final AbstractParameter param : testOperation.getInputParameters()) { LOG.debug("Input param: {}", param.getName()); - found: for (final AbstractNodeTemplate nodeForMatching : nodesForMatching) { + found: + for (final AbstractNodeTemplate nodeForMatching : nodesForMatching) { for (final String propName : ModelUtils.getPropertyNames(nodeForMatching)) { if (param.getName().equals(propName)) { inputMapping.put(param, context.getPropertyVariable(nodeForMatching, propName)); @@ -238,7 +243,7 @@ private void runPlugins(final BPELPlan testPlan, final Property2VariableMapping // create output variable if 'Result' is defined as output parameter final Optional optional = testOperation.getOutputParameters().stream() - .filter(param -> param.getName().equals("Result")).findFirst(); + .filter(param -> param.getName().equals("Result")).findFirst(); if (optional.isPresent()) { final AbstractParameter resultParam = optional.get(); @@ -247,11 +252,11 @@ private void runPlugins(final BPELPlan testPlan, final Property2VariableMapping final String resultVarName = nodeTemplate.getName() + "-" + testOperation.getName() + "-result" + System.currentTimeMillis(); context.addGlobalVariable(resultVarName, VariableType.TYPE, - new QName(xsdNamespace, "anyType", xsdPrefix)); + new QName(xsdNamespace, "anyType", xsdPrefix)); LOG.debug("Name of result variable: " + resultVarName); - outputMapping.put(resultParam, context.getVariable(resultVarName)); + outputMapping.put(resultParam, BPELPlanContext.getVariable(resultVarName)); // add result to the plan output message final String outputName = @@ -264,7 +269,7 @@ private void runPlugins(final BPELPlan testPlan, final Property2VariableMapping // execute the test context.executeOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_TEST, - testOperation.getName(), inputMapping, outputMapping); + testOperation.getName(), inputMapping, outputMapping); } } else { LOG.error("Unable to find test interface for NodeTemplate {}", nodeTemplate.getName()); diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTransformationProcessBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTransformationProcessBuilder.java new file mode 100644 index 000000000..ea1a7e077 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/java/org/opentosca/planbuilder/core/bpel/typebasedplanbuilder/BPELTransformationProcessBuilder.java @@ -0,0 +1,593 @@ +package org.opentosca.planbuilder.core.bpel.typebasedplanbuilder; + +import java.util.Collection; +import java.util.HashSet; +import java.util.List; + +import javax.inject.Inject; +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.planbuilder.core.AbstractTransformingPlanbuilder; +import org.opentosca.planbuilder.core.bpel.artifactbasednodehandler.BPELScopeBuilder; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.bpel.handlers.BPELFinalizer; +import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; +import org.opentosca.planbuilder.core.bpel.handlers.CorrelationIDInitializer; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.EmptyPropertyToInputHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.PropertyVariableHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.ServiceTemplateBoundaryPropertyMappingsToOutputHandler; +import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; +import org.opentosca.planbuilder.core.bpel.typebasednodehandler.BPELPluginHandler; +import org.opentosca.planbuilder.core.plugins.context.Property2VariableMapping; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.opentosca.planbuilder.model.plan.AbstractActivity; +import org.opentosca.planbuilder.model.plan.AbstractPlan; +import org.opentosca.planbuilder.model.plan.AbstractTransformationPlan; +import org.opentosca.planbuilder.model.plan.ActivityType; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELScope; +import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +@Component +public class BPELTransformationProcessBuilder extends AbstractTransformingPlanbuilder { + + private static final Logger LOG = LoggerFactory.getLogger(BPELTransformationProcessBuilder.class); + // class for initializing properties inside the plan + private final PropertyVariableHandler propertyInitializer; + // class for initializing output with boundarydefinitions of a + // serviceTemplate + private final ServiceTemplateBoundaryPropertyMappingsToOutputHandler propertyOutputInitializer; + private final BPELScopeBuilder scopeBuilder; + // adds serviceInstance Variable and instanceDataAPIUrl to buildPlans + + private SimplePlanBuilderServiceInstanceHandler serviceInstanceHandler; + + // class for finalizing build plans (e.g when some template didn't receive + // some provisioning logic and they must be filled with empty elements) + private final BPELFinalizer finalizer; + + private BPELPlanHandler planHandler; + + private BPELPluginHandler bpelPluginHandler; + + private NodeRelationInstanceVariablesHandler nodeRelationInstanceHandler; + + private final EmptyPropertyToInputHandler emptyPropInit; + + private CorrelationIDInitializer correlationHandler; + + @Inject + public BPELTransformationProcessBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + this.bpelPluginHandler = new BPELPluginHandler(pluginRegistry); + this.scopeBuilder = new BPELScopeBuilder(pluginRegistry); + this.emptyPropInit = new EmptyPropertyToInputHandler(scopeBuilder); + try { + this.planHandler = new BPELPlanHandler(); + this.serviceInstanceHandler = new SimplePlanBuilderServiceInstanceHandler(); + this.nodeRelationInstanceHandler = new NodeRelationInstanceVariablesHandler(this.planHandler); + this.correlationHandler = new CorrelationIDInitializer(); + } catch (final ParserConfigurationException e) { + LOG.error("Error while initializing BuildPlanHandler", e); + } + // TODO seems ugly + this.propertyInitializer = new PropertyVariableHandler(this.planHandler); + this.propertyOutputInitializer = new ServiceTemplateBoundaryPropertyMappingsToOutputHandler(); + this.finalizer = new BPELFinalizer(); + } + + /** + * Creates an Adaptation PLan that can change the configuration of a running Service Instance by transforming the + * current state of nodes and relations (sourceNodeTemplates and -RelationshipTemplates) to a target configuration + * (targetNodeTemplates and -RelationshipTemplates). + * + * @param csarName the csar of the service template + * @param definitions the definitions document of th service template + * @param serviceTemplateId the id of the serviceTemplate to adapt its service instance + * @param sourceNodeTemplates the nodeTemplates to adapt from + * @param sourceRelationshipTemplates the relationships to adapt from + * @param targetNodeTemplates the target configuration of nodes to adapt to + * @param targetRelationshipTemplates the target configuration of relations to adapt to + * @return a BPEL Plan that is able to adapt an instance from the given current and target configurations + */ + public BPELPlan buildPlan(String csarName, AbstractDefinitions definitions, QName serviceTemplateId, + Collection sourceNodeTemplates, + Collection sourceRelationshipTemplates, + Collection targetNodeTemplates, + Collection targetRelationshipTemplates) { + AbstractServiceTemplate serviceTemplate = this.getServiceTemplate(definitions, serviceTemplateId); + + // generate abstract plan + AbstractTransformationPlan adaptationPlan = + this.generateTFOG(csarName, definitions, serviceTemplate, sourceNodeTemplates, sourceRelationshipTemplates, + csarName, definitions, serviceTemplate, targetNodeTemplates, targetRelationshipTemplates); + + Long id = System.currentTimeMillis(); + + // transform to bpel skeleton + final String processName = + ModelUtils.makeValidNCName(serviceTemplate.getId() + "_adaptationPlan_" + id); + final String processNamespace = serviceTemplate.getTargetNamespace() + "_adaptiationPlan"; + + BPELPlan transformationBPELPlan = + this.planHandler.createEmptyBPELPlan(processNamespace, processName, adaptationPlan, "adapt" + id); + + transformationBPELPlan.setTOSCAInterfaceName("OpenTOSCA-Transformation-Interface"); + transformationBPELPlan.setTOSCAOperationname("adapt" + id); + + this.planHandler.initializeBPELSkeleton(transformationBPELPlan, csarName); + // instanceDataAPI handling is done solely trough this extension + this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, + transformationBPELPlan); + + // set instance ids for relationships and nodes + this.addNodeRelationInstanceVariables(transformationBPELPlan, serviceTemplate, serviceTemplate); + + // generate variables for properties + final Property2VariableMapping sourcesProp2VarMap = + this.propertyInitializer.initializePropertiesAsVariables(transformationBPELPlan, serviceTemplate, + adaptationPlan.getHandledSourceServiceTemplateNodes(), + adaptationPlan.getHandledSourceServiceTemplateRelations()); + + final Property2VariableMapping targetsProp2VarMap = + this.propertyInitializer.initializePropertiesAsVariables(transformationBPELPlan, serviceTemplate, + adaptationPlan.getHandledTargetServiceTemplateNodes(), + adaptationPlan.getHandledTargetServiceTemplateRelations()); + + // add correlation id and handling for input and output + this.correlationHandler.addCorrellationID(transformationBPELPlan); + + // service instance handling + String sourceServiceInstancesURL = + this.serviceInstanceHandler.addInstanceDataAPIURLVariable(transformationBPELPlan); + + String serviceTemplateURL = this.serviceInstanceHandler.addServiceTemplateURLVariable(transformationBPELPlan); + + String serviceInstanceID = this.serviceInstanceHandler.addServiceInstanceIDVariable(transformationBPELPlan); + + String serviceInstanceURL = this.serviceInstanceHandler.addServiceInstanceURLVariable(transformationBPELPlan); + + String planInstanceURL = this.serviceInstanceHandler.addPlanInstanceURLVariable(transformationBPELPlan); + + // handle sourceinstance information, e.g., load instance url/, template url and + // properties + // append reading source service instance from input and setting created + // variables + this.serviceInstanceHandler.addServiceInstanceHandlingFromInput(transformationBPELPlan, + sourceServiceInstancesURL, serviceInstanceURL, + serviceTemplateURL, serviceInstanceID, + planInstanceURL); + + // load nodeTemplate properties from source service instance + Collection terminationScopes = this.getTerminationScopes(transformationBPELPlan); + this.serviceInstanceHandler.appendInitPropertyVariablesFromServiceInstanceData(transformationBPELPlan, + sourcesProp2VarMap, serviceTemplateURL, + terminationScopes, + serviceTemplate, "?state=STARTED&state=CREATED&state=CONFIGURED"); + + // return created service instance + this.serviceInstanceHandler.appendAssignServiceInstanceIdToOutput(transformationBPELPlan, serviceInstanceID); + + // we need only input for instances that will be created in the target, deleted or migrated node + // instances should never get data from the input + this.emptyPropInit.initializeEmptyPropertiesAsInputParam(this.getProvisioningScopes(transformationBPELPlan), + transformationBPELPlan, sourcesProp2VarMap, + serviceInstanceURL, serviceInstanceID, + serviceTemplateURL, serviceTemplate, csarName); + + for (BPELScope scope : terminationScopes) { + if (scope.getNodeTemplate() != null) { + this.nodeRelationInstanceHandler.addNodeInstanceFindLogic(scope, serviceTemplateURL, + "?state=STARTED&state=CREATED&state=CONFIGURED", + serviceTemplate); + this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(scope, sourcesProp2VarMap, + serviceTemplate); + } else { + this.nodeRelationInstanceHandler.addRelationInstanceFindLogic(scope, serviceTemplateURL, + "?state=CREATED&state=INITIAL", + serviceTemplate); + + this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnRelationInstanceID(scope, sourcesProp2VarMap, + serviceTemplate); + } + } + + for (BPELScope scope : getMigrationScopes(transformationBPELPlan)) { + if (scope.getNodeTemplate() != null) { + this.nodeRelationInstanceHandler.addNodeInstanceFindLogic(scope, serviceTemplateURL, + "?state=STARTED&state=CREATED&state=CONFIGURED", + serviceTemplate); + this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(scope, sourcesProp2VarMap, + serviceTemplate); + } else { + this.nodeRelationInstanceHandler.addRelationInstanceFindLogic(scope, serviceTemplateURL, + "?state=CREATED&state=INITIAL", + serviceTemplate); + + this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnRelationInstanceID(scope, sourcesProp2VarMap, + serviceTemplate); + } + } + + this.runPlugins(transformationBPELPlan, sourcesProp2VarMap, targetsProp2VarMap, csarName, serviceTemplate, serviceInstanceURL, + serviceInstanceID, serviceTemplateURL, csarName, serviceTemplate, serviceInstanceURL, + serviceInstanceID, serviceTemplateURL); + + this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, + transformationBPELPlan.getBpelMainFlowElement(), + "ADAPTING", serviceInstanceURL); + + this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, + transformationBPELPlan.getBpelMainSequenceOutputAssignElement(), + "CREATED", serviceInstanceURL); + + this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(transformationBPELPlan, + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(transformationBPELPlan), + "ERROR", serviceInstanceURL); + this.serviceInstanceHandler.appendSetServiceInstanceStateAsChild(transformationBPELPlan, + this.planHandler.getMainCatchAllFaultHandlerSequenceElement(transformationBPELPlan), + "FAILED", + this.serviceInstanceHandler.findPlanInstanceUrlVariableName(transformationBPELPlan)); + + String planInstanceUrlVarName = this.serviceInstanceHandler.findPlanInstanceUrlVariableName(transformationBPELPlan); + this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, + transformationBPELPlan.getBpelMainFlowElement(), + "RUNNING", planInstanceUrlVarName); + + this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, + transformationBPELPlan.getBpelMainSequenceOutputAssignElement(), + "FINISHED", planInstanceUrlVarName); + + this.finalizer.finalize(transformationBPELPlan); + + // iterate over terminated nodes and create for each loop per instance + for (BPELScope scope : terminationScopes) { + if (scope.getNodeTemplate() != null) { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, transformationBPELPlan, scope, sourcesProp2VarMap, + transformationBPELPlan.getServiceTemplate(), serviceInstanceURL, serviceInstanceID, + serviceTemplateURL, csarName); + this.nodeRelationInstanceHandler.appendCountInstancesLogic(context, scope.getNodeTemplate(), + "?state=STARTED&state=CREATED&state=CONFIGURED"); + } else { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, transformationBPELPlan, scope, sourcesProp2VarMap, + transformationBPELPlan.getServiceTemplate(), serviceInstanceURL, serviceInstanceID, + serviceTemplateURL, csarName); + this.nodeRelationInstanceHandler.appendCountInstancesLogic(context, scope.getRelationshipTemplate(), + "?state=CREATED&state=INITIAL"); + } + } + + return transformationBPELPlan; + } + + @Override + public BPELPlan buildPlan(String sourceCsarName, AbstractDefinitions sourceDefinitions, + QName sourceServiceTemplateId, String targetCsarName, + AbstractDefinitions targetDefinitions, QName targetServiceTemplateId) { + + AbstractServiceTemplate sourceServiceTemplate = null; + AbstractServiceTemplate targetServiceTemplate = null; + sourceServiceTemplate = this.getServiceTemplate(sourceDefinitions, sourceServiceTemplateId); + targetServiceTemplate = this.getServiceTemplate(targetDefinitions, targetServiceTemplateId); + + // generate abstract plan + AbstractTransformationPlan transformationPlan = + this.generateTFOG(sourceCsarName, sourceDefinitions, sourceServiceTemplate, targetCsarName, + targetDefinitions, targetServiceTemplate); + + // transform to bpel skeleton + final String processName = ModelUtils.makeValidNCName(sourceServiceTemplate.getId() + "_transformTo_" + + targetServiceTemplate.getId() + "_plan"); + final String processNamespace = sourceServiceTemplate.getTargetNamespace() + "_transformPlan"; + + BPELPlan transformationBPELPlan = + this.planHandler.createEmptyBPELPlan(processNamespace, processName, transformationPlan, "transform"); + + transformationBPELPlan.setTOSCAInterfaceName("OpenTOSCA-Transformation-Interface"); + transformationBPELPlan.setTOSCAOperationname("transform"); + + this.planHandler.initializeBPELSkeleton(transformationBPELPlan, sourceCsarName); + // instanceDataAPI handling is done solely trough this extension + this.planHandler.registerExtension("http://www.apache.org/ode/bpel/extensions/bpel4restlight", true, + transformationBPELPlan); + + // set instance ids for relationships and nodes + this.addNodeRelationInstanceVariables(transformationBPELPlan, sourceServiceTemplate, targetServiceTemplate); + + // generate variables for properties + final Property2VariableMapping sourcePropMap = + this.propertyInitializer.initializePropertiesAsVariables(transformationBPELPlan, sourceServiceTemplate, + transformationPlan.getHandledSourceServiceTemplateNodes(), + transformationPlan.getHandledSourceServiceTemplateRelations()); + final Property2VariableMapping targetPropMap = + this.propertyInitializer.initializePropertiesAsVariables(transformationBPELPlan, targetServiceTemplate, + transformationPlan.getHandledTargetServiceTemplateNodes(), + transformationPlan.getHandledTargetServiceTemplateRelations()); + + // add correlation id and handling for input and output + this.correlationHandler.addCorrellationID(transformationBPELPlan); + + // service instance handling + String sourceServiceInstancesURL = + this.serviceInstanceHandler.addInstanceDataAPIURLVariable(transformationBPELPlan); + String targetServiceInstancesURL = + this.serviceInstanceHandler.addInstanceDataAPIURLVariable(transformationBPELPlan); + String sourceServiceTemplateURL = + this.serviceInstanceHandler.addServiceTemplateURLVariable(transformationBPELPlan); + String targetServiceTemplateURL = + this.serviceInstanceHandler.addServiceTemplateURLVariable(transformationBPELPlan); + String sourceServiceInstanceID = + this.serviceInstanceHandler.addServiceInstanceIDVariable(transformationBPELPlan); + String targetServiceInstanceID = + this.serviceInstanceHandler.addServiceInstanceIDVariable(transformationBPELPlan); + String sourceServiceInstanceURL = + this.serviceInstanceHandler.addServiceInstanceURLVariable(transformationBPELPlan); + String targetServiceInstanceURL = + this.serviceInstanceHandler.addServiceInstanceURLVariable(transformationBPELPlan); + + String planInstanceURL = this.serviceInstanceHandler.addPlanInstanceURLVariable(transformationBPELPlan); + + // handle sourceinstance information, e.g., load instance url/, template url and + // properties + // append reading source service instance from input and setting created + // variables + this.serviceInstanceHandler.addServiceInstanceHandlingFromInput(transformationBPELPlan, + sourceServiceInstancesURL, + sourceServiceInstanceURL, + sourceServiceTemplateURL, + sourceServiceInstanceID, planInstanceURL); + + // load nodeTemplate properties from source service instance + Collection terminationScopes = this.getTerminationScopes(transformationBPELPlan); + this.serviceInstanceHandler.appendInitPropertyVariablesFromServiceInstanceData(transformationBPELPlan, + sourcePropMap, + sourceServiceTemplateURL, + terminationScopes, + sourceServiceTemplate, "?state=STARTED&state=CREATED&state=CONFIGURED"); + + // handle target service instance information + this.serviceInstanceHandler.initServiceInstancesURLVariableFromAvailableServiceInstanceUrlVar(transformationBPELPlan, + sourceServiceInstancesURL, + targetServiceTemplateId, + targetCsarName, + targetServiceInstancesURL); + // create service instance for target + this.serviceInstanceHandler.appendCreateServiceInstance(transformationBPELPlan, targetServiceInstancesURL, + targetServiceInstanceURL, targetServiceInstanceID, + targetServiceTemplateURL, planInstanceURL, true); + + // return created service instance + this.serviceInstanceHandler.appendAssignServiceInstanceIdToOutput(transformationBPELPlan, + targetServiceInstanceID); + + // we need only input for instances that will be created in the target, deleted or migrated node + // instances should never get data from the input + this.emptyPropInit.initializeEmptyPropertiesAsInputParam(this.getProvisioningScopes(transformationBPELPlan), + transformationBPELPlan, targetPropMap, + targetServiceInstanceURL, targetServiceInstanceID, + targetServiceTemplateURL, targetServiceTemplate, + targetCsarName); + + for (BPELScope scope : terminationScopes) { + if (scope.getNodeTemplate() != null) { + this.nodeRelationInstanceHandler.addNodeInstanceFindLogic(scope, sourceServiceTemplateURL, + "?state=STARTED&state=CREATED&state=CONFIGURED", + sourceServiceTemplate); + this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(scope, sourcePropMap, + sourceServiceTemplate); + } else { + this.nodeRelationInstanceHandler.addRelationInstanceFindLogic(scope, sourceServiceTemplateURL, + "?state=CREATED&state=INITIAL", + sourceServiceTemplate); + + this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnRelationInstanceID(scope, + sourcePropMap, + sourceServiceTemplate); + } + } + + for (BPELScope scope : getMigrationScopes(transformationBPELPlan)) { + if (scope.getNodeTemplate() != null) { + this.nodeRelationInstanceHandler.addNodeInstanceFindLogic(scope, sourceServiceTemplateURL, + "?state=STARTED&state=CREATED&state=CONFIGURED", + sourceServiceTemplate); + this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnNodeInstanceID(scope, sourcePropMap, + sourceServiceTemplate); + } else { + this.nodeRelationInstanceHandler.addRelationInstanceFindLogic(scope, sourceServiceTemplateURL, + "?state=CREATED&state=INITIAL", + sourceServiceTemplate); + + this.nodeRelationInstanceHandler.addPropertyVariableUpdateBasedOnRelationInstanceID(scope, + sourcePropMap, + sourceServiceTemplate); + } + } + + this.runPlugins(transformationBPELPlan, sourcePropMap, targetPropMap, sourceCsarName, sourceServiceTemplate, + sourceServiceInstanceURL, sourceServiceInstanceID, sourceServiceTemplateURL, targetCsarName, + targetServiceTemplate, targetServiceInstanceURL, targetServiceInstanceID, + targetServiceTemplateURL); + + this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, + transformationBPELPlan.getBpelMainFlowElement(), + "MIGRATING", sourceServiceInstanceURL); + this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, + transformationBPELPlan.getBpelMainFlowElement(), + "CREATING", targetServiceInstanceURL); + this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, + transformationBPELPlan.getBpelMainSequenceOutputAssignElement(), + "MIGRATED", sourceServiceInstanceURL); + this.serviceInstanceHandler.appendSetServiceInstanceState(transformationBPELPlan, + transformationBPELPlan.getBpelMainSequenceOutputAssignElement(), + "CREATED", targetServiceInstanceURL); + + this.finalizer.finalize(transformationBPELPlan); + + // iterate over terminated nodes and create for each loop per instance + for (BPELScope scope : terminationScopes) { + if (scope.getNodeTemplate() != null) { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, transformationBPELPlan, scope, sourcePropMap, + transformationBPELPlan.getServiceTemplate(), sourceServiceInstanceURL, sourceServiceInstanceID, + sourceServiceTemplateURL, sourceCsarName); + this.nodeRelationInstanceHandler.appendCountInstancesLogic(context, scope.getNodeTemplate(), + "?state=STARTED&state=CREATED&state=CONFIGURED"); + } else { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, transformationBPELPlan, scope, sourcePropMap, + transformationBPELPlan.getServiceTemplate(), sourceServiceInstanceURL, sourceServiceInstanceID, + sourceServiceTemplateURL, sourceCsarName); + this.nodeRelationInstanceHandler.appendCountInstancesLogic(context, scope.getRelationshipTemplate(), + "?state=CREATED&state=INITIAL"); + } + } + + return transformationBPELPlan; + } + + private Collection getMigrationScopes(BPELPlan plan) { + return this.getScopesByType(plan, ActivityType.MIGRATION); + } + + private Collection getScopesByType(BPELPlan plan, ActivityType type) { + Collection scopes = new HashSet(); + for (AbstractActivity act : plan.getAbstract2BPEL().keySet()) { + if (act.getType().equals(type)) { + scopes.add(plan.getAbstract2BPEL().get(act)); + } + } + return scopes; + } + + private Collection getTerminationScopes(BPELPlan plan) { + return this.getScopesByType(plan, ActivityType.TERMINATION); + } + + private Collection getProvisioningScopes(BPELPlan plan) { + return this.getScopesByType(plan, ActivityType.PROVISIONING); + } + + private AbstractServiceTemplate getServiceTemplate(AbstractDefinitions defs, QName serviceTemplateId) { + for (AbstractServiceTemplate servTemplate : defs.getServiceTemplates()) { + if (servTemplate.getQName().equals(serviceTemplateId)) { + return servTemplate; + } + } + return null; + } + + private void addNodeRelationInstanceVariables(BPELPlan plan, AbstractServiceTemplate sourceServiceTemplate, + AbstractServiceTemplate targetServiceTemplate) { + this.nodeRelationInstanceHandler.addInstanceIDVarToTemplatePlans(plan, sourceServiceTemplate); + this.nodeRelationInstanceHandler.addInstanceIDVarToTemplatePlans(plan, targetServiceTemplate); + + this.nodeRelationInstanceHandler.addInstanceURLVarToTemplatePlans(plan, sourceServiceTemplate); + this.nodeRelationInstanceHandler.addInstanceURLVarToTemplatePlans(plan, targetServiceTemplate); + } + + @Override + public List buildPlans(String sourceCsarName, AbstractDefinitions sourceDefinitions, + String targetCsarName, AbstractDefinitions targetDefinitions) { + // TODO Auto-generated method stub + return null; + } + + private void runPlugins(final BPELPlan buildPlan, final Property2VariableMapping sourceServiceTemplateMap, + final Property2VariableMapping targetServiceTemplateMap, String sourceCsarName, + AbstractServiceTemplate sourceServiceTemplate, String sourceServiceInstanceUrl, + String sourceServiceInstanceId, String sourceServiceTemplateUrl, String targetCsarName, + AbstractServiceTemplate targetServiceTemplate, String targetServiceInstanceUrl, + String targetServiceInstanceId, String targetServiceTemplateUrl) { + + for (final BPELScope bpelScope : buildPlan.getTemplateBuildPlans()) { + + if (bpelScope.getNodeTemplate() != null) { + + AbstractActivity activity = bpelScope.getActivity(); + + if (activity.getType().equals(ActivityType.PROVISIONING)) { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, targetServiceTemplateMap, + targetServiceTemplate, targetServiceInstanceUrl, targetServiceInstanceId, + targetServiceTemplateUrl, targetCsarName); + this.bpelPluginHandler.handleActivity(context, bpelScope, bpelScope.getNodeTemplate()); + } else if (activity.getType().equals(ActivityType.TERMINATION)) { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, sourceServiceTemplateMap, + sourceServiceTemplate, sourceServiceInstanceUrl, sourceServiceInstanceId, + sourceServiceTemplateUrl, sourceCsarName); + this.bpelPluginHandler.handleActivity(context, bpelScope, bpelScope.getNodeTemplate()); + } else if (activity.getType().equals(ActivityType.MIGRATION)) { + + AbstractNodeTemplate sourceRelationshipTemplate = bpelScope.getNodeTemplate(); + AbstractNodeTemplate targetRelationshipTemplate = + this.getCorrespondingNode(bpelScope.getNodeTemplate(), + targetServiceTemplate.getTopologyTemplate().getNodeTemplates()); + + final BPELPlanContext sourceContext = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, + sourceServiceTemplateMap, sourceServiceTemplate, sourceServiceInstanceUrl, + sourceServiceInstanceId, sourceServiceTemplateUrl, sourceCsarName); + + final BPELPlanContext targetContext = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, + targetServiceTemplateMap, targetServiceTemplate, targetServiceInstanceUrl, + targetServiceInstanceId, targetServiceTemplateUrl, targetCsarName); + + for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { + if (postPhasePlugin.canHandleUpdate(sourceRelationshipTemplate, targetRelationshipTemplate)) { + postPhasePlugin.handleUpdate(sourceContext, targetContext, sourceRelationshipTemplate, + targetRelationshipTemplate); + } + } + } + // if this nodeTemplate has the label running (Property: State=Running), skip + // provisioning and just generate instance data handlin + + // generate code for the activity + } else if (bpelScope.getRelationshipTemplate() != null) { + // handling relationshiptemplate + + AbstractActivity activity = bpelScope.getActivity(); + if (activity.getType().equals(ActivityType.PROVISIONING)) { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, targetServiceTemplateMap, + targetServiceTemplate, targetServiceInstanceUrl, targetServiceInstanceId, + targetServiceTemplateUrl, targetCsarName); + this.bpelPluginHandler.handleActivity(context, bpelScope, bpelScope.getRelationshipTemplate()); + } else if (activity.getType().equals(ActivityType.TERMINATION)) { + final BPELPlanContext context = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, sourceServiceTemplateMap, + sourceServiceTemplate, sourceServiceInstanceUrl, sourceServiceInstanceId, + sourceServiceTemplateUrl, sourceCsarName); + this.bpelPluginHandler.handleActivity(context, bpelScope, bpelScope.getRelationshipTemplate()); + } else if (activity.getType().equals(ActivityType.MIGRATION)) { + + AbstractRelationshipTemplate sourceNodeTemplate = bpelScope.getRelationshipTemplate(); + AbstractRelationshipTemplate targetNodeTemplate = + this.getCorrespondingEdge(bpelScope.getRelationshipTemplate(), + targetServiceTemplate.getTopologyTemplate() + .getRelationshipTemplates()); + + final BPELPlanContext sourceContext = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, + sourceServiceTemplateMap, sourceServiceTemplate, sourceServiceInstanceUrl, + sourceServiceInstanceId, sourceServiceTemplateUrl, sourceCsarName); + + final BPELPlanContext targetContext = new BPELPlanContext(scopeBuilder, buildPlan, bpelScope, + targetServiceTemplateMap, targetServiceTemplate, targetServiceInstanceUrl, + targetServiceInstanceId, targetServiceTemplateUrl, targetCsarName); + + for (final IPlanBuilderPostPhasePlugin postPhasePlugin : this.pluginRegistry.getPostPlugins()) { + if (postPhasePlugin.canHandleUpdate(sourceNodeTemplate, targetNodeTemplate)) { + postPhasePlugin.handleUpdate(sourceContext, targetContext, sourceNodeTemplate, + targetNodeTemplate); + } + } + } + } + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightDELETE.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightDELETE.xml new file mode 100644 index 000000000..600054f8a --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightDELETE.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..a85e7399b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstance_Properties.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstance_Properties.xml new file mode 100644 index 000000000..8bd20944f --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstance_Properties.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_NodeInstances_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstances_InstanceDataAPI.xml similarity index 85% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_NodeInstances_InstanceDataAPI.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstances_InstanceDataAPI.xml index 5a5a0376e..a9e8abbc5 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_NodeInstances_InstanceDataAPI.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_NodeInstances_InstanceDataAPI.xml @@ -1,7 +1,6 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstance_InstanceDataAPI.xml similarity index 86% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstance_InstanceDataAPI.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstance_InstanceDataAPI.xml index fa5bbf236..8eb7c37ef 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstance_InstanceDataAPI.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstance_InstanceDataAPI.xml @@ -1,7 +1,6 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstances_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstances_InstanceDataAPI.xml similarity index 86% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstances_InstanceDataAPI.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstances_InstanceDataAPI.xml index 087581881..e6bc360e2 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstances_InstanceDataAPI.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstances_InstanceDataAPI.xml @@ -1,7 +1,6 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml similarity index 89% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml index a00dc75bd..fae2e9f2f 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_RelationInstances_QueryOnTargetInstance_InstanceDataAPI.xml @@ -1,8 +1,7 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_URL_ApplicationXML.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_URL_ApplicationXML.xml similarity index 84% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_URL_ApplicationXML.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_URL_ApplicationXML.xml index 8bdcb283c..e6002166d 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_URL_ApplicationXML.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightGET_URL_ApplicationXML.xml @@ -1,7 +1,6 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_PlanInstance_Logs.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_PlanInstance_Logs.xml similarity index 94% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_PlanInstance_Logs.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_PlanInstance_Logs.xml index ab038c2b1..bd96ded12 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_PlanInstance_Logs.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_PlanInstance_Logs.xml @@ -1,4 +1,3 @@ - @@ -25,4 +24,4 @@ request="$requestVar"> - \ No newline at end of file + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..fbbf53b41 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml similarity index 86% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml index 88b5d6a09..babd1ab7b 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI_WithBody.xml @@ -1,7 +1,6 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPUTInstanceState.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPUTInstanceState.xml similarity index 85% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPUTInstanceState.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPUTInstanceState.xml index 440be6110..c8dfa52de 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightPUTInstanceState.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPEL4RESTLightPUTInstanceState.xml @@ -1,7 +1,6 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELCompareInstanceCounts.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELCompareInstanceCounts.xml similarity index 96% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELCompareInstanceCounts.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELCompareInstanceCounts.xml index 3a47e0335..5a7055349 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELCompareInstanceCounts.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELCompareInstanceCounts.xml @@ -1,4 +1,3 @@ - {booleanExpression} @@ -9,7 +8,7 @@ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">{integerExpression} {integerExpression2} - + @@ -45,4 +44,4 @@
    - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELIfTrueThrowFault.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELIfTrueThrowFault.xml similarity index 85% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELIfTrueThrowFault.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELIfTrueThrowFault.xml index 7563e7d71..332b99905 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELIfTrueThrowFault.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELIfTrueThrowFault.xml @@ -1,8 +1,7 @@ - - + $xpath1Expr - \ No newline at end of file + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELMonitoringSituation.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELMonitoringSituation.xml new file mode 100644 index 000000000..cf277f073 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELMonitoringSituation.xml @@ -0,0 +1,33 @@ + + + + + + + + + $SituationIds + + + + + + + + $situationIdFromInputCopies + + + + + + + + + + + + + + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELWaitTillTrue.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELWaitTillTrue.xml similarity index 100% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPELWaitTillTrue.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BPELWaitTillTrue.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignFromInputToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignFromInputToStringVar.xml new file mode 100644 index 000000000..6d91d941e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignFromInputToStringVar.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignFromNodeInstanceRequestToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignFromNodeInstanceRequestToStringVar.xml new file mode 100644 index 000000000..d08d07a6d --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignFromNodeInstanceRequestToStringVar.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignSelectFromNodeInstancesRequestToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignSelectFromNodeInstancesRequestToStringVar.xml similarity index 92% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignSelectFromNodeInstancesRequestToStringVar.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignSelectFromNodeInstancesRequestToStringVar.xml index 6ce9ad493..7811498bf 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignSelectFromNodeInstancesRequestToStringVar.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignSelectFromNodeInstancesRequestToStringVar.xml @@ -1,8 +1,7 @@ - - \ No newline at end of file +
    diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignSelectFromRelationInstancesRequestToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignSelectFromRelationInstancesRequestToStringVar.xml similarity index 92% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignSelectFromRelationInstancesRequestToStringVar.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignSelectFromRelationInstancesRequestToStringVar.xml index a4a351c37..7f9e6aa19 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignSelectFromRelationInstancesRequestToStringVar.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignSelectFromRelationInstancesRequestToStringVar.xml @@ -1,8 +1,7 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstanceCorrelationIdPOSTRequest.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstanceCorrelationIdPOSTRequest.xml similarity index 88% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstanceCorrelationIdPOSTRequest.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstanceCorrelationIdPOSTRequest.xml index 738e7bbe9..f4253e113 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstanceCorrelationIdPOSTRequest.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstanceCorrelationIdPOSTRequest.xml @@ -1,7 +1,6 @@ - - @@ -15,6 +14,6 @@ - - - \ No newline at end of file + + + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstanceIDFromServiceInstanceUrl.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstanceIDFromServiceInstanceUrl.xml similarity index 87% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstanceIDFromServiceInstanceUrl.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstanceIDFromServiceInstanceUrl.xml index 78e7cdc57..3444378e1 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstanceIDFromServiceInstanceUrl.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstanceIDFromServiceInstanceUrl.xml @@ -1,13 +1,12 @@ - - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstancePOSTResponse.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstancePOSTResponse.xml new file mode 100644 index 000000000..0cd2f2be6 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstancePOSTResponse.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstancePOSTResponse2.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstancePOSTResponse2.xml similarity index 90% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstancePOSTResponse2.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstancePOSTResponse2.xml index 820d106c4..f862f8cfb 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelAssignServiceInstancePOSTResponse2.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelAssignServiceInstancePOSTResponse2.xml @@ -1,9 +1,8 @@ - - - @@ -20,7 +19,7 @@ - @@ -33,4 +32,4 @@ - \ No newline at end of file + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelCopyFromPropertyVarToNodeInstanceProperty.xml similarity index 100% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelCopyFromPropertyVarToNodeInstanceProperty.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelCopyOutputVarFromStringVariable.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelCopyOutputVarFromStringVariable.xml new file mode 100644 index 000000000..50f705135 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/BpelCopyOutputVarFromStringVariable.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/assignStringVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignStringVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/assignStringVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignStringVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/assignVarFromVarWithXpath2Queries.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignVarFromVarWithXpath2Queries.xml similarity index 100% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/assignVarFromVarWithXpath2Queries.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignVarFromVarWithXpath2Queries.xml diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/assignVarFromVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignVarFromVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/assignVarFromVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignVarFromVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/assignVarWithLiteral.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignVarWithLiteral.xml similarity index 84% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/assignVarWithLiteral.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignVarWithLiteral.xml index e30fd8dda..bb2f5531e 100644 --- a/org.opentosca.planbuilder.core.bpel/META-INF/resources/assignVarWithLiteral.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core.bpel/src/main/resources/core-bpel/assignVarWithLiteral.xml @@ -1,4 +1,3 @@ - that don't for (final AbstractNodeTemplate nodeTemplate : topology.getNodeTemplates()) { @@ -79,14 +80,14 @@ protected AbstractPlan generateFOG(final String id, final AbstractDefinitions de links.add(new Link(activity, mapping.get(relationshipTemplate.getTarget()))); } else if (baseType.equals(Types.dependsOnRelationType) | baseType.equals(Types.hostedOnRelationType) | baseType.equals(Types.deployedOnRelationType)) { - links.add(new Link(mapping.get(relationshipTemplate.getSource()), activity)); - links.add(new Link(activity, mapping.get(relationshipTemplate.getTarget()))); - } - + links.add(new Link(mapping.get(relationshipTemplate.getSource()), activity)); + links.add(new Link(activity, mapping.get(relationshipTemplate.getTarget()))); + } } final AbstractPlan abstractTerminationPlan = - new AbstractPlan(id, AbstractPlan.PlanType.TERMINATE, definitions, serviceTemplate, activities, links) {}; + new AbstractPlan(id, PlanType.TERMINATION, definitions, serviceTemplate, activities, links) { + }; return abstractTerminationPlan; } @@ -101,6 +102,6 @@ protected boolean hasFreezableComponentPolicy(final AbstractNodeTemplate nodeTem private boolean hasPolicy(final AbstractNodeTemplate nodeTemplate, final QName policyType) { return nodeTemplate.getPolicies().stream().filter(policy -> policy.getType().getId().equals(policyType)) - .findFirst().isPresent(); + .findFirst().isPresent(); } } diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractManagementFeaturePlanBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractManagementFeaturePlanBuilder.java similarity index 78% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractManagementFeaturePlanBuilder.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractManagementFeaturePlanBuilder.java index 087ffd6b9..ee6fdb0b2 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractManagementFeaturePlanBuilder.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractManagementFeaturePlanBuilder.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder; +package org.opentosca.planbuilder.core; import java.util.ArrayList; import java.util.Collection; @@ -9,10 +9,11 @@ import java.util.Objects; import java.util.Set; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.plan.AbstractPlan.Link; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; import org.opentosca.planbuilder.model.plan.ActivityType; import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; @@ -25,23 +26,26 @@ public abstract class AbstractManagementFeaturePlanBuilder extends AbstractSimplePlanBuilder { + public AbstractManagementFeaturePlanBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + } + @Override public PlanType createdPlanType() { - return PlanType.MANAGE; + return PlanType.MANAGEMENT; } /** - * Generates the Management Order Graph (MOG) for the given ServiceTemplate and the given Management - * Interface. + * Generates the Management Order Graph (MOG) for the given ServiceTemplate and the given Management Interface. * - * @param id the ID of the generated plan - * @param definitions the Definitions document containing the ServiceTemplate - * @param serviceTemplate the ServiceTemplate for which the plan is generated + * @param id the ID of the generated plan + * @param definitions the Definitions document containing the ServiceTemplate + * @param serviceTemplate the ServiceTemplate for which the plan is generated * @param managementInterfaceName the Management Interface on which the plan operates - * @param activityType the ActivityType for the Management Plan - * @param topDown true if the activities need to be executed downwards in the direction - * of the hostedOn relationship templates, false if they need to be executed - * bottom-up + * @param activityType the ActivityType for the Management Plan + * @param topDown true if the activities need to be executed downwards in the + * direction of the hostedOn relationship templates, false if they need + * to be executed bottom-up * @return the AbstractPlan containing the activities */ protected AbstractPlan generateMOG(final String id, final AbstractDefinitions definitions, @@ -88,7 +92,8 @@ protected AbstractPlan generateMOG(final String id, final AbstractDefinitions de } final AbstractPlan abstractTerminationPlan = - new AbstractPlan(id, AbstractPlan.PlanType.MANAGE, definitions, serviceTemplate, activities, links) {}; + new AbstractPlan(id, PlanType.MANAGEMENT, definitions, serviceTemplate, activities, links) { + }; return abstractTerminationPlan; } @@ -101,7 +106,7 @@ private boolean containsManagementInterface(final AbstractNodeTemplate nodeTempl final List ifaces = nodeTemplate.getType().getInterfaces(); if (Objects.nonNull(ifaces)) { return ifaces.stream().filter(iface -> iface.getName().equals(managementInterfaceName)).findFirst() - .isPresent(); + .isPresent(); } return false; } @@ -112,7 +117,7 @@ private boolean containsManagementInterface(final AbstractNodeTemplate nodeTempl protected boolean containsManagementInterface(final AbstractServiceTemplate serviceTemplate, final String managementInterfaceName) { return serviceTemplate.getTopologyTemplate().getNodeTemplates().stream() - .filter(node -> containsManagementInterface(node, managementInterfaceName)).findFirst() - .isPresent(); + .filter(node -> containsManagementInterface(node, managementInterfaceName)).findFirst() + .isPresent(); } } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractPlanBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractPlanBuilder.java new file mode 100644 index 000000000..d1bed5a0e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractPlanBuilder.java @@ -0,0 +1,43 @@ +package org.opentosca.planbuilder.core; + +import javax.inject.Inject; + +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class AbstractPlanBuilder { + + private final static Logger LOG = LoggerFactory.getLogger(AbstractPlanBuilder.class); + + @Inject + protected final PluginRegistry pluginRegistry; + + protected AbstractPlanBuilder(PluginRegistry pluginRegistry) { + this.pluginRegistry = pluginRegistry; + } + + abstract public PlanType createdPlanType(); + + public boolean isRunning(final AbstractNodeTemplate nodeTemplate) { + if (nodeTemplate.getProperties() != null) { + String val = nodeTemplate.getProperties().asMap().get("State"); + return val != null && val.equals("Running"); + } else { + return false; + } + } + + /** + * Returns the number of the plugins registered with this planbuilder + * + * @return integer denoting the count of plugins + */ + public int registeredPlugins() { + return this.pluginRegistry.getTypePlugins().size() + this.pluginRegistry.getDaPlugins().size() + + this.pluginRegistry.getIaPlugins().size() + this.pluginRegistry.getPostPlugins().size() + + this.pluginRegistry.getProvPlugins().size(); + } +} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractScaleOutPlanBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractScaleOutPlanBuilder.java similarity index 87% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractScaleOutPlanBuilder.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractScaleOutPlanBuilder.java index 8abf00d0a..bff5f0453 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractScaleOutPlanBuilder.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractScaleOutPlanBuilder.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder; +package org.opentosca.planbuilder.core; import java.util.ArrayList; import java.util.Collection; @@ -7,10 +7,11 @@ import java.util.List; import java.util.Map; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.plan.AbstractPlan.Link; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; import org.opentosca.planbuilder.model.plan.ActivityType; import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; @@ -21,22 +22,22 @@ import org.opentosca.planbuilder.model.utils.ModelUtils; /** - * * Copyright 2017 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public abstract class AbstractScaleOutPlanBuilder extends AbstractSimplePlanBuilder { + public AbstractScaleOutPlanBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + } @Override public PlanType createdPlanType() { - return PlanType.MANAGE; + return PlanType.MANAGEMENT; } - public AbstractPlan generateSOG(final String id, final AbstractDefinitions defintions, final AbstractServiceTemplate serviceTemplate, final ScalingPlanDefinition scalingPlanDefinition) { @@ -44,15 +45,17 @@ public AbstractPlan generateSOG(final String id, final AbstractDefinitions defin final AbstractPlan abstractScaleOutPlan = AbstractBuildPlanBuilder.generatePOG(id, defintions, serviceTemplate, scalingPlanDefinition.nodeTemplates, - scalingPlanDefinition.relationshipTemplates);; - abstractScaleOutPlan.setType(org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType.MANAGE); + scalingPlanDefinition.relationshipTemplates); + ; + abstractScaleOutPlan.setType(PlanType.MANAGEMENT); // add instance selection activties by starting for each node strat selection // activity for (final AbstractNodeTemplate stratNodeTemplate : scalingPlanDefinition.selectionStrategy2BorderNodes) { final AbstractActivity activity = new NodeTemplateActivity(stratNodeTemplate.getId() + "_strategicselection_activity", - ActivityType.STRATEGICSELECTION, stratNodeTemplate) {}; + ActivityType.STRATEGICSELECTION, stratNodeTemplate) { + }; abstractScaleOutPlan.getActivites().add(activity); mapping.put(stratNodeTemplate, activity); @@ -72,7 +75,8 @@ public AbstractPlan generateSOG(final String id, final AbstractDefinitions defin for (final AbstractRelationshipTemplate relationshipTemplate : path) { final AbstractActivity recursiveRelationActivity = new RelationshipTemplateActivity(relationshipTemplate.getId() + "recursiveselection_activity", - ActivityType.RECURSIVESELECTION, relationshipTemplate) {}; + ActivityType.RECURSIVESELECTION, relationshipTemplate) { + }; final AbstractActivity recursiveTargetNodeActivity = new NodeTemplateActivity( relationshipTemplate.getTarget().getId() + "_recursiveselection_activity", ActivityType.RECURSIVESELECTION, relationshipTemplate.getTarget()); @@ -85,19 +89,19 @@ public AbstractPlan generateSOG(final String id, final AbstractDefinitions defin abstractScaleOutPlan.getActivites().add(recursiveTargetNodeActivity); abstractScaleOutPlan.getLinks() - .add(new Link(recursiveRelationActivity, recursiveTargetNodeActivity)); + .add(new Link(recursiveRelationActivity, recursiveTargetNodeActivity)); abstractScaleOutPlan.getLinks() - .add(new Link(recursiveSourceNodeActivity, recursiveRelationActivity)); + .add(new Link(recursiveSourceNodeActivity, recursiveRelationActivity)); } for (final AbstractRelationshipTemplate relationshipTemplate : serviceTemplate.getTopologyTemplate() - .getRelationshipTemplates()) { + .getRelationshipTemplates()) { if (relationshipTemplate.getSource().equals(stratNodeTemplate) | relationshipTemplate.getTarget().equals(stratNodeTemplate)) { AbstractActivity provRelationActivity = abstractScaleOutPlan.findRelationshipTemplateActivity(relationshipTemplate, - ActivityType.PROVISIONING); + ActivityType.PROVISIONING); if (provRelationActivity == null) { provRelationActivity = @@ -107,13 +111,12 @@ public AbstractPlan generateSOG(final String id, final AbstractDefinitions defin final AbstractActivity recursiveRelationActivity = abstractScaleOutPlan.findRelationshipTemplateActivity(relationshipTemplate, - ActivityType.RECURSIVESELECTION); + ActivityType.RECURSIVESELECTION); abstractScaleOutPlan.getLinks().add(new Link(recursiveRelationActivity, provRelationActivity)); } } } - } return abstractScaleOutPlan; @@ -143,7 +146,5 @@ private void findOutgoingInfrastructurePaths(final Collection + * Creates a BuildPlan in WS-BPEL 2.0 for the specified values csarName, definitions and serviceTemplateId. Where + * csarName denotes the fileName of the CSAR, definitions denotes the Definitions document and serviceTemplateId a + * QName denoting the ServiceTemplate inside the Definitions document + *

    + * + * @param csarName the file name of the CSAR as String + * @param definitions the Definitions document as AbstractDefinitions Object + * @param serviceTemplateId a QName denoting a ServiceTemplate inside the Definitions document + * @return a complete BuildPlan for the given ServiceTemplate, if the ServiceTemplate denoted by the given QName + * isn't found inside the Definitions document null is returned instead + */ + abstract public AbstractPlan buildPlan(String csarName, AbstractDefinitions definitions, + AbstractServiceTemplate serviceTemplateId); + + /** + *

    + * Returns a List of BuildPlans for the ServiceTemplates contained in the given Definitions document + *

    + * + * @param csarName the file name of CSAR + * @param definitions a AbstractDefinitions Object denoting the Definitions document + * @return a List of Build Plans for each ServiceTemplate contained inside the Definitions document + */ + abstract public List buildPlans(String csarName, AbstractDefinitions definitions); +} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractTerminationPlanBuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractTerminationPlanBuilder.java similarity index 85% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractTerminationPlanBuilder.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractTerminationPlanBuilder.java index 0cf652f59..0b0ab88b0 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractTerminationPlanBuilder.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractTerminationPlanBuilder.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder; +package org.opentosca.planbuilder.core; import java.util.ArrayList; import java.util.Collection; @@ -9,37 +9,25 @@ import javax.xml.namespace.QName; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; -import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.plan.AbstractPlan.Link; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; import org.opentosca.planbuilder.model.plan.ActivityType; +import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; +import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractTopologyTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; public abstract class AbstractTerminationPlanBuilder extends AbstractSimplePlanBuilder { - - - @Override - public PlanType createdPlanType() { - return PlanType.TERMINATE; - } - - - protected AbstractPlan generateTOG(final String id, final AbstractDefinitions definitions, - final AbstractServiceTemplate serviceTemplate) { - return AbstractTerminationPlanBuilder.generateTOG(id, definitions, serviceTemplate, - serviceTemplate.getTopologyTemplate().getNodeTemplates(), - serviceTemplate.getTopologyTemplate() - .getRelationshipTemplates()); + public AbstractTerminationPlanBuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); } protected static AbstractPlan generateTOG(final String id, final AbstractDefinitions definitions, @@ -83,13 +71,25 @@ protected static AbstractPlan generateTOG(final String id, final AbstractDefinit links.add(new Link(activity, targetActivity)); } } - } final AbstractPlan abstractTerminationPlan = - new AbstractPlan(id, AbstractPlan.PlanType.TERMINATE, definitions, serviceTemplate, activities, links) {}; + new AbstractPlan(id, PlanType.TERMINATION, definitions, serviceTemplate, activities, links) { + }; return abstractTerminationPlan; } + @Override + public PlanType createdPlanType() { + return PlanType.TERMINATION; + } + + protected AbstractPlan generateTOG(final String id, final AbstractDefinitions definitions, + final AbstractServiceTemplate serviceTemplate) { + return AbstractTerminationPlanBuilder.generateTOG(id, definitions, serviceTemplate, + serviceTemplate.getTopologyTemplate().getNodeTemplates(), + serviceTemplate.getTopologyTemplate() + .getRelationshipTemplates()); + } } diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractTransformingPlanbuilder.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractTransformingPlanbuilder.java similarity index 81% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractTransformingPlanbuilder.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractTransformingPlanbuilder.java index a99cf926f..40b3184e1 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractTransformingPlanbuilder.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/AbstractTransformingPlanbuilder.java @@ -1,6 +1,5 @@ -package org.opentosca.planbuilder; +package org.opentosca.planbuilder.core; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -12,15 +11,17 @@ import javax.xml.namespace.QName; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; -import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.plan.AbstractPlan.Link; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; import org.opentosca.planbuilder.model.plan.AbstractTransformationPlan; import org.opentosca.planbuilder.model.plan.ActivityType; +import org.opentosca.planbuilder.model.plan.NodeTemplateActivity; +import org.opentosca.planbuilder.model.plan.RelationshipTemplateActivity; import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; @@ -28,65 +29,61 @@ import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; import org.opentosca.planbuilder.model.tosca.AbstractTopologyTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.registry.PluginRegistry; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * Abstract Class for generating an AbstractPlan implementing a Transformation Function from a - * Source Model to a Target Model and their respective instances - * - * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de + * Abstract Class for generating an AbstractPlan implementing a Transformation Function from a Source Model to a Target + * Model and their respective instances * + * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de */ public abstract class AbstractTransformingPlanbuilder extends AbstractPlanBuilder { - protected final PluginRegistry pluginRegistry = new PluginRegistry(); - private final static Logger LOG = LoggerFactory.getLogger(AbstractTransformingPlanbuilder.class); + public AbstractTransformingPlanbuilder(PluginRegistry pluginRegistry) { + super(pluginRegistry); + } + @Override public PlanType createdPlanType() { - return PlanType.MANAGE; + return PlanType.MANAGEMENT; } /** *

    - * Creates a BuildPlan in WS-BPEL 2.0 by using the the referenced source and target service - * templates as the transforming function between two models. + * Creates a BuildPlan in WS-BPEL 2.0 by using the the referenced source and target service templates as the + * transforming function between two models. *

    - * - * @param sourceCsarName the name of the source csar - * @param sourceDefinitions the id of the source definitions inside the referenced source csar - * @param sourceServiceTemplateId the id of the source service templates inside the referenced - * definitions - * @param targetCsarName the name of the target csar - * @param targetDefinitions the id of the target definitions inside the referenced target csar - * @param targetServiceTemplateId the id of the target service templates inside the referenced - * definitions - * @return a single AbstractPlan with a concrete implementation of a transformation function from - * the source to the target topology + * + * @param sourceCsarName the name of the source csar + * @param sourceDefinitions the id of the source definitions inside the referenced source csar + * @param sourceServiceTemplateId the id of the source service templates inside the referenced definitions + * @param targetCsarName the name of the target csar + * @param targetDefinitions the id of the target definitions inside the referenced target csar + * @param targetServiceTemplateId the id of the target service templates inside the referenced definitions + * @return a single AbstractPlan with a concrete implementation of a transformation function from the source to the + * target topology */ abstract public AbstractPlan buildPlan(String sourceCsarName, AbstractDefinitions sourceDefinitions, QName sourceServiceTemplateId, String targetCsarName, AbstractDefinitions targetDefinitions, QName targetServiceTemplateId); /** - * Generates a Set of Plans that is generated based on the given source and target definitions. This - * generation is done for each Topology Template defined in both definitions therefore for each - * combination of source and target topology template a plan is generated - * - * @param sourceCsarName the name of the source csar + * Generates a Set of Plans that is generated based on the given source and target definitions. This generation is + * done for each Topology Template defined in both definitions therefore for each combination of source and target + * topology template a plan is generated + * + * @param sourceCsarName the name of the source csar * @param sourceDefinitions the id of the source definitions inside the referenced source csar - * @param targetCsarName the name of the target csar + * @param targetCsarName the name of the target csar * @param targetDefinitions the id of the target definitions inside the referenced target csar * @return a List of AbstractPlans */ abstract public List buildPlans(String sourceCsarName, AbstractDefinitions sourceDefinitions, String targetCsarName, AbstractDefinitions targetDefinitions); - public AbstractTransformationPlan generateTFOG(String sourceCsarName, AbstractDefinitions sourceDefinitions, AbstractServiceTemplate sourceServiceTemplate, Collection sourceNodeTemplates, @@ -98,15 +95,14 @@ public AbstractTransformationPlan generateTFOG(String sourceCsarName, AbstractDe Set maxCommonSubgraph = this.getMaxCommonSubgraph(new HashSet(sourceNodeTemplates), - new HashSet(sourceNodeTemplates), - new HashSet(targetNodeTemplates), - new HashSet()); + new HashSet(sourceNodeTemplates), + new HashSet(targetNodeTemplates), + new HashSet()); // find valid subset inside common subgraph, i.e.: // any component that is a platform node (every node without outgoing // hostedOn edges), or is a node in the subgraph where its (transitive) platform // nodes are also in the subgraph are valid - Set deployableMaxCommonSubgraph = this.getDeployableSubgraph(new HashSet(this.getCorrespondingNodes(maxCommonSubgraph, targetNodeTemplates))); // determine steps which have to be deleted from the original topology @@ -115,46 +111,43 @@ public AbstractTransformationPlan generateTFOG(String sourceCsarName, AbstractDe Collection relationsToTerminate = this.getOutgoingRelations(nodesToTerminate); AbstractPlan termPlan = AbstractTerminationPlanBuilder.generateTOG("transformTerminate" - + sourceDefinitions.getId() + "_to_" + targetDefinitions.getId(), sourceDefinitions, sourceServiceTemplate, - nodesToTerminate, relationsToTerminate); - + + sourceDefinitions.getId() + "_to_" + targetDefinitions.getId(), sourceDefinitions, sourceServiceTemplate, + nodesToTerminate, relationsToTerminate); // migrate node instances from old service instance to new service instance AbstractPlan migrateInstancePlan = this.generateInstanceMigrationPlan(deployableMaxCommonSubgraph, - this.getConnectingEdges(sourceRelationshipTemplates, - deployableMaxCommonSubgraph), - sourceDefinitions, targetDefinitions, sourceServiceTemplate, - targetServiceTemplate); + this.getConnectingEdges(sourceRelationshipTemplates, + deployableMaxCommonSubgraph), + sourceDefinitions, targetDefinitions, sourceServiceTemplate, + targetServiceTemplate); // determine steps which have to be start within the new topology Set nodesToStart = new HashSet(targetNodeTemplates); nodesToStart.removeAll(this.getCorrespondingNodes(deployableMaxCommonSubgraph, targetNodeTemplates)); - + Collection relationsToStart = this.getDeployableSubgraph(targetNodeTemplates, this.getOutgoingRelations(nodesToStart)); AbstractPlan startPlan = AbstractBuildPlanBuilder.generatePOG("transformStart" + sourceDefinitions.getId() + "_to_" + targetDefinitions.getId(), targetDefinitions, targetServiceTemplate, nodesToStart, relationsToStart); - AbstractTransformationPlan transPlan = this.mergePlans("transformationPlan_" + termPlan.getServiceTemplate().getId() + "_to_" - + startPlan.getServiceTemplate().getId(), PlanType.TRANSFORM, termPlan, migrateInstancePlan); + + startPlan.getServiceTemplate().getId(), PlanType.TRANSFORMATION, termPlan, migrateInstancePlan); transPlan = this.mergePlans( - "transformationPlan_" + termPlan.getServiceTemplate().getId() + "_to_" - + startPlan.getServiceTemplate().getId(), - PlanType.TRANSFORM, transPlan, startPlan); - + "transformationPlan_" + termPlan.getServiceTemplate().getId() + "_to_" + + startPlan.getServiceTemplate().getId(), + PlanType.TRANSFORMATION, transPlan, startPlan); return transPlan; } - + public Collection getDeployableSubgraph(Collection nodes, Collection relations) { Collection result = new HashSet(); - for(AbstractRelationshipTemplate rel : relations) { - if(nodes.contains(rel.getSource()) && nodes.contains(rel.getTarget())) { + for (AbstractRelationshipTemplate rel : relations) { + if (nodes.contains(rel.getSource()) && nodes.contains(rel.getTarget())) { result.add(rel); } } @@ -166,27 +159,25 @@ public AbstractTransformationPlan generateTFOG(String sourceCsarName, AbstractDe AbstractDefinitions targetDefinitions, AbstractServiceTemplate targetServiceTemplate) { return this.generateTFOG(sourceCsarName, sourceDefinitions, sourceServiceTemplate, - sourceServiceTemplate.getTopologyTemplate().getNodeTemplates(), - sourceServiceTemplate.getTopologyTemplate().getRelationshipTemplates(), targetCsarName, - targetDefinitions, targetServiceTemplate, - targetServiceTemplate.getTopologyTemplate().getNodeTemplates(), - targetServiceTemplate.getTopologyTemplate().getRelationshipTemplates()); + sourceServiceTemplate.getTopologyTemplate().getNodeTemplates(), + sourceServiceTemplate.getTopologyTemplate().getRelationshipTemplates(), targetCsarName, + targetDefinitions, targetServiceTemplate, + targetServiceTemplate.getTopologyTemplate().getNodeTemplates(), + targetServiceTemplate.getTopologyTemplate().getRelationshipTemplates()); } /** - * Generates an abstract order of activities to transform from the source service template to the - * target service template - * - * @param sourceCsarName the name of the source csar - * @param sourceDefinitions the id of the source definitions inside the referenced source csar - * @param sourceServiceTemplateId the id of the source service templates inside the referenced - * definitions - * @param targetCsarName the name of the target csar - * @param targetDefinitions the id of the target definitions inside the referenced target csar - * @param targetServiceTemplateId the id of the target service templates inside the referenced - * definitions - * @return a single AbstractPlan containing abstract activities for a transformation function from - * the source to the target topology + * Generates an abstract order of activities to transform from the source service template to the target service + * template + * + * @param sourceCsarName the name of the source csar + * @param sourceDefinitions the id of the source definitions inside the referenced source csar + * @param sourceServiceTemplateId the id of the source service templates inside the referenced definitions + * @param targetCsarName the name of the target csar + * @param targetDefinitions the id of the target definitions inside the referenced target csar + * @param targetServiceTemplateId the id of the target service templates inside the referenced definitions + * @return a single AbstractPlan containing abstract activities for a transformation function from the source to the + * target topology */ public AbstractTransformationPlan _generateTFOG(String sourceCsarName, AbstractDefinitions sourceDefinitions, AbstractServiceTemplate sourceServiceTemplate, @@ -197,9 +188,9 @@ public AbstractTransformationPlan _generateTFOG(String sourceCsarName, AbstractD Set maxCommonSubgraph = this.getMaxCommonSubgraph(new HashSet(sourceTopology.getNodeTemplates()), - new HashSet(sourceTopology.getNodeTemplates()), - new HashSet(targetTopology.getNodeTemplates()), - new HashSet()); + new HashSet(sourceTopology.getNodeTemplates()), + new HashSet(targetTopology.getNodeTemplates()), + new HashSet()); // find valid subset inside common subgraph, i.e.: // any component that is a platform node (every node without outgoing @@ -214,38 +205,35 @@ public AbstractTransformationPlan _generateTFOG(String sourceCsarName, AbstractD Collection relationsToTerminate = this.getOutgoingRelations(nodesToTerminate); AbstractPlan termPlan = AbstractTerminationPlanBuilder.generateTOG("transformTerminate" - + sourceDefinitions.getId() + "_to_" + targetDefinitions.getId(), sourceDefinitions, sourceServiceTemplate, - nodesToTerminate, relationsToTerminate); - + + sourceDefinitions.getId() + "_to_" + targetDefinitions.getId(), sourceDefinitions, sourceServiceTemplate, + nodesToTerminate, relationsToTerminate); // migrate node instances from old service instance to new service instance AbstractPlan migrateInstancePlan = this.generateInstanceMigrationPlan(deployableMaxCommonSubgraph, - this.getConnectingEdges(sourceTopology.getRelationshipTemplates(), - deployableMaxCommonSubgraph), - sourceDefinitions, targetDefinitions, sourceServiceTemplate, - targetServiceTemplate); + this.getConnectingEdges(sourceTopology.getRelationshipTemplates(), + deployableMaxCommonSubgraph), + sourceDefinitions, targetDefinitions, sourceServiceTemplate, + targetServiceTemplate); // determine steps which have to be start within the new topology Set nodesToStart = new HashSet(targetTopology.getNodeTemplates()); nodesToStart.removeAll(this.getCorrespondingNodes(deployableMaxCommonSubgraph, - targetTopology.getNodeTemplates())); + targetTopology.getNodeTemplates())); Collection relationsToStart = this.getOutgoingRelations(nodesToStart); AbstractPlan startPlan = AbstractBuildPlanBuilder.generatePOG("transformStart" + sourceDefinitions.getId() + "_to_" + targetDefinitions.getId(), targetDefinitions, targetServiceTemplate, nodesToStart, relationsToStart); - AbstractTransformationPlan transPlan = this.mergePlans("transformationPlan_" + termPlan.getServiceTemplate().getId() + "_to_" - + startPlan.getServiceTemplate().getId(), PlanType.TRANSFORM, termPlan, migrateInstancePlan); + + startPlan.getServiceTemplate().getId(), PlanType.TRANSFORMATION, termPlan, migrateInstancePlan); transPlan = this.mergePlans( - "transformationPlan_" + termPlan.getServiceTemplate().getId() + "_to_" - + startPlan.getServiceTemplate().getId(), - PlanType.TRANSFORM, transPlan, startPlan); - + "transformationPlan_" + termPlan.getServiceTemplate().getId() + "_to_" + + startPlan.getServiceTemplate().getId(), + PlanType.TRANSFORMATION, transPlan, startPlan); return transPlan; } @@ -265,11 +253,11 @@ private AbstractTransformationPlan generateInstanceMigrationPlan(Collection relationMapping = new HashMap<>(); this.generateIMOGActivitesAndLinks(activities, links, nodeMapping, nodeTemplates, relationMapping, - relationshipTemplates); + relationshipTemplates); return new AbstractTransformationPlan( "migrateInstance" + sourceDefinitions.getId() + "_to_" + targetDefinitions.getId(), - AbstractPlan.PlanType.TRANSFORM, sourceDefinitions, sourceServiceTemplate, targetDefinitions, + PlanType.TRANSFORMATION, sourceDefinitions, sourceServiceTemplate, targetDefinitions, targetServiceTemplate, activities, links); } @@ -304,9 +292,7 @@ private void generateIMOGActivitesAndLinks(final Collection ac links.add(new Link(nodeActivityMapping.get(relationshipTemplate.getTarget()), activity)); links.add(new Link(activity, nodeActivityMapping.get(relationshipTemplate.getSource()))); } - } - } private Collection getConnectingEdges(Collection allEdges, @@ -323,7 +309,7 @@ private Collection getConnectingEdges(Collection getCorrespondingNodes(Collection subgraph, - Collection graph) { + Collection graph) { Collection correspondingNodes = new HashSet(); for (AbstractNodeTemplate subgraphNode : subgraph) { AbstractNodeTemplate correspondingNode = null; @@ -336,7 +322,7 @@ private Collection getCorrespondingNodes(Collection graph) { + Collection graph) { for (AbstractNodeTemplate graphNode : graph) { if (this.mappingEquals(subNode, graphNode)) { return graphNode; @@ -377,11 +363,8 @@ private AbstractTransformationPlan mergePlans(String id, PlanType type, Abstract return new AbstractTransformationPlan(id, type, plan1.getDefinitions(), plan1.getServiceTemplate(), plan2.getDefinitions(), plan2.getServiceTemplate(), activities, links); - } - - private Collection getOutgoingRelations(Set nodes) { Collection relations = new HashSet(); for (AbstractNodeTemplate node : nodes) { @@ -424,7 +407,6 @@ public Set getDeployableSubgraph(Set toRemove.add(node); continue; } - } if (toRemove.isEmpty()) { @@ -434,14 +416,14 @@ public Set getDeployableSubgraph(Set return getDeployableSubgraph(validDeploymentSubgraph); } } - + private boolean hasNoHostingNodes(AbstractNodeTemplate nodeTemplate) { - for(AbstractRelationshipTemplate rel :nodeTemplate.getOutgoingRelations()) { - if(rel.getType().equals(Types.hostedOnRelationType) | rel.getType().equals(Types.dependsOnRelationType)) { + for (AbstractRelationshipTemplate rel : nodeTemplate.getOutgoingRelations()) { + if (rel.getType().equals(Types.hostedOnRelationType) | rel.getType().equals(Types.dependsOnRelationType)) { return false; } } - + return true; } @@ -464,11 +446,8 @@ private boolean contains(Collection subgraph1, Collection< return true; } - - // TODO FIXME this is a really naive implementation until we can integrate a - // proper(i.e. efficient) subgraph calculation - // based on https://stackoverflow.com/a/14644158 + // proper(i.e. efficient) subgraph calculation based on https://stackoverflow.com/a/14644158 private Set getMaxCommonSubgraph(Set vertices, Set graph1, Set graph2, @@ -484,8 +463,6 @@ private Set getMaxCommonSubgraph(Set } } - - AbstractNodeTemplate v = this.pop(vertices); LOG.debug("Removed vertex {}", v.getId()); @@ -493,7 +470,6 @@ private Set getMaxCommonSubgraph(Set currentSubset.add(v); LOG.debug("Current subset {}", this.printCandidate(currentSubset)); - Set cand2 = new HashSet(); if (this.isCommonSubgraph(graph1, graph2, currentSubset)) { @@ -503,8 +479,6 @@ private Set getMaxCommonSubgraph(Set currentSubset.remove(v); } - - LOG.debug("Current candidates:"); LOG.debug("Candidate1: {}", this.printCandidate(cand1)); LOG.debug("Candidate2: {}", this.printCandidate(cand2)); @@ -521,14 +495,10 @@ private Set getMaxCommonSubgraph(Set private String printCandidate(Collection nodeTemplates) { String print = "{"; - AbstractNodeTemplate[] nodes = nodeTemplates.toArray(new AbstractNodeTemplate[nodeTemplates.size()]); - for (int i = 0; i < nodes.length; i++) { - print += nodes[i].getId(); - if (i + 1 < nodes.length) { print += ","; } @@ -591,7 +561,7 @@ private boolean mappingEquals(AbstractRelationshipTemplate rel1, AbstractRelatio if (!(this.mappingEquals(rel1.getSource(), rel2.getSource()) && this.mappingEquals(rel1.getTarget(), rel2.getTarget()))) { return false; - } + } return true; } @@ -602,7 +572,6 @@ private boolean mappingEquals(AbstractNodeTemplate node1, AbstractNodeTemplate n return false; } - if (node1.getDeploymentArtifacts().size() != node2.getDeploymentArtifacts().size()) { return false; } else { @@ -624,7 +593,6 @@ private boolean mappingEquals(AbstractNodeTemplate node1, AbstractNodeTemplate n } } - // Maybe add it later // This check is pretty heavy if i think about the State Property or changes in @@ -638,13 +606,11 @@ private boolean mappingEquals(AbstractNodeTemplate node1, AbstractNodeTemplate n // return false; // } LOG.debug("Matched node {} with node {} ", node1.getId(), node2.getId()); - - - if(!node1.getId().equals(node2.getId())) { + + if (!node1.getId().equals(node2.getId())) { return false; } - + return true; } - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/NCName.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/NCName.java new file mode 100644 index 000000000..f82da2c59 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/NCName.java @@ -0,0 +1,107 @@ +package org.opentosca.planbuilder.core; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class NCName { + + public static final Pattern ILLEGAL_CHARACTERS_PATTERN = Pattern + .compile("[\\s\\:\\@\\$\\%\\&\\/\\+\\,\\;\\!\"\\#\'\\(\\)\\*\\<\\=\\>\\?\\[\\]\\\\^\\`\\{\\|\\}\\~]"); + public static final Pattern ILLEGAL_START_CHARACTERS_PATTERN = Pattern.compile("^[\\.\\d\\-]+"); + + // To check validity + public static final Pattern NAME_PATTERN = Pattern.compile("[^\\.\\d\\-][\\w]+"); + + public static final String OUTPUT_FORMAT = "%s:%s"; + + private String prefix; + private String ncName; + + public NCName(final String prefix, final String ncName) { + Objects.requireNonNull(prefix); + Objects.requireNonNull(ncName); + + String prefixResult = prefix; + String ncNameResult = ncName; + + prefixResult = makeValid(prefixResult); + ncNameResult = makeValid(ncNameResult); + + this.prefix = prefixResult; + this.ncName = ncNameResult; + } + + @Override + public String toString() { + return String.format(OUTPUT_FORMAT, this.prefix, this.ncName); + } + + private String makeValid(final String input) { + String output = input; + + // Step 1 + output = removeWhiteSpaces(output); + + // Step 2 + output = replaceInvalidCharacters(output); + + // Step 3 + output = removeInvalidStartCharacters(output); + + // Step 4 + checkValidity(output); + + return output; + } + + private String removeInvalidStartCharacters(final String input) { + String output = input; + + Matcher match = ILLEGAL_START_CHARACTERS_PATTERN.matcher(output); + + output = match.replaceFirst(""); + + return output; + } + + private String removeWhiteSpaces(final String input) { + String output = input; + Pattern whiteSpacePattern = Pattern.compile("\\s"); + + Matcher match = whiteSpacePattern.matcher(output); + + output = match.replaceAll(""); + + return output; + } + + private String replaceInvalidCharacters(final String input) { + String output = input; + + Matcher match = ILLEGAL_CHARACTERS_PATTERN.matcher(output); + + output = match.replaceAll("_"); + + return output; + } + + private void checkValidity(String input) { + + if (input.length() == 0) { + throw new NCNameException("Resulting NCName was empty"); + } + } + + public class NCNameException extends RuntimeException { + + /** + * Generated serialVersionUID + */ + private static final long serialVersionUID = -4052808822350498637L; + + protected NCNameException(String msg) { + super(msg); + } + } +} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/ScalingPlanDefinition.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/ScalingPlanDefinition.java similarity index 98% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/ScalingPlanDefinition.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/ScalingPlanDefinition.java index 5eb0e36eb..984fa772b 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/ScalingPlanDefinition.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/ScalingPlanDefinition.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder; +package org.opentosca.planbuilder.core; import java.util.ArrayList; import java.util.Collection; @@ -25,7 +25,7 @@ public class ScalingPlanDefinition { // topology public String name; - AbstractTopologyTemplate topology; + public AbstractTopologyTemplate topology; // region public List nodeTemplates; @@ -108,7 +108,6 @@ public int getMinInstances() { public List getPolicies() { return this.nodeTemplate.getPolicies(); } - } // recursive selections @@ -152,7 +151,7 @@ private void init() { final List outgoing = ModelUtils.getOutgoingRelations(nodeTemplate, Types.hostedOnRelationType, Types.dependsOnRelationType, - Types.deployedOnRelationType); + Types.deployedOnRelationType); this.nodeTemplatesRecursiveSelection.addAll(sinkNodes); this.relationshipTemplatesRecursiveSelection.addAll(outgoing); @@ -242,7 +241,6 @@ private AbstractNodeTemplate crossesBorder(final AbstractRelationshipTemplate re if (!nodesToScale.contains(target)) { return target; } - } return null; diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/csarhandler/CSARHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/csarhandler/CSARHandler.java new file mode 100644 index 000000000..1b77691f9 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/csarhandler/CSARHandler.java @@ -0,0 +1,91 @@ +package org.opentosca.planbuilder.core.csarhandler; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.opentosca.container.core.common.SystemException; +import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.model.csar.id.CSARID; +import org.opentosca.container.legacy.core.model.CSARContent; +import org.opentosca.container.legacy.core.service.CoreFileServiceImpl; +import org.opentosca.container.legacy.core.service.ICoreFileService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + *

    + * This class is a small layer over the ICoreFileService of the OpenTOSCA Core + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +@Deprecated +public class CSARHandler { + + public static final Path planBuilderWorkingDir = Paths.get(System.getProperty("java.io.tmpdir"), "opentosca", "container", "planbuilder"); + + private static final Logger LOG = LoggerFactory.getLogger(CSARHandler.class); + + private final ICoreFileService fileService; + + public CSARHandler() { + try { + Files.createDirectories(planBuilderWorkingDir); + } catch (IOException e) { + LOG.warn("Could not create working direcotry for planbuilder", e); + throw new ExceptionInInitializerError(e); + } + fileService = new CoreFileServiceImpl(planBuilderWorkingDir); + } + + /** + * Stores a CSAR given as file object + * + * @param file File referencing a CSAR + * @return an Object representing an ID of the stored CSAR, if something went wrong null is returned instead + */ + public Object storeCSAR(final File file) throws UserException, SystemException { + LOG.debug("Trying to store csar"); + + final CSARID csarId = fileService.storeCSAR(file.toPath()); + if (csarId == null) { + LOG.warn("Storing CSAR file failed"); + return null; + } + LOG.info("Storing CSAR file was successful"); + return csarId; + } + + public void deleteCSAR(final CSARID id) throws UserException, SystemException { + fileService.deleteCSAR(id); + } + + /** + * Deletes all CSARs in the OpenTOSCA Core + */ + public void deleteAllCsars() { + LOG.info("Deleting all CSAR files"); + try { + fileService.deleteCSARs(); + } catch (final SystemException e) { + + } + } + + /** + * Returns a CSARContent Object for the given CSARID + * + * @param id a CSARID + * @return the CSARContent for the given CSARID + * @throws UserException is thrown when something inside the OpenTOSCA Core fails + */ + public CSARContent getCSARContentForID(final CSARID id) throws UserException { + LOG.debug("Fetching CSARContent for given ID"); + return fileService.getCSAR(id); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderCompensationOperationPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderCompensationOperationPlugin.java new file mode 100644 index 000000000..5b928ef60 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderCompensationOperationPlugin.java @@ -0,0 +1,90 @@ +package org.opentosca.planbuilder.core.plugins.artifactbased; + +import java.util.Map; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; +import org.opentosca.planbuilder.model.tosca.AbstractParameter; + +public interface IPlanBuilderCompensationOperationPlugin + extends IPlanBuilderProvPhaseParamOperationPlugin { + + /** + * Create BPEL code to invoke given method and additionally add compensation logic + * + * @param context the plan context for the plugin + * @param operation the operation for that this plugin should generate invocation logic + * @param ia the implementation artifact of the given operation + * @param param2propertyMapping a mapping from operation parameters to variables + * @param compensationOperation the operation which compensates the given operation + * @param compensationIa the implementation artifact of the compensation operation + * @param compensationParam2VariableMapping a mapping from compensation operation parameters to variables + * @return true iff generating invocation logic was successful + */ + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, + Map param2propertyMapping, + AbstractOperation compensationOperation, AbstractImplementationArtifact compensationIa, + Map compensationParam2VariableMapping); + + /** + * Create BPEL code to invoke given method and additionally add compensation logic + * + * @param context the plan context for the plugin + * @param operation the operation for that this plugin should generate invocation logic + * @param ia the implementation artifact of the given operation + * @param param2propertyMapping a mapping from operation parameters to variables + * @param compensationOperation the operation which compensates the given operation + * @param compensationIa the implementation artifact of the compensation operation + * @param compensationParam2VariableMapping a mapping from compensation operation parameters to variables + * @param phase determines to which phase of the scope the operation logic should be + * added to + * @return true iff generating invocation logic was successful + */ + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, + Map param2propertyMapping, + AbstractOperation compensationOperation, AbstractImplementationArtifact compensationIa, + Map compensationParam2VariableMapping, BPELScopePhaseType phase); + + /** + * Create BPEL code to invoke given method and additionally add compensation logic + * + * @param context the plan context for the plugin + * @param operation the operation for that this plugin should generate invocation logic + * @param ia the implementation artifact of the given operation + * @param param2propertyMapping a mapping from operation parameters to variables + * @param param2PropertyOutputMapping a mapping from operation output parameters to variables + * @param compensationOperation the operation which compensates the given operation + * @param compensationIa the implementation artifact of the compensation operation + * @param compensationParam2VariableMapping a mapping from compensation operation parameters to variables + * @return true iff generating invocation logic was successful + */ + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, + Map param2propertyMapping, + Map param2PropertyOutputMapping, + AbstractOperation compensationOperation, AbstractImplementationArtifact compensationIa, + Map compensationParam2VariableMapping); + + /** + * Create BPEL code to invoke given method and additionally add compensation logic + * + * @param context the plan context for the plugin + * @param operation the operation for that this plugin should generate invocation logic + * @param ia the implementation artifact of the given operation + * @param param2propertyMapping a mapping from operation parameters to variables + * @param param2PropertyOutputMapping a mapping from operation output parameters to variables + * @param compensationOperation the operation which compensates the given operation + * @param compensationIa the implementation artifact of the compensation operation + * @param compensationParam2VariableMapping a mapping from compensation operation parameters to variables + * @param phase determines to which phase of the scope the operation logic should be + * added to + * @return true iff generating invocation logic was successful + */ + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, + Map param2propertyMapping, + Map param2PropertyOutputMapping, + AbstractOperation compensationOperation, AbstractImplementationArtifact compensationIa, + Map compensationParam2VariableMapping, BPELScopePhaseType phase); +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderPrePhaseDAPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderPrePhaseDAPlugin.java new file mode 100644 index 000000000..bcd8dea00 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderPrePhaseDAPlugin.java @@ -0,0 +1,45 @@ +package org.opentosca.planbuilder.core.plugins.artifactbased; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPlugin; +import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractNodeType; + +/** + *

    + * This interface should be implemented by Plugins which are responsible for deploying DA's inside a PrePhase of a + * TemplateBuildPlan. The deployment should be handle on an appropiate InfrastructureNode + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public interface IPlanBuilderPrePhaseDAPlugin extends IPlanBuilderPlugin { + + /** + * This method is used to determine whether this plugin can deploy a DA based on its type to a Node of the given + * type. + * + * @param deploymentArtifact the DA to deploy + * @param infrastructureNodeType the NodeType of an InfrastructureNode + * @return true iff when this plugin can deploy a DA of the given artifactType to a Node of the given nodeType + */ + public boolean canHandle(AbstractDeploymentArtifact deploymentArtifact, AbstractNodeType infrastructureNodeType); + + /** + * This method is used to add a fragment to a prephase of the nodeTemplate declared inside the given context. The + * fragment should deploy the given DA unto the given InfrastructureNode + * + * @param context a TemplatePlanContext of the Template which a Provisioning has to be created + * @param da the DeploymentArtifact to deploy + * @param infrastructureNodeTemplate the InfrastructureNodeTemplate to deploy the DA on + * @return true iff generating and adding the fragment to the PrePhase of the TemplateContext was successful + */ + public boolean handle(T context, AbstractDeploymentArtifact da, AbstractNodeTemplate infrastructureNodeTemplate); + + public boolean canHandleCreate(AbstractNodeTemplate nodeTemplate); + + public boolean handleCreate(T context, AbstractNodeTemplate nodeTemplate); +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderPrePhaseIAPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderPrePhaseIAPlugin.java new file mode 100644 index 000000000..720b548cd --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderPrePhaseIAPlugin.java @@ -0,0 +1,43 @@ +package org.opentosca.planbuilder.core.plugins.artifactbased; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPlugin; +import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractNodeType; + +/** + *

    + * This interface should be implemented by Plugin which can add PrePhase Fragments for IA's. The plugin should be able + * to deploy at least one ArtifactType to a specific NodeType + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public interface IPlanBuilderPrePhaseIAPlugin extends IPlanBuilderPlugin { + + /** + * This method is used to determin whether the plugin can deploy the given ArtifactType to the given + * InfrastructureNodeType + * + * @param ia an ImplementationArtifact to deploy + * @param infrastructureNodeType a NodeType which should be a InfrastructureNodeType + * @return true iff this plugin can deploy the given ArtifactTypes to the given InfrastructureNodeType + */ + public boolean canHandle(AbstractImplementationArtifact ia, AbstractNodeType infrastructureNodeType); + + /** + * This method is used add the fragment this plugin can generate for the given IA which must be deployed unto the + * given InfrastructureNodeTemplate + * + * @param context a TemplatePlanContext of the Template for which the fragment has to be + * generated + * @param ia an ImplementationArtifact of the Template inside the context + * @param infrastructureNodeTemplate an InfrastructureNodeTemplate of the template inside the context + * @return true iff generating and adding the fragment was successful + */ + public boolean handle(T context, AbstractImplementationArtifact ia, + AbstractNodeTemplate infrastructureNodeTemplate); +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderProvPhaseOperationPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderProvPhaseOperationPlugin.java new file mode 100644 index 000000000..2f6f0cc89 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderProvPhaseOperationPlugin.java @@ -0,0 +1,40 @@ +package org.opentosca.planbuilder.core.plugins.artifactbased; + +import javax.xml.namespace.QName; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPlugin; +import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; + +/** + *

    + * This interface should be implemented by Plugins which can generate Fragments that implement the Provisioning trough + * TOSCA Operations on Node-/RelationshipTypes + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public interface IPlanBuilderProvPhaseOperationPlugin extends IPlanBuilderPlugin { + + /** + * This method is used determine whether the Plugin can handle Operations which are implemented by an IA with the + * given ArtifactType + * + * @param operationArtifactType the Type of the IA which implements a TOSCA Operation + * @return true iff the plugin can handle Operations that are implemented by IA of the given ArtifactType + */ + public boolean canHandle(QName operationArtifactType); + + /** + * This method is used to generate and add a fragment which calls an TOSCA Operations + * + * @param context the TemplateContext of the Template to call the Operation on + * @param operation the Operation to call on the Template + * @param ia the IA which implements the Operation + * @return true iff the plugin generated and added a fragment into the ProvisioningPhase in the TemplateContext + */ + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia); +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderProvPhaseParamOperationPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderProvPhaseParamOperationPlugin.java new file mode 100644 index 000000000..360787d04 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/artifactbased/IPlanBuilderProvPhaseParamOperationPlugin.java @@ -0,0 +1,47 @@ +package org.opentosca.planbuilder.core.plugins.artifactbased; + +import java.util.Map; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; +import org.opentosca.planbuilder.model.tosca.AbstractParameter; +import org.w3c.dom.Element; + +/** + *

    + * This interface should be implemented by Plugins which can generate Fragments that implement the Provisioning trough + * TOSCA Operations on Node-/RelationshipTypes with a map of operation parameters mapped to tosca properties. + *

    + * Copyright 2016 IAAS University of Stuttgart
    + *
    + * + * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de + */ +public interface IPlanBuilderProvPhaseParamOperationPlugin + extends IPlanBuilderProvPhaseOperationPlugin { + + /** + * This method is used to generate and add a fragment which calls a TOSCA Operation + * + * @param context the TemplateContext of the Template to call the Operation on + * @param operation the Operation to call on the Template + * @param ia the IA which implements the Operation + * @param param2propertyMapping a mapping from operation parameters to tosca property variables + * @return true iff the plugin generated and added a fragment into the ProvisioningPhase in the TemplateContext + */ + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, + Map param2propertyMapping); + + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, + Map param2propertyMapping, Element elementToAppendTo); + + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, + Map param2propertyMapping, + Map param2PropertyOutputMapping); + + public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, + Map param2propertyMapping, + Map param2PropertyOutputMapping, Element elementToAppendTo); +} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/PlanContext.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/PlanContext.java similarity index 85% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/PlanContext.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/PlanContext.java index b5a2544ea..641be317f 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/PlanContext.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/PlanContext.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder.plugins.context; +package org.opentosca.planbuilder.core.plugins.context; import java.io.File; import java.util.Collection; @@ -6,8 +6,8 @@ import javax.xml.namespace.QName; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; @@ -46,22 +46,18 @@ public Collection getPropertyVariables(final AbstractNodeTempl return this.propertyMap.getNodePropertyVariables(this.serviceTemplate, nodeTemplate); } - public AbstractServiceTemplate getServiceTemplate() { return this.serviceTemplate; } - public String getServiceTemplateURLVar() { return this.serviceTemplateURLVarName; } - public String getServiceInstanceIDVarName() { return this.serviceInstanceIDVarName; } - public String getServiceInstanceURLVarName() { return this.serviceInstanceURLVarName; } @@ -71,13 +67,12 @@ public String getServiceInstanceURLVarName() { * * @return a TOSCAPlan.PlanType */ - public BPELPlan.PlanType getPlanType() { + public PlanType getPlanType() { return this.plan.getType(); } /** - * Returns a Variable object that represents a property inside the given nodeTemplate with the given - * name + * Returns a Variable object that represents a property inside the given nodeTemplate with the given name * * @param nodeTemplate a nodeTemplate to look for the property in * @param propertyName the name of the searched property @@ -85,22 +80,22 @@ public BPELPlan.PlanType getPlanType() { */ public PropertyVariable getPropertyVariable(final AbstractNodeTemplate nodeTemplate, final String propertyName) { return this.propertyMap.getNodePropertyVariables(this.serviceTemplate, nodeTemplate).stream() - .filter(var -> var.getPropertyName().equals(propertyName)).findFirst().orElse(null); + .filter(var -> var.getPropertyName().equals(propertyName)).findFirst().orElse(null); } public PropertyVariable getPropertyVariable(final AbstractRelationshipTemplate relationshipTemplate, final String propertyName) { return this.propertyMap.getRelationPropertyVariables(this.serviceTemplate, relationshipTemplate).stream() - .filter(var -> var.getPropertyName().equals(propertyName)).findFirst().orElse(null); + .filter(var -> var.getPropertyName().equals(propertyName)).findFirst().orElse(null); } /** - * Looks for a Property with the same localName as the given toscaParameter. The search is on the - * whole TopologyTemplate this TemplateContext belongs to. + * Looks for a Property with the same localName as the given toscaParameter. The search is on the whole + * TopologyTemplate this TemplateContext belongs to. * * @param localName a String - * @return a Variable Object with TemplateId and Name, if null the whole Topology has no Property - * with the specified localName + * @return a Variable Object with TemplateId and Name, if null the whole Topology has no Property with the specified + * localName */ public PropertyVariable getPropertyVariable(final String localName) { // then on everything else @@ -115,7 +110,6 @@ public PropertyVariable getPropertyVariable(final String localName) { return this.getPropertyVariable(infraEdge, localName); } } - return null; } @@ -139,8 +133,8 @@ public File getFileFromArtifactReference(final AbstractArtifactReference ref) { } /** - * Returns an Integer which can be used as variable names etc. So that there are no collisions with - * other declarations + * Returns an Integer which can be used as variable names etc. So that there are no collisions with other + * declarations * * @return an Integer */ @@ -180,19 +174,19 @@ public QName getServiceTemplateId() { /** * Returns the variable name of the given template and property localName * - * @param templateId the Id of the Template to look in + * @param templateId the Id of the Template to look in * @param propertyName the LocalName of a Template Property * @return a String containing the variable name, else null */ public String getVariableNameOfProperty(final AbstractNodeTemplate templateId, final String propertyName) { return this.propertyMap.getNodePropertyVariables(this.serviceTemplate, templateId).stream() - .filter(var -> var.getPropertyName().equals(propertyName)).findFirst() - .map(var -> var.getVariableName()).orElse(null); + .filter(var -> var.getPropertyName().equals(propertyName)).findFirst() + .map(var -> var.getVariableName()).orElse(null); } public String getVariableNameOfProperty(final AbstractRelationshipTemplate templateId, final String propertyName) { return this.propertyMap.getRelationPropertyVariables(this.serviceTemplate, templateId).stream() - .filter(var -> var.getPropertyName().equals(propertyName)).findFirst() - .map(var -> var.getVariableName()).orElse(null); + .filter(var -> var.getPropertyName().equals(propertyName)).findFirst() + .map(var -> var.getVariableName()).orElse(null); } } diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/Property2VariableMapping.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/Property2VariableMapping.java similarity index 98% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/Property2VariableMapping.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/Property2VariableMapping.java index add05dc23..4372774da 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/Property2VariableMapping.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/Property2VariableMapping.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder.plugins.context; +package org.opentosca.planbuilder.core.plugins.context; import java.util.Collection; import java.util.HashSet; @@ -15,13 +15,11 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class Property2VariableMapping { private final Collection propertyVariables; - /** * Constructor */ @@ -89,5 +87,4 @@ public Collection getRelationPropertyVariables(AbstractService return toReturn; } - -} \ No newline at end of file +} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/PropertyVariable.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/PropertyVariable.java similarity index 96% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/PropertyVariable.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/PropertyVariable.java index 8db97ecdd..aa46bfb98 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/PropertyVariable.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/PropertyVariable.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder.plugins.context; +package org.opentosca.planbuilder.core.plugins.context; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; @@ -48,7 +48,7 @@ public AbstractRelationshipTemplate getRelationshipTemplate() { public String getPropertyName() { return this.propertyName; } - + public String getContent() { return this.nodeTemplate.getProperties().asMap().get(this.propertyName); } diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/Variable.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/Variable.java similarity index 92% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/Variable.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/Variable.java index ebbd6f714..12d2a7fd2 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/context/Variable.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/context/Variable.java @@ -1,4 +1,4 @@ -package org.opentosca.planbuilder.plugins.context; +package org.opentosca.planbuilder.core.plugins.context; /** *

    @@ -11,7 +11,6 @@ */ public class Variable { - private final String variableName; /** @@ -32,6 +31,4 @@ public Variable(final String variableName) { public String getVariableName() { return this.variableName; } - - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/registry/PluginRegistry.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/registry/PluginRegistry.java new file mode 100644 index 000000000..8317e869e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/registry/PluginRegistry.java @@ -0,0 +1,249 @@ +package org.opentosca.planbuilder.core.plugins.registry; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; + +import javax.inject.Inject; +import javax.inject.Singleton; + +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPolicyAwarePostPhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPolicyAwarePrePhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPolicyAwareTypePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPrePhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IScalingPlanBuilderSelectionPlugin; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + *

    + * This class is the registry for all plugins of the PlanBuilder + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepes@iaas.uni-stuttgart.de + */ +@Service +@Singleton +public class PluginRegistry { + + private static final Logger LOG = LoggerFactory.getLogger(PluginRegistry.class); + + private final List> genericPlugins = new ArrayList<>(); + private final List> provPlugins = new ArrayList<>(); + private final List> iaPlugins = new ArrayList<>(); + private final List> daPlugins = new ArrayList<>(); + private final List> postPlugins = new ArrayList<>(); + private final List> prePhasePlugins = new ArrayList<>(); + private final List> selectionPlugins = new ArrayList<>(); + private final List> policyAwareTypePlugins = new ArrayList<>(); + private final List> policyAwarePostPhasePlugins = new ArrayList<>(); + private final List> policyAwarePrePhasePlugins = new ArrayList<>(); + + @Inject + // required is false to allow starting without any planbuilder plugins + public PluginRegistry(@Autowired(required = false) Collection availablePlugins) { + if (availablePlugins == null) { + LOG.warn("No planbuilder plugins could be found!"); + return; + } + availablePlugins.forEach(this::registerPlugin); + LOG.info("Registered {} planbuilder plugins overall.", availablePlugins.size()); + } + + private void registerPlugin(IPlanBuilderPlugin plugin) { + final List roles = new ArrayList<>(); + if (plugin instanceof IPlanBuilderTypePlugin) { + roles.add(IPlanBuilderTypePlugin.class.getSimpleName()); + genericPlugins.add((IPlanBuilderTypePlugin) plugin); + } + if (plugin instanceof IPlanBuilderProvPhaseOperationPlugin) { + roles.add(IPlanBuilderProvPhaseOperationPlugin.class.getSimpleName()); + provPlugins.add((IPlanBuilderProvPhaseOperationPlugin) plugin); + } + if (plugin instanceof IPlanBuilderPrePhaseIAPlugin) { + roles.add(IPlanBuilderPrePhaseIAPlugin.class.getSimpleName()); + iaPlugins.add((IPlanBuilderPrePhaseIAPlugin) plugin); + } + if (plugin instanceof IPlanBuilderPrePhaseDAPlugin) { + roles.add(IPlanBuilderPrePhaseDAPlugin.class.getSimpleName()); + daPlugins.add((IPlanBuilderPrePhaseDAPlugin) plugin); + } + if (plugin instanceof IPlanBuilderPostPhasePlugin) { + roles.add(IPlanBuilderPostPhasePlugin.class.getSimpleName()); + postPlugins.add((IPlanBuilderPostPhasePlugin) plugin); + } + if (plugin instanceof IPlanBuilderPrePhasePlugin) { + roles.add(IPlanBuilderPrePhasePlugin.class.getSimpleName()); + prePhasePlugins.add((IPlanBuilderPrePhasePlugin) plugin); + } + if (plugin instanceof IScalingPlanBuilderSelectionPlugin) { + roles.add(IScalingPlanBuilderSelectionPlugin.class.getSimpleName()); + selectionPlugins.add((IScalingPlanBuilderSelectionPlugin) plugin); + } + if (plugin instanceof IPlanBuilderPolicyAwareTypePlugin) { + roles.add(IPlanBuilderPolicyAwareTypePlugin.class.getSimpleName()); + policyAwareTypePlugins.add((IPlanBuilderPolicyAwareTypePlugin) plugin); + } + if (plugin instanceof IPlanBuilderPolicyAwarePostPhasePlugin) { + roles.add(IPlanBuilderPolicyAwarePostPhasePlugin.class.getSimpleName()); + policyAwarePostPhasePlugins.add((IPlanBuilderPolicyAwarePostPhasePlugin) plugin); + } + if (plugin instanceof IPlanBuilderPolicyAwarePrePhasePlugin) { + roles.add(IPlanBuilderPolicyAwarePrePhasePlugin.class.getSimpleName()); + policyAwarePrePhasePlugins.add((IPlanBuilderPolicyAwarePrePhasePlugin) plugin); + } + if (roles.isEmpty()) { + LOG.warn("Plugin {} could not be registered for any roles. It's not available from the PluginRegistry", plugin.getClass().getSimpleName()); + return; + } + LOG.info("Registered plugin {} for role(s) {}", plugin.getClass().getSimpleName(), String.join(", ", roles)); + } + + /** + * Returns all registered GenericPlugins + * + * @return a List of IPlanBuilderTypePlugin + */ + public List> getTypePlugins() { + return genericPlugins; + } + + public List> getPrePlugins() { + return prePhasePlugins; + } + + /** + * Returns all registered ProvPhasePlugins + * + * @return a List of IPlanBuilderProvPhaseOperationPlugin + */ + public List> getProvPlugins() { + return provPlugins; + } + + /** + * Returns all registered PrePhaseIAPlugins + * + * @return a List of IPlanBuilderPrePhaseIAPlugin + */ + public List> getIaPlugins() { + return iaPlugins; + } + + /** + * Returns all registered PrePhaseDAPlugins + * + * @return a List of IPlanBuilderPrePhaseDAPlugin + */ + public List> getDaPlugins() { + return daPlugins; + } + + /** + * Returns all registered PostPhasePlugins + * + * @return a List of IPlanBuilderPostPhasePlugin + */ + public List> getPostPlugins() { + return postPlugins; + } + + /** + * Returns all registered SelectionPlugins + * + * @return a List of IScalingPlanBuilderSelectionPlugin + */ + public List> getSelectionPlugins() { + return selectionPlugins; + } + + public List> getPolicyAwareTypePlugins() { + return policyAwareTypePlugins; + } + + public List> getPolicyAwarePostPhasePlugins() { + return policyAwarePostPhasePlugins; + } + + public List> getPolicyAwarePrePhasePlugins() { + return policyAwarePrePhasePlugins; + } + + public boolean canTypePluginHandleCreate(final AbstractNodeTemplate nodeTemplate) { + return this.findTypePluginForCreation(nodeTemplate) != null; + } + + public boolean canTypePluginHandleCreate(final AbstractRelationshipTemplate relationshipTemplate) { + return this.findTypePluginForCreation(relationshipTemplate) != null; + } + + public IPlanBuilderPolicyAwareTypePlugin findPolicyAwareTypePluginForCreation(final AbstractNodeTemplate nodeTemplate) { + for (final IPlanBuilderPolicyAwareTypePlugin plugin : this.getPolicyAwareTypePlugins()) { + if (plugin.canHandlePolicyAwareCreate(nodeTemplate)) { + return plugin; + } + } + return null; + } + + public IPlanBuilderTypePlugin findTypePluginForTermination(final AbstractRelationshipTemplate relationshipTemplate) { + for (final IPlanBuilderTypePlugin plugin : this.getTypePlugins()) { + if (plugin.canHandleTerminate(relationshipTemplate)) { + return plugin; + } + } + return null; + } + + public IPlanBuilderTypePlugin findTypePluginForTermination(final AbstractNodeTemplate nodeTemplate) { + return getTypePlugins().stream() + .filter(p -> p.canHandleTerminate(nodeTemplate)) + // sort highest priority first + .sorted(Comparator.comparingInt(IPlanBuilderPlugin::getPriority).reversed()) + .findFirst() + .orElse(null); + } + + public IPlanBuilderTypePlugin findTypePluginForCreation(final AbstractNodeTemplate nodeTemplate) { + return getTypePlugins().stream() + .filter(p -> p.canHandleCreate(nodeTemplate)) + // sort highest priority first + .sorted(Comparator.comparingInt(IPlanBuilderPlugin::getPriority).reversed()) + .findFirst() + .orElse(null); + } + + public IPlanBuilderTypePlugin findTypePluginForCreation(final AbstractRelationshipTemplate relationshipTemplate) { + for (final IPlanBuilderTypePlugin plugin : this.getTypePlugins()) { + if (plugin.canHandleCreate(relationshipTemplate)) { + return plugin; + } + } + return null; + } + + public boolean handleCreateWithTypePlugin(final PlanContext context, final AbstractNodeTemplate nodeTemplate, + IPlanBuilderTypePlugin plugin) { + return plugin.handleCreate(context, nodeTemplate); + } + + public boolean handleCreateWithTypePlugin(final PlanContext context, + final AbstractRelationshipTemplate relationshipTemplate, + IPlanBuilderTypePlugin plugin) { + return plugin.handleCreate(context, relationshipTemplate); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPlugin.java new file mode 100644 index 000000000..3368387f6 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPlugin.java @@ -0,0 +1,31 @@ +package org.opentosca.planbuilder.core.plugins.typebased; + +/** + *

    + * This the common interface for all plugins the PlanBuilder will use + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public interface IPlanBuilderPlugin { + + /** + * Returns the Id of the Plugin + * + * @return a String used to identify this Plugin + */ + public String getID(); + + /** + * Returns the priority to use this plugin by the plan builders. The higher the priority the more it is advised to + * use this plugin instead of another which also can handle the requested task (e.g. generating code to create an + * instance of a node template). The highest priority is 0, while it is advised that generic plugins that can handle + * node/relationship templates in a generic way (e.g. by a pattern), and only if they can, should have a lower + * priority than node/relation specific plugins + * + * @return an Integer denoting the priority of this plugin + */ + public int getPriority(); +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwarePostPhasePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwarePostPhasePlugin.java new file mode 100644 index 000000000..9cf0a5acc --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwarePostPhasePlugin.java @@ -0,0 +1,36 @@ +package org.opentosca.planbuilder.core.plugins.typebased; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractPolicy; + +/** + *

    + * This interface should be implemented by Plugins which are PostPhasePlugins. PostPhasePlugins are used to update data + * outside of the BuildPlan, like Databases + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public interface IPlanBuilderPolicyAwarePostPhasePlugin extends IPlanBuilderPlugin { + + /** + * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of the given + * NodeTemplate and send it to the Component it belongs to + * + * @param context a TemplatePlanContext for accessing data inside the BuildPlan + * @param nodeTemplate the NodeTemplate the plugin should handle + * @return true if generating the Fragment of this Plugin was successful, else false + */ + public boolean handle(T context, AbstractNodeTemplate nodeTemplate, AbstractPolicy policy); + + /** + * Evaluates whether the given NodeTemplate can be handled by this post phase plugin. + * + * @param nodeTemplate An AbstractNodeTemplate + * @return true iff this plugin can handle the given nodeTemplate + */ + public boolean canHandle(AbstractNodeTemplate nodeTemplate, AbstractPolicy policy); +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwarePrePhasePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwarePrePhasePlugin.java new file mode 100644 index 000000000..58b5a696d --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwarePrePhasePlugin.java @@ -0,0 +1,36 @@ +package org.opentosca.planbuilder.core.plugins.typebased; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractPolicy; + +/** + *

    + * This interface should be implemented by Plugins which are PostPhasePlugins. PostPhasePlugins are used to update data + * outside of the BuildPlan, like Databases + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public interface IPlanBuilderPolicyAwarePrePhasePlugin extends IPlanBuilderPlugin { + + /** + * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of the given + * NodeTemplate and send it to the Component it belongs to + * + * @param context a TemplatePlanContext for accessing data inside the BuildPlan + * @param nodeTemplate the NodeTemplate the plugin should handle + * @return true if generating the Fragment of this Plugin was successful, else false + */ + public boolean handlePolicyAwareCreate(T context, AbstractNodeTemplate nodeTemplate, AbstractPolicy policy); + + /** + * Evaluates whether the given NodeTemplate can be handled by this post phase plugin. + * + * @param nodeTemplate An AbstractNodeTemplate + * @return true iff this plugin can handle the given nodeTemplate + */ + public boolean canHandlePolicyAwareCreate(AbstractNodeTemplate nodeTemplate, AbstractPolicy policy); +} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwareTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwareTypePlugin.java similarity index 82% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwareTypePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwareTypePlugin.java index 552496c24..2ae76f6b5 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwareTypePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPolicyAwareTypePlugin.java @@ -1,13 +1,12 @@ -package org.opentosca.planbuilder.plugins.typebased; +package org.opentosca.planbuilder.core.plugins.typebased; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; public interface IPlanBuilderPolicyAwareTypePlugin extends IPlanBuilderPlugin { /** - * This method should generate and add a fragment which handle the Template inside the - * TemplateContext + * This method should generate and add a fragment which handle the Template inside the TemplateContext * * @param templateContext a TemplateContext of a Template * @return true iff when generating and adding fragment that handles the template completely diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPostPhasePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPostPhasePlugin.java similarity index 77% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPostPhasePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPostPhasePlugin.java index 3696addde..11b931c85 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPostPhasePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPostPhasePlugin.java @@ -1,37 +1,36 @@ -package org.opentosca.planbuilder.plugins.typebased; +package org.opentosca.planbuilder.core.plugins.typebased; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; /** *

    - * This interface should be implemented by Plugins which are PostPhasePlugins. PostPhasePlugins are - * used to update data outside of the BuildPlan, like Databases + * This interface should be implemented by Plugins which are PostPhasePlugins. PostPhasePlugins are used to update data + * outside of the BuildPlan, like Databases *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public interface IPlanBuilderPostPhasePlugin extends IPlanBuilderPlugin { /** - * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of - * the given NodeTemplate and send it to the Component it belongs to + * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of the given + * NodeTemplate and send it to the Component it belongs to * - * @param context a TemplatePlanContext for accessing data inside the BuildPlan + * @param context a TemplatePlanContext for accessing data inside the BuildPlan * @param nodeTemplate the NodeTemplate the plugin should handle * @return true if generating the Fragment of this Plugin was successful, else false */ public boolean handleCreate(T context, AbstractNodeTemplate nodeTemplate); /** - * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of - * the given RelationshipTemplate and send it to the Component it belongs to + * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of the given + * RelationshipTemplate and send it to the Component it belongs to * - * @param context a TemplatePlanContext for accessing data inside the BuildPlan + * @param context a TemplatePlanContext for accessing data inside the BuildPlan * @param relationshipTemplate the RelationshipTemplate the plugin should handle * @return true if generating the Fragment of this Plugin was successful, else false */ @@ -53,22 +52,21 @@ public interface IPlanBuilderPostPhasePlugin extends IPla */ public boolean canHandleCreate(T context, AbstractRelationshipTemplate relationshipTemplate); - /** - * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of - * the given NodeTemplate and send it to the Component it belongs to + * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of the given + * NodeTemplate and send it to the Component it belongs to * - * @param context a TemplatePlanContext for accessing data inside the BuildPlan + * @param context a TemplatePlanContext for accessing data inside the BuildPlan * @param nodeTemplate the NodeTemplate the plugin should handle * @return true if generating the Fragment of this Plugin was successful, else false */ public boolean handleTerminate(T context, AbstractNodeTemplate nodeTemplate); /** - * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of - * the given RelationshipTemplate and send it to the Component it belongs to + * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of the given + * RelationshipTemplate and send it to the Component it belongs to * - * @param context a TemplatePlanContext for accessing data inside the BuildPlan + * @param context a TemplatePlanContext for accessing data inside the BuildPlan * @param relationshipTemplate the RelationshipTemplate the plugin should handle * @return true if generating the Fragment of this Plugin was successful, else false */ @@ -90,7 +88,6 @@ public interface IPlanBuilderPostPhasePlugin extends IPla */ public boolean canHandleTerminate(T context, AbstractRelationshipTemplate relationshipTemplate); - public boolean handleUpdate(T sourceContext, T targetContext, AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate); diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPrePhasePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPrePhasePlugin.java similarity index 82% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPrePhasePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPrePhasePlugin.java index 9c09329df..962247322 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPrePhasePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderPrePhasePlugin.java @@ -1,15 +1,14 @@ -package org.opentosca.planbuilder.plugins.typebased; +package org.opentosca.planbuilder.core.plugins.typebased; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; /** * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public interface IPlanBuilderPrePhasePlugin extends IPlanBuilderPlugin { @@ -20,5 +19,4 @@ public interface IPlanBuilderPrePhasePlugin extends IPlan public boolean canHandleCreate(AbstractRelationshipTemplate relationshipTemplate); public boolean handleCreate(T context, AbstractRelationshipTemplate relationshipTemplate); - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderTypePlugin.java new file mode 100644 index 000000000..8d1eb57cd --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IPlanBuilderTypePlugin.java @@ -0,0 +1,119 @@ +package org.opentosca.planbuilder.core.plugins.typebased; + +import java.util.Collection; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; + +/** + *

    + * This interface should be implemented by Plugins which can generate and add fragments that provision a complete + * Template + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public interface IPlanBuilderTypePlugin extends IPlanBuilderPlugin { + + /** + * This method should generate and add a fragment which handle the creation of the Template inside the + * TemplateContext + * + * @param templateContext a TemplateContext of a Template + * @return true iff when generating and adding fragment that handles the template completely + */ + public boolean handleCreate(T templateContext, AbstractNodeTemplate nodeTemplate); + + /** + * This method should generate and add a fragment which handle the termination of the Template inside the + * TemplateContext + * + * @param templateContext a TemplateContext of a Template + * @return true iff when generating and adding fragment that handles the template completely + */ + public boolean handleTerminate(T templateContext, AbstractNodeTemplate nodeTemplate); + + /** + * This method should generate and add a fragment which handle the creation of the Template inside the + * TemplateContext + * + * @param templateContext a TemplateContext of a Template + * @return true iff when generating and adding fragment that handles the template completely + */ + public boolean handleCreate(T templateContext, AbstractRelationshipTemplate relationshipTemplate); + + /** + * This method should generate and add a fragment which handle the termination of the Template inside the + * TemplateContext + * + * @param templateContext a TemplateContext of a Template + * @return true iff when generating and adding fragment that handles the template completely + */ + public boolean handleTerminate(T templateContext, AbstractRelationshipTemplate relationshipTemplate); + + /** + * This method should return true if the plugin can handle creation of the given nodeTemplate + * + * @param nodeTemplate the NodeTemplate to be handled by this plugin + * @return true iff this plugin can handle the given nodeTemplate + */ + public boolean canHandleCreate(AbstractNodeTemplate nodeTemplate); + + /** + * This method should return true if the plugin can handle the termination of the given nodeTemplate + * + * @param nodeTemplate the NodeTemplate to be handled by this plugin + * @return true iff this plugin can handle the given nodeTemplate + */ + public boolean canHandleTerminate(AbstractNodeTemplate nodeTemplate); + + /** + * This method should return true if the plugin can handle the creation of the given relationshipTemplate + * + * @param relationshipTemplate the RelationshipTemplate to be handled by this plugin + * @return true iff this can handle the given relationshipTemplate + */ + public boolean canHandleCreate(AbstractRelationshipTemplate relationshipTemplate); + + /** + * This method should return true if the plugin can handle the termination of the given relationshipTemplate + * + * @param relationshipTemplate the RelationshipTemplate to be handled by this plugin + * @return true iff this can handle the given relationshipTemplate + */ + public boolean canHandleTerminate(AbstractRelationshipTemplate relationshipTemplate); + + /** + * May be implemented by Type Plugins to give the planbuilder more information about needed dependencies to handle + * nodeTemplates + * + * @author kalmankepes + */ + public interface NodeDependencyInformationInterface { + + /** + * Returns a collection of nodeTemplates that are needed to be able to create an instance of the given + * nodeTemplate + * + * @param nodeTemplate the nodeTemplate to check its dependencies + * @return a collection of nodeTemplates that must be available for the nodeTemplate to create it by this + * plugin, if null -> the given NodeTemplate cannot be created under the context of the node (e.g. the topology + * template misses nodes) + */ + public Collection getCreateDependencies(AbstractNodeTemplate nodeTemplate); + + /** + * Returns a collection of nodeTemplates that are needed to be able to terminate an instance of the given + * nodeTemplate + * + * @param nodeTemplate the nodeTemplate to check its dependencies + * @return a collection of nodeTemplates that must be available for the nodeTemplate to terminate it by this + * plugin, if null -> the given NodeTemplate cannot be terminated under the context of the node (e.g. the + * topology template misses nodes) + */ + public Collection getTerminateDependencies(AbstractNodeTemplate nodeTemplate); + } +} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IScalingPlanBuilderSelectionPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IScalingPlanBuilderSelectionPlugin.java similarity index 76% rename from org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IScalingPlanBuilderSelectionPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IScalingPlanBuilderSelectionPlugin.java index cddd255f8..e1540bb24 100644 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IScalingPlanBuilderSelectionPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/typebased/IScalingPlanBuilderSelectionPlugin.java @@ -1,14 +1,13 @@ -package org.opentosca.planbuilder.plugins.typebased; +package org.opentosca.planbuilder.core.plugins.typebased; import java.util.List; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; public interface IScalingPlanBuilderSelectionPlugin extends IPlanBuilderPlugin { public boolean canHandle(AbstractNodeTemplate nodeTemplate, List selectionStrategies); public boolean handle(T context, AbstractNodeTemplate nodeTemplate, List selectionStrategies); - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/utils/PluginUtils.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/utils/PluginUtils.java new file mode 100644 index 000000000..4648eb7d6 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/java/org/opentosca/planbuilder/core/plugins/utils/PluginUtils.java @@ -0,0 +1,18 @@ +package org.opentosca.planbuilder.core.plugins.utils; + +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; + +public class PluginUtils { + + /** + * Checks whether the property of the given variable is empty in the TopologyTemplate + * + * @param variable a property variable (var must belong to a topology template property) to check + * @param context the context the variable belongs to + * @return true iff the content of the given variable is empty in the topology template property + */ + public static boolean isVariableValueEmpty(final PropertyVariable variable) { + final String content = variable.getContent(); + return content == null || content.isEmpty(); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/resources/spring/context-planbuilder.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/resources/spring/context-planbuilder.xml new file mode 100644 index 000000000..f72e0f8d6 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.core/src/main/resources/spring/context-planbuilder.xml @@ -0,0 +1,22 @@ + + + + Configuration for Spring-Bean service discovery across planbuilder + + + + + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/pom.xml new file mode 100644 index 000000000..607133553 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.integration + + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + + commons-io + commons-io + 2.6 + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/Application.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/Application.java new file mode 100644 index 000000000..8dffd8734 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/Application.java @@ -0,0 +1,287 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) +// Reference Implementation, v2.2.8-b130911.1802 +// See
    http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source +// schema. +// Generated on: 2017.06.28 at 10:18:28 AM CEST +// + +package org.eclipse.winery.model.selfservice; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlList; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType>
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="csarName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *         <element name="displayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *         <element name="version" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
    + *         <element name="authors" minOccurs="0">
    + *           <simpleType>
    + *             <list itemType="{http://www.w3.org/2001/XMLSchema}string" />
    + *           </simpleType>
    + *         </element>
    + *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *         <element name="iconUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *         <element name="imageUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *         <element name="options">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="option" type="{http://www.eclipse.org/winery/model/selfservice}ApplicationOption" maxOccurs="unbounded" minOccurs="0"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", + propOrder = {"csarName", "displayName", "version", "authors", "description", "iconUrl", "imageUrl", "options"}) +@XmlRootElement(name = "Application") +public class Application { + + @XmlElement(required = true) + protected String csarName; + @XmlElement(required = true) + protected String displayName; + protected String version; + @XmlList + protected List authors; + @XmlElement(required = true) + protected String description; + @XmlElement(required = true) + protected String iconUrl; + @XmlElement(required = true) + protected String imageUrl; + @XmlElement(required = true) + protected Application.Options options; + + /** + * Gets the value of the csarName property. + * + * @return possible object is {@link String } + */ + public String getCsarName() { + return this.csarName; + } + + /** + * Sets the value of the csarName property. + * + * @param value allowed object is {@link String } + */ + public void setCsarName(final String value) { + this.csarName = value; + } + + /** + * Gets the value of the displayName property. + * + * @return possible object is {@link String } + */ + public String getDisplayName() { + return this.displayName; + } + + /** + * Sets the value of the displayName property. + * + * @param value allowed object is {@link String } + */ + public void setDisplayName(final String value) { + this.displayName = value; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link String } + */ + public String getVersion() { + return this.version; + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link String } + */ + public void setVersion(final String value) { + this.version = value; + } + + /** + * Gets the value of the authors property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the authors property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getAuthors().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getAuthors() { + if (this.authors == null) { + this.authors = new ArrayList<>(); + } + return this.authors; + } + + /** + * Gets the value of the description property. + * + * @return possible object is {@link String } + */ + public String getDescription() { + return this.description; + } + + /** + * Sets the value of the description property. + * + * @param value allowed object is {@link String } + */ + public void setDescription(final String value) { + this.description = value; + } + + /** + * Gets the value of the iconUrl property. + * + * @return possible object is {@link String } + */ + public String getIconUrl() { + return this.iconUrl; + } + + /** + * Sets the value of the iconUrl property. + * + * @param value allowed object is {@link String } + */ + public void setIconUrl(final String value) { + this.iconUrl = value; + } + + /** + * Gets the value of the imageUrl property. + * + * @return possible object is {@link String } + */ + public String getImageUrl() { + return this.imageUrl; + } + + /** + * Sets the value of the imageUrl property. + * + * @param value allowed object is {@link String } + */ + public void setImageUrl(final String value) { + this.imageUrl = value; + } + + /** + * Gets the value of the options property. + * + * @return possible object is {@link Application.Options } + */ + public Application.Options getOptions() { + return this.options; + } + + /** + * Sets the value of the options property. + * + * @param value allowed object is {@link Application.Options } + */ + public void setOptions(final Application.Options value) { + this.options = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="option" type="{http://www.eclipse.org/winery/model/selfservice}ApplicationOption" maxOccurs="unbounded" minOccurs="0"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"option"}) + public static class Options { + + protected List option; + + /** + * Gets the value of the option property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the option property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getOption().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link ApplicationOption } + */ + public List getOption() { + if (this.option == null) { + this.option = new ArrayList<>(); + } + return this.option; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/ApplicationOption.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/ApplicationOption.java new file mode 100644 index 000000000..f8b29bbbe --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/ApplicationOption.java @@ -0,0 +1,167 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2017.06.28 at 10:18:28 AM CEST +// + +package org.eclipse.winery.model.selfservice; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for ApplicationOption complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="ApplicationOption">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *         <element name="iconUrl" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
    + *         <element name="planServiceName" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *         <element name="planInputMessageUrl" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *       </sequence>
    + *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ApplicationOption", propOrder = {"description", "iconUrl", "planServiceName", "planInputMessageUrl"}) +public class ApplicationOption { + + @XmlElement(required = true) + protected String description; + @XmlElement(required = true) + @XmlSchemaType(name = "anyURI") + protected String iconUrl; + @XmlElement(required = true) + protected String planServiceName; + @XmlElement(required = true) + protected String planInputMessageUrl; + @XmlAttribute(name = "id", required = true) + protected String id; + @XmlAttribute(name = "name", required = true) + protected String name; + + /** + * Gets the value of the description property. + * + * @return possible object is {@link String } + */ + public String getDescription() { + return this.description; + } + + /** + * Sets the value of the description property. + * + * @param value allowed object is {@link String } + */ + public void setDescription(final String value) { + this.description = value; + } + + /** + * Gets the value of the iconUrl property. + * + * @return possible object is {@link String } + */ + public String getIconUrl() { + return this.iconUrl; + } + + /** + * Sets the value of the iconUrl property. + * + * @param value allowed object is {@link String } + */ + public void setIconUrl(final String value) { + this.iconUrl = value; + } + + /** + * Gets the value of the planServiceName property. + * + * @return possible object is {@link String } + */ + public String getPlanServiceName() { + return this.planServiceName; + } + + /** + * Sets the value of the planServiceName property. + * + * @param value allowed object is {@link String } + */ + public void setPlanServiceName(final String value) { + this.planServiceName = value; + } + + /** + * Gets the value of the planInputMessageUrl property. + * + * @return possible object is {@link String } + */ + public String getPlanInputMessageUrl() { + return this.planInputMessageUrl; + } + + /** + * Sets the value of the planInputMessageUrl property. + * + * @param value allowed object is {@link String } + */ + public void setPlanInputMessageUrl(final String value) { + this.planInputMessageUrl = value; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + */ + public String getId() { + return this.id; + } + + /** + * Sets the value of the id property. + * + * @param value allowed object is {@link String } + */ + public void setId(final String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/ObjectFactory.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/ObjectFactory.java new file mode 100644 index 000000000..67a8a470a --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/ObjectFactory.java @@ -0,0 +1,52 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2014.11.11 at 08:37:59 AM CET +// + +package org.eclipse.winery.model.selfservice; + +import javax.xml.bind.annotation.XmlRegistry; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.eclipse.winery.model.selfservice package. + *

    + * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.eclipse.winery.model.selfservice + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Application } + */ + public Application createApplication() { + return new Application(); + } + + /** + * Create an instance of {@link ApplicationOption } + */ + public ApplicationOption createApplicationOption() { + return new ApplicationOption(); + } + + /** + * Create an instance of {@link Application.Options } + */ + public Application.Options createApplicationOptions() { + return new Application.Options(); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/package-info.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/package-info.java new file mode 100644 index 000000000..dfb351f03 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/eclipse/winery/model/selfservice/package-info.java @@ -0,0 +1,11 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2017.06.28 at 10:18:28 AM CEST +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.eclipse.org/winery/model/selfservice", + elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.eclipse.winery.model.selfservice; diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/Definitions.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/Definitions.java new file mode 100644 index 000000000..2e7298fcd --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/Definitions.java @@ -0,0 +1,39 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType>
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tDefinitions">
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") + +@XmlRootElement(name = "Definitions", namespace = "http://docs.oasis-open.org/tosca/ns/2011/12") +public class Definitions extends TDefinitions { + +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/ObjectFactory.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/ObjectFactory.java new file mode 100644 index 000000000..b060d6544 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/ObjectFactory.java @@ -0,0 +1,724 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.oasis_open.docs.tosca.ns._2011._12 package. + *

    + * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _Documentation_QNAME = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12", "documentation"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.oasis_open.docs.tosca.ns._2011._12 + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link TPlan.PlanModelReference } + */ + public TPlan.PlanModelReference createTPlanPlanModelReference() { + return new TPlan.PlanModelReference(); + } + + /** + * Create an instance of {@link TBoundaryDefinitions.Capabilities } + */ + public TBoundaryDefinitions.Capabilities createTBoundaryDefinitionsCapabilities() { + return new TBoundaryDefinitions.Capabilities(); + } + + /** + * Create an instance of {@link TRelationshipTemplate.SourceElement } + */ + public TRelationshipTemplate.SourceElement createTRelationshipTemplateSourceElement() { + return new TRelationshipTemplate.SourceElement(); + } + + /** + * Create an instance of {@link TDeploymentArtifacts } + */ + public TDeploymentArtifacts createTDeploymentArtifacts() { + return new TDeploymentArtifacts(); + } + + /** + * Create an instance of {@link TPlan.PlanModel } + */ + public TPlan.PlanModel createTPlanPlanModel() { + return new TPlan.PlanModel(); + } + + /** + * Create an instance of {@link TNodeTypeImplementation } + */ + public TNodeTypeImplementation createTNodeTypeImplementation() { + return new TNodeTypeImplementation(); + } + + /** + * Create an instance of {@link TImplementationArtifacts } + */ + public TImplementationArtifacts createTImplementationArtifacts() { + return new TImplementationArtifacts(); + } + + /** + * Create an instance of {@link TCapabilityType } + */ + public TCapabilityType createTCapabilityType() { + return new TCapabilityType(); + } + + /** + * Create an instance of {@link TAppliesTo.NodeTypeReference } + */ + public TAppliesTo.NodeTypeReference createTAppliesToNodeTypeReference() { + return new TAppliesTo.NodeTypeReference(); + } + + /** + * Create an instance of {@link TArtifactType } + */ + public TArtifactType createTArtifactType() { + return new TArtifactType(); + } + + /** + * Create an instance of {@link TNodeTemplate.Requirements } + */ + public TNodeTemplate.Requirements createTNodeTemplateRequirements() { + return new TNodeTemplate.Requirements(); + } + + /** + * Create an instance of {@link TNodeTypeImplementation.DerivedFrom } + */ + public TNodeTypeImplementation.DerivedFrom createTNodeTypeImplementationDerivedFrom() { + return new TNodeTypeImplementation.DerivedFrom(); + } + + /** + * Create an instance of {@link TExtension } + */ + public TExtension createTExtension() { + return new TExtension(); + } + + /** + * Create an instance of {@link TRelationshipTemplate.TargetElement } + */ + public TRelationshipTemplate.TargetElement createTRelationshipTemplateTargetElement() { + return new TRelationshipTemplate.TargetElement(); + } + + /** + * Create an instance of {@link TExportedOperation } + */ + public TExportedOperation createTExportedOperation() { + return new TExportedOperation(); + } + + /** + * Create an instance of {@link TDocumentation } + */ + public TDocumentation createTDocumentation() { + return new TDocumentation(); + } + + /** + * Create an instance of {@link TRelationshipType.ValidTarget } + */ + public TRelationshipType.ValidTarget createTRelationshipTypeValidTarget() { + return new TRelationshipType.ValidTarget(); + } + + /** + * Create an instance of {@link TNodeTemplate.Policies } + */ + public TNodeTemplate.Policies createTNodeTemplatePolicies() { + return new TNodeTemplate.Policies(); + } + + /** + * Create an instance of {@link TCapabilityDefinition } + */ + public TCapabilityDefinition createTCapabilityDefinition() { + return new TCapabilityDefinition(); + } + + /** + * Create an instance of {@link TArtifactTemplate } + */ + public TArtifactTemplate createTArtifactTemplate() { + return new TArtifactTemplate(); + } + + /** + * Create an instance of {@link TRelationshipType.SourceInterfaces } + */ + public TRelationshipType.SourceInterfaces createTRelationshipTypeSourceInterfaces() { + return new TRelationshipType.SourceInterfaces(); + } + + /** + * Create an instance of {@link TTopologyTemplate } + */ + public TTopologyTemplate createTTopologyTemplate() { + return new TTopologyTemplate(); + } + + /** + * Create an instance of {@link TNodeTemplate } + */ + public TNodeTemplate createTNodeTemplate() { + return new TNodeTemplate(); + } + + /** + * Create an instance of {@link TRequiredContainerFeature } + */ + public TRequiredContainerFeature createTRequiredContainerFeature() { + return new TRequiredContainerFeature(); + } + + /** + * Create an instance of {@link TExportedOperation.NodeOperation } + */ + public TExportedOperation.NodeOperation createTExportedOperationNodeOperation() { + return new TExportedOperation.NodeOperation(); + } + + /** + * Create an instance of {@link TPropertyMapping } + */ + public TPropertyMapping createTPropertyMapping() { + return new TPropertyMapping(); + } + + /** + * Create an instance of {@link TPlans } + */ + public TPlans createTPlans() { + return new TPlans(); + } + + /** + * Create an instance of {@link TRelationshipTypeImplementation } + */ + public TRelationshipTypeImplementation createTRelationshipTypeImplementation() { + return new TRelationshipTypeImplementation(); + } + + /** + * Create an instance of {@link TPlan.OutputParameters } + */ + public TPlan.OutputParameters createTPlanOutputParameters() { + return new TPlan.OutputParameters(); + } + + /** + * Create an instance of {@link TOperation.OutputParameters } + */ + public TOperation.OutputParameters createTOperationOutputParameters() { + return new TOperation.OutputParameters(); + } + + /** + * Create an instance of {@link TCapability } + */ + public TCapability createTCapability() { + return new TCapability(); + } + + /** + * Create an instance of {@link TExportedInterface } + */ + public TExportedInterface createTExportedInterface() { + return new TExportedInterface(); + } + + /** + * Create an instance of {@link TRequirementDefinition } + */ + public TRequirementDefinition createTRequirementDefinition() { + return new TRequirementDefinition(); + } + + /** + * Create an instance of {@link TRequiredContainerFeatures } + */ + public TRequiredContainerFeatures createTRequiredContainerFeatures() { + return new TRequiredContainerFeatures(); + } + + /** + * Create an instance of {@link TArtifactReference } + */ + public TArtifactReference createTArtifactReference() { + return new TArtifactReference(); + } + + /** + * Create an instance of {@link TBoundaryDefinitions.Requirements } + */ + public TBoundaryDefinitions.Requirements createTBoundaryDefinitionsRequirements() { + return new TBoundaryDefinitions.Requirements(); + } + + /** + * Create an instance of {@link TImplementationArtifact } + */ + public TImplementationArtifact createTImplementationArtifact() { + return new TImplementationArtifact(); + } + + /** + * Create an instance of {@link Definitions } + */ + public Definitions createDefinitions() { + return new Definitions(); + } + + /** + * Create an instance of {@link TRelationshipType.TargetInterfaces } + */ + public TRelationshipType.TargetInterfaces createTRelationshipTypeTargetInterfaces() { + return new TRelationshipType.TargetInterfaces(); + } + + /** + * Create an instance of {@link TBoundaryDefinitions } + */ + public TBoundaryDefinitions createTBoundaryDefinitions() { + return new TBoundaryDefinitions(); + } + + /** + * Create an instance of {@link TRequirementDefinition.Constraints } + */ + public TRequirementDefinition.Constraints createTRequirementDefinitionConstraints() { + return new TRequirementDefinition.Constraints(); + } + + /** + * Create an instance of {@link TNodeType.RequirementDefinitions } + */ + public TNodeType.RequirementDefinitions createTNodeTypeRequirementDefinitions() { + return new TNodeType.RequirementDefinitions(); + } + + /** + * Create an instance of {@link TPropertyConstraint } + */ + public TPropertyConstraint createTPropertyConstraint() { + return new TPropertyConstraint(); + } + + /** + * Create an instance of {@link TTopologyElementInstanceStates.InstanceState } + */ + public TTopologyElementInstanceStates.InstanceState createTTopologyElementInstanceStatesInstanceState() { + return new TTopologyElementInstanceStates.InstanceState(); + } + + /** + * Create an instance of {@link TRelationshipTemplate } + */ + public TRelationshipTemplate createTRelationshipTemplate() { + return new TRelationshipTemplate(); + } + + /** + * Create an instance of {@link TExtensibleElements } + */ + public TExtensibleElements createTExtensibleElements() { + return new TExtensibleElements(); + } + + /** + * Create an instance of {@link TBoundaryDefinitions.Properties.PropertyMappings } + */ + public TBoundaryDefinitions.Properties.PropertyMappings createTBoundaryDefinitionsPropertiesPropertyMappings() { + return new TBoundaryDefinitions.Properties.PropertyMappings(); + } + + /** + * Create an instance of {@link TPlan.InputParameters } + */ + public TPlan.InputParameters createTPlanInputParameters() { + return new TPlan.InputParameters(); + } + + /** + * Create an instance of {@link TTopologyElementInstanceStates } + */ + public TTopologyElementInstanceStates createTTopologyElementInstanceStates() { + return new TTopologyElementInstanceStates(); + } + + /** + * Create an instance of {@link TRelationshipTypeImplementation.DerivedFrom } + */ + public TRelationshipTypeImplementation.DerivedFrom createTRelationshipTypeImplementationDerivedFrom() { + return new TRelationshipTypeImplementation.DerivedFrom(); + } + + /** + * Create an instance of {@link TAppliesTo } + */ + public TAppliesTo createTAppliesTo() { + return new TAppliesTo(); + } + + /** + * Create an instance of {@link TPolicyTemplate } + */ + public TPolicyTemplate createTPolicyTemplate() { + return new TPolicyTemplate(); + } + + /** + * Create an instance of {@link TNodeType.CapabilityDefinitions } + */ + public TNodeType.CapabilityDefinitions createTNodeTypeCapabilityDefinitions() { + return new TNodeType.CapabilityDefinitions(); + } + + /** + * Create an instance of {@link TInterface } + */ + public TInterface createTInterface() { + return new TInterface(); + } + + /** + * Create an instance of {@link TTags } + */ + public TTags createTTags() { + return new TTags(); + } + + /** + * Create an instance of {@link TRelationshipTemplate.RelationshipConstraints } + */ + public TRelationshipTemplate.RelationshipConstraints createTRelationshipTemplateRelationshipConstraints() { + return new TRelationshipTemplate.RelationshipConstraints(); + } + + /** + * Create an instance of {@link TServiceTemplate } + */ + public TServiceTemplate createTServiceTemplate() { + return new TServiceTemplate(); + } + + /** + * Create an instance of {@link TRequirement } + */ + public TRequirement createTRequirement() { + return new TRequirement(); + } + + /** + * Create an instance of {@link TRelationshipType.ValidSource } + */ + public TRelationshipType.ValidSource createTRelationshipTypeValidSource() { + return new TRelationshipType.ValidSource(); + } + + /** + * Create an instance of {@link TOperation } + */ + public TOperation createTOperation() { + return new TOperation(); + } + + /** + * Create an instance of {@link TArtifactTemplate.ArtifactReferences } + */ + public TArtifactTemplate.ArtifactReferences createTArtifactTemplateArtifactReferences() { + return new TArtifactTemplate.ArtifactReferences(); + } + + /** + * Create an instance of {@link TCondition } + */ + public TCondition createTCondition() { + return new TCondition(); + } + + /** + * Create an instance of {@link org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.Properties } + */ + public org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.Properties createTEntityTemplateProperties() { + return new org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.Properties(); + } + + /** + * Create an instance of {@link TImplementationArtifacts.ImplementationArtifact } + */ + public TImplementationArtifacts.ImplementationArtifact createTImplementationArtifactsImplementationArtifact() { + return new TImplementationArtifacts.ImplementationArtifact(); + } + + /** + * Create an instance of {@link TExportedOperation.Plan } + */ + public TExportedOperation.Plan createTExportedOperationPlan() { + return new TExportedOperation.Plan(); + } + + /** + * Create an instance of {@link TBoundaryDefinitions.Policies } + */ + public TBoundaryDefinitions.Policies createTBoundaryDefinitionsPolicies() { + return new TBoundaryDefinitions.Policies(); + } + + /** + * Create an instance of {@link TPlan } + */ + public TPlan createTPlan() { + return new TPlan(); + } + + /** + * Create an instance of {@link TConstraint } + */ + public TConstraint createTConstraint() { + return new TConstraint(); + } + + /** + * Create an instance of {@link TNodeType } + */ + public TNodeType createTNodeType() { + return new TNodeType(); + } + + /** + * Create an instance of {@link TParameter } + */ + public TParameter createTParameter() { + return new TParameter(); + } + + /** + * Create an instance of {@link TRequirementRef } + */ + public TRequirementRef createTRequirementRef() { + return new TRequirementRef(); + } + + /** + * Create an instance of {@link TImport } + */ + public TImport createTImport() { + return new TImport(); + } + + /** + * Create an instance of {@link TDefinitions } + */ + public TDefinitions createTDefinitions() { + return new TDefinitions(); + } + + /** + * Create an instance of {@link TPolicyType } + */ + public TPolicyType createTPolicyType() { + return new TPolicyType(); + } + + /** + * Create an instance of {@link TCapabilityRef } + */ + public TCapabilityRef createTCapabilityRef() { + return new TCapabilityRef(); + } + + /** + * Create an instance of {@link TOperation.InputParameters } + */ + public TOperation.InputParameters createTOperationInputParameters() { + return new TOperation.InputParameters(); + } + + /** + * Create an instance of {@link TArtifactReference.Include } + */ + public TArtifactReference.Include createTArtifactReferenceInclude() { + return new TArtifactReference.Include(); + } + + /** + * Create an instance of {@link TDeploymentArtifact } + */ + public TDeploymentArtifact createTDeploymentArtifact() { + return new TDeploymentArtifact(); + } + + /** + * Create an instance of {@link TExtensions } + */ + public TExtensions createTExtensions() { + return new TExtensions(); + } + + /** + * Create an instance of {@link org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.PropertyConstraints } + */ + public org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.PropertyConstraints createTEntityTemplatePropertyConstraints() { + return new org.oasis_open.docs.tosca.ns._2011._12.TEntityTemplate.PropertyConstraints(); + } + + /** + * Create an instance of {@link TNodeTemplate.Capabilities } + */ + public TNodeTemplate.Capabilities createTNodeTemplateCapabilities() { + return new TNodeTemplate.Capabilities(); + } + + /** + * Create an instance of {@link TBoundaryDefinitions.Properties } + */ + public TBoundaryDefinitions.Properties createTBoundaryDefinitionsProperties() { + return new TBoundaryDefinitions.Properties(); + } + + /** + * Create an instance of {@link TArtifactReference.Exclude } + */ + public TArtifactReference.Exclude createTArtifactReferenceExclude() { + return new TArtifactReference.Exclude(); + } + + /** + * Create an instance of {@link TDefinitions.Extensions } + */ + public TDefinitions.Extensions createTDefinitionsExtensions() { + return new TDefinitions.Extensions(); + } + + /** + * Create an instance of {@link TRelationshipType } + */ + public TRelationshipType createTRelationshipType() { + return new TRelationshipType(); + } + + /** + * Create an instance of {@link TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint } + */ + public TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint createTRelationshipTemplateRelationshipConstraintsRelationshipConstraint() { + return new TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint(); + } + + /** + * Create an instance of {@link TBoundaryDefinitions.Interfaces } + */ + public TBoundaryDefinitions.Interfaces createTBoundaryDefinitionsInterfaces() { + return new TBoundaryDefinitions.Interfaces(); + } + + /** + * Create an instance of {@link TNodeType.Interfaces } + */ + public TNodeType.Interfaces createTNodeTypeInterfaces() { + return new TNodeType.Interfaces(); + } + + /** + * Create an instance of {@link org.oasis_open.docs.tosca.ns._2011._12.TEntityType.PropertiesDefinition } + */ + public org.oasis_open.docs.tosca.ns._2011._12.TEntityType.PropertiesDefinition createTEntityTypePropertiesDefinition() { + return new org.oasis_open.docs.tosca.ns._2011._12.TEntityType.PropertiesDefinition(); + } + + /** + * Create an instance of {@link TDefinitions.Types } + */ + public TDefinitions.Types createTDefinitionsTypes() { + return new TDefinitions.Types(); + } + + /** + * Create an instance of {@link TPolicy } + */ + public TPolicy createTPolicy() { + return new TPolicy(); + } + + /** + * Create an instance of {@link org.oasis_open.docs.tosca.ns._2011._12.TEntityType.DerivedFrom } + */ + public org.oasis_open.docs.tosca.ns._2011._12.TEntityType.DerivedFrom createTEntityTypeDerivedFrom() { + return new org.oasis_open.docs.tosca.ns._2011._12.TEntityType.DerivedFrom(); + } + + /** + * Create an instance of {@link TTag } + */ + public TTag createTTag() { + return new TTag(); + } + + /** + * Create an instance of {@link TExportedOperation.RelationshipOperation } + */ + public TExportedOperation.RelationshipOperation createTExportedOperationRelationshipOperation() { + return new TExportedOperation.RelationshipOperation(); + } + + /** + * Create an instance of {@link TRequirementType } + */ + public TRequirementType createTRequirementType() { + return new TRequirementType(); + } + + /** + * Create an instance of {@link TBoundaryDefinitions.PropertyConstraints } + */ + public TBoundaryDefinitions.PropertyConstraints createTBoundaryDefinitionsPropertyConstraints() { + return new TBoundaryDefinitions.PropertyConstraints(); + } + + /** + * Create an instance of {@link TCapabilityDefinition.Constraints } + */ + public TCapabilityDefinition.Constraints createTCapabilityDefinitionConstraints() { + return new TCapabilityDefinition.Constraints(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TDocumentation }{@code >}} + */ + @XmlElementDecl(namespace = "http://docs.oasis-open.org/tosca/ns/2011/12", name = "documentation") + public JAXBElement createDocumentation(final TDocumentation value) { + return new JAXBElement<>(_Documentation_QNAME, TDocumentation.class, null, value); + } +} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/Plan.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/Plan.java similarity index 100% rename from org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/Plan.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/Plan.java diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TAppliesTo.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TAppliesTo.java new file mode 100644 index 000000000..464100b81 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TAppliesTo.java @@ -0,0 +1,123 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tAppliesTo complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tAppliesTo">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="NodeTypeReference" maxOccurs="unbounded">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tAppliesTo", propOrder = {"nodeTypeReference"}) +public class TAppliesTo { + + @XmlElement(name = "NodeTypeReference", required = true) + protected List nodeTypeReference; + + /** + * Gets the value of the nodeTypeReference property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the nodeTypeReference property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getNodeTypeReference().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TAppliesTo.NodeTypeReference } + */ + public List getNodeTypeReference() { + if (this.nodeTypeReference == null) { + this.nodeTypeReference = new ArrayList<>(); + } + return this.nodeTypeReference; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class NodeTypeReference { + + @XmlAttribute(required = true) + protected QName typeRef; + + /** + * Gets the value of the typeRef property. + * + * @return possible object is {@link QName } + */ + public QName getTypeRef() { + return this.typeRef; + } + + /** + * Sets the value of the typeRef property. + * + * @param value allowed object is {@link QName } + */ + public void setTypeRef(final QName value) { + this.typeRef = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactReference.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactReference.java new file mode 100644 index 000000000..82bc4254b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactReference.java @@ -0,0 +1,200 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tArtifactReference complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tArtifactReference">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <choice maxOccurs="unbounded" minOccurs="0">
    + *         <element name="Include">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Exclude">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </choice>
    + *       <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tArtifactReference", propOrder = {"includeOrExclude"}) +public class TArtifactReference { + + @XmlElements( {@XmlElement(name = "Exclude", type = TArtifactReference.Exclude.class), + @XmlElement(name = "Include", type = TArtifactReference.Include.class)}) + protected List includeOrExclude; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String reference; + + /** + * Gets the value of the includeOrExclude property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the includeOrExclude property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getIncludeOrExclude().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TArtifactReference.Exclude } {@link + * TArtifactReference.Include } + */ + public List getIncludeOrExclude() { + if (this.includeOrExclude == null) { + this.includeOrExclude = new ArrayList<>(); + } + return this.includeOrExclude; + } + + /** + * Gets the value of the reference property. + * + * @return possible object is {@link String } + */ + public String getReference() { + return this.reference; + } + + /** + * Sets the value of the reference property. + * + * @param value allowed object is {@link String } + */ + public void setReference(final String value) { + this.reference = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Exclude { + + @XmlAttribute(required = true) + protected String pattern; + + /** + * Gets the value of the pattern property. + * + * @return possible object is {@link String } + */ + public String getPattern() { + return this.pattern; + } + + /** + * Sets the value of the pattern property. + * + * @param value allowed object is {@link String } + */ + public void setPattern(final String value) { + this.pattern = value; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="pattern" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Include { + + @XmlAttribute(required = true) + protected String pattern; + + /** + * Gets the value of the pattern property. + * + * @return possible object is {@link String } + */ + public String getPattern() { + return this.pattern; + } + + /** + * Sets the value of the pattern property. + * + * @param value allowed object is {@link String } + */ + public void setPattern(final String value) { + this.pattern = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactTemplate.java new file mode 100644 index 000000000..4aaca6c72 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactTemplate.java @@ -0,0 +1,148 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tArtifactTemplate complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tArtifactTemplate">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    + *       <sequence>
    + *         <element name="ArtifactReferences" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="ArtifactReference" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactReference" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tArtifactTemplate", propOrder = {"artifactReferences"}) +public class TArtifactTemplate extends TEntityTemplate { + + @XmlElement(name = "ArtifactReferences") + protected TArtifactTemplate.ArtifactReferences artifactReferences; + @XmlAttribute + protected String name; + + /** + * Gets the value of the artifactReferences property. + * + * @return possible object is {@link TArtifactTemplate.ArtifactReferences } + */ + public TArtifactTemplate.ArtifactReferences getArtifactReferences() { + return this.artifactReferences; + } + + /** + * Sets the value of the artifactReferences property. + * + * @param value allowed object is {@link TArtifactTemplate.ArtifactReferences } + */ + public void setArtifactReferences(final TArtifactTemplate.ArtifactReferences value) { + this.artifactReferences = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="ArtifactReference" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactReference" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"artifactReference"}) + public static class ArtifactReferences { + + @XmlElement(name = "ArtifactReference", required = true) + protected List artifactReference; + + /** + * Gets the value of the artifactReference property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the artifactReference property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getArtifactReference().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TArtifactReference } + */ + public List getArtifactReference() { + if (this.artifactReference == null) { + this.artifactReference = new ArrayList<>(); + } + return this.artifactReference; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactType.java new file mode 100644 index 000000000..1fec5170b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TArtifactType.java @@ -0,0 +1,36 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tArtifactType complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tArtifactType">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tArtifactType") +public class TArtifactType extends TEntityType { + +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TBoolean.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TBoolean.java new file mode 100644 index 000000000..bc1d1badc --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TBoolean.java @@ -0,0 +1,57 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tBoolean. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + *

    + * + *

    + * <simpleType name="tBoolean">
    + *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *     <enumeration value="yes"/>
    + *     <enumeration value="no"/>
    + *   </restriction>
    + * </simpleType>
    + * 
    + */ +@XmlType(name = "tBoolean") +@XmlEnum +public enum TBoolean { + + @XmlEnumValue("yes") + YES("yes"), @XmlEnumValue("no") + NO("no"); + private final String value; + + TBoolean(final String v) { + this.value = v; + } + + public String value() { + return this.value; + } + + public static TBoolean fromValue(final String v) { + for (final TBoolean c : TBoolean.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TBoundaryDefinitions.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TBoundaryDefinitions.java new file mode 100644 index 000000000..51bb3ae29 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TBoundaryDefinitions.java @@ -0,0 +1,634 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tBoundaryDefinitions complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tBoundaryDefinitions">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="Properties" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <any namespace='##other'/>
    + *                   <element name="PropertyMappings" minOccurs="0">
    + *                     <complexType>
    + *                       <complexContent>
    + *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                           <sequence>
    + *                             <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    + *                           </sequence>
    + *                         </restriction>
    + *                       </complexContent>
    + *                     </complexType>
    + *                   </element>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="PropertyConstraints" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Requirements" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementRef" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Capabilities" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityRef" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Policies" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Interfaces" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedInterface" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tBoundaryDefinitions", + propOrder = {"properties", "propertyConstraints", "requirements", "capabilities", "policies", "interfaces"}) +public class TBoundaryDefinitions { + + @XmlElement(name = "Properties") + protected TBoundaryDefinitions.Properties properties; + @XmlElement(name = "PropertyConstraints") + protected TBoundaryDefinitions.PropertyConstraints propertyConstraints; + @XmlElement(name = "Requirements") + protected TBoundaryDefinitions.Requirements requirements; + @XmlElement(name = "Capabilities") + protected TBoundaryDefinitions.Capabilities capabilities; + @XmlElement(name = "Policies") + protected TBoundaryDefinitions.Policies policies; + @XmlElement(name = "Interfaces") + protected TBoundaryDefinitions.Interfaces interfaces; + + /** + * Gets the value of the properties property. + * + * @return possible object is {@link TBoundaryDefinitions.Properties } + */ + public TBoundaryDefinitions.Properties getProperties() { + return this.properties; + } + + /** + * Sets the value of the properties property. + * + * @param value allowed object is {@link TBoundaryDefinitions.Properties } + */ + public void setProperties(final TBoundaryDefinitions.Properties value) { + this.properties = value; + } + + /** + * Gets the value of the propertyConstraints property. + * + * @return possible object is {@link TBoundaryDefinitions.PropertyConstraints } + */ + public TBoundaryDefinitions.PropertyConstraints getPropertyConstraints() { + return this.propertyConstraints; + } + + /** + * Sets the value of the propertyConstraints property. + * + * @param value allowed object is {@link TBoundaryDefinitions.PropertyConstraints } + */ + public void setPropertyConstraints(final TBoundaryDefinitions.PropertyConstraints value) { + this.propertyConstraints = value; + } + + /** + * Gets the value of the requirements property. + * + * @return possible object is {@link TBoundaryDefinitions.Requirements } + */ + public TBoundaryDefinitions.Requirements getRequirements() { + return this.requirements; + } + + /** + * Sets the value of the requirements property. + * + * @param value allowed object is {@link TBoundaryDefinitions.Requirements } + */ + public void setRequirements(final TBoundaryDefinitions.Requirements value) { + this.requirements = value; + } + + /** + * Gets the value of the capabilities property. + * + * @return possible object is {@link TBoundaryDefinitions.Capabilities } + */ + public TBoundaryDefinitions.Capabilities getCapabilities() { + return this.capabilities; + } + + /** + * Sets the value of the capabilities property. + * + * @param value allowed object is {@link TBoundaryDefinitions.Capabilities } + */ + public void setCapabilities(final TBoundaryDefinitions.Capabilities value) { + this.capabilities = value; + } + + /** + * Gets the value of the policies property. + * + * @return possible object is {@link TBoundaryDefinitions.Policies } + */ + public TBoundaryDefinitions.Policies getPolicies() { + return this.policies; + } + + /** + * Sets the value of the policies property. + * + * @param value allowed object is {@link TBoundaryDefinitions.Policies } + */ + public void setPolicies(final TBoundaryDefinitions.Policies value) { + this.policies = value; + } + + /** + * Gets the value of the interfaces property. + * + * @return possible object is {@link TBoundaryDefinitions.Interfaces } + */ + public TBoundaryDefinitions.Interfaces getInterfaces() { + return this.interfaces; + } + + /** + * Sets the value of the interfaces property. + * + * @param value allowed object is {@link TBoundaryDefinitions.Interfaces } + */ + public void setInterfaces(final TBoundaryDefinitions.Interfaces value) { + this.interfaces = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityRef" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"capability"}) + public static class Capabilities { + + @XmlElement(name = "Capability", required = true) + protected List capability; + + /** + * Gets the value of the capability property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the capability property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getCapability().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCapabilityRef } + */ + public List getCapability() { + if (this.capability == null) { + this.capability = new ArrayList<>(); + } + return this.capability; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedInterface" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"_interface"}) + public static class Interfaces { + + @XmlElement(name = "Interface", required = true) + protected List _interface; + + /** + * Gets the value of the interface property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the interface property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getInterface().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TExportedInterface } + */ + public List getInterface() { + if (this._interface == null) { + this._interface = new ArrayList<>(); + } + return this._interface; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"policy"}) + public static class Policies { + + @XmlElement(name = "Policy", required = true) + protected List policy; + + /** + * Gets the value of the policy property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the policy property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getPolicy().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TPolicy } + */ + public List getPolicy() { + if (this.policy == null) { + this.policy = new ArrayList<>(); + } + return this.policy; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <any namespace='##other'/>
    +     *         <element name="PropertyMappings" minOccurs="0">
    +     *           <complexType>
    +     *             <complexContent>
    +     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *                 <sequence>
    +     *                   <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    +     *                 </sequence>
    +     *               </restriction>
    +     *             </complexContent>
    +     *           </complexType>
    +     *         </element>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"any", "propertyMappings"}) + public static class Properties { + + @XmlAnyElement(lax = true) + protected Object any; + @XmlElement(name = "PropertyMappings") + protected TBoundaryDefinitions.Properties.PropertyMappings propertyMappings; + + /** + * Gets the value of the any property. + * + * @return possible object is {@link Object } + */ + public Object getAny() { + return this.any; + } + + /** + * Sets the value of the any property. + * + * @param value allowed object is {@link Object } + */ + public void setAny(final Object value) { + this.any = value; + } + + /** + * Gets the value of the propertyMappings property. + * + * @return possible object is {@link TBoundaryDefinitions.Properties.PropertyMappings } + */ + public TBoundaryDefinitions.Properties.PropertyMappings getPropertyMappings() { + return this.propertyMappings; + } + + /** + * Sets the value of the propertyMappings property. + * + * @param value allowed object is {@link TBoundaryDefinitions.Properties.PropertyMappings } + */ + public void setPropertyMappings(final TBoundaryDefinitions.Properties.PropertyMappings value) { + this.propertyMappings = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +         * <complexType>
    +         *   <complexContent>
    +         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +         *       <sequence>
    +         *         <element name="PropertyMapping" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyMapping" maxOccurs="unbounded"/>
    +         *       </sequence>
    +         *     </restriction>
    +         *   </complexContent>
    +         * </complexType>
    +         * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"propertyMapping"}) + public static class PropertyMappings { + + @XmlElement(name = "PropertyMapping", required = true) + protected List propertyMapping; + + /** + * Gets the value of the propertyMapping property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a + * set method for the propertyMapping property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +             * getPropertyMapping().add(newItem);
    +             * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TPropertyMapping } + */ + public List getPropertyMapping() { + if (this.propertyMapping == null) { + this.propertyMapping = new ArrayList<>(); + } + return this.propertyMapping; + } + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"propertyConstraint"}) + public static class PropertyConstraints { + + @XmlElement(name = "PropertyConstraint", required = true) + protected List propertyConstraint; + + /** + * Gets the value of the propertyConstraint property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the propertyConstraint property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getPropertyConstraint().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TPropertyConstraint } + */ + public List getPropertyConstraint() { + if (this.propertyConstraint == null) { + this.propertyConstraint = new ArrayList<>(); + } + return this.propertyConstraint; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementRef" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"requirement"}) + public static class Requirements { + + @XmlElement(name = "Requirement", required = true) + protected List requirement; + + /** + * Gets the value of the requirement property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the requirement property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getRequirement().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TRequirementRef } + */ + public List getRequirement() { + if (this.requirement == null) { + this.requirement = new ArrayList<>(); + } + return this.requirement; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapability.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapability.java new file mode 100644 index 000000000..43e9073ed --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapability.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tCapability complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tCapability">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tCapability") +public class TCapability extends TEntityTemplate { + + @XmlAttribute(required = true) + protected String name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityDefinition.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityDefinition.java new file mode 100644 index 000000000..4f2e9d210 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityDefinition.java @@ -0,0 +1,235 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tCapabilityDefinition complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tCapabilityDefinition">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Constraints" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="capabilityType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="lowerBound" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    + *       <attribute name="upperBound" default="1">
    + *         <simpleType>
    + *           <union>
    + *             <simpleType>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    + *                 <pattern value="([1-9]+[0-9]*)"/>
    + *               </restriction>
    + *             </simpleType>
    + *             <simpleType>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *                 <enumeration value="unbounded"/>
    + *               </restriction>
    + *             </simpleType>
    + *           </union>
    + *         </simpleType>
    + *       </attribute>
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tCapabilityDefinition", propOrder = {"constraints"}) +public class TCapabilityDefinition extends TExtensibleElements { + + @XmlElement(name = "Constraints") + protected TCapabilityDefinition.Constraints constraints; + @XmlAttribute(required = true) + protected String name; + @XmlAttribute(required = true) + protected QName capabilityType; + @XmlAttribute + protected Integer lowerBound; + @XmlAttribute + protected String upperBound; + + /** + * Gets the value of the constraints property. + * + * @return possible object is {@link TCapabilityDefinition.Constraints } + */ + public TCapabilityDefinition.Constraints getConstraints() { + return this.constraints; + } + + /** + * Sets the value of the constraints property. + * + * @param value allowed object is {@link TCapabilityDefinition.Constraints } + */ + public void setConstraints(final TCapabilityDefinition.Constraints value) { + this.constraints = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the capabilityType property. + * + * @return possible object is {@link QName } + */ + public QName getCapabilityType() { + return this.capabilityType; + } + + /** + * Sets the value of the capabilityType property. + * + * @param value allowed object is {@link QName } + */ + public void setCapabilityType(final QName value) { + this.capabilityType = value; + } + + /** + * Gets the value of the lowerBound property. + * + * @return possible object is {@link Integer } + */ + public int getLowerBound() { + if (this.lowerBound == null) { + return 1; + } else { + return this.lowerBound; + } + } + + /** + * Sets the value of the lowerBound property. + * + * @param value allowed object is {@link Integer } + */ + public void setLowerBound(final Integer value) { + this.lowerBound = value; + } + + /** + * Gets the value of the upperBound property. + * + * @return possible object is {@link String } + */ + public String getUpperBound() { + if (this.upperBound == null) { + return "1"; + } else { + return this.upperBound; + } + } + + /** + * Sets the value of the upperBound property. + * + * @param value allowed object is {@link String } + */ + public void setUpperBound(final String value) { + this.upperBound = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"constraint"}) + public static class Constraints { + + @XmlElement(name = "Constraint", required = true) + protected List constraint; + + /** + * Gets the value of the constraint property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the constraint property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getConstraint().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TConstraint } + */ + public List getConstraint() { + if (this.constraint == null) { + this.constraint = new ArrayList<>(); + } + return this.constraint; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityRef.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityRef.java new file mode 100644 index 000000000..cc62a6ad4 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityRef.java @@ -0,0 +1,82 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tCapabilityRef complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tCapabilityRef">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tCapabilityRef") +public class TCapabilityRef { + + @XmlAttribute + protected String name; + @XmlAttribute(required = true) + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object ref; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the ref property. + * + * @return possible object is {@link Object } + */ + public Object getRef() { + return this.ref; + } + + /** + * Sets the value of the ref property. + * + * @param value allowed object is {@link Object } + */ + public void setRef(final Object value) { + this.ref = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityType.java new file mode 100644 index 000000000..224869f6e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCapabilityType.java @@ -0,0 +1,36 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tCapabilityType complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tCapabilityType">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tCapabilityType") +public class TCapabilityType extends TEntityType { + +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCondition.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCondition.java new file mode 100644 index 000000000..312a204ea --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TCondition.java @@ -0,0 +1,96 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tCondition complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tCondition">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="expressionLanguage" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tCondition", propOrder = {"any"}) +public class TCondition { + + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String expressionLanguage; + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the any property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getAny().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (this.any == null) { + this.any = new ArrayList<>(); + } + return this.any; + } + + /** + * Gets the value of the expressionLanguage property. + * + * @return possible object is {@link String } + */ + public String getExpressionLanguage() { + return this.expressionLanguage; + } + + /** + * Sets the value of the expressionLanguage property. + * + * @param value allowed object is {@link String } + */ + public void setExpressionLanguage(final String value) { + this.expressionLanguage = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TConstraint.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TConstraint.java new file mode 100644 index 000000000..99a4cecae --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TConstraint.java @@ -0,0 +1,87 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tConstraint complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tConstraint">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <any processContents='lax' namespace='##other'/>
    + *       </sequence>
    + *       <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tConstraint", propOrder = {"any"}) +@XmlSeeAlso( {TPropertyConstraint.class}) +public class TConstraint { + + @XmlAnyElement(lax = true) + protected Object any; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String constraintType; + + /** + * Gets the value of the any property. + * + * @return possible object is {@link Object } {@link Element } + */ + public Object getAny() { + return this.any; + } + + /** + * Sets the value of the any property. + * + * @param value allowed object is {@link Object } {@link Element } + */ + public void setAny(final Object value) { + this.any = value; + } + + /** + * Gets the value of the constraintType property. + * + * @return possible object is {@link String } + */ + public String getConstraintType() { + return this.constraintType; + } + + /** + * Sets the value of the constraintType property. + * + * @param value allowed object is {@link String } + */ + public void setConstraintType(final String value) { + this.constraintType = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDefinitions.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDefinitions.java new file mode 100644 index 000000000..4dd051d76 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDefinitions.java @@ -0,0 +1,372 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tDefinitions complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tDefinitions">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Extensions" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Import" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImport" maxOccurs="unbounded" minOccurs="0"/>
    + *         <element name="Types" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <choice maxOccurs="unbounded">
    + *           <element name="ServiceTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tServiceTemplate"/>
    + *           <element name="NodeType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeType"/>
    + *           <element name="NodeTypeImplementation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeTypeImplementation"/>
    + *           <element name="RelationshipType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipType"/>
    + *           <element name="RelationshipTypeImplementation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipTypeImplementation"/>
    + *           <element name="RequirementType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementType"/>
    + *           <element name="CapabilityType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityType"/>
    + *           <element name="ArtifactType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactType"/>
    + *           <element name="ArtifactTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tArtifactTemplate"/>
    + *           <element name="PolicyType" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicyType"/>
    + *           <element name="PolicyTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicyTemplate"/>
    + *         </choice>
    + *       </sequence>
    + *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="targetNamespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tDefinitions", + propOrder = {"extensions", "_import", "types", "serviceTemplateOrNodeTypeOrNodeTypeImplementation"}) +@XmlSeeAlso( {Definitions.class}) +public class TDefinitions extends TExtensibleElements { + + @XmlElement(name = "Extensions") + protected TDefinitions.Extensions extensions; + @XmlElement(name = "Import") + protected List _import; + @XmlElement(name = "Types") + protected TDefinitions.Types types; + @XmlElements( {@XmlElement(name = "PolicyType", type = TPolicyType.class), + @XmlElement(name = "RelationshipType", type = TRelationshipType.class), + @XmlElement(name = "NodeType", type = TNodeType.class), + @XmlElement(name = "CapabilityType", type = TCapabilityType.class), + @XmlElement(name = "RequirementType", type = TRequirementType.class), + @XmlElement(name = "NodeTypeImplementation", type = TNodeTypeImplementation.class), + @XmlElement(name = "ArtifactType", type = TArtifactType.class), + @XmlElement(name = "PolicyTemplate", type = TPolicyTemplate.class), + @XmlElement(name = "ArtifactTemplate", type = TArtifactTemplate.class), + @XmlElement(name = "RelationshipTypeImplementation", type = TRelationshipTypeImplementation.class), + @XmlElement(name = "ServiceTemplate", type = TServiceTemplate.class)}) + protected List serviceTemplateOrNodeTypeOrNodeTypeImplementation; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute + protected String name; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String targetNamespace; + + /** + * Gets the value of the extensions property. + * + * @return possible object is {@link TDefinitions.Extensions } + */ + public TDefinitions.Extensions getExtensions() { + return this.extensions; + } + + /** + * Sets the value of the extensions property. + * + * @param value allowed object is {@link TDefinitions.Extensions } + */ + public void setExtensions(final TDefinitions.Extensions value) { + this.extensions = value; + } + + /** + * Gets the value of the import property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the import property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getImport().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TImport } + */ + public List getImport() { + if (this._import == null) { + this._import = new ArrayList<>(); + } + return this._import; + } + + /** + * Gets the value of the types property. + * + * @return possible object is {@link TDefinitions.Types } + */ + public TDefinitions.Types getTypes() { + return this.types; + } + + /** + * Sets the value of the types property. + * + * @param value allowed object is {@link TDefinitions.Types } + */ + public void setTypes(final TDefinitions.Types value) { + this.types = value; + } + + /** + * Gets the value of the serviceTemplateOrNodeTypeOrNodeTypeImplementation property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the serviceTemplateOrNodeTypeOrNodeTypeImplementation property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getServiceTemplateOrNodeTypeOrNodeTypeImplementation().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TPolicyType } {@link TRelationshipType } {@link + * TNodeType } {@link TCapabilityType } {@link TRequirementType } {@link TNodeTypeImplementation } {@link + * TArtifactType } {@link TPolicyTemplate } {@link TArtifactTemplate } {@link TRelationshipTypeImplementation } + * {@link TServiceTemplate } + */ + public List getServiceTemplateOrNodeTypeOrNodeTypeImplementation() { + if (this.serviceTemplateOrNodeTypeOrNodeTypeImplementation == null) { + this.serviceTemplateOrNodeTypeOrNodeTypeImplementation = new ArrayList<>(); + } + return this.serviceTemplateOrNodeTypeOrNodeTypeImplementation; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + */ + public String getId() { + return this.id; + } + + /** + * Sets the value of the id property. + * + * @param value allowed object is {@link String } + */ + public void setId(final String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the targetNamespace property. + * + * @return possible object is {@link String } + */ + public String getTargetNamespace() { + return this.targetNamespace; + } + + /** + * Sets the value of the targetNamespace property. + * + * @param value allowed object is {@link String } + */ + public void setTargetNamespace(final String value) { + this.targetNamespace = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"extension"}) + public static class Extensions { + + @XmlElement(name = "Extension", required = true) + protected List extension; + + /** + * Gets the value of the extension property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the extension property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getExtension().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TExtension } + */ + public List getExtension() { + if (this.extension == null) { + this.extension = new ArrayList<>(); + } + return this.extension; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"any"}) + public static class Types { + + @XmlAnyElement(lax = true) + protected List any; + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the any property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getAny().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (this.any == null) { + this.any = new ArrayList<>(); + } + return this.any; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifact.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifact.java new file mode 100644 index 000000000..0e01149c9 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifact.java @@ -0,0 +1,101 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tDeploymentArtifact complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tDeploymentArtifact">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="artifactType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="artifactRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tDeploymentArtifact") +public class TDeploymentArtifact extends TExtensibleElements { + + @XmlAttribute(required = true) + protected String name; + @XmlAttribute(required = true) + protected QName artifactType; + @XmlAttribute + protected QName artifactRef; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the artifactType property. + * + * @return possible object is {@link QName } + */ + public QName getArtifactType() { + return this.artifactType; + } + + /** + * Sets the value of the artifactType property. + * + * @param value allowed object is {@link QName } + */ + public void setArtifactType(final QName value) { + this.artifactType = value; + } + + /** + * Gets the value of the artifactRef property. + * + * @return possible object is {@link QName } + */ + public QName getArtifactRef() { + return this.artifactRef; + } + + /** + * Sets the value of the artifactRef property. + * + * @param value allowed object is {@link QName } + */ + public void setArtifactRef(final QName value) { + this.artifactRef = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifacts.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifacts.java new file mode 100644 index 000000000..9a39de4ae --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDeploymentArtifacts.java @@ -0,0 +1,70 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tDeploymentArtifacts complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tDeploymentArtifacts">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="DeploymentArtifact" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifact" maxOccurs="unbounded"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tDeploymentArtifacts", propOrder = {"deploymentArtifact"}) +public class TDeploymentArtifacts { + + @XmlElement(name = "DeploymentArtifact", required = true) + protected List deploymentArtifact; + + /** + * Gets the value of the deploymentArtifact property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the deploymentArtifact property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getDeploymentArtifact().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TDeploymentArtifact } + */ + public List getDeploymentArtifact() { + if (this.deploymentArtifact == null) { + this.deploymentArtifact = new ArrayList<>(); + } + return this.deploymentArtifact; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDocumentation.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDocumentation.java new file mode 100644 index 000000000..c91b86d96 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TDocumentation.java @@ -0,0 +1,119 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tDocumentation complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tDocumentation">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="source" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tDocumentation", propOrder = {"content"}) +public class TDocumentation { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String source; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + protected String lang; + + /** + * Gets the value of the content property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the content property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getContent().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } {@link Object } {@link Element } + */ + public List getContent() { + if (this.content == null) { + this.content = new ArrayList<>(); + } + return this.content; + } + + /** + * Gets the value of the source property. + * + * @return possible object is {@link String } + */ + public String getSource() { + return this.source; + } + + /** + * Sets the value of the source property. + * + * @param value allowed object is {@link String } + */ + public void setSource(final String value) { + this.source = value; + } + + /** + * Gets the value of the lang property. + * + * @return possible object is {@link String } + */ + public String getLang() { + return this.lang; + } + + /** + * Sets the value of the lang property. + * + * @param value allowed object is {@link String } + */ + public void setLang(final String value) { + this.lang = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityTemplate.java new file mode 100644 index 000000000..fa9bdec07 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityTemplate.java @@ -0,0 +1,259 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tEntityTemplate complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tEntityTemplate">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Properties" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <any processContents='lax' namespace='##other'/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="PropertyConstraints" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    + *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tEntityTemplate", propOrder = {"properties", "propertyConstraints"}) +@XmlSeeAlso( {TArtifactTemplate.class, TPolicyTemplate.class, TNodeTemplate.class, TCapability.class, + TRelationshipTemplate.class, TRequirement.class}) +public abstract class TEntityTemplate extends TExtensibleElements { + + @XmlElement(name = "Properties") + protected TEntityTemplate.Properties properties; + @XmlElement(name = "PropertyConstraints") + protected TEntityTemplate.PropertyConstraints propertyConstraints; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute(required = true) + protected QName type; + + /** + * Gets the value of the properties property. + * + * @return possible object is {@link TEntityTemplate.Properties } + */ + public TEntityTemplate.Properties getProperties() { + return this.properties; + } + + /** + * Sets the value of the properties property. + * + * @param value allowed object is {@link TEntityTemplate.Properties } + */ + public void setProperties(final TEntityTemplate.Properties value) { + this.properties = value; + } + + /** + * Gets the value of the propertyConstraints property. + * + * @return possible object is {@link TEntityTemplate.PropertyConstraints } + */ + public TEntityTemplate.PropertyConstraints getPropertyConstraints() { + return this.propertyConstraints; + } + + /** + * Sets the value of the propertyConstraints property. + * + * @param value allowed object is {@link TEntityTemplate.PropertyConstraints } + */ + public void setPropertyConstraints(final TEntityTemplate.PropertyConstraints value) { + this.propertyConstraints = value; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + */ + public String getId() { + return this.id; + } + + /** + * Sets the value of the id property. + * + * @param value allowed object is {@link String } + */ + public void setId(final String value) { + this.id = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link QName } + */ + public QName getType() { + return this.type; + } + + /** + * Sets the value of the type property. + * + * @param value allowed object is {@link QName } + */ + public void setType(final QName value) { + this.type = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <any processContents='lax' namespace='##other'/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"any"}) + public static class Properties { + + @XmlAnyElement(lax = true) + protected Object any; + + /** + * Gets the value of the any property. + * + * @return possible object is {@link Object } {@link Element } + */ + public Object getAny() { + return this.any; + } + + /** + * Sets the value of the any property. + * + * @param value allowed object is {@link Object } {@link Element } + */ + public void setAny(final Object value) { + this.any = value; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="PropertyConstraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPropertyConstraint" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"propertyConstraint"}) + public static class PropertyConstraints { + + @XmlElement(name = "PropertyConstraint", required = true) + protected List propertyConstraint; + + /** + * Gets the value of the propertyConstraint property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the propertyConstraint property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getPropertyConstraint().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TPropertyConstraint } + */ + public List getPropertyConstraint() { + if (this.propertyConstraint == null) { + this.propertyConstraint = new ArrayList<>(); + } + return this.propertyConstraint; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityType.java new file mode 100644 index 000000000..3f70654fa --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TEntityType.java @@ -0,0 +1,329 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tEntityType complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tEntityType">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    + *         <element name="DerivedFrom" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="PropertiesDefinition" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="element" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *                 <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    + *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    + *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tEntityType", propOrder = {"tags", "derivedFrom", "propertiesDefinition"}) +@XmlSeeAlso( {TNodeType.class, TRelationshipType.class, TRequirementType.class, TCapabilityType.class, + TArtifactType.class, TPolicyType.class}) +public abstract class TEntityType extends TExtensibleElements { + + @XmlElement(name = "Tags") + protected TTags tags; + @XmlElement(name = "DerivedFrom") + protected TEntityType.DerivedFrom derivedFrom; + @XmlElement(name = "PropertiesDefinition") + protected TEntityType.PropertiesDefinition propertiesDefinition; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute(name = "abstract") + protected TBoolean _abstract; + @XmlAttribute(name = "final") + protected TBoolean _final; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String targetNamespace; + + /** + * Gets the value of the tags property. + * + * @return possible object is {@link TTags } + */ + public TTags getTags() { + return this.tags; + } + + /** + * Sets the value of the tags property. + * + * @param value allowed object is {@link TTags } + */ + public void setTags(final TTags value) { + this.tags = value; + } + + /** + * Gets the value of the derivedFrom property. + * + * @return possible object is {@link TEntityType.DerivedFrom } + */ + public TEntityType.DerivedFrom getDerivedFrom() { + return this.derivedFrom; + } + + /** + * Sets the value of the derivedFrom property. + * + * @param value allowed object is {@link TEntityType.DerivedFrom } + */ + public void setDerivedFrom(final TEntityType.DerivedFrom value) { + this.derivedFrom = value; + } + + /** + * Gets the value of the propertiesDefinition property. + * + * @return possible object is {@link TEntityType.PropertiesDefinition } + */ + public TEntityType.PropertiesDefinition getPropertiesDefinition() { + return this.propertiesDefinition; + } + + /** + * Sets the value of the propertiesDefinition property. + * + * @param value allowed object is {@link TEntityType.PropertiesDefinition } + */ + public void setPropertiesDefinition(final TEntityType.PropertiesDefinition value) { + this.propertiesDefinition = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the abstract property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getAbstract() { + if (this._abstract == null) { + return TBoolean.NO; + } else { + return this._abstract; + } + } + + /** + * Sets the value of the abstract property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setAbstract(final TBoolean value) { + this._abstract = value; + } + + /** + * Gets the value of the final property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getFinal() { + if (this._final == null) { + return TBoolean.NO; + } else { + return this._final; + } + } + + /** + * Sets the value of the final property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setFinal(final TBoolean value) { + this._final = value; + } + + /** + * Gets the value of the targetNamespace property. + * + * @return possible object is {@link String } + */ + public String getTargetNamespace() { + return this.targetNamespace; + } + + /** + * Sets the value of the targetNamespace property. + * + * @param value allowed object is {@link String } + */ + public void setTargetNamespace(final String value) { + this.targetNamespace = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class DerivedFrom { + + @XmlAttribute(required = true) + protected QName typeRef; + + /** + * Gets the value of the typeRef property. + * + * @return possible object is {@link QName } + */ + public QName getTypeRef() { + return this.typeRef; + } + + /** + * Sets the value of the typeRef property. + * + * @param value allowed object is {@link QName } + */ + public void setTypeRef(final QName value) { + this.typeRef = value; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="element" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class PropertiesDefinition { + + @XmlAttribute + protected QName element; + @XmlAttribute + protected QName type; + + /** + * Gets the value of the element property. + * + * @return possible object is {@link QName } + */ + public QName getElement() { + return this.element; + } + + /** + * Sets the value of the element property. + * + * @param value allowed object is {@link QName } + */ + public void setElement(final QName value) { + this.element = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link QName } + */ + public QName getType() { + return this.type; + } + + /** + * Sets the value of the type property. + * + * @param value allowed object is {@link QName } + */ + public void setType(final QName value) { + this.type = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedInterface.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedInterface.java new file mode 100644 index 000000000..b903610a7 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedInterface.java @@ -0,0 +1,94 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tExportedInterface complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tExportedInterface">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="Operation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExportedOperation" maxOccurs="unbounded"/>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tExportedInterface", propOrder = {"operation"}) +public class TExportedInterface { + + @XmlElement(name = "Operation", required = true) + protected List operation; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String name; + + /** + * Gets the value of the operation property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the operation property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getOperation().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TExportedOperation } + */ + public List getOperation() { + if (this.operation == null) { + this.operation = new ArrayList<>(); + } + return this.operation; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedOperation.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedOperation.java new file mode 100644 index 000000000..766f847c2 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExportedOperation.java @@ -0,0 +1,383 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) +// Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source +// schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

    + * Java class for tExportedOperation complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tExportedOperation">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <choice>
    + *         <element name="NodeOperation">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="nodeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    + *                 <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *                 <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="RelationshipOperation">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="relationshipRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    + *                 <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *                 <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Plan">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="planRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </choice>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tExportedOperation", propOrder = {"nodeOperation", "relationshipOperation", "plan"}) +public class TExportedOperation { + + @XmlElement(name = "NodeOperation") + protected TExportedOperation.NodeOperation nodeOperation; + @XmlElement(name = "RelationshipOperation") + protected TExportedOperation.RelationshipOperation relationshipOperation; + @XmlElement(name = "Plan") + protected TExportedOperation.Plan plan; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + + /** + * Gets the value of the nodeOperation property. + * + * @return possible object is {@link TExportedOperation.NodeOperation } + */ + public TExportedOperation.NodeOperation getNodeOperation() { + return this.nodeOperation; + } + + /** + * Sets the value of the nodeOperation property. + * + * @param value allowed object is {@link TExportedOperation.NodeOperation } + */ + public void setNodeOperation(final TExportedOperation.NodeOperation value) { + this.nodeOperation = value; + } + + /** + * Gets the value of the relationshipOperation property. + * + * @return possible object is {@link TExportedOperation.RelationshipOperation } + */ + public TExportedOperation.RelationshipOperation getRelationshipOperation() { + return this.relationshipOperation; + } + + /** + * Sets the value of the relationshipOperation property. + * + * @param value allowed object is {@link TExportedOperation.RelationshipOperation } + */ + public void setRelationshipOperation(final TExportedOperation.RelationshipOperation value) { + this.relationshipOperation = value; + } + + /** + * Gets the value of the plan property. + * + * @return possible object is {@link TExportedOperation.Plan } + */ + public TExportedOperation.Plan getPlan() { + return this.plan; + } + + /** + * Sets the value of the plan property. + * + * @param value allowed object is {@link TExportedOperation.Plan } + */ + public void setPlan(final TExportedOperation.Plan value) { + this.plan = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="nodeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    +     *       <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    +     *       <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class NodeOperation { + + @XmlAttribute(required = true) + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object nodeRef; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String interfaceName; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String operationName; + + /** + * Gets the value of the nodeRef property. + * + * @return possible object is {@link Object } + */ + public Object getNodeRef() { + return this.nodeRef; + } + + /** + * Sets the value of the nodeRef property. + * + * @param value allowed object is {@link Object } + */ + public void setNodeRef(final Object value) { + this.nodeRef = value; + } + + /** + * Gets the value of the interfaceName property. + * + * @return possible object is {@link String } + */ + public String getInterfaceName() { + return this.interfaceName; + } + + /** + * Sets the value of the interfaceName property. + * + * @param value allowed object is {@link String } + */ + public void setInterfaceName(final String value) { + this.interfaceName = value; + } + + /** + * Gets the value of the operationName property. + * + * @return possible object is {@link String } + */ + public String getOperationName() { + return this.operationName; + } + + /** + * Sets the value of the operationName property. + * + * @param value allowed object is {@link String } + */ + public void setOperationName(final String value) { + this.operationName = value; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="planRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Plan { + + @XmlAttribute(required = true) + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object planRef; + + /** + * Gets the value of the planRef property. + * + * @return possible object is {@link Object } + */ + public Object getPlanRef() { + return this.planRef; + } + + /** + * Sets the value of the planRef property. + * + * @param value allowed object is {@link Object } + */ + public void setPlanRef(final Object value) { + this.planRef = value; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="relationshipRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    +     *       <attribute name="interfaceName" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    +     *       <attribute name="operationName" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class RelationshipOperation { + + @XmlAttribute(required = true) + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object relationshipRef; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String interfaceName; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String operationName; + + /** + * Gets the value of the relationshipRef property. + * + * @return possible object is {@link Object } + */ + public Object getRelationshipRef() { + return this.relationshipRef; + } + + /** + * Sets the value of the relationshipRef property. + * + * @param value allowed object is {@link Object } + */ + public void setRelationshipRef(final Object value) { + this.relationshipRef = value; + } + + /** + * Gets the value of the interfaceName property. + * + * @return possible object is {@link String } + */ + public String getInterfaceName() { + return this.interfaceName; + } + + /** + * Sets the value of the interfaceName property. + * + * @param value allowed object is {@link String } + */ + public void setInterfaceName(final String value) { + this.interfaceName = value; + } + + /** + * Gets the value of the operationName property. + * + * @return possible object is {@link String } + */ + public String getOperationName() { + return this.operationName; + } + + /** + * Sets the value of the operationName property. + * + * @param value allowed object is {@link String } + */ + public void setOperationName(final String value) { + this.operationName = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensibleElements.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensibleElements.java new file mode 100644 index 000000000..35e973fe3 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensibleElements.java @@ -0,0 +1,128 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tExtensibleElements complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tExtensibleElements">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element ref="{http://docs.oasis-open.org/tosca/ns/2011/12}documentation" maxOccurs="unbounded" minOccurs="0"/>
    + *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tExtensibleElements", propOrder = {"documentation", "any"}) +@XmlSeeAlso( {TImport.class, TServiceTemplate.class, TNodeTypeImplementation.class, + TRelationshipTypeImplementation.class, TOperation.class, TCapabilityDefinition.class, TPlan.class, + TExtension.class, TDeploymentArtifact.class, TExtensions.class, TTopologyTemplate.class, TEntityType.class, + TImplementationArtifact.class, TPolicy.class, TRequirementDefinition.class, TEntityTemplate.class, + TDefinitions.class}) +public class TExtensibleElements { + + protected List documentation; + @XmlAnyElement(lax = true) + protected List any; + @XmlAnyAttribute + private final Map otherAttributes = new HashMap<>(); + + /** + * Gets the value of the documentation property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the documentation property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getDocumentation().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TDocumentation } + */ + public List getDocumentation() { + if (this.documentation == null) { + this.documentation = new ArrayList<>(); + } + return this.documentation; + } + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the any property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getAny().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (this.any == null) { + this.any = new ArrayList<>(); + } + return this.any; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

    + * the map is keyed by the name of the attribute and the value is the string value of the attribute. + *

    + * the map returned by this method is live, and you can add new attribute by updating the map directly. Because of + * this design, there's no setter. + * + * @return always non-null + */ + public Map getOtherAttributes() { + return this.otherAttributes; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtension.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtension.java new file mode 100644 index 000000000..64b282f39 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtension.java @@ -0,0 +1,85 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tExtension complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tExtension">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <attribute name="namespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute name="mustUnderstand" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="yes" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tExtension") +public class TExtension extends TExtensibleElements { + + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String namespace; + @XmlAttribute + protected TBoolean mustUnderstand; + + /** + * Gets the value of the namespace property. + * + * @return possible object is {@link String } + */ + public String getNamespace() { + return this.namespace; + } + + /** + * Sets the value of the namespace property. + * + * @param value allowed object is {@link String } + */ + public void setNamespace(final String value) { + this.namespace = value; + } + + /** + * Gets the value of the mustUnderstand property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getMustUnderstand() { + if (this.mustUnderstand == null) { + return TBoolean.YES; + } else { + return this.mustUnderstand; + } + } + + /** + * Sets the value of the mustUnderstand property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setMustUnderstand(final TBoolean value) { + this.mustUnderstand = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensions.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensions.java new file mode 100644 index 000000000..6b077a005 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TExtensions.java @@ -0,0 +1,71 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tExtensions complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tExtensions">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Extension" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtension" maxOccurs="unbounded"/>
    + *       </sequence>
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tExtensions", propOrder = {"extension"}) +public class TExtensions extends TExtensibleElements { + + @XmlElement(name = "Extension", required = true) + protected List extension; + + /** + * Gets the value of the extension property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the extension property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getExtension().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TExtension } + */ + public List getExtension() { + if (this.extension == null) { + this.extension = new ArrayList<>(); + } + return this.extension; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifact.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifact.java new file mode 100644 index 000000000..8a9ce865e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifact.java @@ -0,0 +1,130 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tImplementationArtifact complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tImplementationArtifact">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <attribute name="interfaceName" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute name="operationName" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *       <attribute name="artifactType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="artifactRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tImplementationArtifact") +@XmlSeeAlso( {org.oasis_open.docs.tosca.ns._2011._12.TImplementationArtifacts.ImplementationArtifact.class}) +public class TImplementationArtifact extends TExtensibleElements { + + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String interfaceName; + @XmlAttribute + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String operationName; + @XmlAttribute(required = true) + protected QName artifactType; + @XmlAttribute + protected QName artifactRef; + + /** + * Gets the value of the interfaceName property. + * + * @return possible object is {@link String } + */ + public String getInterfaceName() { + return this.interfaceName; + } + + /** + * Sets the value of the interfaceName property. + * + * @param value allowed object is {@link String } + */ + public void setInterfaceName(final String value) { + this.interfaceName = value; + } + + /** + * Gets the value of the operationName property. + * + * @return possible object is {@link String } + */ + public String getOperationName() { + return this.operationName; + } + + /** + * Sets the value of the operationName property. + * + * @param value allowed object is {@link String } + */ + public void setOperationName(final String value) { + this.operationName = value; + } + + /** + * Gets the value of the artifactType property. + * + * @return possible object is {@link QName } + */ + public QName getArtifactType() { + return this.artifactType; + } + + /** + * Sets the value of the artifactType property. + * + * @param value allowed object is {@link QName } + */ + public void setArtifactType(final QName value) { + this.artifactType = value; + } + + /** + * Gets the value of the artifactRef property. + * + * @return possible object is {@link QName } + */ + public QName getArtifactRef() { + return this.artifactRef; + } + + /** + * Sets the value of the artifactRef property. + * + * @param value allowed object is {@link QName } + */ + public void setArtifactRef(final QName value) { + this.artifactRef = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifacts.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifacts.java new file mode 100644 index 000000000..caa7068a6 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImplementationArtifacts.java @@ -0,0 +1,102 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tImplementationArtifacts complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tImplementationArtifacts">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="ImplementationArtifact" maxOccurs="unbounded">
    + *           <complexType>
    + *             <complexContent>
    + *               <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifact">
    + *                 <anyAttribute processContents='lax' namespace='##other'/>
    + *               </extension>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tImplementationArtifacts", propOrder = {"implementationArtifact"}) +public class TImplementationArtifacts { + + @XmlElement(name = "ImplementationArtifact", required = true) + protected List implementationArtifact; + + /** + * Gets the value of the implementationArtifact property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the implementationArtifact property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getImplementationArtifact().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TImplementationArtifacts.ImplementationArtifact + * } + */ + public List getImplementationArtifact() { + if (this.implementationArtifact == null) { + this.implementationArtifact = new ArrayList<>(); + } + return this.implementationArtifact; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifact">
    +     *       <anyAttribute processContents='lax' namespace='##other'/>
    +     *     </extension>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class ImplementationArtifact extends TImplementationArtifact { + + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImport.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImport.java new file mode 100644 index 000000000..558a5872c --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TImport.java @@ -0,0 +1,103 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tImport complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tImport">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <attribute name="namespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute name="location" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute name="importType" use="required" type="{http://docs.oasis-open.org/tosca/ns/2011/12}importedURI" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tImport") +public class TImport extends TExtensibleElements { + + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String namespace; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String location; + @XmlAttribute(required = true) + protected String importType; + + /** + * Gets the value of the namespace property. + * + * @return possible object is {@link String } + */ + public String getNamespace() { + return this.namespace; + } + + /** + * Sets the value of the namespace property. + * + * @param value allowed object is {@link String } + */ + public void setNamespace(final String value) { + this.namespace = value; + } + + /** + * Gets the value of the location property. + * + * @return possible object is {@link String } + */ + public String getLocation() { + return this.location; + } + + /** + * Sets the value of the location property. + * + * @param value allowed object is {@link String } + */ + public void setLocation(final String value) { + this.location = value; + } + + /** + * Gets the value of the importType property. + * + * @return possible object is {@link String } + */ + public String getImportType() { + return this.importType; + } + + /** + * Sets the value of the importType property. + * + * @param value allowed object is {@link String } + */ + public void setImportType(final String value) { + this.importType = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TInterface.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TInterface.java new file mode 100644 index 000000000..1a4ceb70a --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TInterface.java @@ -0,0 +1,94 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tInterface complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tInterface">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="Operation" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tOperation" maxOccurs="unbounded"/>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tInterface", propOrder = {"operation"}) +public class TInterface { + + @XmlElement(name = "Operation", required = true) + protected List operation; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String name; + + /** + * Gets the value of the operation property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the operation property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getOperation().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TOperation } + */ + public List getOperation() { + if (this.operation == null) { + this.operation = new ArrayList<>(); + } + return this.operation; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } +} diff --git a/org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TInterfaces.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TInterfaces.java similarity index 100% rename from org.opentosca.planbuilder.integration/src/org/oasis_open/docs/tosca/ns/_2011/_12/TInterfaces.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TInterfaces.java diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTemplate.java new file mode 100644 index 000000000..271b36cb0 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTemplate.java @@ -0,0 +1,402 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tNodeTemplate complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tNodeTemplate">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    + *       <sequence>
    + *         <element name="Requirements" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirement" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Capabilities" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapability" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="Policies" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="DeploymentArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifacts" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="minInstances" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    + *       <attribute name="maxInstances" default="1">
    + *         <simpleType>
    + *           <union>
    + *             <simpleType>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    + *                 <pattern value="([1-9]+[0-9]*)"/>
    + *               </restriction>
    + *             </simpleType>
    + *             <simpleType>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *                 <enumeration value="unbounded"/>
    + *               </restriction>
    + *             </simpleType>
    + *           </union>
    + *         </simpleType>
    + *       </attribute>
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tNodeTemplate", propOrder = {"requirements", "capabilities", "policies", "deploymentArtifacts"}) +public class TNodeTemplate extends TEntityTemplate { + + @XmlElement(name = "Requirements") + protected TNodeTemplate.Requirements requirements; + @XmlElement(name = "Capabilities") + protected TNodeTemplate.Capabilities capabilities; + @XmlElement(name = "Policies") + protected TNodeTemplate.Policies policies; + @XmlElement(name = "DeploymentArtifacts") + protected TDeploymentArtifacts deploymentArtifacts; + @XmlAttribute + protected String name; + @XmlAttribute + protected Integer minInstances; + @XmlAttribute + protected String maxInstances; + + /** + * Gets the value of the requirements property. + * + * @return possible object is {@link TNodeTemplate.Requirements } + */ + public TNodeTemplate.Requirements getRequirements() { + return this.requirements; + } + + /** + * Sets the value of the requirements property. + * + * @param value allowed object is {@link TNodeTemplate.Requirements } + */ + public void setRequirements(final TNodeTemplate.Requirements value) { + this.requirements = value; + } + + /** + * Gets the value of the capabilities property. + * + * @return possible object is {@link TNodeTemplate.Capabilities } + */ + public TNodeTemplate.Capabilities getCapabilities() { + return this.capabilities; + } + + /** + * Sets the value of the capabilities property. + * + * @param value allowed object is {@link TNodeTemplate.Capabilities } + */ + public void setCapabilities(final TNodeTemplate.Capabilities value) { + this.capabilities = value; + } + + /** + * Gets the value of the policies property. + * + * @return possible object is {@link TNodeTemplate.Policies } + */ + public TNodeTemplate.Policies getPolicies() { + return this.policies; + } + + /** + * Sets the value of the policies property. + * + * @param value allowed object is {@link TNodeTemplate.Policies } + */ + public void setPolicies(final TNodeTemplate.Policies value) { + this.policies = value; + } + + /** + * Gets the value of the deploymentArtifacts property. + * + * @return possible object is {@link TDeploymentArtifacts } + */ + public TDeploymentArtifacts getDeploymentArtifacts() { + return this.deploymentArtifacts; + } + + /** + * Sets the value of the deploymentArtifacts property. + * + * @param value allowed object is {@link TDeploymentArtifacts } + */ + public void setDeploymentArtifacts(final TDeploymentArtifacts value) { + this.deploymentArtifacts = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the minInstances property. + * + * @return possible object is {@link Integer } + */ + public int getMinInstances() { + if (this.minInstances == null) { + return 1; + } else { + return this.minInstances; + } + } + + /** + * Sets the value of the minInstances property. + * + * @param value allowed object is {@link Integer } + */ + public void setMinInstances(final Integer value) { + this.minInstances = value; + } + + /** + * Gets the value of the maxInstances property. + * + * @return possible object is {@link String } + */ + public String getMaxInstances() { + if (this.maxInstances == null) { + return "1"; + } else { + return this.maxInstances; + } + } + + /** + * Sets the value of the maxInstances property. + * + * @param value allowed object is {@link String } + */ + public void setMaxInstances(final String value) { + this.maxInstances = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Capability" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapability" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"capability"}) + public static class Capabilities { + + @XmlElement(name = "Capability", required = true) + protected List capability; + + /** + * Gets the value of the capability property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the capability property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getCapability().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCapability } + */ + public List getCapability() { + if (this.capability == null) { + this.capability = new ArrayList<>(); + } + return this.capability; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Policy" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPolicy" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"policy"}) + public static class Policies { + + @XmlElement(name = "Policy", required = true) + protected List policy; + + /** + * Gets the value of the policy property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the policy property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getPolicy().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TPolicy } + */ + public List getPolicy() { + if (this.policy == null) { + this.policy = new ArrayList<>(); + } + return this.policy; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Requirement" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirement" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"requirement"}) + public static class Requirements { + + @XmlElement(name = "Requirement", required = true) + protected List requirement; + + /** + * Gets the value of the requirement property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the requirement property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getRequirement().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TRequirement } + */ + public List getRequirement() { + if (this.requirement == null) { + this.requirement = new ArrayList<>(); + } + return this.requirement; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeType.java new file mode 100644 index 000000000..fb0bf865e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeType.java @@ -0,0 +1,316 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tNodeType complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tNodeType">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    + *       <sequence>
    + *         <element name="RequirementDefinitions" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="RequirementDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementDefinition" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="CapabilityDefinitions" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="CapabilityDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityDefinition" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="InstanceStates" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyElementInstanceStates" minOccurs="0"/>
    + *         <element name="Interfaces" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tNodeType", + propOrder = {"requirementDefinitions", "capabilityDefinitions", "instanceStates", "interfaces"}) +public class TNodeType extends TEntityType { + + @XmlElement(name = "RequirementDefinitions") + protected TNodeType.RequirementDefinitions requirementDefinitions; + @XmlElement(name = "CapabilityDefinitions") + protected TNodeType.CapabilityDefinitions capabilityDefinitions; + @XmlElement(name = "InstanceStates") + protected TTopologyElementInstanceStates instanceStates; + @XmlElement(name = "Interfaces") + protected TNodeType.Interfaces interfaces; + + /** + * Gets the value of the requirementDefinitions property. + * + * @return possible object is {@link TNodeType.RequirementDefinitions } + */ + public TNodeType.RequirementDefinitions getRequirementDefinitions() { + return this.requirementDefinitions; + } + + /** + * Sets the value of the requirementDefinitions property. + * + * @param value allowed object is {@link TNodeType.RequirementDefinitions } + */ + public void setRequirementDefinitions(final TNodeType.RequirementDefinitions value) { + this.requirementDefinitions = value; + } + + /** + * Gets the value of the capabilityDefinitions property. + * + * @return possible object is {@link TNodeType.CapabilityDefinitions } + */ + public TNodeType.CapabilityDefinitions getCapabilityDefinitions() { + return this.capabilityDefinitions; + } + + /** + * Sets the value of the capabilityDefinitions property. + * + * @param value allowed object is {@link TNodeType.CapabilityDefinitions } + */ + public void setCapabilityDefinitions(final TNodeType.CapabilityDefinitions value) { + this.capabilityDefinitions = value; + } + + /** + * Gets the value of the instanceStates property. + * + * @return possible object is {@link TTopologyElementInstanceStates } + */ + public TTopologyElementInstanceStates getInstanceStates() { + return this.instanceStates; + } + + /** + * Sets the value of the instanceStates property. + * + * @param value allowed object is {@link TTopologyElementInstanceStates } + */ + public void setInstanceStates(final TTopologyElementInstanceStates value) { + this.instanceStates = value; + } + + /** + * Gets the value of the interfaces property. + * + * @return possible object is {@link TNodeType.Interfaces } + */ + public TNodeType.Interfaces getInterfaces() { + return this.interfaces; + } + + /** + * Sets the value of the interfaces property. + * + * @param value allowed object is {@link TNodeType.Interfaces } + */ + public void setInterfaces(final TNodeType.Interfaces value) { + this.interfaces = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="CapabilityDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCapabilityDefinition" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"capabilityDefinition"}) + public static class CapabilityDefinitions { + + @XmlElement(name = "CapabilityDefinition", required = true) + protected List capabilityDefinition; + + /** + * Gets the value of the capabilityDefinition property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the capabilityDefinition property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getCapabilityDefinition().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCapabilityDefinition } + */ + public List getCapabilityDefinition() { + if (this.capabilityDefinition == null) { + this.capabilityDefinition = new ArrayList<>(); + } + return this.capabilityDefinition; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"_interface"}) + public static class Interfaces { + + @XmlElement(name = "Interface", required = true) + protected List _interface; + + /** + * Gets the value of the interface property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the interface property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getInterface().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TInterface } + */ + public List getInterface() { + if (this._interface == null) { + this._interface = new ArrayList<>(); + } + return this._interface; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="RequirementDefinition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequirementDefinition" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"requirementDefinition"}) + public static class RequirementDefinitions { + + @XmlElement(name = "RequirementDefinition", required = true) + protected List requirementDefinition; + + /** + * Gets the value of the requirementDefinition property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the requirementDefinition property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getRequirementDefinition().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TRequirementDefinition } + */ + public List getRequirementDefinition() { + if (this.requirementDefinition == null) { + this.requirementDefinition = new ArrayList<>(); + } + return this.requirementDefinition; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTypeImplementation.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTypeImplementation.java new file mode 100644 index 000000000..b0575d4e2 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TNodeTypeImplementation.java @@ -0,0 +1,317 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tNodeTypeImplementation complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tNodeTypeImplementation">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    + *         <element name="DerivedFrom" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="nodeTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="RequiredContainerFeatures" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeatures" minOccurs="0"/>
    + *         <element name="ImplementationArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifacts" minOccurs="0"/>
    + *         <element name="DeploymentArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tDeploymentArtifacts" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute name="nodeType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    + *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tNodeTypeImplementation", propOrder = {"tags", "derivedFrom", "requiredContainerFeatures", + "implementationArtifacts", "deploymentArtifacts"}) +public class TNodeTypeImplementation extends TExtensibleElements { + + @XmlElement(name = "Tags") + protected TTags tags; + @XmlElement(name = "DerivedFrom") + protected TNodeTypeImplementation.DerivedFrom derivedFrom; + @XmlElement(name = "RequiredContainerFeatures") + protected TRequiredContainerFeatures requiredContainerFeatures; + @XmlElement(name = "ImplementationArtifacts") + protected TImplementationArtifacts implementationArtifacts; + @XmlElement(name = "DeploymentArtifacts") + protected TDeploymentArtifacts deploymentArtifacts; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String targetNamespace; + @XmlAttribute(required = true) + protected QName nodeType; + @XmlAttribute(name = "abstract") + protected TBoolean _abstract; + @XmlAttribute(name = "final") + protected TBoolean _final; + + /** + * Gets the value of the tags property. + * + * @return possible object is {@link TTags } + */ + public TTags getTags() { + return this.tags; + } + + /** + * Sets the value of the tags property. + * + * @param value allowed object is {@link TTags } + */ + public void setTags(final TTags value) { + this.tags = value; + } + + /** + * Gets the value of the derivedFrom property. + * + * @return possible object is {@link TNodeTypeImplementation.DerivedFrom } + */ + public TNodeTypeImplementation.DerivedFrom getDerivedFrom() { + return this.derivedFrom; + } + + /** + * Sets the value of the derivedFrom property. + * + * @param value allowed object is {@link TNodeTypeImplementation.DerivedFrom } + */ + public void setDerivedFrom(final TNodeTypeImplementation.DerivedFrom value) { + this.derivedFrom = value; + } + + /** + * Gets the value of the requiredContainerFeatures property. + * + * @return possible object is {@link TRequiredContainerFeatures } + */ + public TRequiredContainerFeatures getRequiredContainerFeatures() { + return this.requiredContainerFeatures; + } + + /** + * Sets the value of the requiredContainerFeatures property. + * + * @param value allowed object is {@link TRequiredContainerFeatures } + */ + public void setRequiredContainerFeatures(final TRequiredContainerFeatures value) { + this.requiredContainerFeatures = value; + } + + /** + * Gets the value of the implementationArtifacts property. + * + * @return possible object is {@link TImplementationArtifacts } + */ + public TImplementationArtifacts getImplementationArtifacts() { + return this.implementationArtifacts; + } + + /** + * Sets the value of the implementationArtifacts property. + * + * @param value allowed object is {@link TImplementationArtifacts } + */ + public void setImplementationArtifacts(final TImplementationArtifacts value) { + this.implementationArtifacts = value; + } + + /** + * Gets the value of the deploymentArtifacts property. + * + * @return possible object is {@link TDeploymentArtifacts } + */ + public TDeploymentArtifacts getDeploymentArtifacts() { + return this.deploymentArtifacts; + } + + /** + * Sets the value of the deploymentArtifacts property. + * + * @param value allowed object is {@link TDeploymentArtifacts } + */ + public void setDeploymentArtifacts(final TDeploymentArtifacts value) { + this.deploymentArtifacts = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the targetNamespace property. + * + * @return possible object is {@link String } + */ + public String getTargetNamespace() { + return this.targetNamespace; + } + + /** + * Sets the value of the targetNamespace property. + * + * @param value allowed object is {@link String } + */ + public void setTargetNamespace(final String value) { + this.targetNamespace = value; + } + + /** + * Gets the value of the nodeType property. + * + * @return possible object is {@link QName } + */ + public QName getNodeType() { + return this.nodeType; + } + + /** + * Sets the value of the nodeType property. + * + * @param value allowed object is {@link QName } + */ + public void setNodeType(final QName value) { + this.nodeType = value; + } + + /** + * Gets the value of the abstract property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getAbstract() { + if (this._abstract == null) { + return TBoolean.NO; + } else { + return this._abstract; + } + } + + /** + * Sets the value of the abstract property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setAbstract(final TBoolean value) { + this._abstract = value; + } + + /** + * Gets the value of the final property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getFinal() { + if (this._final == null) { + return TBoolean.NO; + } else { + return this._final; + } + } + + /** + * Sets the value of the final property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setFinal(final TBoolean value) { + this._final = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="nodeTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class DerivedFrom { + + @XmlAttribute(required = true) + protected QName nodeTypeImplementationRef; + + /** + * Gets the value of the nodeTypeImplementationRef property. + * + * @return possible object is {@link QName } + */ + public QName getNodeTypeImplementationRef() { + return this.nodeTypeImplementationRef; + } + + /** + * Sets the value of the nodeTypeImplementationRef property. + * + * @param value allowed object is {@link QName } + */ + public void setNodeTypeImplementationRef(final QName value) { + this.nodeTypeImplementationRef = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TOperation.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TOperation.java new file mode 100644 index 000000000..4d3ec2c4b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TOperation.java @@ -0,0 +1,237 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

    + * Java class for tOperation complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tOperation">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="InputParameters" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="OutputParameters" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tOperation", propOrder = {"inputParameters", "outputParameters"}) +public class TOperation extends TExtensibleElements { + + @XmlElement(name = "InputParameters") + protected TOperation.InputParameters inputParameters; + @XmlElement(name = "OutputParameters") + protected TOperation.OutputParameters outputParameters; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + + /** + * Gets the value of the inputParameters property. + * + * @return possible object is {@link TOperation.InputParameters } + */ + public TOperation.InputParameters getInputParameters() { + return this.inputParameters; + } + + /** + * Sets the value of the inputParameters property. + * + * @param value allowed object is {@link TOperation.InputParameters } + */ + public void setInputParameters(final TOperation.InputParameters value) { + this.inputParameters = value; + } + + /** + * Gets the value of the outputParameters property. + * + * @return possible object is {@link TOperation.OutputParameters } + */ + public TOperation.OutputParameters getOutputParameters() { + return this.outputParameters; + } + + /** + * Sets the value of the outputParameters property. + * + * @param value allowed object is {@link TOperation.OutputParameters } + */ + public void setOutputParameters(final TOperation.OutputParameters value) { + this.outputParameters = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"inputParameter"}) + public static class InputParameters { + + @XmlElement(name = "InputParameter", required = true) + protected List inputParameter; + + /** + * Gets the value of the inputParameter property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the inputParameter property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getInputParameter().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TParameter } + */ + public List getInputParameter() { + if (this.inputParameter == null) { + this.inputParameter = new ArrayList<>(); + } + return this.inputParameter; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"outputParameter"}) + public static class OutputParameters { + + @XmlElement(name = "OutputParameter", required = true) + protected List outputParameter; + + /** + * Gets the value of the outputParameter property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the outputParameter property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getOutputParameter().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TParameter } + */ + public List getOutputParameter() { + if (this.outputParameter == null) { + this.outputParameter = new ArrayList<>(); + } + return this.outputParameter; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TParameter.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TParameter.java new file mode 100644 index 000000000..4af3dba67 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TParameter.java @@ -0,0 +1,103 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tParameter complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tParameter">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="required" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="yes" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tParameter") +public class TParameter { + + @XmlAttribute(required = true) + protected String name; + @XmlAttribute(required = true) + protected String type; + @XmlAttribute + protected TBoolean required; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link String } + */ + public String getType() { + return this.type; + } + + /** + * Sets the value of the type property. + * + * @param value allowed object is {@link String } + */ + public void setType(final String value) { + this.type = value; + } + + /** + * Gets the value of the required property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getRequired() { + if (this.required == null) { + return TBoolean.YES; + } else { + return this.required; + } + } + + /** + * Sets the value of the required property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setRequired(final TBoolean value) { + this.required = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPlan.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPlan.java new file mode 100644 index 000000000..f9ea6104f --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPlan.java @@ -0,0 +1,480 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tPlan complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tPlan">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Precondition" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tCondition" minOccurs="0"/>
    + *         <element name="InputParameters" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="OutputParameters" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <choice>
    + *           <element name="PlanModel">
    + *             <complexType>
    + *               <complexContent>
    + *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                   <sequence>
    + *                     <any processContents='lax' namespace='##other'/>
    + *                   </sequence>
    + *                 </restriction>
    + *               </complexContent>
    + *             </complexType>
    + *           </element>
    + *           <element name="PlanModelReference">
    + *             <complexType>
    + *               <complexContent>
    + *                 <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                   <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *                 </restriction>
    + *               </complexContent>
    + *             </complexType>
    + *           </element>
    + *         </choice>
    + *       </sequence>
    + *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="planType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute name="planLanguage" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tPlan", + propOrder = {"precondition", "inputParameters", "outputParameters", "planModel", "planModelReference"}) +public class TPlan extends TExtensibleElements { + + @XmlElement(name = "Precondition") + protected TCondition precondition; + @XmlElement(name = "InputParameters") + protected TPlan.InputParameters inputParameters; + @XmlElement(name = "OutputParameters") + protected TPlan.OutputParameters outputParameters; + @XmlElement(name = "PlanModel") + protected TPlan.PlanModel planModel; + @XmlElement(name = "PlanModelReference") + protected TPlan.PlanModelReference planModelReference; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute + protected String name; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String planType; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String planLanguage; + + /** + * Gets the value of the precondition property. + * + * @return possible object is {@link TCondition } + */ + public TCondition getPrecondition() { + return this.precondition; + } + + /** + * Sets the value of the precondition property. + * + * @param value allowed object is {@link TCondition } + */ + public void setPrecondition(final TCondition value) { + this.precondition = value; + } + + /** + * Gets the value of the inputParameters property. + * + * @return possible object is {@link TPlan.InputParameters } + */ + public TPlan.InputParameters getInputParameters() { + return this.inputParameters; + } + + /** + * Sets the value of the inputParameters property. + * + * @param value allowed object is {@link TPlan.InputParameters } + */ + public void setInputParameters(final TPlan.InputParameters value) { + this.inputParameters = value; + } + + /** + * Gets the value of the outputParameters property. + * + * @return possible object is {@link TPlan.OutputParameters } + */ + public TPlan.OutputParameters getOutputParameters() { + return this.outputParameters; + } + + /** + * Sets the value of the outputParameters property. + * + * @param value allowed object is {@link TPlan.OutputParameters } + */ + public void setOutputParameters(final TPlan.OutputParameters value) { + this.outputParameters = value; + } + + /** + * Gets the value of the planModel property. + * + * @return possible object is {@link TPlan.PlanModel } + */ + public TPlan.PlanModel getPlanModel() { + return this.planModel; + } + + /** + * Sets the value of the planModel property. + * + * @param value allowed object is {@link TPlan.PlanModel } + */ + public void setPlanModel(final TPlan.PlanModel value) { + this.planModel = value; + } + + /** + * Gets the value of the planModelReference property. + * + * @return possible object is {@link TPlan.PlanModelReference } + */ + public TPlan.PlanModelReference getPlanModelReference() { + return this.planModelReference; + } + + /** + * Sets the value of the planModelReference property. + * + * @param value allowed object is {@link TPlan.PlanModelReference } + */ + public void setPlanModelReference(final TPlan.PlanModelReference value) { + this.planModelReference = value; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + */ + public String getId() { + return this.id; + } + + /** + * Sets the value of the id property. + * + * @param value allowed object is {@link String } + */ + public void setId(final String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the planType property. + * + * @return possible object is {@link String } + */ + public String getPlanType() { + return this.planType; + } + + /** + * Sets the value of the planType property. + * + * @param value allowed object is {@link String } + */ + public void setPlanType(final String value) { + this.planType = value; + } + + /** + * Gets the value of the planLanguage property. + * + * @return possible object is {@link String } + */ + public String getPlanLanguage() { + return this.planLanguage; + } + + /** + * Sets the value of the planLanguage property. + * + * @param value allowed object is {@link String } + */ + public void setPlanLanguage(final String value) { + this.planLanguage = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="InputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"inputParameter"}) + public static class InputParameters { + + @XmlElement(name = "InputParameter", required = true) + protected List inputParameter; + + /** + * Gets the value of the inputParameter property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the inputParameter property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getInputParameter().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TParameter } + */ + public List getInputParameter() { + if (this.inputParameter == null) { + this.inputParameter = new ArrayList<>(); + } + return this.inputParameter; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="OutputParameter" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tParameter" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"outputParameter"}) + public static class OutputParameters { + + @XmlElement(name = "OutputParameter", required = true) + protected List outputParameter; + + /** + * Gets the value of the outputParameter property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the outputParameter property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getOutputParameter().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TParameter } + */ + public List getOutputParameter() { + if (this.outputParameter == null) { + this.outputParameter = new ArrayList<>(); + } + return this.outputParameter; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <any processContents='lax' namespace='##other'/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"any"}) + public static class PlanModel { + + @XmlAnyElement(lax = true) + protected Object any; + + /** + * Gets the value of the any property. + * + * @return possible object is {@link Object } {@link Element } + */ + public Object getAny() { + return this.any; + } + + /** + * Sets the value of the any property. + * + * @param value allowed object is {@link Object } {@link Element } + */ + public void setAny(final Object value) { + this.any = value; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="reference" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class PlanModelReference { + + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String reference; + + /** + * Gets the value of the reference property. + * + * @return possible object is {@link String } + */ + public String getReference() { + return this.reference; + } + + /** + * Sets the value of the reference property. + * + * @param value allowed object is {@link String } + */ + public void setReference(final String value) { + this.reference = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPlans.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPlans.java new file mode 100644 index 000000000..32e298a60 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPlans.java @@ -0,0 +1,95 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) +// Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source +// schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tPlans complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tPlans">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="BuildPlan" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPlan" maxOccurs="unbounded"/>
    + *       </sequence>
    + *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tPlans", propOrder = {"plan"}) +public class TPlans { + + @XmlElement(name = "Plan", required = true) + protected List plan; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String targetNamespace; + + /** + * Gets the value of the plan property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the plan property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getPlan().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TPlan } + */ + public List getPlan() { + if (this.plan == null) { + this.plan = new ArrayList<>(); + } + return this.plan; + } + + /** + * Gets the value of the targetNamespace property. + * + * @return possible object is {@link String } + */ + public String getTargetNamespace() { + return this.targetNamespace; + } + + /** + * Sets the value of the targetNamespace property. + * + * @param value allowed object is {@link String } + */ + public void setTargetNamespace(final String value) { + this.targetNamespace = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicy.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicy.java new file mode 100644 index 000000000..49ad05869 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicy.java @@ -0,0 +1,101 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tPolicy complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tPolicy">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="policyType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="policyRef" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tPolicy") +public class TPolicy extends TExtensibleElements { + + @XmlAttribute + protected String name; + @XmlAttribute(required = true) + protected QName policyType; + @XmlAttribute + protected QName policyRef; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the policyType property. + * + * @return possible object is {@link QName } + */ + public QName getPolicyType() { + return this.policyType; + } + + /** + * Sets the value of the policyType property. + * + * @param value allowed object is {@link QName } + */ + public void setPolicyType(final QName value) { + this.policyType = value; + } + + /** + * Gets the value of the policyRef property. + * + * @return possible object is {@link QName } + */ + public QName getPolicyRef() { + return this.policyRef; + } + + /** + * Sets the value of the policyRef property. + * + * @param value allowed object is {@link QName } + */ + public void setPolicyRef(final QName value) { + this.policyRef = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyTemplate.java new file mode 100644 index 000000000..e40e6d6a8 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyTemplate.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tPolicyTemplate complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tPolicyTemplate">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tPolicyTemplate") +public class TPolicyTemplate extends TEntityTemplate { + + @XmlAttribute + protected String name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyType.java new file mode 100644 index 000000000..b023a33d4 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPolicyType.java @@ -0,0 +1,84 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tPolicyType complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tPolicyType">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    + *       <sequence>
    + *         <element name="AppliesTo" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tAppliesTo"/>
    + *       </sequence>
    + *       <attribute name="policyLanguage" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tPolicyType", propOrder = {"appliesTo"}) +public class TPolicyType extends TEntityType { + + @XmlElement(name = "AppliesTo", required = true) + protected TAppliesTo appliesTo; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String policyLanguage; + + /** + * Gets the value of the appliesTo property. + * + * @return possible object is {@link TAppliesTo } + */ + public TAppliesTo getAppliesTo() { + return this.appliesTo; + } + + /** + * Sets the value of the appliesTo property. + * + * @param value allowed object is {@link TAppliesTo } + */ + public void setAppliesTo(final TAppliesTo value) { + this.appliesTo = value; + } + + /** + * Gets the value of the policyLanguage property. + * + * @return possible object is {@link String } + */ + public String getPolicyLanguage() { + return this.policyLanguage; + } + + /** + * Sets the value of the policyLanguage property. + * + * @param value allowed object is {@link String } + */ + public void setPolicyLanguage(final String value) { + this.policyLanguage = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyConstraint.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyConstraint.java new file mode 100644 index 000000000..576645d27 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyConstraint.java @@ -0,0 +1,57 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tPropertyConstraint complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tPropertyConstraint">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint">
    + *       <attribute name="property" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tPropertyConstraint") +public class TPropertyConstraint extends TConstraint { + + @XmlAttribute(required = true) + protected String property; + + /** + * Gets the value of the property property. + * + * @return possible object is {@link String } + */ + public String getProperty() { + return this.property; + } + + /** + * Sets the value of the property property. + * + * @param value allowed object is {@link String } + */ + public void setProperty(final String value) { + this.property = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyMapping.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyMapping.java new file mode 100644 index 000000000..637b93e49 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TPropertyMapping.java @@ -0,0 +1,103 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tPropertyMapping complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tPropertyMapping">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <attribute name="serviceTemplatePropertyRef" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="targetObjectRef" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    + *       <attribute name="targetPropertyRef" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tPropertyMapping") +public class TPropertyMapping { + + @XmlAttribute(required = true) + protected String serviceTemplatePropertyRef; + @XmlAttribute(required = true) + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object targetObjectRef; + @XmlAttribute(required = true) + protected String targetPropertyRef; + + /** + * Gets the value of the serviceTemplatePropertyRef property. + * + * @return possible object is {@link String } + */ + public String getServiceTemplatePropertyRef() { + return this.serviceTemplatePropertyRef; + } + + /** + * Sets the value of the serviceTemplatePropertyRef property. + * + * @param value allowed object is {@link String } + */ + public void setServiceTemplatePropertyRef(final String value) { + this.serviceTemplatePropertyRef = value; + } + + /** + * Gets the value of the targetObjectRef property. + * + * @return possible object is {@link Object } + */ + public Object getTargetObjectRef() { + return this.targetObjectRef; + } + + /** + * Sets the value of the targetObjectRef property. + * + * @param value allowed object is {@link Object } + */ + public void setTargetObjectRef(final Object value) { + this.targetObjectRef = value; + } + + /** + * Gets the value of the targetPropertyRef property. + * + * @return possible object is {@link String } + */ + public String getTargetPropertyRef() { + return this.targetPropertyRef; + } + + /** + * Sets the value of the targetPropertyRef property. + * + * @param value allowed object is {@link String } + */ + public void setTargetPropertyRef(final String value) { + this.targetPropertyRef = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTemplate.java new file mode 100644 index 000000000..1a437e40b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTemplate.java @@ -0,0 +1,391 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tRelationshipTemplate complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRelationshipTemplate">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    + *       <sequence>
    + *         <element name="SourceElement">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="TargetElement">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="RelationshipConstraints" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="RelationshipConstraint" maxOccurs="unbounded">
    + *                     <complexType>
    + *                       <complexContent>
    + *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                           <sequence>
    + *                             <any processContents='lax' namespace='##other' minOccurs="0"/>
    + *                           </sequence>
    + *                           <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *                         </restriction>
    + *                       </complexContent>
    + *                     </complexType>
    + *                   </element>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRelationshipTemplate", propOrder = {"sourceElement", "targetElement", "relationshipConstraints"}) +public class TRelationshipTemplate extends TEntityTemplate { + + @XmlElement(name = "SourceElement", required = true) + protected TRelationshipTemplate.SourceElement sourceElement; + @XmlElement(name = "TargetElement", required = true) + protected TRelationshipTemplate.TargetElement targetElement; + @XmlElement(name = "RelationshipConstraints") + protected TRelationshipTemplate.RelationshipConstraints relationshipConstraints; + @XmlAttribute + protected String name; + + /** + * Gets the value of the sourceElement property. + * + * @return possible object is {@link TRelationshipTemplate.SourceElement } + */ + public TRelationshipTemplate.SourceElement getSourceElement() { + return this.sourceElement; + } + + /** + * Sets the value of the sourceElement property. + * + * @param value allowed object is {@link TRelationshipTemplate.SourceElement } + */ + public void setSourceElement(final TRelationshipTemplate.SourceElement value) { + this.sourceElement = value; + } + + /** + * Gets the value of the targetElement property. + * + * @return possible object is {@link TRelationshipTemplate.TargetElement } + */ + public TRelationshipTemplate.TargetElement getTargetElement() { + return this.targetElement; + } + + /** + * Sets the value of the targetElement property. + * + * @param value allowed object is {@link TRelationshipTemplate.TargetElement } + */ + public void setTargetElement(final TRelationshipTemplate.TargetElement value) { + this.targetElement = value; + } + + /** + * Gets the value of the relationshipConstraints property. + * + * @return possible object is {@link TRelationshipTemplate.RelationshipConstraints } + */ + public TRelationshipTemplate.RelationshipConstraints getRelationshipConstraints() { + return this.relationshipConstraints; + } + + /** + * Sets the value of the relationshipConstraints property. + * + * @param value allowed object is {@link TRelationshipTemplate.RelationshipConstraints } + */ + public void setRelationshipConstraints(final TRelationshipTemplate.RelationshipConstraints value) { + this.relationshipConstraints = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="RelationshipConstraint" maxOccurs="unbounded">
    +     *           <complexType>
    +     *             <complexContent>
    +     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *                 <sequence>
    +     *                   <any processContents='lax' namespace='##other' minOccurs="0"/>
    +     *                 </sequence>
    +     *                 <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    +     *               </restriction>
    +     *             </complexContent>
    +     *           </complexType>
    +     *         </element>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"relationshipConstraint"}) + public static class RelationshipConstraints { + + @XmlElement(name = "RelationshipConstraint", required = true) + protected List relationshipConstraint; + + /** + * Gets the value of the relationshipConstraint property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the relationshipConstraint property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getRelationshipConstraint().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TRelationshipTemplate.RelationshipConstraints.RelationshipConstraint + * } + */ + public List getRelationshipConstraint() { + if (this.relationshipConstraint == null) { + this.relationshipConstraint = new ArrayList<>(); + } + return this.relationshipConstraint; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +         * <complexType>
    +         *   <complexContent>
    +         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +         *       <sequence>
    +         *         <any processContents='lax' namespace='##other' minOccurs="0"/>
    +         *       </sequence>
    +         *       <attribute name="constraintType" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    +         *     </restriction>
    +         *   </complexContent>
    +         * </complexType>
    +         * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"any"}) + public static class RelationshipConstraint { + + @XmlAnyElement(lax = true) + protected Object any; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String constraintType; + + /** + * Gets the value of the any property. + * + * @return possible object is {@link Object } {@link Element } + */ + public Object getAny() { + return this.any; + } + + /** + * Sets the value of the any property. + * + * @param value allowed object is {@link Object } {@link Element } + */ + public void setAny(final Object value) { + this.any = value; + } + + /** + * Gets the value of the constraintType property. + * + * @return possible object is {@link String } + */ + public String getConstraintType() { + return this.constraintType; + } + + /** + * Sets the value of the constraintType property. + * + * @param value allowed object is {@link String } + */ + public void setConstraintType(final String value) { + this.constraintType = value; + } + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class SourceElement { + + @XmlAttribute(required = true) + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object ref; + + /** + * Gets the value of the ref property. + * + * @return possible object is {@link Object } + */ + public Object getRef() { + return this.ref; + } + + /** + * Sets the value of the ref property. + * + * @param value allowed object is {@link Object } + */ + public void setRef(final Object value) { + this.ref = value; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class TargetElement { + + @XmlAttribute(required = true) + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object ref; + + /** + * Gets the value of the ref property. + * + * @return possible object is {@link Object } + */ + public Object getRef() { + return this.ref; + } + + /** + * Sets the value of the ref property. + * + * @param value allowed object is {@link Object } + */ + public void setRef(final Object value) { + this.ref = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipType.java new file mode 100644 index 000000000..509a4ab08 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipType.java @@ -0,0 +1,388 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tRelationshipType complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRelationshipType">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    + *       <sequence>
    + *         <element name="InstanceStates" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyElementInstanceStates" minOccurs="0"/>
    + *         <element name="SourceInterfaces" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="TargetInterfaces" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="ValidSource" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="ValidTarget" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRelationshipType", propOrder = {"instanceStates", "interfaces", "sourceInterfaces", + "targetInterfaces", "validSource", "validTarget"}) +public class TRelationshipType extends TEntityType { + + @XmlElement(name = "InstanceStates") + protected TTopologyElementInstanceStates instanceStates; + @XmlElement(name = "Interfaces", namespace = "http://www.opentosca.org/winery/extensions/tosca/2013/02/12") + protected TInterfaces interfaces; + @XmlElement(name = "SourceInterfaces") + protected TRelationshipType.SourceInterfaces sourceInterfaces; + @XmlElement(name = "TargetInterfaces") + protected TRelationshipType.TargetInterfaces targetInterfaces; + @XmlElement(name = "ValidSource") + protected TRelationshipType.ValidSource validSource; + @XmlElement(name = "ValidTarget") + protected TRelationshipType.ValidTarget validTarget; + + /** + * Gets the value of the instanceStates property. + * + * @return possible object is {@link TTopologyElementInstanceStates } + */ + public TTopologyElementInstanceStates getInstanceStates() { + return this.instanceStates; + } + + /** + * Sets the value of the instanceStates property. + * + * @param value allowed object is {@link TTopologyElementInstanceStates } + */ + public void setInstanceStates(final TTopologyElementInstanceStates value) { + this.instanceStates = value; + } + + public TInterfaces getInterfaces() { + return this.interfaces; + } + + public void setInterfaces(final TInterfaces interfaces) { + this.interfaces = interfaces; + } + + /** + * Gets the value of the sourceInterfaces property. + * + * @return possible object is {@link TRelationshipType.SourceInterfaces } + */ + public TRelationshipType.SourceInterfaces getSourceInterfaces() { + return this.sourceInterfaces; + } + + /** + * Sets the value of the sourceInterfaces property. + * + * @param value allowed object is {@link TRelationshipType.SourceInterfaces } + */ + public void setSourceInterfaces(final TRelationshipType.SourceInterfaces value) { + this.sourceInterfaces = value; + } + + /** + * Gets the value of the targetInterfaces property. + * + * @return possible object is {@link TRelationshipType.TargetInterfaces } + */ + public TRelationshipType.TargetInterfaces getTargetInterfaces() { + return this.targetInterfaces; + } + + /** + * Sets the value of the targetInterfaces property. + * + * @param value allowed object is {@link TRelationshipType.TargetInterfaces } + */ + public void setTargetInterfaces(final TRelationshipType.TargetInterfaces value) { + this.targetInterfaces = value; + } + + /** + * Gets the value of the validSource property. + * + * @return possible object is {@link TRelationshipType.ValidSource } + */ + public TRelationshipType.ValidSource getValidSource() { + return this.validSource; + } + + /** + * Sets the value of the validSource property. + * + * @param value allowed object is {@link TRelationshipType.ValidSource } + */ + public void setValidSource(final TRelationshipType.ValidSource value) { + this.validSource = value; + } + + /** + * Gets the value of the validTarget property. + * + * @return possible object is {@link TRelationshipType.ValidTarget } + */ + public TRelationshipType.ValidTarget getValidTarget() { + return this.validTarget; + } + + /** + * Sets the value of the validTarget property. + * + * @param value allowed object is {@link TRelationshipType.ValidTarget } + */ + public void setValidTarget(final TRelationshipType.ValidTarget value) { + this.validTarget = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"_interface"}) + public static class SourceInterfaces { + + @XmlElement(name = "Interface", required = true) + protected List _interface; + + /** + * Gets the value of the interface property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the interface property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getInterface().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TInterface } + */ + public List getInterface() { + if (this._interface == null) { + this._interface = new ArrayList<>(); + } + return this._interface; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Interface" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tInterface" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"_interface"}) + public static class TargetInterfaces { + + @XmlElement(name = "Interface", required = true) + protected List _interface; + + /** + * Gets the value of the interface property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the interface property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getInterface().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TInterface } + */ + public List getInterface() { + if (this._interface == null) { + this._interface = new ArrayList<>(); + } + return this._interface; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class ValidSource { + + @XmlAttribute(required = true) + protected QName typeRef; + + /** + * Gets the value of the typeRef property. + * + * @return possible object is {@link QName } + */ + public QName getTypeRef() { + return this.typeRef; + } + + /** + * Sets the value of the typeRef property. + * + * @param value allowed object is {@link QName } + */ + public void setTypeRef(final QName value) { + this.typeRef = value; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="typeRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class ValidTarget { + + @XmlAttribute(required = true) + protected QName typeRef; + + /** + * Gets the value of the typeRef property. + * + * @return possible object is {@link QName } + */ + public QName getTypeRef() { + return this.typeRef; + } + + /** + * Sets the value of the typeRef property. + * + * @param value allowed object is {@link QName } + */ + public void setTypeRef(final QName value) { + this.typeRef = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTypeImplementation.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTypeImplementation.java new file mode 100644 index 000000000..e2329b52b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRelationshipTypeImplementation.java @@ -0,0 +1,296 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tRelationshipTypeImplementation complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRelationshipTypeImplementation">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    + *         <element name="DerivedFrom" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="relationshipTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element name="RequiredContainerFeatures" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeatures" minOccurs="0"/>
    + *         <element name="ImplementationArtifacts" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tImplementationArtifacts" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute name="relationshipType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="abstract" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    + *       <attribute name="final" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoolean" default="no" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRelationshipTypeImplementation", + propOrder = {"tags", "derivedFrom", "requiredContainerFeatures", "implementationArtifacts"}) +public class TRelationshipTypeImplementation extends TExtensibleElements { + + @XmlElement(name = "Tags") + protected TTags tags; + @XmlElement(name = "DerivedFrom") + protected TRelationshipTypeImplementation.DerivedFrom derivedFrom; + @XmlElement(name = "RequiredContainerFeatures") + protected TRequiredContainerFeatures requiredContainerFeatures; + @XmlElement(name = "ImplementationArtifacts") + protected TImplementationArtifacts implementationArtifacts; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String name; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String targetNamespace; + @XmlAttribute(required = true) + protected QName relationshipType; + @XmlAttribute(name = "abstract") + protected TBoolean _abstract; + @XmlAttribute(name = "final") + protected TBoolean _final; + + /** + * Gets the value of the tags property. + * + * @return possible object is {@link TTags } + */ + public TTags getTags() { + return this.tags; + } + + /** + * Sets the value of the tags property. + * + * @param value allowed object is {@link TTags } + */ + public void setTags(final TTags value) { + this.tags = value; + } + + /** + * Gets the value of the derivedFrom property. + * + * @return possible object is {@link TRelationshipTypeImplementation.DerivedFrom } + */ + public TRelationshipTypeImplementation.DerivedFrom getDerivedFrom() { + return this.derivedFrom; + } + + /** + * Sets the value of the derivedFrom property. + * + * @param value allowed object is {@link TRelationshipTypeImplementation.DerivedFrom } + */ + public void setDerivedFrom(final TRelationshipTypeImplementation.DerivedFrom value) { + this.derivedFrom = value; + } + + /** + * Gets the value of the requiredContainerFeatures property. + * + * @return possible object is {@link TRequiredContainerFeatures } + */ + public TRequiredContainerFeatures getRequiredContainerFeatures() { + return this.requiredContainerFeatures; + } + + /** + * Sets the value of the requiredContainerFeatures property. + * + * @param value allowed object is {@link TRequiredContainerFeatures } + */ + public void setRequiredContainerFeatures(final TRequiredContainerFeatures value) { + this.requiredContainerFeatures = value; + } + + /** + * Gets the value of the implementationArtifacts property. + * + * @return possible object is {@link TImplementationArtifacts } + */ + public TImplementationArtifacts getImplementationArtifacts() { + return this.implementationArtifacts; + } + + /** + * Sets the value of the implementationArtifacts property. + * + * @param value allowed object is {@link TImplementationArtifacts } + */ + public void setImplementationArtifacts(final TImplementationArtifacts value) { + this.implementationArtifacts = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the targetNamespace property. + * + * @return possible object is {@link String } + */ + public String getTargetNamespace() { + return this.targetNamespace; + } + + /** + * Sets the value of the targetNamespace property. + * + * @param value allowed object is {@link String } + */ + public void setTargetNamespace(final String value) { + this.targetNamespace = value; + } + + /** + * Gets the value of the relationshipType property. + * + * @return possible object is {@link QName } + */ + public QName getRelationshipType() { + return this.relationshipType; + } + + /** + * Sets the value of the relationshipType property. + * + * @param value allowed object is {@link QName } + */ + public void setRelationshipType(final QName value) { + this.relationshipType = value; + } + + /** + * Gets the value of the abstract property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getAbstract() { + if (this._abstract == null) { + return TBoolean.NO; + } else { + return this._abstract; + } + } + + /** + * Sets the value of the abstract property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setAbstract(final TBoolean value) { + this._abstract = value; + } + + /** + * Gets the value of the final property. + * + * @return possible object is {@link TBoolean } + */ + public TBoolean getFinal() { + if (this._final == null) { + return TBoolean.NO; + } else { + return this._final; + } + } + + /** + * Sets the value of the final property. + * + * @param value allowed object is {@link TBoolean } + */ + public void setFinal(final TBoolean value) { + this._final = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="relationshipTypeImplementationRef" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class DerivedFrom { + + @XmlAttribute(required = true) + protected QName relationshipTypeImplementationRef; + + /** + * Gets the value of the relationshipTypeImplementationRef property. + * + * @return possible object is {@link QName } + */ + public QName getRelationshipTypeImplementationRef() { + return this.relationshipTypeImplementationRef; + } + + /** + * Sets the value of the relationshipTypeImplementationRef property. + * + * @param value allowed object is {@link QName } + */ + public void setRelationshipTypeImplementationRef(final QName value) { + this.relationshipTypeImplementationRef = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeature.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeature.java new file mode 100644 index 000000000..e2d52b725 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeature.java @@ -0,0 +1,59 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tRequiredContainerFeature complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRequiredContainerFeature">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <attribute name="feature" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRequiredContainerFeature") +public class TRequiredContainerFeature { + + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String feature; + + /** + * Gets the value of the feature property. + * + * @return possible object is {@link String } + */ + public String getFeature() { + return this.feature; + } + + /** + * Sets the value of the feature property. + * + * @param value allowed object is {@link String } + */ + public void setFeature(final String value) { + this.feature = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeatures.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeatures.java new file mode 100644 index 000000000..eba1b6f59 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequiredContainerFeatures.java @@ -0,0 +1,70 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tRequiredContainerFeatures complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRequiredContainerFeatures">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="RequiredContainerFeature" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRequiredContainerFeature" maxOccurs="unbounded"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRequiredContainerFeatures", propOrder = {"requiredContainerFeature"}) +public class TRequiredContainerFeatures { + + @XmlElement(name = "RequiredContainerFeature", required = true) + protected List requiredContainerFeature; + + /** + * Gets the value of the requiredContainerFeature property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the requiredContainerFeature property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getRequiredContainerFeature().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TRequiredContainerFeature } + */ + public List getRequiredContainerFeature() { + if (this.requiredContainerFeature == null) { + this.requiredContainerFeature = new ArrayList<>(); + } + return this.requiredContainerFeature; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirement.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirement.java new file mode 100644 index 000000000..f60c38fdc --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirement.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tRequirement complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRequirement">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityTemplate">
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRequirement") +public class TRequirement extends TEntityTemplate { + + @XmlAttribute(required = true) + protected String name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementDefinition.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementDefinition.java new file mode 100644 index 000000000..ec8998801 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementDefinition.java @@ -0,0 +1,235 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tRequirementDefinition complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRequirementDefinition">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Constraints" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    + *                 </sequence>
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="requirementType" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="lowerBound" type="{http://www.w3.org/2001/XMLSchema}int" default="1" />
    + *       <attribute name="upperBound" default="1">
    + *         <simpleType>
    + *           <union>
    + *             <simpleType>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger">
    + *                 <pattern value="([1-9]+[0-9]*)"/>
    + *               </restriction>
    + *             </simpleType>
    + *             <simpleType>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *                 <enumeration value="unbounded"/>
    + *               </restriction>
    + *             </simpleType>
    + *           </union>
    + *         </simpleType>
    + *       </attribute>
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRequirementDefinition", propOrder = {"constraints"}) +public class TRequirementDefinition extends TExtensibleElements { + + @XmlElement(name = "Constraints") + protected TRequirementDefinition.Constraints constraints; + @XmlAttribute(required = true) + protected String name; + @XmlAttribute(required = true) + protected QName requirementType; + @XmlAttribute + protected Integer lowerBound; + @XmlAttribute + protected String upperBound; + + /** + * Gets the value of the constraints property. + * + * @return possible object is {@link TRequirementDefinition.Constraints } + */ + public TRequirementDefinition.Constraints getConstraints() { + return this.constraints; + } + + /** + * Sets the value of the constraints property. + * + * @param value allowed object is {@link TRequirementDefinition.Constraints } + */ + public void setConstraints(final TRequirementDefinition.Constraints value) { + this.constraints = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the requirementType property. + * + * @return possible object is {@link QName } + */ + public QName getRequirementType() { + return this.requirementType; + } + + /** + * Sets the value of the requirementType property. + * + * @param value allowed object is {@link QName } + */ + public void setRequirementType(final QName value) { + this.requirementType = value; + } + + /** + * Gets the value of the lowerBound property. + * + * @return possible object is {@link Integer } + */ + public int getLowerBound() { + if (this.lowerBound == null) { + return 1; + } else { + return this.lowerBound; + } + } + + /** + * Sets the value of the lowerBound property. + * + * @param value allowed object is {@link Integer } + */ + public void setLowerBound(final Integer value) { + this.lowerBound = value; + } + + /** + * Gets the value of the upperBound property. + * + * @return possible object is {@link String } + */ + public String getUpperBound() { + if (this.upperBound == null) { + return "1"; + } else { + return this.upperBound; + } + } + + /** + * Sets the value of the upperBound property. + * + * @param value allowed object is {@link String } + */ + public void setUpperBound(final String value) { + this.upperBound = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="Constraint" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tConstraint" maxOccurs="unbounded"/>
    +     *       </sequence>
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"constraint"}) + public static class Constraints { + + @XmlElement(name = "Constraint", required = true) + protected List constraint; + + /** + * Gets the value of the constraint property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the constraint property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getConstraint().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TConstraint } + */ + public List getConstraint() { + if (this.constraint == null) { + this.constraint = new ArrayList<>(); + } + return this.constraint; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementRef.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementRef.java new file mode 100644 index 000000000..b33a04fd3 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementRef.java @@ -0,0 +1,82 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tRequirementRef complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRequirementRef">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="ref" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRequirementRef") +public class TRequirementRef { + + @XmlAttribute + protected String name; + @XmlAttribute(required = true) + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object ref; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the ref property. + * + * @return possible object is {@link Object } + */ + public Object getRef() { + return this.ref; + } + + /** + * Sets the value of the ref property. + * + * @param value allowed object is {@link Object } + */ + public void setRef(final Object value) { + this.ref = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementType.java new file mode 100644 index 000000000..2e81bcb27 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TRequirementType.java @@ -0,0 +1,59 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tRequirementType complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tRequirementType">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tEntityType">
    + *       <attribute name="requiredCapabilityType" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tRequirementType") +public class TRequirementType extends TEntityType { + + @XmlAttribute + protected QName requiredCapabilityType; + + /** + * Gets the value of the requiredCapabilityType property. + * + * @return possible object is {@link QName } + */ + public QName getRequiredCapabilityType() { + return this.requiredCapabilityType; + } + + /** + * Sets the value of the requiredCapabilityType property. + * + * @param value allowed object is {@link QName } + */ + public void setRequiredCapabilityType(final QName value) { + this.requiredCapabilityType = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TServiceTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TServiceTemplate.java new file mode 100644 index 000000000..08b31674e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TServiceTemplate.java @@ -0,0 +1,217 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +/** + *

    + * Java class for tServiceTemplate complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tServiceTemplate">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <sequence>
    + *         <element name="Tags" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTags" minOccurs="0"/>
    + *         <element name="BoundaryDefinitions" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tBoundaryDefinitions" minOccurs="0"/>
    + *         <element name="TopologyTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTopologyTemplate"/>
    + *         <element name="Plans" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tPlans" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
    + *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *       <attribute name="substitutableNodeType" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tServiceTemplate", propOrder = {"tags", "boundaryDefinitions", "topologyTemplate", "plans"}) +public class TServiceTemplate extends TExtensibleElements { + + @XmlElement(name = "Tags") + protected TTags tags; + @XmlElement(name = "BoundaryDefinitions") + protected TBoundaryDefinitions boundaryDefinitions; + @XmlElement(name = "TopologyTemplate", required = true) + protected TTopologyTemplate topologyTemplate; + @XmlElement(name = "Plans") + protected TPlans plans; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute + protected String name; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String targetNamespace; + @XmlAttribute + protected QName substitutableNodeType; + + /** + * Gets the value of the tags property. + * + * @return possible object is {@link TTags } + */ + public TTags getTags() { + return this.tags; + } + + /** + * Sets the value of the tags property. + * + * @param value allowed object is {@link TTags } + */ + public void setTags(final TTags value) { + this.tags = value; + } + + /** + * Gets the value of the boundaryDefinitions property. + * + * @return possible object is {@link TBoundaryDefinitions } + */ + public TBoundaryDefinitions getBoundaryDefinitions() { + return this.boundaryDefinitions; + } + + /** + * Sets the value of the boundaryDefinitions property. + * + * @param value allowed object is {@link TBoundaryDefinitions } + */ + public void setBoundaryDefinitions(final TBoundaryDefinitions value) { + this.boundaryDefinitions = value; + } + + /** + * Gets the value of the topologyTemplate property. + * + * @return possible object is {@link TTopologyTemplate } + */ + public TTopologyTemplate getTopologyTemplate() { + return this.topologyTemplate; + } + + /** + * Sets the value of the topologyTemplate property. + * + * @param value allowed object is {@link TTopologyTemplate } + */ + public void setTopologyTemplate(final TTopologyTemplate value) { + this.topologyTemplate = value; + } + + /** + * Gets the value of the plans property. + * + * @return possible object is {@link TPlans } + */ + public TPlans getPlans() { + return this.plans; + } + + /** + * Sets the value of the plans property. + * + * @param value allowed object is {@link TPlans } + */ + public void setPlans(final TPlans value) { + this.plans = value; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + */ + public String getId() { + return this.id; + } + + /** + * Sets the value of the id property. + * + * @param value allowed object is {@link String } + */ + public void setId(final String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the targetNamespace property. + * + * @return possible object is {@link String } + */ + public String getTargetNamespace() { + return this.targetNamespace; + } + + /** + * Sets the value of the targetNamespace property. + * + * @param value allowed object is {@link String } + */ + public void setTargetNamespace(final String value) { + this.targetNamespace = value; + } + + /** + * Gets the value of the substitutableNodeType property. + * + * @return possible object is {@link QName } + */ + public QName getSubstitutableNodeType() { + return this.substitutableNodeType; + } + + /** + * Sets the value of the substitutableNodeType property. + * + * @param value allowed object is {@link QName } + */ + public void setSubstitutableNodeType(final QName value) { + this.substitutableNodeType = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTag.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTag.java new file mode 100644 index 000000000..dc6818ef1 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTag.java @@ -0,0 +1,78 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tTag complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tTag">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tTag") +public class TTag { + + @XmlAttribute(required = true) + protected String name; + @XmlAttribute(required = true) + protected String value; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } + + /** + * Gets the value of the value property. + * + * @return possible object is {@link String } + */ + public String getValue() { + return this.value; + } + + /** + * Sets the value of the value property. + * + * @param value allowed object is {@link String } + */ + public void setValue(final String value) { + this.value = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTags.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTags.java new file mode 100644 index 000000000..e564962dd --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTags.java @@ -0,0 +1,70 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tTags complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tTags">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="Tag" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tTag" maxOccurs="unbounded"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tTags", propOrder = {"tag"}) +public class TTags { + + @XmlElement(name = "Tag", required = true) + protected List tag; + + /** + * Gets the value of the tag property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the tag property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getTag().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TTag } + */ + public List getTag() { + if (this.tag == null) { + this.tag = new ArrayList<>(); + } + return this.tag; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyElementInstanceStates.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyElementInstanceStates.java new file mode 100644 index 000000000..5b64a6c4a --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyElementInstanceStates.java @@ -0,0 +1,124 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tTopologyElementInstanceStates complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tTopologyElementInstanceStates">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="InstanceState" maxOccurs="unbounded">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="state" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tTopologyElementInstanceStates", propOrder = {"instanceState"}) +public class TTopologyElementInstanceStates { + + @XmlElement(name = "InstanceState", required = true) + protected List instanceState; + + /** + * Gets the value of the instanceState property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the instanceState property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getInstanceState().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TTopologyElementInstanceStates.InstanceState } + */ + public List getInstanceState() { + if (this.instanceState == null) { + this.instanceState = new ArrayList<>(); + } + return this.instanceState; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="state" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class InstanceState { + + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String state; + + /** + * Gets the value of the state property. + * + * @return possible object is {@link String } + */ + public String getState() { + return this.state; + } + + /** + * Sets the value of the state property. + * + * @param value allowed object is {@link String } + */ + public void setState(final String value) { + this.state = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyTemplate.java new file mode 100644 index 000000000..e5bec6d0d --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/TTopologyTemplate.java @@ -0,0 +1,74 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +package org.oasis_open.docs.tosca.ns._2011._12; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tTopologyTemplate complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tTopologyTemplate">
    + *   <complexContent>
    + *     <extension base="{http://docs.oasis-open.org/tosca/ns/2011/12}tExtensibleElements">
    + *       <choice maxOccurs="unbounded">
    + *         <element name="NodeTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tNodeTemplate"/>
    + *         <element name="RelationshipTemplate" type="{http://docs.oasis-open.org/tosca/ns/2011/12}tRelationshipTemplate"/>
    + *       </choice>
    + *       <anyAttribute processContents='lax' namespace='##other'/>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tTopologyTemplate", propOrder = {"nodeTemplateOrRelationshipTemplate"}) +public class TTopologyTemplate extends TExtensibleElements { + + @XmlElements( {@XmlElement(name = "RelationshipTemplate", type = TRelationshipTemplate.class), + @XmlElement(name = "NodeTemplate", type = TNodeTemplate.class)}) + protected List nodeTemplateOrRelationshipTemplate; + + /** + * Gets the value of the nodeTemplateOrRelationshipTemplate property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the nodeTemplateOrRelationshipTemplate property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getNodeTemplateOrRelationshipTemplate().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TRelationshipTemplate } {@link TNodeTemplate } + */ + public List getNodeTemplateOrRelationshipTemplate() { + if (this.nodeTemplateOrRelationshipTemplate == null) { + this.nodeTemplateOrRelationshipTemplate = new ArrayList<>(); + } + return this.nodeTemplateOrRelationshipTemplate; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/package-info.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/package-info.java new file mode 100644 index 000000000..5f7d65d2e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/oasis_open/docs/tosca/ns/_2011/_12/package-info.java @@ -0,0 +1,11 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.04.02 at 04:58:44 PM CEST +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://docs.oasis-open.org/tosca/ns/2011/12", + elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.oasis_open.docs.tosca.ns._2011._12; diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/Exporter.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/Exporter.java similarity index 75% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/Exporter.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/Exporter.java index 09781a99e..8e473ee77 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/Exporter.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/Exporter.java @@ -6,6 +6,10 @@ import java.io.FileWriter; import java.io.IOException; import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -18,10 +22,10 @@ import javax.xml.namespace.QName; import javax.xml.stream.FactoryConfigurationError; -import org.apache.commons.io.FileUtils; -import org.apache.ode.schemas.dd._2007._03.TProvide; import org.eclipse.winery.model.selfservice.Application; import org.eclipse.winery.model.selfservice.ApplicationOption; + +import org.apache.ode.schemas.dd._2007._03.TProvide; import org.oasis_open.docs.tosca.ns._2011._12.Definitions; import org.oasis_open.docs.tosca.ns._2011._12.ObjectFactory; import org.oasis_open.docs.tosca.ns._2011._12.Plan; @@ -36,22 +40,20 @@ import org.oasis_open.docs.tosca.ns._2011._12.TServiceTemplate; import org.opentosca.container.core.common.SystemException; import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.impl.service.FileSystem; import org.opentosca.container.core.model.AbstractFile; -import org.opentosca.container.core.model.csar.CSARContent; import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.container.core.service.IFileAccessService; -import org.opentosca.planbuilder.csarhandler.CSARHandler; +import org.opentosca.container.core.next.model.PlanType; +import org.opentosca.container.legacy.core.model.CSARContent; +import org.opentosca.planbuilder.core.csarhandler.CSARHandler; import org.opentosca.planbuilder.export.exporters.SimpleFileExporter; import org.opentosca.planbuilder.integration.layer.AbstractExporter; import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.plan.bpel.Deploy; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; /** *

    @@ -61,42 +63,39 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ +@Service public class Exporter extends AbstractExporter { private final static Logger LOG = LoggerFactory.getLogger(Exporter.class); - private final SimpleFileExporter simpleExporter; + private final SimpleFileExporter simpleExporter = new SimpleFileExporter(); - private final ObjectFactory toscaFactory; + private final ObjectFactory toscaFactory = new ObjectFactory(); private final CSARHandler handler = new CSARHandler(); - - public class PlanExportResult{ - public File csarFile; + public class PlanExportResult { + public Path csarFile; public Collection planIds; - - public PlanExportResult(File csarFile, Collection planIds) { + + public PlanExportResult(Path csarFile, Collection planIds) { this.csarFile = csarFile; this.planIds = planIds; } } - + /** * Constructor */ public Exporter() { - this.simpleExporter = new SimpleFileExporter(); - this.toscaFactory = new ObjectFactory(); } /** * Exports the given BuildPlan to the given URI * * @param destination the absolute location to export to - * @param buildPlan the BuildPlan to export - * @throws IOException is thrown when reading/writing to the given URI fails + * @param buildPlan the BuildPlan to export + * @throws IOException is thrown when reading/writing to the given URI fails * @throws JAXBException is thrown when writing with JAXB fails */ public void exportToPlanFile(final URI destination, final AbstractPlan buildPlan) throws IOException, JAXBException { @@ -104,8 +103,8 @@ public void exportToPlanFile(final URI destination, final AbstractPlan buildPlan } public PlanExportResult exportToCSAR(final List plans, final CSARID csarId) { - final List bpelPlans = new ArrayList<>(); - + final List bpelPlans = new ArrayList<>(); + for (final AbstractPlan plan : plans) { if (plan instanceof BPELPlan) { bpelPlans.add((BPELPlan) plan); @@ -116,14 +115,13 @@ public PlanExportResult exportToCSAR(final List plans, final CSARI } public PlanExportResult exportBPELToCSAR(final List plans, final CSARID csarId) { - + Collection exportedBpelPlanIds = new ArrayList(); CSARContent csarContent = null; try { csarContent = this.handler.getCSARContentForID(csarId); - } - catch (final UserException e1) { + } catch (final UserException e1) { Exporter.LOG.error("Error occured while trying to retrieve CSAR content", e1); } @@ -133,11 +131,9 @@ public PlanExportResult exportBPELToCSAR(final List plans, final CSARI final String csarName = csarId.getFileName(); - final IFileAccessService service = getFileAccessService(); - - final File tempDir = service.getTemp(); - final File pathToRepackagedCsar = service.getTemp(); - final File repackagedCsar = new File(pathToRepackagedCsar, csarName); + final Path tempDir = FileSystem.getTemporaryFolder(); + final Path pathToRepackagedCsar = FileSystem.getTemporaryFolder(); + final Path repackagedCsar = pathToRepackagedCsar.resolve(csarName); try { final Set files = csarContent.getFilesRecursively(); @@ -181,7 +177,6 @@ public PlanExportResult exportBPELToCSAR(final List plans, final CSARI planList.add(generatedPlanElement); plansToExport.add(plan); - TExportedInterface exportedIface = null; // find already set openTOSCA lifecycle interface @@ -218,60 +213,56 @@ public PlanExportResult exportBPELToCSAR(final List plans, final CSARI } } + final Path csarRoot = Paths.get(csarContent.getDirectory(".").getPath()).getParent(); for (final AbstractFile file : files) { - if (file.getFile().toFile().toString().equals(rootDefFile.toString())) { + if (file.getFile().toString().equals(rootDefFile.toString())) { continue; } - final File newLocation = new File(tempDir, file.getPath()); - Exporter.LOG.debug(newLocation.getAbsolutePath()); - Exporter.LOG.debug(file.getFile().toString()); - if (newLocation.isDirectory()) { - - FileUtils.copyDirectory(file.getFile().toFile(), newLocation); - } else { - FileUtils.copyFile(file.getFile().toFile(), newLocation); - } - + final Path filePath = Paths.get(file.getPath()); + final Path relativeToRoot = csarRoot.relativize(filePath); + final Path newLocation = tempDir.resolve(relativeToRoot); + LOG.debug("Exporting {} to {}", file.getFile(), newLocation.toAbsolutePath().toString()); + // must ensure that the directory we want to copy the file to exists. + Files.createDirectories(newLocation.getParent()); + Files.copy(file.getFile(), newLocation); } // write new defs file - final File newDefsFile = new File(tempDir, mainDefFile.getPath()); + + final File newDefsFile = tempDir.resolve(csarRoot.relativize(Paths.get(mainDefFile.getPath()))).toFile(); + Files.createDirectories(newDefsFile.toPath().getParent()); newDefsFile.createNewFile(); final JAXBContext jaxbContext = JAXBContext.newInstance(Definitions.class); - final Marshaller m = jaxbContext.createMarshaller(); - final FileWriter writer = new FileWriter(newDefsFile); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); // output to the console: m.marshal(defs, System.out); try { m.marshal(defs, writer); - } - catch (final FactoryConfigurationError e) { - // TODO Auto-generated catch block - e.printStackTrace(); + } catch (final FactoryConfigurationError e) { + LOG.error("Could not configure factory for XML Export", e); } // write plans for (final BPELPlan plan : plansToExport) { - final File planPath = new File(tempDir, generateRelativePlanPath(plan)); + final Path planPath = tempDir.resolve(generateRelativePlanPath(plan)); Exporter.LOG.debug(planPath.toString()); - planPath.getParentFile().mkdirs(); - planPath.createNewFile(); - this.simpleExporter.export(planPath.toURI(), plan); + Files.createDirectories(planPath.getParent()); + Files.createFile(planPath); + this.simpleExporter.export(planPath.toUri(), plan); } // Check if selfservice is already available - final File selfServiceDir = new File(tempDir, "SELFSERVICE-Metadata"); - final File selfServiceDataXml = new File(selfServiceDir, "data.xml"); + final Path selfServiceDir = tempDir.resolve("SELFSERVICE-Metadata"); + final Path selfServiceDataXml = selfServiceDir.resolve("data.xml"); final JAXBContext jaxbContextWineryApplication = JAXBContext.newInstance(Application.class); - if (selfServiceDir.exists() && selfServiceDataXml.exists()) { + if (Files.exists(selfServiceDir) && Files.exists(selfServiceDataXml)) { final Unmarshaller u = jaxbContextWineryApplication.createUnmarshaller(); - final Application appDesc = (Application) u.unmarshal(selfServiceDataXml); + final Application appDesc = (Application) u.unmarshal(selfServiceDataXml.toFile()); if (appDesc.getOptions() != null) { // check if planInput etc. is set properly @@ -279,14 +270,11 @@ public PlanExportResult exportBPELToCSAR(final List plans, final CSARI for (final ApplicationOption option : appDesc.getOptions().getOption()) { for (final BPELPlan plan : plansToExport) { if (option.getPlanServiceName() - .equals(getBuildPlanServiceName(plan.getDeploymentDeskriptor()).getLocalPart())) { - if (!new File(selfServiceDir, option.getPlanInputMessageUrl()).exists()) { - // the planinput file is defined in the xml, - // but - // no file exists in the csar -> write one - final File planInputFile = - new File(selfServiceDir, option.getPlanInputMessageUrl()); - writePlanInputMessageInstance(plan, planInputFile); + .equals(getBuildPlanServiceName(plan.getDeploymentDeskriptor()).getLocalPart())) { + final Path planInputFile = selfServiceDir.resolve(option.getPlanInputMessageUrl()); + if (!Files.exists(planInputFile)) { + // the planinput file is defined in the xml, but no file exists in the csar -> write one + writePlanInputMessageInstance(plan, planInputFile.toFile()); exportedPlans.add(plan); } } @@ -302,73 +290,72 @@ public PlanExportResult exportBPELToCSAR(final List plans, final CSARI } final ApplicationOption option = createApplicationOption(plan, optionCounter); - writePlanInputMessageInstance(plan, new File(selfServiceDir, - "plan.input.default." + optionCounter + ".xml")); + writePlanInputMessageInstance(plan, + selfServiceDir.resolve("plan.input.default." + optionCounter + ".xml").toFile()); appDesc.getOptions().getOption().add(option); optionCounter++; } final Marshaller wineryAppMarshaller = jaxbContextWineryApplication.createMarshaller(); - wineryAppMarshaller.marshal(appDesc, selfServiceDataXml); + wineryAppMarshaller.marshal(appDesc, selfServiceDataXml.toFile()); } - } else { int optionCounter = 1; final Application.Options options = new Application.Options(); for (final BPELPlan plan : plansToExport) { final ApplicationOption option = createApplicationOption(plan, optionCounter); - writePlanInputMessageInstance(plan, new File(selfServiceDir, - "plan.input.default." + optionCounter + ".xml")); + writePlanInputMessageInstance(plan, + selfServiceDir.resolve("plan.input.default." + optionCounter + ".xml").toFile()); optionCounter++; options.getOption().add(option); } appDesc.setOptions(options); final Marshaller wineryAppMarshaller = jaxbContextWineryApplication.createMarshaller(); - wineryAppMarshaller.marshal(appDesc, selfServiceDataXml); + wineryAppMarshaller.marshal(appDesc, selfServiceDataXml.toFile()); } - } else { // write SELFSERVICE-Metadata folder and files - if (selfServiceDir.mkdirs() && selfServiceDataXml.createNewFile()) { - final Application appDesc = new Application(); - - appDesc.setDisplayName(csarName); - appDesc.setDescription("No description available. This application was partially generated"); - appDesc.setIconUrl(""); - appDesc.setImageUrl(""); - - int optionCounter = 1; - final Application.Options options = new Application.Options(); - - for (final BPELPlan plan : plansToExport) { - final ApplicationOption option = createApplicationOption(plan, optionCounter); - writePlanInputMessageInstance(plan, new File(selfServiceDir, - "plan.input.default." + optionCounter + ".xml")); - optionCounter++; - options.getOption().add(option); - } - appDesc.setOptions(options); - - final Marshaller wineryAppMarshaller = jaxbContextWineryApplication.createMarshaller(); - wineryAppMarshaller.marshal(appDesc, selfServiceDataXml); + Files.createDirectories(selfServiceDir); + // safeguard against an exception by checking whether the thing exists before trying to create it + if (!Files.exists(selfServiceDataXml)) { + Files.createFile(selfServiceDataXml); + } + final Application appDesc = new Application(); + + appDesc.setDisplayName(csarName); + appDesc.setDescription("No description available. This application was partially generated"); + appDesc.setIconUrl(""); + appDesc.setImageUrl(""); + + int optionCounter = 1; + final Application.Options options = new Application.Options(); + + for (final BPELPlan plan : plansToExport) { + final ApplicationOption option = createApplicationOption(plan, optionCounter); + writePlanInputMessageInstance(plan, + selfServiceDir.resolve("plan.input.default." + optionCounter + ".xml").toFile()); + optionCounter++; + options.getOption().add(option); } + appDesc.setOptions(options); + + final Marshaller wineryAppMarshaller = jaxbContextWineryApplication.createMarshaller(); + wineryAppMarshaller.marshal(appDesc, selfServiceDataXml.toFile()); } - } - catch (final IOException e) { + FileSystem.zip(repackagedCsar, tempDir); + } catch (final IOException e) { Exporter.LOG.error("Some IO Exception occured", e); - } - catch (final JAXBException e) { + } catch (final JAXBException e) { Exporter.LOG.error("Some error while marshalling with JAXB", e); - } - catch (final SystemException e) { + } catch (final SystemException e) { Exporter.LOG.error("Some error in the openTOSCA Core", e); } - service.zip(tempDir, repackagedCsar); - Exporter.LOG.debug(repackagedCsar.toString()); + + Exporter.LOG.debug(repackagedCsar.toString()); return new PlanExportResult(repackagedCsar, exportedBpelPlanIds); } @@ -379,11 +366,11 @@ private ApplicationOption createApplicationOption(final BPELPlan plan, final int option.setName("Build" + optionCounter); option.setDescription("Generated BuildPlan"); break; - case MANAGE: + case MANAGEMENT: option.setName("Manage" + optionCounter); option.setDescription("Generated ManagementPlan"); break; - case TERMINATE: + case TERMINATION: option.setName("Terminate" + optionCounter); option.setDescription("Generated TerminationPlan"); break; @@ -407,34 +394,20 @@ private Definitions parseDefinitionsFile(final File file) { final JAXBContext jaxbContext = JAXBContext.newInstance(Definitions.class); final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); def = (Definitions) unmarshaller.unmarshal(new FileReader(file)); - } - catch (final JAXBException e) { + } catch (final JAXBException e) { Exporter.LOG.error("Error while reading a Definitions file", e); return null; - } - catch (final FileNotFoundException e) { + } catch (final FileNotFoundException e) { Exporter.LOG.error("Definitions file not found", e); return null; } return def; } - /** - * Returns the FileAccessService of the OpenTOSCA Core - * - * @return the IFileAccessService of the OpenTOSCA Core - */ - private IFileAccessService getFileAccessService() { - final BundleContext ctx = FrameworkUtil.getBundle(Exporter.class).getBundleContext(); - final ServiceReference serviceReference = ctx.getServiceReference(IFileAccessService.class.getName()); - final IFileAccessService service = (IFileAccessService) ctx.getService(serviceReference); - return service; - } - /** * Builds a valid QName for the given ServiceTemplate based on the given Definitions document * - * @param defs a JAXB Definitions + * @param defs a JAXB Definitions * @param serviceTemplate a JAXB TServiceTemplate * @return a QName denoting the given ServiceTemplate */ @@ -451,8 +424,7 @@ private QName buildQName(final Definitions defs, final TServiceTemplate serviceT * Returns a List of TServiceTemplate of the given Definitions document * * @param defs a JAXB Definitions document - * @return a List of TServiceTemplate which are the ServiceTemplates of the given Definitions - * Document + * @return a List of TServiceTemplate which are the ServiceTemplates of the given Definitions Document */ private List getServiceTemplates(final Definitions defs) { final List servTemps = new ArrayList<>(); @@ -504,18 +476,18 @@ private TPlan generateTPlanElement(final BPELPlan generatedPlan) { switch (generatedPlan.getType()) { case BUILD: - plan.setPlanType(PlanType.BUILD.getString()); + plan.setPlanType(PlanType.BUILD.toString()); break; - case TERMINATE: - plan.setPlanType(PlanType.TERMINATE.getString()); + case TERMINATION: + plan.setPlanType(PlanType.TERMINATION.toString()); break; - case TRANSFORM: - plan.setPlanType(PlanType.TRANSFORM.getString()); + case TRANSFORMATION: + plan.setPlanType(PlanType.TRANSFORMATION.toString()); break; default: // every other plan is a management plan - case MANAGE: - plan.setPlanType(PlanType.MANAGE.getString()); + case MANAGEMENT: + plan.setPlanType(PlanType.MANAGEMENT.toString()); break; } @@ -561,7 +533,7 @@ private void writePlanInputMessageInstance(final BPELPlan buildPlan, final File } soapMessage += soapMessageSuffix; - FileUtils.write(xmlFile, soapMessage); + Files.write(xmlFile.toPath(), soapMessage.getBytes(StandardCharsets.UTF_8)); } private String createPrefixPartOfSoapMessage(final String namespace, final String messageBodyRootLocalName) { @@ -579,5 +551,4 @@ private String createSuffixPartOfSoapMessage(final String messageBodyRootLocalNa final String soapEnvelopeSuffix = ""; return soapEnvelopeSuffix; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/VinothekKnownParameters.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/VinothekKnownParameters.java similarity index 76% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/VinothekKnownParameters.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/VinothekKnownParameters.java index 0a9fe7645..09db5ff3f 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/export/VinothekKnownParameters.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/VinothekKnownParameters.java @@ -7,7 +7,6 @@ public class VinothekKnownParameters { private final Map knownParameterToXmlMapping = new HashMap<>(); - public VinothekKnownParameters() { this.knownParameterToXmlMapping.put("csarName", "%CSAR-NAME%"); this.knownParameterToXmlMapping.put("containerApi", "%CONTAINER-API%"); @@ -16,18 +15,17 @@ public VinothekKnownParameters() { // e.g. // http://localhost:1337/containerapi/CSARs/PhpMoodleAppTemplate.csar this.knownParameterToXmlMapping.put("csarEntrypoint", - "%CSARENTRYPOINT-URL%"); + "%CSARENTRYPOINT-URL%"); // e.g. // http://169.254.178.214:9763/services/InvokerService/ this.knownParameterToXmlMapping.put("planCallbackAddress_invoker", - "%PLANCALLBACKINVOKER-URL%"); + "%PLANCALLBACKINVOKER-URL%"); // e.g. // http://localhost:1337/containerapi/instancedata this.knownParameterToXmlMapping.put("instanceDataAPIUrl", - "%INSTANCEDATA-URL%"); + "%INSTANCEDATA-URL%"); this.knownParameterToXmlMapping.put("OpenTOSCAContainerAPIServiceInstanceID", - "%SERVICEINSTANCE-URL%"); - + "%SERVICEINSTANCE-URL%"); } public String createXmlElement(final String parameterLocalName) { @@ -37,5 +35,4 @@ public String createXmlElement(final String parameterLocalName) { return "Please fill in"; } } - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/exporters/SimpleFileExporter.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/exporters/SimpleFileExporter.java new file mode 100644 index 000000000..f4a1015ec --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/export/exporters/SimpleFileExporter.java @@ -0,0 +1,345 @@ +package org.opentosca.planbuilder.export.exporters; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.wsdl.Definition; +import javax.wsdl.Port; +import javax.wsdl.Service; +import javax.wsdl.WSDLException; +import javax.wsdl.factory.WSDLFactory; +import javax.wsdl.xml.WSDLReader; +import javax.wsdl.xml.WSDLWriter; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.namespace.QName; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import com.ibm.wsdl.ServiceImpl; +import org.apache.commons.io.FileUtils; +import org.apache.ode.schemas.dd._2007._03.TInvoke; +import org.apache.ode.schemas.dd._2007._03.TProvide; +import org.apache.ode.schemas.dd._2007._03.TService; +import org.opentosca.container.core.impl.service.ZipManager; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.Deploy; +import org.opentosca.planbuilder.model.plan.bpel.GenericWsdlWrapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + *

    + * This class is used to export buildPlans on filesystems + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public class SimpleFileExporter { + + private final static Logger LOG = LoggerFactory.getLogger(SimpleFileExporter.class); + + // wrapper class for the rewriting of service names in WSDL's + public class Service2ServiceEntry { + + public QName service0; + public QName service1; + + public Service2ServiceEntry(final QName service0, final QName service1) { + this.service0 = service0; + this.service1 = service1; + } + } + + /** + * Exports the given BuildPlan to the given URI location + * + * @param destination the URI to export to + * @param buildPlan the BuildPlan to export + * @return true iff exporting the BuildPlan was successful + * @throws IOException is thrown when reading/writing the file fails + * @throws JAXBException is thrown when writing with JAXB fails + */ + public boolean export(final URI destination, final BPELPlan buildPlan) throws IOException, JAXBException { + if (!new File(destination).getName().contains("zip")) { + return false; + } + // fetch imported files + final Set importedFiles = buildPlan.getImportedFiles(); + + LOG.debug("BuildPlan has following files attached"); + for (final Path file : importedFiles) { + LOG.debug(file.toAbsolutePath().toString()); + } + + // fetch import elements + final List importElements = buildPlan.getBpelImportElements(); + + LOG.debug("BuildPlan has following import elements"); + for (final Element element : importElements) { + LOG.debug("LocalName: " + element.getLocalName()); + LOG.debug("location:" + element.getAttribute("location")); + } + + // fetch wsdl + final GenericWsdlWrapper wsdl = buildPlan.getWsdl(); + + // generate temp folder + final Path tempFolder = Files.createTempDirectory(Long.toString(System.currentTimeMillis())); + LOG.debug("Trying to write files to temp folder: " + tempFolder.toAbsolutePath()); + + final List exportedFiles = new ArrayList<>(); + + // match importedFiles with importElements, to change temporary paths + // inside import elements to relative paths inside the generated zip + for (final Path importedFile : importedFiles) { + for (final Element importElement : importElements) { + final String filePath = importedFile.toAbsolutePath().toString(); + final String locationPath = importElement.getAttribute("location"); + LOG.debug("checking filepath:"); + LOG.debug(filePath); + LOG.debug("with: "); + LOG.debug(locationPath); + if (filePath.trim().equals(importElement.getAttribute("location").trim())) { + // found the import element for the corresponding file + // get file name + final String fileName = importedFile.getFileName().toString(); + LOG.debug("Trying to reset path to: " + fileName); + // change location attribute in import element + importElement.setAttribute("location", fileName); + // copy file to tempdir + final Path fileLocationInDir = tempFolder.resolve(fileName); + + Files.copy(importedFile, fileLocationInDir); + + LOG.debug("Adding " + fileLocationInDir + " to files to export"); + exportedFiles.add(fileLocationInDir); + } + } + } + + LOG.debug("Imported files:" + importedFiles); + LOG.debug("Exported files:" + exportedFiles); + + // write deploy.xml + LOG.debug("Starting marshalling"); + final Deploy deployment = buildPlan.getDeploymentDeskriptor(); + + // rewrite service names in deploy.xml and potential wsdl files + try { + this.rewriteServiceNames(deployment, exportedFiles, buildPlan.getCsarName()); + } catch (final WSDLException e) { + LOG.warn("Rewriting of Service names failed", e); + } catch (final FileNotFoundException e) { + LOG.warn("Something went wrong with locating wsdl files that needed to be changed", e); + } + + final File deployXmlFile = tempFolder.resolve("deploy.xml").toFile(); + deployXmlFile.createNewFile(); + final JAXBContext jaxbContext = JAXBContext.newInstance(Deploy.class); + final Marshaller m = jaxbContext.createMarshaller(); + m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + // output to console uncomment this: m.marshal(deployment, System.out); + m.marshal(deployment, deployXmlFile); + + // save wsdl in tempfolder + final File wsdlFile = tempFolder.resolve(wsdl.getFileName()).toFile(); + FileUtils.writeStringToFile(wsdlFile, wsdl.getFinalizedWsdlAsString()); + + // save bpel file in tempfolder + final File bpelFile = tempFolder.resolve(wsdl.getFileName().replace(".wsdl", ".bpel")).toFile(); + try { + this.writeBPELDocToFile(bpelFile, buildPlan.getBpelDocument()); + } catch (final TransformerException e) { + LOG.error("Error while writing BPEL Document to a file", e); + return false; + } + + // package temp dir and move to destination URI + ZipManager.getInstance().zip(tempFolder.toFile(), new File(destination)); + return true; + } + + private class Mapping { + private final QName key; + private final QName val; + + protected Mapping(final QName key, final QName val) { + this.key = key; + this.val = val; + } + + @Override + public boolean equals(final Object obj) { + + if (obj instanceof Mapping) { + final Mapping map = (Mapping) obj; + return map.key.equals(this.key) && map.val.equals(this.val); + } + + return super.equals(obj); + } + + @Override + public String toString() { + return this.key.toString() + this.val.toString(); + } + } + + private void rewriteServiceNames(final Deploy deploy, final List referencedFiles, + final String csarName) throws WSDLException, IOException { + final WSDLFactory factory = WSDLFactory.newInstance(); + final WSDLReader reader = factory.newWSDLReader(); + final WSDLWriter writer = factory.newWSDLWriter(); + + // first fetch all provide and invoke element which aren't using the + // 'client' partnerLink + // single process only + final List invokes = deploy.getProcess().get(0).getInvoke(); + final List provides = deploy.getProcess().get(0).getProvide(); + + // the services and their new name the dd uses, excluding the client + // services, will be added here + final Set invokedServicesToRewrite = new HashSet<>(); + final Set providedServicesToRewrite = new HashSet<>(); + + LOG.debug("Starting to determine services to rewrite"); + LOG.debug("Starting to determine invoked services"); + for (final TInvoke invoke : invokes) { + if (invoke.getPartnerLink().equals("client")) { + continue; + } + + final TService service = invoke.getService(); + final QName serviceName = service.getName(); + + final QName renamedServiceName = new QName(serviceName.getNamespaceURI(), + csarName + serviceName.getLocalPart() + System.currentTimeMillis()); + + LOG.debug("Adding " + serviceName + " to be rewrited to " + renamedServiceName); + invokedServicesToRewrite.add(new Mapping(serviceName, renamedServiceName)); + + service.setName(renamedServiceName); + + invoke.setService(service); + } + + LOG.debug("Starting to determine provided services"); + for (final TProvide provide : provides) { + if (provide.getPartnerLink().equals("client")) { + continue; + } + + final TService service = provide.getService(); + final QName serviceName = service.getName(); + + final QName renamedServiceName = new QName(serviceName.getNamespaceURI(), + csarName + serviceName.getLocalPart() + System.currentTimeMillis()); + + LOG.debug("Adding " + serviceName + " to be rewrited to " + renamedServiceName); + providedServicesToRewrite.add(new Mapping(serviceName, renamedServiceName)); + + service.setName(renamedServiceName); + + provide.setService(service); + } + + this.rewriteServices(invokedServicesToRewrite, writer, reader, referencedFiles); + this.rewriteServices(providedServicesToRewrite, writer, reader, referencedFiles); + } + + private void rewriteServices(final Set servicesToRewrite, final WSDLWriter writer, final WSDLReader reader, + final List referencedFiles) throws WSDLException, IOException { + + LOG.debug("Rewriting service names:"); + LOG.debug("Files referenced:" + referencedFiles); + LOG.debug("Services to rewrite:" + servicesToRewrite); + + for (final Mapping service : servicesToRewrite) { + final QName serviceName = service.key; + for (final Path file : referencedFiles) { + if (!file.getFileName().toString().endsWith(".wsdl")) { + continue; + } + + final Definition def = reader.readWSDL(file.toAbsolutePath().toString()); + + final List servicesToRemove = new ArrayList<>(); + + boolean foundMatch = false; + // fetch defined services + for (final Object obj : def.getAllServices().values()) { + final Service serviceA = (Service) obj; + + if (serviceName.equals(serviceA.getQName())) { + // found wsdl with service we have to rewrite + servicesToRemove.add(serviceA.getQName()); + + final Service newService = new ServiceImpl(); + + for (final Object o : serviceA.getPorts().values()) { + final Port port = (Port) o; + newService.addPort(port); + } + + newService.setQName(service.val); + + def.addService(newService); + foundMatch = true; + } + } + + if (foundMatch) { + for (final QName serviceToRemove : servicesToRemove) { + def.removeService(serviceToRemove); + } + + writer.writeWSDL(def, Files.newOutputStream(file)); + break; + } + } + } + } + + /** + * Writes the given DOM Document to the location denoted by the given File + * + * @param destination a File denoting the location to export to + * @param doc the Document to export + * @throws TransformerException is thrown when initializing a TransformerFactory or writing the Document fails + * @throws FileNotFoundException is thrown when the File denoted by the File Object doesn't exist + */ + private void writeBPELDocToFile(final File destination, final Document doc) throws TransformerException, + FileNotFoundException { + final TransformerFactory tFactory = TransformerFactory.newInstance(); + final Transformer transformer = tFactory.newTransformer(); + + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); + transformer.setOutputProperty(OutputKeys.METHOD, "xml"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); + + final DOMSource source = new DOMSource(doc); + final StreamResult result = new StreamResult(new FileOutputStream(destination)); + transformer.transform(source, result); + } +} diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/Importer.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/Importer.java similarity index 79% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/Importer.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/Importer.java index dd17a614b..f377ca8f5 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/Importer.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/Importer.java @@ -5,14 +5,16 @@ import java.util.List; import java.util.Set; +import javax.inject.Inject; import javax.xml.namespace.QName; import org.opentosca.container.core.common.SystemException; import org.opentosca.container.core.common.UserException; import org.opentosca.container.core.model.AbstractFile; -import org.opentosca.container.core.model.csar.CSARContent; import org.opentosca.container.core.model.csar.id.CSARID; -import org.opentosca.planbuilder.csarhandler.CSARHandler; +import org.opentosca.container.legacy.core.model.CSARContent; +import org.opentosca.planbuilder.core.csarhandler.CSARHandler; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; import org.opentosca.planbuilder.importer.context.impl.DefinitionsImpl; import org.opentosca.planbuilder.integration.layer.AbstractImporter; import org.opentosca.planbuilder.model.plan.AbstractPlan; @@ -22,27 +24,32 @@ import org.opentosca.planbuilder.model.tosca.AbstractTopologyTemplate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; /** *

    - * This class is a PlanBuilder Importer for openTOSCA. Importing of CSARs is handled by passing a - * CSARID + * This class is a PlanBuilder Importer for openTOSCA. Importing of CSARs is handled by passing a CSARID *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ +@Service public class Importer extends AbstractImporter { final private static Logger LOG = LoggerFactory.getLogger(Importer.class); private final CSARHandler handler = new CSARHandler(); + @Inject + public Importer(PluginRegistry pluginRegistry) { + super(pluginRegistry); + } + /** - * Generates a List of BuildPlans for the given CSARID. The BuildPlans are generated for the - * ServiceTemplates inside the Entry-Definitions Document, that haven't got a BuildPlan yet. + * Generates a List of BuildPlans for the given CSARID. The BuildPlans are generated for the ServiceTemplates inside + * the Entry-Definitions Document, that haven't got a BuildPlan yet. * * @param csarId the CSARID for the CSAR the BuildPlans should be generated * @return a List of BuildPlan @@ -53,17 +60,15 @@ public List generatePlans(final CSARID csarId) { final AbstractDefinitions defs = this.createContext(content); final List plans = this.buildPlans(defs, csarId.getFileName()); return plans; - } - catch (final UserException e) { + } catch (final UserException e) { Importer.LOG.error("Some error within input", e); - } - catch (final SystemException e) { + } catch (final SystemException e) { Importer.LOG.error("Some internal error", e); } return new ArrayList<>(); } - public AbstractPlan generateAdaptationPlan(CSARID csarId, QName serviceTemplatId, + public AbstractPlan generateAdaptationPlan(CSARID csarId, QName serviceTemplateId, Collection sourceNodeTemplateIds, Collection sourceRelationshipTemplateIds, Collection targetNodeTemplateId, @@ -74,25 +79,21 @@ public AbstractPlan generateAdaptationPlan(CSARID csarId, QName serviceTemplatId AbstractDefinitions defs = this.createContext(content); AbstractTopologyTemplate topology = defs.getServiceTemplates().get(0).getTopologyTemplate(); - return this.buildAdaptationPlan(csarId.getFileName(), defs, serviceTemplatId, - this.getNodes(topology, sourceNodeTemplateIds), - this.getRelations(topology, sourceRelationshipTemplateIds), - this.getNodes(topology, targetNodeTemplateId), - this.getRelations(topology, targetRelationshipTemplateId)); - - } - catch (UserException e) { + return this.buildAdaptationPlan(csarId.getFileName(), defs, serviceTemplateId, + this.getNodes(topology, sourceNodeTemplateIds), + this.getRelations(topology, sourceRelationshipTemplateIds), + this.getNodes(topology, targetNodeTemplateId), + this.getRelations(topology, targetRelationshipTemplateId)); + } catch (UserException e) { // TODO Auto-generated catch block e.printStackTrace(); } - - return null; } private Collection getNodes(AbstractTopologyTemplate topology, Collection nodeIds) { - Collection result = new ArrayList(); + Collection result = new ArrayList<>(); for (AbstractNodeTemplate node : topology.getNodeTemplates()) { if (nodeIds.contains(node.getId())) { @@ -105,7 +106,7 @@ private Collection getNodes(AbstractTopologyTemplate topol private Collection getRelations(AbstractTopologyTemplate topology, Collection relationIds) { - Collection result = new ArrayList(); + Collection result = new ArrayList<>(); for (AbstractRelationshipTemplate relation : topology.getRelationshipTemplates()) { if (relationIds.contains(relation.getId())) { @@ -117,7 +118,7 @@ private Collection getRelations(AbstractTopologyTe } public List generateTransformationPlans(final CSARID sourceCsarId, final CSARID targetCsarId) { - final List plans = new ArrayList(); + final List plans = new ArrayList<>(); try { final CSARContent sourceCsarContent = this.handler.getCSARContentForID(sourceCsarId); final AbstractDefinitions sourceDefs = this.createContext(sourceCsarContent); @@ -125,13 +126,11 @@ public List generateTransformationPlans(final CSARID sourceCsarId, final AbstractDefinitions targetDefs = this.createContext(targetCsarContent); plans.addAll(this.buildTransformationPlans(sourceCsarId.getFileName(), sourceDefs, - targetCsarId.getFileName(), targetDefs)); + targetCsarId.getFileName(), targetDefs)); return plans; - } - catch (final UserException e) { + } catch (final UserException e) { Importer.LOG.error("Some error within input", e); - } - catch (final SystemException e) { + } catch (final SystemException e) { Importer.LOG.error("Some internal error", e); } return new ArrayList<>(); @@ -146,11 +145,9 @@ public List generateTransformationPlans(final CSARID sourceCsarId, public AbstractDefinitions getMainDefinitions(final CSARID csarId) { try { return this.createContext(this.handler.getCSARContentForID(csarId)); - } - catch (final UserException e) { + } catch (final UserException e) { Importer.LOG.error("Some error within input", e); - } - catch (final SystemException e) { + } catch (final SystemException e) { Importer.LOG.error("Some internal error", e); } return null; @@ -168,5 +165,4 @@ public AbstractDefinitions createContext(final CSARContent csarContent) throws S final Set referencedFilesInCsar = csarContent.getFilesRecursively(); return new DefinitionsImpl(rootTosca, referencedFilesInCsar, true); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/AbstractPolicyTypeImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/AbstractPolicyTypeImpl.java similarity index 99% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/AbstractPolicyTypeImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/AbstractPolicyTypeImpl.java index f7b93a20b..e7b7195d0 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/AbstractPolicyTypeImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/AbstractPolicyTypeImpl.java @@ -59,5 +59,4 @@ public AbstractProperties getProperties() { // TODO Auto-generated method stub return null; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactReferenceImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactReferenceImpl.java similarity index 96% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactReferenceImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactReferenceImpl.java index 749078f89..9d401a243 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactReferenceImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactReferenceImpl.java @@ -14,13 +14,11 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class ArtifactReferenceImpl extends AbstractArtifactReference { private final TArtifactReference ref; - /** * Constructor * @@ -74,5 +72,4 @@ public List getExcludePatterns() { } return patterns; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactTemplateImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactTemplateImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactTemplateImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactTemplateImpl.java index b0f50cf90..e56525887 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactTemplateImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactTemplateImpl.java @@ -21,7 +21,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class ArtifactTemplateImpl extends AbstractArtifactTemplate { @@ -34,7 +33,7 @@ public class ArtifactTemplateImpl extends AbstractArtifactTemplate { * Constructor * * @param artifactTemplate a JAXB TArtifactTemplate - * @param definitions a DefinitionsImpl for finding various data + * @param definitions a DefinitionsImpl for finding various data */ public ArtifactTemplateImpl(final TArtifactTemplate artifactTemplate, final DefinitionsImpl definitions) { this.defs = definitions; @@ -119,5 +118,4 @@ public AbstractArtifactType getAbstractArtifactType() { } return null; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactTypeImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactTypeImpl.java similarity index 99% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactTypeImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactTypeImpl.java index df67e94ce..6adbabb92 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ArtifactTypeImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ArtifactTypeImpl.java @@ -55,5 +55,4 @@ public AbstractArtifactType getTypeRef() { } return null; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/BoundaryDefinitionsImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/BoundaryDefinitionsImpl.java similarity index 96% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/BoundaryDefinitionsImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/BoundaryDefinitionsImpl.java index c7556022b..2b0fb3948 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/BoundaryDefinitionsImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/BoundaryDefinitionsImpl.java @@ -21,7 +21,6 @@ public class BoundaryDefinitionsImpl extends AbstractBoundaryDefinitions { private final TBoundaryDefinitions boundaryDefinitions; - /** * Constructor * @@ -41,7 +40,5 @@ public AbstractServiceTemplateProperties getProperties() { } else { return null; } - } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/CapabilityImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/CapabilityImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/CapabilityImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/CapabilityImpl.java index b50bd6082..0701b6382 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/CapabilityImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/CapabilityImpl.java @@ -13,13 +13,11 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class CapabilityImpl extends AbstractCapability { private final TCapability capability; - /** * Constructor * @@ -52,5 +50,4 @@ public String getName() { public QName getType() { return this.capability.getType(); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/DefinitionsImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/DefinitionsImpl.java similarity index 91% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/DefinitionsImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/DefinitionsImpl.java index 1a4fd8c7c..ac51eca66 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/DefinitionsImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/DefinitionsImpl.java @@ -48,7 +48,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class DefinitionsImpl extends AbstractDefinitions { @@ -69,13 +68,11 @@ public class DefinitionsImpl extends AbstractDefinitions { private List policyTemlates = null; /** - * Constructor with a Definitions file as File Object and all referenced File Artifacts as a File - * List + * Constructor with a Definitions file as File Object and all referenced File Artifacts as a File List * - * @param mainDefFile the File of the TOSCA Definitions to load as DefinitionsImpl - * @param filesInCsar a list of Files referenced by the given Definitions - * @param isEntryDefinitions gives information whether the given definitions document is an entry - * definition + * @param mainDefFile the File of the TOSCA Definitions to load as DefinitionsImpl + * @param filesInCsar a list of Files referenced by the given Definitions + * @param isEntryDefinitions gives information whether the given definitions document is an entry definition */ public DefinitionsImpl(final AbstractFile mainDefFile, final Set filesInCsar, final boolean isEntryDefinitions) { @@ -110,12 +107,11 @@ public DefinitionsImpl(final AbstractFile mainDefFile, final Set f if (isEntryDefinitions) { updateDefinitionsReferences(this.allFoundDefinitions); } - } /** - * Resolves TOSCA Definitions imports for this DefinitionsImpl by initializing imported Definitions - * as another DefinitionsImpl each. + * Resolves TOSCA Definitions imports for this DefinitionsImpl by initializing imported Definitions as another + * DefinitionsImpl each. * * @return a List of Files of the resolved, referenced Definitions */ @@ -125,7 +121,7 @@ private List resolveImportedDefinitions() { if (this.definitions.getImport() != null) { for (final TImport imported : this.definitions.getImport()) { DefinitionsImpl.LOG.debug("Check import element with namespace: {} location: {} importType: {}", - imported.getNamespace(), imported.getLocation(), imported.getImportType()); + imported.getNamespace(), imported.getLocation(), imported.getImportType()); // check if importtype is tosca ns, the location is set (else // there's nothing to parse) and just for looks the string // shouldn't @@ -138,9 +134,7 @@ private List resolveImportedDefinitions() { // add it DefinitionsImpl.LOG.debug("Trying to add Definitions import"); importedDefinitions.add(getFileByLocation(imported.getLocation(), this.filesInCsar)); - } - } } return importedDefinitions; @@ -149,11 +143,9 @@ private List resolveImportedDefinitions() { /** * Searches through the given list of files, which contains the given location. * - * * @param location the location to look for as String - * @param files a List of Files to look trough - * @return if files.contains(file), where file.getPath().contains(location) is true, file is - * returned, else null + * @param files a List of Files to look trough + * @return if files.contains(file), where file.getPath().contains(location) is true, file is returned, else null */ private AbstractFile getFileByLocation(final String location, final Set files) { DefinitionsImpl.LOG.debug("Looking trough files to for given location: {}", location); @@ -214,8 +206,8 @@ public void addRelationshipType(final AbstractRelationshipType relationshipType) } /** - * Initializes the types and templates given by the internal JAXB model, into the higher level model - * of DefinitionsImpl + * Initializes the types and templates given by the internal JAXB model, into the higher level model of + * DefinitionsImpl */ private void initTypesAndTemplates() { for (final TExtensibleElements element : this.definitions.getServiceTemplateOrNodeTypeOrNodeTypeImplementation()) { @@ -256,7 +248,6 @@ private void initTypesAndTemplates() { } } } - } /** @@ -269,7 +260,7 @@ public void addPolicyType(final AbstractPolicyType policyType) { } /** - * <<<<<<< HEAD ======= Adds an AbstractPolicyTemplate to this DefinitionsImpl + * Adds an AbstractPolicyTemplate to this DefinitionsImpl * * @param policyTemplate an AbstractPolicyTemplate to add to this DefinitionsImpl */ @@ -278,7 +269,7 @@ public void addPolicyTemplate(final AbstractPolicyTemplate policyTemplate) { } /** - * >>>>>>> master Adds an AbstractArtifactTemplate to this DefinitionsImpl + * Adds an AbstractArtifactTemplate to this DefinitionsImpl * * @param artifactTemplate an AbstractArtifactTemplate to add to this DefinitionsImpl */ @@ -350,8 +341,8 @@ public String getTargetNamespace() { * {@inheritDoc} */ @Override - public List getImportedDefinitions() { - return (List) (List) this.referencedDefinitions; + public List getImportedDefinitions() { + return this.referencedDefinitions; } /** @@ -368,12 +359,10 @@ private Definitions parseDefinitionsFile(final AbstractFile file) { final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); DefinitionsImpl.LOG.debug("Trying to parse file {} into JAXB object", file.getPath()); def = (Definitions) unmarshaller.unmarshal(new InputStreamReader(file.getFileAsInputStream())); - } - catch (final JAXBException e) { + } catch (final JAXBException e) { DefinitionsImpl.LOG.error("Error while parsing file, maybe file is not a TOSCA Defintions File", e); return null; - } - catch (final SystemException e) { + } catch (final SystemException e) { // TODO Auto-generated catch block LOG.error("Exception within Core", e); return null; @@ -432,8 +421,7 @@ public File getAbsolutePathOfArtifactReference(final AbstractArtifactReference r if (file.getPath().contains(path)) { try { return file.getFile().toFile(); - } - catch (final SystemException e) { + } catch (final SystemException e) { LOG.error("Exception within core", e); } } @@ -442,8 +430,7 @@ public File getAbsolutePathOfArtifactReference(final AbstractArtifactReference r } /** - * Tries to find all definitions recursively trough imported definitions by this definitions - * document + * Tries to find all definitions recursively trough imported definitions by this definitions document * * @return a Set of DefinitionsImpl */ @@ -501,8 +488,8 @@ protected List getAllPolicyTypes() { } /** - * <<<<<<< HEAD ======= Returns a List of all policyTemplates in the current csar context of this - * definitions document + * <<<<<<< HEAD ======= Returns a List of all policyTemplates in the current csar context of this definitions + * document * * @return a List of PolicyTemplates */ @@ -515,8 +502,7 @@ protected List getAllPolicyTemplates() { } /** - * >>>>>>> master Returns a List of all nodeTypes in the current csar context of this definitions - * document + * >>>>>>> master Returns a List of all nodeTypes in the current csar context of this definitions document * * @return a List of AbstractNodeType */ diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/DeploymentArtifactImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/DeploymentArtifactImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/DeploymentArtifactImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/DeploymentArtifactImpl.java index ac8df46f7..048cc5ae6 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/DeploymentArtifactImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/DeploymentArtifactImpl.java @@ -14,10 +14,48 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class DeploymentArtifactImpl extends AbstractDeploymentArtifact { + private final DefinitionsImpl def; + + private final TDeploymentArtifact artifact; + + /** + * Constructor + * + * @param artifact A JAXB TDeploymentArtifact + * @param definitions a DefinitionsImpl + */ + public DeploymentArtifactImpl(final TDeploymentArtifact artifact, final DefinitionsImpl definitions) { + this.def = definitions; + this.artifact = artifact; + } + + /** + * {@inheritDoc} + */ + @Override + public QName getArtifactType() { + return this.artifact.getArtifactType(); + } + + /** + * {@inheritDoc} + */ + @Override + public AbstractArtifactTemplate getArtifactRef() { + return this.def.getArtifactTemplate(this.artifact.getArtifactRef()); + } + + /** + * {@inheritDoc} + */ + @Override + public String getName() { + return this.artifact.getName(); + } + @Override public int hashCode() { final int prime = 31; @@ -63,43 +101,4 @@ public boolean equals(final Object obj) { } return true; } - - private final DefinitionsImpl def; - private final TDeploymentArtifact artifact; - - - /** - * Constructor - * - * @param artifact A JAXB TDeploymentArtifact - * @param definitions a DefinitionsImpl - */ - public DeploymentArtifactImpl(final TDeploymentArtifact artifact, final DefinitionsImpl definitions) { - this.def = definitions; - this.artifact = artifact; - } - - /** - * {@inheritDoc} - */ - @Override - public QName getArtifactType() { - return this.artifact.getArtifactType(); - } - - /** - * {@inheritDoc} - */ - @Override - public AbstractArtifactTemplate getArtifactRef() { - return this.def.getArtifactTemplate(this.artifact.getArtifactRef()); - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return this.artifact.getName(); - } } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ImplementationArtifactImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ImplementationArtifactImpl.java similarity index 90% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ImplementationArtifactImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ImplementationArtifactImpl.java index eb99c503e..56567ff92 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ImplementationArtifactImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ImplementationArtifactImpl.java @@ -12,14 +12,12 @@ /** *

    - * This class implements a TOSCA ImplementationArtifact, in particular an - * AbstractImplementationArtifact + * This class implements a TOSCA ImplementationArtifact, in particular an AbstractImplementationArtifact *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class ImplementationArtifactImpl extends AbstractImplementationArtifact { @@ -27,11 +25,10 @@ public class ImplementationArtifactImpl extends AbstractImplementationArtifact { private final DefinitionsImpl defs; private final List additionalElements; - /** * Constructor * - * @param artifact a JAXB TImplementationArtifact + * @param artifact a JAXB TImplementationArtifact * @param definitions a DefinitionsImpl */ public ImplementationArtifactImpl(final TImplementationArtifact artifact, final DefinitionsImpl definitions) { @@ -91,7 +88,7 @@ public AbstractArtifactTemplate getArtifactRef() { @Override public String getName() { // TODO there is a bug in the schema, there is no name attribute defined - // "name" is now interfacename_operationname + // "name" is now interfacename_operationname return this.artifact.getInterfaceName() + "_" + this.artifact.getOperationName(); } @@ -102,5 +99,4 @@ public String getName() { public List getAdditionalElements() { return this.additionalElements; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/InterfaceImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/InterfaceImpl.java similarity index 93% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/InterfaceImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/InterfaceImpl.java index d774f8802..5435a0439 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/InterfaceImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/InterfaceImpl.java @@ -16,7 +16,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class InterfaceImpl extends AbstractInterface { @@ -24,12 +23,11 @@ public class InterfaceImpl extends AbstractInterface { private final TInterface inter; private final List operations; - /** * Constructor * * @param definitions a DefinitionsImpl - * @param a JAXB TInterface + * @param a JAXB TInterface */ public InterfaceImpl(final DefinitionsImpl definitions, final TInterface i) { this.inter = i; @@ -62,5 +60,4 @@ public List getOperations() { public String getName() { return this.inter.getName(); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTemplateImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTemplateImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTemplateImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTemplateImpl.java index 9205beea4..562ad1a0d 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTemplateImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTemplateImpl.java @@ -30,7 +30,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class NodeTemplateImpl extends AbstractNodeTemplate { @@ -50,7 +49,7 @@ public class NodeTemplateImpl extends AbstractNodeTemplate { * Constructor * * @param nodeTemplate a JAXB TNodeTemplate - * @param definitions a DefinitionsImpl + * @param definitions a DefinitionsImpl */ public NodeTemplateImpl(final TNodeTemplate nodeTemplate, final DefinitionsImpl definitions) { this.nodeTemplate = nodeTemplate; @@ -85,7 +84,7 @@ private void setUpPolicies() { private void setUpDeploymentArtifacts() { if (this.nodeTemplate.getDeploymentArtifacts() != null) { for (final TDeploymentArtifact artifact : this.nodeTemplate.getDeploymentArtifacts() - .getDeploymentArtifact()) { + .getDeploymentArtifact()) { this.das.add(new DeploymentArtifactImpl(artifact, this.definitions)); } } @@ -261,7 +260,6 @@ private List findNodeTypeImpls(final AbstractDef } else { currentDef = null; } - } return impls; } @@ -288,10 +286,9 @@ public int getMinInstances() { public List getPolicies() { return this.policies; } - + @Override public String toString() { - return " Id: " + this.getId() + " Name: " + this.getName() + "Def: " + this.definitions.getId(); + return String.format(" Id: %s Name: %s Def: %s", getId(), getName(), definitions.getId()); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTypeImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTypeImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTypeImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTypeImpl.java index d2d6f8c83..37e824493 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTypeImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTypeImpl.java @@ -19,7 +19,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class NodeTypeImpl extends AbstractNodeType { @@ -27,11 +26,10 @@ public class NodeTypeImpl extends AbstractNodeType { private final DefinitionsImpl definitions; private final List interfaces; - /** * Constructor * - * @param nodeType a JAXB TNodeType + * @param nodeType a JAXB TNodeType * @param definitionsImpl a DefinitionsImpl */ public NodeTypeImpl(final TNodeType nodeType, final DefinitionsImpl definitionsImpl) { @@ -64,7 +62,6 @@ public AbstractNodeType getTypeRef() { return nodeType; } } - } return null; } @@ -119,5 +116,4 @@ public List getAdditionalElements() { return nodes; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTypeImplementationImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTypeImplementationImpl.java similarity index 88% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTypeImplementationImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTypeImplementationImpl.java index d0c644d5d..22808a55d 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/NodeTypeImplementationImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/NodeTypeImplementationImpl.java @@ -20,14 +20,12 @@ /** *

    - * This class implements a TOSCA NodeTypeImplementation, in particular an - * AbstractNodeTypeImplementation + * This class implements a TOSCA NodeTypeImplementation, in particular an AbstractNodeTypeImplementation *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class NodeTypeImplementationImpl extends AbstractNodeTypeImplementation { @@ -39,11 +37,10 @@ public class NodeTypeImplementationImpl extends AbstractNodeTypeImplementation { private final List ias; private final List das; - /** * Constructor * - * @param nodeTypeImpl a JAXB TNodeTypeImplementation + * @param nodeTypeImpl a JAXB TNodeTypeImplementation * @param definitionsImpl a DefinitionsImpl */ public NodeTypeImplementationImpl(final TNodeTypeImplementation nodeTypeImpl, @@ -66,7 +63,7 @@ public NodeTypeImplementationImpl(final TNodeTypeImplementation nodeTypeImpl, private void initIas() { if (this.nodeTypeImpl.getImplementationArtifacts() != null) { for (final TImplementationArtifact artifact : this.nodeTypeImpl.getImplementationArtifacts() - .getImplementationArtifact()) { + .getImplementationArtifact()) { this.ias.add(new ImplementationArtifactImpl(artifact, this.definitions)); } } @@ -78,7 +75,7 @@ private void initIas() { private void initDas() { if (this.nodeTypeImpl.getDeploymentArtifacts() != null) { for (final TDeploymentArtifact artifact : this.nodeTypeImpl.getDeploymentArtifacts() - .getDeploymentArtifact()) { + .getDeploymentArtifact()) { this.das.add(new DeploymentArtifactImpl(artifact, this.definitions)); } } @@ -143,7 +140,7 @@ public List getRequiredContainerFeatures() { // TODO make this non-hacky final List features = new ArrayList<>(); for (final TRequiredContainerFeature feature : this.nodeTypeImpl.getRequiredContainerFeatures() - .getRequiredContainerFeature()) { + .getRequiredContainerFeature()) { features.add(feature.getFeature()); } return features; @@ -181,7 +178,7 @@ public List getDeploymentArtifacts() { public AbstractNodeType getNodeType() { if (this.nodeTypeImpl.getNodeType() == null) { NodeTypeImplementationImpl.LOG.error("NodeTypeImplementation {} has no defined nodeType", - "{" + this.getTargetNamespace() + "}" + this.getName()); + "{" + this.getTargetNamespace() + "}" + this.getName()); } for (final AbstractNodeType nodeType : this.definitions.getAllNodeTypes()) { if (nodeType.getId().equals(this.nodeTypeImpl.getNodeType())) { @@ -190,5 +187,4 @@ public AbstractNodeType getNodeType() { } return null; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/OperationImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/OperationImpl.java similarity index 92% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/OperationImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/OperationImpl.java index 664c8ecfe..56ad49596 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/OperationImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/OperationImpl.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.List; -import org.oasis_open.docs.tosca.ns._2011._12.TInterface; import org.oasis_open.docs.tosca.ns._2011._12.TOperation; import org.oasis_open.docs.tosca.ns._2011._12.TParameter; import org.opentosca.planbuilder.model.tosca.AbstractInterface; @@ -18,27 +17,25 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class OperationImpl extends AbstractOperation { private final DefinitionsImpl defs; private final InterfaceImpl iface; - private final TOperation operation; + private final TOperation operation; private final List inputParameters; private final List outputParameters; - /** * Constructor * - * @param defs a DefinitionsImpl + * @param defs a DefinitionsImpl * @param operation a JAXB TOperation */ public OperationImpl(final DefinitionsImpl defs, final InterfaceImpl iface, final TOperation operation) { this.defs = defs; this.iface = iface; - this.operation = operation; + this.operation = operation; this.inputParameters = new ArrayList<>(); this.outputParameters = new ArrayList<>(); this.setUp(); @@ -142,5 +139,4 @@ public boolean equals(final Object obj) { public AbstractInterface getInterface() { return this.iface; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ParameterImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ParameterImpl.java similarity index 92% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ParameterImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ParameterImpl.java index 650a9e221..c5b546d9a 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ParameterImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ParameterImpl.java @@ -11,18 +11,16 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class ParameterImpl extends AbstractParameter { private final DefinitionsImpl defs; private final TParameter parameter; - /** * Constructur * - * @param defs a DefinitionsImpl + * @param defs a DefinitionsImpl * @param parameter a JAXB TParameter */ public ParameterImpl(final DefinitionsImpl defs, final TParameter parameter) { @@ -53,5 +51,4 @@ public boolean isRequired() { public String getType() { return this.parameter.getType(); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PolicyImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PolicyImpl.java similarity index 99% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PolicyImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PolicyImpl.java index 76aa15f1a..e4ca41446 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PolicyImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PolicyImpl.java @@ -42,7 +42,6 @@ public AbstractPolicyType getType() { if (policyType.getId().equals(this.policy.getPolicyType())) { return policyType; } - } return null; } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PolicyTemplateImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PolicyTemplateImpl.java similarity index 100% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PolicyTemplateImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PolicyTemplateImpl.java diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PolicyTypeImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PolicyTypeImpl.java similarity index 100% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PolicyTypeImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PolicyTypeImpl.java diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PropertiesImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PropertiesImpl.java similarity index 96% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PropertiesImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PropertiesImpl.java index 67a375fc6..cb026f4f9 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PropertiesImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PropertiesImpl.java @@ -15,14 +15,12 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class PropertiesImpl extends AbstractProperties { private Object props = null; private boolean isDOM = false; - /** * Constructor * @@ -57,5 +55,4 @@ public Map asMap() { } return properties; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PropertyMappingImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PropertyMappingImpl.java similarity index 95% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PropertyMappingImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PropertyMappingImpl.java index d29196aa5..43ad3e4db 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/PropertyMappingImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/PropertyMappingImpl.java @@ -13,13 +13,11 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class PropertyMappingImpl extends AbstractPropertyMapping { private final TPropertyMapping mapping; - /** * Constructor * @@ -59,5 +57,4 @@ public String getTargetObjectRef() { public String getTargetPropertyRef() { return this.mapping.getTargetPropertyRef(); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTemplateImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTemplateImpl.java similarity index 92% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTemplateImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTemplateImpl.java index cb535b65a..09237e157 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTemplateImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTemplateImpl.java @@ -45,7 +45,6 @@ public class RelationshipTemplateImpl extends AbstractRelationshipTemplate { private AbstractCapability targetCapability = null; private AbstractProperties properties = null; - /** * Constructor * @@ -59,7 +58,6 @@ public RelationshipTemplateImpl(final TRelationshipTemplate relationshipTemplate if (this.relationshipTemplate.getProperties() != null) { this.properties = new PropertiesImpl(this.relationshipTemplate.getProperties().getAny()); } - } /** @@ -182,8 +180,8 @@ private AbstractRelationshipType searchRelationshipType(final QName type) { definitionsToLookTrough.addAll(definitions.getImportedDefinitions()); } } - // FIXME: this is cleary an error in definitions, but no mechanism to - // handle this right now, e.g. NoRelationshipTypeFoundException + // FIXME: this is clearly an error in definitions, but no mechanism to + // handle this right now, e.g. NoRelationshipTypeFoundException return null; } @@ -220,7 +218,6 @@ private List findRelationshipTypeImpls(f } else { currentDef = null; } - } return impls; } @@ -233,10 +230,8 @@ public AbstractProperties getProperties() { return this.properties; } - @Override public String toString() { - return " Id: " + this.getId() + " Name: " + this.getName() + "Def: " + this.definitions.getId() + "\n Source: " + this.getSource() + "\n Target: " + this.getTarget(); + return String.format(" Id: %s Name: %s Def: %s%n Source: %s%n Target: %s", getId(), getName(), definitions.getId(), getSource(), getTarget()); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImpl.java similarity index 95% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImpl.java index 8abe4e892..7aae93eaf 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImpl.java @@ -18,7 +18,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class RelationshipTypeImpl extends AbstractRelationshipType { @@ -28,12 +27,11 @@ public class RelationshipTypeImpl extends AbstractRelationshipType { private final List sourceInterfaces; private final List targetInterfaces; - /** * Constructor * * @param relationshipType a JAXB TRelationshipType - * @param definitionsImpl a DefinitionsImpl + * @param definitionsImpl a DefinitionsImpl */ public RelationshipTypeImpl(final TRelationshipType relationshipType, final DefinitionsImpl definitionsImpl) { this.relationshipType = relationshipType; @@ -74,7 +72,6 @@ public QName getTypeRef() { return this.relationshipType.getDerivedFrom().getTypeRef(); } return null; - } /** @@ -121,7 +118,6 @@ public AbstractRelationshipType getReferencedType() { } } return null; - } /** @@ -147,5 +143,4 @@ public List getSourceInterfaces() { public List getTargetInterfaces() { return this.targetInterfaces; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImplementationImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImplementationImpl.java similarity index 89% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImplementationImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImplementationImpl.java index 67dc2d8bf..19eb5b270 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImplementationImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RelationshipTypeImplementationImpl.java @@ -16,14 +16,12 @@ /** *

    - * This class implements a TOSCA RelationshipTypeImplementation, particular an - * AbstractRelationshipTypeImplementation + * This class implements a TOSCA RelationshipTypeImplementation, particular an AbstractRelationshipTypeImplementation *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class RelationshipTypeImplementationImpl extends AbstractRelationshipTypeImplementation { @@ -32,12 +30,11 @@ public class RelationshipTypeImplementationImpl extends AbstractRelationshipType private final List ias; private final List tags; - /** * Constructor * * @param relationshipTypeImplementation a JAXB TRelationshipTypeImplementation - * @param definitionsImpl a DefinitionsImpl + * @param definitionsImpl a DefinitionsImpl */ public RelationshipTypeImplementationImpl(final TRelationshipTypeImplementation relationshipTypeImplementation, final DefinitionsImpl definitionsImpl) { @@ -54,7 +51,7 @@ public RelationshipTypeImplementationImpl(final TRelationshipTypeImplementation */ private void initIas() { for (final TImplementationArtifact artifact : this.relationshipTypeImpl.getImplementationArtifacts() - .getImplementationArtifact()) { + .getImplementationArtifact()) { this.ias.add(new ImplementationArtifactImpl(artifact, this.defs)); } } @@ -123,7 +120,7 @@ public List getRequiredContainerFeatures() { // TODO make this non-hacky final List features = new ArrayList<>(); for (final TRequiredContainerFeature feature : this.relationshipTypeImpl.getRequiredContainerFeatures() - .getRequiredContainerFeature()) { + .getRequiredContainerFeature()) { features.add(feature.getFeature()); } return features; @@ -152,5 +149,4 @@ public QName getDerivedFrom() { public List getTags() { return this.tags; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RequirementImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RequirementImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RequirementImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RequirementImpl.java index 35f2f1be6..86521056c 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/RequirementImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/RequirementImpl.java @@ -13,13 +13,11 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class RequirementImpl extends AbstractRequirement { private final TRequirement requirement; - /** * Constructor * @@ -52,5 +50,4 @@ public String getId() { public QName getType() { return this.requirement.getType(); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ServiceTemplateImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ServiceTemplateImpl.java similarity index 93% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ServiceTemplateImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ServiceTemplateImpl.java index 86fd64b64..20fd56be0 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ServiceTemplateImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ServiceTemplateImpl.java @@ -24,7 +24,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class ServiceTemplateImpl extends AbstractServiceTemplate { @@ -34,7 +33,6 @@ public class ServiceTemplateImpl extends AbstractServiceTemplate { private AbstractTopologyTemplate topologyTemplate = null; private DefinitionsImpl definitions = null; - /** * Constructor * @@ -136,15 +134,14 @@ public boolean hasBuildPlan() { final TPlans plans = this.serviceTemplate.getPlans(); final List plans2 = plans.getPlan(); ServiceTemplateImpl.LOG.debug("Checking whether ServiceTemplate {} has no BuildPlan", - this.getQName().toString()); + this.getQName().toString()); for (final TPlan plan : plans.getPlan()) { ServiceTemplateImpl.LOG.debug("Checking Plan {} of Type {}", plan.getId(), plan.getPlanType()); if (plan.getPlanType().trim() - .equals("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan")) { + .equals("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan")) { return true; } } - } return false; } @@ -155,15 +152,14 @@ public boolean hasTerminationPlan() { final TPlans plans = this.serviceTemplate.getPlans(); final List plans2 = plans.getPlan(); ServiceTemplateImpl.LOG.debug("Checking whether ServiceTemplate {} has no TerminationPlan", - this.getQName().toString()); + this.getQName().toString()); for (final TPlan plan : plans.getPlan()) { ServiceTemplateImpl.LOG.debug("Checking Plan {} of Type {}", plan.getId(), plan.getPlanType()); if (plan.getPlanType().trim() - .equals("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/TerminationPlan")) { + .equals("http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/TerminationPlan")) { return true; } } - } return false; } @@ -184,5 +180,4 @@ public Map getTags() { return tags; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ServiceTemplatePropertiesImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ServiceTemplatePropertiesImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ServiceTemplatePropertiesImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ServiceTemplatePropertiesImpl.java index 4423ff2f7..2c0fbfc69 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/ServiceTemplatePropertiesImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/ServiceTemplatePropertiesImpl.java @@ -11,21 +11,18 @@ /** *

    - * This class implements TOSCA Properties for ServiceTemplates, in particular - * AbstractServiceTemplateProperties + * This class implements TOSCA Properties for ServiceTemplates, in particular AbstractServiceTemplateProperties *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class ServiceTemplatePropertiesImpl extends AbstractServiceTemplateProperties { private final Properties properties; private final List propMappings; - /** * Constructor * @@ -68,5 +65,4 @@ public AbstractProperties getProperties() { return null; } } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/TagImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/TagImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/TagImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/TagImpl.java index 1c4171a70..67bbbb927 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/TagImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/TagImpl.java @@ -11,13 +11,11 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class TagImpl extends AbstractTag { private final TTag tag; - /** * Constructor * @@ -42,5 +40,4 @@ public String getName() { public String getValue() { return this.tag.getValue(); } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/TopologyTemplateImpl.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/TopologyTemplateImpl.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/TopologyTemplateImpl.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/TopologyTemplateImpl.java index 55ac07d33..a9fe2127a 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/importer/context/impl/TopologyTemplateImpl.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/importer/context/impl/TopologyTemplateImpl.java @@ -27,7 +27,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class TopologyTemplateImpl extends AbstractTopologyTemplate { @@ -39,25 +38,23 @@ public class TopologyTemplateImpl extends AbstractTopologyTemplate { private final List relationshipTemplates = new ArrayList<>(); private DefinitionsImpl definitions = null; - /** * Constructor * * @param topologyTemplate a JAXB TTopologyTemplate - * @param definitions a DefinitionsImpl + * @param definitions a DefinitionsImpl */ public TopologyTemplateImpl(final TTopologyTemplate topologyTemplate, final DefinitionsImpl definitions, final QName serviceTemplateId) { this.topologyTemplate = topologyTemplate; this.definitions = definitions; - this.serviceTemplateId = serviceTemplateId; + this.serviceTemplateId = serviceTemplateId; setUpTemplates(); setUpRelations(); } /** - * Initializes the relations between the NodeTemplates and RelationshipTemplates inside this - * TopologyTemplate + * Initializes the relations between the NodeTemplates and RelationshipTemplates inside this TopologyTemplate */ private void setUpRelations() { setUpRelationshipTemplates(); @@ -80,12 +77,12 @@ private void setUpRelationshipTemplates() { final TNodeTemplate source = (TNodeTemplate) temp._getSource(); if (source == null) { TopologyTemplateImpl.LOG.warn("Source NodeTemplate of RelationshipTemplate {} is null!", - temp.getId()); + temp.getId()); } final TNodeTemplate target = (TNodeTemplate) temp._getTarget(); if (target == null) { TopologyTemplateImpl.LOG.warn("Target NodeTemplate of RelationshipTemplate {} is null!", - temp.getId()); + temp.getId()); } for (final AbstractNodeTemplate nodetemplate : this.nodeTemplates) { if (source.getId().equals(nodetemplate.getId())) { @@ -135,7 +132,6 @@ private void setUpRelationshipTemplates() { } } } - } else { TopologyTemplateImpl.LOG.error("Error, relationshipTemplate {} has no defined source", temp.getId()); } @@ -204,7 +200,6 @@ private void setUpTemplates() { this.definitions)); } else if (element instanceof TNodeTemplate) { this.nodeTemplates.add(new NodeTemplateImpl((TNodeTemplate) element, this.definitions)); - } } } @@ -213,5 +208,4 @@ private void setUpTemplates() { public QName getServiceTemplateId() { return this.serviceTemplateId; } - } diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/integration/layer/AbstractExporter.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/integration/layer/AbstractExporter.java similarity index 94% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/integration/layer/AbstractExporter.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/integration/layer/AbstractExporter.java index 86fc34eba..daf6679f5 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/integration/layer/AbstractExporter.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/integration/layer/AbstractExporter.java @@ -8,7 +8,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractExporter { diff --git a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/integration/layer/AbstractImporter.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/integration/layer/AbstractImporter.java similarity index 82% rename from org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/integration/layer/AbstractImporter.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/integration/layer/AbstractImporter.java index b07feadb9..c2dfdd36a 100644 --- a/org.opentosca.planbuilder.integration/src/org/opentosca/planbuilder/integration/layer/AbstractImporter.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/java/org/opentosca/planbuilder/integration/layer/AbstractImporter.java @@ -6,7 +6,7 @@ import javax.xml.namespace.QName; -import org.opentosca.planbuilder.AbstractSimplePlanBuilder; +import org.opentosca.planbuilder.core.AbstractSimplePlanBuilder; import org.opentosca.planbuilder.core.bpel.typebasedplanbuilder.BPELBackupManagementProcessBuilder; import org.opentosca.planbuilder.core.bpel.typebasedplanbuilder.BPELBuildProcessBuilder; import org.opentosca.planbuilder.core.bpel.typebasedplanbuilder.BPELDefrostProcessBuilder; @@ -16,6 +16,7 @@ import org.opentosca.planbuilder.core.bpel.typebasedplanbuilder.BPELTerminationProcessBuilder; import org.opentosca.planbuilder.core.bpel.typebasedplanbuilder.BPELTestManagementProcessBuilder; import org.opentosca.planbuilder.core.bpel.typebasedplanbuilder.BPELTransformationProcessBuilder; +import org.opentosca.planbuilder.core.plugins.registry.PluginRegistry; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; @@ -31,10 +32,14 @@ * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de * @author Jan Ruthardt - st107755@stud.uni-stuttgart.de - * */ public abstract class AbstractImporter { + private final PluginRegistry pluginRegistry; + + protected AbstractImporter(PluginRegistry pluginRegistry) { + this.pluginRegistry = pluginRegistry; + } protected AbstractPlan buildAdaptationPlan(final String csarName, final AbstractDefinitions definitions, final QName serviceTemplateId, @@ -42,11 +47,11 @@ protected AbstractPlan buildAdaptationPlan(final String csarName, final Abstract final Collection sourceRelationshipTemplates, final Collection targetNodeTemplates, final Collection targetRelationshipTemplates) { - final BPELTransformationProcessBuilder transformPlanBuilder = new BPELTransformationProcessBuilder(); + final BPELTransformationProcessBuilder transformPlanBuilder = new BPELTransformationProcessBuilder(pluginRegistry); return transformPlanBuilder.buildPlan(csarName, definitions, serviceTemplateId, sourceNodeTemplates, - sourceRelationshipTemplates, targetNodeTemplates, - targetRelationshipTemplates); + sourceRelationshipTemplates, targetNodeTemplates, + targetRelationshipTemplates); } protected List buildTransformationPlans(final String sourceCsarName, @@ -55,15 +60,12 @@ protected List buildTransformationPlans(final String sourceCsarNam final AbstractDefinitions targetDefinitions) { final List plans = new ArrayList<>(); - - final BPELTransformationProcessBuilder transformPlanBuilder = new BPELTransformationProcessBuilder(); + final BPELTransformationProcessBuilder transformPlanBuilder = new BPELTransformationProcessBuilder(pluginRegistry); plans.add(transformPlanBuilder.buildPlan(sourceCsarName, sourceDefinitions, - sourceDefinitions.getServiceTemplates().get(0).getQName(), - targetCsarName, targetDefinitions, - targetDefinitions.getServiceTemplates().get(0).getQName())); - - + sourceDefinitions.getServiceTemplates().get(0).getQName(), + targetCsarName, targetDefinitions, + targetDefinitions.getServiceTemplates().get(0).getQName())); return plans; } @@ -71,7 +73,7 @@ protected List buildTransformationPlans(final String sourceCsarNam /** * Generates Plans for ServiceTemplates inside the given Definitions document * - * @param defs an AbstractDefinitions + * @param defs an AbstractDefinitions * @param csarName the FileName of the CSAR the given Definitions is contained in * @return a List of Plans */ @@ -79,14 +81,13 @@ public List buildPlans(final AbstractDefinitions defs, final Strin final List plans = new ArrayList<>(); - AbstractSimplePlanBuilder buildPlanBuilder = new BPELBuildProcessBuilder(); - final BPELSituationAwareBuildProcessBuilder sitAwareBuilder = new BPELSituationAwareBuildProcessBuilder(); + AbstractSimplePlanBuilder buildPlanBuilder = new BPELBuildProcessBuilder(pluginRegistry); + final BPELSituationAwareBuildProcessBuilder sitAwareBuilder = new BPELSituationAwareBuildProcessBuilder(pluginRegistry); if (!sitAwareBuilder.buildPlans(csarName, defs).isEmpty()) { buildPlanBuilder = sitAwareBuilder; } - // FIXME: This does not work for me (Michael W. - 2018-02-19) // if (!this.hasPolicies(defs)) { // buildPlanBuilder = new BPELBuildProcessBuildeplanr(); @@ -97,18 +98,17 @@ public List buildPlans(final AbstractDefinitions defs, final Strin // if (!this.hasPolicies(defs)) { // buildPlanBuilder = new BPELBuildProcessBuilder(); // } else { - // buildPlanBuilder = new PolicyAwareBPELBuildProcessBuilder(); + // buildPlanBuilder = new BPELPolicyAwareBuildProcessBuilder(); // } - final AbstractSimplePlanBuilder terminationPlanBuilder = new BPELTerminationProcessBuilder(); - final AbstractSimplePlanBuilder scalingPlanBuilder = new BPELScaleOutProcessBuilder(); + final AbstractSimplePlanBuilder terminationPlanBuilder = new BPELTerminationProcessBuilder(pluginRegistry); + final AbstractSimplePlanBuilder scalingPlanBuilder = new BPELScaleOutProcessBuilder(pluginRegistry); - final AbstractSimplePlanBuilder freezePlanBuilder = new BPELFreezeProcessBuilder(); - final AbstractSimplePlanBuilder defreezePlanBuilder = new BPELDefrostProcessBuilder(); - - final AbstractSimplePlanBuilder backupPlanBuilder = new BPELBackupManagementProcessBuilder(); - final AbstractSimplePlanBuilder testPlanBuilder = new BPELTestManagementProcessBuilder(); + final AbstractSimplePlanBuilder freezePlanBuilder = new BPELFreezeProcessBuilder(pluginRegistry); + final AbstractSimplePlanBuilder defreezePlanBuilder = new BPELDefrostProcessBuilder(pluginRegistry); + final AbstractSimplePlanBuilder backupPlanBuilder = new BPELBackupManagementProcessBuilder(pluginRegistry); + final AbstractSimplePlanBuilder testPlanBuilder = new BPELTestManagementProcessBuilder(pluginRegistry); plans.addAll(scalingPlanBuilder.buildPlans(csarName, defs)); plans.addAll(buildPlanBuilder.buildPlans(csarName, defs)); @@ -131,5 +131,4 @@ private boolean hasPolicies(final AbstractDefinitions defs) { } return false; } - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/resources/spring/context-planbuilder-integration.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/resources/spring/context-planbuilder-integration.xml new file mode 100644 index 000000000..8e461857b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.integration/src/main/resources/spring/context-planbuilder-integration.xml @@ -0,0 +1,19 @@ + + + + Spring DI configuration for planbuilder + + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/pom.xml new file mode 100644 index 000000000..12c78e1cf --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.model + + + + commons-io + commons-io + 2.6 + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/FailureHandling.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/FailureHandling.java new file mode 100644 index 000000000..63070b32c --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/FailureHandling.java @@ -0,0 +1,101 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.activityrecovery; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType>
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <all>
    + *         <element name="retryFor" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    + *         <element name="retryDelay" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    + *         <element name="faultOnFailure" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *       </all>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + +}) +@XmlRootElement(name = "failureHandling") +public class FailureHandling { + + protected Integer retryFor; + protected Integer retryDelay; + protected Boolean faultOnFailure; + + /** + * Gets the value of the retryFor property. + * + * @return possible object is {@link Integer } + */ + public Integer getRetryFor() { + return this.retryFor; + } + + /** + * Sets the value of the retryFor property. + * + * @param value allowed object is {@link Integer } + */ + public void setRetryFor(final Integer value) { + this.retryFor = value; + } + + /** + * Gets the value of the retryDelay property. + * + * @return possible object is {@link Integer } + */ + public Integer getRetryDelay() { + return this.retryDelay; + } + + /** + * Sets the value of the retryDelay property. + * + * @param value allowed object is {@link Integer } + */ + public void setRetryDelay(final Integer value) { + this.retryDelay = value; + } + + /** + * Gets the value of the faultOnFailure property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isFaultOnFailure() { + return this.faultOnFailure; + } + + /** + * Sets the value of the faultOnFailure property. + * + * @param value allowed object is {@link Boolean } + */ + public void setFaultOnFailure(final Boolean value) { + this.faultOnFailure = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/ObjectFactory.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/ObjectFactory.java new file mode 100644 index 000000000..ede5d697e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/ObjectFactory.java @@ -0,0 +1,38 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.activityrecovery; + +import javax.xml.bind.annotation.XmlRegistry; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.apache.ode.activityrecovery package. + *

    + * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.apache.ode.activityrecovery + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link FailureHandling } + */ + public FailureHandling createFailureHandling() { + return new FailureHandling(); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/package-info.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/package-info.java new file mode 100644 index 000000000..0c7e3f326 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/activityrecovery/package-info.java @@ -0,0 +1,11 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://ode.apache.org/activityRecovery", + elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.apache.ode.activityrecovery; diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java new file mode 100644 index 000000000..ff62cfbe4 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java @@ -0,0 +1,149 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.apache.ode.schemas.dd._2007._03 package. + *

    + * An ObjectFactory allows you to programatically construct new instances of the Java representation for XML content. + * The Java representation of XML content can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory methods for each of these are provided in + * this class. + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _Deploy_QNAME = new QName("http://www.apache.org/ode/schemas/dd/2007/03", "deploy"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.apache.ode.schemas.dd._2007._03 + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link TCleanup } + */ + public TCleanup createTCleanup() { + return new TCleanup(); + } + + /** + * Create an instance of {@link TEnableSharing } + */ + public TEnableSharing createTEnableSharing() { + return new TEnableSharing(); + } + + /** + * Create an instance of {@link TDeployment } + */ + public TDeployment createTDeployment() { + return new TDeployment(); + } + + /** + * Create an instance of {@link TProvide } + */ + public TProvide createTProvide() { + return new TProvide(); + } + + /** + * Create an instance of {@link TProcessEvents } + */ + public TProcessEvents createTProcessEvents() { + return new TProcessEvents(); + } + + /** + * Create an instance of {@link TService } + */ + public TService createTService() { + return new TService(); + } + + /** + * Create an instance of {@link TSchedule } + */ + public TSchedule createTSchedule() { + return new TSchedule(); + } + + /** + * Create an instance of {@link TDeployment.Process.MexInterceptors } + */ + public TDeployment.Process.MexInterceptors createTDeploymentProcessMexInterceptors() { + return new TDeployment.Process.MexInterceptors(); + } + + /** + * Create an instance of {@link TInvoke.Binding } + */ + public TInvoke.Binding createTInvokeBinding() { + return new TInvoke.Binding(); + } + + /** + * Create an instance of {@link TDeployment.Process } + */ + public TDeployment.Process createTDeploymentProcess() { + return new TDeployment.Process(); + } + + /** + * Create an instance of {@link TEnableEventList } + */ + public TEnableEventList createTEnableEventList() { + return new TEnableEventList(); + } + + /** + * Create an instance of {@link TMexInterceptor } + */ + public TMexInterceptor createTMexInterceptor() { + return new TMexInterceptor(); + } + + /** + * Create an instance of {@link TDeployment.Process.Property } + */ + public TDeployment.Process.Property createTDeploymentProcessProperty() { + return new TDeployment.Process.Property(); + } + + /** + * Create an instance of {@link TScopeEvents } + */ + public TScopeEvents createTScopeEvents() { + return new TScopeEvents(); + } + + /** + * Create an instance of {@link TInvoke } + */ + public TInvoke createTInvoke() { + return new TInvoke(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TDeployment }{@code >}} + */ + @XmlElementDecl(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", name = "deploy") + public JAXBElement createDeploy(final TDeployment value) { + return new JAXBElement<>(_Deploy_QNAME, TDeployment.class, null, value); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java new file mode 100644 index 000000000..3da21c8b2 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java @@ -0,0 +1,139 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tCleanup complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tCleanup">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="category" maxOccurs="unbounded" minOccurs="0">
    + *           <simpleType>
    + *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *               <enumeration value="instance"/>
    + *               <enumeration value="variables"/>
    + *               <enumeration value="messages"/>
    + *               <enumeration value="correlations"/>
    + *               <enumeration value="events"/>
    + *               <enumeration value="all"/>
    + *             </restriction>
    + *           </simpleType>
    + *         </element>
    + *         <element name="filter" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="on">
    + *         <simpleType>
    + *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *             <enumeration value="success"/>
    + *             <enumeration value="failure"/>
    + *             <enumeration value="always"/>
    + *           </restriction>
    + *         </simpleType>
    + *       </attribute>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tCleanup", propOrder = {"category", "filter"}) +public class TCleanup { + + @XmlElement(defaultValue = "all") + protected List category; + protected List filter; + @XmlAttribute + protected String on; + + /** + * Gets the value of the category property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the category property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getCategory().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getCategory() { + if (this.category == null) { + this.category = new ArrayList<>(); + } + return this.category; + } + + /** + * Gets the value of the filter property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the filter property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getFilter().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getFilter() { + if (this.filter == null) { + this.filter = new ArrayList<>(); + } + return this.filter; + } + + /** + * Gets the value of the on property. + * + * @return possible object is {@link String } + */ + public String getOn() { + return this.on; + } + + /** + * Sets the value of the on property. + * + * @param value allowed object is {@link String } + */ + public void setOn(final String value) { + this.on = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java new file mode 100644 index 000000000..975e4fe92 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java @@ -0,0 +1,619 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tDeployment complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tDeployment">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="process" maxOccurs="unbounded" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="property" maxOccurs="unbounded" minOccurs="0">
    + *                     <complexType>
    + *                       <complexContent>
    + *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                           <sequence>
    + *                             <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    + *                           </sequence>
    + *                           <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *                         </restriction>
    + *                       </complexContent>
    + *                     </complexType>
    + *                   </element>
    + *                   <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    + *                   <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    + *                   <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    + *                   <element name="mex-interceptors" minOccurs="0">
    + *                     <complexType>
    + *                       <complexContent>
    + *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                           <sequence>
    + *                             <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    + *                           </sequence>
    + *                         </restriction>
    + *                       </complexContent>
    + *                     </complexType>
    + *                   </element>
    + *                   <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    + *                   <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    + *                   <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    + *                 </sequence>
    + *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *                 <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *                 <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tDeployment", propOrder = {"process"}) +public class TDeployment { + + protected List process; + + /** + * Gets the value of the process property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the process property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getProcess().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TDeployment.Process } + */ + public List getProcess() { + if (this.process == null) { + this.process = new ArrayList<>(); + } + return this.process; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="property" maxOccurs="unbounded" minOccurs="0">
    +     *           <complexType>
    +     *             <complexContent>
    +     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *                 <sequence>
    +     *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    +     *                 </sequence>
    +     *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *               </restriction>
    +     *             </complexContent>
    +     *           </complexType>
    +     *         </element>
    +     *         <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    +     *         <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    +     *         <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    +     *         <element name="mex-interceptors" minOccurs="0">
    +     *           <complexType>
    +     *             <complexContent>
    +     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *                 <sequence>
    +     *                   <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    +     *                 </sequence>
    +     *               </restriction>
    +     *             </complexContent>
    +     *           </complexType>
    +     *         </element>
    +     *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    +     *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    +     *         <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    +     *       </sequence>
    +     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *       <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    +     *       <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"active", "retired", "inMemory", "property", "processEvents", "provide", "invoke", + "mexInterceptors", "type", "cleanup", "schedule"}) + public static class Process { + + @XmlElement(defaultValue = "true") + protected Boolean active; + @XmlElement(defaultValue = "false") + protected Boolean retired; + @XmlElement(name = "in-memory", defaultValue = "false") + protected Boolean inMemory; + protected List property; + @XmlElement(name = "process-events") + protected TProcessEvents processEvents; + protected List provide; + protected List invoke; + @XmlElement(name = "mex-interceptors") + protected TDeployment.Process.MexInterceptors mexInterceptors; + protected QName type; + protected List cleanup; + protected List schedule; + @XmlAttribute(required = true) + protected QName name; + @XmlAttribute + protected String fileName; + @XmlAttribute(name = "bpel11wsdlFileName") + protected String bpel11WsdlFileName; + + /** + * Gets the value of the active property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isActive() { + return this.active; + } + + /** + * Sets the value of the active property. + * + * @param value allowed object is {@link Boolean } + */ + public void setActive(final Boolean value) { + this.active = value; + } + + /** + * Gets the value of the retired property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isRetired() { + return this.retired; + } + + /** + * Sets the value of the retired property. + * + * @param value allowed object is {@link Boolean } + */ + public void setRetired(final Boolean value) { + this.retired = value; + } + + /** + * Gets the value of the inMemory property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isInMemory() { + return this.inMemory; + } + + /** + * Sets the value of the inMemory property. + * + * @param value allowed object is {@link Boolean } + */ + public void setInMemory(final Boolean value) { + this.inMemory = value; + } + + /** + * Gets the value of the property property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the property property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getProperty().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TDeployment.Process.Property } + */ + public List getProperty() { + if (this.property == null) { + this.property = new ArrayList<>(); + } + return this.property; + } + + /** + * Gets the value of the processEvents property. + * + * @return possible object is {@link TProcessEvents } + */ + public TProcessEvents getProcessEvents() { + return this.processEvents; + } + + /** + * Sets the value of the processEvents property. + * + * @param value allowed object is {@link TProcessEvents } + */ + public void setProcessEvents(final TProcessEvents value) { + this.processEvents = value; + } + + /** + * Gets the value of the provide property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the provide property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getProvide().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TProvide } + */ + public List getProvide() { + if (this.provide == null) { + this.provide = new ArrayList<>(); + } + return this.provide; + } + + /** + * Gets the value of the invoke property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the invoke property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getInvoke().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TInvoke } + */ + public List getInvoke() { + if (this.invoke == null) { + this.invoke = new ArrayList<>(); + } + return this.invoke; + } + + /** + * Gets the value of the mexInterceptors property. + * + * @return possible object is {@link TDeployment.Process.MexInterceptors } + */ + public TDeployment.Process.MexInterceptors getMexInterceptors() { + return this.mexInterceptors; + } + + /** + * Sets the value of the mexInterceptors property. + * + * @param value allowed object is {@link TDeployment.Process.MexInterceptors } + */ + public void setMexInterceptors(final TDeployment.Process.MexInterceptors value) { + this.mexInterceptors = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link QName } + */ + public QName getType() { + return this.type; + } + + /** + * Sets the value of the type property. + * + * @param value allowed object is {@link QName } + */ + public void setType(final QName value) { + this.type = value; + } + + /** + * Gets the value of the cleanup property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the cleanup property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getCleanup().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCleanup } + */ + public List getCleanup() { + if (this.cleanup == null) { + this.cleanup = new ArrayList<>(); + } + return this.cleanup; + } + + /** + * Gets the value of the schedule property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the schedule property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +         * getSchedule().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TSchedule } + */ + public List getSchedule() { + if (this.schedule == null) { + this.schedule = new ArrayList<>(); + } + return this.schedule; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(final QName value) { + this.name = value; + } + + /** + * Gets the value of the fileName property. + * + * @return possible object is {@link String } + */ + public String getFileName() { + return this.fileName; + } + + /** + * Sets the value of the fileName property. + * + * @param value allowed object is {@link String } + */ + public void setFileName(final String value) { + this.fileName = value; + } + + /** + * Gets the value of the bpel11WsdlFileName property. + * + * @return possible object is {@link String } + */ + public String getBpel11WsdlFileName() { + return this.bpel11WsdlFileName; + } + + /** + * Sets the value of the bpel11WsdlFileName property. + * + * @param value allowed object is {@link String } + */ + public void setBpel11WsdlFileName(final String value) { + this.bpel11WsdlFileName = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +         * <complexType>
    +         *   <complexContent>
    +         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +         *       <sequence>
    +         *         <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    +         *       </sequence>
    +         *     </restriction>
    +         *   </complexContent>
    +         * </complexType>
    +         * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"mexInterceptor"}) + public static class MexInterceptors { + + @XmlElement(name = "mex-interceptor") + protected List mexInterceptor; + + /** + * Gets the value of the mexInterceptor property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a + * set method for the mexInterceptor property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +             * getMexInterceptor().add(newItem);
    +             * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TMexInterceptor } + */ + public List getMexInterceptor() { + if (this.mexInterceptor == null) { + this.mexInterceptor = new ArrayList<>(); + } + return this.mexInterceptor; + } + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +         * <complexType>
    +         *   <complexContent>
    +         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +         *       <sequence>
    +         *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    +         *       </sequence>
    +         *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +         *     </restriction>
    +         *   </complexContent>
    +         * </complexType>
    +         * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"any"}) + public static class Property { + + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(required = true) + protected QName name; + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a + * set method for the any property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +             * getAny().add(newItem);
    +             * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (this.any == null) { + this.any = new ArrayList<>(); + } + return this.any; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(final QName value) { + this.name = value; + } + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java new file mode 100644 index 000000000..4128b9b6d --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java @@ -0,0 +1,72 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tEnableEventList complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tEnableEventList">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="enable-event" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tEnableEventList", propOrder = {"enableEvent"}) +@XmlSeeAlso( {TProcessEvents.class, TScopeEvents.class}) +public class TEnableEventList { + + @XmlElement(name = "enable-event") + protected List enableEvent; + + /** + * Gets the value of the enableEvent property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the enableEvent property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getEnableEvent().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getEnableEvent() { + if (this.enableEvent == null) { + this.enableEvent = new ArrayList<>(); + } + return this.enableEvent; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java new file mode 100644 index 000000000..9cd3577f9 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java @@ -0,0 +1,35 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tEnableSharing complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tEnableSharing">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tEnableSharing") +public class TEnableSharing { + +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java new file mode 100644 index 000000000..8b07298cb --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java @@ -0,0 +1,201 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +import org.apache.ode.activityrecovery.FailureHandling; + +/** + *

    + * Java class for tInvoke complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tInvoke">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    + *         <element name="binding" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element ref="{http://ode.apache.org/activityRecovery}failureHandling" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="usePeer2Peer" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tInvoke", propOrder = {"service", "binding", "failureHandling"}) +public class TInvoke { + + @XmlElement(required = true) + protected TService service; + protected TInvoke.Binding binding; + @XmlElement(namespace = "http://ode.apache.org/activityRecovery") + protected FailureHandling failureHandling; + @XmlAttribute(required = true) + protected String partnerLink; + @XmlAttribute + protected Boolean usePeer2Peer; + + /** + * Gets the value of the service property. + * + * @return possible object is {@link TService } + */ + public TService getService() { + return this.service; + } + + /** + * Sets the value of the service property. + * + * @param value allowed object is {@link TService } + */ + public void setService(final TService value) { + this.service = value; + } + + /** + * Gets the value of the binding property. + * + * @return possible object is {@link TInvoke.Binding } + */ + public TInvoke.Binding getBinding() { + return this.binding; + } + + /** + * Sets the value of the binding property. + * + * @param value allowed object is {@link TInvoke.Binding } + */ + public void setBinding(final TInvoke.Binding value) { + this.binding = value; + } + + /** + * Gets the value of the failureHandling property. + * + * @return possible object is {@link FailureHandling } + */ + public FailureHandling getFailureHandling() { + return this.failureHandling; + } + + /** + * Sets the value of the failureHandling property. + * + * @param value allowed object is {@link FailureHandling } + */ + public void setFailureHandling(final FailureHandling value) { + this.failureHandling = value; + } + + /** + * Gets the value of the partnerLink property. + * + * @return possible object is {@link String } + */ + public String getPartnerLink() { + return this.partnerLink; + } + + /** + * Sets the value of the partnerLink property. + * + * @param value allowed object is {@link String } + */ + public void setPartnerLink(final String value) { + this.partnerLink = value; + } + + /** + * Gets the value of the usePeer2Peer property. + * + * @return possible object is {@link Boolean } + */ + public boolean isUsePeer2Peer() { + if (this.usePeer2Peer == null) { + return true; + } else { + return this.usePeer2Peer; + } + } + + /** + * Sets the value of the usePeer2Peer property. + * + * @param value allowed object is {@link Boolean } + */ + public void setUsePeer2Peer(final Boolean value) { + this.usePeer2Peer = value; + } + + /** + *

    + * Java class for anonymous complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Binding { + + @XmlAttribute(required = true) + protected QName name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(final QName value) { + this.name = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java new file mode 100644 index 000000000..94b56264b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java @@ -0,0 +1,62 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + * Message exchange interceptor configuration. + * + * + *

    + * Java class for tMexInterceptor complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tMexInterceptor">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="class-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tMexInterceptor", propOrder = {"className"}) +public class TMexInterceptor { + + @XmlElement(name = "class-name", required = true) + protected String className; + + /** + * Gets the value of the className property. + * + * @return possible object is {@link String } + */ + public String getClassName() { + return this.className; + } + + /** + * Sets the value of the className property. + * + * @param value allowed object is {@link String } + */ + public void setClassName(final String value) { + this.className = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java new file mode 100644 index 000000000..444683748 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java @@ -0,0 +1,99 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tProcessEvents complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tProcessEvents">
    + *   <complexContent>
    + *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    + *       <sequence>
    + *         <element name="scope-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tScopeEvents" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="generate">
    + *         <simpleType>
    + *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *             <enumeration value="all"/>
    + *             <enumeration value="none"/>
    + *           </restriction>
    + *         </simpleType>
    + *       </attribute>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tProcessEvents", propOrder = {"scopeEvents"}) +public class TProcessEvents extends TEnableEventList { + + @XmlElement(name = "scope-events") + protected List scopeEvents; + @XmlAttribute + protected String generate; + + /** + * Gets the value of the scopeEvents property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the scopeEvents property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getScopeEvents().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TScopeEvents } + */ + public List getScopeEvents() { + if (this.scopeEvents == null) { + this.scopeEvents = new ArrayList<>(); + } + return this.scopeEvents; + } + + /** + * Gets the value of the generate property. + * + * @return possible object is {@link String } + */ + public String getGenerate() { + return this.generate; + } + + /** + * Sets the value of the generate property. + * + * @param value allowed object is {@link String } + */ + public void setGenerate(final String value) { + this.generate = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProvide.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProvide.java new file mode 100644 index 000000000..0701c4b44 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TProvide.java @@ -0,0 +1,101 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tProvide complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tProvide">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    + *         <element name="enableSharing" type="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableSharing" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tProvide", propOrder = {"service", "enableSharing"}) +public class TProvide { + + @XmlElement(required = true) + protected TService service; + protected TEnableSharing enableSharing; + @XmlAttribute(required = true) + protected String partnerLink; + + /** + * Gets the value of the service property. + * + * @return possible object is {@link TService } + */ + public TService getService() { + return this.service; + } + + /** + * Sets the value of the service property. + * + * @param value allowed object is {@link TService } + */ + public void setService(final TService value) { + this.service = value; + } + + /** + * Gets the value of the enableSharing property. + * + * @return possible object is {@link TEnableSharing } + */ + public TEnableSharing getEnableSharing() { + return this.enableSharing; + } + + /** + * Sets the value of the enableSharing property. + * + * @param value allowed object is {@link TEnableSharing } + */ + public void setEnableSharing(final TEnableSharing value) { + this.enableSharing = value; + } + + /** + * Gets the value of the partnerLink property. + * + * @return possible object is {@link String } + */ + public String getPartnerLink() { + return this.partnerLink; + } + + /** + * Sets the value of the partnerLink property. + * + * @param value allowed object is {@link String } + */ + public void setPartnerLink(final String value) { + this.partnerLink = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java new file mode 100644 index 000000000..8fa6050b5 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java @@ -0,0 +1,90 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tSchedule complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tSchedule">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="when" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tSchedule", propOrder = {"cleanup"}) +public class TSchedule { + + protected List cleanup; + @XmlAttribute(required = true) + protected String when; + + /** + * Gets the value of the cleanup property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the cleanup property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getCleanup().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCleanup } + */ + public List getCleanup() { + if (this.cleanup == null) { + this.cleanup = new ArrayList<>(); + } + return this.cleanup; + } + + /** + * Gets the value of the when property. + * + * @return possible object is {@link String } + */ + public String getWhen() { + return this.when; + } + + /** + * Sets the value of the when property. + * + * @param value allowed object is {@link String } + */ + public void setWhen(final String value) { + this.when = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java new file mode 100644 index 000000000..b4ad43a32 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java @@ -0,0 +1,57 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    + * Java class for tScopeEvents complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tScopeEvents">
    + *   <complexContent>
    + *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tScopeEvents") +public class TScopeEvents extends TEnableEventList { + + @XmlAttribute(required = true) + protected String name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(final String value) { + this.name = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TService.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TService.java new file mode 100644 index 000000000..787c6440f --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/TService.java @@ -0,0 +1,121 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +/** + *

    + * Java class for tService complex type. + * + *

    + * The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tService">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="port" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tService", propOrder = {"any"}) +public class TService { + + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(required = true) + protected QName name; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String port; + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the any property. + * + *

    + * For example, to add a new item, do as follows: + * + *

    +     * getAny().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (this.any == null) { + this.any = new ArrayList<>(); + } + return this.any; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return this.name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(final QName value) { + this.name = value; + } + + /** + * Gets the value of the port property. + * + * @return possible object is {@link String } + */ + public String getPort() { + return this.port; + } + + /** + * Sets the value of the port property. + * + * @param value allowed object is {@link String } + */ + public void setPort(final String value) { + this.port = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/package-info.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/package-info.java new file mode 100644 index 000000000..538fd3093 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/apache/ode/schemas/dd/_2007/_03/package-info.java @@ -0,0 +1,11 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference +// Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", + elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package org.apache.ode.schemas.dd._2007._03; diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractActivity.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractActivity.java similarity index 99% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractActivity.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractActivity.java index c5155de5b..77cac46d3 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractActivity.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractActivity.java @@ -16,7 +16,7 @@ public String getId() { public ActivityType getType() { return this.type; - } + } @Override public boolean equals(Object obj) { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractPlan.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractPlan.java similarity index 88% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractPlan.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractPlan.java index b75676ec4..d60f5c0c1 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractPlan.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractPlan.java @@ -3,6 +3,7 @@ import java.util.Collection; import java.util.HashSet; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; @@ -13,30 +14,9 @@ *
    * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public abstract class AbstractPlan { - // general categories - public enum PlanType { - BUILD, MANAGE, TERMINATE, TRANSFORM; - - public String getString() { - switch (this) { - case BUILD: - return "http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/BuildPlan"; - case TERMINATE: - return "http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/TerminationPlan"; - case TRANSFORM: - return "http://opentosca.org/plantypes/TransformationPlan"; - default: - // every other plan is a management plan - case MANAGE: - return "http://docs.oasis-open.org/tosca/ns/2011/12/PlanTypes/ManagementPlan"; - } - } - } - public static class Link { private final AbstractActivity srcActiv; private final AbstractActivity trgActiv; @@ -58,13 +38,10 @@ public AbstractActivity getTrgActiv() { public String toString() { return "{Src: " + this.srcActiv.getId() + " Trgt: " + this.trgActiv.getId() + "}"; } - } private final AbstractServiceTemplate serviceTemplate; - private PlanType type; - private final AbstractDefinitions definitions; private final Collection activites; @@ -73,7 +50,9 @@ public String toString() { private final String id; - int internalCounterId = 0; + private PlanType type; + + private int internalCounterId = 0; public AbstractPlan(final String id, final PlanType type, final AbstractDefinitions definitions, final AbstractServiceTemplate serviceTemplate, final Collection activities, @@ -105,8 +84,8 @@ public void setType(final PlanType type) { } /** - * Returns the definitions document this AbstractPlan belongs to. The ServiceTemplate this BuildPlan - * provisions must be contained in the given AbstractDefinitions. + * Returns the definitions document this AbstractPlan belongs to. The ServiceTemplate this BuildPlan provisions must + * be contained in the given AbstractDefinitions. * * @return an AbstractDefinitions */ @@ -186,7 +165,6 @@ public Collection findNodeTemplateActivities(final AbstractNod foundActivities.add(activity); } } - } return foundActivities; } @@ -200,7 +178,6 @@ public Collection findRelationshipTemplateActivities(final Abs foundActivities.add(activity); } } - } return foundActivities; } @@ -251,5 +228,4 @@ public String toString() { return toString; } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractTransformationPlan.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractTransformationPlan.java similarity index 81% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractTransformationPlan.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractTransformationPlan.java index 88ffc5eac..c10cc82ec 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/AbstractTransformationPlan.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/AbstractTransformationPlan.java @@ -2,8 +2,8 @@ import java.util.Collection; import java.util.HashSet; -import java.util.Set; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; @@ -14,7 +14,6 @@ public class AbstractTransformationPlan extends AbstractPlan { private final AbstractDefinitions targetDefinitions; private final AbstractServiceTemplate targetServiceTemplate; - public AbstractTransformationPlan(String id, PlanType type, AbstractDefinitions sourceDefinitions, AbstractServiceTemplate sourceServiceTemplate, AbstractDefinitions targetDefinitions, @@ -32,41 +31,40 @@ public AbstractDefinitions getTargetDefinitions() { public AbstractServiceTemplate getTargetServiceTemplate() { return this.targetServiceTemplate; } - - public Collection getHandledSourceServiceTemplateNodes(){ - return this.getHandledServiceTemplateNodes(this.getServiceTemplate()); + + public Collection getHandledSourceServiceTemplateNodes() { + return this.getHandledServiceTemplateNodes(this.getServiceTemplate()); } - - public Collection getHandledSourceServiceTemplateRelations(){ + + public Collection getHandledSourceServiceTemplateRelations() { return this.getHandledServiceTemplateRelations(this.getServiceTemplate()); } - - public Collection getHandledTargetServiceTemplateNodes(){ + + public Collection getHandledTargetServiceTemplateNodes() { return this.getHandledServiceTemplateNodes(this.targetServiceTemplate); } - - public Collection getHandledTargetServiceTemplateRelations(){ + + public Collection getHandledTargetServiceTemplateRelations() { return this.getHandledServiceTemplateRelations(this.targetServiceTemplate); } - - private Collection getHandledServiceTemplateRelations(AbstractServiceTemplate serviceTemplate){ + + private Collection getHandledServiceTemplateRelations(AbstractServiceTemplate serviceTemplate) { Collection handledServiceTemplateRelations = new HashSet(); - for(AbstractRelationshipTemplate relation : serviceTemplate.getTopologyTemplate().getRelationshipTemplates()) { - if(!this.findRelationshipTemplateActivities(relation).isEmpty()) { + for (AbstractRelationshipTemplate relation : serviceTemplate.getTopologyTemplate().getRelationshipTemplates()) { + if (!this.findRelationshipTemplateActivities(relation).isEmpty()) { handledServiceTemplateRelations.add(relation); } } return handledServiceTemplateRelations; } - - private Collection getHandledServiceTemplateNodes(AbstractServiceTemplate serviceTemplate){ + + private Collection getHandledServiceTemplateNodes(AbstractServiceTemplate serviceTemplate) { Collection handledServiceTemplateNodes = new HashSet(); - for(AbstractNodeTemplate node : serviceTemplate.getTopologyTemplate().getNodeTemplates()) { - if(!this.findNodeTemplateActivities(node).isEmpty()) { + for (AbstractNodeTemplate node : serviceTemplate.getTopologyTemplate().getNodeTemplates()) { + if (!this.findNodeTemplateActivities(node).isEmpty()) { handledServiceTemplateNodes.add(node); } } return handledServiceTemplateNodes; } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/ActivityType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/ActivityType.java similarity index 98% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/ActivityType.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/ActivityType.java index ba8bf2ed3..9836cf2c9 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/ActivityType.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/ActivityType.java @@ -4,9 +4,7 @@ * Represents the abstract activity types supported by the planbuilder system * * @author Kálmán Képes - kepes@iaas.uni-stuttgart.de - * */ public enum ActivityType { - PROVISIONING, TERMINATION, RECURSIVESELECTION, STRATEGICSELECTION, FREEZE, DEFROST, MIGRATION, TEST, BACKUP, MONITORING, NONE } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/MonitoringActivity.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/MonitoringActivity.java new file mode 100644 index 000000000..6e22b198c --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/MonitoringActivity.java @@ -0,0 +1,8 @@ +package org.opentosca.planbuilder.model.plan; + +public class MonitoringActivity extends AbstractActivity { + + public MonitoringActivity(String id, ActivityType type) { + super(id, type); + } +} diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/NodeTemplateActivity.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/NodeTemplateActivity.java similarity index 99% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/NodeTemplateActivity.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/NodeTemplateActivity.java index 473803f7a..dd62a82a5 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/NodeTemplateActivity.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/NodeTemplateActivity.java @@ -7,13 +7,11 @@ *
    * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class NodeTemplateActivity extends AbstractActivity { private final AbstractNodeTemplate nodeTemplate; - public NodeTemplateActivity(final String id, final ActivityType type, final AbstractNodeTemplate nodeTemplate) { super(id, type); this.nodeTemplate = nodeTemplate; @@ -22,5 +20,4 @@ public NodeTemplateActivity(final String id, final ActivityType type, final Abst public AbstractNodeTemplate getNodeTemplate() { return this.nodeTemplate; } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/RelationshipTemplateActivity.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/RelationshipTemplateActivity.java similarity index 84% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/RelationshipTemplateActivity.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/RelationshipTemplateActivity.java index dcf6eab4f..95ad98af0 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/RelationshipTemplateActivity.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/RelationshipTemplateActivity.java @@ -7,7 +7,7 @@ public class RelationshipTemplateActivity extends AbstractActivity { private final AbstractRelationshipTemplate relationshipTemplate; public RelationshipTemplateActivity(final String id, final ActivityType type, - final AbstractRelationshipTemplate relationshipTemplate) { + final AbstractRelationshipTemplate relationshipTemplate) { super(id, type); this.relationshipTemplate = relationshipTemplate; } @@ -15,5 +15,4 @@ public RelationshipTemplateActivity(final String id, final ActivityType type, public AbstractRelationshipTemplate getRelationshipTemplate() { return this.relationshipTemplate; } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/BPELPlan.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/BPELPlan.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/BPELPlan.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/BPELPlan.java index 08ab6a590..2340f4d91 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/BPELPlan.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/BPELPlan.java @@ -1,6 +1,6 @@ package org.opentosca.planbuilder.model.plan.bpel; -import java.io.File; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -8,6 +8,7 @@ import java.util.Map; import java.util.Set; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.plan.AbstractPlan; import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; @@ -19,27 +20,19 @@ /** *

    - * This class is the main model for the PlanBuilder. It represents a BPEL Process, which enforces - * the structure of the concepts in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans für - * OpenTOSCA. The methods on this class mostly consist of setters/getters, all logic should be - * made through the facade under org.opentosca.planbuilder.handlers + * This class is the main model for the PlanBuilder. It represents a BPEL Process, which enforces the structure of the + * concepts in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans für OpenTOSCA. The + * methods on this class mostly consist of setters/getters, all logic should be made through the facade under + * org.opentosca.planbuilder.handlers *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELPlan extends AbstractPlan { - public BPELPlan(final String id, final PlanType type, final AbstractDefinitions definitions, - final AbstractServiceTemplate serviceTemplate, final Collection activities, - final Collection links) { - super(id, type, definitions, serviceTemplate, activities, links); - } - /** *

    * Defines which variables the model allows to define @@ -48,10 +41,9 @@ public BPELPlan(final String id, final PlanType type, final AbstractDefinitions *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public enum VariableType { - MESSAGE, TYPE, ELEMENT + MESSAGE, TYPE, ELEMENT; } /** @@ -62,7 +54,6 @@ public enum VariableType { *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public enum ImportType { WSDL, XSD; @@ -80,20 +71,25 @@ public String toString() { } } + public static final String bpelNamespace = "http://docs.oasis-open.org/wsbpel/2.0/process/executable"; + public static final String xpath2Namespace = "urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"; + + public Map namespaceMap = new HashMap<>(); + // xml document private Document bpelProcessDocument; - // variables associated with the bpel xml document itself + private Element bpelProcessElement; private Element bpelExtensionsElement; private List bpelImportElements; private Element bpelPartnerLinksElement; private Element bpelProcessVariablesElement; - - private Element bpelFaultHandlersElement; + private Element bpelFaultHandlersElement; // variables associated with the bpel orchestration // the main sequence element of this process + private Element bpelMainSequenceElement; // assign element for property assigns private Element bpelMainSequencePropertyAssignElement; @@ -107,33 +103,33 @@ public String toString() { // will work on private Element bpelMainFlowElement; private Element bpelMainFlowLinksElement; - // variable for TemplateBuildPlans, makes it easier or handlers and // planbuilder to hold it here extra + private List templateBuildPlans = new ArrayList<>(); // imported files of the whole buildplan, to keep track for export - private Set importedFiles; - + private Set importedFiles; // var for apache ode deployment deskriptor - private Deploy deploymentDeskriptor; + private Deploy deploymentDeskriptor; // the file name of the csar the serviceTemplate and this buildPlan belongs // to - private String csarName = null; + private String csarName = null; // wsdl related stuff - private GenericWsdlWrapper processWsdl = null; + private GenericWsdlWrapper processWsdl = null; private Map abstract2bpelMap; - public static final String bpelNamespace = "http://docs.oasis-open.org/wsbpel/2.0/process/executable"; - - public static final String xpath2Namespace = "urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"; - private String toscaInterfaceName = null; + private String toscaOperationName = null; - public Map namespaceMap = new HashMap<>(); + public BPELPlan(final String id, final PlanType type, final AbstractDefinitions definitions, + final AbstractServiceTemplate serviceTemplate, final Collection activities, + final Collection links) { + super(id, type, definitions, serviceTemplate, activities, links); + } public void setTOSCAInterfaceName(final String name) { this.toscaInterfaceName = name; @@ -150,7 +146,7 @@ public String getTOSCAInterfaceName() { return this.bpelProcessElement.getAttribute("name"); } } - + public String getProcessNamespace() { return this.bpelProcessElement.getAttribute("targetNamespace"); } @@ -180,7 +176,7 @@ public String getCsarName() { public void setCsarName(final String csarName) { this.csarName = csarName; } - + public Element getBpelFaultHandlersElement() { return bpelFaultHandlersElement; } @@ -194,7 +190,7 @@ public void setBpelFaultHandlersElement(Element bpelFaultHandlersElement) { * * @return a List of File */ - public Set getImportedFiles() { + public Set getImportedFiles() { return this.importedFiles; } @@ -203,7 +199,7 @@ public Set getImportedFiles() { * * @param files a List of File */ - public void setImportedFiles(final Set files) { + public void setImportedFiles(final Set files) { this.importedFiles = files; } @@ -213,7 +209,7 @@ public void setImportedFiles(final Set files) { * @param file the File to add as imported file * @return true iff adding was successful */ - public boolean addImportedFile(final File file) { + public boolean addImportedFile(final Path file) { return this.importedFiles.add(file); } @@ -544,8 +540,6 @@ public void setBpelMainSequenceOutputAssignElement(final Element bpelMainSequenc this.bpelMainSequenceOutputAssignElement = bpelMainSequenceOutputAssignElement; } - - public void setAbstract2BPELMapping(final Map abstract2bpelMap) { this.abstract2bpelMap = abstract2bpelMap; } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/BPELScope.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/BPELScope.java similarity index 88% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/BPELScope.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/BPELScope.java index 24da10bb8..387a52f91 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/BPELScope.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/BPELScope.java @@ -2,6 +2,7 @@ import java.util.HashMap; import java.util.Map; + import org.opentosca.planbuilder.model.plan.AbstractActivity; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; @@ -11,32 +12,27 @@ /** *

    - * This class is the model for TemplateBuildPlans as declared in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans für - * OpenTOSCA and enforces those concepts by defining placeholder elements + * This class is the model for TemplateBuildPlans as declared in Konzept und Implementierung eine Java-Komponente zur Generierung von WS-BPEL 2.0 BuildPlans für OpenTOSCA and + * enforces those concepts by defining placeholder elements *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ -public class BPELScope{ +public class BPELScope { private AbstractActivity act; - - + public BPELScope(AbstractActivity activity) { this.act = activity; this.usedOperations = new HashMap(); } - // the buildplan this templatebuildplan belongs to private BPELPlan buildPlan; - // bpel elements this templatebuildplan controls private Element bpelScopeElement; @@ -49,21 +45,20 @@ public BPELScope(AbstractActivity activity) { private Element bpelMainSequenceElement; private Element bpelSequencePrePhaseElement; private Element bpelSequenceProvisioningPhaseElement; - private Element bpelSequencePostPhaseElement; - private Element bpelEventHandlersElement; + private Element bpelSequencePostPhaseElement; + private Element bpelEventHandlersElement; private BPELScope bpelCompensationScope; private BPELScope bpelFaultScope; - - private Map usedOperations; + private Map usedOperations; private AbstractNodeTemplate nodeTemplate = null; private AbstractRelationshipTemplate relationshipTemplate = null; - + @Override public String toString() { - return "BPELScope Plan: " + buildPlan.getId() + " Activity: " + this.act + ((this.getNodeTemplate() != null) ? " Node: " +this.nodeTemplate.getId() : " Relation: " + this.relationshipTemplate.getId()); + return "BPELScope Plan: " + buildPlan.getId() + " Activity: " + this.act + ((this.getNodeTemplate() != null) ? " Node: " + this.nodeTemplate.getId() : " Relation: " + this.relationshipTemplate.getId()); } public static enum BPELScopePhaseType { @@ -73,7 +68,7 @@ public static enum BPELScopePhaseType { public AbstractActivity getActivity() { return this.act; } - + /** * Returns the DOM Document this TemplateBuildPlan is declared * @@ -185,7 +180,7 @@ public Element getBpelPartnerLinksElement() { /** * Sets the BPEL PartnerLinks element of this TemplateBuildPlan * - * @param bpelPartnerLinks a DOM Element + * @param bpelPartnerLinks a DOM Element */ public void setBpelPartnerLinks(final Element bpelPartnerLinks) { this.bpelPartnerLinks = bpelPartnerLinks; @@ -262,11 +257,10 @@ public Element getBpelSequencePostPhaseElement() { public void setBpelSequencePostPhaseElement(final Element bpelSequencePostPhaseElement) { this.bpelSequencePostPhaseElement = bpelSequencePostPhaseElement; } - - /** * Returns the scope containing the compensation activities of this scope + * * @return a DOM Element */ public BPELScope getBpelCompensationHandlerScope() { @@ -274,26 +268,27 @@ public BPELScope getBpelCompensationHandlerScope() { } /** - * Sets the scope as the compensation handler of this scope + * Sets the scope as the compensation handler of this scope + * * @param bpelCompensationScope a BPEL DOM Element with a compensation handler */ public void setBpelCompensationHandlerScope(BPELScope bpelCompensationScope) { - this.bpelCompensationScope = bpelCompensationScope; - Element compensationHandlerElement = this.buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, "compensationHandler"); - compensationHandlerElement.appendChild(this.bpelCompensationScope.getBpelScopeElement()); - this.bpelScopeElement.insertBefore(compensationHandlerElement, this.bpelMainSequenceElement); + this.bpelCompensationScope = bpelCompensationScope; + Element compensationHandlerElement = this.buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, "compensationHandler"); + compensationHandlerElement.appendChild(this.bpelCompensationScope.getBpelScopeElement()); + this.bpelScopeElement.insertBefore(compensationHandlerElement, this.bpelMainSequenceElement); } /** * Returns the scope containing the faul handling activities of this scope - * @return */ public BPELScope getBpelFaultHandlerScope() { return this.bpelFaultScope; } - + /** - * Sets the scope as the fault handler of this scope + * Sets the scope as the fault handler of this scope + * * @param bpelFaultScope a BPEL DOM Element with fault handler */ public void setBpelFaultHandlerScope(BPELScope bpelFaultScope) { @@ -303,16 +298,14 @@ public void setBpelFaultHandlerScope(BPELScope bpelFaultScope) { Element faultHandlersElement = this.buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, "faultHandlers"); Element catchAllElement = this.buildPlan.getBpelDocument().createElementNS(BPELPlan.bpelNamespace, "catchAll"); catchAllElement.appendChild(this.bpelFaultScope.getBpelScopeElement()); - faultHandlersElement.appendChild(catchAllElement); - this.bpelScopeElement.insertBefore(faultHandlersElement, this.bpelMainSequenceElement); + faultHandlersElement.appendChild(catchAllElement); + this.bpelScopeElement.insertBefore(faultHandlersElement, this.bpelMainSequenceElement); } - /** * Gets the NodeTemplate this TemplateBuildPlan belongs to * - * @return an AbstractNodeTemplate, else null if this is a TemplateBuildPlan for a - * RelationshipTemplate + * @return an AbstractNodeTemplate, else null if this is a TemplateBuildPlan for a RelationshipTemplate */ public AbstractNodeTemplate getNodeTemplate() { return this.nodeTemplate; @@ -330,8 +323,7 @@ public void setNodeTemplate(final AbstractNodeTemplate nodeTemplate) { /** * Get the RelationshipTemplate this TemplateBuildPlan belongs to * - * @return an AbstractRelationshipTemplate, else null if this is a TemplateBuildPlan for a - * RelationshipTemplate + * @return an AbstractRelationshipTemplate, else null if this is a TemplateBuildPlan for a RelationshipTemplate */ public AbstractRelationshipTemplate getRelationshipTemplate() { return this.relationshipTemplate; @@ -363,7 +355,7 @@ public Element getBpelCorrelationSets() { public void setBpelCorrelationSets(final Element bpelCorrelationSets) { this.bpelCorrelationSets = bpelCorrelationSets; } - + public Element getBpelEventHandlersElement() { return bpelEventHandlersElement; } @@ -371,13 +363,12 @@ public Element getBpelEventHandlersElement() { public void setBpelEventHandlersElement(Element bpelEventHandlersElement) { this.bpelEventHandlersElement = bpelEventHandlersElement; } - + public Map getUsedOperations() { return usedOperations; } public void addUsedOperation(AbstractOperation usedOperation, AbstractOperation compensationOperation) { - this.usedOperations.put(usedOperation, compensationOperation); + this.usedOperations.put(usedOperation, compensationOperation); } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/Deploy.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/Deploy.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/Deploy.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/Deploy.java index bbf8e1e36..693053c23 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/Deploy.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/Deploy.java @@ -12,7 +12,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ @XmlRootElement(namespace = "http://www.apache.org/ode/schemas/dd/2007/03") public class Deploy extends TDeployment { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/GenericWsdlWrapper.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/GenericWsdlWrapper.java similarity index 81% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/GenericWsdlWrapper.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/GenericWsdlWrapper.java index e1c71dd42..b7b03cbd5 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/plan/bpel/GenericWsdlWrapper.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/plan/bpel/GenericWsdlWrapper.java @@ -10,24 +10,22 @@ import javax.xml.namespace.QName; -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; -import org.osgi.framework.FrameworkUtil; +import org.opentosca.container.core.common.file.ResourceAccess; +import org.opentosca.container.core.next.model.PlanType; +import org.slf4j.LoggerFactory; /** *

    - * This class represents a WSDL v1.1. This class is mainly used for the BuildPlan. It uses a - * internal fragmented WSDL File and allows to add declarations at defined points. The WSDL declares - * a single PortType for invoking the BuildPlan and second for callback. Both have a single one-way - * operation defined. With the given operations of this class, the messages can have additional - * elements defined, which can be used by the plugins to fetch data outside of the TopoloyTemplate - * scope. + * This class represents a WSDL v1.1. This class is mainly used for the BuildPlan. It uses a internal fragmented WSDL + * File and allows to add declarations at defined points. The WSDL declares a single PortType for invoking the BuildPlan + * and second for callback. Both have a single one-way operation defined. With the given operations of this class, the + * messages can have additional elements defined, which can be used by the plugins to fetch data outside of the + * TopoloyTemplate scope. *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class GenericWsdlWrapper { @@ -91,11 +89,9 @@ public class GenericWsdlWrapper { *
    * * @author nyu - * */ private class PltMap { - private final List partnerLinkTypeNames = new ArrayList<>(); private final List roleNames1 = new ArrayList<>(); private final List portTypes1 = new ArrayList<>(); @@ -106,10 +102,10 @@ private class PltMap { * Adds a partnerLinkType to this PltMap * * @param partnerLinkTypeName the name of the partnerLinkType to use - * @param role1 the name of the 1st role - * @param portType1 a QName of the 1st portType - * @param role2 the name of the 2nd role - * @param portType2 a QName of the 2nd portType + * @param role1 the name of the 1st role + * @param portType1 a QName of the 1st portType + * @param role2 the name of the 2nd role + * @param portType2 a QName of the 2nd portType * @return true iff adding was successful */ public boolean addPLT(final String partnerLinkTypeName, final String role1, final QName portType1, @@ -158,20 +154,22 @@ public QName getPortType2OfPLT(final String partnerLinkTypeName) { } else { return portType; } - } } - /** * Constructor * * @throws IOException is thrown when reading the internal file fails */ - public GenericWsdlWrapper(final BPELPlan.PlanType planType, final String inputOperationName) throws IOException { - final URL url = FrameworkUtil.getBundle(this.getClass()).getResource("genericProcessWsdl.wsdl"); - final File genericWsdlFile = new File(FileLocator.toFileURL(url).getPath()); - this.genericWsdlFileAsString = FileUtils.readFileToString(genericWsdlFile); + public GenericWsdlWrapper(final PlanType planType, final String inputOperationName) throws IOException { + final URL url = getClass().getClassLoader().getResource("genericProcessWsdl.wsdl"); + try { + this.genericWsdlFileAsString = ResourceAccess.readResourceAsString(url); + } catch (IOException e) { + LoggerFactory.getLogger(GenericWsdlWrapper.class).warn("Could not read generic process wsdl from {} with exception", url, e); + this.genericWsdlFileAsString = ""; + } this.partnerLinkTypeNames = new ArrayList<>(); this.absoluteLocations = new ArrayList<>(); this.inputMessageLocalNames = new ArrayList<>(); @@ -212,15 +210,15 @@ public List getInputMessageLocalNames() { * Adds a element declaration to the input message of this wsdl * * @param elementName the localName of the element - * @param type the XSD type of the element + * @param type the XSD type of the element * @return true iff adding was successful */ public boolean addElementToRequestMessage(final String elementName, final QName type) { if (!this.inputMessageLocalNames.contains(elementName)) { this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_REQUESTTYPEELEMENTS_TAG, - this.generateElementString(elementName, type.getLocalPart()) - + GenericWsdlWrapper.WSDL_REQUESTTYPEELEMENTS_TAG); + this.generateElementString(elementName, type.getLocalPart()) + + GenericWsdlWrapper.WSDL_REQUESTTYPEELEMENTS_TAG); this.inputMessageLocalNames.add(elementName); return true; } else { @@ -232,15 +230,15 @@ public boolean addElementToRequestMessage(final String elementName, final QName * Adds a element declaration to the output message of this wsdl * * @param elementName the localName of the element - * @param type the XSD type of the element + * @param type the XSD type of the element * @return true iff adding was successful */ public boolean addElementToResponseMessage(final String elementName, final QName type) { if (!this.outputMessageLocalNames.contains(elementName)) { this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_RESPONETYPEELEMENTS_TAG, - this.generateElementString(elementName, type.getLocalPart()) - + GenericWsdlWrapper.WSDL_RESPONETYPEELEMENTS_TAG); + this.generateElementString(elementName, type.getLocalPart()) + + GenericWsdlWrapper.WSDL_RESPONETYPEELEMENTS_TAG); this.outputMessageLocalNames.add(elementName); return true; } else { @@ -252,7 +250,7 @@ public boolean addElementToResponseMessage(final String elementName, final QName * Adds a namespace with fiven prefix to this wsdl * * @param namespace the namespace to add - * @param prefix the prefix for the given namespace + * @param prefix the prefix for the given namespace * @return true iff adding was successful */ private boolean addNamespace(final String namespace, final String prefix) { @@ -262,13 +260,13 @@ private boolean addNamespace(final String namespace, final String prefix) { final String nsDecl1 = "xmlns:ns" + this.namespaceCounter + "=\"" + namespace + "\" "; this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_NAMESPACEPREFIX_TAG, - nsDecl1 + GenericWsdlWrapper.WSDL_NAMESPACEPREFIX_TAG); + nsDecl1 + GenericWsdlWrapper.WSDL_NAMESPACEPREFIX_TAG); this.namespaceCounter++; } else { final String nsDecl2 = "xmlns:" + prefix + "=\"" + namespace + "\" "; this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_NAMESPACEPREFIX_TAG, - nsDecl2 + GenericWsdlWrapper.WSDL_NAMESPACEPREFIX_TAG); + nsDecl2 + GenericWsdlWrapper.WSDL_NAMESPACEPREFIX_TAG); } return true; @@ -281,25 +279,23 @@ private boolean addNamespace(final String namespace, final String prefix) { * Adds an import element to his wsdl * * @param importType the type of the import (wsdl, xsd) - * @param namespace the namespace of the import - * @param prefix the prefix of namespace - * @param location the location of the import + * @param namespace the namespace of the import + * @param prefix the prefix of namespace + * @param location the location of the import * @return true iff adding was successful */ public boolean addImportElement(final String importType, final String namespace, final String prefix, final String location) { - // TODO we assume the location is absolute for packaging later this has - // to be fixed + // TODO we assume the location is absolute for packaging later this has to be fixed if (this.absoluteLocations.contains(location)) { return false; } - final String importString = this.generateImportString(importType, namespace, location); this.absoluteLocations.add(location); this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_IMPORTS_TAG, - importString + GenericWsdlWrapper.WSDL_IMPORTS_TAG); + importString + GenericWsdlWrapper.WSDL_IMPORTS_TAG); this.addNamespace(namespace, prefix); return true; } @@ -308,8 +304,8 @@ public boolean addImportElement(final String importType, final String namespace, * Generates a string which contains a wsdl import string * * @param importType the importType of the import as String - * @param namespace the namespace of the import as String - * @param location the location of the import as String + * @param namespace the namespace of the import as String + * @param location the location of the import as String * @return a String containing an WSDL import declaration */ private String generateImportString(final String importType, final String namespace, final String location) { @@ -332,7 +328,7 @@ private String generateElementString(final String name, final String type) { * Sets the id of this WSDL * * @param namespace the namespace of the WSDL to set - * @param name the name of the WSDL to set + * @param name the name of the WSDL to set */ public void setId(final String namespace, final String name) { if (this.processName == null) { @@ -382,8 +378,8 @@ public String getRequestMessageLocalName() { * Adds a partnerLinkType to this WSDL * * @param partnerLinkTypeName the name of partnerLinkType - * @param roleName the name of the 1st role - * @param portType the portType of the partner + * @param roleName the name of the 1st role + * @param portType the portType of the partner * @return true iff adding the partnerLinkType was successful */ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String roleName, final QName portType) { @@ -394,9 +390,9 @@ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String // partnerlinks later this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_PARTNERLINKS_TAG, - this.generatePartnerLinkTypeString(partnerLinkTypeName, roleName, - portType) - + GenericWsdlWrapper.WSDL_PARTNERLINKS_TAG); + this.generatePartnerLinkTypeString(partnerLinkTypeName, roleName, + portType) + + GenericWsdlWrapper.WSDL_PARTNERLINKS_TAG); } this.partnerLinkTypeNames.add(partnerLinkTypeName); this.pltMap.addPLT(partnerLinkTypeName, roleName, portType, "", new QName("")); @@ -408,10 +404,10 @@ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String * Adds a partnerLinkType to this WSDL * * @param partnerLinkTypeName the name of the partnerLinkType - * @param roleName1 the name of the 1st role - * @param portType1 the portType of the 1st role - * @param roleName2 the name of the 2nd role - * @param portType2 the portType of the 2nd role + * @param roleName1 the name of the 1st role + * @param portType1 the portType of the 1st role + * @param roleName2 the name of the 2nd role + * @param portType2 the portType of the 2nd role * @return true iff adding was successful */ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String roleName1, final QName portType1, @@ -423,9 +419,9 @@ public boolean addPartnerLinkType(final String partnerLinkTypeName, final String // partnerlinks later this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_PARTNERLINKS_TAG, - this.generatePartnerLinkTypeString(partnerLinkTypeName, roleName1, - portType1, roleName2, portType2) - + GenericWsdlWrapper.WSDL_PARTNERLINKS_TAG); + this.generatePartnerLinkTypeString(partnerLinkTypeName, roleName1, + portType1, roleName2, portType2) + + GenericWsdlWrapper.WSDL_PARTNERLINKS_TAG); } this.partnerLinkTypeNames.add(partnerLinkTypeName); this.pltMap.addPLT(partnerLinkTypeName, roleName1, portType1, roleName2, portType2); @@ -457,7 +453,7 @@ public QName getPortType1FromPartnerLinkType(final String partnerLinkTypeName) { * Adds a property declaration to this WSDL * * @param propertyName the name of the property - * @param type the type of the property + * @param type the type of the property * @return true iff adding was succesful */ public boolean addProperty(final String propertyName, final QName type) { @@ -468,7 +464,7 @@ public boolean addProperty(final String propertyName, final QName type) { final String property = this.generatePropertyString(propertyName, type); this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_PROPERTYS_TAG, - property + GenericWsdlWrapper.WSDL_PROPERTYS_TAG); + property + GenericWsdlWrapper.WSDL_PROPERTYS_TAG); return true; } @@ -476,9 +472,9 @@ public boolean addProperty(final String propertyName, final QName type) { * Adds a propertyAlias to this WSDL for the given property * * @param propertyName the name of the property the propertyAlias should belong to - * @param partName the name of the message part - * @param messageType the type of the message - * @param query a XPath Query + * @param partName the name of the message part + * @param messageType the type of the message + * @param query a XPath Query * @return true iff adding was successful */ public boolean addPropertyAlias(final String propertyName, final String partName, final QName messageType, @@ -487,7 +483,7 @@ public boolean addPropertyAlias(final String propertyName, final String partName final String propertyAlias = this.generatePropertyAliasString(propertyName, partName, messageType, query); this.genericWsdlFileAsString = this.genericWsdlFileAsString.replace(GenericWsdlWrapper.WSDL_PROPERTYALIAS_TAG, - propertyAlias + GenericWsdlWrapper.WSDL_PROPERTYALIAS_TAG); + propertyAlias + GenericWsdlWrapper.WSDL_PROPERTYALIAS_TAG); return true; } @@ -505,7 +501,7 @@ public QName getPortType2FromPartnerLinkType(final String partnerLinkTypeName) { * Generates a String which contains a property declaration * * @param propertyName the name of the property - * @param type the type of the property + * @param type the type of the property * @return a String containing a property declaration */ private String generatePropertyString(final String propertyName, final QName type) { @@ -519,9 +515,9 @@ private String generatePropertyString(final String propertyName, final QName typ * Generates a String which contains a propertyAlias declaration * * @param propertyName the name of the property the propertyAlias should belong to - * @param partName the part name of the message the propertyAlias should reference - * @param messageType the type of the message the propertyAlias should reference - * @param query a XPath query which the propertyAlias should use + * @param partName the part name of the message the propertyAlias should reference + * @param messageType the type of the message the propertyAlias should reference + * @param query a XPath query which the propertyAlias should use * @return a String containing a propertyAlias declaration */ private String generatePropertyAliasString(final String propertyName, final String partName, @@ -539,8 +535,8 @@ private String generatePropertyAliasString(final String propertyName, final Stri * Generates a String containing a partnerLinkType declaration with one portType * * @param partnerLinkTypeName the name for the partnerLinkType - * @param roleName the name for the role - * @param portType a QName for the portType + * @param roleName the name for the role + * @param portType a QName for the portType * @return a String containing a partnerLinkType declaration */ private String generatePartnerLinkTypeString(final String partnerLinkTypeName, final String roleName, @@ -553,10 +549,10 @@ private String generatePartnerLinkTypeString(final String partnerLinkTypeName, f * Generates a String containing a partnerLinkType declaration with two roles * * @param partnerLinkTypeName the name of the partnerLinkType - * @param roleName1 the name of the 1st role - * @param portType1 a QName of a portType for the 1st role - * @param roleName2 the name of the 2nd role - * @param portType2 a QName of a portType for the 2nd role + * @param roleName1 the name of the 1st role + * @param portType1 a QName of a portType for the 1st role + * @param roleName2 the name of the 2nd role + * @param portType2 a QName of a portType for the 2nd role * @return a String containing a partnerLinkType declaration with 2 roles */ private String generatePartnerLinkTypeString(final String partnerLinkTypeName, final String roleName1, @@ -608,7 +604,7 @@ public String getFinalizedWsdlAsString() { /** * Checks whether the QName with the given location is already imported inside this wsdl * - * @param qName a QName + * @param qName a QName * @param absolutePath a location where the QName is defined * @return true iff the given QName is already imported inside this WSDL */ diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactReference.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactReference.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactReference.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactReference.java index c890bedf0..7c7eecf55 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactReference.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactReference.java @@ -10,7 +10,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractArtifactReference { @@ -34,5 +33,4 @@ public abstract class AbstractArtifactReference { * @return a List of Strings */ public abstract List getExcludePatterns(); - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactTemplate.java similarity index 91% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactTemplate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactTemplate.java index 0b6857aeb..19138a598 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactTemplate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactTemplate.java @@ -14,7 +14,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractArtifactTemplate { @@ -41,8 +40,6 @@ public abstract class AbstractArtifactTemplate { /** * Returns the ArtifactType of this {@link AbstractArtifactTemplate} as {@link AbstractArtifactType} - * - * @return */ public abstract AbstractArtifactType getAbstractArtifactType(); @@ -61,8 +58,8 @@ public abstract class AbstractArtifactTemplate { public abstract List getArtifactReferences(); /** - * Returns all defined DOM nodes which aren't part of the TOSCA spec but can be defined under the - * nodeTypes (e.g. extensible elements) + * Returns all defined DOM nodes which aren't part of the TOSCA spec but can be defined under the nodeTypes (e.g. + * extensible elements) * * @return a List of DOM nodes representing additionaly elements defined on this nodeType */ diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactType.java similarity index 99% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactType.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactType.java index 76d8772d1..abfa951d9 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractArtifactType.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractArtifactType.java @@ -9,5 +9,4 @@ public abstract class AbstractArtifactType { public abstract QName getRef(); public abstract AbstractArtifactType getTypeRef(); - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractBoundaryDefinitions.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractBoundaryDefinitions.java similarity index 100% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractBoundaryDefinitions.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractBoundaryDefinitions.java diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractCapability.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractCapability.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractCapability.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractCapability.java index f413c64dd..7c5265068 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractCapability.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractCapability.java @@ -10,7 +10,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractCapability { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractDefinitions.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractDefinitions.java similarity index 83% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractDefinitions.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractDefinitions.java index 70bd96fde..1ddb3f031 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractDefinitions.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractDefinitions.java @@ -13,7 +13,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractDefinitions { @@ -78,7 +77,7 @@ public abstract class AbstractDefinitions { * * @return a List of AbstractDefinitions */ - public abstract List getImportedDefinitions(); + public abstract List getImportedDefinitions(); /** * Returns an absolute Path for the given AbstractArtifactReference @@ -89,8 +88,8 @@ public abstract class AbstractDefinitions { public abstract File getAbsolutePathOfArtifactReference(AbstractArtifactReference ref); /** - * Returns a RelationshipType for the given QName. This method looks trough the whole Definitions - * space, which means the search looks trough the imported Definitions of this Definitions. + * Returns a RelationshipType for the given QName. This method looks trough the whole Definitions space, which means + * the search looks trough the imported Definitions of this Definitions. * * @param relationshipTypeId a QName * @return an AbstractRelationshipType, if nothing was found null @@ -107,8 +106,8 @@ public AbstractRelationshipType getRelationshipType(final QName relationshipType } /** - * Returns a NodeType for the given QName, This method looks trough the whole Definitions space, - * which means the search looks trough the imported Definitions of this Definitions + * Returns a NodeType for the given QName, This method looks trough the whole Definitions space, which means the + * search looks trough the imported Definitions of this Definitions * * @param nodeTypeId a QName * @return an AbstractNodeType, if nothing was found null @@ -123,8 +122,8 @@ public AbstractNodeType getNodeType(final QName nodeTypeId) { } /** - * Returns a ArtifactTemplate for the given QName, This method looks trough the whole Definitions - * space, which means the search looks trough the imported Definitions of this Definitions + * Returns a ArtifactTemplate for the given QName, This method looks trough the whole Definitions space, which means + * the search looks trough the imported Definitions of this Definitions * * @param qname a QName * @return an AbstractArtifactTemplate, if nothing was found null @@ -142,22 +141,22 @@ public AbstractArtifactTemplate getArtifactTemplate(final QName qname) { } return null; } - + public AbstractOperation findOperation(String interfaceName, String operationName) { - for(AbstractNodeType nodeType : this.getNodeTypes()) { - for(AbstractInterface iface : nodeType.getInterfaces()) { - if(iface.getName().equals(interfaceName)) { - for(AbstractOperation op : iface.getOperations()) { - if(op.getName().equals(operationName)) { + for (AbstractNodeType nodeType : this.getNodeTypes()) { + for (AbstractInterface iface : nodeType.getInterfaces()) { + if (iface.getName().equals(interfaceName)) { + for (AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(operationName)) { return op; } } } } } - for(AbstractDefinitions defs : this.getImportedDefinitions()) { + for (AbstractDefinitions defs : this.getImportedDefinitions()) { AbstractOperation op = defs.findOperation(interfaceName, operationName); - if(op != null) { + if (op != null) { return op; } } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractDeploymentArtifact.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractDeploymentArtifact.java similarity index 96% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractDeploymentArtifact.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractDeploymentArtifact.java index b5d2bf43c..a17b59bc6 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractDeploymentArtifact.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractDeploymentArtifact.java @@ -12,7 +12,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractDeploymentArtifact { @@ -73,5 +72,4 @@ public boolean equals(Object obj) { return true; } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractEntityTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractEntityTemplate.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractEntityTemplate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractEntityTemplate.java index 574503e72..27c58ae02 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractEntityTemplate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractEntityTemplate.java @@ -10,7 +10,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractEntityTemplate { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractEntityType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractEntityType.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractEntityType.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractEntityType.java index c9fe092fa..b032b4d73 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractEntityType.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractEntityType.java @@ -10,7 +10,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractEntityType { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractImplementationArtifact.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractImplementationArtifact.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractImplementationArtifact.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractImplementationArtifact.java index 54edd20ab..2a8bbd651 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractImplementationArtifact.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractImplementationArtifact.java @@ -12,7 +12,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractImplementationArtifact { @@ -33,8 +32,8 @@ public abstract class AbstractImplementationArtifact { /** * Returns the TOSCA Operation Name this ImplementationArtifact implements. * - * @return a String containing the Operation this ImplementationArtifact implements, maybe null if - * IA implements whole Interface + * @return a String containing the Operation this ImplementationArtifact implements, maybe null if IA implements + * whole Interface */ public abstract String getOperationName(); @@ -48,8 +47,7 @@ public abstract class AbstractImplementationArtifact { /** * Returns the TOSCA ArtifactTemplate of this ImplementationArtifact * - * @return an AbstractArtifactTemplate representing the referenced Template of this - * ImplementationArtifact + * @return an AbstractArtifactTemplate representing the referenced Template of this ImplementationArtifact */ public abstract AbstractArtifactTemplate getArtifactRef(); @@ -60,7 +58,6 @@ public abstract class AbstractImplementationArtifact { */ public abstract List getAdditionalElements(); - @Override public boolean equals(final Object obj) { if (!(obj instanceof AbstractImplementationArtifact)) { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractInterface.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractInterface.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractInterface.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractInterface.java index 7c318574f..d059d10b6 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractInterface.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractInterface.java @@ -10,7 +10,6 @@ *
    * * @author Kalman Kepes - kepsekn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractInterface { @@ -27,5 +26,4 @@ public abstract class AbstractInterface { * @return a List of AbstractOperations for the Operations of this Interface */ public abstract List getOperations(); - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeTemplate.java similarity index 89% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeTemplate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeTemplate.java index 2eeca3289..d654e5495 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeTemplate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeTemplate.java @@ -10,25 +10,22 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractNodeTemplate { /** - * Returns the TOSCA RelationshipTemplate which can be used/are declared as the source relation, of - * this NodeTemplate. + * Returns the TOSCA RelationshipTemplate which can be used/are declared as the source relation, of this + * NodeTemplate. * - * @return a List of AbstractRelationshipTemplates that have this NodeTemplate as possible source - * declaration + * @return a List of AbstractRelationshipTemplates that have this NodeTemplate as possible source declaration */ public abstract List getOutgoingRelations(); /** - * Returns the TOSCA RelationshipTemplate which can be used/are declared as the target relation of - * this NodeTemplate + * Returns the TOSCA RelationshipTemplate which can be used/are declared as the target relation of this + * NodeTemplate * - * @return a List of AbstractRelationshipTemplates that have this NodeTemplate as possible target - * declaration + * @return a List of AbstractRelationshipTemplates that have this NodeTemplate as possible target declaration */ public abstract List getIngoingRelations(); @@ -124,10 +121,8 @@ public boolean equals(final Object o) { return false; } return true; - } else { return false; } } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeType.java similarity index 84% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeType.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeType.java index 4010162b6..1c7b10b7c 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeType.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeType.java @@ -14,7 +14,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractNodeType { @@ -54,27 +53,26 @@ public abstract class AbstractNodeType { public abstract List getInterfaces(); /** - * Returns all defined DOM nodes which aren't part of the TOSCA spec but can be defined under the - * nodeTypes (e.g. extensible elements) + * Returns all defined DOM nodes which aren't part of the TOSCA spec but can be defined under the nodeTypes (e.g. + * extensible elements) * * @return a List of DOM nodes representing additionaly elements defined on this nodeType */ public abstract List getAdditionalElements(); - + @Override public boolean equals(Object o) { - - if(!(o instanceof AbstractNodeType)) { + + if (!(o instanceof AbstractNodeType)) { return false; } - + AbstractNodeType nodeType = (AbstractNodeType) o; - - if(!nodeType.getId().equals(this.getId())) { + + if (!nodeType.getId().equals(this.getId())) { return false; } - + return true; } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeTypeImplementation.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeTypeImplementation.java similarity index 96% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeTypeImplementation.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeTypeImplementation.java index 4ec14b3c8..b8f538361 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractNodeTypeImplementation.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractNodeTypeImplementation.java @@ -12,7 +12,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractNodeTypeImplementation { @@ -85,5 +84,4 @@ public abstract class AbstractNodeTypeImplementation { * @return an AbstractNodeType this NodeTypeImplementation implements */ public abstract AbstractNodeType getNodeType(); - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractOperation.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractOperation.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractOperation.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractOperation.java index 1fc6cea7f..49d6dcc91 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractOperation.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractOperation.java @@ -10,7 +10,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractOperation { @@ -34,6 +33,6 @@ public abstract class AbstractOperation { * @return a List of AbstractParameters as Ouput of this Operation */ public abstract List getOutputParameters(); - + public abstract AbstractInterface getInterface(); } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractParameter.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractParameter.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractParameter.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractParameter.java index 90c8d0f3d..8983f3e2f 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractParameter.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractParameter.java @@ -8,7 +8,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractParameter { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPolicy.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPolicy.java similarity index 99% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPolicy.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPolicy.java index f65812608..1922247c1 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPolicy.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPolicy.java @@ -9,7 +9,6 @@ *
    * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public abstract class AbstractPolicy { @@ -17,12 +16,10 @@ public abstract class AbstractPolicy { public abstract AbstractProperties getProperties(); - public abstract AbstractPolicyType getType(); public abstract AbstractPolicyTemplate getTemplate(); - @Override public boolean equals(Object object) { if (!(object instanceof AbstractPolicy)) { @@ -50,5 +47,4 @@ public boolean equals(Object object) { return true; } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPolicyTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPolicyTemplate.java similarity index 100% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPolicyTemplate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPolicyTemplate.java diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPolicyType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPolicyType.java similarity index 100% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPolicyType.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPolicyType.java diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractProperties.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractProperties.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractProperties.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractProperties.java index 379ee05bd..69cf8afc6 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractProperties.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractProperties.java @@ -12,7 +12,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractProperties { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPropertyMapping.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPropertyMapping.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPropertyMapping.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPropertyMapping.java index 3a63ef79a..3a8359c5e 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractPropertyMapping.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractPropertyMapping.java @@ -8,7 +8,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractPropertyMapping { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTemplate.java similarity index 82% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTemplate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTemplate.java index 0d6aa8151..5023a36c4 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTemplate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTemplate.java @@ -10,13 +10,11 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractRelationshipTemplate extends AbstractEntityTemplate { /** - * Returns the AbstractNodeTemplate representing the NodeTemplate which is the source of this - * RelationshipTemplate + * Returns the AbstractNodeTemplate representing the NodeTemplate which is the source of this RelationshipTemplate * * @return an AbstractNodeTemplate representing the source NodeTemplate of this RelationshipTemplate */ @@ -25,14 +23,13 @@ public abstract class AbstractRelationshipTemplate extends AbstractEntityTemplat /** * Returns the Requirement which is referenced by this Relationship Template. * - * @return an AbstractRequirements object, or null if this Relationship Template references a Node - * Template as Source instead + * @return an AbstractRequirements object, or null if this Relationship Template references a Node Template as + * Source instead */ public abstract AbstractRequirement getSourceRequirement(); /** - * Returns the AbstractNodeTemplate representing the NodeTemplate which is the target of this - * RelationshipTemplate + * Returns the AbstractNodeTemplate representing the NodeTemplate which is the target of this RelationshipTemplate * * @return an AbstractNodeTemplate representing the taret NodeTemplate of this RelationshipTemplate */ @@ -41,8 +38,8 @@ public abstract class AbstractRelationshipTemplate extends AbstractEntityTemplat /** * Returns the Capability which is referenced by this Relationship Template. * - * @return an AbstractCapability object, or null if this Relationship Template references a Node - * Template as Target instead. + * @return an AbstractCapability object, or null if this Relationship Template references a Node Template as Target + * instead. */ public abstract AbstractCapability getTargetCapability(); @@ -81,20 +78,19 @@ public abstract class AbstractRelationshipTemplate extends AbstractEntityTemplat public boolean equals(final Object o) { if (o instanceof AbstractRelationshipTemplate) { final AbstractRelationshipTemplate relation = (AbstractRelationshipTemplate) o; - - if(!relation.getId().equals(this.getId())) { + + if (!relation.getId().equals(this.getId())) { return false; } - - if(!(relation.getSource().equals(this.getSource()) & relation.getTarget().equals(relation.getTarget()))) { + + if (!(relation.getSource().equals(this.getSource()) & relation.getTarget().equals(relation.getTarget()))) { return false; } - + if (!relation.getType().equals(this.getType())) { return false; } return true; - } else { return false; } @@ -107,5 +103,4 @@ public boolean equals(final Object o) { public int hashCode() { return (this.getId() + this.getName()).hashCode(); } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipType.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipType.java similarity index 96% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipType.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipType.java index 1ec348733..04afb2bdb 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipType.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipType.java @@ -10,7 +10,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractRelationshipType extends AbstractEntityType { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTypeImplementation.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTypeImplementation.java similarity index 96% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTypeImplementation.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTypeImplementation.java index 2a077ac6f..ba15460b8 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTypeImplementation.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRelationshipTypeImplementation.java @@ -12,7 +12,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractRelationshipTypeImplementation { @@ -78,5 +77,4 @@ public abstract class AbstractRelationshipTypeImplementation { * @return a List of AbstractTags */ public abstract List getTags(); - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRequirement.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRequirement.java similarity index 95% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRequirement.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRequirement.java index b60bb5449..7482d6c2c 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractRequirement.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractRequirement.java @@ -10,7 +10,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractRequirement { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplate.java similarity index 99% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplate.java index 0457e5846..e74f92f77 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplate.java @@ -12,7 +12,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractServiceTemplate { @@ -78,5 +77,4 @@ public abstract class AbstractServiceTemplate { * @return a Map from String to Strin representing the keys and values of TOSCA tags */ public abstract Map getTags(); - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplateProperties.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplateProperties.java new file mode 100644 index 000000000..57cf02eb1 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractServiceTemplateProperties.java @@ -0,0 +1,33 @@ +/** + * + */ +package org.opentosca.planbuilder.model.tosca; + +import java.util.List; + +/** + *

    + * This class represents TOSCA ServiceTemplate Properties + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + * + */ +public abstract class AbstractServiceTemplateProperties { + + /** + * Returns the PropertyMappings of this ServiceTemplate Properties + * + * @return a List of AbstractPropertyMappings + */ + public abstract List getPropertyMappings(); + + /** + * Returns the Properties of this ServiceTemplate Properties + * + * @return an AbstractProperties of this ServiceTemplate Properties + */ + public abstract AbstractProperties getProperties(); +} diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractTag.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractTag.java similarity index 94% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractTag.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractTag.java index 32ad93378..cdbe7040a 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractTag.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractTag.java @@ -8,7 +8,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractTag { diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractTopologyTemplate.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractTopologyTemplate.java similarity index 96% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractTopologyTemplate.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractTopologyTemplate.java index 749e5a264..6b115cae8 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/tosca/AbstractTopologyTemplate.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/tosca/AbstractTopologyTemplate.java @@ -13,13 +13,12 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class AbstractTopologyTemplate { /** * Returns the id of the Service Template this Topology Template belongs to - * + * * @return a QName denoting the Service Template of this Topology Template */ public abstract QName getServiceTemplateId(); @@ -67,5 +66,4 @@ public List getSinks() { } return sinks; } - } diff --git a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/utils/ModelUtils.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/utils/ModelUtils.java similarity index 87% rename from org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/utils/ModelUtils.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/utils/ModelUtils.java index 4f43febef..ee91de763 100644 --- a/org.opentosca.planbuilder.model/src/org/opentosca/planbuilder/model/utils/ModelUtils.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/java/org/opentosca/planbuilder/model/utils/ModelUtils.java @@ -21,6 +21,13 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.eclipse.winery.model.tosca.TNodeTemplate; +import org.eclipse.winery.model.tosca.TNodeType; + +import org.apache.http.annotation.Obsolete; +import org.opentosca.container.core.common.NotFoundException; +import org.opentosca.container.core.engine.ToscaEngine; +import org.opentosca.container.core.model.csar.Csar; import org.opentosca.container.core.tosca.convention.Types; import org.opentosca.planbuilder.model.tosca.AbstractArtifactTemplate; import org.opentosca.planbuilder.model.tosca.AbstractArtifactType; @@ -48,7 +55,6 @@ *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class ModelUtils { @@ -56,15 +62,14 @@ public class ModelUtils { public static String makeValidNCName(final String string) { return string.replaceAll("\\.", "_").replaceAll(" ", "_").replace("{", "_").replace("}", "_").replace("/", "_") - .replace(":", "_"); + .replace(":", "_"); } /** - * Returns true if the given QName type denotes to a NodeType in the type hierarchy of the given - * NodeTemplate + * Returns true if the given QName type denotes to a NodeType in the type hierarchy of the given NodeTemplate * * @param nodeTemplate an AbstractNodeTemplate - * @param type the Type as a QName to check against + * @param type the Type as a QName to check against * @return true iff the given NodeTemplate contains the given type in its type hierarchy */ public static boolean checkForTypeInHierarchy(final AbstractNodeTemplate nodeTemplate, final QName type) { @@ -79,11 +84,11 @@ public static boolean checkForTypeInHierarchy(final AbstractNodeTemplate nodeTem } /** - * Returns true if the given QName type denotes to a RelationshipType in the type hierarchy of the - * given RelationshipTemplate + * Returns true if the given QName type denotes to a RelationshipType in the type hierarchy of the given + * RelationshipTemplate * * @param relationshipTemplate an AbstractRelationshipTemplate - * @param type the Type as a QName to check against + * @param type the Type as a QName to check against * @return true iff the given RelationshipTemplate contains the given type in its type hierarchy */ public static boolean checkForTypeInHierarchy(final AbstractRelationshipTemplate relationshipTemplate, @@ -119,7 +124,6 @@ private static void cleanDuplciates(final Collection nodeT } nodeTemplates.clear(); nodeTemplates.addAll(list); - } /** @@ -145,8 +149,7 @@ public static String getStringFromDoc(final org.w3c.dom.Document doc) { transformer.transform(domSource, result); writer.flush(); return writer.toString(); - } - catch (final TransformerException ex) { + } catch (final TransformerException ex) { ModelUtils.LOG.error("Couldn't transform DOM Document to a String", ex); return null; } @@ -205,9 +208,8 @@ public static List getArtifactTypeHierarchy(final AbstractArtifactTemplat /** * Adds the InfrastructureEdges of the given NodeTemplate to the given List * - * @param nodeTemplate an AbstractNodeTemplate - * @param infrastructureEdges a List of AbstractRelationshipTemplate to add the InfrastructureEdges - * to + * @param nodeTemplate an AbstractNodeTemplate + * @param infrastructureEdges a List of AbstractRelationshipTemplate to add the InfrastructureEdges to */ public static void getInfrastructureEdges(final AbstractNodeTemplate nodeTemplate, final List infrastructureEdges) { @@ -235,8 +237,6 @@ public static void getInfrastructureEdges(final AbstractNodeTemplate nodeTemplat infrastructureEdges.add(outgoingEdge); } } - - ModelUtils.cleanDuplicates(infrastructureEdges); } @@ -244,9 +244,9 @@ public static void getInfrastructureEdges(final AbstractNodeTemplate nodeTemplat * Adds the InfrastructureEdges of the given RelationshipTemplate to the given List * * @param relationshipTemplate an AbstractRelationshipTemplate - * @param infraEdges a List of AbstractRelationshipTemplate to add the InfrastructureEdges to - * @param forSource whether to search for InfrastructureEdges along the SourceInterface or - * TargetInterface + * @param infraEdges a List of AbstractRelationshipTemplate to add the InfrastructureEdges to + * @param forSource whether to search for InfrastructureEdges along the SourceInterface or + * TargetInterface */ public static void getInfrastructureEdges(final AbstractRelationshipTemplate relationshipTemplate, final List infraEdges, @@ -258,15 +258,12 @@ public static void getInfrastructureEdges(final AbstractRelationshipTemplate rel } } - - /** - * Calculates all Infrastructure Nodes of all Infrastructure Paths originating from the given - * NodeTemplate + * Calculates all Infrastructure Nodes of all Infrastructure Paths originating from the given NodeTemplate * - * @param nodeTemplate AbstractNodeTemplate from where the search for Infrastructure Nodes begin - * @param infrastructureNodes a List of AbstractNodeTemplates which represent Infrastructure Nodes - * of the given NodeTemplate (including itself when applicable as an infrastructure node) + * @param nodeTemplate AbstractNodeTemplate from where the search for Infrastructure Nodes begin + * @param infrastructureNodes a List of AbstractNodeTemplates which represent Infrastructure Nodes of the given + * NodeTemplate (including itself when applicable as an infrastructure node) * @Info the infrastructureNodes List must be empty */ public static void getInfrastructureNodes(final AbstractNodeTemplate nodeTemplate, @@ -300,10 +297,9 @@ public static void getInfrastructureNodes(final AbstractNodeTemplate nodeTemplat * Adds InfrastructureNodes of the given RelaitonshipTemplate to the given List of NodeTemplates * * @param relationshipTemplate an AbstractRelationshipTemplate to search its InfrastructureNodes - * @param infrastructureNodes a List of AbstractNodeTemplate where the InfrastructureNodes will be - * added - * @param forSource whether to search for InfrastructureNodes along the SourceInterface or - * TargetInterface + * @param infrastructureNodes a List of AbstractNodeTemplate where the InfrastructureNodes will be added + * @param forSource whether to search for InfrastructureNodes along the SourceInterface or + * TargetInterface */ public static void getInfrastructureNodes(final AbstractRelationshipTemplate relationshipTemplate, final List infrastructureNodes, @@ -314,7 +310,6 @@ public static void getInfrastructureNodes(final AbstractRelationshipTemplate rel } else { ModelUtils.getInfrastructureNodes(relationshipTemplate.getTarget(), infrastructureNodes); } - } public static List getIngoingRelations(final AbstractNodeTemplate nodeTemplate, @@ -344,6 +339,7 @@ public static List getIngoingRelations(final Abstr * @param nodeTemplate an AbstractNodeTemplate * @return a QName which represents the baseType of the given NodeTemplate */ + @Deprecated public static QName getNodeBaseType(final AbstractNodeTemplate nodeTemplate) { ModelUtils.LOG.debug("Beginning search for basetype of: " + nodeTemplate.getId()); final List typeHierarchy = ModelUtils.getNodeTypeHierarchy(nodeTemplate.getType()); @@ -359,12 +355,32 @@ public static QName getNodeBaseType(final AbstractNodeTemplate nodeTemplate) { return typeHierarchy.get(typeHierarchy.size() - 1); } + public static TNodeType getNodeBaseType(Csar csar, final TNodeTemplate nodeTemplate) { + LOG.debug("Beginning search for basetype of: " + nodeTemplate.getId()); + final List typeHierarchy; + try { + typeHierarchy = ToscaEngine.resolveNodeTypeHierarchy(csar, nodeTemplate); + } catch (NotFoundException e) { + return null; + } + for (final TNodeType type : typeHierarchy) { + ModelUtils.LOG.debug("Checking Type in Hierarchy, type: " + type.toString()); + if (type.getQName().equals(Types.TOSCABASETYPE_SERVER)) { + return type; + } else if (type.getQName().equals(Types.TOSCABASETYPE_OS)) { + return type; + } + } + // FIXME: when there are no basetypes we're screwed + return typeHierarchy.get(typeHierarchy.size() - 1); + } + /** - * Returns all NodeTemplates from the given NodeTemplate going along the path of relation following - * the target interfaces + * Returns all NodeTemplates from the given NodeTemplate going along the path of relation following the target + * interfaces * * @param nodeTemplate an AbstractNodeTemplate - * @param nodes a List of AbstractNodeTemplate to add the result to + * @param nodes a List of AbstractNodeTemplate to add the result to */ public static void getNodesFromNodeToSink(final AbstractNodeTemplate nodeTemplate, final List nodes) { @@ -386,7 +402,7 @@ public static void getNodesFromNodeToSink(final AbstractNodeTemplate nodeTemplat nodes.add(nodeTemplate); for (final AbstractRelationshipTemplate outgoingTemplate : nodeTemplate.getOutgoingRelations()) { if (ModelUtils.getRelationshipTypeHierarchy(outgoingTemplate.getRelationshipType()) - .contains(relationshipType)) { + .contains(relationshipType)) { // we skip connectTo relations, as they are connecting stacks // and // make the result even more ambigious @@ -412,11 +428,11 @@ public static void getNodesFromNodeToSource(final AbstractNodeTemplate nodeTempl } /** - * Returns all NodeTemplates from the given RelationshipTemplate going along all occuring - * Relationships using the Target + * Returns all NodeTemplates from the given RelationshipTemplate going along all occuring Relationships using the + * Target * * @param relationshipTemplate an AbstractRelationshipTemplate - * @param nodes a List of AbstractNodeTemplate to add the result to + * @param nodes a List of AbstractNodeTemplate to add the result to */ public static void getNodesFromRelationToSink(final AbstractRelationshipTemplate relationshipTemplate, final Collection nodes) { @@ -442,11 +458,10 @@ public static void getNodesFromRelationToSink(final AbstractRelationshipTemplate for (final AbstractRelationshipTemplate outgoingTemplate : nodeTemplate.getOutgoingRelations()) { if (ModelUtils.getRelationshipTypeHierarchy(outgoingTemplate.getRelationshipType()) - .contains(relationshipType)) { + .contains(relationshipType)) { ModelUtils.getNodesFromRelationToSink(outgoingTemplate, relationshipType, nodes); } - } ModelUtils.cleanDuplciates(nodes); } @@ -465,15 +480,15 @@ private static void getNodesFromRelationToSources(final AbstractRelationshipTemp } /** - * Returns a ordered list of QNames. The order represents the inheritance of NodeTypes defining the - * given NodeType. E.g. NodeType "someNodeType" inherits properties from "someOtherNodeType". The - * returns list would have {someNs}someNodeType,{someNs}someOtherNodeType inside, in the exact same - * order. + * Returns a ordered list of QNames. The order represents the inheritance of NodeTypes defining the given NodeType. + * E.g. NodeType "someNodeType" inherits properties from "someOtherNodeType". The returns list would have + * {someNs}someNodeType,{someNs}someOtherNodeType inside, in the exact same order. * * @param nodeType the nodeType to get the hierarchy for - * @return a List containing an order of inheritance of NodeTypes for this NodeType with itself at - * the first spot in the list. + * @return a List containing an order of inheritance of NodeTypes for this NodeType with itself at the first spot in + * the list. */ + @Obsolete public static List getNodeTypeHierarchy(final AbstractNodeType nodeType) { ModelUtils.LOG.debug("Beginning calculating NodeType Hierarchy for: " + nodeType.getId().toString()); final List typeHierarchy = new ArrayList<>(); @@ -562,15 +577,14 @@ public static QName getRelationshipBaseType(final AbstractRelationshipTemplate r } /** - * Returns a ordered list of QNames. The order represents the inheritance of RelationshipTypes - * defining the given RelationshipType. E.g. Relationship "someRelationType" and it inherits - * properties from "someOtherRelationType". The returns list would have - * {someNs}someRelationType,{someNs}someOtherRelationType inside, in the exact same order. Var + * Returns a ordered list of QNames. The order represents the inheritance of RelationshipTypes defining the given + * RelationshipType. E.g. Relationship "someRelationType" and it inherits properties from "someOtherRelationType". + * The returns list would have {someNs}someRelationType,{someNs}someOtherRelationType inside, in the exact same + * order. Var * - * @param definitions the Definitions to look in + * @param definitions the Definitions to look in * @param relationshipType the RelationshipType to get the hierarchy for - * @return a List containing an order of inheritance of RelationshipTypes of the given - * RelationshipType + * @return a List containing an order of inheritance of RelationshipTypes of the given RelationshipType */ public static List getRelationshipTypeHierarchy(final AbstractRelationshipType relationshipType) { final List typeHierarchy = new ArrayList<>(); @@ -593,11 +607,11 @@ public static List getRelationshipTypeHierarchy(final AbstractRelationshi /** * Looks for a childelement with an attribute with the given name and value * - * @param element the element to look in - * @param attributeName the name of the attribute + * @param element the element to look in + * @param attributeName the name of the attribute * @param attributeValue the value of the attribute - * @return true if the given element has a child element with an attribute where - * attrname.equals(attributeName) & attr.value(attributeValue), else false + * @return true if the given element has a child element with an attribute where attrname.equals(attributeName) & + * attr.value(attributeValue), else false */ public static boolean hasChildElementWithAttribute(final Element element, final String attributeName, final String attributeValue) { @@ -637,12 +651,9 @@ public static Collection getPropertyNames(final AbstractNodeTemplate nod * * @param xmlString the xml to transform as String * @return a DOM Node representing the given string - * @throws ParserConfigurationException - * @throws SAXException - * @throws IOException */ public static Node string2dom(final String xmlString) throws ParserConfigurationException, SAXException, - IOException { + IOException { final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); docFactory.setNamespaceAware(true); @@ -657,8 +668,7 @@ public static Node string2dom(final String xmlString) throws ParserConfiguration public static Node string2domQuietly(final String xmlString) { try { return string2dom(xmlString); - } - catch (ParserConfigurationException | SAXException | IOException e) { + } catch (ParserConfigurationException | SAXException | IOException e) { throw new RuntimeException(e); } } @@ -666,20 +676,20 @@ public static Node string2domQuietly(final String xmlString) { /** * Get the AbstractInterface with a certain name from a NodeTemplate * - * @param nodeTemplate the name of the NodeTemplate + * @param nodeTemplate the name of the NodeTemplate * @param interfaceName the name of the interface * @return the AbstractInterface if found, null otherwise */ public static AbstractInterface getInterfaceOfNode(final AbstractNodeTemplate nodeTemplate, final String interfaceName) { return nodeTemplate.getType().getInterfaces().stream().filter(iface -> iface.getName().equals(interfaceName)) - .findFirst().orElse(null); + .findFirst().orElse(null); } /** * Get the AbstractOperation with a certain name from a NodeTemplate * - * @param nodeTemplate the name of the NodeTemplate + * @param nodeTemplate the name of the NodeTemplate * @param interfaceName the name of the interface containing the operation * @param operationName the name of the operation * @return the AbstractOperation if found, null>/code> otherwise @@ -689,7 +699,7 @@ public static AbstractOperation getOperationOfNode(final AbstractNodeTemplate no final AbstractInterface iface = ModelUtils.getInterfaceOfNode(nodeTemplate, interfaceName); if (Objects.nonNull(iface)) { return iface.getOperations().stream().filter(op -> op.getName().equals(operationName)).findFirst() - .orElse(null); + .orElse(null); } else { LOG.error("Unable to find interface {} for NodeTemplate {}", interfaceName, nodeTemplate.getName()); return null; diff --git a/org.opentosca.planbuilder.model/META-INF/resources/activityRecovery.xsd b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/activityRecovery.xsd similarity index 100% rename from org.opentosca.planbuilder.model/META-INF/resources/activityRecovery.xsd rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/activityRecovery.xsd diff --git a/org.opentosca.planbuilder.model/META-INF/resources/dd.xsd b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/dd.xsd similarity index 100% rename from org.opentosca.planbuilder.model/META-INF/resources/dd.xsd rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/dd.xsd diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/activityrecovery/FailureHandling.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/activityrecovery/FailureHandling.java new file mode 100644 index 000000000..c528619e8 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/activityrecovery/FailureHandling.java @@ -0,0 +1,98 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.activityrecovery; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    Java class for anonymous complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType>
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <all>
    + *         <element name="retryFor" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    + *         <element name="retryDelay" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
    + *         <element name="faultOnFailure" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *       </all>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + +}) +@XmlRootElement(name = "failureHandling") +public class FailureHandling { + + protected Integer retryFor; + protected Integer retryDelay; + protected Boolean faultOnFailure; + + /** + * Gets the value of the retryFor property. + * + * @return possible object is {@link Integer } + */ + public Integer getRetryFor() { + return retryFor; + } + + /** + * Sets the value of the retryFor property. + * + * @param value allowed object is {@link Integer } + */ + public void setRetryFor(Integer value) { + this.retryFor = value; + } + + /** + * Gets the value of the retryDelay property. + * + * @return possible object is {@link Integer } + */ + public Integer getRetryDelay() { + return retryDelay; + } + + /** + * Sets the value of the retryDelay property. + * + * @param value allowed object is {@link Integer } + */ + public void setRetryDelay(Integer value) { + this.retryDelay = value; + } + + /** + * Gets the value of the faultOnFailure property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isFaultOnFailure() { + return faultOnFailure; + } + + /** + * Sets the value of the faultOnFailure property. + * + * @param value allowed object is {@link Boolean } + */ + public void setFaultOnFailure(Boolean value) { + this.faultOnFailure = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/activityrecovery/ObjectFactory.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/activityrecovery/ObjectFactory.java new file mode 100644 index 000000000..dad67978d --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/activityrecovery/ObjectFactory.java @@ -0,0 +1,36 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.activityrecovery; + +import javax.xml.bind.annotation.XmlRegistry; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.apache.ode.activityrecovery package. + *

    An ObjectFactory allows you to programatically + * construct new instances of the Java representation for XML content. The Java representation of XML content can + * consist of schema derived interfaces and classes representing the binding of schema type definitions, element + * declarations and model groups. Factory methods for each of these are provided in this class. + */ +@XmlRegistry +public class ObjectFactory { + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.apache.ode.activityrecovery + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link FailureHandling } + */ + public FailureHandling createFailureHandling() { + return new FailureHandling(); + } +} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/activityrecovery/package-info.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/activityrecovery/package-info.java similarity index 100% rename from org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/activityrecovery/package-info.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/activityrecovery/package-info.java diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java new file mode 100644 index 000000000..e2a18af69 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/ObjectFactory.java @@ -0,0 +1,147 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java element interface generated in the + * org.apache.ode.schemas.dd._2007._03 package. + *

    An ObjectFactory allows you to programatically + * construct new instances of the Java representation for XML content. The Java representation of XML content can + * consist of schema derived interfaces and classes representing the binding of schema type definitions, element + * declarations and model groups. Factory methods for each of these are provided in this class. + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _Deploy_QNAME = new QName("http://www.apache.org/ode/schemas/dd/2007/03", "deploy"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * org.apache.ode.schemas.dd._2007._03 + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link TCleanup } + */ + public TCleanup createTCleanup() { + return new TCleanup(); + } + + /** + * Create an instance of {@link TEnableSharing } + */ + public TEnableSharing createTEnableSharing() { + return new TEnableSharing(); + } + + /** + * Create an instance of {@link TDeployment } + */ + public TDeployment createTDeployment() { + return new TDeployment(); + } + + /** + * Create an instance of {@link TProvide } + */ + public TProvide createTProvide() { + return new TProvide(); + } + + /** + * Create an instance of {@link TProcessEvents } + */ + public TProcessEvents createTProcessEvents() { + return new TProcessEvents(); + } + + /** + * Create an instance of {@link TService } + */ + public TService createTService() { + return new TService(); + } + + /** + * Create an instance of {@link TSchedule } + */ + public TSchedule createTSchedule() { + return new TSchedule(); + } + + /** + * Create an instance of {@link TDeployment.Process.MexInterceptors } + */ + public TDeployment.Process.MexInterceptors createTDeploymentProcessMexInterceptors() { + return new TDeployment.Process.MexInterceptors(); + } + + /** + * Create an instance of {@link TInvoke.Binding } + */ + public TInvoke.Binding createTInvokeBinding() { + return new TInvoke.Binding(); + } + + /** + * Create an instance of {@link TDeployment.Process } + */ + public TDeployment.Process createTDeploymentProcess() { + return new TDeployment.Process(); + } + + /** + * Create an instance of {@link TEnableEventList } + */ + public TEnableEventList createTEnableEventList() { + return new TEnableEventList(); + } + + /** + * Create an instance of {@link TMexInterceptor } + */ + public TMexInterceptor createTMexInterceptor() { + return new TMexInterceptor(); + } + + /** + * Create an instance of {@link TDeployment.Process.Property } + */ + public TDeployment.Process.Property createTDeploymentProcessProperty() { + return new TDeployment.Process.Property(); + } + + /** + * Create an instance of {@link TScopeEvents } + */ + public TScopeEvents createTScopeEvents() { + return new TScopeEvents(); + } + + /** + * Create an instance of {@link TInvoke } + */ + public TInvoke createTInvoke() { + return new TInvoke(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TDeployment }{@code >}} + */ + @XmlElementDecl(namespace = "http://www.apache.org/ode/schemas/dd/2007/03", name = "deploy") + public JAXBElement createDeploy(TDeployment value) { + return new JAXBElement(_Deploy_QNAME, TDeployment.class, null, value); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java new file mode 100644 index 000000000..2f24f3433 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TCleanup.java @@ -0,0 +1,137 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    Java class for tCleanup complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tCleanup">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="category" maxOccurs="unbounded" minOccurs="0">
    + *           <simpleType>
    + *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *               <enumeration value="instance"/>
    + *               <enumeration value="variables"/>
    + *               <enumeration value="messages"/>
    + *               <enumeration value="correlations"/>
    + *               <enumeration value="events"/>
    + *               <enumeration value="all"/>
    + *             </restriction>
    + *           </simpleType>
    + *         </element>
    + *         <element name="filter" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="on">
    + *         <simpleType>
    + *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *             <enumeration value="success"/>
    + *             <enumeration value="failure"/>
    + *             <enumeration value="always"/>
    + *           </restriction>
    + *         </simpleType>
    + *       </attribute>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tCleanup", propOrder = { + "category", + "filter" +}) +public class TCleanup { + + @XmlElement(defaultValue = "all") + protected List category; + protected List filter; + @XmlAttribute + protected String on; + + /** + * Gets the value of the category property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the category property. + * + *

    + * For example, to add a new item, do as follows: + *

    +     *    getCategory().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getCategory() { + if (category == null) { + category = new ArrayList(); + } + return this.category; + } + + /** + * Gets the value of the filter property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the filter property. + * + *

    + * For example, to add a new item, do as follows: + *

    +     *    getFilter().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getFilter() { + if (filter == null) { + filter = new ArrayList(); + } + return this.filter; + } + + /** + * Gets the value of the on property. + * + * @return possible object is {@link String } + */ + public String getOn() { + return on; + } + + /** + * Sets the value of the on property. + * + * @param value allowed object is {@link String } + */ + public void setOn(String value) { + this.on = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java new file mode 100644 index 000000000..64b6d61cd --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TDeployment.java @@ -0,0 +1,619 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +/** + *

    Java class for tDeployment complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tDeployment">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="process" maxOccurs="unbounded" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <sequence>
    + *                   <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    + *                   <element name="property" maxOccurs="unbounded" minOccurs="0">
    + *                     <complexType>
    + *                       <complexContent>
    + *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                           <sequence>
    + *                             <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    + *                           </sequence>
    + *                           <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *                         </restriction>
    + *                       </complexContent>
    + *                     </complexType>
    + *                   </element>
    + *                   <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    + *                   <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    + *                   <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    + *                   <element name="mex-interceptors" minOccurs="0">
    + *                     <complexType>
    + *                       <complexContent>
    + *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                           <sequence>
    + *                             <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    + *                           </sequence>
    + *                         </restriction>
    + *                       </complexContent>
    + *                     </complexType>
    + *                   </element>
    + *                   <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    + *                   <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    + *                   <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    + *                 </sequence>
    + *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *                 <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *                 <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tDeployment", propOrder = { + "process" +}) +public class TDeployment { + + protected List process; + + /** + * Gets the value of the process property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the process property. + * + *

    + * For example, to add a new item, do as follows: + *

    +     *    getProcess().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TDeployment.Process } + */ + public List getProcess() { + if (process == null) { + process = new ArrayList(); + } + return this.process; + } + + /** + *

    Java class for anonymous complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <sequence>
    +     *         <element name="active" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="retired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="in-memory" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
    +     *         <element name="property" maxOccurs="unbounded" minOccurs="0">
    +     *           <complexType>
    +     *             <complexContent>
    +     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *                 <sequence>
    +     *                   <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    +     *                 </sequence>
    +     *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *               </restriction>
    +     *             </complexContent>
    +     *           </complexType>
    +     *         </element>
    +     *         <element name="process-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProcessEvents" minOccurs="0"/>
    +     *         <element name="provide" type="{http://www.apache.org/ode/schemas/dd/2007/03}tProvide" maxOccurs="unbounded" minOccurs="0"/>
    +     *         <element name="invoke" type="{http://www.apache.org/ode/schemas/dd/2007/03}tInvoke" maxOccurs="unbounded" minOccurs="0"/>
    +     *         <element name="mex-interceptors" minOccurs="0">
    +     *           <complexType>
    +     *             <complexContent>
    +     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *                 <sequence>
    +     *                   <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    +     *                 </sequence>
    +     *               </restriction>
    +     *             </complexContent>
    +     *           </complexType>
    +     *         </element>
    +     *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}QName" minOccurs="0"/>
    +     *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="3" minOccurs="0"/>
    +     *         <element name="schedule" type="{http://www.apache.org/ode/schemas/dd/2007/03}tSchedule" maxOccurs="unbounded" minOccurs="0"/>
    +     *       </sequence>
    +     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *       <attribute name="fileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    +     *       <attribute name="bpel11wsdlFileName" type="{http://www.w3.org/2001/XMLSchema}string" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "active", + "retired", + "inMemory", + "property", + "processEvents", + "provide", + "invoke", + "mexInterceptors", + "type", + "cleanup", + "schedule" + }) + public static class Process { + + @XmlElement(defaultValue = "true") + protected Boolean active; + @XmlElement(defaultValue = "false") + protected Boolean retired; + @XmlElement(name = "in-memory", defaultValue = "false") + protected Boolean inMemory; + protected List property; + @XmlElement(name = "process-events") + protected TProcessEvents processEvents; + protected List provide; + protected List invoke; + @XmlElement(name = "mex-interceptors") + protected TDeployment.Process.MexInterceptors mexInterceptors; + protected QName type; + protected List cleanup; + protected List schedule; + @XmlAttribute(required = true) + protected QName name; + @XmlAttribute + protected String fileName; + @XmlAttribute(name = "bpel11wsdlFileName") + protected String bpel11WsdlFileName; + + /** + * Gets the value of the active property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isActive() { + return active; + } + + /** + * Sets the value of the active property. + * + * @param value allowed object is {@link Boolean } + */ + public void setActive(Boolean value) { + this.active = value; + } + + /** + * Gets the value of the retired property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isRetired() { + return retired; + } + + /** + * Sets the value of the retired property. + * + * @param value allowed object is {@link Boolean } + */ + public void setRetired(Boolean value) { + this.retired = value; + } + + /** + * Gets the value of the inMemory property. + * + * @return possible object is {@link Boolean } + */ + public Boolean isInMemory() { + return inMemory; + } + + /** + * Sets the value of the inMemory property. + * + * @param value allowed object is {@link Boolean } + */ + public void setInMemory(Boolean value) { + this.inMemory = value; + } + + /** + * Gets the value of the property property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the property property. + * + *

    + * For example, to add a new item, do as follows: + *

    +         *    getProperty().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TDeployment.Process.Property } + */ + public List getProperty() { + if (property == null) { + property = new ArrayList(); + } + return this.property; + } + + /** + * Gets the value of the processEvents property. + * + * @return possible object is {@link TProcessEvents } + */ + public TProcessEvents getProcessEvents() { + return processEvents; + } + + /** + * Sets the value of the processEvents property. + * + * @param value allowed object is {@link TProcessEvents } + */ + public void setProcessEvents(TProcessEvents value) { + this.processEvents = value; + } + + /** + * Gets the value of the provide property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the provide property. + * + *

    + * For example, to add a new item, do as follows: + *

    +         *    getProvide().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TProvide } + */ + public List getProvide() { + if (provide == null) { + provide = new ArrayList(); + } + return this.provide; + } + + /** + * Gets the value of the invoke property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the invoke property. + * + *

    + * For example, to add a new item, do as follows: + *

    +         *    getInvoke().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TInvoke } + */ + public List getInvoke() { + if (invoke == null) { + invoke = new ArrayList(); + } + return this.invoke; + } + + /** + * Gets the value of the mexInterceptors property. + * + * @return possible object is {@link TDeployment.Process.MexInterceptors } + */ + public TDeployment.Process.MexInterceptors getMexInterceptors() { + return mexInterceptors; + } + + /** + * Sets the value of the mexInterceptors property. + * + * @param value allowed object is {@link TDeployment.Process.MexInterceptors } + */ + public void setMexInterceptors(TDeployment.Process.MexInterceptors value) { + this.mexInterceptors = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link QName } + */ + public QName getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value allowed object is {@link QName } + */ + public void setType(QName value) { + this.type = value; + } + + /** + * Gets the value of the cleanup property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the cleanup property. + * + *

    + * For example, to add a new item, do as follows: + *

    +         *    getCleanup().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCleanup } + */ + public List getCleanup() { + if (cleanup == null) { + cleanup = new ArrayList(); + } + return this.cleanup; + } + + /** + * Gets the value of the schedule property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a set + * method for the schedule property. + * + *

    + * For example, to add a new item, do as follows: + *

    +         *    getSchedule().add(newItem);
    +         * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TSchedule } + */ + public List getSchedule() { + if (schedule == null) { + schedule = new ArrayList(); + } + return this.schedule; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(QName value) { + this.name = value; + } + + /** + * Gets the value of the fileName property. + * + * @return possible object is {@link String } + */ + public String getFileName() { + return fileName; + } + + /** + * Sets the value of the fileName property. + * + * @param value allowed object is {@link String } + */ + public void setFileName(String value) { + this.fileName = value; + } + + /** + * Gets the value of the bpel11WsdlFileName property. + * + * @return possible object is {@link String } + */ + public String getBpel11WsdlFileName() { + return bpel11WsdlFileName; + } + + /** + * Sets the value of the bpel11WsdlFileName property. + * + * @param value allowed object is {@link String } + */ + public void setBpel11WsdlFileName(String value) { + this.bpel11WsdlFileName = value; + } + + /** + *

    Java class for anonymous complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    +         * <complexType>
    +         *   <complexContent>
    +         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +         *       <sequence>
    +         *         <element name="mex-interceptor" type="{http://www.apache.org/ode/schemas/dd/2007/03}tMexInterceptor" maxOccurs="unbounded" minOccurs="0"/>
    +         *       </sequence>
    +         *     </restriction>
    +         *   </complexContent>
    +         * </complexType>
    +         * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "mexInterceptor" + }) + public static class MexInterceptors { + + @XmlElement(name = "mex-interceptor") + protected List mexInterceptor; + + /** + * Gets the value of the mexInterceptor property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a + * set method for the mexInterceptor property. + * + *

    + * For example, to add a new item, do as follows: + *

    +             *    getMexInterceptor().add(newItem);
    +             * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TMexInterceptor } + */ + public List getMexInterceptor() { + if (mexInterceptor == null) { + mexInterceptor = new ArrayList(); + } + return this.mexInterceptor; + } + } + + /** + *

    Java class for anonymous complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    +         * <complexType>
    +         *   <complexContent>
    +         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +         *       <sequence>
    +         *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    +         *       </sequence>
    +         *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +         *     </restriction>
    +         *   </complexContent>
    +         * </complexType>
    +         * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "any" + }) + public static class Property { + + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(required = true) + protected QName name; + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you + * make to the returned list will be present inside the JAXB object. This is why there is not a + * set method for the any property. + * + *

    + * For example, to add a new item, do as follows: + *

    +             *    getAny().add(newItem);
    +             * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (any == null) { + any = new ArrayList(); + } + return this.any; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(QName value) { + this.name = value; + } + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java new file mode 100644 index 000000000..f2ef5f04e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableEventList.java @@ -0,0 +1,73 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + +/** + *

    Java class for tEnableEventList complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tEnableEventList">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="enable-event" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tEnableEventList", propOrder = { + "enableEvent" +}) +@XmlSeeAlso( { + TProcessEvents.class, + TScopeEvents.class +}) +public class TEnableEventList { + + @XmlElement(name = "enable-event") + protected List enableEvent; + + /** + * Gets the value of the enableEvent property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the enableEvent property. + * + *

    + * For example, to add a new item, do as follows: + *

    +     *    getEnableEvent().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link String } + */ + public List getEnableEvent() { + if (enableEvent == null) { + enableEvent = new ArrayList(); + } + return this.enableEvent; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java new file mode 100644 index 000000000..0432ea1a7 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TEnableSharing.java @@ -0,0 +1,32 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + +/** + *

    Java class for tEnableSharing complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tEnableSharing">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tEnableSharing") +public class TEnableSharing { + +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java new file mode 100644 index 000000000..2cd730f8d --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TInvoke.java @@ -0,0 +1,200 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +import org.apache.ode.activityrecovery.FailureHandling; + +/** + *

    Java class for tInvoke complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tInvoke">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    + *         <element name="binding" minOccurs="0">
    + *           <complexType>
    + *             <complexContent>
    + *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *                 <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *               </restriction>
    + *             </complexContent>
    + *           </complexType>
    + *         </element>
    + *         <element ref="{http://ode.apache.org/activityRecovery}failureHandling" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *       <attribute name="usePeer2Peer" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tInvoke", propOrder = { + "service", + "binding", + "failureHandling" +}) +public class TInvoke { + + @XmlElement(required = true) + protected TService service; + protected TInvoke.Binding binding; + @XmlElement(namespace = "http://ode.apache.org/activityRecovery") + protected FailureHandling failureHandling; + @XmlAttribute(required = true) + protected String partnerLink; + @XmlAttribute + protected Boolean usePeer2Peer; + + /** + * Gets the value of the service property. + * + * @return possible object is {@link TService } + */ + public TService getService() { + return service; + } + + /** + * Sets the value of the service property. + * + * @param value allowed object is {@link TService } + */ + public void setService(TService value) { + this.service = value; + } + + /** + * Gets the value of the binding property. + * + * @return possible object is {@link TInvoke.Binding } + */ + public TInvoke.Binding getBinding() { + return binding; + } + + /** + * Sets the value of the binding property. + * + * @param value allowed object is {@link TInvoke.Binding } + */ + public void setBinding(TInvoke.Binding value) { + this.binding = value; + } + + /** + * Gets the value of the failureHandling property. + * + * @return possible object is {@link FailureHandling } + */ + public FailureHandling getFailureHandling() { + return failureHandling; + } + + /** + * Sets the value of the failureHandling property. + * + * @param value allowed object is {@link FailureHandling } + */ + public void setFailureHandling(FailureHandling value) { + this.failureHandling = value; + } + + /** + * Gets the value of the partnerLink property. + * + * @return possible object is {@link String } + */ + public String getPartnerLink() { + return partnerLink; + } + + /** + * Sets the value of the partnerLink property. + * + * @param value allowed object is {@link String } + */ + public void setPartnerLink(String value) { + this.partnerLink = value; + } + + /** + * Gets the value of the usePeer2Peer property. + * + * @return possible object is {@link Boolean } + */ + public boolean isUsePeer2Peer() { + if (usePeer2Peer == null) { + return true; + } else { + return usePeer2Peer; + } + } + + /** + * Sets the value of the usePeer2Peer property. + * + * @param value allowed object is {@link Boolean } + */ + public void setUsePeer2Peer(Boolean value) { + this.usePeer2Peer = value; + } + + /** + *

    Java class for anonymous complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    +     * <complexType>
    +     *   <complexContent>
    +     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    +     *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    +     *     </restriction>
    +     *   </complexContent>
    +     * </complexType>
    +     * 
    + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Binding { + + @XmlAttribute(required = true) + protected QName name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(QName value) { + this.name = value; + } + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java new file mode 100644 index 000000000..2edb2b5b9 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TMexInterceptor.java @@ -0,0 +1,61 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + * Message exchange interceptor configuration. + * + * + *

    Java class for tMexInterceptor complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tMexInterceptor">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="class-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
    + *       </sequence>
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tMexInterceptor", propOrder = { + "className" +}) +public class TMexInterceptor { + + @XmlElement(name = "class-name", required = true) + protected String className; + + /** + * Gets the value of the className property. + * + * @return possible object is {@link String } + */ + public String getClassName() { + return className; + } + + /** + * Sets the value of the className property. + * + * @param value allowed object is {@link String } + */ + public void setClassName(String value) { + this.className = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java new file mode 100644 index 000000000..a54212886 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProcessEvents.java @@ -0,0 +1,98 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    Java class for tProcessEvents complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tProcessEvents">
    + *   <complexContent>
    + *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    + *       <sequence>
    + *         <element name="scope-events" type="{http://www.apache.org/ode/schemas/dd/2007/03}tScopeEvents" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="generate">
    + *         <simpleType>
    + *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
    + *             <enumeration value="all"/>
    + *             <enumeration value="none"/>
    + *           </restriction>
    + *         </simpleType>
    + *       </attribute>
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tProcessEvents", propOrder = { + "scopeEvents" +}) +public class TProcessEvents + extends TEnableEventList { + + @XmlElement(name = "scope-events") + protected List scopeEvents; + @XmlAttribute + protected String generate; + + /** + * Gets the value of the scopeEvents property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the scopeEvents property. + * + *

    + * For example, to add a new item, do as follows: + *

    +     *    getScopeEvents().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TScopeEvents } + */ + public List getScopeEvents() { + if (scopeEvents == null) { + scopeEvents = new ArrayList(); + } + return this.scopeEvents; + } + + /** + * Gets the value of the generate property. + * + * @return possible object is {@link String } + */ + public String getGenerate() { + return generate; + } + + /** + * Sets the value of the generate property. + * + * @param value allowed object is {@link String } + */ + public void setGenerate(String value) { + this.generate = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProvide.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProvide.java new file mode 100644 index 000000000..f997a6537 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TProvide.java @@ -0,0 +1,101 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

    Java class for tProvide complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tProvide">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="service" type="{http://www.apache.org/ode/schemas/dd/2007/03}tService"/>
    + *         <element name="enableSharing" type="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableSharing" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="partnerLink" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tProvide", propOrder = { + "service", + "enableSharing" +}) +public class TProvide { + + @XmlElement(required = true) + protected TService service; + protected TEnableSharing enableSharing; + @XmlAttribute(required = true) + protected String partnerLink; + + /** + * Gets the value of the service property. + * + * @return possible object is {@link TService } + */ + public TService getService() { + return service; + } + + /** + * Sets the value of the service property. + * + * @param value allowed object is {@link TService } + */ + public void setService(TService value) { + this.service = value; + } + + /** + * Gets the value of the enableSharing property. + * + * @return possible object is {@link TEnableSharing } + */ + public TEnableSharing getEnableSharing() { + return enableSharing; + } + + /** + * Sets the value of the enableSharing property. + * + * @param value allowed object is {@link TEnableSharing } + */ + public void setEnableSharing(TEnableSharing value) { + this.enableSharing = value; + } + + /** + * Gets the value of the partnerLink property. + * + * @return possible object is {@link String } + */ + public String getPartnerLink() { + return partnerLink; + } + + /** + * Sets the value of the partnerLink property. + * + * @param value allowed object is {@link String } + */ + public void setPartnerLink(String value) { + this.partnerLink = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java new file mode 100644 index 000000000..bde43d32a --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TSchedule.java @@ -0,0 +1,88 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    Java class for tSchedule complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tSchedule">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <element name="cleanup" type="{http://www.apache.org/ode/schemas/dd/2007/03}tCleanup" maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="when" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tSchedule", propOrder = { + "cleanup" +}) +public class TSchedule { + + protected List cleanup; + @XmlAttribute(required = true) + protected String when; + + /** + * Gets the value of the cleanup property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the cleanup property. + * + *

    + * For example, to add a new item, do as follows: + *

    +     *    getCleanup().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link TCleanup } + */ + public List getCleanup() { + if (cleanup == null) { + cleanup = new ArrayList(); + } + return this.cleanup; + } + + /** + * Gets the value of the when property. + * + * @return possible object is {@link String } + */ + public String getWhen() { + return when; + } + + /** + * Sets the value of the when property. + * + * @param value allowed object is {@link String } + */ + public void setWhen(String value) { + this.when = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java new file mode 100644 index 000000000..77eaf2bbd --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TScopeEvents.java @@ -0,0 +1,55 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

    Java class for tScopeEvents complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tScopeEvents">
    + *   <complexContent>
    + *     <extension base="{http://www.apache.org/ode/schemas/dd/2007/03}tEnableEventList">
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
    + *     </extension>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tScopeEvents") +public class TScopeEvents + extends TEnableEventList { + + @XmlAttribute(required = true) + protected String name; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link String } + */ + public void setName(String value) { + this.name = value; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TService.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TService.java new file mode 100644 index 000000000..967cea119 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/TService.java @@ -0,0 +1,119 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2013.05.27 at 03:40:55 PM CEST +// + +package org.apache.ode.schemas.dd._2007._03; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + +import org.w3c.dom.Element; + +/** + *

    Java class for tService complex type. + * + *

    The following schema fragment specifies the expected content contained within this class. + * + *

    + * <complexType name="tService">
    + *   <complexContent>
    + *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
    + *       <sequence>
    + *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
    + *       </sequence>
    + *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}QName" />
    + *       <attribute name="port" use="required" type="{http://www.w3.org/2001/XMLSchema}NCName" />
    + *     </restriction>
    + *   </complexContent>
    + * </complexType>
    + * 
    + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "tService", propOrder = { + "any" +}) +public class TService { + + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(required = true) + protected QName name; + @XmlAttribute(required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NCName") + protected String port; + + /** + * Gets the value of the any property. + * + *

    + * This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to + * the returned list will be present inside the JAXB object. This is why there is not a set method for + * the any property. + * + *

    + * For example, to add a new item, do as follows: + *

    +     *    getAny().add(newItem);
    +     * 
    + * + * + *

    + * Objects of the following type(s) are allowed in the list {@link Object } {@link Element } + */ + public List getAny() { + if (any == null) { + any = new ArrayList(); + } + return this.any; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link QName } + */ + public QName getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is {@link QName } + */ + public void setName(QName value) { + this.name = value; + } + + /** + * Gets the value of the port property. + * + * @return possible object is {@link String } + */ + public String getPort() { + return port; + } + + /** + * Sets the value of the port property. + * + * @param value allowed object is {@link String } + */ + public void setPort(String value) { + this.port = value; + } +} diff --git a/org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/package-info.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/package-info.java similarity index 100% rename from org.opentosca.planbuilder.model/META-INF/resources/generated/org/apache/ode/schemas/dd/_2007/_03/package-info.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/generated/org/apache/ode/schemas/dd/_2007/_03/package-info.java diff --git a/org.opentosca.planbuilder.model/META-INF/resources/genericProcessWsdl.wsdl b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/genericProcessWsdl.wsdl similarity index 100% rename from org.opentosca.planbuilder.model/META-INF/resources/genericProcessWsdl.wsdl rename to org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/genericProcessWsdl.wsdl diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/spring/context-planbuilder-model.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/spring/context-planbuilder-model.xml new file mode 100644 index 000000000..e7ceeff5c --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.model/src/main/resources/spring/context-planbuilder-model.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/pom.xml new file mode 100644 index 000000000..a9df00204 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.postphase.plugin.instancedata + + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + + + + diff --git a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/BPELInstanceDataPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/BPELInstanceDataPlugin.java similarity index 81% rename from org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/BPELInstanceDataPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/BPELInstanceDataPlugin.java index ac1b7fb91..90630e645 100644 --- a/org.opentosca.planbuilder.postphase.plugin.instancedata/src/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/BPELInstanceDataPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/BPELInstanceDataPlugin.java @@ -3,32 +3,36 @@ import javax.xml.namespace.QName; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.plan.AbstractPlan; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPolicyAwarePrePhasePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractPolicy; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwarePrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.springframework.stereotype.Component; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** *

    - * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to - * the OpenTOSCA Container InstanceData API + * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to the OpenTOSCA + * Container InstanceData API *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ +@Component public class BPELInstanceDataPlugin implements IPlanBuilderPostPhasePlugin, - IPlanBuilderPolicyAwarePrePhasePlugin { + IPlanBuilderPolicyAwarePrePhasePlugin { private static final String PLAN_ID = "OpenTOSCA InstanceData Post Phase Plugin"; + private final Handler handler = new Handler(); + + private final QName securePasswordPolicyType = + new QName("http://opentosca.org/policytypes", "SecurePasswordPolicyType"); + @Override public boolean canHandleCreate(BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { // we can handle nodes @@ -56,15 +60,10 @@ public String getID() { return PLAN_ID; } - private final Handler handler = new Handler(); - - private final QName securePasswordPolicyType = - new QName("http://opentosca.org/policytypes", "SecurePasswordPolicyType"); - @Override public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { // TODO FIXME this is a huge assumption right now! Not all management plans need - // instance handling for provisioning + // instance handling for provisioning return this.handler.handleCreate(context, nodeTemplate); } @@ -116,7 +115,7 @@ public int getPriority() { @Override public boolean handleUpdate(BPELPlanContext sourceContext, BPELPlanContext targetContext, AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate) { - if(this.canHandleUpdate(sourceNodeTemplate, targetNodeTemplate)) { + if (this.canHandleUpdate(sourceNodeTemplate, targetNodeTemplate)) { return this.handler.handleUpdate(sourceContext, targetContext, sourceNodeTemplate, targetNodeTemplate); } return false; @@ -125,10 +124,7 @@ public boolean handleUpdate(BPELPlanContext sourceContext, BPELPlanContext targe @Override public boolean canHandleUpdate(AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate) { // this plugin can create instance data for only equal nodeTemplates as of now - if(sourceNodeTemplate.getType().getId().equals(targetNodeTemplate.getType().getId())) { - return true; - } - return false; + return sourceNodeTemplate.getType().getId().equals(targetNodeTemplate.getType().getId()); } @Override @@ -136,7 +132,7 @@ public boolean handleUpdate(BPELPlanContext sourceContext, BPELPlanContext targe AbstractRelationshipTemplate sourceRelationshipTemplate, AbstractRelationshipTemplate targetRelationshipTemplate) { - if(this.canHandleUpdate(sourceRelationshipTemplate, targetRelationshipTemplate)) { + if (this.canHandleUpdate(sourceRelationshipTemplate, targetRelationshipTemplate)) { return this.handler.handleUpdate(sourceContext, targetContext, sourceRelationshipTemplate, targetRelationshipTemplate); } return false; @@ -145,10 +141,6 @@ public boolean handleUpdate(BPELPlanContext sourceContext, BPELPlanContext targe @Override public boolean canHandleUpdate(AbstractRelationshipTemplate sourceRelationshipTemplate, AbstractRelationshipTemplate targetRelationshipTemplate) { - if(sourceRelationshipTemplate.getType().equals(targetRelationshipTemplate.getType())) { - return true; - } - return false; + return sourceRelationshipTemplate.getType().equals(targetRelationshipTemplate.getType()); } - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Fragments.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Fragments.java new file mode 100644 index 000000000..3225138c0 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Fragments.java @@ -0,0 +1,511 @@ +/** + * + */ +package org.opentosca.planbuilder.postphase.plugin.instancedata.bpel; + +import java.io.IOException; +import java.io.StringReader; +import java.net.URL; +import java.util.Map; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.common.file.ResourceAccess; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + *

    + * This class contains all the BPEL Fragments + *

    + * Copyright 2014 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + * + */ +public class Fragments { + + private final DocumentBuilderFactory docFactory; + private final DocumentBuilder docBuilder; + + /** + * Constructor + * + * @throws ParserConfigurationException is thrown when initializing the internal DocumentBuild fails + */ + public Fragments() throws ParserConfigurationException { + this.docFactory = DocumentBuilderFactory.newInstance(); + this.docFactory.setNamespaceAware(true); + this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } + + /** + * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. + * + * @param bpelVarName the variable containing an URL + * @param responseVarName the variable to hold the response + * @return a String containing a BPEL4RESTLight Activity + * @throws IOException is thrown when reading internal files fails + */ + public String createRESTDeleteOnURLBPELVarAsString(final String bpelVarName, + final String responseVarName) throws IOException { + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightDELETE.xml"); + // + String template = ResourceAccess.readResourceAsString(url); + template = template.replace("$urlVarName", bpelVarName); + template = template.replace("$ResponseVarName", responseVarName); + + return template; + } + + /** + * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. + * + * @param bpelVarName the variable containing an URL + * @param responseVarName the variable to hold the response + * @return a String containing a BPEL4RESTLight Activity + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node createRESTDeleteOnURLBPELVarAsNode(final String bpelVarName, + final String responseVarName) throws IOException, SAXException { + final String templateString = createRESTDeleteOnURLBPELVarAsString(bpelVarName, responseVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a BPEL4RESTLight extension activity that sets the instance state of the given + * nodeInstance with the contents of the given string variable + * + * @param instanceURLVar the variable holding the url to the node instance + * @param RequestVarName the variable to take the request body contents from + * @return a String containing a single BPEL extension activity + * @throws IOException is thrown when reading a internal file fails + */ + public String generateBPEL4RESTLightPUTInstanceState(final String instanceURLVar, + final String RequestVarName) throws IOException { + // BPEL4RESTLightPUT_NodeInstance_State_InstanceDataAPI.xml + // + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml"); + String bpel4restString = ResourceAccess.readResourceAsString(url); + ; + + bpel4restString = bpel4restString.replace("$instanceURLVar", instanceURLVar); + bpel4restString = bpel4restString.replace("$RequestVarName", RequestVarName); + + return bpel4restString; + } + + public String generateBPEL4RESTLightGETInstanceState(final String instanceURLVar, + final String ResponseVarName) throws IOException { + // BPEL4RESTLightPUT_NodeInstance_State_InstanceDataAPI.xml + // + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml"); + String bpel4restString = ResourceAccess.readResourceAsString(url); + + bpel4restString = bpel4restString.replace("$instanceURLVar", instanceURLVar); + bpel4restString = bpel4restString.replace("$ResponseVarName", ResponseVarName); + + return bpel4restString; + } + + public Node generateBPEL4RESTLightGETInstanceStateAsNode(final String instanceURLVar, + final String ResponseVarName) throws SAXException, IOException { + return this.toDom(this.generateBPEL4RESTLightGETInstanceState(instanceURLVar, ResponseVarName)); + } + + private Node toDom(String templateString) throws SAXException, IOException { + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a String containing a BPEL assign that reads the value of a NodeInstance create + * response and writes it into the referenced string variable + * + * @param nodeInstanceURLVarName the string variable to write the data into + * @param nodeInstancePOSTResponseVarName the response variable of a nodeInstance create POST + * @return a String containing a BPEL assign + * @throws IOException is thrown when reading a internal file fails + */ + public String generateAssignFromNodeInstancePOSTResponseToStringVar(final String nodeInstanceURLVarName, + final String nodeInstanceIDVarName, + final String nodeInstancePOSTResponseVarName) throws IOException { + // BPELAssignFromNodeInstancePOSTResponseToStringVar.xml + // + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml"); + String bpelAssignString = ResourceAccess.readResourceAsString(url); + + bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", nodeInstanceURLVarName); + bpelAssignString = + bpelAssignString.replaceAll("\\$NodeInstanceResponseVarName", nodeInstancePOSTResponseVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$nodeInstanceIDVar", nodeInstanceIDVarName); + + return bpelAssignString; + } + + /** + * Generates a String containing a BPEL assign that reads the value of a RelationInstance create + * response and writes it into the referenced string variable + * + * @param stringVarName the string variable to write the data into + * @param relationInstancePOSTResponseVarName the response variable of a relationInstance create + * POST + * @return a String containing a BPEL assign + * @throws IOException is thrown when reading a internal file fails + */ + public String generateAssignFromRelationInstancePOSTResponseToStringVar(final String stringVarName, + final String relationInstanceIDVar, + final String relationInstancePOSTResponseVarName) throws IOException { + // BPELAssignFromNodeInstancePOSTResponseToStringVar.xml + // + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml"); + String bpelAssignString = ResourceAccess.readResourceAsString(url); + + bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", stringVarName); + bpelAssignString = + bpelAssignString.replaceAll("\\$RelationInstanceResponseVarName", relationInstancePOSTResponseVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$relationInstanceIDVar", relationInstanceIDVar); + + return bpelAssignString; + } + + /** + * Generates a String containing a BPEL4RESTLight extension activity which create a nodeTemplate + * instance on the given serviceTemplate instance + * + * @param serviceInstanceURLVar the variable holding the serviceInstanceUrl + * @param nodeTemplateId the id of the nodeTemplate to instantiate + * @param responseVariableName the variable to store the response into + * @return a String containing a BPEL extension activity + * @throws IOException is thrown when reading the internal file fails + */ + public String generateBPEL4RESTLightNodeInstancePOST(final String serviceInstanceURLVar, + final String serviceInstanceIDVarName, + final String nodeTemplateId, + final String responseVariableName) throws IOException { + // + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml"); + String bpel4RestString = ResourceAccess.readResourceAsString(url); + + bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceURLVar", serviceInstanceURLVar); + bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceIDVar", serviceInstanceIDVarName); + bpel4RestString = bpel4RestString.replaceAll("\\$nodeTemplateId", nodeTemplateId); + bpel4RestString = bpel4RestString.replaceAll("\\$ResponseVarName", responseVariableName); + + return bpel4RestString; + } + + /** + * Generates a String containing a BPEL4RESTLight extension activity which creates a Relationship + * Template instance on the given Service Template instance + * + * @param serviceInstanceURLVar the variable holding the serviceInstanceUrl + * @param relationshipTemplateId the id of the Relationship Template to instantiate + * @param responseVariableName the variable to store the response into + * @param sourceInstanceIdVarName the variable name of the instance Id of the source node instance + * of the relation to be created + * @param targetInstanceIdVarName the variable name of the instance Id of the target node instance + * of the relation to be created + * @return a String containing a BPEL extension activity + * @throws IOException is thrown when reading the internal file fails + */ + public String generateBPEL4RESTLightRelationInstancePOST(final String serviceInstanceURLVar, + final String relationshipTemplateId, + final String requestVariableName, + final String responseVariableName, + final String sourceInstanceIdVarName, + final String targetInstanceIdVarName, + final String serviceInstanceIdVarName) throws IOException { + // + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml"); + String bpel4RestString = ResourceAccess.readResourceAsString(url); + + bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceURLVar", serviceInstanceURLVar); + bpel4RestString = bpel4RestString.replaceAll("\\$relationshipTemplateId", relationshipTemplateId); + bpel4RestString = bpel4RestString.replaceAll("\\$RequestVarName", requestVariableName); + bpel4RestString = bpel4RestString.replaceAll("\\$ResponseVarName", responseVariableName); + bpel4RestString = bpel4RestString.replaceAll("\\$sourceInstanceIdVarName", sourceInstanceIdVarName); + bpel4RestString = bpel4RestString.replaceAll("\\$targetInstanceIdVarName", targetInstanceIdVarName); + bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceIdVarName", serviceInstanceIdVarName); + + return bpel4RestString; + } + + public String generateBPEL4RESTLightServiceInstancePOST(final String instanceDataAPIUrlVariableName, + final String csarId, final QName serviceTemplateId, + final String responseVariableName) throws IOException { + // tags in xml snippet: $InstanceDataURLVar, $CSARName, + // $serviceTemplateId, $ResponseVarName + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml"); + String bpel4RestString = ResourceAccess.readResourceAsString(url); + + bpel4RestString = bpel4RestString.replace("$InstanceDataURLVar", instanceDataAPIUrlVariableName); + bpel4RestString = bpel4RestString.replace("$CSARName", csarId); + bpel4RestString = bpel4RestString.replace("$serviceTemplateId", serviceTemplateId.toString()); + bpel4RestString = bpel4RestString.replace("$ResponseVarName", responseVariableName); + + return bpel4RestString; + } + + public Node generateBPEL4RESTLightServiceInstancePOSTAsNode(final String instanceDataAPIUrlVariableName, + final String csarId, final QName serviceTemplateId, + final String responseVariableName) throws IOException, + SAXException { + final String templateString = + generateBPEL4RESTLightServiceInstancePOST(instanceDataAPIUrlVariableName, csarId, serviceTemplateId, + responseVariableName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateServiceInstanceURLVarAssign(final String serviceInstanceResponseVarName, + final String serviceInstanceURLVarName) throws IOException { + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BpelAssignServiceInstancePOSTResponse.xml"); + String bpelAssignString = ResourceAccess.readResourceAsString(url); + // + + bpelAssignString = + bpelAssignString.replace("$assignName", "assignServiceInstance" + System.currentTimeMillis()); + bpelAssignString = bpelAssignString.replace("$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); + bpelAssignString = bpelAssignString.replace("$ServiceInstanceURLVarName", serviceInstanceURLVarName); + return bpelAssignString; + } + + public Node generateServiceInstanceURLVarAssignAsNode(final String serviceInstanceResponseVarName, + final String serviceInstanceURLVarName) throws IOException, + SAXException { + final String templateString = + generateServiceInstanceURLVarAssign(serviceInstanceResponseVarName, serviceInstanceURLVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public Node generateNodeInstancesQueryGETasNode(final String instanceDataUrlVarName, final String responseVarName, + final QName nodeType) throws IOException, SAXException { + final String templateString = + generateNodeInstancePropertiesGET(instanceDataUrlVarName, responseVarName, nodeType); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateInstancePropertiesGET(final String instanceUrlVarName, + final String bpel4RestLightResponseVarName) throws IOException { + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightGET_Instance_Properties.xml"); + String bpel4restLightGETString = ResourceAccess.readResourceAsString(url); + // + bpel4restLightGETString = bpel4restLightGETString.replace("$urlVarName", instanceUrlVarName); + bpel4restLightGETString = bpel4restLightGETString.replace("$ResponseVarName", bpel4RestLightResponseVarName); + return bpel4restLightGETString; + } + + public Node generateInstancePropertiesGETAsNode(final String instanceUrlVarName, + final String bpel4RestLightResponseVarName) throws SAXException, + IOException { + final String templateString = generateInstancePropertiesGET(instanceUrlVarName, bpel4RestLightResponseVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateAssignFromNodeInstanceResonseToStringVar(final String stringVarName, + final String nodeInstanceResponseVarName) throws IOException { + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BpelAssignFromNodeInstanceRequestToStringVar.xml"); + String bpelAssignString = ResourceAccess.readResourceAsString(url); + // + bpelAssignString = bpelAssignString.replace("$stringVarName", stringVarName); + bpelAssignString = bpelAssignString.replace("$NodeInstanceResponseVarName", nodeInstanceResponseVarName); + return bpelAssignString; + } + + public Node generateAssignFromNodeInstanceResponseToStringVarAsNode(final String stringVarName, + final String nodeInstanceResponseVarName) throws IOException, + SAXException { + final String templateString = + generateAssignFromNodeInstanceResonseToStringVar(stringVarName, nodeInstanceResponseVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateNodeInstancePropertiesGET(final String instanceDataUrlVarName, final String responseVarName, + final QName nodeType) throws IOException { + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml"); + String bpelAssignString = ResourceAccess.readResourceAsString(url); + + // $InstanceDataURLVar, $ResponseVarName, $nodeType + + bpelAssignString = bpelAssignString.replace("$InstanceDataURLVar", instanceDataUrlVarName); + bpelAssignString = bpelAssignString.replace("$ResponseVarName", responseVarName); + bpelAssignString = bpelAssignString.replace("$nodeType", nodeType.toString()); + return bpelAssignString; + } + + public String generateServiceInstanceRequestToStringVarAssign(final String stringVarName, + final String serviceInstanceResponseVarName, + final int nodeInstanceIndex) throws IOException { + // + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BpelAssignFromServiceInstanceRequestToStringVar.xml"); + String bpelAssignString = ResourceAccess.readResourceAsString(url); + + bpelAssignString = bpelAssignString.replace("$stringVarName", stringVarName); + bpelAssignString = bpelAssignString.replace("$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); + bpelAssignString = bpelAssignString.replace("$nodeInstanceIndex", String.valueOf(nodeInstanceIndex)); + + return bpelAssignString; + } + + public Node generateServiceInstanceRequestToStringVarAssignAsNode(final String stringVarName, + final String serviceInstanceResponseVarName, + final int nodeInstanceIndex) throws IOException, + SAXException { + final String templateString = + generateServiceInstanceRequestToStringVarAssign(stringVarName, serviceInstanceResponseVarName, + nodeInstanceIndex); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateBPEL4RESTLightGET(final String urlVarName, final String responseVarName) throws IOException { + // BPEL4RESTLightGET_ServiceInstance_InstanceDataAPI.xml + // + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightGET.xml"); + String bpelServiceInstanceGETString = ResourceAccess.readResourceAsString(url); + + bpelServiceInstanceGETString = bpelServiceInstanceGETString.replace("$urlVarName", urlVarName); + bpelServiceInstanceGETString = bpelServiceInstanceGETString.replace("$ResponseVarName", responseVarName); + return bpelServiceInstanceGETString; + } + + public Node generateBPEL4RESTLightGETAsNode(final String serviceInstanceUrlVarName, + final String responseVarName) throws IOException, SAXException { + final String templateString = generateBPEL4RESTLightGET(serviceInstanceUrlVarName, responseVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateAssignFromInputMessageToStringVariable(final String inputMessageElementLocalName, + final String stringVariableName) throws IOException { + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BpelAssignFromInputToStringVar.xml"); + String bpelAssignString = ResourceAccess.readResourceAsString(url); + // + bpelAssignString = bpelAssignString.replace("$inputElementLocalName", inputMessageElementLocalName); + bpelAssignString = bpelAssignString.replace("$StringVariableName", stringVariableName); + bpelAssignString = + bpelAssignString.replace("$assignName", "assignFromInputToString" + System.currentTimeMillis()); + return bpelAssignString; + } + + public Node generateAssignFromInputMessageToStringVariableAsNode(final String inputMessageElementLocalName, + final String stringVariableName) throws IOException, + SAXException { + final String templateString = + generateAssignFromInputMessageToStringVariable(inputMessageElementLocalName, stringVariableName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateCopyFromStringVarToAnyTypeVar(final String propertyVarName, + final String nodeInstancePropertyRequestVarName, + final String nodeInstancePropertyLocalName, + final String nodeInstancePropertyNamespace) throws IOException { + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BpelCopyFromPropertyVarToNodeInstanceProperty.xml"); + String bpelAssignString = ResourceAccess.readResourceAsString(url); + // + bpelAssignString = bpelAssignString.replace("$PropertyVarName", propertyVarName); + bpelAssignString = + bpelAssignString.replace("$NodeInstancePropertyRequestVarName", nodeInstancePropertyRequestVarName); + bpelAssignString = bpelAssignString.replace("$NodeInstancePropertyLocalName", nodeInstancePropertyLocalName); + bpelAssignString = bpelAssignString.replace("$NodeInstancePropertyNamespace", nodeInstancePropertyNamespace); + return bpelAssignString; + } + + public Node generateCopyFromStringVarToAnyTypeVarAsNode(final String propertyVarName, + final String nodeInstancePropertyRequestVarName, + final String nodeInstancePropertyLocalName, + final String nodeInstancePropertyNamespace) throws IOException, + SAXException { + final String templateString = + generateCopyFromStringVarToAnyTypeVar(propertyVarName, nodeInstancePropertyRequestVarName, + nodeInstancePropertyLocalName, nodeInstancePropertyNamespace); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public Node generateAssignFromPropertyVarToDomMapping(final String nodeInstancePropertyRequestVarName, + final Map propertyVarToDomMapping) throws SAXException, + IOException { + // create empty bpel:assign + final String bpelAssignString = + ""; + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(bpelAssignString)); + final Document doc = this.docBuilder.parse(is); + + final Node assignNode = doc.getFirstChild(); + for (final String propertyVarName : propertyVarToDomMapping.keySet()) { + final Node propertyNode = propertyVarToDomMapping.get(propertyVarName); + Node copyNode = + generateCopyFromStringVarToAnyTypeVarAsNode(propertyVarName, nodeInstancePropertyRequestVarName, + propertyNode.getLocalName(), + propertyNode.getNamespaceURI()); + + copyNode = doc.importNode(copyNode, true); + assignNode.appendChild(copyNode); + } + + return assignNode; + } + + public String generateInstancesBPEL4RESTLightPUT(final String requestVarName, + final String instanceURLVarName) throws IOException { + final URL url = getClass().getClassLoader().getResource("instancedata-plugin/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml"); + String bpel4RESTLightPut = ResourceAccess.readResourceAsString(url); + + // + bpel4RESTLightPut = bpel4RESTLightPut.replace("$RequestVarName", requestVarName); + bpel4RESTLightPut = bpel4RESTLightPut.replace("$instanceURLVar", instanceURLVarName); + return bpel4RESTLightPut; + } + + public Node generateInstancesBPEL4RESTLightPUTAsNode(final String requestVarName, + final String instanceURLVarName) throws IOException, + SAXException { + final String templateString = generateInstancesBPEL4RESTLightPUT(requestVarName, instanceURLVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Handler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Handler.java new file mode 100644 index 000000000..71523e980 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/Handler.java @@ -0,0 +1,1836 @@ +package org.opentosca.planbuilder.postphase.plugin.instancedata.bpel; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.opentosca.container.core.tosca.convention.Interfaces; +import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.model.plan.ActivityType; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.model.tosca.AbstractInterface; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; +import org.opentosca.planbuilder.model.tosca.AbstractParameter; +import org.opentosca.planbuilder.model.tosca.AbstractProperties; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +/** + *

    + * This class contains all logic to append BPEL code which updates the InstanceData of a NodeTemplate + *

    + * Copyright 2014 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public class Handler { + + private final static Logger LOG = LoggerFactory.getLogger(Handler.class); + + private Fragments fragments; + private BPELProcessFragments bpelFrags; + private BPELInvokerPlugin invoker; + + private final XPathFactory xPathfactory = XPathFactory.newInstance(); + + public Handler() { + + try { + this.fragments = new Fragments(); + this.bpelFrags = new BPELProcessFragments(); + this.invoker = new BPELInvokerPlugin(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + + private String createRESTResponseVar(final BPELPlanContext context) { + final String restCallResponseVarName = "bpel4restlightVarResponse" + context.getIdForNames(); + final QName restCallResponseDeclId = + context.importQName(new QName("http://www.w3.org/2001/XMLSchema", "anyType", "xsd")); + if (!context.addGlobalVariable(restCallResponseVarName, BPELPlan.VariableType.TYPE, restCallResponseDeclId)) { + return null; + } + return restCallResponseVarName; + } + + private String createStateVar(final BPELPlanContext context, final String templateId) { + // create state variable inside scope + final String stateVarName = ModelUtils.makeValidNCName(templateId) + "_state_" + context.getIdForNames(); + final QName stringTypeDeclId = + context.importQName(new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); + if (!context.addGlobalVariable(stateVarName, BPELPlan.VariableType.TYPE, stringTypeDeclId)) { + return null; + } + + return stateVarName; + } + + public String createInstanceURLVar(final BPELPlanContext context, final String templateId) { + final String instanceURLVarName = (context.getRelationshipTemplate() == null ? "node" : "relationship") + + "InstanceURL_" + ModelUtils.makeValidNCName(templateId) + "_" + context.getIdForNames(); + final QName stringTypeDeclId = + context.importQName(new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); + if (!context.addGlobalVariable(instanceURLVarName, BPELPlan.VariableType.TYPE, stringTypeDeclId)) { + return null; + } + + return instanceURLVarName; + } + + public String createInstanceIDVar(final BPELPlanContext context, final String templateId) { + final String instanceURLVarName = (context.getRelationshipTemplate() == null ? "node" : "relationship") + + "InstanceID_" + ModelUtils.makeValidNCName(templateId) + "_" + context.getIdForNames(); + final QName stringTypeDeclId = + context.importQName(new QName("http://www.w3.org/2001/XMLSchema", "string", "xsd")); + if (!context.addGlobalVariable(instanceURLVarName, BPELPlan.VariableType.TYPE, stringTypeDeclId)) { + return null; + } + + return instanceURLVarName; + } + + public boolean handleTerminate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { + final boolean hasProps = checkProperties(nodeTemplate.getProperties()); + + final String serviceInstanceVarName = context.getServiceInstanceURLVarName(); + if (serviceInstanceVarName == null) { + return false; + } + + /* + * Pre Phase code + */ + + // create variable for all responses + final String restCallResponseVarName = createRESTResponseVar(context); + + if (restCallResponseVarName == null) { + return false; + } + + // create state variable inside scope + final String stateVarName = createStateVar(context, context.getNodeTemplate().getId()); + + if (stateVarName == null) { + return false; + } + + String nodeInstanceURLVarName = ""; + + if (context.findInstanceURLVar(context.getNodeTemplate().getId(), true) == null) { + // generate String var for nodeInstance URL + nodeInstanceURLVarName = createInstanceURLVar(context, context.getNodeTemplate().getId()); + } else { + nodeInstanceURLVarName = context.findInstanceURLVar(context.getNodeTemplate().getId(), true); + } + + if (nodeInstanceURLVarName == null) { + return false; + } + + // we'll use this later when we determine that the handle Node doesn't + // have lifecycle operations. Without this check all nodes without + // lifecycle (or cloud prov operations) will be in an uninstalled state + String lastSetState = "DELETED"; + + /* + * Prov Phase code + */ + + // fetch all assigns that assign an invoke async operation request + + final Element provisioningPhaseElement = context.getProvisioningPhaseElement(); + final List assignContentElements = fetchInvokerCallAssigns(provisioningPhaseElement); + + // for each assign element we fetch the operation name, determine the + // pre and post states, and append the pre state before the found assign + // and the post state after the receive of the invoker iteraction + for (final Element assignContentElement : assignContentElements) { + + // fetch operationName from literal contents + final String operationName = fetchOperationName(assignContentElement); + // determine pre and post state for operation + final String preState = InstanceStates.getOperationPreState(operationName); + final String postState = InstanceStates.getOperationPostState(operationName); + + if (preState != null) { + + try { + + // assign prestate to state variable + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignNodeStateFor_" + + operationName + "_" + System.currentTimeMillis(), "string('" + preState + "')", stateVarName); + assignNode = context.importNode(assignNode); + lastSetState = preState; + + // assign the state before the assign of the invoker request + // is made + final Node bpelAssignNode = + assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); + bpelAssignNode.getParentNode().insertBefore(assignNode, bpelAssignNode); + + // create REST Put activity + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + + // send the state before the assign of the invoker request + // is made + bpelAssignNode.getParentNode().insertBefore(extActiv, bpelAssignNode); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + + if (postState != null) { + try { + // create state assign activity + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = + frag.createAssignXpathQueryToStringVarFragmentAsNode("assignNodeState_" + operationName + "_" + + System.currentTimeMillis(), "string('" + postState + "')", stateVarName); + assignNode = context.importNode(assignNode); + + lastSetState = postState; + + /* + * assign the state after the receiving the response of the + */ + + // fetch assign node + final Node bpelAssignNode = + assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); + + // fetch the variable name which is used as request body + final String reqVarName = fetchRequestVarNameFromInvokerAssign(assignContentElement); + + // from the assign element search for the receive element + // that is witing for the response + final Element invokerReceiveElement = fetchInvokerReceive((Element) bpelAssignNode, reqVarName); + + // insert assign after the receive + assignNode = invokerReceiveElement.getParentNode() + .insertBefore(assignNode, invokerReceiveElement.getNextSibling()); + + // create PUT activity + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + + // insert REST call after the assign + invokerReceiveElement.getParentNode().insertBefore(extActiv, assignNode.getNextSibling()); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + } + + // needs property update only if the node has properties + if (hasProps) { + // make a GET on the nodeInstance properties + + try { + // fetch properties + Node nodeInstancePropsGETNode = + this.fragments.generateInstancePropertiesGETAsNode(nodeInstanceURLVarName, restCallResponseVarName); + nodeInstancePropsGETNode = context.importNode(nodeInstancePropsGETNode); + context.getPostPhaseElement().appendChild(nodeInstancePropsGETNode); + } catch (final SAXException e1) { + e1.printStackTrace(); + return false; + } catch (final IOException e1) { + e1.printStackTrace(); + return false; + } + + // assign the values from the property variables into REST/HTTP + // Request + // and send + // first build a mapping from property variable names to dom element + final Map propertyVarNameToDOMMapping = + buildMappingsFromVarNameToDomElement(context, nodeTemplate); + try { + // then generate an assign to have code that writes the runtime + // values into the instance data db. + // we use the restCallResponseVarName from the GET before, as it + // has + // proper format + Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, + propertyVarNameToDOMMapping); + assignNode = context.importNode(assignNode); + context.getPostPhaseElement().appendChild(assignNode); + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } catch (final IOException e) { + e.printStackTrace(); + return false; + } + + // generate BPEL4RESTLight PUT request to update the instance data + try { + Node bpel4restPUTNode = this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, + nodeInstanceURLVarName); + bpel4restPUTNode = context.importNode(bpel4restPUTNode); + context.getPostPhaseElement().appendChild(bpel4restPUTNode); + } catch (final IOException e) { + e.printStackTrace(); + return false; + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } + } + + this.appendStateUpdateToPostPhase(context, nodeInstanceURLVarName, stateVarName, lastSetState); + this.appendFailedStateToFaultHandler(context, nodeInstanceURLVarName); + return true; + } + + public boolean handleTerminate(final BPELPlanContext context, AbstractRelationshipTemplate relationshipTemplate) { + final String restCallResponseVarName = createRESTResponseVar(context); + final String stateVarName = createStateVar(context, relationshipTemplate.getId()); + + String relationInstanceURLVarName = context.findInstanceURLVar(relationshipTemplate.getId(), false); + + // we'll use this later when we determine that the handle Node doesn't + // have lifecycle operations. Without this check all nodes without + // lifecycle (or cloud prov operations) will be in an uninstalled state + String lastSetState = "DELETED"; + + final Element provisioningPhaseElement = context.getProvisioningPhaseElement(); + final List assignContentElements = fetchInvokerCallAssigns(provisioningPhaseElement); + + // for each assign element we fetch the operation name, determine the + // pre and post states, and append the pre state before the found assign + // and the post state after the receive of the invoker iteraction + for (final Element assignContentElement : assignContentElements) { + + // fetch operationName from literal contents + final String operationName = fetchOperationName(assignContentElement); + // determine pre and post state for operation + final String preState = InstanceStates.getOperationPreState(operationName); + final String postState = InstanceStates.getOperationPostState(operationName); + + if (preState != null) { + + try { + + // assign prestate to state variable + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignRelationStateFor_" + + operationName + "_" + System.currentTimeMillis(), "string('" + preState + "')", stateVarName); + assignNode = context.importNode(assignNode); + lastSetState = preState; + + // assign the state before the assign of the invoker request + // is made + final Node bpelAssignNode = + assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); + bpelAssignNode.getParentNode().insertBefore(assignNode, bpelAssignNode); + + // create REST Put activity + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(relationInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + + // send the state before the assign of the invoker request + // is made + bpelAssignNode.getParentNode().insertBefore(extActiv, bpelAssignNode); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + + if (postState != null) { + try { + // create state assign activity + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = + frag.createAssignXpathQueryToStringVarFragmentAsNode("assignRelationState_" + operationName + "_" + + System.currentTimeMillis(), "string('" + postState + "')", stateVarName); + assignNode = context.importNode(assignNode); + + lastSetState = postState; + + /* + * assign the state after the receiving the response of the + */ + + // fetch assign node + final Node bpelAssignNode = + assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); + + // fetch the variable name which is used as request body + final String reqVarName = fetchRequestVarNameFromInvokerAssign(assignContentElement); + + // from the assign element search for the receive element + // that is witing for the response + final Element invokerReceiveElement = fetchInvokerReceive((Element) bpelAssignNode, reqVarName); + + // insert assign after the receive + assignNode = invokerReceiveElement.getParentNode() + .insertBefore(assignNode, invokerReceiveElement.getNextSibling()); + + // create PUT activity + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(relationInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + + // insert REST call after the assign + invokerReceiveElement.getParentNode().insertBefore(extActiv, assignNode.getNextSibling()); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + } + + // needs property update only if the node has properties + if (this.checkProperties(relationshipTemplate.getProperties())) { + // make a GET on the nodeInstance properties + + try { + // fetch properties + Node nodeInstancePropsGETNode = + this.fragments.generateInstancePropertiesGETAsNode(relationInstanceURLVarName, restCallResponseVarName); + nodeInstancePropsGETNode = context.importNode(nodeInstancePropsGETNode); + context.getPostPhaseElement().appendChild(nodeInstancePropsGETNode); + } catch (final SAXException e1) { + e1.printStackTrace(); + return false; + } catch (final IOException e1) { + e1.printStackTrace(); + return false; + } + + // assign the values from the property variables into REST/HTTP + // Request + // and send + // first build a mapping from property variable names to dom element + final Map propertyVarNameToDOMMapping = + buildMappingsFromVarNameToDomElement(context, relationshipTemplate); + try { + // then generate an assign to have code that writes the runtime + // values into the instance data db. + // we use the restCallResponseVarName from the GET before, as it + // has + // proper format + Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, + propertyVarNameToDOMMapping); + assignNode = context.importNode(assignNode); + context.getPostPhaseElement().appendChild(assignNode); + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } catch (final IOException e) { + e.printStackTrace(); + return false; + } + + // generate BPEL4RESTLight PUT request to update the instance data + try { + Node bpel4restPUTNode = this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, + relationInstanceURLVarName); + bpel4restPUTNode = context.importNode(bpel4restPUTNode); + context.getPostPhaseElement().appendChild(bpel4restPUTNode); + } catch (final IOException e) { + e.printStackTrace(); + return false; + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } + } + + this.appendStateUpdateToPostPhase(context, relationInstanceURLVarName, stateVarName, lastSetState); + this.appendFailedStateToFaultHandler(context, relationInstanceURLVarName); + return true; + } + + public boolean handleUpdate(final BPELPlanContext sourceContext, final BPELPlanContext targetContext, + AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate) { + final boolean hasProps = checkProperties(sourceNodeTemplate.getProperties()); + + /* create new node instance */ + final String targetServiceInstanceUrlVar = targetContext.getServiceInstanceURLVarName(); + final String targetServiceInstanceIdVar = targetContext.getServiceInstanceIDVarName(); + final String targetServiceTemplateUrlVar = targetContext.getServiceTemplateURLVar(); + + final String restCallResponseVar = this.createRESTResponseVar(targetContext); + final String stateVar = this.createStateVar(targetContext, targetNodeTemplate.getId()); + + // create instance at API + try { + final String bpelString = + this.fragments.generateBPEL4RESTLightNodeInstancePOST(targetServiceTemplateUrlVar, + targetServiceInstanceIdVar, + targetNodeTemplate.getId(), restCallResponseVar); + Node createNodeInstanceExActiv = ModelUtils.string2dom(bpelString); + createNodeInstanceExActiv = targetContext.importNode(createNodeInstanceExActiv); + targetContext.getPrePhaseElement().appendChild(createNodeInstanceExActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + final String targetNodeInstanceUrlVar = targetContext.findInstanceURLVar(targetNodeTemplate.getId(), true); + final String targetNodeInstanceIdVar = targetContext.findInstanceIDVar(targetNodeTemplate.getId(), true); + final String sourceNodeInstanceURLVarName = sourceContext.findInstanceURLVar(sourceNodeTemplate.getId(), true); + // save data from response in node instance vars + try { + // save nodeInstance url from response + final String bpelString = + this.fragments.generateAssignFromNodeInstancePOSTResponseToStringVar(targetNodeInstanceUrlVar, + targetNodeInstanceIdVar, + restCallResponseVar); + Node assignNodeInstanceUrl = ModelUtils.string2dom(bpelString); + assignNodeInstanceUrl = targetContext.importNode(assignNodeInstanceUrl); + targetContext.getPrePhaseElement().appendChild(assignNodeInstanceUrl); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + /* load properties and state from old instance to new instance */ + if (hasProps) { + this.appendUpdatePropertiesFromSourceToTarget(sourceContext, sourceNodeTemplate, + sourceNodeInstanceURLVarName, targetNodeInstanceUrlVar, + restCallResponseVar, targetContext.getPostPhaseElement()); + } + + this.appendGetStateToPostPhase(targetContext, sourceNodeInstanceURLVarName, stateVar); + this.appendStateUpdateToPostPhase(targetContext, targetNodeInstanceUrlVar, stateVar); + /* set state of old instance to migrated */ + this.appendStateUpdateToPostPhase(sourceContext, sourceNodeInstanceURLVarName, stateVar, "MIGRATED"); + + this.appendFailedStateToFaultHandler(targetContext, targetNodeInstanceUrlVar); + this.appendFailedStateToFaultHandler(sourceContext, sourceNodeInstanceURLVarName); + return true; + } + + /** + * Appends BPEL Code that updates InstanceData for the given NodeTemplate. Needs initialization code on the global + * level in the plan. This will be checked and appended if needed. + * + * @param context the TemplateContext of the NodeTemplate + * @param nodeTemplate the NodeTemplate to handle + * @return true iff appending all BPEL code was successful + */ + public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { + final boolean hasProps = checkProperties(nodeTemplate.getProperties()); + + final String serviceInstanceVarName = context.getServiceInstanceURLVarName(); + if (serviceInstanceVarName == null) { + return false; + } + + final String serviceInstanceIDVarName = context.getServiceInstanceIDVarName(); + if (serviceInstanceIDVarName == null) { + return false; + } + + final String serviceTemplateUrlVarName = context.getServiceTemplateURLVar(); + if (serviceTemplateUrlVarName == null) { + return false; + } + + /* + * Pre Phase code + */ + + // create variable for all responses + final String restCallResponseVarName = createRESTResponseVar(context); + + if (restCallResponseVarName == null) { + return false; + } + + // create state variable inside scope + final String stateVarName = createStateVar(context, context.getNodeTemplate().getId()); + + if (stateVarName == null) { + return false; + } + + /* + * (i) append bpel code to create the nodeInstance (ii) append bpel code to fetch nodeInstanceURL + */ + + try { + // create bpel extension activity and append + final String bpelString = + this.fragments.generateBPEL4RESTLightNodeInstancePOST(serviceTemplateUrlVarName, + serviceInstanceIDVarName, + context.getNodeTemplate().getId(), + restCallResponseVarName); + Node createNodeInstanceExActiv = ModelUtils.string2dom(bpelString); + createNodeInstanceExActiv = context.importNode(createNodeInstanceExActiv); + context.getPrePhaseElement().appendChild(createNodeInstanceExActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + String nodeInstanceURLVarName = ""; + + if (context.findInstanceURLVar(context.getNodeTemplate().getId(), true) == null) { + // generate String var for nodeInstance URL + nodeInstanceURLVarName = createInstanceURLVar(context, context.getNodeTemplate().getId()); + } else { + nodeInstanceURLVarName = context.findInstanceURLVar(context.getNodeTemplate().getId(), true); + } + + if (nodeInstanceURLVarName == null) { + return false; + } + + String nodeInstanceIDVarName = ""; + + if (context.findInstanceIDVar(context.getNodeTemplate().getId(), true) == null) { + nodeInstanceIDVarName = createInstanceIDVar(context, context.getNodeTemplate().getId()); + } else { + nodeInstanceIDVarName = context.findInstanceIDVar(context.getNodeTemplate().getId(), true); + } + + if (nodeInstanceIDVarName == null) { + return false; + } + + try { + // save nodeInstance url from response + final String bpelString = + this.fragments.generateAssignFromNodeInstancePOSTResponseToStringVar(nodeInstanceURLVarName, + nodeInstanceIDVarName, + restCallResponseVarName); + Node assignNodeInstanceUrl = ModelUtils.string2dom(bpelString); + assignNodeInstanceUrl = context.importNode(assignNodeInstanceUrl); + context.getPrePhaseElement().appendChild(assignNodeInstanceUrl); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // we'll use this later when we determine that the handle Node doesn't + // have lifecycle operations. Without this check all nodes without + // lifecycle (or cloud prov operations) will be in an uninstalled state + String lastSetState = "INITIAL"; + + this.appendStateUpdateToPrePhase(context, nodeInstanceURLVarName, stateVarName, lastSetState); + + /* + * Prov Phase code + */ + + // fetch all assigns that assign an invoke async operation request + + final Element provisioningPhaseElement = context.getProvisioningPhaseElement(); + final List assignContentElements = fetchInvokerCallAssigns(provisioningPhaseElement); + + final List operationNames = new ArrayList<>(); + + // for each assign element we fetch the operation name, determine the + // pre and post states, and append the pre state before the found assign + // and the post state after the receive of the invoker iteraction + for (final Element assignContentElement : assignContentElements) { + + // fetch operationName from literal contents + final String operationName = fetchOperationName(assignContentElement); + operationNames.add(operationName); + // determine pre and post state for operation + final String preState = InstanceStates.getOperationPreState(operationName); + final String postState = InstanceStates.getOperationPostState(operationName); + + if (preState != null) { + + try { + + // assign prestate to state variable + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignNodeStateFor_" + + operationName + "_" + System.currentTimeMillis(), "string('" + preState + "')", stateVarName); + assignNode = context.importNode(assignNode); + lastSetState = preState; + + // assign the state before the assign of the invoker request + // is made + final Node bpelAssignNode = + assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); + bpelAssignNode.getParentNode().insertBefore(assignNode, bpelAssignNode); + + // create REST Put activity + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + + // send the state before the assign of the invoker request + // is made + bpelAssignNode.getParentNode().insertBefore(extActiv, bpelAssignNode); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + + if (postState != null) { + try { + // create state assign activity + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = + frag.createAssignXpathQueryToStringVarFragmentAsNode("assignNodeState_" + operationName + "_" + + System.currentTimeMillis(), "string('" + postState + "')", stateVarName); + assignNode = context.importNode(assignNode); + + lastSetState = postState; + + /* + * assign the state after the receiving the response of the + */ + + // fetch assign node + final Node bpelAssignNode = + assignContentElement.getParentNode().getParentNode().getParentNode().getParentNode(); + + // fetch the variable name which is used as request body + final String reqVarName = fetchRequestVarNameFromInvokerAssign(assignContentElement); + + // from the assign element search for the receive element + // that is witing for the response + final Element invokerReceiveElement = fetchInvokerReceive((Element) bpelAssignNode, reqVarName); + + // insertAfterUpdateProperties(context, nodeTemplate, nodeInstanceURLVarName, + // restCallResponseVarName, + // invokerReceiveElement); + + // insert assign after the receive + assignNode = invokerReceiveElement.getParentNode() + .insertBefore(assignNode, invokerReceiveElement.getNextSibling()); + + // create PUT activity + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + + // insert REST call after the assign + final Element afterElement = + (Element) invokerReceiveElement.getParentNode().insertBefore(extActiv, + assignNode.getNextSibling()); + + if (hasProps) { + appendUpdateProperties(context, nodeTemplate, nodeInstanceURLVarName, restCallResponseVarName, + afterElement.getParentNode()); + } + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + } + + /* + * Post Phase code + */ + + if (lastSetState.equals("INITIAL") || lastSetState.equals("CONFIGURED")) { + try { + // set state + String nextState = InstanceStates.getNextStableOperationState(lastSetState); + // if this node never was handled by lifecycle ops we just set + // it to started + if (operationNames.isEmpty()) { + nextState = "STARTED"; + } + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignFinalNodeState" + + System.currentTimeMillis(), "string('" + nextState + "')", stateVarName); + assignNode = context.importNode(assignNode); + + // create PUT activity + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + + context.getPostPhaseElement().appendChild(assignNode); + context.getPostPhaseElement().appendChild(extActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + + // needs property update only if the node has properties + if (hasProps) { + final Element postPhaseElement = context.getPostPhaseElement(); + // make a GET on the nodeInstance properties + appendUpdateProperties(context, nodeTemplate, nodeInstanceURLVarName, restCallResponseVarName, + postPhaseElement); + } + + // add progression log message + appendProgressionUpdateLogMessage(context, nodeTemplate.getId()); + + this.appendFailedStateToFaultHandler(context, nodeInstanceURLVarName); + + return true; + } + + private void appendGetStateToPrePhase(BPELPlanContext context, String nodeInstanceURLVarName, String stateVarName) { + this.appendGetStateToElement(context, nodeInstanceURLVarName, stateVarName, context.getPrePhaseElement()); + } + + private void appendGetStateToPostPhase(BPELPlanContext context, String instanceUrlVar, String stateVarName) { + this.appendGetStateToElement(context, instanceUrlVar, stateVarName, context.getPostPhaseElement()); + } + + private void appendGetStateToElement(BPELPlanContext context, String instanceURLVar, String stateVarName, Element toAppendAsChild) { + try { + + Node getStateNode = + this.fragments.generateBPEL4RESTLightGETInstanceStateAsNode(instanceURLVar, stateVarName); + getStateNode = context.importNode(getStateNode); + toAppendAsChild.appendChild(getStateNode); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } + } + + private void appendFailedStateToFaultHandler(BPELPlanContext context, String nodeInstanceURLVarName) { + String stateVarName = this.createStateVar(context, context.getTemplateId()); + this.appendStateUpdateAsChild(context, nodeInstanceURLVarName, stateVarName, "ERROR", context.getProvisioningFaultHandlerPhaseElement()); + } + + private void appendStateUpdateToPrePhase(BPELPlanContext context, String nodeInstanceURLVarName, + String stateVarName) { + this.appendStateUpdateFromVarToElement(context, nodeInstanceURLVarName, stateVarName, context.getPrePhaseElement()); + } + + private void appendStateUpdateToPostPhase(BPELPlanContext context, String nodeInstanceURLVarName, + String stateVarName) { + this.appendStateUpdateFromVarToElement(context, nodeInstanceURLVarName, stateVarName, context.getPostPhaseElement()); + } + + private void appendStateUpdateFromVarToElement(BPELPlanContext context, String instanceUrlVar, String stateVarName, Element element) { + try { + + // send state to api + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(instanceUrlVar, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + element.appendChild(extActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + + private void appendStateUpdateToPostPhase(BPELPlanContext context, String nodeRelationInstanceURLVarName, + String stateVarName, String stateToSet) { + this.appendStateUpdateAsChild(context, nodeRelationInstanceURLVarName, stateVarName, stateToSet, context.getPostPhaseElement()); + } + + private void appendStateUpdateToPrePhase(BPELPlanContext context, String nodeInstanceURLVarName, + String stateVarName, String stateToSet) { + this.appendStateUpdateAsChild(context, nodeInstanceURLVarName, stateVarName, stateToSet, context.getPrePhaseElement()); + } + + private void appendStateUpdateAsChild(BPELPlanContext context, String nodeRelationInstanceURLVarName, + String stateVarName, String stateToSet, Element parentElement) { + try { + // update state variable to uninstalled + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = + frag.createAssignXpathQueryToStringVarFragmentAsNode("assignSetNodeState" + System.currentTimeMillis(), + "string('" + stateToSet + "')", stateVarName); + assignNode = context.importNode(assignNode); + parentElement.appendChild(assignNode); + + // send state to api + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(nodeRelationInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + parentElement.appendChild(extActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + } + + private void appendProgressionUpdateLogMessage(final BPELPlanContext context, final String templateId) { + + final int topologySize = context.getNodeTemplates().size() + context.getRelationshipTemplates().size(); + + final String message = "Finished with " + templateId + " of overall topology with steps of " + topologySize; + + this.invoker.addLogActivity(context, message, PlanContext.Phase.POST); + } + + public boolean appendUpdatePropertiesFromSourceToTarget(final BPELPlanContext sourceNodeContext, + final AbstractNodeTemplate nodeTemplate, + final String sourceNodeInstanceURLVarName, + final String targetNodeInstanceUrlVarName, + final String restCallResponseVarName, + final Node appendAsChildElement) { + try { + // fetch properties + Node nodeInstancePropsGETNode = + this.fragments.generateInstancePropertiesGETAsNode(sourceNodeInstanceURLVarName, + restCallResponseVarName); + nodeInstancePropsGETNode = sourceNodeContext.importNode(nodeInstancePropsGETNode); + appendAsChildElement.appendChild(nodeInstancePropsGETNode); + } catch (final SAXException e1) { + e1.printStackTrace(); + return false; + } catch (final IOException e1) { + e1.printStackTrace(); + return false; + } + + // assign the values from the property variables into REST/HTTP + // Request + // and send + // first build a mapping from property variable names to dom element + final Map propertyVarNameToDOMMapping = + buildMappingsFromVarNameToDomElement(sourceNodeContext, nodeTemplate); + try { + // then generate an assign to have code that writes the runtime + // values into the instance data db. + // we use the restCallResponseVarName from the GET before, as it + // has + // proper format + Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, + propertyVarNameToDOMMapping); + assignNode = sourceNodeContext.importNode(assignNode); + appendAsChildElement.appendChild(assignNode); + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } catch (final IOException e) { + e.printStackTrace(); + return false; + } + + // generate BPEL4RESTLight PUT request to update the instance data + try { + Node bpel4restPUTNode = + this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, + targetNodeInstanceUrlVarName); + bpel4restPUTNode = sourceNodeContext.importNode(bpel4restPUTNode); + appendAsChildElement.appendChild(bpel4restPUTNode); + } catch (final IOException e) { + e.printStackTrace(); + return false; + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } + return true; + } + + public boolean appendUpdateProperties(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, + final String nodeInstanceURLVarName, final String restCallResponseVarName, + final Node appendAsChildElement) { + try { + // fetch properties + Node nodeInstancePropsGETNode = + this.fragments.generateInstancePropertiesGETAsNode(nodeInstanceURLVarName, restCallResponseVarName); + nodeInstancePropsGETNode = context.importNode(nodeInstancePropsGETNode); + appendAsChildElement.appendChild(nodeInstancePropsGETNode); + } catch (final SAXException e1) { + e1.printStackTrace(); + return false; + } catch (final IOException e1) { + e1.printStackTrace(); + return false; + } + + // assign the values from the property variables into REST/HTTP + // Request + // and send + // first build a mapping from property variable names to dom element + final Map propertyVarNameToDOMMapping = + buildMappingsFromVarNameToDomElement(context, nodeTemplate); + try { + // then generate an assign to have code that writes the runtime + // values into the instance data db. + // we use the restCallResponseVarName from the GET before, as it + // has + // proper format + Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, + propertyVarNameToDOMMapping); + assignNode = context.importNode(assignNode); + appendAsChildElement.appendChild(assignNode); + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } catch (final IOException e) { + e.printStackTrace(); + return false; + } + + // generate BPEL4RESTLight PUT request to update the instance data + try { + Node bpel4restPUTNode = this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, + nodeInstanceURLVarName); + bpel4restPUTNode = context.importNode(bpel4restPUTNode); + appendAsChildElement.appendChild(bpel4restPUTNode); + } catch (final IOException e) { + e.printStackTrace(); + return false; + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } + return true; + } + + public boolean handleUpdate(final BPELPlanContext sourceContext, final BPELPlanContext targetContext, + AbstractRelationshipTemplate sourceRelationshipTemplate, + AbstractRelationshipTemplate targetRelationshipTemplate) { + + final String targetServiceTemplateUrlVarName = targetContext.getServiceTemplateURLVar(); + final String targetServiceInstanceIdVarName = targetContext.getServiceInstanceIDVarName(); + + // create variable for all responses + final String restCallResponseVarName = createRESTResponseVar(sourceContext); + + final String stateVarName = createStateVar(sourceContext, sourceRelationshipTemplate.getId()); + + // find already available instanceIds from the target nodes (source and target of the relation to + // create + final String targetServiceRelationSourceNodeInstanceIdVar = + targetContext.findInstanceIDVar(targetRelationshipTemplate.getSource().getId(), true); + final String targetServiceRelationTargetNodeInstanceIdVar = + targetContext.findInstanceIDVar(targetRelationshipTemplate.getTarget().getId(), true); + + // if it is a connect to relation that we migrate, the node instances are already migrated, + // therefore we can create the new instance in the connect migration scope + // else only the the target of a hosted/depends on relation is already migrated, we have to wait + // until it source is migrated. therefore we add the creation to the scope of the relation source + // (e.g. Raspian-hostedOn->Raspi3 => create code is added to raspbian) + Element injectionPreElement = null; + Element injectionPostElement = null; + if (ModelUtils.getRelationshipTypeHierarchy(targetRelationshipTemplate.getRelationshipType()) + .contains(Types.connectsToRelationType)) { + injectionPreElement = targetContext.getPrePhaseElement(); + injectionPostElement = targetContext.getPostPhaseElement(); + } else { + // fetch nodeTemplate + final AbstractNodeTemplate sourceNodeTemplate = sourceRelationshipTemplate.getSource(); + injectionPreElement = targetContext.createContext(sourceNodeTemplate, ActivityType.MIGRATION).getPostPhaseElement(); + injectionPostElement = targetContext.createContext(sourceNodeTemplate, ActivityType.MIGRATION).getPostPhaseElement(); + } + + // register request message + final String createRelTInstanceReqVarName = "createRelationshipTemplateRequest" + targetContext.getIdForNames(); + + try { + final Path opentoscaApiSchemaFile = this.bpelFrags.getOpenTOSCAAPISchemaFile(); + QName createRelationshipTemplateInstanceRequestQName = + this.bpelFrags.getOpenToscaApiCreateRelationshipTemplateInstanceRequestElementQname(); + targetContext.registerType(createRelationshipTemplateInstanceRequestQName, opentoscaApiSchemaFile); + createRelationshipTemplateInstanceRequestQName = + targetContext.importQName(createRelationshipTemplateInstanceRequestQName); + + targetContext.addGlobalVariable(createRelTInstanceReqVarName, BPELPlan.VariableType.ELEMENT, + createRelationshipTemplateInstanceRequestQName); + } catch (final IOException e3) { + // TODO Auto-generated catch block + e3.printStackTrace(); + } + + // assign nodeInstanceId to req message and create relationInstance + try { + // create bpel extension activity and append + final String bpelString = + this.fragments.generateBPEL4RESTLightRelationInstancePOST(targetServiceTemplateUrlVarName, + targetRelationshipTemplate.getId(), + createRelTInstanceReqVarName, + restCallResponseVarName, + targetServiceRelationSourceNodeInstanceIdVar, + targetServiceRelationTargetNodeInstanceIdVar, targetServiceInstanceIdVarName); + Node createRelationInstanceExActiv = ModelUtils.string2dom(bpelString); + createRelationInstanceExActiv = targetContext.importNode(createRelationInstanceExActiv); + injectionPreElement.appendChild(createRelationInstanceExActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // store relationinstance url + + final String createdRelationInstanceId = + targetContext.findInstanceIDVar(targetRelationshipTemplate.getId(), false); + final String createRelationInstanceUrl = + targetContext.findInstanceURLVar(targetRelationshipTemplate.getId(), false); + final String oldRelationInstanceUrl = + sourceContext.findInstanceURLVar(sourceRelationshipTemplate.getId(), false); + + try { + // save relationInstance url from response + final String bpelString = + this.fragments.generateAssignFromRelationInstancePOSTResponseToStringVar(createRelationInstanceUrl, + createdRelationInstanceId, + restCallResponseVarName); + Node assignRelationInstanceUrl = ModelUtils.string2dom(bpelString); + assignRelationInstanceUrl = targetContext.importNode(assignRelationInstanceUrl); + injectionPreElement.appendChild(assignRelationInstanceUrl); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + /* load properties and state from old instance to new instance */ + if (checkProperties(sourceRelationshipTemplate.getProperties())) { + // make a GET on the nodeInstance properties + + try { + // fetch properties + Node nodeInstancePropsGETNode = + this.fragments.generateInstancePropertiesGETAsNode(oldRelationInstanceUrl, restCallResponseVarName); + nodeInstancePropsGETNode = targetContext.importNode(nodeInstancePropsGETNode); + injectionPostElement.appendChild(nodeInstancePropsGETNode); + } catch (final SAXException e1) { + e1.printStackTrace(); + return false; + } catch (final IOException e1) { + e1.printStackTrace(); + return false; + } + + // assign the values from the property variables into REST/HTTP + // Request + // and send + // first build a mapping from property variable names to dom element + final Map propertyVarNameToDOMMapping = + buildMappingsFromVarNameToDomElement(targetContext, sourceRelationshipTemplate); + try { + // then generate an assign to have code that writes the runtime + // values into the instance data db. + // we use the restCallResponseVarName from the GET before, as it + // has + // proper format + Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, + propertyVarNameToDOMMapping); + assignNode = targetContext.importNode(assignNode); + injectionPostElement.appendChild(assignNode); + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } catch (final IOException e) { + e.printStackTrace(); + return false; + } + + // generate BPEL4RESTLight PUT request to update the instance data + try { + Node bpel4restPUTNode = + this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, + createRelationInstanceUrl); + bpel4restPUTNode = targetContext.importNode(bpel4restPUTNode); + injectionPostElement.appendChild(bpel4restPUTNode); + } catch (final IOException e) { + e.printStackTrace(); + return false; + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } + } + + this.appendGetStateToElement(targetContext, oldRelationInstanceUrl, stateVarName, injectionPostElement); + this.appendStateUpdateFromVarToElement(targetContext, createRelationInstanceUrl, stateVarName, injectionPostElement); + + /* set state of old instance to migrated */ + this.appendStateUpdateAsChild(targetContext, oldRelationInstanceUrl, stateVarName, "MIGRATED", injectionPostElement); + + return true; + } + + public boolean handleCreate(final BPELPlanContext context, + final AbstractRelationshipTemplate relationshipTemplate) { + + final String serviceInstanceVarName = context.getServiceInstanceURLVarName(); + if (serviceInstanceVarName == null) { + return false; + } + + final String serviceTemplateUrlVarName = context.getServiceTemplateURLVar(); + if (serviceTemplateUrlVarName == null) { + return false; + } + + final String serviceInstanceIdVarName = context.getServiceInstanceIDVarName(); + if (serviceInstanceIdVarName == null) { + return false; + } + + /* + * Pre Phase code + */ + + // create variable for all responses + final String restCallResponseVarName = createRESTResponseVar(context); + + if (restCallResponseVarName == null) { + return false; + } + + // create state variable inside scope + final String stateVarName = createStateVar(context, context.getRelationshipTemplate().getId()); + + if (stateVarName == null) { + return false; + } + + // based on the relatioships baseType we add the logic into different + // phases of relations AND nodes + // connectsTo = own phases + // else = source node phasesl + + Element injectionPreElement = null; + Element injectionPostElement = null; + final String sourceInstanceVarName = + context.findInstanceIDVar(context.getRelationshipTemplate().getSource().getId(), true); + final String targetInstanceVarName = + context.findInstanceIDVar(context.getRelationshipTemplate().getTarget().getId(), true); + + if (ModelUtils.getRelationshipTypeHierarchy(context.getRelationshipTemplate().getRelationshipType()) + .contains(Types.connectsToRelationType)) { + injectionPreElement = context.getPrePhaseElement(); + injectionPostElement = context.getPostPhaseElement(); + } else { + // fetch nodeTemplate + final AbstractNodeTemplate sourceNodeTemplate = context.getRelationshipTemplate().getSource(); + LOG.debug("Trying to create provisioning plan context for sourceNodeTemplate {} of relationshipTemplate {}", sourceNodeTemplate.toString(), context.getRelationshipTemplate().toString()); + + // Right now the knowledge of DEFROST and PROVISIONING activities is to hard of an assumption, if you ask me + BPELPlanContext sourceContext = context.createContext(sourceNodeTemplate, ActivityType.PROVISIONING, ActivityType.DEFROST); + if (sourceContext == null) { + LOG.error("Couldn't create context for sourceNodeTemplate {}", sourceNodeTemplate.toString()); + return false; + } + injectionPreElement = sourceContext.getPostPhaseElement(); + injectionPostElement = sourceContext.getPostPhaseElement(); + } + + if (injectionPostElement == null | injectionPreElement == null | sourceInstanceVarName == null + | targetInstanceVarName == null) { + return false; + } + + /* + * import request message type and create variable + */ + + final String createRelTInstanceReqVarName = "createRelationshipTemplateRequest" + context.getIdForNames(); + + try { + final Path opentoscaApiSchemaFile = this.bpelFrags.getOpenTOSCAAPISchemaFile(); + QName createRelationshipTemplateInstanceRequestQName = + this.bpelFrags.getOpenToscaApiCreateRelationshipTemplateInstanceRequestElementQname(); + context.registerType(createRelationshipTemplateInstanceRequestQName, opentoscaApiSchemaFile); + createRelationshipTemplateInstanceRequestQName = + context.importQName(createRelationshipTemplateInstanceRequestQName); + + context.addGlobalVariable(createRelTInstanceReqVarName, BPELPlan.VariableType.ELEMENT, + createRelationshipTemplateInstanceRequestQName); + } catch (final IOException e3) { + // TODO Auto-generated catch block + e3.printStackTrace(); + } + + /* + * (i) append bpel code to create the relationInstance (ii) append bpel code to fetch + * relationInstanceURL + */ + + try { + // create bpel extension activity and append + final String bpelString = + this.fragments.generateBPEL4RESTLightRelationInstancePOST(serviceTemplateUrlVarName, + context.getRelationshipTemplate().getId(), + createRelTInstanceReqVarName, + restCallResponseVarName, + sourceInstanceVarName, targetInstanceVarName, serviceInstanceIdVarName); + Node createRelationInstanceExActiv = ModelUtils.string2dom(bpelString); + createRelationInstanceExActiv = context.importNode(createRelationInstanceExActiv); + injectionPreElement.appendChild(createRelationInstanceExActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // generate String var for relationInstance URL + String relationInstanceURLVarName = ""; + if (context.findInstanceURLVar(context.getRelationshipTemplate().getId(), false) == null) { + // generate String var for relationInstance URL + relationInstanceURLVarName = createInstanceURLVar(context, context.getRelationshipTemplate().getId()); + } else { + relationInstanceURLVarName = context.findInstanceURLVar(context.getRelationshipTemplate().getId(), false); + } + + if (relationInstanceURLVarName == null) { + return false; + } + + String relationInstanceIDVarName = ""; + + if (context.findInstanceIDVar(context.getRelationshipTemplate().getId(), false) == null) { + // generate String var for nodeInstance URL + relationInstanceIDVarName = createInstanceIDVar(context, context.getRelationshipTemplate().getId()); + } else { + relationInstanceIDVarName = context.findInstanceIDVar(context.getRelationshipTemplate().getId(), false); + } + + if (relationInstanceIDVarName == null) { + return false; + } + + try { + // save relationInstance data from response + final String bpelString = + this.fragments.generateAssignFromRelationInstancePOSTResponseToStringVar(relationInstanceURLVarName, + relationInstanceIDVarName, + restCallResponseVarName); + Node assignRelationInstanceUrl = ModelUtils.string2dom(bpelString); + assignRelationInstanceUrl = context.importNode(assignRelationInstanceUrl); + injectionPreElement.appendChild(assignRelationInstanceUrl); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // we'll use this later when we determine that the handle Node doesn't + // have lifecycle operations. Without this check all nodes without + // lifecycle (or cloud prov operations) will be in an uninstalled state + final String lastSetState = "INITIAL"; + + try { + // update state variable to uninstalled + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode("assignInitRelationState" + + System.currentTimeMillis(), "string('" + lastSetState + "')", stateVarName); + assignNode = context.importNode(assignNode); + injectionPreElement.appendChild(assignNode); + + // send state to api + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(relationInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + injectionPreElement.appendChild(extActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + + try { + // set state + final BPELProcessFragments frag = new BPELProcessFragments(); + Node assignNode = frag.createAssignXpathQueryToStringVarFragmentAsNode( + "assignFinalNodeState" + + System.currentTimeMillis(), + "string('CREATED')", stateVarName); + assignNode = context.importNode(assignNode); + + // create PUT activity + final String bpelString = + this.fragments.generateBPEL4RESTLightPUTInstanceState(relationInstanceURLVarName, stateVarName); + Node extActiv = ModelUtils.string2dom(bpelString); + extActiv = context.importNode(extActiv); + + injectionPostElement.appendChild(assignNode); + injectionPostElement.appendChild(extActiv); + } catch (final IOException e2) { + e2.printStackTrace(); + } catch (final SAXException e) { + e.printStackTrace(); + } catch (final ParserConfigurationException e) { + e.printStackTrace(); + } + + // needs property update only if the relation has properties + if (checkProperties(relationshipTemplate.getProperties())) { + // make a GET on the nodeInstance properties + + try { + // fetch properties + Node nodeInstancePropsGETNode = + this.fragments.generateInstancePropertiesGETAsNode(relationInstanceURLVarName, + restCallResponseVarName); + nodeInstancePropsGETNode = context.importNode(nodeInstancePropsGETNode); + injectionPostElement.appendChild(nodeInstancePropsGETNode); + } catch (final SAXException e1) { + e1.printStackTrace(); + return false; + } catch (final IOException e1) { + e1.printStackTrace(); + return false; + } + + // assign the values from the property variables into REST/HTTP + // Request + // and send + // first build a mapping from property variable names to dom element + final Map propertyVarNameToDOMMapping = + buildMappingsFromVarNameToDomElement(context, relationshipTemplate); + try { + // then generate an assign to have code that writes the runtime + // values into the instance data db. + // we use the restCallResponseVarName from the GET before, as it + // has + // proper format + Node assignNode = this.fragments.generateAssignFromPropertyVarToDomMapping(restCallResponseVarName, + propertyVarNameToDOMMapping); + assignNode = context.importNode(assignNode); + injectionPostElement.appendChild(assignNode); + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } catch (final IOException e) { + e.printStackTrace(); + return false; + } + + // generate BPEL4RESTLight PUT request to update the instance data + try { + Node bpel4restPUTNode = + this.fragments.generateInstancesBPEL4RESTLightPUTAsNode(restCallResponseVarName, + relationInstanceURLVarName); + bpel4restPUTNode = context.importNode(bpel4restPUTNode); + injectionPostElement.appendChild(bpel4restPUTNode); + } catch (final IOException e) { + e.printStackTrace(); + return false; + } catch (final SAXException e) { + e.printStackTrace(); + return false; + } + } + + appendProgressionUpdateLogMessage(context, relationshipTemplate.getId()); + + return true; + } + + private Element fetchInvokerReceive(final Element invokerAssign, final String requestVarName) { + + Node sibling = invokerAssign.getNextSibling(); + + while (sibling != null & !sibling.getNodeName().contains("invoke")) { + sibling = sibling.getNextSibling(); + } + + if (sibling.getNodeType() == Node.ELEMENT_NODE + & sibling.getAttributes().getNamedItem("inputVariable").getTextContent().equals(requestVarName)) { + return (Element) sibling.getNextSibling(); + } + + return null; + } + + private String fetchRequestVarNameFromInvokerAssign(final Element assignContentElement) { + String reqVarName = null; + + final Node fromNode = fetchFromNode(assignContentElement); + + final Node toNode = fetchNextNamedNodeRecursively(fromNode, "to"); + + reqVarName = toNode.getAttributes().getNamedItem("variable").getTextContent(); + + return reqVarName; + } + + private Node fetchNextNamedNodeRecursively(final Node node, final String name) { + Node sibling = node.getNextSibling(); + + while (sibling != null & !sibling.getNodeName().contains(name)) { + sibling = sibling.getNextSibling(); + } + + return sibling; + } + + private Node fetchFromNode(final Element assignContentElement) { + Node parent = assignContentElement.getParentNode(); + + while (parent != null & !parent.getNodeName().contains("from")) { + parent = parent.getParentNode(); + } + + return parent; + } + + private String fetchOperationName(final Element assignElement) { + final XPath xpath = this.xPathfactory.newXPath(); + String operationName = null; + + try { + + operationName = (String) xpath.evaluate(".//*[local-name()='OperationName']/node()", assignElement, + XPathConstants.STRING); + } catch (final XPathExpressionException e) { + e.printStackTrace(); + } + + return operationName; + } + + private List fetchInvokerCallAssigns(final Element provisioningPhaseElement) { + final XPath xpath = this.xPathfactory.newXPath(); + final List assignElements = new ArrayList<>(); + final String xpathQuery = ".//*[local-name()='invokeOperationAsync']"; + try { + final NodeList nodeList = + (NodeList) xpath.evaluate(xpathQuery, provisioningPhaseElement, XPathConstants.NODESET); + + for (int i = 0; i < nodeList.getLength(); i++) { + if (nodeList.item(i).getNodeType() == Node.ELEMENT_NODE) { + assignElements.add((Element) nodeList.item(i)); + } + } + } catch (final XPathExpressionException e) { + e.printStackTrace(); + } + + return assignElements; + } + + /** + *

    + * This method is initializing a Map from BpelVariableName to a DomElement of the given Properties and Context. + *

    + * + * @param context BPELPlanContext + * @param properties AbstractProperties with proper DOM Element + * @return a Map of BpelVariableName to DOM Node. Maybe null if the mapping is not complete, e.g. some + * bpel variable was not found or the properties weren't parsed right. + */ + private Map buildMappingsFromVarNameToDomElement(final PlanContext context, + AbstractNodeTemplate nodeTemplate) { + final Element propRootElement = nodeTemplate.getProperties().getDOMElement(); + + final Map mapping = new HashMap<>(); + + // get list of child elements + final NodeList childList = propRootElement.getChildNodes(); + + for (int i = 0; i < childList.getLength(); i++) { + final Node child = childList.item(i); + if (child.getNodeType() == Node.ELEMENT_NODE) { + final String propertyName = child.getLocalName(); + final String propVarName = context.getVariableNameOfProperty(nodeTemplate, propertyName); + if (propVarName != null) { + mapping.put(propVarName, child); + } + } + } + return mapping; + } + + private Map buildMappingsFromVarNameToDomElement(final PlanContext context, + AbstractRelationshipTemplate relationshipTemplate) { + final Element propRootElement = relationshipTemplate.getProperties().getDOMElement(); + + final Map mapping = new HashMap<>(); + + // get list of child elements + final NodeList childList = propRootElement.getChildNodes(); + + for (int i = 0; i < childList.getLength(); i++) { + final Node child = childList.item(i); + if (child.getNodeType() == Node.ELEMENT_NODE) { + final String propertyName = child.getLocalName(); + final String propVarName = context.getVariableNameOfProperty(relationshipTemplate, propertyName); + mapping.put(propVarName, child); + } + } + return mapping; + } + + /** + *

    + * Checks the given AbstractProperties against following criteria: Nullpointer-Check for properties itself and its + * given DOM Element, followed by whether the dom element has any child elements (if not, we have no + * properties/bpel-variables defined) + *

    + * + * @param properties AbstractProperties of an AbstractNodeTemplate or AbstractRelationshipTemplate + * @return true iff properties and properties.getDomElement() != null and DomElement.hasChildNodes() == true + */ + private boolean checkProperties(final AbstractProperties properties) { + if (properties == null) { + return false; + } + + if (properties.getDOMElement() == null) { + return false; + } + + final Element propertiesRootElement = properties.getDOMElement(); + + if (!propertiesRootElement.hasChildNodes()) { + return false; + } + + return true; + } + + public boolean handlePasswordCheck(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { + + // find properties which store passwords + // find their variables + final Collection pwVariables = new ArrayList<>(); + final Collection nodePropertyVariables = context.getPropertyVariables(nodeTemplate); + + for (final Variable var : nodePropertyVariables) { + if (var.getVariableName().contains("Password")) { + pwVariables.add(var); + } + } + + // find runScript method + + final AbstractNodeTemplate node = findRunScriptNode(nodeTemplate); + + if (node == null) { + return false; + } + + final Map inputParams = new HashMap<>(); + + final String cmdStringName = "checkPasswordScript_" + nodeTemplate.getId() + "_" + System.currentTimeMillis(); + final String cmdStringVal = createPlaceHolderPwCheckCmdString(pwVariables); + final Variable cmdVar = context.createGlobalStringVariable(cmdStringName, cmdStringVal); + + final String xPathReplacementCmd = createPlaceholderReplaceingXPath(cmdVar.getVariableName(), pwVariables); + + try { + Node assignPlaceholder = + this.bpelFrags.createAssignXpathQueryToStringVarFragmentAsNode("replacePlaceholdersOfPWCheck" + + System.currentTimeMillis(), xPathReplacementCmd, cmdVar.getVariableName()); + assignPlaceholder = context.importNode(assignPlaceholder); + context.getPrePhaseElement().appendChild(assignPlaceholder); + } catch (final IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (final SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + inputParams.put(new AbstractParameter() { + + @Override + public boolean isRequired() { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getType() { + // TODO Auto-generated method stub + return "xs:String"; + } + + @Override + public String getName() { + // TODO Auto-generated method stub + return "Script"; + } + }, cmdVar); + + final Map outputParams = new HashMap<>(); + + final String outputVarName = "pwCheckResult" + System.currentTimeMillis(); + + final Variable outputVar = context.createGlobalStringVariable(outputVarName, ""); + + outputParams.put(new AbstractParameter() { + + @Override + public boolean isRequired() { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getType() { + // TODO Auto-generated method stub + return "xs:String"; + } + + @Override + public String getName() { + // TODO Auto-generated method stub + return "ScriptResult"; + } + }, outputVar); + + // generate call to method + context.executeOperation(node, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT, inputParams, + outputParams, BPELScopePhaseType.PRE, context.getPrePhaseElement()); + + // check result and eventually throw error + + Node ifTrueThrowError = + this.bpelFrags.createIfTrueThrowsError("contains($" + outputVar.getVariableName() + ",'false')", + new QName("http://opentosca.org/plans/faults", "PasswordWeak")); + ifTrueThrowError = context.importNode(ifTrueThrowError); + context.getPrePhaseElement().appendChild(ifTrueThrowError); + + return true; + } + + private String createPlaceholderReplaceingXPath(final String cmdStringName, + final Collection pwVariables) { + String xpath = "$" + cmdStringName + ","; + + for (final Variable var : pwVariables) { + xpath = "replace(" + xpath; + xpath += "'" + var.getVariableName() + "'," + "$" + var.getVariableName() + ")"; + } + + return xpath; + } + + private String createPlaceHolderPwCheckCmdString(final Collection pwVariables) { + /* + * if echo "$candidate_password" | grep -Eq "$strong_pw_regex"; then echo strong else echo weak fi + */ + String cmdString = ""; + + for (final Variable var : pwVariables) { + cmdString += "if echo \"" + var.getVariableName() + + "\" | grep -Eq \"(?=^.{8,255}$)((?=.*\\d)(?!.*\\s)(?=.*[A-Z])(?=.*[a-z]))^.*\"; then : else echo \"false\" fi;"; + } + + return cmdString; + } + + protected AbstractNodeTemplate findRunScriptNode(final AbstractNodeTemplate nodeTemplate) { + final List infraNodes = new ArrayList<>(); + + ModelUtils.getInfrastructureNodes(nodeTemplate, infraNodes); + + for (final AbstractNodeTemplate node : infraNodes) { + for (final AbstractInterface iface : node.getType().getInterfaces()) { + if (iface.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM) + | iface.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER)) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_RUNSCRIPT) + | op.getName() + .equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERCONTAINER_RUNSCRIPT)) { + return node; + } + } + } + } + } + return null; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/InstanceStates.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/InstanceStates.java new file mode 100644 index 000000000..0d24011c6 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/bpel/InstanceStates.java @@ -0,0 +1,115 @@ +package org.opentosca.planbuilder.postphase.plugin.instancedata.bpel; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de + */ +public class InstanceStates { + + private static Map operationPreStates; + private static Map operationPostStates; + + static { + operationPreStates = new HashMap<>(); + operationPostStates = new HashMap<>(); + + /* + * INITIAL, CREATING, CREATED, CONFIGURING, CONFIGURED, STARTING, STARTED, STOPPING, STOPPED, + * DELETING, DELETED, ERROR + */ + // left side = operation name + // right side = pre/post state of operation + + // lifecycle + operationPreStates.put("install", "CREATING"); + operationPreStates.put("uninstall", "DELETING"); + operationPreStates.put("configure", "CONFIGURING"); + operationPreStates.put("start", "STARTING"); + operationPreStates.put("stop", "STOPPING"); + + operationPostStates.put("install", "CREATED"); + operationPostStates.put("uninstall", "DELETED"); + operationPostStates.put("configure", "CONFIGURED"); + operationPostStates.put("start", "STARTED"); + operationPostStates.put("stop", "STOPPED"); + + // VM's + operationPreStates.put("createVM", "STARTING"); + operationPreStates.put("waitForAvailability", "STARTING"); + + operationPostStates.put("createVM", "CONFIGURED"); + operationPostStates.put("waitForAvailability", "STARTED"); + + // Docker + operationPreStates.put("startContainer", "STARTING"); + operationPostStates.put("startContainer", "STARTED"); + + operationPreStates.put("removeContainer", "DELETING"); + operationPostStates.put("removeContainer", "DELETED"); + } + + public static String getOperationPreState(final String operationName) { + return operationPreStates.get(operationName); + } + + public static String getOperationPostState(final String operationName) { + return operationPostStates.get(operationName); + } + + public static boolean isStableOperationState(final String state) { + return operationPostStates.containsValue(state); + } + + /** + * Returns the next stable state for the given state. A stable state means that the node isn't in a state of + * modification such as installing, starting, pending, etc.. + *

    + * The next stable state of e.g., uninstalled would be installed, for installing it would be installed, configuring + * would be configured, etc. + * + * @param state a String containing a lifecycle state + * @return a String containing the next stable state from the given state + */ + public static String getNextStableOperationState(final String state) { + + if (operationPreStates.containsValue(state)) { + /* + * INITIAL, CREATING, CREATED, CONFIGURING, CONFIGURED, STARTING, STARTED, STOPPING, STOPPED, + * DELETING, DELETED, ERROR + */ + // given state is unstable + switch (state) { + case "CREATING": + return "CREATED"; + case "DELETING": + return "DELETED"; + case "CONFIGURING": + return "CONFIGURED"; + case "STARTING": + return "STARTED"; + case "STOPPING": + return "STOPPED"; + case "PENDING": + return "STARTED"; + } + } else if (operationPostStates.containsValue(state)) { + // given state is stable + switch (state) { + case "INITIAL": + return "CREATED"; + case "CREATED": + return "CONFIGURED"; + case "CONFIGURED": + return "STARTED"; + case "STARTED": + return "STARTED"; + case "STOPPED": + return "STOPPED"; + } + } + + return null; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/core/InstanceStates.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/core/InstanceStates.java new file mode 100644 index 000000000..db2aae3a0 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/java/org/opentosca/planbuilder/postphase/plugin/instancedata/core/InstanceStates.java @@ -0,0 +1,115 @@ +package org.opentosca.planbuilder.postphase.plugin.instancedata.core; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de + */ +public class InstanceStates { + + private static Map operationPreStates; + private static Map operationPostStates; + + static { + operationPreStates = new HashMap<>(); + operationPostStates = new HashMap<>(); + + /* + * INITIAL, CREATING, CREATED, CONFIGURING, CONFIGURED, STARTING, STARTED, STOPPING, STOPPED, + * DELETING, DELETED, ERROR + */ + // left side = operation name + // right side = pre/post state of operation + + // lifecycle + operationPreStates.put("install", "CREATING"); + operationPreStates.put("uninstall", "DELETING"); + operationPreStates.put("configure", "CONFIGURING"); + operationPreStates.put("start", "STARTING"); + operationPreStates.put("stop", "STOPPING"); + + operationPostStates.put("install", "CREATED"); + operationPostStates.put("uninstall", "INITIAL"); + operationPostStates.put("configure", "CONFIGURED"); + operationPostStates.put("start", "STARTED"); + operationPostStates.put("stop", "STOPPED"); + + // VM's + operationPreStates.put("createVM", "STARTING"); + operationPreStates.put("waitForAvailability", "STARTING"); + + operationPostStates.put("createVM", "CONFIGURED"); + operationPostStates.put("waitForAvailability", "STARTED"); + + // Docker + operationPreStates.put("startContainer", "STARTING"); + operationPostStates.put("startContainer", "STARTED"); + + operationPreStates.put("removeContainer", "DELETING"); + operationPostStates.put("removeContainer", "DELETED"); + } + + public static String getOperationPreState(final String operationName) { + return operationPreStates.get(operationName); + } + + public static String getOperationPostState(final String operationName) { + return operationPostStates.get(operationName); + } + + public static boolean isStableOperationState(final String state) { + return operationPostStates.containsValue(state); + } + + /** + * Returns the next stable state for the given state. A stable state means that the node isn't in a state of + * modification such as installing, starting, pending, etc.. + *

    + * The next stable state of e.g., uninstalled would be installed, for installing it would be installed, configuring + * would be configured, etc. + * + * @param state a String containing a lifecycle state + * @return a String containing the next stable state from the given state + */ + public static String getNextStableOperationState(final String state) { + + if (operationPreStates.containsValue(state)) { + /* + * INITIAL, CREATING, CREATED, CONFIGURING, CONFIGURED, STARTING, STARTED, STOPPING, STOPPED, + * DELETING, DELETED, ERROR + */ + // given state is unstable + switch (state) { + case "CREATING": + return "CREATED"; + case "DELETING": + return "DELETED"; + case "CONFIGURING": + return "CONFIGURED"; + case "STARTING": + return "STARTED"; + case "STOPPING": + return "STOPPED"; + case "PENDING": + return "STARTED"; + } + } else if (operationPostStates.containsValue(state)) { + // given state is stable + switch (state) { + case "INITIAL": + return "CREATED"; + case "CREATED": + return "CONFIGURED"; + case "CONFIGURED": + return "STARTED"; + case "STARTED": + return "STARTED"; + case "STOPPED": + return "STOPPED"; + } + } + + return null; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightDELETE.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightDELETE.xml new file mode 100644 index 000000000..600054f8a --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightDELETE.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET.xml new file mode 100644 index 000000000..6ff173b64 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_Instance_Properties.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_Instance_Properties.xml new file mode 100644 index 000000000..691468887 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_Instance_Properties.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml new file mode 100644 index 000000000..b757aaede --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..806986bec --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..116afa3c7 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..3ccd9881b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..62ef00328 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml new file mode 100644 index 000000000..261cd9876 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml new file mode 100644 index 000000000..bf7eb03c1 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml @@ -0,0 +1,6 @@ + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml new file mode 100644 index 000000000..1dd533c45 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml new file mode 100644 index 000000000..ad0f920f4 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromInputToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromInputToStringVar.xml new file mode 100644 index 000000000..6d91d941e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromInputToStringVar.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromNodeInstanceRequestToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromNodeInstanceRequestToStringVar.xml new file mode 100644 index 000000000..4a4419a7d --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromNodeInstanceRequestToStringVar.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromServiceInstanceRequestToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromServiceInstanceRequestToStringVar.xml new file mode 100644 index 000000000..c4bf619d3 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignFromServiceInstanceRequestToStringVar.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignServiceInstancePOSTResponse.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignServiceInstancePOSTResponse.xml new file mode 100644 index 000000000..f5f1d6c82 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelAssignServiceInstancePOSTResponse.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelCopyFromPropertyVarToNodeInstanceProperty.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelCopyFromPropertyVarToNodeInstanceProperty.xml new file mode 100644 index 000000000..148425d29 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/instancedata-plugin/BpelCopyFromPropertyVarToNodeInstanceProperty.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..f83bc8a45 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.instancedata/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder instancedata postphase plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.monitoring/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.monitoring/pom.xml new file mode 100644 index 000000000..4fe05c9de --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.monitoring/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.postphase.plugin.monitoring + + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + + diff --git a/org.opentosca.planbuilder.postphase.plugin.monitoring/src/org/opentosca/planbuilder/postphase/plugin/monitoring/bpel/impl/BPELMonitoringPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.monitoring/src/main/java/org/opentosca/planbuilder/postphase/plugin/monitoring/bpel/impl/BPELMonitoringPlugin.java similarity index 90% rename from org.opentosca.planbuilder.postphase.plugin.monitoring/src/org/opentosca/planbuilder/postphase/plugin/monitoring/bpel/impl/BPELMonitoringPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.monitoring/src/main/java/org/opentosca/planbuilder/postphase/plugin/monitoring/bpel/impl/BPELMonitoringPlugin.java index 4c12c7c59..0678af030 100644 --- a/org.opentosca.planbuilder.postphase.plugin.monitoring/src/org/opentosca/planbuilder/postphase/plugin/monitoring/bpel/impl/BPELMonitoringPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.monitoring/src/main/java/org/opentosca/planbuilder/postphase/plugin/monitoring/bpel/impl/BPELMonitoringPlugin.java @@ -6,9 +6,11 @@ import javax.xml.namespace.QName; +import org.opentosca.container.core.next.model.PlanType; import org.opentosca.container.core.tosca.convention.Utils; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractInterface; @@ -16,20 +18,17 @@ import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; /** *

    - * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to - * the OpenTOSCA Container InstanceData API + * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to the OpenTOSCA + * Container InstanceData API *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELMonitoringPlugin implements IPlanBuilderPostPhasePlugin { @@ -38,7 +37,6 @@ public class BPELMonitoringPlugin implements IPlanBuilderPostPhasePlugin + + + Register the beans within the planbuilder monitoring postphase plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/pom.xml new file mode 100644 index 000000000..52aa338c1 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.postphase.plugin.situations + + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + commons-io + commons-io + 2.6 + + + + diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/BPELSituationPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/BPELSituationPlugin.java similarity index 80% rename from org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/BPELSituationPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/BPELSituationPlugin.java index bae53eb36..393e56119 100644 --- a/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/BPELSituationPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/BPELSituationPlugin.java @@ -1,279 +1,254 @@ -package org.opentosca.planbuilder.postphase.plugin.situations.bpel; - -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.text.Document; -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.opentosca.container.core.tosca.convention.Utils; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELPlan.VariableType; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicy; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwarePrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.xml.sax.SAXException; - -/** - *

    - * This plugin enables situation-aware execution of management operations. It needs the appropiate - * policies annotated, wich are: multiple SituationPolicy policies which specify which situations - * must be active to execute an operation and a single SituationAwareExecutionPolicy per - * NodeTemplate which configures whether to 'Wait' or 'Abort' when trying to execute an operation - * and when it is executed should operation 'Continue', 'Abort' or 'Compensate. - *

    - * Copyright 2019 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepes@iaas.uni-stuttgart.de - * - */ -public class BPELSituationPlugin implements IPlanBuilderPostPhasePlugin { - - private static final String PLAN_ID = "OpenTOSCA Situation-Aware Post Phase Plugin"; - private final Fragments fragments; - private final BPELProcessFragments mainFragments; - - public BPELSituationPlugin() throws ParserConfigurationException { - this.fragments = new Fragments(); - this.mainFragments = new BPELProcessFragments(); - } - - @Override - public boolean canHandleCreate(BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { - Collection nodes = SituationPluginUtils.findUsedNodes(context); - return SituationPluginUtils.getSituationAwareExecutionPolicy(nodes) != null & !SituationPluginUtils.getSituationPolicies(nodes).isEmpty(); - } - - @Override - public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { - Collection usedNodes = SituationPluginUtils.findUsedNodes(context); - // get annotated policy for the situational scope - AbstractPolicy situationAwareExecutionPolicy = SituationPluginUtils.getSituationAwareExecutionPolicy(usedNodes); - String entryMode = situationAwareExecutionPolicy.getTemplate().getProperties().asMap().get("EntryMode"); - String situationViolation = - situationAwareExecutionPolicy.getTemplate().getProperties().asMap().get("SituationViolation"); - - - // get annotated situation policies - Collection situationPolicies = SituationPluginUtils.getSituationPolicies(usedNodes); - Map situationPolicies2DataVariables = new HashMap(); - Map situationPolicies2IdVariables = new HashMap(); - Map situationPolicies2InputParamName = new HashMap(); - - - // create variable to check if we started the situational scope yet - Variable situationalScopeStartedVariable = - context.createGlobalStringVariable(nodeTemplate.getId() + "_situationalScope_started", "false"); - - // create ID(/URL) and data variable for each situation - - for (AbstractPolicy policy : situationPolicies) { - String varName = policy.getName() + "_URL_" + System.currentTimeMillis(); - Variable policyIdVar = context.createGlobalStringVariable(varName, "-1"); - - varName = policy.getName() + "_DATA_" + System.currentTimeMillis(); - context.addGlobalVariable(varName, VariableType.TYPE, new QName("http://www.w3.org/2001/XMLSchema", - "anyType", "xsd" + System.currentTimeMillis())); - Variable policyDataVar = context.getVariable(varName); - - situationPolicies2IdVariables.put(policy, policyIdVar); - situationPolicies2DataVariables.put(policy, policyDataVar); - - // add input param for situation - String inputName = policy.getName() + "_URL"; - context.addStringValueToPlanRequest(inputName); - situationPolicies2InputParamName.put(policy, inputName); - - // assign ID(/URL) from input - try { - Node assignIdFromInputToVar = - this.fragments.generateAssignFromInputMessageToStringVariableAsNode(inputName, - policyIdVar.getVariableName()); - assignIdFromInputToVar = context.importNode(assignIdFromInputToVar); - context.appendToInitSequence(assignIdFromInputToVar); - } - catch (IOException e) { - e.printStackTrace(); - } - catch (SAXException e) { - e.printStackTrace(); - } - } - - // add update situation data - SituationPluginUtils.addGETSituationData(context, situationPolicies2IdVariables, situationPolicies2DataVariables, - context.getPrePhaseElement(), this.fragments); - - String situationsActiveXpathQuery = SituationPluginUtils.getSituationDataEvaluationQuery(situationPolicies2DataVariables); - - - - - - String combinedQuery = situationsActiveXpathQuery; - - if(SituationPluginUtils.isWCETCalculationPossible(context, nodeTemplate, usedNodes)) { - String situationsMinActiveTimeXpathQuery = - SituationPluginUtils.getSituationMinActiveTimeEvaluationQuery(situationPolicies2DataVariables); - - Variable compensationWcetTimeVariable = SituationPluginUtils.appendCompensationWCETCalculation(context, nodeTemplate, usedNodes); - - String wcetQuery = "number($" + compensationWcetTimeVariable.getVariableName() + ") <= number(" + situationsMinActiveTimeXpathQuery + ")"; - - combinedQuery += " and " + wcetQuery; - } - - - // If entryMode is 'abort' we exit the process if one situation is not active at this point - if (entryMode.equals("Abort")) { - Node node = SituationPluginUtils.createIfXPathExprTrueThrowError(combinedQuery, nodeTemplate, this.mainFragments); - node = context.importNode(node); - context.getPrePhaseElement().appendChild(node); - context.getProvisioningCompensationPhaseElement() - .appendChild(context.createElement(BPELPlan.bpelNamespace, "exit")); - } - - // ..if 'wait' we wait 5s and re-evaluate via a while activity wrapping a sequence of wait and data - // updates - if (entryMode.equals("Wait")) { - try { - Element waitForConditionActivities = - (Element) this.mainFragments.createWaitForCondition("not(" + combinedQuery + ")", - "'PT5S'"); - waitForConditionActivities = (Element) context.importNode(waitForConditionActivities); - - - Node seq = SituationPluginUtils.getFirstChildNode(waitForConditionActivities, "sequence"); - - SituationPluginUtils.addGETSituationData(context, situationPolicies2IdVariables, situationPolicies2DataVariables, - (Element) seq, this.fragments); - - waitForConditionActivities = (Element) context.importNode(waitForConditionActivities); - context.getPrePhaseElement().appendChild(waitForConditionActivities); - } - catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - try { - Node assignStartedVar = this.mainFragments.createAssignXpathQueryToStringVarFragmentAsNode(nodeTemplate - .getId() - + "_assignSituationScopeStarted", "boolean('true')", situationalScopeStartedVariable.getVariableName()); - assignStartedVar = context.importNode(assignStartedVar); - context.getPrePhaseElement().appendChild(assignStartedVar); - } - catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (SAXException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - /* Add EventHandler Activity that observes the situations */ - SituationPluginUtils.addSituationObservationActivities(context, nodeTemplate, "'PT5S'", situationPolicies2DataVariables, - situationPolicies2IdVariables, situationViolation, - situationalScopeStartedVariable, this.fragments, this.mainFragments); - return true; - } - - @Override - public boolean canHandleTerminate(BPELPlanContext context, AbstractNodeTemplate nodeTemplate) { - // if we can handle creation, we can also handle termination as we only add situation observation - // code - return this.canHandleCreate(context, nodeTemplate); - } - - @Override - public boolean canHandleCreate(BPELPlanContext context, final AbstractRelationshipTemplate relationshipTemplate) { - // we can handle relations - return false; - } - - @Override - public boolean canHandleTerminate(BPELPlanContext context, AbstractRelationshipTemplate relationshipTemplate) { - return false; - } - - - @Override - public boolean handleTerminate(BPELPlanContext context, AbstractNodeTemplate nodeTemplate) { - return false; - } - - @Override - public String getID() { - return PLAN_ID; - } - - @Override - public boolean handleCreate(final BPELPlanContext context, - final AbstractRelationshipTemplate relationshipTemplate) { - return false; - } - - - - @Override - public boolean handleTerminate(BPELPlanContext context, AbstractRelationshipTemplate relationshipTemplate) { - return false; - } - - @Override - public int getPriority() { - return 1; - } - - @Override - public boolean handleUpdate(BPELPlanContext sourceContext, BPELPlanContext targetContext, - AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate) { - - return false; - } - - @Override - public boolean canHandleUpdate(AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate) { - // this plugin can create instance data for only equal nodeTemplates as of now - if (sourceNodeTemplate.getType().getId().equals(targetNodeTemplate.getType().getId())) { - return true; - } - return false; - } - - @Override - public boolean handleUpdate(BPELPlanContext sourceContext, BPELPlanContext targetContext, - AbstractRelationshipTemplate sourceRelationshipTemplate, - AbstractRelationshipTemplate targetRelationshipTemplate) { - - - return false; - } - - @Override - public boolean canHandleUpdate(AbstractRelationshipTemplate sourceRelationshipTemplate, - AbstractRelationshipTemplate targetRelationshipTemplate) { - return false; - } - -} +package org.opentosca.planbuilder.postphase.plugin.situations.bpel; + +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.namespace.QName; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; +import org.opentosca.planbuilder.model.plan.bpel.BPELPlan.VariableType; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractPolicy; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.springframework.stereotype.Component; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +/** + *

    + * This plugin enables situation-aware execution of management operations. It needs the appropiate policies annotated, + * wich are: multiple SituationPolicy policies which specify which situations must be active to execute an operation and + * a single SituationAwareExecutionPolicy per NodeTemplate which configures whether to 'Wait' or 'Abort' when trying to + * execute an operation and when it is executed should operation 'Continue', 'Abort' or 'Compensate. + *

    + * Copyright 2019 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepes@iaas.uni-stuttgart.de + */ +@Component +public class BPELSituationPlugin implements IPlanBuilderPostPhasePlugin { + + private static final String PLAN_ID = "OpenTOSCA Situation-Aware Post Phase Plugin"; + private final Fragments fragments; + private final BPELProcessFragments mainFragments; + + public BPELSituationPlugin() throws ParserConfigurationException { + this.fragments = new Fragments(); + this.mainFragments = new BPELProcessFragments(); + } + + @Override + public boolean canHandleCreate(BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { + Collection nodes = SituationPluginUtils.findUsedNodes(context); + return SituationPluginUtils.getSituationAwareExecutionPolicy(nodes) != null & !SituationPluginUtils.getSituationPolicies(nodes).isEmpty(); + } + + @Override + public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { + Collection usedNodes = SituationPluginUtils.findUsedNodes(context); + // get annotated policy for the situational scope + AbstractPolicy situationAwareExecutionPolicy = SituationPluginUtils.getSituationAwareExecutionPolicy(usedNodes); + String entryMode = situationAwareExecutionPolicy.getTemplate().getProperties().asMap().get("EntryMode"); + String situationViolation = + situationAwareExecutionPolicy.getTemplate().getProperties().asMap().get("SituationViolation"); + + // get annotated situation policies + Collection situationPolicies = SituationPluginUtils.getSituationPolicies(usedNodes); + Map situationPolicies2DataVariables = new HashMap(); + Map situationPolicies2IdVariables = new HashMap(); + Map situationPolicies2InputParamName = new HashMap(); + + // create variable to check if we started the situational scope yet + Variable situationalScopeStartedVariable = + context.createGlobalStringVariable(nodeTemplate.getId() + "_situationalScope_started", "false"); + + // create ID(/URL) and data variable for each situation + + for (AbstractPolicy policy : situationPolicies) { + String varName = policy.getName() + "_URL_" + System.currentTimeMillis(); + Variable policyIdVar = context.createGlobalStringVariable(varName, "-1"); + + varName = policy.getName() + "_DATA_" + System.currentTimeMillis(); + context.addGlobalVariable(varName, VariableType.TYPE, new QName("http://www.w3.org/2001/XMLSchema", + "anyType", "xsd" + System.currentTimeMillis())); + Variable policyDataVar = context.getVariable(varName); + + situationPolicies2IdVariables.put(policy, policyIdVar); + situationPolicies2DataVariables.put(policy, policyDataVar); + + // add input param for situation + String inputName = policy.getName() + "_URL"; + context.addStringValueToPlanRequest(inputName); + situationPolicies2InputParamName.put(policy, inputName); + + // assign ID(/URL) from input + try { + Node assignIdFromInputToVar = + this.fragments.generateAssignFromInputMessageToStringVariableAsNode(inputName, + policyIdVar.getVariableName()); + assignIdFromInputToVar = context.importNode(assignIdFromInputToVar); + context.appendToInitSequence(assignIdFromInputToVar); + } catch (IOException e) { + e.printStackTrace(); + } catch (SAXException e) { + e.printStackTrace(); + } + } + + // add update situation data + SituationPluginUtils.addGETSituationData(context, situationPolicies2IdVariables, situationPolicies2DataVariables, + context.getPrePhaseElement(), this.fragments); + + String situationsActiveXpathQuery = SituationPluginUtils.getSituationDataEvaluationQuery(situationPolicies2DataVariables); + + String combinedQuery = situationsActiveXpathQuery; + + if (SituationPluginUtils.isWCETCalculationPossible(context, nodeTemplate, usedNodes)) { + String situationsMinActiveTimeXpathQuery = + SituationPluginUtils.getSituationMinActiveTimeEvaluationQuery(situationPolicies2DataVariables); + + Variable compensationWcetTimeVariable = SituationPluginUtils.appendCompensationWCETCalculation(context, nodeTemplate, usedNodes); + + String wcetQuery = "number($" + compensationWcetTimeVariable.getVariableName() + ") <= number(" + situationsMinActiveTimeXpathQuery + ")"; + + combinedQuery += " and " + wcetQuery; + } + + // If entryMode is 'abort' we exit the process if one situation is not active at this point + if (entryMode.equals("Abort")) { + Node node = SituationPluginUtils.createIfXPathExprTrueThrowError(combinedQuery, nodeTemplate, this.mainFragments); + node = context.importNode(node); + context.getPrePhaseElement().appendChild(node); + context.getProvisioningCompensationPhaseElement() + .appendChild(context.createElement(BPELPlan.bpelNamespace, "exit")); + } + + // ..if 'wait' we wait 5s and re-evaluate via a while activity wrapping a sequence of wait and data + // updates + if (entryMode.equals("Wait")) { + try { + Element waitForConditionActivities = + (Element) this.mainFragments.createWaitForCondition("not(" + combinedQuery + ")", + "'PT5S'"); + waitForConditionActivities = (Element) context.importNode(waitForConditionActivities); + + Node seq = SituationPluginUtils.getFirstChildNode(waitForConditionActivities, "sequence"); + + SituationPluginUtils.addGETSituationData(context, situationPolicies2IdVariables, situationPolicies2DataVariables, + (Element) seq, this.fragments); + + waitForConditionActivities = (Element) context.importNode(waitForConditionActivities); + context.getPrePhaseElement().appendChild(waitForConditionActivities); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + try { + Node assignStartedVar = this.mainFragments.createAssignXpathQueryToStringVarFragmentAsNode(nodeTemplate + .getId() + + "_assignSituationScopeStarted", "boolean('true')", situationalScopeStartedVariable.getVariableName()); + assignStartedVar = context.importNode(assignStartedVar); + context.getPrePhaseElement().appendChild(assignStartedVar); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (SAXException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + /* Add EventHandler Activity that observes the situations */ + SituationPluginUtils.addSituationObservationActivities(context, nodeTemplate, "'PT5S'", situationPolicies2DataVariables, + situationPolicies2IdVariables, situationViolation, + situationalScopeStartedVariable, this.fragments, this.mainFragments); + return true; + } + + @Override + public boolean canHandleTerminate(BPELPlanContext context, AbstractNodeTemplate nodeTemplate) { + // if we can handle creation, we can also handle termination as we only add situation observation + // code + return this.canHandleCreate(context, nodeTemplate); + } + + @Override + public boolean canHandleCreate(BPELPlanContext context, final AbstractRelationshipTemplate relationshipTemplate) { + // we can handle relations + return false; + } + + @Override + public boolean canHandleTerminate(BPELPlanContext context, AbstractRelationshipTemplate relationshipTemplate) { + return false; + } + + @Override + public boolean handleTerminate(BPELPlanContext context, AbstractNodeTemplate nodeTemplate) { + return false; + } + + @Override + public String getID() { + return PLAN_ID; + } + + @Override + public boolean handleCreate(final BPELPlanContext context, + final AbstractRelationshipTemplate relationshipTemplate) { + return false; + } + + @Override + public boolean handleTerminate(BPELPlanContext context, AbstractRelationshipTemplate relationshipTemplate) { + return false; + } + + @Override + public int getPriority() { + return 1; + } + + @Override + public boolean handleUpdate(BPELPlanContext sourceContext, BPELPlanContext targetContext, + AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate) { + + return false; + } + + @Override + public boolean canHandleUpdate(AbstractNodeTemplate sourceNodeTemplate, AbstractNodeTemplate targetNodeTemplate) { + // this plugin can create instance data for only equal nodeTemplates as of now + if (sourceNodeTemplate.getType().getId().equals(targetNodeTemplate.getType().getId())) { + return true; + } + return false; + } + + @Override + public boolean handleUpdate(BPELPlanContext sourceContext, BPELPlanContext targetContext, + AbstractRelationshipTemplate sourceRelationshipTemplate, + AbstractRelationshipTemplate targetRelationshipTemplate) { + + return false; + } + + @Override + public boolean canHandleUpdate(AbstractRelationshipTemplate sourceRelationshipTemplate, + AbstractRelationshipTemplate targetRelationshipTemplate) { + return false; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/Fragments.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/Fragments.java new file mode 100644 index 000000000..1fb7e7f3c --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/Fragments.java @@ -0,0 +1,498 @@ +/** + * + */ +package org.opentosca.planbuilder.postphase.plugin.situations.bpel; + +import java.io.IOException; +import java.io.StringReader; +import java.util.Map; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.common.file.ResourceAccess; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + *

    + * This class contains all the BPEL Fragments + *

    + * Copyright 2014 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + * + */ +public class Fragments { + + private final DocumentBuilderFactory docFactory; + private final DocumentBuilder docBuilder; + + /** + * Constructor + * + * @throws ParserConfigurationException is thrown when initializing the internal DocumentBuild fails + */ + public Fragments() throws ParserConfigurationException { + this.docFactory = DocumentBuilderFactory.newInstance(); + this.docFactory.setNamespaceAware(true); + this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } + + /** + * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. + * + * @param bpelVarName the variable containing an URL + * @param responseVarName the variable to hold the response + * @return a String containing a BPEL4RESTLight Activity + * @throws IOException is thrown when reading internal files fails + */ + public String createRESTDeleteOnURLBPELVarAsString(final String bpelVarName, + final String responseVarName) throws IOException { + String template = readFileAsString("BPEL4RESTLightDELETE.xml"); + // + template = template.replace("$urlVarName", bpelVarName); + template = template.replace("$ResponseVarName", responseVarName); + + return template; + } + + /** + * Creates a BPEL4RESTLight DELETE Activity with the given BPELVar as Url to request on. + * + * @param bpelVarName the variable containing an URL + * @param responseVarName the variable to hold the response + * @return a String containing a BPEL4RESTLight Activity + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node createRESTDeleteOnURLBPELVarAsNode(final String bpelVarName, + final String responseVarName) throws IOException, SAXException { + final String templateString = createRESTDeleteOnURLBPELVarAsString(bpelVarName, responseVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a BPEL4RESTLight extension activity that sets the instance state of the given + * nodeInstance with the contents of the given string variable + * + * @param instanceURLVar the variable holding the url to the node instance + * @param RequestVarName the variable to take the request body contents from + * @return a String containing a single BPEL extension activity + * @throws IOException is thrown when reading a internal file fails + */ + public String generateBPEL4RESTLightPUTInstanceState(final String instanceURLVar, + final String RequestVarName) throws IOException { + // BPEL4RESTLightPUT_NodeInstance_State_InstanceDataAPI.xml + // + + String bpel4restString = readFileAsString("BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml"); + + bpel4restString = bpel4restString.replace("$instanceURLVar", instanceURLVar); + bpel4restString = bpel4restString.replace("$RequestVarName", RequestVarName); + + return bpel4restString; + } + + public String generateBPEL4RESTLightGETInstanceState(final String instanceURLVar, + final String ResponseVarName) throws IOException { + // BPEL4RESTLightPUT_NodeInstance_State_InstanceDataAPI.xml + // + String bpel4restString = readFileAsString("BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml"); + + bpel4restString = bpel4restString.replace("$instanceURLVar", instanceURLVar); + bpel4restString = bpel4restString.replace("$ResponseVarName", ResponseVarName); + + return bpel4restString; + } + + public Node generateBPEL4RESTLightGETInstanceStateAsNode(final String instanceURLVar, + final String ResponseVarName) throws SAXException, IOException { + return this.toDom(this.generateBPEL4RESTLightGETInstanceState(instanceURLVar, ResponseVarName)); + } + + private Node toDom(String templateString) throws SAXException, IOException { + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a String containing a BPEL assign that reads the value of a NodeInstance create + * response and writes it into the referenced string variable + * + * @param nodeInstanceURLVarName the string variable to write the data into + * @param nodeInstancePOSTResponseVarName the response variable of a nodeInstance create POST + * @return a String containing a BPEL assign + * @throws IOException is thrown when reading a internal file fails + */ + public String generateAssignFromNodeInstancePOSTResponseToStringVar(final String nodeInstanceURLVarName, + final String nodeInstanceIDVarName, + final String nodeInstancePOSTResponseVarName) throws IOException { + // BPELAssignFromNodeInstancePOSTResponseToStringVar.xml + // + String bpelAssignString = readFileAsString("BPELAssignFromNodeInstancePOSTResponseToStringVar.xml"); + + bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", nodeInstanceURLVarName); + bpelAssignString = + bpelAssignString.replaceAll("\\$NodeInstanceResponseVarName", nodeInstancePOSTResponseVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$nodeInstanceIDVar", nodeInstanceIDVarName); + + return bpelAssignString; + } + + /** + * Generates a String containing a BPEL assign that reads the value of a RelationInstance create + * response and writes it into the referenced string variable + * + * @param stringVarName the string variable to write the data into + * @param relationInstancePOSTResponseVarName the response variable of a relationInstance create + * POST + * @return a String containing a BPEL assign + * @throws IOException is thrown when reading a internal file fails + */ + public String generateAssignFromRelationInstancePOSTResponseToStringVar(final String stringVarName, + final String relationInstanceIDVar, + final String relationInstancePOSTResponseVarName) throws IOException { + // BPELAssignFromNodeInstancePOSTResponseToStringVar.xml + // + String bpelAssignString = readFileAsString("BPELAssignFromRelationInstancePOSTResponseToStringVar.xml"); + + bpelAssignString = bpelAssignString.replaceAll("\\$stringVarName", stringVarName); + bpelAssignString = + bpelAssignString.replaceAll("\\$RelationInstanceResponseVarName", relationInstancePOSTResponseVarName); + bpelAssignString = bpelAssignString.replaceAll("\\$relationInstanceIDVar", relationInstanceIDVar); + + return bpelAssignString; + } + + /** + * Generates a String containing a BPEL4RESTLight extension activity which create a nodeTemplate + * instance on the given serviceTemplate instance + * + * @param serviceInstanceURLVar the variable holding the serviceInstanceUrl + * @param nodeTemplateId the id of the nodeTemplate to instantiate + * @param responseVariableName the variable to store the response into + * @return a String containing a BPEL extension activity + * @throws IOException is thrown when reading the internal file fails + */ + public String generateBPEL4RESTLightNodeInstancePOST(final String serviceInstanceURLVar, + final String serviceInstanceIDVarName, + final String nodeTemplateId, + final String responseVariableName) throws IOException { + // + String bpel4RestString = readFileAsString("BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml"); + + bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceURLVar", serviceInstanceURLVar); + bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceIDVar", serviceInstanceIDVarName); + bpel4RestString = bpel4RestString.replaceAll("\\$nodeTemplateId", nodeTemplateId); + bpel4RestString = bpel4RestString.replaceAll("\\$ResponseVarName", responseVariableName); + + return bpel4RestString; + } + + /** + * Generates a String containing a BPEL4RESTLight extension activity which creates a Relationship + * Template instance on the given Service Template instance + * + * @param serviceInstanceURLVar the variable holding the serviceInstanceUrl + * @param relationshipTemplateId the id of the Relationship Template to instantiate + * @param responseVariableName the variable to store the response into + * @param sourceInstanceIdVarName the variable name of the instance Id of the source node instance + * of the relation to be created + * @param targetInstanceIdVarName the variable name of the instance Id of the target node instance + * of the relation to be created + * @return a String containing a BPEL extension activity + * @throws IOException is thrown when reading the internal file fails + */ + public String generateBPEL4RESTLightRelationInstancePOST(final String serviceInstanceURLVar, + final String relationshipTemplateId, + final String requestVariableName, + final String responseVariableName, + final String sourceInstanceIdVarName, + final String targetInstanceIdVarName, + final String serviceInstanceIdVarName) throws IOException { + // + String bpel4RestString = readFileAsString("BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml"); + + bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceURLVar", serviceInstanceURLVar); + bpel4RestString = bpel4RestString.replaceAll("\\$relationshipTemplateId", relationshipTemplateId); + bpel4RestString = bpel4RestString.replaceAll("\\$RequestVarName", requestVariableName); + bpel4RestString = bpel4RestString.replaceAll("\\$ResponseVarName", responseVariableName); + bpel4RestString = bpel4RestString.replaceAll("\\$sourceInstanceIdVarName", sourceInstanceIdVarName); + bpel4RestString = bpel4RestString.replaceAll("\\$targetInstanceIdVarName", targetInstanceIdVarName); + bpel4RestString = bpel4RestString.replaceAll("\\$serviceInstanceIdVarName", serviceInstanceIdVarName); + + return bpel4RestString; + } + + public String generateBPEL4RESTLightServiceInstancePOST(final String instanceDataAPIUrlVariableName, + final String csarId, final QName serviceTemplateId, + final String responseVariableName) throws IOException { + // tags in xml snippet: $InstanceDataURLVar, $CSARName, + // $serviceTemplateId, $ResponseVarName + String bpel4RestString = readFileAsString("BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml"); + + bpel4RestString = bpel4RestString.replace("$InstanceDataURLVar", instanceDataAPIUrlVariableName); + bpel4RestString = bpel4RestString.replace("$CSARName", csarId); + bpel4RestString = bpel4RestString.replace("$serviceTemplateId", serviceTemplateId.toString()); + bpel4RestString = bpel4RestString.replace("$ResponseVarName", responseVariableName); + + return bpel4RestString; + } + + public Node generateBPEL4RESTLightServiceInstancePOSTAsNode(final String instanceDataAPIUrlVariableName, + final String csarId, final QName serviceTemplateId, + final String responseVariableName) throws IOException, + SAXException { + final String templateString = + generateBPEL4RESTLightServiceInstancePOST(instanceDataAPIUrlVariableName, csarId, serviceTemplateId, + responseVariableName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateServiceInstanceURLVarAssign(final String serviceInstanceResponseVarName, + final String serviceInstanceURLVarName) throws IOException { + String bpelAssignString = readFileAsString("BpelAssignServiceInstancePOSTResponse.xml"); + // + + bpelAssignString = + bpelAssignString.replace("$assignName", "assignServiceInstance" + System.currentTimeMillis()); + bpelAssignString = bpelAssignString.replace("$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); + bpelAssignString = bpelAssignString.replace("$ServiceInstanceURLVarName", serviceInstanceURLVarName); + return bpelAssignString; + } + + public Node generateServiceInstanceURLVarAssignAsNode(final String serviceInstanceResponseVarName, + final String serviceInstanceURLVarName) throws IOException, + SAXException { + final String templateString = + generateServiceInstanceURLVarAssign(serviceInstanceResponseVarName, serviceInstanceURLVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public Node generateNodeInstancesQueryGETasNode(final String instanceDataUrlVarName, final String responseVarName, + final QName nodeType) throws IOException, SAXException { + final String templateString = + generateNodeInstancePropertiesGET(instanceDataUrlVarName, responseVarName, nodeType); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateInstancePropertiesGET(final String instanceUrlVarName, + final String bpel4RestLightResponseVarName) throws IOException { + String bpel4restLightGETString = readFileAsString("BPEL4RESTLightGET_Instance_Properties.xml"); + // + bpel4restLightGETString = bpel4restLightGETString.replace("$urlVarName", instanceUrlVarName); + bpel4restLightGETString = bpel4restLightGETString.replace("$ResponseVarName", bpel4RestLightResponseVarName); + return bpel4restLightGETString; + } + + public Node generateInstancePropertiesGETAsNode(final String instanceUrlVarName, + final String bpel4RestLightResponseVarName) throws SAXException, + IOException { + final String templateString = generateInstancePropertiesGET(instanceUrlVarName, bpel4RestLightResponseVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateAssignFromNodeInstanceResonseToStringVar(final String stringVarName, + final String nodeInstanceResponseVarName) throws IOException { + String bpelAssignString = readFileAsString("BpelAssignFromNodeInstanceRequestToStringVar.xml"); + // + bpelAssignString = bpelAssignString.replace("$stringVarName", stringVarName); + bpelAssignString = bpelAssignString.replace("$NodeInstanceResponseVarName", nodeInstanceResponseVarName); + return bpelAssignString; + } + + public Node generateAssignFromNodeInstanceResponseToStringVarAsNode(final String stringVarName, + final String nodeInstanceResponseVarName) throws IOException, + SAXException { + final String templateString = + generateAssignFromNodeInstanceResonseToStringVar(stringVarName, nodeInstanceResponseVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateNodeInstancePropertiesGET(final String instanceDataUrlVarName, final String responseVarName, + final QName nodeType) throws IOException { + String bpelAssignString = readFileAsString("BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml"); + + // $InstanceDataURLVar, $ResponseVarName, $nodeType + + bpelAssignString = bpelAssignString.replace("$InstanceDataURLVar", instanceDataUrlVarName); + bpelAssignString = bpelAssignString.replace("$ResponseVarName", responseVarName); + bpelAssignString = bpelAssignString.replace("$nodeType", nodeType.toString()); + return bpelAssignString; + } + + public String generateServiceInstanceRequestToStringVarAssign(final String stringVarName, + final String serviceInstanceResponseVarName, + final int nodeInstanceIndex) throws IOException { + // + String bpelAssignString = readFileAsString("BpelAssignFromServiceInstanceRequestToStringVar.xml"); + + bpelAssignString = bpelAssignString.replace("$stringVarName", stringVarName); + bpelAssignString = bpelAssignString.replace("$ServiceInstanceResponseVarName", serviceInstanceResponseVarName); + bpelAssignString = bpelAssignString.replace("$nodeInstanceIndex", String.valueOf(nodeInstanceIndex)); + + return bpelAssignString; + } + + public Node generateServiceInstanceRequestToStringVarAssignAsNode(final String stringVarName, + final String serviceInstanceResponseVarName, + final int nodeInstanceIndex) throws IOException, + SAXException { + final String templateString = + generateServiceInstanceRequestToStringVarAssign(stringVarName, serviceInstanceResponseVarName, + nodeInstanceIndex); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateBPEL4RESTLightGET(final String urlVarName, final String responseVarName) throws IOException { + // BPEL4RESTLightGET_ServiceInstance_InstanceDataAPI.xml + // + String bpelServiceInstanceGETString = readFileAsString("BPEL4RESTLightGET.xml"); + + bpelServiceInstanceGETString = bpelServiceInstanceGETString.replace("$urlVarName", urlVarName); + bpelServiceInstanceGETString = bpelServiceInstanceGETString.replace("$ResponseVarName", responseVarName); + return bpelServiceInstanceGETString; + } + + public Node generateBPEL4RESTLightGETAsNode(final String serviceInstanceUrlVarName, + final String responseVarName) throws IOException, SAXException { + final String templateString = generateBPEL4RESTLightGET(serviceInstanceUrlVarName, responseVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateAssignFromInputMessageToStringVariable(final String inputMessageElementLocalName, + final String stringVariableName) throws IOException { + String bpelAssignString = readFileAsString("BpelAssignFromInputToStringVar.xml"); + // + bpelAssignString = bpelAssignString.replace("$inputElementLocalName", inputMessageElementLocalName); + bpelAssignString = bpelAssignString.replace("$StringVariableName", stringVariableName); + bpelAssignString = + bpelAssignString.replace("$assignName", "assignFromInputToString" + System.currentTimeMillis()); + return bpelAssignString; + } + + public Node generateAssignFromInputMessageToStringVariableAsNode(final String inputMessageElementLocalName, + final String stringVariableName) throws IOException, + SAXException { + final String templateString = + generateAssignFromInputMessageToStringVariable(inputMessageElementLocalName, stringVariableName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateCopyFromStringVarToAnyTypeVar(final String propertyVarName, + final String nodeInstancePropertyRequestVarName, + final String nodeInstancePropertyLocalName, + final String nodeInstancePropertyNamespace) throws IOException { + String bpelAssignString = readFileAsString("BpelCopyFromPropertyVarToNodeInstanceProperty.xml"); + // + bpelAssignString = bpelAssignString.replace("$PropertyVarName", propertyVarName); + bpelAssignString = + bpelAssignString.replace("$NodeInstancePropertyRequestVarName", nodeInstancePropertyRequestVarName); + bpelAssignString = bpelAssignString.replace("$NodeInstancePropertyLocalName", nodeInstancePropertyLocalName); + bpelAssignString = bpelAssignString.replace("$NodeInstancePropertyNamespace", nodeInstancePropertyNamespace); + return bpelAssignString; + } + + public Node generateCopyFromStringVarToAnyTypeVarAsNode(final String propertyVarName, + final String nodeInstancePropertyRequestVarName, + final String nodeInstancePropertyLocalName, + final String nodeInstancePropertyNamespace) throws IOException, + SAXException { + final String templateString = + generateCopyFromStringVarToAnyTypeVar(propertyVarName, nodeInstancePropertyRequestVarName, + nodeInstancePropertyLocalName, nodeInstancePropertyNamespace); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public Node generateAssignFromPropertyVarToDomMapping(final String nodeInstancePropertyRequestVarName, + final Map propertyVarToDomMapping) throws SAXException, + IOException { + // create empty bpel:assign + final String bpelAssignString = + ""; + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(bpelAssignString)); + final Document doc = this.docBuilder.parse(is); + + final Node assignNode = doc.getFirstChild(); + for (final String propertyVarName : propertyVarToDomMapping.keySet()) { + final Node propertyNode = propertyVarToDomMapping.get(propertyVarName); + Node copyNode = + generateCopyFromStringVarToAnyTypeVarAsNode(propertyVarName, nodeInstancePropertyRequestVarName, + propertyNode.getLocalName(), + propertyNode.getNamespaceURI()); + + copyNode = doc.importNode(copyNode, true); + assignNode.appendChild(copyNode); + } + + return assignNode; + } + + public String generateInstancesBPEL4RESTLightPUT(final String requestVarName, + final String instanceURLVarName) throws IOException { + String bpel4RESTLightPut = readFileAsString("BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml"); + + // + bpel4RESTLightPut = bpel4RESTLightPut.replace("$RequestVarName", requestVarName); + bpel4RESTLightPut = bpel4RESTLightPut.replace("$instanceURLVar", instanceURLVarName); + return bpel4RESTLightPut; + } + + public Node generateInstancesBPEL4RESTLightPUTAsNode(final String requestVarName, + final String instanceURLVarName) throws IOException, + SAXException { + final String templateString = generateInstancesBPEL4RESTLightPUT(requestVarName, instanceURLVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + private String readFileAsString(String fileName) throws IllegalArgumentException, IOException { + String bpelString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("/" + fileName)); + return bpelString; + } +} diff --git a/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/SituationPluginUtils.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/SituationPluginUtils.java similarity index 90% rename from org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/SituationPluginUtils.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/SituationPluginUtils.java index d7e77bafe..2cd0951d0 100644 --- a/org.opentosca.planbuilder.postphase.plugin.situations/src/org/opentosca/planbuilder/postphase/plugin/situations/bpel/SituationPluginUtils.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/java/org/opentosca/planbuilder/postphase/plugin/situations/bpel/SituationPluginUtils.java @@ -15,12 +15,12 @@ import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.tosca.AbstractInterface; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractPolicy; -import org.opentosca.planbuilder.plugins.context.Variable; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -46,13 +46,12 @@ public static Collection fetchUsedNodeTemplates(BPELPlanCo // therefore we have to find those node templates here Collection nodes = new ArrayList(); - Element provPhaseElement = context.getProvisioningPhaseElement(); XPath xpath = XPathFactory.newInstance().newXPath(); try { NodeList nodeTemplateIDNodes = (NodeList) xpath.evaluate("//*[local-name()='invokeOperationAsync']/*[local-name()='NodeTemplateID']", - provPhaseElement, XPathConstants.NODESET); + provPhaseElement, XPathConstants.NODESET); for (int i = 0; i < nodeTemplateIDNodes.getLength(); i++) { String nodeTemplateId = nodeTemplateIDNodes.item(i).getTextContent(); @@ -62,8 +61,7 @@ public static Collection fetchUsedNodeTemplates(BPELPlanCo } } } - } - catch (XPathExpressionException e) { + } catch (XPathExpressionException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -81,7 +79,7 @@ public static Collection findUsedNodes(BPELPlanContext con // nodes.addAll(SituationPluginUtils.findUsedNodes(context, ops.get(key))); // // } - + nodes.add(context.getNodeTemplate()); return nodes; } @@ -149,20 +147,17 @@ public static void addGETSituationData(BPELPlanContext context, // fetch situation data Node fetchSituationState = fragments.generateBPEL4RESTLightGETAsNode(situationPolicies2IdVariables.get(policy) - .getVariableName(), - situationPolicies2DataVariables.get(policy) - .getVariableName()); + .getVariableName(), + situationPolicies2DataVariables.get(policy) + .getVariableName()); fetchSituationState = context.importNode(fetchSituationState); elementToAppendTo.appendChild(fetchSituationState); - } - catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); - } - catch (SAXException e) { + } catch (SAXException e) { e.printStackTrace(); } } - } public static void addSituationDataUpdate(BPELPlanContext context, Node nodeToAppendTo, @@ -174,11 +169,10 @@ public static void addSituationDataUpdate(BPELPlanContext context, Node nodeToAp Element sequenceElement = context.createElement(BPELPlan.bpelNamespace, "sequence"); SituationPluginUtils.addGETSituationData(context, situationPolicies2IdVariables, - situationPolicies2DataVariables, sequenceElement, fragments); + situationPolicies2DataVariables, sequenceElement, fragments); String evalDataExpr = SituationPluginUtils.getSituationDataEvaluationQuery(situationPolicies2DataVariables); - if (situationViolation.equals("Abort")) { // we exit the process if the situation are not active Element ifElement = SituationPluginUtils.createXpathExprIfElement(context, evalDataExpr); @@ -189,15 +183,15 @@ public static void addSituationDataUpdate(BPELPlanContext context, Node nodeToAp // throw error when situation not okay and use integrated compensation logic Node throwErrorIfEvalFalse = context.importNode(SituationPluginUtils.createIfXPathExprTrueThrowError(evalDataExpr, - context.getNodeTemplate(), - mainFragments)); + context.getNodeTemplate(), + mainFragments)); sequenceElement.appendChild(throwErrorIfEvalFalse); } // add the fetch/check/action sequence into an if that checks whether the scope started already Element ifElement = SituationPluginUtils.createXpathExprIfElement(context, - "$" + situationalScopeStartedVariable.getVariableName()); + "$" + situationalScopeStartedVariable.getVariableName()); ifElement.appendChild(sequenceElement); nodeToAppendTo.appendChild(ifElement); } @@ -213,8 +207,8 @@ public static void addSituationObservationActivities(final BPELPlanContext conte BPELProcessFragments processFagments) { Element onAlarmElement = SituationPluginUtils.createOnAlarmEventHandler(context, durationExpression); SituationPluginUtils.addSituationDataUpdate(context, onAlarmElement, situationPolicies2DataVariables, - situationPolicies2IdVariables, situationViolation, - situationalScopeStartedVariable, pluginFragments, processFagments); + situationPolicies2IdVariables, situationViolation, + situationalScopeStartedVariable, pluginFragments, processFagments); context.getEventHandlersElement().appendChild(onAlarmElement); } @@ -227,7 +221,7 @@ public static boolean isWCETCalculationPossible(BPELPlanContext context, Abstrac Collection operationExecutionTimePolicies = SituationPluginUtils.getOperationExecutionTimePolicies(usedNodes); - + int defiendWcets = 0; for (AbstractOperation op : usedOperations.values()) { @@ -235,7 +229,7 @@ public static boolean isWCETCalculationPossible(BPELPlanContext context, Abstrac for (AbstractPolicy pol : operationExecutionTimePolicies) { if (pol.getTemplate().getProperties().asMap().get("InterfaceName") - .equals(op.getInterface().getName()) + .equals(op.getInterface().getName()) && pol.getTemplate().getProperties().asMap().get("OperationName").equals(op.getName())) { String wcetProp = pol.getTemplate().getProperties().asMap().get("WorstCaseExecutionTime"); @@ -251,7 +245,7 @@ public static boolean isWCETCalculationPossible(BPELPlanContext context, Abstrac } public static Variable appendCompensationWCETCalculation(BPELPlanContext context, AbstractNodeTemplate nodeTemplate, - Collection usedNodes) { + Collection usedNodes) { Collection operationExecutionTimePolicies = SituationPluginUtils.getOperationExecutionTimePolicies(usedNodes); @@ -268,7 +262,7 @@ public static Variable appendCompensationWCETCalculation(BPELPlanContext context for (AbstractPolicy pol : operationExecutionTimePolicies) { if (pol.getTemplate().getProperties().asMap().get("InterfaceName") - .equals(op.getInterface().getName()) + .equals(op.getInterface().getName()) && pol.getTemplate().getProperties().asMap().get("OperationName").equals(op.getName())) { String wcetProp = pol.getTemplate().getProperties().asMap().get("WorstCaseExecutionTime"); @@ -282,7 +276,7 @@ public static Variable appendCompensationWCETCalculation(BPELPlanContext context Variable wcetVariable = context.createGlobalStringVariable(nodeTemplate.getId() + "_WCET_" + System.currentTimeMillis(), - String.valueOf(wcet)); + String.valueOf(wcet)); return wcetVariable; } @@ -353,5 +347,4 @@ public static String getSituationMinActiveTimeEvaluationQuery(Map + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_NodeInstance_Properties.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightGET_Instance_Properties.xml similarity index 100% rename from org.opentosca.planbuilder.core.bpel/META-INF/resources/BPEL4RESTLightGET_NodeInstance_Properties.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightGET_Instance_Properties.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml new file mode 100644 index 000000000..f73e0f436 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightGET_Instance_State_InstanceDataAPI.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..09a3ddc05 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightGET_NodeInstance_InstanceDataAPI.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..985d56a1c --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_NodeInstance_InstanceDataAPI.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..9cce0fed4 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_RelationInstance_InstanceDataAPI.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml new file mode 100644 index 000000000..e012bc391 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPOST_ServiceInstance_InstanceDataAPI.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml new file mode 100644 index 000000000..5e8d9449b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPUT_Instance_InstanceDataAPI.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml new file mode 100644 index 000000000..cb1c2be27 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPEL4RESTLightPUT_Instance_State_InstanceDataAPI.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml new file mode 100644 index 000000000..e168e8eb7 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPELAssignFromNodeInstancePOSTResponseToStringVar.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml new file mode 100644 index 000000000..dc2398203 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BPELAssignFromRelationInstancePOSTResponseToStringVar.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromInputToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromInputToStringVar.xml new file mode 100644 index 000000000..f3c6059aa --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromInputToStringVar.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml new file mode 100644 index 000000000..252354b5f --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromNodeInstanceRequestToStringVar.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml new file mode 100644 index 000000000..b34edd2ac --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignFromServiceInstanceRequestToStringVar.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignServiceInstancePOSTResponse.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignServiceInstancePOSTResponse.xml new file mode 100644 index 000000000..b8c513fa3 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelAssignServiceInstancePOSTResponse.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml new file mode 100644 index 000000000..33420d66f --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/BpelCopyFromPropertyVarToNodeInstanceProperty.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..ad68ddbef --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.situations/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,14 @@ + + + + Register the beans within the planbuilder post-phase situation plugin + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/pom.xml new file mode 100644 index 000000000..d9ba0ae52 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.postphase.plugin.vinothek + + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + commons-io + commons-io + 2.6 + + + + diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/BPELVinothekPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/BPELVinothekPlugin.java similarity index 96% rename from org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/BPELVinothekPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/BPELVinothekPlugin.java index 4758ec632..81ffa95ea 100644 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/BPELVinothekPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/BPELVinothekPlugin.java @@ -18,7 +18,6 @@ import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; import org.opentosca.planbuilder.postphase.plugin.vinothek.bpel.handler.BPELVinothekPluginHandler; import org.opentosca.planbuilder.postphase.plugin.vinothek.core.VinothekPlugin; @@ -31,9 +30,10 @@ */ public class BPELVinothekPlugin extends VinothekPlugin { - private static final String pluginId = "OpenTOSCA PlanBuilder PostPhase Plugin Vinothek"; public static final QName phpApp = new QName("http://opentosca.org/types/declarative", "PhpApplication"); public static final QName bpelProcess = new QName("http://opentosca.org/declarative/", "BPEL"); + + private static final String pluginId = "OpenTOSCA PlanBuilder PostPhase Plugin Vinothek"; private final QName zipArtifactType = new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ArchiveArtifact"); @@ -42,8 +42,7 @@ public class BPELVinothekPlugin extends VinothekPlugin { public BPELVinothekPlugin() { try { this.handler = new BPELVinothekPluginHandler(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -188,7 +187,6 @@ private AbstractNodeTypeImplementation selectNodeTypeImplementation(final BPELPl // right spots return nodeImpl; } - } return null; } diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/handler/BPELVinothekPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/handler/BPELVinothekPluginHandler.java similarity index 86% rename from org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/handler/BPELVinothekPluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/handler/BPELVinothekPluginHandler.java index 335b088c9..d6690bb55 100644 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/handler/BPELVinothekPluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/bpel/handler/BPELVinothekPluginHandler.java @@ -1,10 +1,8 @@ package org.opentosca.planbuilder.postphase.plugin.vinothek.bpel.handler; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; -import java.io.UnsupportedEncodingException; import java.net.URL; import java.net.URLDecoder; import java.nio.file.Path; @@ -26,16 +24,15 @@ import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; import org.opentosca.container.core.common.SystemException; import org.opentosca.container.core.common.UserException; +import org.opentosca.container.core.common.file.ResourceAccess; import org.opentosca.container.core.model.AbstractFile; -import org.opentosca.container.core.model.csar.CSARContent; import org.opentosca.container.core.model.csar.id.CSARID; import org.opentosca.container.core.tosca.convention.Properties; +import org.opentosca.container.legacy.core.model.CSARContent; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.csarhandler.CSARHandler; +import org.opentosca.planbuilder.core.csarhandler.CSARHandler; import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; @@ -43,7 +40,6 @@ import org.opentosca.planbuilder.model.utils.ModelUtils; import org.opentosca.planbuilder.postphase.plugin.vinothek.bpel.BPELVinothekPlugin; import org.opentosca.planbuilder.postphase.plugin.vinothek.core.handler.VinothekPluginHandler; -import org.osgi.framework.FrameworkUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -51,12 +47,10 @@ import org.xml.sax.SAXException; /** - * * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - nyuuyn@googlemail.com - * */ public class BPELVinothekPluginHandler implements VinothekPluginHandler { @@ -78,13 +72,10 @@ public BPELVinothekPluginHandler() throws ParserConfigurationException { private Node createSelfserviceApplicationUrlAssign(final String serverIpVarName, final String applicationName, final String outputVarName, final String outputVarPartName, final String outputVarPrefix) throws IOException, SAXException { - // - - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("assignSelfserviceApplicationUrl.xml"); - final File bpelfragmentfile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelfragmentfile); + // + final URL url = getClass().getClassLoader() + .getResource("vinothek-plugin/assignSelfserviceApplicationUrl.xml"); + String template = ResourceAccess.readResourceAsString(url); template = template.replace("{serverIpVarName}", serverIpVarName); template = template.replace("{appName}", applicationName); template = template.replace("{outputVarName}", outputVarName); @@ -137,10 +128,9 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate private boolean handleBPELApp(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, final AbstractNodeTypeImplementation nodeImpl) { - // FIXME: this will be working under many assumptions (bpel-engine: wso2 - // bps.., no port reconfigs,..) - // we try to construct an endpoint of the form - // ServerIP:9763/services/BPELStack_buildPlanService/ + // FIXME: this will be working under many assumptions (bpel-engine: wso2 bps.., no port reconfigs,..) + // we try to construct an endpoint of the form + // ServerIP:9763/services/BPELStack_buildPlanService/ final List das = new ArrayList<>(); @@ -236,7 +226,7 @@ public Iterator getPrefixes(final String namespaceURI) { final String value = (String) xpath.evaluate("/ns:deploy/ns:process/ns:provide[@partnerLink='client']/ns:service/@name", - inputSource, XPathConstants.STRING); + inputSource, XPathConstants.STRING); final String serviceName = value.split(":")[1]; @@ -268,34 +258,12 @@ public Iterator getPrefixes(final String namespaceURI) { Node assignNode = this.createSelfserviceApplicationUrlAssign(serverIpVarName, applicationFolderName, - context.getPlanResponseMessageName(), "payload", "tns"); + context.getPlanResponseMessageName(), "payload", "tns"); assignNode = context.importNode(assignNode); postPhaseElement.appendChild(assignNode); - - } - catch (final UserException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final SystemException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final XPathExpressionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - catch (final SAXException e) { - // TODO Auto-generated catch block + } catch (final UserException | SystemException | IOException | XPathExpressionException | SAXException e) { + // FIXME autogenerated catch block e.printStackTrace(); } return false; @@ -382,28 +350,23 @@ private boolean handlePhpApp(final BPELPlanContext context, final AbstractNodeTe Node assignNode = this.createSelfserviceApplicationUrlAssign(serverIpVarName, applicationFolderName, - context.getPlanResponseMessageName(), "payload", "tns"); + context.getPlanResponseMessageName(), "payload", "tns"); assignNode = context.importNode(assignNode); postPhaseElement.appendChild(assignNode); - - } - catch (final UserException e) { + } catch (final UserException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; - } - catch (final SystemException e) { + } catch (final SystemException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); return false; @@ -411,5 +374,4 @@ private boolean handlePhpApp(final BPELPlanContext context, final AbstractNodeTe return true; } - } diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/core/VinothekPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/core/VinothekPlugin.java similarity index 78% rename from org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/core/VinothekPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/core/VinothekPlugin.java index 97f2a1182..02e86b8d7 100644 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/core/VinothekPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/core/VinothekPlugin.java @@ -6,11 +6,10 @@ import javax.xml.namespace.QName; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPostPhasePlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; /** * Copyright 2014 IAAS University of Stuttgart
    @@ -28,14 +27,14 @@ public abstract class VinothekPlugin implements IPlan new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ArchiveArtifact"); @Override - public boolean canHandleCreate(BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { + public boolean canHandleCreate(BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { // if the nodeTemplate is some kind of PhpApp we're happy return ModelUtils.checkForTypeInHierarchy(nodeTemplate, phpApp) || ModelUtils.checkForTypeInHierarchy(nodeTemplate, bpelProcess); } @Override - public boolean canHandleCreate(BPELPlanContext context, final AbstractRelationshipTemplate relationshipTemplate) { + public boolean canHandleCreate(BPELPlanContext context, final AbstractRelationshipTemplate relationshipTemplate) { // only handling nodeTemplates return false; } @@ -44,5 +43,4 @@ public boolean canHandleCreate(BPELPlanContext context, final AbstractRelations public String getID() { return VinothekPlugin.PLUGIN_ID; } - } diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/core/handler/VinothekPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/core/handler/VinothekPluginHandler.java similarity index 89% rename from org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/core/handler/VinothekPluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/core/handler/VinothekPluginHandler.java index 5ece8eb38..39793815b 100644 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/src/org/opentosca/planbuilder/postphase/plugin/vinothek/core/handler/VinothekPluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/java/org/opentosca/planbuilder/postphase/plugin/vinothek/core/handler/VinothekPluginHandler.java @@ -1,16 +1,14 @@ package org.opentosca.planbuilder.postphase.plugin.vinothek.core.handler; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; -import org.opentosca.planbuilder.plugins.context.PlanContext; /** - * * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - nyuuyn@googlemail.com - * */ public interface VinothekPluginHandler { diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..769f10ce3 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder vinothek postphase plugin + + + + diff --git a/org.opentosca.planbuilder.postphase.plugin.vinothek/META-INF/resources/assignSelfserviceApplicationUrl.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/resources/vinothek-plugin/assignSelfserviceApplicationUrl.xml similarity index 85% rename from org.opentosca.planbuilder.postphase.plugin.vinothek/META-INF/resources/assignSelfserviceApplicationUrl.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/resources/vinothek-plugin/assignSelfserviceApplicationUrl.xml index 6f99f6b81..4699d4d11 100644 --- a/org.opentosca.planbuilder.postphase.plugin.vinothek/META-INF/resources/assignSelfserviceApplicationUrl.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.postphase.plugin.vinothek/src/main/resources/vinothek-plugin/assignSelfserviceApplicationUrl.xml @@ -1,10 +1,9 @@ - - + - \ No newline at end of file +
    diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/pom.xml new file mode 100644 index 000000000..1ae971e6b --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.prephase.plugin.fileupload + + + + commons-io + commons-io + 2.6 + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + compile + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + compile + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + compile + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + compile + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/java/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/BPELPrePhasePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/java/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/BPELPrePhasePlugin.java new file mode 100644 index 000000000..9eb9db7f7 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/java/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/BPELPrePhasePlugin.java @@ -0,0 +1,286 @@ +package org.opentosca.planbuilder.prephase.plugin.fileupload.bpel; + +import java.util.Collection; +import java.util.HashSet; + +import javax.xml.namespace.QName; + +import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPrePhasePlugin; +import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractNodeType; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.opentosca.planbuilder.prephase.plugin.fileupload.bpel.handler.BPELPrePhasePluginHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + *

    + * This class is a PrePhase Plugin for IAs of type {http://docs.oasis-open.org/tosca + * /ns/2011/12/ToscaBaseTypes}ScriptArtifact,{http ://www.example.com/ToscaTypes}WAR and DAs of type + * {http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes}ArchiveArtifact + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public class BPELPrePhasePlugin implements IPlanBuilderPrePhasePlugin, + IPlanBuilderPrePhaseIAPlugin, IPlanBuilderPrePhaseDAPlugin { + + private final static Logger LOG = LoggerFactory.getLogger(BPELPrePhasePlugin.class); + + private static final String PLUGIN_ID = "openTOSCA DA/IA On Linux Plugin v0.1"; + + private static final QName scriptArtifactType = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ScriptArtifact"); + private static final QName jarArtifactType = new QName("http://opentosca.org/artifacttypes", "JAR"); + private static final QName archiveArtifactType = + new QName("http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes", "ArchiveArtifact"); + private static final QName bpelArchiveArtifactType = + new QName("http://docs.oasis-open.org/wsbpel/2.0/process/executable", "BPEL"); + private static final QName warArtifactTypeOld = new QName("http://www.example.com/ToscaTypes", "WAR"); + private static final QName warArtifactType = new QName("http://opentosca.org/artifacttypes", "WAR"); + private static final QName sqlArtifactType = new QName("http://opentosca.org/artifacttypes", "SQLArtifact"); + private static final QName configurationArtifactType = + new QName("http://opentosca.org/artifacttypes", "ConfigurationArtifact"); + private static final QName tdlConfigurationArtifactType = + new QName("http://opentosca.org/artifacttypes", "TDLArtifact"); + + private static final QName ansibleArtifactType = new QName("http://opentosca.org/artifacttypes", "Ansible"); + private static final QName chefArtifactType = new QName("http://opentosca.org/artifacttypes", "Chef"); + private static final QName dockerContainerArtefactTypeOld = + new QName("http://opentosca.org/artefacttypes", "DockerContainerArtefact"); + private static final QName dockerContainerArtefactType = + new QName("http://opentosca.org/artifacttypes", "DockerContainerArtifact"); + private static final QName stateArtifactType = new QName("http://opentosca.org/artifacttypes", "State"); + + private final BPELPrePhasePluginHandler handler = new BPELPrePhasePluginHandler(); + + /** + * {@inheritDoc} + */ + @Override + public boolean handle(final BPELPlanContext context, final AbstractDeploymentArtifact da, + final AbstractNodeTemplate nodeTemplate) { + + if (da.getArtifactType().equals(this.dockerContainerArtefactType) + || da.getArtifactType().equals(this.dockerContainerArtefactTypeOld)) { + return true; + } + + return this.handler.handle(context, da, nodeTemplate); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean handle(final BPELPlanContext context, final AbstractImplementationArtifact ia, + final AbstractNodeTemplate nodeTemplate) { + final QName type = ia.getArtifactType(); + return type.equals(this.warArtifactType) || type.equals(this.warArtifactTypeOld); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean canHandle(final AbstractDeploymentArtifact deploymentArtifact, + final AbstractNodeType infrastructureNodeType) { + for (final QName artType : ModelUtils.getArtifactTypeHierarchy(deploymentArtifact.getArtifactRef())) { + for (final QName nodeType : ModelUtils.getNodeTypeHierarchy(infrastructureNodeType)) { + BPELPrePhasePlugin.LOG.debug("Checking if type: " + artType.toString() + + " and infrastructure nodeType: " + nodeType.toString() + " can be handled"); + + if (isSupportedDeploymentPair(artType, nodeType, true)) { + return true; + } + } + } + + return false; + } + + @Override + public boolean canHandle(final AbstractImplementationArtifact ia, final AbstractNodeType infrastructureNodeType) { + for (final QName artType : ModelUtils.getArtifactTypeHierarchy(ia.getArtifactRef())) { + for (final QName nodeType : ModelUtils.getNodeTypeHierarchy(infrastructureNodeType)) { + BPELPrePhasePlugin.LOG.debug("Checking if type: " + artType.toString() + + " and infrastructure nodeType: " + nodeType.toString() + " can be handled"); + if (isSupportedDeploymentPair(artType, nodeType, false)) { + return true; + } + } + } + + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public String getID() { + return PLUGIN_ID; + } + + /** + * Checks whether this Plugin can handle deploying artifacts of the given artifactType to a given InfrastructureNode + * of the given infrastructureNodeType + * + * @param artifactType a QName denoting an scriptArtifactType + * @param infrastructureNodeType a QName denoting an infrastructureNodeType + * @param isDA indicates whether this check is on an IA or DA with the given artifactType + * @return a Boolean. True if given pair of QName's denotes a pair which this plugin can handle + */ + private boolean isSupportedDeploymentPair(final QName artifactType, final QName infrastructureNodeType, + final boolean isDA) { + + if (infrastructureNodeType.equals(Types.dockerEngineNodeType)) { + return false; + } + + if (!isDA + && (BPELPrePhasePlugin.warArtifactType.equals(artifactType) + || BPELPrePhasePlugin.warArtifactTypeOld.equals(artifactType)) + && infrastructureNodeType + .equals(new QName("http://opentosca.org/nodetypes", "TOSCAManagmentInfrastructure"))) { + // WARs are deployed as environment-centric artifacts -> doesn't + // need to be deployed on a node inside the topology, instead we + // install it inside the management infrastructure + return true; + } + + if (!org.opentosca.container.core.tosca.convention.Utils + .isSupportedInfrastructureNodeType(infrastructureNodeType)) { + return false; + } + + boolean isSupportedArtifactType = false; + + if (BPELPrePhasePlugin.jarArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.archiveArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.scriptArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.ansibleArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.chefArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.bpelArchiveArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.warArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.warArtifactTypeOld.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.sqlArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.configurationArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + if (BPELPrePhasePlugin.dockerContainerArtefactTypeOld.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + // if (BPELPrePhasePlugin.dockerContainerArtefactType.equals(artifactType)) { + // isSupportedArtifactType |= true; + // } + + if (BPELPrePhasePlugin.tdlConfigurationArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + // We always support state artifacts. + if (BPELPrePhasePlugin.stateArtifactType.equals(artifactType)) { + isSupportedArtifactType |= true; + } + + // we can deploy on debian nodes (ubuntu, rasbpian, docker containers based on + // debian,..) + + return isSupportedArtifactType; + } + + @Override + public boolean canHandleCreate(final AbstractNodeTemplate nodeTemplate) { + LOG.debug("Checking if DAs of node template {} can be deployed", nodeTemplate.getId()); + // Find infrastructures of this node and check if we can deploy all of its DA's + for (final AbstractDeploymentArtifact da : nodeTemplate.getDeploymentArtifacts()) { + if (getDeployableInfrastructureNode(nodeTemplate, da) == null) { + LOG.warn("DAs of node template {} can't be deployed", nodeTemplate.getId()); + return false; + } + } + LOG.debug("DAs of node template {} can be deployed", nodeTemplate.getId()); + return true; + } + + public AbstractNodeTemplate getDeployableInfrastructureNode(final AbstractNodeTemplate nodeToDeploy, + final AbstractDeploymentArtifact da) { + final Collection infraNodes = new HashSet<>(); + ModelUtils.getInfrastructureNodes(nodeToDeploy, infraNodes); + for (final AbstractNodeTemplate node : infraNodes) { + for (final QName artType : ModelUtils.getArtifactTypeHierarchy(da.getArtifactRef())) { + for (final QName nodeType : ModelUtils.getNodeTypeHierarchy(node.getType())) { + if (isSupportedDeploymentPair(artType, nodeType, true)) { + return node; + } + } + } + } + return null; + } + + @Override + public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { + boolean handle = true; + for (final AbstractDeploymentArtifact da : nodeTemplate.getDeploymentArtifacts()) { + final AbstractNodeTemplate infraNode = getDeployableInfrastructureNode(nodeTemplate, da); + handle &= this.handler.handle(context, da, infraNode); + } + return handle; + } + + @Override + public boolean canHandleCreate(final AbstractRelationshipTemplate relationshipTemplate) { + return false; + } + + @Override + public boolean handleCreate(final BPELPlanContext context, + final AbstractRelationshipTemplate relationshipTemplate) { + return false; + } + + @Override + public int getPriority() { + return 1; + } +} diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/BPELPrePhasePluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/java/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/BPELPrePhasePluginHandler.java similarity index 84% rename from org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/BPELPrePhasePluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/java/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/BPELPrePhasePluginHandler.java index 47e39015d..3a21e9dc5 100644 --- a/org.opentosca.planbuilder.prephase.plugin.fileupload/src/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/BPELPrePhasePluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/java/org/opentosca/planbuilder/prephase/plugin/fileupload/bpel/handler/BPELPrePhasePluginHandler.java @@ -5,26 +5,24 @@ import javax.xml.parsers.ParserConfigurationException; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** *

    - * This class contains logic to upload files to a linux machine. Those files must be available - * trough a openTOSCA Container + * This class contains logic to upload files to a linux machine. Those files must be available trough a openTOSCA + * Container *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class BPELPrePhasePluginHandler { @@ -40,8 +38,7 @@ public class BPELPrePhasePluginHandler { public BPELPrePhasePluginHandler() { try { this.res = new ResourceHandler(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { BPELPrePhasePluginHandler.LOG.error("Couldn't initialize internal ResourceHandler", e); } } @@ -50,8 +47,8 @@ public BPELPrePhasePluginHandler() { * Adds necessary BPEL logic trough the given context that can upload the given DA unto the given * InfrastructureNode * - * @param context a TemplateContext - * @param da the DeploymentArtifact to deploy + * @param context a TemplateContext + * @param da the DeploymentArtifact to deploy * @param infraNodeTemplate the NodeTemplate which is used as InfrastructureNode * @return true iff adding logic was successful */ @@ -65,8 +62,8 @@ public boolean handle(final BPELPlanContext context, final AbstractDeploymentArt * Adds necessary BPEL logic through the given context that can upload the given IA unto the given * InfrastructureNode * - * @param context a TemplateContext - * @param ia the ImplementationArtifact to deploy + * @param context a TemplateContext + * @param ia the ImplementationArtifact to deploy * @param nodeTemplate the NodeTemplate which is used as InfrastructureNode * @return true iff adding logic was successful */ @@ -75,19 +72,17 @@ public boolean handle(final BPELPlanContext context, final AbstractImplementatio // fetch references final List refs = ia.getArtifactRef().getArtifactReferences(); return this.handle(context, refs, ia.getArtifactType().getLocalPart() + "_" + ia.getOperationName() + "_IA", - nodeTemplate); - + nodeTemplate); } /** - * Adds necessary BPEL logic through the given Context, to deploy the given ArtifactReferences unto - * the specified InfrastructureNode + * Adds necessary BPEL logic through the given Context, to deploy the given ArtifactReferences unto the specified + * InfrastructureNode * - * @param context a TemplateContext - * @param refs the ArtifactReferences to deploy - * @param artifactName the name of the artifact, where the references originate from - * @param infraTemplate a NodeTemplate which is a InfrastructureNode to deploy the - * AbstractReferences on + * @param context a TemplateContext + * @param refs the ArtifactReferences to deploy + * @param artifactName the name of the artifact, where the references originate from + * @param infraTemplate a NodeTemplate which is a InfrastructureNode to deploy the AbstractReferences on * @return true iff adding the logic was successful */ private boolean handle(final BPELPlanContext templateContext, final List refs, @@ -149,7 +144,7 @@ private boolean handle(final BPELPlanContext templateContext, final List + * This class holds all BPEL Fragments and other Artifacts for the ScriptIAOnLinux Plugin + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public class ResourceHandler { + + private final static Logger LOG = LoggerFactory.getLogger(ResourceHandler.class); + + private final DocumentBuilderFactory docFactory; + private final DocumentBuilder docBuilder; + + /** + * Constructor + * + * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails + */ + public ResourceHandler() throws ParserConfigurationException { + this.docFactory = DocumentBuilderFactory.newInstance(); + this.docFactory.setNamespaceAware(true); + this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } + + /** + * Generates a DOM Node containing a BPEL Fragment that assigns an EC2 Linux RunScript request + * + * @param assignName the name for the assign + * @param prefix the prefix of the EC2 Linux Service + * @param requestVarName the name of the RunScript request variable + * @param serverIpName the name of variable containing an address to a linux machine + * @param inputMessageVarName the name of the BuildPlan input message + * @param script the script to execute on the remote machine + * @return a DOM Node containing a complete BPEL Fragment + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when transforming the internal files to a DOM Node + */ + public Node generateAssignRequestMsgAsNode(final String assignName, final String prefix, + final String requestVarName, final String serverIpName, + final String inputMessageVarName, + final String script) throws IOException, SAXException { + final String templateString = this.generateAssignRequestMsgAsString(assignName, prefix, requestVarName, + serverIpName, inputMessageVarName, script); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a String containing a BPEL Fragment that assigns an EC2 Linux RunScript request + * + * @param assignName the name for the assign + * @param prefix the prefix of the EC2 Linux Service + * @param requestVarName the name of the RunScript request variable + * @param serverIpName the name of variable containing an address to a linux machine + * @param inputMessageVarName the name of the BuildPlan input message + * @param script the script to execute on the remote machine + * @return a String containing a complete BPEL Fragment + * @throws IOException is thrown when reading internal files fails + */ + public String generateAssignRequestMsgAsString(final String assignName, final String prefix, + final String requestVarName, final String serverIpName, + final String inputMessageVarName, + final String script) throws IOException { + // + final URL url = getClass().getClassLoader() + .getResource("fileupload-plugin/assRunScriptRequest.xml"); + String template = ResourceAccess.readResourceAsString(url); + template = template.replace("{assignName}", assignName); + template = template.replace("{prefix}", prefix); + template = template.replace("{requestVarName}", requestVarName); + template = template.replace("{serverIpVarName}", serverIpName); + template = template.replace("{inputMessageVarName}", inputMessageVarName); + template = template.replace("{script}", script); + return template; + } + + /** + * Generates an BPEL Invoke Element as String. + * + * @param invokeName the name attribute of the Invoke Element + * @param partnerLinkName the partnerLink attribute of the invoke + * @param operationName the name of the operation used on the given porttype + * @param portType the porttype to call on + * @param inputVarName the input variable name + * @param outputVarName the output variable name + * @return BPEL Invoke Element as Node + */ + public Node generateInvokeAsNode(final String invokeName, final String partnerLinkName, final String operationname, + final QName portType, final String inputVarName, + final String outputVarName) throws SAXException, IOException { + final String templateString = this.generateInvokeAsString(invokeName, partnerLinkName, operationname, portType, + inputVarName, outputVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates an BPEL Invoke Element as String. + * + * @param invokeName the name attribute of the Invoke Element + * @param partnerLinkName the partnerLink attribute of the invoke + * @param operationName the name of the operation used on the given porttype + * @param portType the porttype to call on + * @param inputVarName the input variable name + * @param outputVarName the output variable name + * @return BPEL Invoke Element as String + */ + public String generateInvokeAsString(final String invokeName, final String partnerLinkName, + final String operationName, final QName portType, final String inputVarName, + final String outputVarName) { + // Example: + // + final String invokeAsString = + ""; + return invokeAsString; + } + + /** + * Returns the WSDL file of the EC2Linux IA WebService + * + * @return a File containing the absolute path to the WSDL file + * @throws IOException is thrown when reading internal files fails + */ + public File getLinuxFileUploadWSDLFile() throws IOException { + final URL url = getClass().getClassLoader() + .getResource("fileupload-plugin/EC2LinuxIAService.wsdl"); + // FIXME can't work + final File wsdlFile = ResourceAccess.resolveUrl(url).toFile(); + return wsdlFile; + } + + /** + * Returns the openTOSCA References Schema file + * + * @return a File containing the absolute path to the openTOSCA References Schema file + * @throws IOException is thrown when reading internal files fails + */ + public File getOpenToscaReferencesSchema() throws IOException { + final URL url = getClass().getClassLoader() + .getResource("fileupload-plugin/openTOSCAReferencesSchema.xsd"); + // FIXME can't work + final File xsdFile = ResourceAccess.resolveUrl(url).toFile(); + return xsdFile; + } + + /** + * Returns the WSDL PortType of the EC2Linux IA WebService + * + * @return a QName denoting the PortType of the EC2Linux IA WebService + */ + public QName getPortTypeFromLinuxUploadWSDL() { + return new QName("http://ec2linux.aws.ia.opentosca.org", "EC2LinuxIAService", "ec2linuxport"); + } + + /** + * Returns an XPath Query which contructs a valid String, to GET a File from the openTOSCA API + * + * @param artifactPath a path inside an ArtifactTemplate + * @return a String containing an XPath query + */ + public String getRemoteFilePathString(final String artifactPath) { + ResourceHandler.LOG.debug("Generating XPATH Query for ArtifactPath: " + artifactPath); + final String filePath = + "string(concat($input.payload//*[local-name()='csarEntrypoint']/text(),'/Content/" + artifactPath + "'))"; + return filePath; + } + + /** + *

    + * Returns a DOM Node containing a BPEL Fragment that assigns values to Ec2 Linux FileTransfer Request + *

    + * + * @param assignName the name of the assign + * @param requestVarName the name of the FileTransferRequest variable + * @param prefix the prefix for the EC2 Linux Service + * @param serverIpVarName the name of a variable holding an address to a linux machine + * @param planRequestName the name of BuildPlan input variable + * @param remoteFilePath the path of the file to be transfered + * @param remotePath the path for the file to upload unto the linux machine + * @return a DOM Node containing a complete BPEL Fragment + * @throws IOException is thrown if reading internal files fails + * @throws SAXException is thrown if transforming internal files to DOM fails + */ + public Node getRemoteTransferFileAssignAsNode(final String assignName, final String requestVarName, + final String prefix, final String serverIpVarName, + final String planRequestName, final String remoteFilePath, + final String remotePath) throws SAXException, IOException { + final String templateString = + this.getRemoteTransferFileAssignAsString(assignName, requestVarName, prefix, serverIpVarName, + planRequestName, remoteFilePath, remotePath); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + *

    + * Returns a String containing a BPEL Fragment that assigns values to Ec2 Linux RemoteFileTransfer Request + *

    + * + * @param assignName the name of the assign + * @param requestVarName the name of the FileTransferRequest variable + * @param prefix the prefix for the EC2 Linux Service + * @param serverIpVarName the name of a variable holding an address to a linux machine + * @param planRequestName the name of BuildPlan input variable + * @param remoteFilePath the path of the file to be transfered + * @param remotePath the path for the file to upload unto the linux machine + * @return a String containing a complete BPEL Fragment + * @throws IOException is thrown if reading internal files fails + */ + public String getRemoteTransferFileAssignAsString(final String assignName, final String requestVarName, + final String prefix, final String serverIpVarName, + final String planRequestName, final String remoteFilePath, + final String remotePath) throws IOException { + final URL url = getClass().getClassLoader() + .getResource("fileupload-plugin/assignRemoteTransferFileRequestFragment.xml"); + String template = ResourceAccess.readResourceAsString(url); + template = template.replace("{AssignName}", assignName); + template = template.replace("{RequestVarName}", requestVarName); + template = template.replace("{ServerIpPropVarName}", serverIpVarName); + template = template.replace("{prefix}", prefix); + template = template.replace("{remoteFilePath}", remoteFilePath); + template = template.replace("{remotePath}", remotePath); + template = template.replace("{planRequestName}", planRequestName); + return template; + } + + /** + * Returns a DOM Node containing a BPEL Fragment to fetch Data from the openTOSCA ContainerAPI with the + * BPEL4RESTLight Extension + * + * @param csarFileName the file name of the csar the build plan belongs to + * @param responseName the variable name of the response variable + * @param relativeFilePath a relative path on the containerAPI + * @return a DOM Node containing a complete BPEL Fragment + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node getRESTExtensionGETAsNode(final String csarFileName, final String responseName, + final String relativeFilePath) throws SAXException, IOException { + final String templateString = this.getRESTExtensionGETAsString(csarFileName, responseName, relativeFilePath); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Returns a String containing a BPEL Fragment to fetch Data from the openTOSCA ContainerAPI with the BPEL4RESTLight + * Extension + * + * @param csarFileName the file name of the csar the build plan belongs to + * @param responseName the variable name of the response variable + * @param relativeFilePath a relative path on the containerAPI + * @return a String containing a complete BPEL Fragment + * @throws IOException is thrown when reading internal files fails + */ + public String getRESTExtensionGETAsString(final String csarFileName, final String responseName, + final String relativeFilePath) throws IOException { + final URL url = getClass().getClassLoader() + .getResource("fileupload-plugin/restExtensionGetFragment.xml"); + String template = ResourceAccess.readResourceAsString(url); + template = template.replace("{CSAR_filename}", csarFileName); + template = template.replace("{response_var_name}", responseName); + template = template.replace("{relative_path_to_file}", relativeFilePath); + return template; + } + + /** + * Generates a DOM Node containing a BPEL Fragment that assigns values to an EC2 Linux TransferFile request + * + * @param assignName the name for the assign + * @param requestVarName the name of the TranferFile request variable + * @param prefix the prefix of the EC2 Linux Service + * @param serverIpVarName the name of a variable containing an address to a linux machine + * @param planRequestName the name of the BuildPlan input message + * @param localPathVarName a local path of a file on the machine the BuildPlan will be executed + * @param remotePath the remote path where the file must be uploaded to, on the remote machine + * @return a DOM Node containing a complete BPEL Fragment + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when transforming internal data to DOM fails + */ + public Node getTransferFileAssignAsNode(final String assignName, final String requestVarName, final String prefix, + final String serverIpVarName, final String planRequestName, + final String localPathVarName, + final String remotePath) throws IOException, SAXException { + final String templateString = + this.getTransferFileAssignAsString(assignName, requestVarName, prefix, serverIpVarName, planRequestName, + localPathVarName, remotePath); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a String containing a BPEL Fragment that assigns values to an EC2 Linux TransferFile request + * + * @param assignName the name for the assign + * @param requestVarName the name of the TranferFile request variable + * @param prefix the prefix of the EC2 Linux Service + * @param serverIpVarName the name of a variable containing an address to a linux machine + * @param planRequestName the name of the BuildPlan input message + * @param localPathVarName a local path of a file on the machine the BuildPlan will be executed + * @param remotePath the remote path where the file must be uploaded to, on the remote machine + * @return a String containing a complete BPEL Fragment + * @throws IOException is thrown when reading internal files fails + */ + public String getTransferFileAssignAsString(final String assignName, final String requestVarName, + final String prefix, final String serverIpVarName, + final String planRequestName, final String localPathVarName, + final String remotePath) throws IOException { + // + final URL url = getClass().getClassLoader() + .getResource("fileupload-plugin/assignTransferFileRequestFragment.xml"); + String template = ResourceAccess.readResourceAsString(url); + template = template.replace("{AssignName}", assignName); + template = template.replace("{RequestVarName}", requestVarName); + template = template.replace("{ServerIpPropVarName}", serverIpVarName); + template = template.replace("{prefix}", prefix); + template = template.replace("{localFilePathVarName}", localPathVarName); + template = template.replace("{remotePath}", remotePath); + template = template.replace("{planRequestName}", planRequestName); + return template; + } + + /** + * Generates a DOM Node containing a BPEL Fragment that invokes an EC2 Linux Service with the transferFile + * operation + * + * @param invokeName the name of the invoke + * @param partnerLinkName the name of the partnerLink + * @param portTypeprefix the prefix of the portType + * @param inputVarName the name of the input variable + * @param outputVarName the name of the output variable + * @param operationName the name of the operation + * @return a DOM Node containing a complete BPEL Fragment + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when transforming internal data to DOM fails + */ + public Node getTransferFileInvokeAsNode(final String invokeName, final String partnerLinkName, + final String portTypeprefix, final String inputVarName, + final String outputVarName, + final String operationName) throws SAXException, IOException { + final String templateString = this.getTransferFileInvokeAsString(invokeName, partnerLinkName, portTypeprefix, + inputVarName, outputVarName, operationName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a String containing a BPEL Fragment that invokes an EC2 Linux Service with the transferFile operation + * + * @param invokeName the name of the invoke + * @param partnerLinkName the name of the partnerLink + * @param portTypeprefix the prefix of the portType + * @param inputVarName the name of the input variable + * @param outputVarName the name of the output variable + * @param operationName the name of the operation + * @return a String containing a complete BPEL Fragment + * @throws IOException is thrown when reading internal files fails + */ + public String getTransferFileInvokeAsString(final String invokeName, final String partnerLinkName, + final String portTypeprefix, final String inputVarName, + final String outputVarName, + final String operationName) throws IOException { + // + final URL url = getClass().getClassLoader() + .getResource("fileupload-plugin/invokeTransferFile.xml"); + String template = ResourceAccess.readResourceAsString(url); + template = template.replace("{InvokeName}", invokeName); + template = template.replace("{partnerlinkName}", partnerLinkName); + template = template.replace("{portTypePrefix}", portTypeprefix); + template = template.replace("{inputVarName}", inputVarName); + template = template.replace("{outputVarName}", outputVarName); + template = template.replace("{operation}", operationName); + return template; + } +} diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/EC2LinuxIAService.wsdl b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/EC2LinuxIAService.wsdl similarity index 100% rename from org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/EC2LinuxIAService.wsdl rename to org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/EC2LinuxIAService.wsdl diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/assRunScriptRequest.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/assRunScriptRequest.xml similarity index 100% rename from org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/assRunScriptRequest.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/assRunScriptRequest.xml diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/assignRemoteTransferFileRequestFragment.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/assignRemoteTransferFileRequestFragment.xml similarity index 100% rename from org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/assignRemoteTransferFileRequestFragment.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/assignRemoteTransferFileRequestFragment.xml diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/assignTransferFileRequestFragment.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/assignTransferFileRequestFragment.xml similarity index 100% rename from org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/assignTransferFileRequestFragment.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/assignTransferFileRequestFragment.xml diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/invokeTransferFile.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/invokeTransferFile.xml similarity index 100% rename from org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/invokeTransferFile.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/invokeTransferFile.xml diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/openTOSCAReferencesSchema.xsd b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/openTOSCAReferencesSchema.xsd similarity index 100% rename from org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/openTOSCAReferencesSchema.xsd rename to org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/openTOSCAReferencesSchema.xsd diff --git a/org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/restExtensionGetFragment.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/restExtensionGetFragment.xml similarity index 100% rename from org.opentosca.planbuilder.prephase.plugin.fileupload/META-INF/resources/restExtensionGetFragment.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/fileupload-plugin/restExtensionGetFragment.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..cd536c0c7 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.prephase.plugin.fileupload/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder monitoring postphase plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/pom.xml new file mode 100644 index 000000000..4bd28b8cf --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.provphase.plugin.ansibleoperation + + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + compile + + + + diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/BPELAnsibleOperationPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/BPELAnsibleOperationPlugin.java similarity index 93% rename from org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/BPELAnsibleOperationPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/BPELAnsibleOperationPlugin.java index 998ed03b3..5e749026b 100644 --- a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/BPELAnsibleOperationPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/BPELAnsibleOperationPlugin.java @@ -3,11 +3,10 @@ import java.util.Map; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.plugins.context.Variable; import org.opentosca.planbuilder.provphase.plugin.ansibleoperation.bpel.handler.BPELAnsibleOperationPluginHandler; import org.opentosca.planbuilder.provphase.plugin.ansibleoperation.core.AnsibleOperationPlugin; import org.w3c.dom.Element; @@ -21,7 +20,6 @@ * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * */ public class BPELAnsibleOperationPlugin extends AnsibleOperationPlugin { @@ -73,6 +71,4 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope public int getPriority() { return 0; } - - } diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/handler/BPELAnsibleOperationPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/handler/BPELAnsibleOperationPluginHandler.java similarity index 85% rename from org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/handler/BPELAnsibleOperationPluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/handler/BPELAnsibleOperationPluginHandler.java index 65700706d..af5790af0 100644 --- a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/handler/BPELAnsibleOperationPluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/bpel/handler/BPELAnsibleOperationPluginHandler.java @@ -1,6 +1,5 @@ package org.opentosca.planbuilder.provphase.plugin.ansibleoperation.bpel.handler; -import java.io.File; import java.io.IOException; import java.io.StringReader; import java.net.URL; @@ -12,25 +11,22 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; -import org.eclipse.core.runtime.FileLocator; +import org.opentosca.container.core.common.file.ResourceAccess; import org.opentosca.container.core.tosca.convention.Interfaces; import org.opentosca.container.core.tosca.convention.Properties; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference; import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; import org.opentosca.planbuilder.provphase.plugin.ansibleoperation.core.handler.AnsibleOperationPluginHandler; import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; -import org.osgi.framework.FrameworkUtil; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Node; @@ -40,16 +36,15 @@ /** *

    - * This class is contains the logic to add BPEL Fragments, which executes Ansible Playbooks on - * remote machine. The class assumes that the playbook that must be called are already uploaded to - * the appropriate path. For example by the ScriptIAOnLinux Plugin + * This class is contains the logic to add BPEL Fragments, which executes Ansible Playbooks on remote machine. The class + * assumes that the playbook that must be called are already uploaded to the appropriate path. For example by the + * ScriptIAOnLinux Plugin *

    * Copyright 2013 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de - * */ public class BPELAnsibleOperationPluginHandler implements AnsibleOperationPluginHandler { @@ -65,8 +60,7 @@ public BPELAnsibleOperationPluginHandler() { this.docFactory = DocumentBuilderFactory.newInstance(); this.docFactory.setNamespaceAware(true); this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { e.printStackTrace(); } } @@ -101,7 +95,6 @@ private Variable appendBPELAssignOperationShScript(final BPELPlanContext templat if (playbookPath == null) { LOG.error("No specified Playbook found in the corresponding ArtifactTemplate!"); - } else { LOG.debug("Found Playbook: {}", playbookPath); @@ -138,12 +131,12 @@ private Variable appendBPELAssignOperationShScript(final PlanContext templateCon /** * Append logic for executing a script on a remote machine with the invoker plugin * - * @param templateContext the context with a bpel templateBuildPlan - * @param templateId the id of the template inside the context + * @param templateContext the context with a bpel templateBuildPlan + * @param templateId the id of the template inside the context * @param runShScriptStringVar the bpel variable containing the script call - * @param sshUserVariable the user name for the remote machine as a bpel variable - * @param sshKeyVariable the pass for the remote machine as a bpel variable - * @param serverIpPropWrapper the ip of the remote machine as a bpel variable + * @param sshUserVariable the user name for the remote machine as a bpel variable + * @param sshKeyVariable the pass for the remote machine as a bpel variable + * @param serverIpPropWrapper the ip of the remote machine as a bpel variable * @return true if appending the bpel logic was successful else false */ private boolean appendExecuteScript(final BPELPlanContext templateContext, final String templateId, @@ -161,7 +154,7 @@ private boolean appendExecuteScript(final BPELPlanContext templateContext, final runScriptRequestInputParams.put("sshUser", sshUserVariable); runScriptRequestInputParams.put("script", runShScriptStringVar); this.invokerPlugin.handle(templateContext, templateId, true, "runScript", "InterfaceUbuntu", runScriptRequestInputParams, - new HashMap(), templateContext.getProvisioningPhaseElement()); + new HashMap(), templateContext.getProvisioningPhaseElement()); break; case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMIP: @@ -171,12 +164,11 @@ private boolean appendExecuteScript(final BPELPlanContext templateContext, final runScriptRequestInputParams.put("VMUserName", sshUserVariable); runScriptRequestInputParams.put("Script", runShScriptStringVar); this.invokerPlugin.handle(templateContext, templateId, true, "runScript", - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, runScriptRequestInputParams, - new HashMap(), templateContext.getProvisioningPhaseElement()); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, runScriptRequestInputParams, + new HashMap(), templateContext.getProvisioningPhaseElement()); break; default: return false; - } return true; } @@ -185,8 +177,8 @@ private boolean appendExecuteScript(final BPELPlanContext templateContext, final * Returns the first occurrence of *.zip file, inside the given ImplementationArtifact * * @param ia an AbstractImplementationArtifact - * @return a String containing a relative file path to a *.zip file, if no *.zip file inside the - * given IA is found null + * @return a String containing a relative file path to a *.zip file, if no *.zip file inside the given IA is found + * null */ private AbstractArtifactReference fetchAnsiblePlaybookRefFromIA(final AbstractImplementationArtifact ia) { final List refs = ia.getArtifactRef().getArtifactReferences(); @@ -201,7 +193,7 @@ private AbstractArtifactReference fetchAnsiblePlaybookRefFromIA(final AbstractIm private AbstractNodeTemplate findInfrastructureNode(final List nodes) { for (final AbstractNodeTemplate nodeTemplate : nodes) { if (org.opentosca.container.core.tosca.convention.Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType() - .getId())) { + .getId())) { return nodeTemplate; } } @@ -211,7 +203,6 @@ private AbstractNodeTemplate findInfrastructureNode(final List - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("assignStringVarWithXpath2Query.xml"); - final File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelFragmentFile); + final URL url = getClass().getClassLoader().getResource("invoker-plugin/assignStringVarWithXpath2Query.xml"); + String template = ResourceAccess.readResourceAsString(url); template = template.replace("{AssignName}", assignName); template = template.replace("{xpath2query}", xpath2Query); template = template.replace("{stringVarName}", stringVarName); return template; } - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/AnsibleOperationPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/AnsibleOperationPlugin.java new file mode 100644 index 000000000..94979e7d2 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/AnsibleOperationPlugin.java @@ -0,0 +1,40 @@ +package org.opentosca.planbuilder.provphase.plugin.ansibleoperation.core; + +import javax.xml.namespace.QName; + +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseParamOperationPlugin; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; + +/** + *

    + * This class implements a ProvPhase Plugin, in particular to enable provisioning with ansible + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de + */ +public abstract class AnsibleOperationPlugin implements IPlanBuilderProvPhaseOperationPlugin, + IPlanBuilderProvPhaseParamOperationPlugin { + + private static final String PLUGIN_ID = "OpenTOSCA ProvPhase AnsibleOperation Plugin v0.1"; + private static final QName ANSIBLE_ARTIFACTTYPE = new QName("http://opentosca.org/artifacttypes", "Ansible"); + + /** + * {@inheritDoc} + */ + @Override + public boolean canHandle(final QName artifactType) { + return AnsibleOperationPlugin.ANSIBLE_ARTIFACTTYPE.equals(artifactType); + } + + /** + * {@inheritDoc} + */ + @Override + public String getID() { + return AnsibleOperationPlugin.PLUGIN_ID; + } +} diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/handler/AnsibleOperationPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/handler/AnsibleOperationPluginHandler.java new file mode 100644 index 000000000..a49cd78d8 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/java/org/opentosca/planbuilder/provphase/plugin/ansibleoperation/core/handler/AnsibleOperationPluginHandler.java @@ -0,0 +1,38 @@ +package org.opentosca.planbuilder.provphase.plugin.ansibleoperation.core.handler; + +import java.util.Map; + +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; +import org.opentosca.planbuilder.model.tosca.AbstractParameter; + +/** + *

    + * This class is contains the logic to add BPEL Fragments, which executes Ansible Playbooks on remote machine. The class + * assumes that the playbook that must be called are already uploaded to the appropriate path. For example by the + * ScriptIAOnLinux Plugin + *

    + * Copyright 2013 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de + * @author Michael Zimmermann - michael.zimmermann@iaas.uni-stuttgart.de + */ +public interface AnsibleOperationPluginHandler { + + /** + * Adds logic to the Plan to call a Ansible Playbook on a remote machine + * + * @param context the TemplatePlanContext where the logical provisioning operation is called + * @param operation the operation to call + * @param ia the ia that implements the operation + * @return true iff adding BPEL Fragment was successful + */ + public boolean handle(final T templateContext, final AbstractOperation operation, + final AbstractImplementationArtifact ia); + + public boolean handle(final T context, final AbstractOperation operation, final AbstractImplementationArtifact ia, + final Map param2propertyMapping); +} diff --git a/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/META-INF/resources/assignStringVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/resources/ansibleoperation-plugin/assignStringVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.provphase.plugin.ansibleoperation/META-INF/resources/assignStringVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/resources/ansibleoperation-plugin/assignStringVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..de45ec213 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.ansibleoperation/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder ansibleoperation provisioning plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/pom.xml new file mode 100644 index 000000000..e1a9c6428 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.provphase.plugin.invoker + + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + commons-io + commons-io + 2.6 + + + + diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/BPELInvokerPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/BPELInvokerPlugin.java similarity index 81% rename from org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/BPELInvokerPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/BPELInvokerPlugin.java index d94cc07ab..23a2abaa7 100644 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/BPELInvokerPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/BPELInvokerPlugin.java @@ -10,20 +10,21 @@ import javax.xml.namespace.QName; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderCompensationOperationPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; +import org.opentosca.planbuilder.core.plugins.artifactbased.IPlanBuilderProvPhaseParamOperationPlugin; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference; import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderCompensationOperationPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseParamOperationPlugin; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.handlers.BPELInvokerPluginHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; import org.w3c.dom.Element; /** @@ -33,23 +34,14 @@ * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de * */ +@Component public class BPELInvokerPlugin implements IPlanBuilderProvPhaseOperationPlugin, - IPlanBuilderProvPhaseParamOperationPlugin, - IPlanBuilderCompensationOperationPlugin { + IPlanBuilderProvPhaseParamOperationPlugin, + IPlanBuilderCompensationOperationPlugin { + private static final Logger LOG = LoggerFactory.getLogger(BPELInvokerPlugin.class); private static final String PLUGIN_ID = "OpenTOSCA ProvPhase Plugin for the ServiceInvoker v0.1"; - @Override - public boolean canHandle(final QName operationArtifactType) { - return true; - } - - @Override - public String getID() { - return PLUGIN_ID; - } - - private final static Logger LOG = LoggerFactory.getLogger(BPELInvokerPlugin.class); private final BPELInvokerPluginHandler handler = new BPELInvokerPluginHandler(); public void addLogActivity(final BPELPlanContext context, final String message, final BPELPlanContext.Phase phase) { @@ -59,14 +51,13 @@ public void addLogActivity(final BPELPlanContext context, final String message, @Override public boolean handle(final BPELPlanContext context, final AbstractOperation operation, final AbstractImplementationArtifact ia) { - try { - return this.handler.handle(context, operation, ia); - } - catch (final Exception e) { - BPELInvokerPlugin.LOG.error("Couldn't append logic to provphase of Template: " - + context.getNodeTemplate() != null ? context.getNodeTemplate().getId() - : context.getRelationshipTemplate().getId(), - e); + try { + return this.handler.handle(context, operation, ia); + } catch (final Exception e) { + LOG.error("Couldn't append logic to provphase of Template: " + + context.getNodeTemplate() != null ? context.getNodeTemplate().getId() + : context.getRelationshipTemplate().getId(), + e); return false; } } @@ -75,7 +66,7 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope public boolean handle(final BPELPlanContext context, final AbstractOperation operation, final AbstractImplementationArtifact ia, final Map param2propertyMapping, - Element elementToAppendTo) { + Element elementToAppendTo) { String templateId = ""; boolean isNodeTemplate = false; if (context.getNodeTemplate() != null) { @@ -93,9 +84,8 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope try { return this.handler.handle(context, templateId, isNodeTemplate, operation.getName(), ia.getInterfaceName(), - inputParams, new HashMap(), elementToAppendTo); - } - catch (final Exception e) { + inputParams, new HashMap(), elementToAppendTo); + } catch (final Exception e) { e.printStackTrace(); return false; } @@ -122,9 +112,8 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope try { return this.handler.handle(context, templateId, isNodeTemplate, operation.getName(), ia.getInterfaceName(), - inputParams, new HashMap(), context.getProvisioningPhaseElement()); - } - catch (final Exception e) { + inputParams, new HashMap(), context.getProvisioningPhaseElement()); + } catch (final Exception e) { e.printStackTrace(); return false; } @@ -148,19 +137,17 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope public boolean handle(final BPELPlanContext context, final String templateId, final boolean isNodeTemplate, final String operationName, final String interfaceName, final Map internalExternalPropsInput, - final Map internalExternalPropsOutput, Element elementToAppendTo) { - try { + final Map internalExternalPropsOutput, Element elementToAppendTo) { + try { return this.handler.handle(context, templateId, isNodeTemplate, operationName, interfaceName, - internalExternalPropsInput, internalExternalPropsOutput, elementToAppendTo); - } - catch (final Exception e) { - BPELInvokerPlugin.LOG.error("Couldn't append logic to provphase of Template: " - + context.getNodeTemplate() != null ? context.getNodeTemplate().getId() - : context.getRelationshipTemplate().getId(), - e); + internalExternalPropsInput, internalExternalPropsOutput, elementToAppendTo); + } catch (final Exception e) { + LOG.error("Couldn't append logic to provphase of Template: " + + context.getNodeTemplate() != null ? context.getNodeTemplate().getId() + : context.getRelationshipTemplate().getId(), + e); return false; } - } /** @@ -181,13 +168,12 @@ public boolean handle(final BPELPlanContext context, final String operationName, final Map internalExternalPropsOutput) { try { return this.handler.handle(context, operationName, interfaceName, callbackAddressVarName, - internalExternalPropsInput, internalExternalPropsOutput, context.getProvisioningPhaseElement()); - } - catch (final Exception e) { - BPELInvokerPlugin.LOG.error("Couldn't append logic to provphase of Template: " - + context.getNodeTemplate() != null ? context.getNodeTemplate().getId() - : context.getRelationshipTemplate().getId(), - e); + internalExternalPropsInput, internalExternalPropsOutput, context.getProvisioningPhaseElement()); + } catch (final Exception e) { + LOG.error("Couldn't append logic to provphase of Template: " + + context.getNodeTemplate() != null ? context.getNodeTemplate().getId() + : context.getRelationshipTemplate().getId(), + e); return false; } } @@ -213,9 +199,8 @@ public boolean handleArtifactReferenceUpload(final AbstractArtifactReference ref final AbstractNodeTemplate infraTemplate, Element elementToAppendTo) { try { return this.handler.handleArtifactReferenceUpload(ref, templateContext, serverIp, sshUser, sshKey, - infraTemplate, elementToAppendTo); - } - catch (final Exception e) { + infraTemplate, elementToAppendTo); + } catch (final Exception e) { LOG.error("Couldn't load internal files", e); return false; } @@ -245,11 +230,10 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope outputParams.put(key.getName(), param2PropertyOutputMapping.get(key)); } - try { + try { return this.handler.handle(context, templateId, isNodeTemplate, operation.getName(), ia.getInterfaceName(), - inputParams, outputParams, context.getProvisioningPhaseElement()); - } - catch (final IOException e) { + inputParams, outputParams, context.getProvisioningPhaseElement()); + } catch (final IOException e) { e.printStackTrace(); return false; } @@ -270,11 +254,10 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope outputParams.put(key.getName(), param2PropertyOutputMapping.get(key)); } - try { + try { return this.handler.handle(context, operation.getName(), ia.getInterfaceName(), null, inputParams, - outputParams, elementToAppendTo); - } - catch (final Exception e) { + outputParams, elementToAppendTo); + } catch (final Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return false; @@ -294,10 +277,7 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope final AbstractImplementationArtifact compensationIa, final Map compensationParam2VariableMapping) { // TODO Auto-generated method stub - - - - + return false; } @@ -338,4 +318,13 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope return false; } + @Override + public boolean canHandle(final QName operationArtifactType) { + return true; + } + + @Override + public String getID() { + return PLUGIN_ID; + } } diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/BPELInvokerPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/BPELInvokerPluginHandler.java similarity index 76% rename from org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/BPELInvokerPluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/BPELInvokerPluginHandler.java index a62f8335f..f3e8da0d0 100644 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/src/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/BPELInvokerPluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/BPELInvokerPluginHandler.java @@ -1,9 +1,9 @@ package org.opentosca.planbuilder.provphase.plugin.invoker.bpel.handlers; -import java.io.File; import java.io.IOException; import java.io.StringReader; import java.net.URL; +import java.nio.file.Path; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -15,25 +15,22 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import org.apache.commons.io.FileUtils; -import org.eclipse.core.runtime.FileLocator; +import org.opentosca.container.core.common.file.ResourceAccess; import org.opentosca.container.core.tosca.convention.Interfaces; import org.opentosca.container.core.tosca.convention.Properties; import org.opentosca.container.core.tosca.convention.Utils; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference; import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; import org.opentosca.planbuilder.model.tosca.AbstractInterface; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.osgi.framework.FrameworkUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -57,12 +54,12 @@ public BPELInvokerPluginHandler() { try { this.resHandler = new ResourceHandler(); this.bpelFrags = new BPELProcessFragments(); - this.docFactory = DocumentBuilderFactory.newInstance(); - this.docFactory.setNamespaceAware(true); + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); + docFactory.setNamespaceAware(true); this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } - catch (final ParserConfigurationException e) { - BPELInvokerPluginHandler.LOG.error("Couldn't initialize ResourceHandler", e); + } catch (final ParserConfigurationException e) { + LOG.error("Couldn't initialize ResourceHandler", e); + throw new RuntimeException(e); } } @@ -81,12 +78,10 @@ public void appendLOGMessageActivity(final BPELPlanContext context, final String final String planInstanceURLVar = findPlanInstanceURLVar(context); try { - - Node logPOSTNode = new BPELProcessFragments().createBPEL4RESTLightPlanInstanceLOGsPOSTAsNode(planInstanceURLVar, - logMessageTempStringVarName, - logMessageReqVarName); + logMessageTempStringVarName, + logMessageReqVarName); logPOSTNode = context.importNode(logPOSTNode); switch (phase) { @@ -99,20 +94,14 @@ public void appendLOGMessageActivity(final BPELPlanContext context, final String case POST: context.getPostPhaseElement().appendChild(logPOSTNode); break; - } - - - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -132,14 +121,13 @@ private String createLogRequestMsgVar(final BPELPlanContext context) { final String logMsgReqVarName = "logMessage" + context.getIdForNames(); try { - final File opentoscaApiSchemaFile = this.bpelFrags.getOpenTOSCAAPISchemaFile(); + final Path opentoscaApiSchemaFile = this.bpelFrags.getOpenTOSCAAPISchemaFile(); QName logMsgRequestQName = this.bpelFrags.getOpenToscaApiLogMsgReqElementQName(); context.registerType(logMsgRequestQName, opentoscaApiSchemaFile); logMsgRequestQName = context.importQName(logMsgRequestQName); context.addGlobalVariable(logMsgReqVarName, BPELPlan.VariableType.ELEMENT, logMsgRequestQName); - } - catch (final IOException e3) { + } catch (final IOException e3) { // TODO Auto-generated catch block e3.printStackTrace(); } @@ -184,7 +172,6 @@ private String findInterfaceForOperation(final BPELPlanContext context, final Ab } } return null; - } private Variable findVar(final BPELPlanContext context, final String propName) { @@ -243,19 +230,17 @@ public boolean handle(final BPELPlanContext context, final AbstractOperation ope internalExternalPropsOutput.put(para.getName(), propWrapper); } - return this.handle(context, templateId, isNodeTemplate, operationName, interfaceName, - internalExternalPropsInput, internalExternalPropsOutput, - context.getProvisioningPhaseElement()); + internalExternalPropsInput, internalExternalPropsOutput, context.getProvisioningPhaseElement()); } public boolean handle(final BPELPlanContext context, final String templateId, final boolean isNodeTemplate, final String operationName, final String interfaceName, final Map internalExternalPropsInput, final Map internalExternalPropsOutput, - Element elementToAppendTo) throws IOException { - final File xsdFile = this.resHandler.getServiceInvokerXSDFile(context.getIdForNames()); - final File wsdlFile = this.resHandler.getServiceInvokerWSDLFile(xsdFile, context.getIdForNames()); + Element elementToAppendTo) throws IOException { + final Path xsdFile = this.resHandler.getServiceInvokerXSDFile(context.getIdForNames()); + final Path wsdlFile = this.resHandler.getServiceInvokerWSDLFile(xsdFile, context.getIdForNames()); // register wsdls and xsd final QName invokerPortType = context.registerPortType(this.resHandler.getServiceInvokerPortType(), wsdlFile); final QName invokerCallbackPortType = @@ -273,7 +258,7 @@ public boolean handle(final BPELPlanContext context, final String templateId, fi // generate partnerlink from the two porttypes final String partnerLinkTypeName = invokerPortType.getLocalPart() + "PLT" + context.getIdForNames(); context.addPartnerLinkType(partnerLinkTypeName, "Requester", invokerCallbackPortType, "Requestee", - invokerPortType); + invokerPortType); final String partnerLinkName = invokerPortType.getLocalPart() + "PL" + context.getIdForNames(); context.addPartnerLinkToTemplateScope(partnerLinkName, partnerLinkTypeName, "Requester", "Requestee", true); @@ -329,31 +314,28 @@ public boolean handle(final BPELPlanContext context, final String templateId, fi return false; } - // add request message assign to prov phase scope try { Node assignNode = null; // if (context.getPlanType().equals(PlanType.TERMINATE)) { // TODO FIXME, right now the termination plans are able to call operations of node Instances for - // that the instanceID can be null at runtime e.g. when removing a DockerContainer the operation - // removeContainer of the DockerEngine is called for that the nodeInstanceId is not fetched at the - // time - // of removal + // that the instanceID can be null at runtime e.g. when removing a DockerContainer the operation + // removeContainer of the DockerEngine is called for that the nodeInstanceId is not fetched at the + // time of removal // TIP this issue theoretically happens only with the "container deployment pattern" were a hosting // node has the operations needed to manage a component => different termination handling for such // components is needed assignNode = this.resHandler.generateInvokerRequestMessageInitAssignTemplateAsNode(context.getCSARFileName(), - context.getServiceTemplateId(), - serviceInstanceIdVarName, null, - operationName, - String.valueOf(System.currentTimeMillis()), - requestVariableName, - InputMessagePartName, - interfaceName, isNodeTemplate, - templateId, - internalExternalPropsInput); - + context.getServiceTemplateId(), + serviceInstanceIdVarName, null, + operationName, + String.valueOf(System.currentTimeMillis()), + requestVariableName, + InputMessagePartName, + interfaceName, isNodeTemplate, + templateId, + internalExternalPropsInput); assignNode = context.importNode(assignNode); @@ -366,25 +348,20 @@ public boolean handle(final BPELPlanContext context, final String templateId, fi addressingCopyNode = context.importNode(addressingCopyNode); assignNode.appendChild(addressingCopyNode); - Node replyToCopy = this.resHandler.generateReplyToCopyAsNode(partnerLinkName, requestVariableName, - InputMessagePartName, "ReplyTo"); + InputMessagePartName, "ReplyTo"); replyToCopy = context.importNode(replyToCopy); assignNode.appendChild(replyToCopy); - Node messageIdInit = this.resHandler.generateMessageIdInitAsNode(requestVariableName, InputMessagePartName, templateId + ":" + interfaceName + ":" + operationName + ":"); messageIdInit = context.importNode(messageIdInit); assignNode.appendChild(messageIdInit); - elementToAppendTo.appendChild(assignNode); - - } - catch (final SAXException e) { - BPELInvokerPluginHandler.LOG.error("Couldn't generate DOM node for the request message assign element", e); + } catch (final SAXException e) { + LOG.error("Couldn't generate DOM node for the request message assign element", e); return false; } @@ -394,17 +371,17 @@ public boolean handle(final BPELPlanContext context, final String templateId, fi + context.getNodeTemplate().getId(), PlanContext.Phase.PROV); } else { appendLOGMessageActivity(context, - "Executing " + (operationName != null ? "operation " + operationName + " of " : "") - + "RelationshipTemplate " + context.getRelationshipTemplate().getId() + "", - PlanContext.Phase.PROV); + "Executing " + (operationName != null ? "operation " + operationName + " of " : "") + + "RelationshipTemplate " + context.getRelationshipTemplate().getId() + "", + PlanContext.Phase.PROV); } // invoke service invoker // add invoke try { Node invokeNode = this.resHandler.generateInvokeAsNode("invoke_" + requestVariableName, partnerLinkName, - "invokeOperationAsync", invokerPortType, requestVariableName); - BPELInvokerPluginHandler.LOG.debug("Trying to ImportNode: " + invokeNode.toString()); + "invokeOperationAsync", invokerPortType, requestVariableName); + LOG.debug("Trying to ImportNode: " + invokeNode.toString()); invokeNode = context.importNode(invokeNode); Node correlationSetsNode = this.resHandler.generateCorrelationSetsAsNode(correlationSetName, true); @@ -412,14 +389,11 @@ public boolean handle(final BPELPlanContext context, final String templateId, fi invokeNode.appendChild(correlationSetsNode); elementToAppendTo.appendChild(invokeNode); - - } - catch (final SAXException e) { - BPELInvokerPluginHandler.LOG.error("Error reading/writing XML File", e); + } catch (final SAXException e) { + LOG.error("Error reading/writing XML File", e); return false; - } - catch (final IOException e) { - BPELInvokerPluginHandler.LOG.error("Error reading/writing File", e); + } catch (final IOException e) { + LOG.error("Error reading/writing File", e); return false; } @@ -427,7 +401,7 @@ public boolean handle(final BPELPlanContext context, final String templateId, fi try { Node receiveNode = this.resHandler.generateReceiveAsNode("receive_" + responseVariableName, partnerLinkName, "callback", - invokerCallbackPortType, responseVariableName); + invokerCallbackPortType, responseVariableName); receiveNode = context.importNode(receiveNode); Node correlationSetsNode = this.resHandler.generateCorrelationSetsAsNode(correlationSetName, false); @@ -435,75 +409,63 @@ public boolean handle(final BPELPlanContext context, final String templateId, fi receiveNode.appendChild(correlationSetsNode); elementToAppendTo.appendChild(receiveNode); - } - catch (final SAXException e1) { - BPELInvokerPluginHandler.LOG.error("Error reading/writing XML File", e1); + } catch (final SAXException e1) { + LOG.error("Error reading/writing XML File", e1); return false; - } - catch (final IOException e1) { - BPELInvokerPluginHandler.LOG.error("Error reading/writing File", e1); + } catch (final IOException e1) { + LOG.error("Error reading/writing File", e1); return false; } - Node responseAssignNode = null; - - // process response message // add assign for response try { responseAssignNode = this.resHandler.generateResponseAssignAsNode(responseVariableName, OutputMessagePartName, - internalExternalPropsOutput, - "assign_" + responseVariableName, OutputMessageId, - context.getPlanResponseMessageName(), "payload"); + internalExternalPropsOutput, + "assign_" + responseVariableName, OutputMessageId, + context.getPlanResponseMessageName(), "payload"); responseAssignNode = context.importNode(responseAssignNode); elementToAppendTo.appendChild(responseAssignNode); - - - } - catch (final SAXException e) { - BPELInvokerPluginHandler.LOG.error("Error reading/writing XML File", e); + } catch (final SAXException e) { + LOG.error("Error reading/writing XML File", e); return false; - } - catch (final IOException e) { - BPELInvokerPluginHandler.LOG.error("Error reading/writing File", e); + } catch (final IOException e) { + LOG.error("Error reading/writing File", e); return false; } - try { Node checkForFault = this.resHandler.generateBPELIfTrueThrowFaultAsNode("boolean($" + responseVariableName - + "//*[local-name()=\"Param\" and namespace-uri()=\"http://siserver.org/schema\"]/*[local-name()=\"key\" and text()=\"Fault\"])", - new QName( - "http://opentosca.org/plans/invocationfault", - templateId + "_" + interfaceName + "_" - + operationName, - "fault" + String.valueOf(System.currentTimeMillis())), responseVariableName); + + "//*[local-name()=\"Param\" and namespace-uri()=\"http://siserver.org/schema\"]/*[local-name()=\"key\" and text()=\"Fault\"])", + new QName( + "http://opentosca.org/plans/invocationfault", + templateId + "_" + interfaceName + "_" + + operationName, + "fault" + String.valueOf(System.currentTimeMillis())), responseVariableName); checkForFault = context.importNode(checkForFault); elementToAppendTo.insertBefore(checkForFault, responseAssignNode); - + //elementToAppendTo.appendChild(checkForFault); - } - catch (SAXException e1) { + } catch (SAXException e1) { // TODO Auto-generated catch block e1.printStackTrace(); - } - + } + return true; } public boolean handle(final BPELPlanContext context, final String operationName, final String interfaceName, final String callbackAddressVarName, final Map internalExternalPropsInput, final Map internalExternalPropsOutput, - Element elementToAppendTo) throws Exception { + final Element elementToAppendTo) throws Exception { - // fetch "meta"-data for invoker message (e.g. csarid, nodetemplate - // id..) + // fetch "meta"-data for invoker message (e.g. csarid, nodetemplate id..) boolean isNodeTemplate = true; String templateId = ""; if (context.getNodeTemplate() != null) { @@ -513,7 +475,7 @@ public boolean handle(final BPELPlanContext context, final String operationName, isNodeTemplate = false; } return this.handle(context, templateId, isNodeTemplate, operationName, interfaceName, - internalExternalPropsInput, internalExternalPropsOutput, elementToAppendTo); + internalExternalPropsInput, internalExternalPropsOutput, elementToAppendTo); } private List getRunScriptParams(final AbstractNodeTemplate nodeTemplate) { @@ -552,8 +514,8 @@ public boolean handleArtifactReferenceUpload(final AbstractArtifactReference ref final BPELPlanContext templateContext, final PropertyVariable serverIp, final PropertyVariable sshUser, final PropertyVariable sshKey, final AbstractNodeTemplate infraTemplate, - Element elementToAppendTo) throws Exception { - BPELInvokerPluginHandler.LOG.debug("Handling DA " + ref.getReference()); + final Element elementToAppendTo) throws Exception { + LOG.debug("Handling DA " + ref.getReference()); if (Objects.isNull(serverIp)) { LOG.error("Unable to upload artifact with server IP equal to null."); @@ -584,23 +546,19 @@ public boolean handleArtifactReferenceUpload(final AbstractArtifactReference ref try { Node assignNode = loadAssignXpathQueryToStringVarFragmentAsNode("assign" + templateContext.getIdForNames(), - containerAPIAbsoluteURIXPathQuery, - containerAPIAbsoluteURIVar.getVariableName()); + containerAPIAbsoluteURIXPathQuery, + containerAPIAbsoluteURIVar.getVariableName()); assignNode = templateContext.importNode(assignNode); elementToAppendTo.appendChild(assignNode); - - } - catch (final IOException e) { - BPELInvokerPluginHandler.LOG.error("Couldn't read internal file", e); + } catch (final IOException e) { + LOG.error("Couldn't read internal file", e); return false; - } - catch (final SAXException e) { - BPELInvokerPluginHandler.LOG.error("Couldn't parse internal xml file"); + } catch (final SAXException e) { + LOG.error("Couldn't parse internal xml file"); return false; } - // create the folder the file must be uploaded into and upload the file afterwards final String mkdirScriptVarName = "mkdirScript" + templateContext.getIdForNames(); final Variable mkdirScriptVar = @@ -622,16 +580,16 @@ public boolean handleArtifactReferenceUpload(final AbstractArtifactReference ref runScriptRequestInputParams.put(serverIp.getPropertyName(), serverIp); } this.handle(templateContext, infraTemplate.getId(), true, "runScript", "ContainerManagementInterface", - runScriptRequestInputParams, new HashMap(), elementToAppendTo); + runScriptRequestInputParams, new HashMap(), elementToAppendTo); // transfer the file if (transferFileInputParams.contains(serverIp.getPropertyName())) { transferFileRequestInputParams.put(serverIp.getPropertyName(), serverIp); } this.handle(templateContext, infraTemplate.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE, - "ContainerManagementInterface", transferFileRequestInputParams, - new HashMap(), elementToAppendTo); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE, + "ContainerManagementInterface", transferFileRequestInputParams, + new HashMap(), elementToAppendTo); break; case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMIP: case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_RASPBIANIP: @@ -646,8 +604,8 @@ public boolean handleArtifactReferenceUpload(final AbstractArtifactReference ref runScriptRequestInputParams.put("VMPrivateKey", sshKey); } this.handle(templateContext, infraTemplate.getId(), true, "runScript", - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, runScriptRequestInputParams, - new HashMap(), elementToAppendTo); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, runScriptRequestInputParams, + new HashMap(), elementToAppendTo); // transfer the file if (transferFileInputParams.contains(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMIP)) { @@ -660,9 +618,9 @@ public boolean handleArtifactReferenceUpload(final AbstractArtifactReference ref transferFileRequestInputParams.put("VMPrivateKey", sshKey); } this.handle(templateContext, infraTemplate.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, transferFileRequestInputParams, - new HashMap(), elementToAppendTo); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_TRANSFERFILE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, transferFileRequestInputParams, + new HashMap(), elementToAppendTo); break; default: return false; @@ -672,19 +630,18 @@ public boolean handleArtifactReferenceUpload(final AbstractArtifactReference ref } /** - * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String - * variable. + * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String variable. * - * @param assignName the name of the BPEL assign + * @param assignName the name of the BPEL assign * @param csarEntryXpathQuery the csarEntryPoint XPath query - * @param stringVarName the variable to load the queries results into + * @param stringVarName the variable to load the queries results into * @return a DOM Node representing a BPEL assign element - * @throws IOException is thrown when loading internal bpel fragments fails + * @throws IOException is thrown when loading internal bpel fragments fails * @throws SAXException is thrown when parsing internal format into DOM fails */ public Node loadAssignXpathQueryToStringVarFragmentAsNode(final String assignName, final String xpath2Query, final String stringVarName) throws IOException, - SAXException { + SAXException { final String templateString = loadAssignXpathQueryToStringVarFragmentAsString(assignName, xpath2Query, stringVarName); final InputSource is = new InputSource(); @@ -694,11 +651,10 @@ public Node loadAssignXpathQueryToStringVarFragmentAsNode(final String assignNam } /** - * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String - * variable. + * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String variable. * - * @param assignName the name of the BPEL assign - * @param xpath2Query the csarEntryPoint XPath query + * @param assignName the name of the BPEL assign + * @param xpath2Query the csarEntryPoint XPath query * @param stringVarName the variable to load the queries results into * @return a String containing a BPEL Assign element * @throws IOException is thrown when reading the BPEL fragment form the resources fails @@ -706,10 +662,8 @@ public Node loadAssignXpathQueryToStringVarFragmentAsNode(final String assignNam public String loadAssignXpathQueryToStringVarFragmentAsString(final String assignName, final String xpath2Query, final String stringVarName) throws IOException { // - final URL url = FrameworkUtil.getBundle(this.getClass()).getBundleContext().getBundle() - .getResource("assignStringVarWithXpath2Query.xml"); - final File bpelFragmentFile = new File(FileLocator.toFileURL(url).getPath()); - String template = FileUtils.readFileToString(bpelFragmentFile); + final URL url = this.getClass().getClassLoader().getResource("invoker-plugin/assignStringVarWithXpath2Query.xml"); + String template = ResourceAccess.readResourceAsString(url); template = template.replace("{AssignName}", assignName); template = template.replace("{xpath2query}", xpath2Query); template = template.replace("{stringVarName}", stringVarName); diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/ResourceHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/ResourceHandler.java new file mode 100644 index 000000000..64aed292a --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/java/org/opentosca/planbuilder/provphase/plugin/invoker/bpel/handlers/ResourceHandler.java @@ -0,0 +1,818 @@ +/** + * + */ +package org.opentosca.planbuilder.provphase.plugin.invoker.bpel.handlers; + +import java.io.IOException; +import java.io.StringReader; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.Map; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.common.file.ResourceAccess; +import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Copyright 2014 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + * + */ +public class ResourceHandler { + + private final static Logger LOG = LoggerFactory.getLogger(ResourceHandler.class); + + private final DocumentBuilderFactory docFactory; + private final DocumentBuilder docBuilder; + + private final BPELProcessFragments fragments; + + /** + * Constructor + * + * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails + */ + public ResourceHandler() throws ParserConfigurationException { + this.docFactory = DocumentBuilderFactory.newInstance(); + this.docFactory.setNamespaceAware(true); + this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + + this.fragments = new BPELProcessFragments(); + } + + public Path touchNewTempFile(final Path file, final int id) throws IOException { + final String filename = file.getFileName().toString(); + final String[] segments = filename.split("\\.", 2); + // we assume the given filename had a . in it! + assert (segments.length == 2); + final Path tempFile = Files.createTempFile(segments[0] + id, "." + segments[1]); + + return tempFile; + } + + /** + * Generates a BPEL If activity that throws the given fault when the given expr evaluates to true at + * runtime + * + * @param xpath1Expr a XPath 1.0 expression as String + * @param faultQName a QName denoting the fault to be thrown when the if evaluates to true + * @return a Node containing a BPEL If Activity + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node generateBPELIfTrueThrowFaultAsNode(final String xpath1Expr, final QName faultQName, + final String faultVariableName) throws IOException, SAXException { + final String templateString = generateBPELIfTrueThrowFaultAsString(xpath1Expr, faultQName, faultVariableName); + return this.fragments.transformStringToNode(templateString); + } + + /** + * Generates a BPEL If activity that throws the given fault when the given expr evaluates to true at + * runtime + * + * @param xpath1Expr a XPath 1.0 expression as String + * @param faultQName a QName denoting the fault to be thrown when the if evaluates to true + * @return a String containing a BPEL If Activity + * @throws IOException is thrown when reading internal files fails + */ + public String generateBPELIfTrueThrowFaultAsString(final String xpath1Expr, + final QName faultQName, String faultVariableName) throws IOException { + // + String bpelIfString = ResourceAccess.readResourceAsString(getClass().getClassLoader().getResource("invoker-plugin/ifFaultMessageThrowFault.xml")); + + bpelIfString = bpelIfString.replace("$xpath1Expr", xpath1Expr); + + bpelIfString = bpelIfString.replace("$faultPrefix", faultQName.getPrefix()); + bpelIfString = bpelIfString.replace("$faultLocalName", faultQName.getLocalPart()); + bpelIfString = bpelIfString.replace("$faultNamespace", faultQName.getNamespaceURI()); + bpelIfString = bpelIfString.replace("$faultVariable", faultVariableName); + + return bpelIfString; + } + + /** + * Generates a BPEL Copy element to use in BPEL Assigns, which sets the WS-Addressing ReplyTo + * Header for the specified request variable + * + * @param partnerLinkName the name of the BPEL partnerLink that will be used as String + * @param requestVariableName the name of the BPEL Variable used for an asynchronous request as + * String + * @return a String containing a complete BPEL Copy element + * @throws IOException is thrown when reading internal files fails + */ + public String generateAddressingCopy(final String partnerLinkName, + final String requestVariableName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/addressingCopy.xml"); + String addressingFileString = ResourceAccess.readResourceAsString(url); + /* + * "{partnerLinkName}" "{requestVarName}" + */ + addressingFileString = addressingFileString.replace("{requestVarName}", requestVariableName); + addressingFileString = addressingFileString.replace("{partnerLinkName}", partnerLinkName); + + return addressingFileString; + } + + /** + * Generates a BPEL Copy element to use in BPEL Assigns, which sets the WS-Addressing ReplyTo + * Header for the specified request variable + * + * @param partnerLinkName the name of the BPEL partnerLink that will be used as String + * @param requestVariableName the name of the BPEL Variable used for an asynchronous request as + * String + * @return a DOM Node containing a complete BPEL Copy element + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal data to DOM fails + */ + public Node generateAddressingCopyAsNode(final String partnerLinkName, + final String requestVariableName) throws IOException, SAXException { + final String addressingCopyString = generateAddressingCopy(partnerLinkName, requestVariableName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(addressingCopyString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a BPEL Copy which sets a dummy WS-Addressing ReplyTo Header on the given request + * variable + * + * @param requestVariableName the name of a BPEL Variable as String + * @return a String containing a complete BPEL Copy element + * @throws IOException is thrown when reading internal files fails + */ + public String generateAddressingInit(final String requestVariableName) throws IOException { + final URL url = getClass().getClassLoader().getResource("invoker-plugin/addressingInit.xml"); + String addressingFileString = ResourceAccess.readResourceAsString(url); + /* + * "{partnerLinkName}" "{requestVarName}" + */ + addressingFileString = addressingFileString.replace("{requestVarName}", requestVariableName); + return addressingFileString; + } + + /** + * Generates a BPEL Copy which sets a dummy WS-Addressing ReplyTo Header on the given request + * variable + * + * @param requestVariableName the name of a BPEL Variable as String + * @return a DOM Node containing a complete BPEL Copy element + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal data to DOM fails + */ + public Node generateAddressingInitAsNode(final String requestVariableName) throws IOException, SAXException { + final String addressingCopyString = generateAddressingInit(requestVariableName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(addressingCopyString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public Node generateCopyFromExternalParamToInvokerNode(final String requestVarName, final String requestVarPartName, + final String paramName, + final String invokerParamName) throws IOException, + SAXException { + final String addressingCopyString = + generateCopyFromExternalParamToInvokerString(requestVarName, requestVarPartName, paramName, + invokerParamName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(addressingCopyString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + private String generateCopyFromExternalParamToInvokerString(final String requestVarName, + final String requestVarPartName, final String paramName, + final String invokerParamName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/externalParamCopy2.xml"); + String copyTemplateString = ResourceAccess.readResourceAsString(url); + + // {paramName}, {requestVarName}, {requestVarPartName} + copyTemplateString = copyTemplateString.replace("{paramName}", paramName); + copyTemplateString = copyTemplateString.replace("{requestVarName}", requestVarName); + copyTemplateString = copyTemplateString.replace("{requestVarPartName}", requestVarPartName); + copyTemplateString = copyTemplateString.replace("{invokerParamName}", invokerParamName); + + return copyTemplateString; + } + + /** + * Generates a BPEL Correlations element to us with BPEL Invoke and Receive elements + * + * @param correlationSetName the name of the correlationSet to use + * @param initiate whether the correlationSet must be initialized or not + * @return a DOM Node containing a complete BPEL Correlations element + * @throws SAXException is thrown when parsing internal data fails + * @throws IOException is thrown when reading internal data fails + */ + public Node generateCorrelationSetsAsNode(final String correlationSetName, + final boolean initiate) throws SAXException, IOException { + final String correlationSetsString = + ""; + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(correlationSetsString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a copy from a partnerLink myRole EPR to a invoker request param such as ReplyTo + * + * @param partnerLinkName the name of the partnerLink to use + * @param invokerRequestVarName the name of the invoker request message + * @param invokerRequestVarPartName the name of the message part of the referenced invoker + * request message variable + * @param invokerParamName the name of the invoker param to assign + * @return a DOM node containing a BPEL copy element + * @throws SAXException is thrown when parsing internal files fail + * @throws IOException is thrown when reading internal files fail + */ + public Node generateEPRMyRoleCopyToInvokerParamAsNode(final String partnerLinkName, + final String invokerRequestVarName, + final String invokerRequestVarPartName, + final String invokerParamName) throws SAXException, + IOException { + final String addressingCopyString = + generateEPRMyRoleCopyToInvokerParamAsString(partnerLinkName, invokerRequestVarName, + invokerRequestVarPartName, invokerParamName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(addressingCopyString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a copy from a partnerLink myRole EPR to a invoker request param such as ReplyTo + * + * @param partnerLinkName the name of the partnerLink to use + * @param invokerRequestVarName the name of the invoker request message + * @param invokerRequestVarPartName the name of the message part of the referenced invoker + * request message variable + * @param invokerParamName the name of the invoker param to assign + * @return a String containing a BPEL copy element + * @throws IOException is thrown when reading internal files fail + */ + public String generateEPRMyRoleCopyToInvokerParamAsString(final String partnerLinkName, + final String invokerRequestVarName, + final String invokerRequestVarPartName, + final String invokerParamName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/EPRCopyToInvokerReplyTo.xml"); + String eprCopyFileString = ResourceAccess.readResourceAsString(url); + + // + eprCopyFileString = eprCopyFileString.replace("{partnerLinkName}", partnerLinkName); + eprCopyFileString = eprCopyFileString.replace("{requestVarName} ", invokerRequestVarName); + eprCopyFileString = eprCopyFileString.replace("{requestVarPartName}", invokerRequestVarPartName); + eprCopyFileString = eprCopyFileString.replace("{invokerParamName}", invokerParamName); + + return eprCopyFileString; + } + + /** + * Generates a DOM Node containing a BPEL invoke element + * + * @param invokeName the name of the invoke as String + * @param partnerLinkName the name of the partnerLink used as String + * @param operationName the name of the WSDL operation as String + * @param portType a QName denoting the WSDL portType + * @param inputVarName the name of the BPEL Variable to use as Input, given as String + * @return a DOM Node containing a complete BPEL Invoke element + */ + public Node generateInvokeAsNode(final String invokeName, final String partnerLinkName, final String operationName, + final QName portType, final String inputVarName) throws SAXException, IOException { + final String invokeString = + generateInvokeAsString(invokeName, partnerLinkName, operationName, portType, inputVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(invokeString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a String containing a BPEL invoke element + * + * @param invokeName the name of the invoke as String + * @param partnerLinkName the name of the partnerLink used as String + * @param operationName the name of the WSDL operation as String + * @param portType a QName denoting the WSDL portType + * @param inputVarName the name of the BPEL Variable to use as Input, given as String + * @return a String containing a complete BPEL Invoke element + */ + public String generateInvokeAsString(final String invokeName, final String partnerLinkName, + final String operationName, final QName portType, final String inputVarName) { + return ""; + } + + public String generateInvokerRequestMessageInitAssignTemplate(final String csarName, final QName serviceTemplateId, + final String serviceInstanceIdVarName, + final String nodeInstanceIdVarName, + final String operationName, final String messageId, + final String requestVarName, + final String requestVarPartName, final String iface, + final boolean isNodeTemplate, final String templateId, + final Map internalExternalProps) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/assignInvokerAsyncMessage.xml"); + String assignTemplateString = ResourceAccess.readResourceAsString(url); + + /* + * String values must replace: {csarName}, {serviceTemplateNS}, {serviceTemplateLocalName}, + * {operationName}, {messageID}, {requestVarName}, {requestVarPartName} + * + * These must be xml snippets again -> more complicated: {copies} {interface}, {templateID}, + * {paramsMap}, + */ + + // first the easy ones + assignTemplateString = assignTemplateString.replace("{csarName}", csarName); + assignTemplateString = assignTemplateString.replace("{serviceInstanceID}", ""); + assignTemplateString = assignTemplateString.replace("{planCorrelation}", ""); + + if (nodeInstanceIdVarName != null) { + assignTemplateString = assignTemplateString.replace("{nodeInstanceID}", ""); + } else { + assignTemplateString = + assignTemplateString.replace("{nodeInstanceID}", ""); + } + assignTemplateString = assignTemplateString.replace("{serviceTemplateNS}", serviceTemplateId.getNamespaceURI()); + assignTemplateString = + assignTemplateString.replace("{serviceTemplateLocalName}", serviceTemplateId.getLocalPart()); + assignTemplateString = assignTemplateString.replace("{operationName}", operationName); + assignTemplateString = assignTemplateString.replace("{messageID}", messageId); + assignTemplateString = assignTemplateString.replace("{requestVarName}", requestVarName); + assignTemplateString = assignTemplateString.replace("{requestVarPartName}", requestVarPartName); + + if (iface != null) { + final String ifaceString = "" + iface + ""; + assignTemplateString = assignTemplateString.replace("{interface}", ifaceString); + } else { + assignTemplateString = assignTemplateString.replace("{interface}", ""); + } + + String templateString = ""; + if (isNodeTemplate) { + templateString = "" + templateId + ""; + } else { + templateString = "" + templateId + ""; + } + + assignTemplateString = assignTemplateString.replace("{templateID}", templateString); + + assignTemplateString = + assignTemplateString.replace("{paramsMap}", generateServiceInvokerParamsMap(internalExternalProps)); + + // add copy elements to the assign according to the given map of + // parameters + for (final String propertyName : internalExternalProps.keySet()) { + if (internalExternalProps.get(propertyName) == null) { + // parameter is external, fetch value from plan input message + String copyString = + generateServiceInvokerExternalParamCopyString(requestVarName, requestVarPartName, propertyName); + copyString = copyString.replace("", ""); + assignTemplateString = assignTemplateString.replace("{copies}", copyString + "{copies}"); + } else { + // parameter is internal, fetch value from bpel variable + String copyString = + generateServiceInvokerInternalParamCopyString(internalExternalProps.get(propertyName) + .getVariableName(), + requestVarName, requestVarPartName, propertyName); + copyString = copyString.replace("", ""); + assignTemplateString = assignTemplateString.replace("{copies}", copyString + "{copies}"); + } + } + + // assign correlation id + String correlationIdCopyString = generateCorrelationIdCopy(requestVarName, requestVarPartName); + correlationIdCopyString = correlationIdCopyString.replace("", ""); + assignTemplateString = assignTemplateString.replace("{copies}", correlationIdCopyString + "{copies}"); + + // assign serviceInstanceID + String serviceInstanceCopyString = + generateServiceInstanceIDCopy(serviceInstanceIdVarName, requestVarName, requestVarPartName); + serviceInstanceCopyString = serviceInstanceCopyString.replace("", ""); + assignTemplateString = assignTemplateString.replace("{copies}", serviceInstanceCopyString + "{copies}"); + + if (nodeInstanceIdVarName != null) { + String nodeInstanceCopyString = + generateNodeInstanceIdCopy(nodeInstanceIdVarName, requestVarName, requestVarPartName); + nodeInstanceCopyString = nodeInstanceCopyString.replace("", ""); + assignTemplateString = assignTemplateString.replace("{copies}", nodeInstanceCopyString + "{copies}"); + } + + assignTemplateString = assignTemplateString.replace("{copies}", ""); + + // TODO REPLACE THIS PART + + LOG.debug("Generated Invoker Operation Call:"); + LOG.debug(assignTemplateString); + return assignTemplateString; + } + + public Node generateInvokerRequestMessageInitAssignTemplateAsNode(final String csarName, + final QName serviceTemplateId, + final String serviceInstanceIdVarName, + final String nodeInstanceIdVarName, + final String operationName, + final String messageId, + final String requestVarName, + final String requestVarPartName, + final String iface, final boolean isNodeTemplate, + final String templateId, + final Map internalExternalProps) throws IOException, + SAXException { + final String templateString = + generateInvokerRequestMessageInitAssignTemplate(csarName, serviceTemplateId, serviceInstanceIdVarName, + nodeInstanceIdVarName, operationName, messageId, + requestVarName, requestVarPartName, iface, isNodeTemplate, + templateId, internalExternalProps); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a BPEL Copy which sets the MessageId of an Invoker Message Body to a given prefix + * and the current date + * + * @param requestVariableName the name of the request variable with an invoker message body + * @param requestVariabelPartName the name of the part which has the invoker message body + * @param messageIdPrefix a prefix to be used inside the message id + * @return a String containing a BPEL copy element + * @throws IOException is thrown when reading internal files fails + */ + public String generateMessageIdInit(final String requestVariableName, final String requestVariabelPartName, + final String messageIdPrefix) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/initMessageId.xml"); + String initMessageIdFileString = ResourceAccess.readResourceAsString(url); + + // + initMessageIdFileString = initMessageIdFileString.replace("{requestVarName}", requestVariableName); + initMessageIdFileString = initMessageIdFileString.replace("{requestVarPartName}", requestVariabelPartName); + initMessageIdFileString = initMessageIdFileString.replace("{messageIdPrefix}", messageIdPrefix); + return initMessageIdFileString; + } + + /** + * Generates a BPEL Copy which sets the MessageId of an Invoker Message Body to a given prefix + * and the current date + * + * @param requestVariableName the name of the request variable with an invoker message body + * @param requestVariabelPartName the name of the part which has the invoker message body + * @param messageIdPrefix a prefix to be used inside the message id + * @return a DOM Node containing a BPEL copy element + * @throws IOException is thrown when reading internal files fails + * @throws SAXException is thrown when parsing internal files fails + */ + public Node generateMessageIdInitAsNode(final String requestVariableName, final String requestVariabelPartName, + final String messageIdPrefix) throws IOException, SAXException { + final String addressingCopyString = + generateMessageIdInit(requestVariableName, requestVariabelPartName, messageIdPrefix); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(addressingCopyString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a BPEL Receive Element + * + * @param receiveName a name for the receive as String + * @param partnerLinkName the name of a BPEL partnerLink as String + * @param operationName the name of a WSDL operation as String + * @param portType the reference to a WSDL portType as QName + * @param variableName a name of a BPEL Variable as String + * @return a DOM Node containing a complete BPEL Receive element + * @throws SAXException is thrown when parsing internal data to DOM + * @throws IOException is thrown when reading internal files fails + */ + public Node generateReceiveAsNode(final String receiveName, final String partnerLinkName, + final String operationName, final QName portType, + final String variableName) throws SAXException, IOException { + final String receiveString = + ""; + /* + * + */ + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(receiveString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + public String generateReplyToCopy(final String partnerLinkName, final String requestVarName, + final String requestVarPartName, final String paramName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/copyReplyTo.xml"); + String copyTemplateString = ResourceAccess.readResourceAsString(url); + + // {paramName}, {partnerLinkName}, {requestVarName}, + // {requestVarPartName} + copyTemplateString = copyTemplateString.replace("{paramName}", paramName); + copyTemplateString = copyTemplateString.replace("{partnerLinkName}", partnerLinkName); + copyTemplateString = copyTemplateString.replace("{requestVarName}", requestVarName); + copyTemplateString = copyTemplateString.replace("{requestVarPartName}", requestVarPartName); + + return copyTemplateString; + } + + public Node generateReplyToCopyAsNode(final String partnerLinkName, final String requestVarName, + final String requestVarPartName, + final String paramName) throws IOException, SAXException { + final String addressingCopyString = + generateReplyToCopy(partnerLinkName, requestVarName, requestVarPartName, paramName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(addressingCopyString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates an BPEL Assign Element as String, which reads Response Message Data into internal + * PropertyVariables + * + * @param variableName the Response Message variable name + * @param part the part name of response message + * @param toscaWsdlMappings Mappings from TOSCA Output Parameters to WSDL Response message + * Elements + * @param paramPropertyMappings Mappings from TOSCA Output Parameters to Properties + * @param assignName the name attribute of the assign + * @param MessageDeclId the XML Schema Declaration of the Response Message as QName + * @return BPEL Assign Element as DOM Node + */ + public Node generateResponseAssignAsNode(final String variableName, final String part, + final Map paramPropertyMappings, final String assignName, + final QName MessageDeclId, final String planOutputMsgName, + final String planOutputMsgPartName) throws SAXException, IOException { + final String templateString = + generateResponseAssignAsString(variableName, part, paramPropertyMappings, assignName, MessageDeclId, + planOutputMsgName, planOutputMsgPartName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates an BPEL Assign Element as String, which reads Response Message Data into internal + * PropertyVariables + * + * @param variableName the Response Message variable name + * @param part the part name of response message + * @param toscaWsdlMappings Mappings from TOSCA Output Parameters to WSDL Response message + * Elements + * @param paramPropertyMappings Mappings from TOSCA Output Parameters to Properties + * @param assignName the name attribute of the assign + * @param MessageDeclId the XML Schema Declaration of the Response Message as QName + * @return BPEL Assign Element as String + */ + public String generateResponseAssignAsString(final String variableName, final String part, + final Map paramPropertyMappings, + final String assignName, final QName MessageDeclId, + final String planOutputMsgName, final String planOutputMsgPartName) { + String assignAsString = + ""; + + for (final String toscaParam : paramPropertyMappings.keySet()) { + final Variable propWrapper = paramPropertyMappings.get(toscaParam); + if (propWrapper == null) { + + final String internalCopyString = + ""; + final String internalQueryString = + ""; + final String internalToString = ""; + final String internalQueryStringToOutput = + ""; + assignAsString += internalCopyString; + assignAsString += internalQueryString; + assignAsString += internalToString; + assignAsString += internalQueryStringToOutput; + } else { + // interal parameter, assign response message element value to + // internal property variable + + final String internalCopyString = + ""; + final String internalQueryString = + ""; + final String internalToString = + ""; + assignAsString += internalCopyString; + assignAsString += internalQueryString; + assignAsString += internalToString; + } + } + assignAsString += ""; + LOG.debug("Generated following assign element:"); + LOG.debug(assignAsString); + return assignAsString; + } + + /** + * Generates a BPEL Copy snippet from a single variable to a invoker message body, where the + * value of the variable is added as ServiceInstanceID to the invoker message. + * + * @param bpelVarName the Name of the BPEL variable to use + * @param requestVarName the name of the request variable holding a invoker request + * @param requestVarPartName the name of part inside the invoker request message + * @return a String containing a BPEL copy element + * @throws IOException when the reading of an internal file fails + * @throws SAXException when parsing the internal file fails + */ + public Node generateServiceInstanceCopyAsNode(final String bpelVarName, final String requestVarName, + final String requestVarPartName) throws IOException, SAXException { + final String serviceInstanceCopyString = + generateServiceInstanceIDCopy(bpelVarName, requestVarName, requestVarPartName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(serviceInstanceCopyString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Generates a BPEL Copy snippet from the plan input message 'CorrelationID' property to the + * invoker message + * + * @param requestVarName the name of the request variable holding a invoker request + * @param requestVarPartName the name of part inside the invoker request message + * @return a String containing a BPEL copy element + * @throws IOException when reading internal files fails + */ + private String generateCorrelationIdCopy(final String requestVarName, + final String requestVarPartName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/correlationIdCopy.xml"); + String correlationIdCopyString = ResourceAccess.readResourceAsString(url); + + correlationIdCopyString = correlationIdCopyString.replace("{requestVarName}", requestVarName); + correlationIdCopyString = correlationIdCopyString.replace("{requestVarPartName}", requestVarPartName); + + return correlationIdCopyString; + } + + /** + * Generates a BPEL Copy snippet from a single variable to a invoker message body, where the + * value of the variable is added as ServiceInstanceID to the invoker message. + * + * @param bpelVarName the Name of the BPEL variable to use + * @param requestVarName the name of the request variable holding a invoker request + * @param requestVarPartName the name of part inside the invoker request message + * @return a String containing a BPEL copy element + * @throws IOException when reading internal files fail + */ + public String generateServiceInstanceIDCopy(final String bpelVarName, final String requestVarName, + final String requestVarPartName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/serviceInstanceCopy.xml"); + String serviceInstanceCopyString = ResourceAccess.readResourceAsString(url); + + serviceInstanceCopyString = serviceInstanceCopyString.replace("{bpelVarName}", bpelVarName); + serviceInstanceCopyString = serviceInstanceCopyString.replace("{requestVarName}", requestVarName); + serviceInstanceCopyString = serviceInstanceCopyString.replace("{requestVarPartName}", requestVarPartName); + + return serviceInstanceCopyString; + } + + public String generateNodeInstanceIdCopy(final String bpelVarName, final String requestVarName, + final String requestVarPartName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/nodeInstanceCopy.xml"); + String serviceInstanceCopyString = ResourceAccess.readResourceAsString(url); + + serviceInstanceCopyString = serviceInstanceCopyString.replace("{bpelVarName}", bpelVarName); + serviceInstanceCopyString = serviceInstanceCopyString.replace("{requestVarName}", requestVarName); + serviceInstanceCopyString = serviceInstanceCopyString.replace("{requestVarPartName}", requestVarPartName); + + return serviceInstanceCopyString; + } + + public Node generateNodeInstanceIdCopyAsNode(final String bpelVarName, final String requestVarName, + final String requestVarPartName) throws IOException, SAXException { + final String nodeInstanceCopyString = + generateNodeInstanceIdCopy(bpelVarName, requestVarName, requestVarPartName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(nodeInstanceCopyString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + private String generateServiceInvokerExternalParamCopyString(final String requestVarName, + final String requestVarPartName, + final String paramName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/externalParamCopy.xml"); + String copyTemplateString = ResourceAccess.readResourceAsString(url); + + // {paramName}, {requestVarName}, {requestVarPartName} + copyTemplateString = copyTemplateString.replace("{paramName}", paramName); + copyTemplateString = copyTemplateString.replace("{requestVarName}", requestVarName); + copyTemplateString = copyTemplateString.replace("{requestVarPartName}", requestVarPartName); + + return copyTemplateString; + } + + private String generateServiceInvokerInternalParamCopyString(final String bpelVarName, final String requestVarName, + final String requestVarPartName, + final String paramName) throws IOException { + URL url = getClass().getClassLoader().getResource("invoker-plugin/internalParamCopy.xml"); + String copyTemplateString = ResourceAccess.readResourceAsString(url); + + // {bpelVarName}, {requestVarName}, {requestVarPartName}, {paramName} + copyTemplateString = copyTemplateString.replace("{bpelVarName}", bpelVarName); + copyTemplateString = copyTemplateString.replace("{requestVarName}", requestVarName); + copyTemplateString = copyTemplateString.replace("{requestVarPartName}", requestVarPartName); + copyTemplateString = copyTemplateString.replace("{paramName}", paramName); + return copyTemplateString; + } + + private String generateServiceInvokerParamsMap(final Map internalExternalProps) { + String paramsMapString = ""; + for (final String key : internalExternalProps.keySet()) { + paramsMapString += + "" + key + "value"; + } + paramsMapString += ""; + return paramsMapString; + } + + public String getServiceInvokerAsyncRequestMessagePart() { + return "invokeOperationAsync"; + } + + // FIXME replace public getters for constants with public static finals + public QName getServiceInvokerAsyncRequestMessageType() { + return new QName("http://siserver.org/wsdl", "invokeOperationAsyncMessage"); + } + + public QName getServiceInvokerAsyncRequestXSDType() { + return new QName("http://siserver.org/schema", "invokeOperationAsync"); + } + + public String getServiceInvokerAsyncResponseMessagePart() { + return "invokeResponse"; + } + + public QName getServiceInvokerAsyncResponseMessageType() { + return new QName("http://siserver.org/wsdl", "invokeResponse"); + } + + public QName getServiceInvokerAsyncResponseXSDType() { + return new QName("http://siserver.org/schema", "invokeResponse"); + } + + public QName getServiceInvokerCallbackPortType() { + return new QName("http://siserver.org/wsdl", "CallbackPortType"); + } + + public QName getServiceInvokerPortType() { + return new QName("http://siserver.org/wsdl", "InvokePortType"); + } + + public Path getServiceInvokerWSDLFile(final Path invokerXsdFile, final int id) throws IOException { + final URL url = getClass().getClassLoader().getResource("invoker-plugin/invoker.wsdl"); + + final Path wsdlFile = ResourceAccess.resolveUrl(url); + final Path tempFile = touchNewTempFile(wsdlFile, id); + final String fileName = invokerXsdFile.getFileName().toString(); + + Files.write(tempFile, new String(Files.readAllBytes(wsdlFile)).replaceAll("invoker.xsd", fileName).getBytes()); + + return tempFile; + } + + public Path getServiceInvokerXSDFile(final int id) throws IOException { + final URL url = getClass().getClassLoader().getResource("invoker-plugin/invoker.xsd"); + + final Path xsdFile = ResourceAccess.resolveUrl(url); + final Path tempFile = touchNewTempFile(xsdFile, id); + + Files.copy(xsdFile, Files.newOutputStream(tempFile, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)); + return tempFile; + } +} diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/EPRCopyToInvokerReplyTo.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/EPRCopyToInvokerReplyTo.xml similarity index 100% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/EPRCopyToInvokerReplyTo.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/EPRCopyToInvokerReplyTo.xml diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/addressingCopy.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/addressingCopy.xml similarity index 100% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/addressingCopy.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/addressingCopy.xml diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/addressingInit.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/addressingInit.xml similarity index 100% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/addressingInit.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/addressingInit.xml diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/assignInvokerAsyncMessage.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/assignInvokerAsyncMessage.xml similarity index 93% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/assignInvokerAsyncMessage.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/assignInvokerAsyncMessage.xml index c409ee028..89dc49cfb 100644 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/assignInvokerAsyncMessage.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/assignInvokerAsyncMessage.xml @@ -1,4 +1,3 @@ - @@ -8,7 +7,7 @@ {planCorrelation} {csarName} {serviceInstanceID} - {nodeInstanceID} + {nodeInstanceID} {serviceTemplateNS} {serviceTemplateLocalName} {interface} @@ -26,4 +25,4 @@ {copies} - \ No newline at end of file +
    diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/assignStringVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/assignStringVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/assignStringVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/assignStringVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/copyReplyTo.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/copyReplyTo.xml similarity index 86% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/copyReplyTo.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/copyReplyTo.xml index b200d4de0..2e1237145 100644 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/copyReplyTo.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/copyReplyTo.xml @@ -1,7 +1,6 @@ - - \ No newline at end of file + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/correlationIdCopy.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/correlationIdCopy.xml new file mode 100644 index 000000000..548d8c04a --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/correlationIdCopy.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/externalParamCopy.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/externalParamCopy.xml new file mode 100644 index 000000000..9ec158875 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/externalParamCopy.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/externalParamCopy2.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/externalParamCopy2.xml new file mode 100644 index 000000000..51719c7ec --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/externalParamCopy2.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/ifFaultMessageThrowFault.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/ifFaultMessageThrowFault.xml similarity index 100% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/ifFaultMessageThrowFault.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/ifFaultMessageThrowFault.xml diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/initMessageId.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/initMessageId.xml similarity index 89% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/initMessageId.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/initMessageId.xml index 5744c10dd..2aef2f0c4 100644 --- a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/initMessageId.xml +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/initMessageId.xml @@ -1,4 +1,3 @@ - @@ -7,4 +6,4 @@ - \ No newline at end of file + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/internalParamCopy.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/internalParamCopy.xml new file mode 100644 index 000000000..2294b63cf --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/internalParamCopy.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/invoker.wsdl b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/invoker.wsdl similarity index 100% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/invoker.wsdl rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/invoker.wsdl diff --git a/org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/invoker.xsd b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/invoker.xsd similarity index 100% rename from org.opentosca.planbuilder.provphase.plugin.invoker/META-INF/resources/invoker.xsd rename to org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/invoker.xsd diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/nodeInstanceCopy.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/nodeInstanceCopy.xml new file mode 100644 index 000000000..dfb1e576d --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/nodeInstanceCopy.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/serviceInstanceCopy.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/serviceInstanceCopy.xml new file mode 100644 index 000000000..cb8e85869 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/invoker-plugin/serviceInstanceCopy.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..6633ab376 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.provphase.plugin.invoker/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,14 @@ + + + + Register the beans within the planbuilder provisioning-phase invoker plugin + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/pom.xml new file mode 100644 index 000000000..e81e6ac21 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.selection.plugin.firstavailable + + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + + diff --git a/org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/bpel/BPELFirstAvailablePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/java/org/opentosca/planbuilder/selection/plugin/firstavailable/bpel/BPELFirstAvailablePlugin.java similarity index 75% rename from org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/bpel/BPELFirstAvailablePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/java/org/opentosca/planbuilder/selection/plugin/firstavailable/bpel/BPELFirstAvailablePlugin.java index 2409cd063..02fff13f0 100644 --- a/org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/bpel/BPELFirstAvailablePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/java/org/opentosca/planbuilder/selection/plugin/firstavailable/bpel/BPELFirstAvailablePlugin.java @@ -10,7 +10,6 @@ import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; import org.opentosca.planbuilder.core.bpel.handlers.BPELPlanHandler; import org.opentosca.planbuilder.core.bpel.tosca.handlers.NodeRelationInstanceVariablesHandler; -import org.opentosca.planbuilder.core.bpel.tosca.handlers.SimplePlanBuilderServiceInstanceHandler; import org.opentosca.planbuilder.model.plan.bpel.BPELPlan; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.selection.plugin.firstavailable.core.FirstAvailablePlugin; @@ -19,21 +18,20 @@ /** *

    - * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to - * the OpenTOSCA Container InstanceData API + * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to the OpenTOSCA + * Container InstanceData API *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELFirstAvailablePlugin extends FirstAvailablePlugin { @Override public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, final List selectionStrategies) { - + // fetch instance variables final String nodeTemplateInstanceURLVar = context.findInstanceURLVar(nodeTemplate.getId(), true); final String nodeTemplateInstanceIDVar = context.findInstanceIDVar(nodeTemplate.getId(), true); @@ -51,8 +49,8 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate try { Node getNodeInstances = new BPELProcessFragments().createRESTExtensionGETForNodeInstanceDataAsNode(serviceTemplateUrlVar, - responseVarName, - nodeTemplate.getId(), null); + responseVarName, + nodeTemplate.getId(), null); getNodeInstances = context.importNode(getNodeInstances); context.getPrePhaseElement().appendChild(getNodeInstances); @@ -60,30 +58,28 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate "//*[local-name()='NodeTemplateInstanceResources']/*[local-name()='NodeTemplateInstances']/*[local-name()='NodeTemplateInstance']/*[1]/*[local-name()='Link']/@*[local-name()='href']/string()"; Node fetchNodeInstance = new BPELProcessFragments().createAssignVarToVarWithXpathQueryAsNode("selectFirstInstance_" - + nodeTemplate.getId() + "_FetchSourceNodeInstance_" + System.currentTimeMillis(), responseVarName, - nodeTemplateInstanceURLVar, - xpath2Query);; + + nodeTemplate.getId() + "_FetchSourceNodeInstance_" + System.currentTimeMillis(), responseVarName, + nodeTemplateInstanceURLVar, + xpath2Query); + ; fetchNodeInstance = context.importNode(fetchNodeInstance); context.getPrePhaseElement().appendChild(fetchNodeInstance); final String assignIDFromUrlVarQuery = "tokenize(//*,'/')[last()]"; Node assignId = new BPELProcessFragments().createAssignVarToVarWithXpathQueryAsNode("seleftFirstInstanceassignIDFromUrlVar", - nodeTemplateInstanceURLVar, - nodeTemplateInstanceIDVar, - assignIDFromUrlVarQuery); + nodeTemplateInstanceURLVar, + nodeTemplateInstanceIDVar, + assignIDFromUrlVarQuery); assignId = context.importNode(assignId); context.getPrePhaseElement().appendChild(assignId); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -93,9 +89,8 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate new NodeRelationInstanceVariablesHandler(new BPELPlanHandler()); nodeInit.addPropertyVariableUpdateBasedOnNodeInstanceID(context, nodeTemplate, - context.getServiceTemplate()); - } - catch (final ParserConfigurationException e) { + context.getServiceTemplate()); + } catch (final ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -107,5 +102,4 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate public int getPriority() { return 1; } - } diff --git a/org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/core/FirstAvailablePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/java/org/opentosca/planbuilder/selection/plugin/firstavailable/core/FirstAvailablePlugin.java similarity index 79% rename from org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/core/FirstAvailablePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/java/org/opentosca/planbuilder/selection/plugin/firstavailable/core/FirstAvailablePlugin.java index 60d20e3ad..d947a35ef 100644 --- a/org.opentosca.planbuilder.selection.plugin.firstavailable/src/org/opentosca/planbuilder/selection/plugin/firstavailable/core/FirstAvailablePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/java/org/opentosca/planbuilder/selection/plugin/firstavailable/core/FirstAvailablePlugin.java @@ -2,20 +2,19 @@ import java.util.List; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IScalingPlanBuilderSelectionPlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IScalingPlanBuilderSelectionPlugin; /** *

    - * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to - * the OpenTOSCA Container InstanceData API + * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to the OpenTOSCA + * Container InstanceData API *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class FirstAvailablePlugin implements IScalingPlanBuilderSelectionPlugin { diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..3ea2c79a2 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.firstavailable/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder firstavailable selection plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/pom.xml new file mode 100644 index 000000000..23d49ac27 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.selection.plugin.input + + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + + diff --git a/org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/bpel/BPELSelectionInputPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/src/main/java/org/opentosca/planbuilder/selection/plugin/input/bpel/BPELSelectionInputPlugin.java similarity index 80% rename from org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/bpel/BPELSelectionInputPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/src/main/java/org/opentosca/planbuilder/selection/plugin/input/bpel/BPELSelectionInputPlugin.java index 1848e8042..b67a6a794 100644 --- a/org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/bpel/BPELSelectionInputPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/src/main/java/org/opentosca/planbuilder/selection/plugin/input/bpel/BPELSelectionInputPlugin.java @@ -16,18 +16,16 @@ /** *

    - * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to - * the OpenTOSCA Container InstanceData API + * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to the OpenTOSCA + * Container InstanceData API *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELSelectionInputPlugin extends SelectionInputPlugin { - @Override public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, final List selectionStrategies) { @@ -35,7 +33,6 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate final String inputFieldName = nodeTemplate.getId() + "_InstanceID"; context.addStringValueToPlanRequest(inputFieldName); - // fetch nodeInstanceVar final String nodeInstanceVarName = context.findInstanceURLVar(nodeTemplate.getId(), true); @@ -43,20 +40,18 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate try { Node assignFromInputToNodeInstanceIdVar = new BPELProcessFragments().generateAssignFromInputMessageToStringVariableAsNode(inputFieldName, - nodeInstanceVarName); + nodeInstanceVarName); assignFromInputToNodeInstanceIdVar = context.importNode(assignFromInputToNodeInstanceIdVar); context.getPrePhaseElement().appendChild(assignFromInputToNodeInstanceIdVar); - } - catch (IOException | ParserConfigurationException | SAXException e) { + } catch (IOException | ParserConfigurationException | SAXException e) { e.printStackTrace(); } try { new NodeRelationInstanceVariablesHandler( new BPELPlanHandler()).addPropertyVariableUpdateBasedOnNodeInstanceID(context, nodeTemplate, - context.getServiceTemplate()); - } - catch (final ParserConfigurationException e) { + context.getServiceTemplate()); + } catch (final ParserConfigurationException e) { e.printStackTrace(); } @@ -67,5 +62,4 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate public int getPriority() { return 1; } - } diff --git a/org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/core/SelectionInputPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/src/main/java/org/opentosca/planbuilder/selection/plugin/input/core/SelectionInputPlugin.java similarity index 78% rename from org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/core/SelectionInputPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/src/main/java/org/opentosca/planbuilder/selection/plugin/input/core/SelectionInputPlugin.java index 875df675e..71ba77a95 100644 --- a/org.opentosca.planbuilder.selection.plugin.input/src/org/opentosca/planbuilder/selection/plugin/input/core/SelectionInputPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.input/src/main/java/org/opentosca/planbuilder/selection/plugin/input/core/SelectionInputPlugin.java @@ -2,20 +2,19 @@ import java.util.List; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IScalingPlanBuilderSelectionPlugin; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IScalingPlanBuilderSelectionPlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; /** *

    - * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to - * the OpenTOSCA Container InstanceData API + * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to the OpenTOSCA + * Container InstanceData API *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class SelectionInputPlugin implements IScalingPlanBuilderSelectionPlugin { @@ -31,5 +30,4 @@ public boolean canHandle(final AbstractNodeTemplate nodeTemplate, final List + + + Register the beans within the planbuilder input selection plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/pom.xml new file mode 100644 index 000000000..30cb7202e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + org.opentosca.planbuilder.selection.plugin.mosquitto.workload + + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + compile + + + + diff --git a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/bpel/BPELMosquittoSelectionPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/java/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/bpel/BPELMosquittoSelectionPlugin.java similarity index 84% rename from org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/bpel/BPELMosquittoSelectionPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/java/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/bpel/BPELMosquittoSelectionPlugin.java index 4ff49b12d..a7a7eeff0 100644 --- a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/bpel/BPELMosquittoSelectionPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/java/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/bpel/BPELMosquittoSelectionPlugin.java @@ -18,14 +18,13 @@ /** *

    - * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to - * the OpenTOSCA Container InstanceData API + * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to the OpenTOSCA + * Container InstanceData API *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELMosquittoSelectionPlugin extends MosquittoSelectionPlugin { @@ -43,8 +42,7 @@ private String findInstanceVar(final BPELPlanContext context, final String templ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, final List selectionStrategies) { - // TODO - // fetch instance variables + // TODO fetch instance variables final String nodeTemplateInstanceVar = this.findInstanceVar(context, nodeTemplate.getId(), true); final List relations = ModelUtils.getOutgoingInfrastructureEdges(nodeTemplate); @@ -64,7 +62,7 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate try { Node getRelationInstance = new BPELProcessFragments().generateBPEL4RESTLightGETonURLAsNode(relationTemplateInstnaceVar, - responseVarName); + responseVarName); getRelationInstance = context.importNode(getRelationInstance); context.getPrePhaseElement().appendChild(getRelationInstance); @@ -72,13 +70,11 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate "//*[local-name()='Reference' and @*[local-name()='title' and string()='SourceInstanceId']]/@*[local-name()='href']/string()"; Node fetchSourceInstance = new BPELProcessFragments().createAssignXpathQueryToStringVarFragmentAsNode("selectFirstInstance_" - + nodeTemplate.getId() + "_FetchSourceNodeInstance_" + System.currentTimeMillis(), xpath2Query, - nodeTemplateInstanceVar); + + nodeTemplate.getId() + "_FetchSourceNodeInstance_" + System.currentTimeMillis(), xpath2Query, + nodeTemplateInstanceVar); fetchSourceInstance = context.importNode(fetchSourceInstance); context.getPrePhaseElement().appendChild(fetchSourceInstance); - - } - catch (IOException | SAXException | ParserConfigurationException e) { + } catch (IOException | SAXException | ParserConfigurationException e) { e.printStackTrace(); } @@ -89,5 +85,4 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate public int getPriority() { return 1; } - } diff --git a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/core/MosquittoSelectionPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/java/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/core/MosquittoSelectionPlugin.java similarity index 79% rename from org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/core/MosquittoSelectionPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/java/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/core/MosquittoSelectionPlugin.java index f9999c6cf..b1f7a45c7 100644 --- a/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/core/MosquittoSelectionPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/java/org/opentosca/planbuilder/selection/plugin/mosquitto/workload/core/MosquittoSelectionPlugin.java @@ -2,20 +2,19 @@ import java.util.List; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IScalingPlanBuilderSelectionPlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IScalingPlanBuilderSelectionPlugin; /** *

    - * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to - * the OpenTOSCA Container InstanceData API + * This class represents a POST-Phase Plugin which sends runtime values of NodeTemplate Instances to the OpenTOSCA + * Container InstanceData API *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class MosquittoSelectionPlugin implements IScalingPlanBuilderSelectionPlugin { @@ -26,12 +25,10 @@ public abstract class MosquittoSelectionPlugin implements public boolean canHandle(final AbstractNodeTemplate nodeTemplate, final List selectionStrategies) { // we can basically handle every type with this strategy return selectionStrategies.contains(MosquittoSelectionPlugin.WORKLOAD_SELECTION_STRATEGY); - } @Override public String getID() { return MosquittoSelectionPlugin.PLUGIN_ID; } - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..3974bdc80 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.selection.plugin.mosquitto.workload/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder mosquitto workload selection plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/pom.xml new file mode 100644 index 000000000..231b18fda --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.type.plugin.connectsto + + + + org.opentosca + org.opentosca.container.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConfigureRelationsPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConfigureRelationsPlugin.java similarity index 96% rename from org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConfigureRelationsPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConfigureRelationsPlugin.java index e02b802d0..585e9a572 100644 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConfigureRelationsPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConfigureRelationsPlugin.java @@ -3,7 +3,6 @@ import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; import org.opentosca.planbuilder.type.plugin.connectsto.bpel.handler.BPELConfigureRelationsPluginHandler; import org.opentosca.planbuilder.type.plugin.connectsto.core.ConfigureRelationsPlugin; import org.opentosca.planbuilder.type.plugin.connectsto.core.handler.ConnectsToPluginHandler; @@ -39,6 +38,4 @@ public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemp public int getPriority() { return 1; } - - } diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConnectsToPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConnectsToPlugin.java similarity index 75% rename from org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConnectsToPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConnectsToPlugin.java index 33efb0164..1278271ff 100644 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConnectsToPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/BPELConnectsToPlugin.java @@ -1,4 +1,3 @@ - package org.opentosca.planbuilder.type.plugin.connectsto.bpel; import javax.xml.parsers.ParserConfigurationException; @@ -6,7 +5,6 @@ import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; import org.opentosca.planbuilder.type.plugin.connectsto.bpel.handler.BPELConnectsToPluginHandler; import org.opentosca.planbuilder.type.plugin.connectsto.core.ConnectsToPlugin; @@ -15,27 +13,27 @@ *
    * *

    - * This class implements a PlanBuilder Type Plugin for the RelationshipType ConnectsTo. This plugin - * searches for a connection interface on the source node, which implements a connectsTo operation - * with any kind of parameter. These parameters will be wired against properties of the stack - * connected to as target to this relation. + * This class implements a PlanBuilder Type Plugin for the RelationshipType ConnectsTo. This plugin searches for a + * connection interface on the source node, which implements a connectsTo operation with any kind of parameter. These + * parameters will be wired against properties of the stack connected to as target to this relation. *

    * - * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class BPELConnectsToPlugin extends ConnectsToPlugin { - private BPELConnectsToPluginHandler handler; + private final BPELConnectsToPluginHandler handler; public BPELConnectsToPlugin() { + BPELConnectsToPluginHandler safeCreatedHandler; try { - this.handler = new BPELConnectsToPluginHandler(); - } - catch (final ParserConfigurationException e) { + safeCreatedHandler = new BPELConnectsToPluginHandler(); + } catch (ParserConfigurationException e) { + // Wow this is bad e.printStackTrace(); + safeCreatedHandler = null; } + handler = safeCreatedHandler; } /* @@ -77,5 +75,4 @@ public boolean handleTerminate(BPELPlanContext templateContext, AbstractRelation public int getPriority() { return 1; } - } diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/Constants.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/Constants.java new file mode 100644 index 000000000..4fff515ed --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/Constants.java @@ -0,0 +1,21 @@ +package org.opentosca.planbuilder.type.plugin.connectsto.bpel; + +import javax.xml.namespace.QName; + +/** + * Copyright 2016 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de + */ +public final class Constants { + + // the relationshipType this plugin can handle + public static final QName MOSQUITTOC_CONNECTS_TO_RELATIONSHIP_TYPE = + new QName("http://opentosca.org/relationshiptypes", "MosquittoConnectsTo"); + + // the target nodes of the relationshiptTypes must be a stack of topic and + // mosquitto + public static final QName TOPIC_NODE_TYPE = new QName("http://opentosca.org/nodetypes", "Topic"); + public static final QName MOSQUITTO_NODE_TYPE = new QName("http://opentosca.org/nodetypes", "Mosquitto_3.1"); +} diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConfigureRelationsPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConfigureRelationsPluginHandler.java similarity index 93% rename from org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConfigureRelationsPluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConfigureRelationsPluginHandler.java index 9c3b23602..dab4af0ae 100644 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConfigureRelationsPluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConfigureRelationsPluginHandler.java @@ -5,14 +5,14 @@ import org.opentosca.container.core.tosca.convention.Types; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.tosca.AbstractInterface; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Variable; import org.opentosca.planbuilder.type.plugin.connectsto.core.ConfigureRelationsPlugin; import org.opentosca.planbuilder.type.plugin.connectsto.core.handler.ConnectsToPluginHandler; @@ -30,7 +30,7 @@ public boolean handle(final BPELPlanContext templateContext) { final Map input = findInputParameters(templateContext, op, relationTemplate, sourceNodeTemplate, targetNodeTemplate); templateContext.executeOperation(relationTemplate, ConfigureRelationsPlugin.INTERFACE_NAME, - ConfigureRelationsPlugin.OPERATION_POST_CONFIGURE_SOURCE, input, null); + ConfigureRelationsPlugin.OPERATION_POST_CONFIGURE_SOURCE, input, null); } if (hasOperation(relationTemplate, ConfigureRelationsPlugin.OPERATION_POST_CONFIGURE_TARGET)) { @@ -39,7 +39,7 @@ public boolean handle(final BPELPlanContext templateContext) { final Map input = findInputParameters(templateContext, op, relationTemplate, sourceNodeTemplate, targetNodeTemplate); templateContext.executeOperation(relationTemplate, ConfigureRelationsPlugin.INTERFACE_NAME, - ConfigureRelationsPlugin.OPERATION_POST_CONFIGURE_TARGET, input, null); + ConfigureRelationsPlugin.OPERATION_POST_CONFIGURE_TARGET, input, null); } return true; diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConnectsToPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConnectsToPluginHandler.java new file mode 100644 index 000000000..be5b2e45e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/bpel/handler/BPELConnectsToPluginHandler.java @@ -0,0 +1,376 @@ +package org.opentosca.planbuilder.type.plugin.connectsto.bpel.handler; + +import java.io.IOException; +import java.io.StringReader; +import java.net.URL; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.opentosca.container.core.common.file.ResourceAccess; +import org.opentosca.container.core.tosca.convention.Interfaces; +import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.model.tosca.AbstractInterface; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractOperation; +import org.opentosca.planbuilder.model.tosca.AbstractParameter; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.model.utils.ModelUtils; +import org.opentosca.planbuilder.type.plugin.connectsto.core.handler.ConnectsToPluginHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Copyright 2016 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de + */ +public class BPELConnectsToPluginHandler implements ConnectsToPluginHandler { + + private final static Logger LOG = LoggerFactory.getLogger(BPELConnectsToPluginHandler.class); + + private final DocumentBuilderFactory docFactory; + private final DocumentBuilder docBuilder; + + /** + * Constructor + * + * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails + */ + public BPELConnectsToPluginHandler() throws ParserConfigurationException { + this.docFactory = DocumentBuilderFactory.newInstance(); + this.docFactory.setNamespaceAware(true); + this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } + + /** + * Executes the connectTo operation on the given connectToNode NodeTemplate, the parameters for the operation will + * be searched starting from the opposite NodeTemplate. + *

    + * Additionally it is possible to search properties which start with "SOURCE_" or "TARGET_" on the source/target + * NodeTemplate. + * + * @param templateContext the context of this operation call + * @param connectToNode a Node Template with a connectTo operation + * @param sourceParameterNode the source node template of the connectsTo relationship + * @param targetParameterNode the target node template of the connectsTo relationship + */ + private boolean executeConnectsTo(final BPELPlanContext templateContext, final AbstractNodeTemplate connectToNode, + final AbstractNodeTemplate sourceParameterNode, + final AbstractNodeTemplate targetParameterNode) { + // fetch the connectsTo Operation of the source node and it's parameters + AbstractInterface connectsToIface = null; + AbstractOperation connectsToOp = null; + Map param2propertyMapping = null; + for (final AbstractInterface iface : connectToNode.getType().getInterfaces()) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_CONNECTTO)) { + // find properties that match the params on the target nodes' stack or prefixed + // properties at the source stack + BPELConnectsToPluginHandler.LOG.debug("Found connectTo operation. Searching for matching parameters in the properties."); + param2propertyMapping = findInputParameters(templateContext, op, connectToNode, sourceParameterNode, + targetParameterNode); + + // check if all input params (or at least all required input params) can be matched with properties + if (param2propertyMapping.size() != op.getInputParameters().size() + && !allRequiredParamsAreMatched(op.getInputParameters(), param2propertyMapping)) { + BPELConnectsToPluginHandler.LOG.info("Didn't find necessary matchings from parameter to property. Can't initialize connectsTo relationship."); + } else { + // executable operation found + connectsToIface = iface; + connectsToOp = op; + break; + } + } + } + if (connectsToOp != null) { + break; + } + } + + // no connectTo operation found with matching parameters + if (connectsToOp == null) { + BPELConnectsToPluginHandler.LOG.debug("No executable connectTo operation found."); + return false; + } + + // execute the connectTo operation with the found parameters + BPELConnectsToPluginHandler.LOG.debug("Adding connectTo operation execution to build plan."); + final Boolean result = templateContext.executeOperation(connectToNode, connectsToIface.getName(), + connectsToOp.getName(), param2propertyMapping); + BPELConnectsToPluginHandler.LOG.debug("Result from adding operation: " + result); + + return true; + } + + /** + * Search the input parameters for a given connectTo operation. + * + * @param templateContext the context of the operation + * @param connectsToOp the connectTo operation object + * @param connectToNode the node which tries to establish the connection + * @param sourceParameterNode the source node of the relationship + * @param targetParameterNode the target node of the relationship + * @return the Map which contains all found input parameters + */ + private Map findInputParameters(final BPELPlanContext templateContext, + final AbstractOperation connectsToOp, + final AbstractNodeTemplate connectToNode, + final AbstractNodeTemplate sourceParameterNode, + final AbstractNodeTemplate targetParameterNode) { + final Map param2propertyMapping = new HashMap<>(); + + // search on the opposite side of the connectToNode NodeTemplate for default parameters + AbstractNodeTemplate parametersRootNode; + if (sourceParameterNode.equals(connectToNode)) { + parametersRootNode = targetParameterNode; + } else { + parametersRootNode = sourceParameterNode; + } + + // search the input parameters in the properties + for (final AbstractParameter param : connectsToOp.getInputParameters()) { + // search parameter in the RelationshipTemplate properties + final Variable var = + templateContext.getPropertyVariable(templateContext.getRelationshipTemplate(), param.getName()); + + if (var != null) { + param2propertyMapping.put(param, var); + } else { + // search for prefixed parameters + if (param.getName().startsWith("SOURCE_")) { + final String unprefixedParam = param.getName().substring(7); + final Variable property = + searchPropertyInStack(templateContext, sourceParameterNode, unprefixedParam); + if (property != null) { + param2propertyMapping.put(param, property); + } + } + + if (param.getName().startsWith("TARGET_")) { + final String unprefixedParam = param.getName().substring(7); + final Variable property = + searchPropertyInStack(templateContext, targetParameterNode, unprefixedParam); + if (property != null) { + param2propertyMapping.put(param, property); + } + } + + // search for default parameters at opposite NodeTemplate + if (!param2propertyMapping.containsKey(param)) { + if (!org.opentosca.container.core.tosca.convention.Utils.isSupportedVirtualMachineIPProperty(param.getName())) { + // search for property with exact name + final Variable property = + searchPropertyInStack(templateContext, parametersRootNode, param.getName()); + if (property != null) { + param2propertyMapping.put(param, property); + } + } else { + // search for IP property with different names + for (final String paramName : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineIPPropertyNames()) { + final Variable property = + searchPropertyInStack(templateContext, parametersRootNode, paramName); + if (property != null) { + param2propertyMapping.put(param, property); + break; + } + } + } + } + } + } + return param2propertyMapping; + } + + /** + * Search for a property with a certain name on the stack of a node template. + * + * @param templateContext the context of the operation + * @param currentNode the node which is part of the stack + * @param propName the name of the property + * @return the property if found, null otherwise + */ + private Variable searchPropertyInStack(final PlanContext templateContext, AbstractNodeTemplate currentNode, + final String propName) { + while (currentNode != null) { + final Variable property = templateContext.getPropertyVariable(currentNode, propName); + if (property != null) { + return property; + } else { + currentNode = fetchNodeConnectedWithHostedOn(currentNode); + } + } + return null; + } + + /** + * Returns the first node found connected trough a hostedOn relation + * + * @param nodeTemplate the node which is a possible source of an hostedOn relation + * @return an AbstractNodeTemplate which is a target of an hostedOn relation. Null if the given nodeTemplate isn't + * connected to as a source to a hostedOn relation + */ + private AbstractNodeTemplate fetchNodeConnectedWithHostedOn(final AbstractNodeTemplate nodeTemplate) { + for (final AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { + if (ModelUtils.getRelationshipTypeHierarchy(relation.getRelationshipType()) + .contains(Types.hostedOnRelationType)) { + return relation.getTarget(); + } + } + return null; + } + + private String getInterface(final AbstractNodeTemplate nodeTemplate, final String operationName) { + for (final AbstractInterface iface : nodeTemplate.getType().getInterfaces()) { + for (final AbstractOperation op : iface.getOperations()) { + if (op.getName().equals(operationName)) { + return iface.getName(); + } + } + } + return null; + } + + @Override + public boolean handle(final BPELPlanContext templateContext) { + final AbstractRelationshipTemplate relationTemplate = templateContext.getRelationshipTemplate(); + final AbstractNodeTemplate sourceNodeTemplate = relationTemplate.getSource(); + final AbstractNodeTemplate targetNodeTemplate = relationTemplate.getTarget(); + + // if the target has connectTo we execute it + if (hasOperation(targetNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_CONNECTTO)) { + // if we can stop and start the node and it is not defined as non interruptive, stop it + if (!hasInterface(targetNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE) + && startAndStopAvailable(targetNodeTemplate)) { + final String ifaceName = + getInterface(targetNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP); + templateContext.executeOperation(targetNodeTemplate, ifaceName, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP, null); + } + + // connectTo + executeConnectsTo(templateContext, targetNodeTemplate, sourceNodeTemplate, targetNodeTemplate); + + // start the node again + if (!hasInterface(targetNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE) + && startAndStopAvailable(targetNodeTemplate)) { + templateContext.executeOperation(targetNodeTemplate, + getInterface(targetNodeTemplate, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START), + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START, null); + } + } + + // if the source has connectTo we execute it + if (hasOperation(sourceNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_CONNECTTO)) { + + // if we can stop and start the node and it is not defined as non interruptive, stop it + if (!hasInterface(sourceNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE) + && startAndStopAvailable(sourceNodeTemplate)) { + templateContext.executeOperation(sourceNodeTemplate, + getInterface(sourceNodeTemplate, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP), + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP, null); + } + + // connectTo + executeConnectsTo(templateContext, sourceNodeTemplate, sourceNodeTemplate, targetNodeTemplate); + + // start the node again + if (!hasInterface(sourceNodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CONNECT_NON_INTERRUPTIVE) + && startAndStopAvailable(sourceNodeTemplate)) { + templateContext.executeOperation(sourceNodeTemplate, + getInterface(sourceNodeTemplate, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START), + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START, null); + } + } + + return true; + } + + private boolean startAndStopAvailable(final AbstractNodeTemplate nodeTemplate) { + return hasOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_STOP) + & hasOperation(nodeTemplate, Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_START); + } + + private boolean hasInterface(final AbstractNodeTemplate nodeTemplate, final String interfaceName) { + return nodeTemplate.getType().getInterfaces().stream().filter(inter -> inter.getName().equals(interfaceName)) + .findFirst().isPresent(); + } + + private boolean hasOperation(final AbstractNodeTemplate nodeTemplate, final String operationName) { + return nodeTemplate.getType().getInterfaces().stream().flatMap(inter -> inter.getOperations().stream()) + .filter(op -> op.getName().equals(operationName)).findFirst().isPresent(); + } + + /** + * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String variable. + * + * @param assignName the name of the BPEL assign + * @param stringVarName the variable to load the queries results into + * @return a DOM Node representing a BPEL assign element + * @throws IOException is thrown when loading internal bpel fragments fails + * @throws SAXException is thrown when parsing internal format into DOM fails + */ + public Node loadAssignXpathQueryToStringVarFragmentAsNode(final String assignName, final String xpath2Query, + final String stringVarName) throws IOException, + SAXException { + final String templateString = + loadAssignXpathQueryToStringVarFragmentAsString(assignName, xpath2Query, stringVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String variable. + * + * @param assignName the name of the BPEL assign + * @param xpath2Query the csarEntryPoint XPath query + * @param stringVarName the variable to load the queries results into + * @return a String containing a BPEL Assign element + * @throws IOException is thrown when reading the BPEL fragment form the resources fails + */ + public String loadAssignXpathQueryToStringVarFragmentAsString(final String assignName, final String xpath2Query, + final String stringVarName) throws IOException { + // + final URL url = getClass().getClassLoader() + .getResource("connectsto-plugin/assignStringVarWithXpath2Query.xml"); + String template = ResourceAccess.readResourceAsString(url); + template = template.replace("{AssignName}", assignName); + template = template.replace("{xpath2query}", xpath2Query); + template = template.replace("{stringVarName}", stringVarName); + return template; + } + + /** + * Checks if all required input params have a matching property + * + * @param inputParameters of the connectsTo operation + * @param param2propertyMapping mapping between inputParameters and matched properties + * @return true, if all required input params have a matching property. Otherwise, false. + */ + private boolean allRequiredParamsAreMatched(final List inputParameters, + final Map param2propertyMapping) { + for (final AbstractParameter inputParam : inputParameters) { + if (inputParam.isRequired() && !param2propertyMapping.containsKey(inputParam)) { + return false; + } + } + return true; + } +} diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/ConfigureRelationsPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/ConfigureRelationsPlugin.java similarity index 92% rename from org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/ConfigureRelationsPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/ConfigureRelationsPlugin.java index 33a1a6d08..004c99502 100644 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/ConfigureRelationsPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/ConfigureRelationsPlugin.java @@ -2,11 +2,11 @@ import java.util.List; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.tosca.AbstractInterface; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; public abstract class ConfigureRelationsPlugin implements IPlanBuilderTypePlugin { diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/ConnectsToPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/ConnectsToPlugin.java similarity index 81% rename from org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/ConnectsToPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/ConnectsToPlugin.java index 85d05b786..c22902244 100644 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/ConnectsToPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/ConnectsToPlugin.java @@ -1,29 +1,25 @@ package org.opentosca.planbuilder.type.plugin.connectsto.core; import org.opentosca.container.core.tosca.convention.Types; -import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.tosca.AbstractInterface; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; /** * Copyright 2016 IAAS University of Stuttgart
    *
    * *

    - * This class implements a PlanBuilder Type Plugin for the RelationshipType ConnectsTo. This plugin - * searches for a connection interface on the source node, which implements a connectsTo operation - * with any kind of parameter. These parameters will be wired against properties of the stack - * connected to as target to this relation. + * This class implements a PlanBuilder Type Plugin for the RelationshipType ConnectsTo. This plugin searches for a + * connection interface on the source node, which implements a connectsTo operation with any kind of parameter. These + * parameters will be wired against properties of the stack connected to as target to this relation. *

    * - * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public abstract class ConnectsToPlugin implements IPlanBuilderTypePlugin { public static final String PLUGIN_ID = "OpenTOSCA PlanBuilder Type Plugin Client connects to Mosquitto Broker"; @@ -51,7 +47,7 @@ public boolean canHandleCreate(final AbstractRelationshipTemplate relationshipTe // check the relationshipType if (!ModelUtils.getRelationshipTypeHierarchy(relationshipTemplate.getRelationshipType()) - .contains(Types.connectsToRelationType)) { + .contains(Types.connectsToRelationType)) { return false; } @@ -86,11 +82,9 @@ public boolean canHandleTerminate(AbstractRelationshipTemplate relationshipTempl return false; } - @Override public boolean canHandleTerminate(AbstractNodeTemplate nodeTemplate) { // will never be used for nodeTemplates return false; } - } diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/handler/ConnectsToPluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/handler/ConnectsToPluginHandler.java similarity index 79% rename from org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/handler/ConnectsToPluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/handler/ConnectsToPluginHandler.java index bd6144fd8..a072cb64a 100644 --- a/org.opentosca.planbuilder.type.plugin.connectsto/src/org/opentosca/planbuilder/type/plugin/connectsto/core/handler/ConnectsToPluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/java/org/opentosca/planbuilder/type/plugin/connectsto/core/handler/ConnectsToPluginHandler.java @@ -1,16 +1,14 @@ package org.opentosca.planbuilder.type.plugin.connectsto.core.handler; -import org.opentosca.planbuilder.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; /** * Copyright 2016 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public interface ConnectsToPluginHandler { public boolean handle(final T templateContext); - } diff --git a/org.opentosca.planbuilder.type.plugin.connectsto/META-INF/resources/assignStringVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/resources/connectsto-plugin/assignStringVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.type.plugin.connectsto/META-INF/resources/assignStringVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/resources/connectsto-plugin/assignStringVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..17cdfd19f --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.connectsto/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,14 @@ + + + + Register the beans within the planbuilder connectsto type plugin + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/pom.xml new file mode 100644 index 000000000..3572e2372 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.type.plugin.dockercontainer + + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + compile + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + compile + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELDockerContainerTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELDockerContainerTypePlugin.java new file mode 100644 index 000000000..0ff9c2046 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELDockerContainerTypePlugin.java @@ -0,0 +1,96 @@ +package org.opentosca.planbuilder.type.plugin.dockercontainer.bpel; + +import java.util.Collection; +import java.util.HashSet; + +import org.opentosca.container.core.tosca.convention.Interfaces; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.opentosca.planbuilder.type.plugin.dockercontainer.bpel.handler.BPELDockerContainerTypePluginHandler; +import org.opentosca.planbuilder.type.plugin.dockercontainer.core.DockerContainerTypePlugin; + +/** + *

    + * This class represents a generic plugin to install a PhpModule on Apache HTTP Server with the OpenTOSCA Container + * Invoker Service + *

    + * Copyright 2014 IAAS University of Stuttgart
    + *
    + * + * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de + */ +public class BPELDockerContainerTypePlugin extends DockerContainerTypePlugin { + + private final BPELDockerContainerTypePluginHandler handler = new BPELDockerContainerTypePluginHandler(); + + @Override + public boolean handleCreate(final BPELPlanContext templateContext, AbstractNodeTemplate nodeTemplate) { + + boolean check = false; + if (this.canHandleCreate(nodeTemplate)) { + check = this.handler.handleCreate(templateContext); + } + + if (check) { + templateContext.addUsedOperation(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER); + } + + return check; + } + + @Override + public boolean handleCreate(BPELPlanContext templateContext, AbstractRelationshipTemplate relationshipTemplate) { + return false; + } + + @Override + public Collection getCreateDependencies(AbstractNodeTemplate nodeTemplate) { + Collection deps = new HashSet(); + deps.add(this.getDockerEngineNode(nodeTemplate)); + return deps; + } + + @Override + public Collection getTerminateDependencies(AbstractNodeTemplate nodeTemplate) { + return null; + } + + @Override + public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemplate nodeTemplate) { + boolean check = false; + if (this.canHandleTerminate(nodeTemplate)) { + check = this.handler.handleTerminate(templateContext); + } + + if (check) { + templateContext.addUsedOperation(Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER); + } + + return check; + } + + @Override + public boolean handleTerminate(BPELPlanContext templateContext, AbstractRelationshipTemplate relationshipTemplate) { + // never handles relationshipTemplates + return false; + } + + @Override + public boolean canHandleTerminate(AbstractRelationshipTemplate relationshipTemplate) { + // never handles relationshipTemplates + return false; + } + + @Override + public int getPriority() { + // specific first than generic handling + return 0; + } +} diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELOpenMTCDockerContainerTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELOpenMTCDockerContainerTypePlugin.java similarity index 86% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELOpenMTCDockerContainerTypePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELOpenMTCDockerContainerTypePlugin.java index 04a950b27..a5745f532 100644 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELOpenMTCDockerContainerTypePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/BPELOpenMTCDockerContainerTypePlugin.java @@ -3,7 +3,6 @@ import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; import org.opentosca.planbuilder.type.plugin.dockercontainer.bpel.handler.BPELOpenMTCDockerContainerTypePluginHandler; import org.opentosca.planbuilder.type.plugin.dockercontainer.core.OpenMTCDockerContainerTypePlugin; @@ -18,8 +17,8 @@ public boolean handleCreate(final BPELPlanContext templateContext, AbstractNodeT return this.handler.handleOpenMTCGateway(templateContext, findConnectedBackend(nodeTemplate)); } else if (this.canHandleProtocolAdapter(templateContext.getNodeTemplate())) { return this.handler.handleOpenMTCProtocolAdapter(templateContext, - findConnectedGateway(templateContext.getNodeTemplate()), - getAdapterForNode(templateContext.getNodeTemplate())); + findConnectedGateway(templateContext.getNodeTemplate()), + getAdapterForNode(templateContext.getNodeTemplate())); } } return false; @@ -47,5 +46,4 @@ public int getPriority() { // specific first than generic return 0; } - } diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELDockerContainerTypePluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELDockerContainerTypePluginHandler.java similarity index 81% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELDockerContainerTypePluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELDockerContainerTypePluginHandler.java index 478f59291..79c03f382 100644 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELDockerContainerTypePluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELDockerContainerTypePluginHandler.java @@ -12,16 +12,15 @@ import org.opentosca.container.core.tosca.convention.Interfaces; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.core.plugins.utils.PluginUtils; import org.opentosca.planbuilder.model.tosca.AbstractArtifactReference; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.plugins.utils.PluginUtils; import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; import org.opentosca.planbuilder.type.plugin.dockercontainer.core.DockerContainerTypePlugin; import org.opentosca.planbuilder.type.plugin.dockercontainer.core.DockerContainerTypePluginPluginConstants; @@ -34,20 +33,16 @@ /** *

    - * This class contains all the logic to add BPEL Code which installs a PhpModule on an Apache HTTP - * Server + * This class contains all the logic to add BPEL Code which installs a PhpModule on an Apache HTTP Server *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public class BPELDockerContainerTypePluginHandler implements DockerContainerTypePluginHandler { private static final Logger LOG = LoggerFactory.getLogger(BPELDockerContainerTypePluginHandler.class); - - private final BPELInvokerPlugin invokerPlugin = new BPELInvokerPlugin(); private BPELProcessFragments planBuilderFragments; @@ -55,46 +50,41 @@ public class BPELDockerContainerTypePluginHandler implements DockerContainerType public BPELDockerContainerTypePluginHandler() { try { this.planBuilderFragments = new BPELProcessFragments(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { BPELDockerContainerTypePluginHandler.LOG.error("Couldn't initialize planBuilderFragments class"); e.printStackTrace(); } } - + private boolean handleTerminate(final BPELPlanContext context, Element elementToAppendTo) { final List nodes = new ArrayList<>(); ModelUtils.getNodesFromNodeToSink(context.getNodeTemplate(), nodes); - - - - for(AbstractNodeTemplate node : nodes) { + + for (AbstractNodeTemplate node : nodes) { if (org.opentosca.container.core.tosca.convention.Utils.isSupportedDockerEngineNodeType(node.getType() - .getId())) { - + .getId())) { + final Map createDEInternalExternalPropsInput = new HashMap<>(); final Map createDEInternalExternalPropsOutput = new HashMap<>(); final Variable dockerEngineUrlVar = context.getPropertyVariable(node, "DockerEngineURL"); final Variable dockerContainerIds = context.getPropertyVariable(context.getNodeTemplate(), "ContainerID"); - + createDEInternalExternalPropsInput.put("DockerEngineURL", dockerEngineUrlVar); createDEInternalExternalPropsInput.put("ContainerID", dockerContainerIds); - return this.invokerPlugin.handle(context, node.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - createDEInternalExternalPropsInput, createDEInternalExternalPropsOutput, - elementToAppendTo); - + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_REMOVECONTAINER, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + createDEInternalExternalPropsInput, createDEInternalExternalPropsOutput, + elementToAppendTo); } } - + return false; } - public boolean handleTerminate(final BPELPlanContext context) { + public boolean handleTerminate(final BPELPlanContext context) { return this.handleTerminate(context, context.getProvisioningPhaseElement()); } @@ -108,8 +98,8 @@ public boolean handleCreate(final BPELPlanContext templateContext) { final AbstractNodeTemplate nodeTemplate = templateContext.getNodeTemplate(); // fetch port binding variables (ContainerPort, Port) - final Variable containerPortVar = templateContext.getPropertyVariable(nodeTemplate, "ContainerPort"); - final Variable portVar = templateContext.getPropertyVariable(nodeTemplate, "Port"); + final PropertyVariable containerPortVar = templateContext.getPropertyVariable(nodeTemplate, "ContainerPort"); + final PropertyVariable portVar = templateContext.getPropertyVariable(nodeTemplate, "Port"); if (containerPortVar == null | portVar == null) { BPELDockerContainerTypePluginHandler.LOG.error("Couldn't fetch Property variables ContainerPort or Port"); @@ -122,20 +112,18 @@ public boolean handleCreate(final BPELPlanContext templateContext) { try { Node assignContainerPortsNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignPortMapping", - "concat($" - + containerPortVar.getVariableName() - + ",',',$" - + portVar.getVariableName() - + ")", - portMappingVar.getVariableName()); + "concat($" + + containerPortVar.getVariableName() + + ",',',$" + + portVar.getVariableName() + + ")", + portMappingVar.getVariableName()); assignContainerPortsNode = templateContext.importNode(assignContainerPortsNode); templateContext.getProvisioningPhaseElement().appendChild(assignContainerPortsNode); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -163,10 +151,7 @@ public boolean handleCreate(final BPELPlanContext templateContext) { // determine whether we work with an ImageId or a zipped DockerContainer final PropertyVariable containerImageVar = templateContext.getPropertyVariable(nodeTemplate, "ImageID"); - - /* volume data handling */ - // /etc/openmtc/certs // /home/ubuntu/ca-smartorchestra.crt @@ -195,27 +180,25 @@ public boolean handleCreate(final BPELPlanContext templateContext) { } } - boolean check = false; if (containerImageVar == null || PluginUtils.isVariableValueEmpty(containerImageVar)) { // handle with DA -> construct URL to the DockerImage .zip final AbstractDeploymentArtifact da = fetchFirstDockerContainerDA(nodeTemplate); check = handleWithDA(templateContext, dockerEngineNode, da, portMappingVar, dockerEngineUrlVar, sshPortVar, - containerIpVar, containerIdVar, - fetchEnvironmentVariables(templateContext, nodeTemplate), null, null, - containerMountPath, remoteVolumeDataVariable, hostVolumeDataVariable, vmIpVariable, - vmPrivateKeyVariable); - + containerIpVar, containerIdVar, + fetchEnvironmentVariables(templateContext, nodeTemplate), null, null, + containerMountPath, remoteVolumeDataVariable, hostVolumeDataVariable, vmIpVariable, + vmPrivateKeyVariable); } else { // handle with imageId - check =handleWithImageId(templateContext, dockerEngineNode, containerImageVar, portMappingVar, - dockerEngineUrlVar, sshPortVar, containerIpVar, containerIdVar, - fetchEnvironmentVariables(templateContext, nodeTemplate), containerMountPath, - remoteVolumeDataVariable, hostVolumeDataVariable, vmIpVariable, - vmPrivateKeyVariable); - } - + check = handleWithImageId(templateContext, dockerEngineNode, containerImageVar, portMappingVar, + dockerEngineUrlVar, sshPortVar, containerIpVar, containerIdVar, + fetchEnvironmentVariables(templateContext, nodeTemplate), containerMountPath, + remoteVolumeDataVariable, hostVolumeDataVariable, vmIpVariable, + vmPrivateKeyVariable); + } + return check; } @@ -259,7 +242,6 @@ private Variable findPrivateKey(final PlanContext templateContext, final Abstrac private Variable createRemoteVolumeDataInputVariable(final List das, final BPELPlanContext context) { - final Variable remoteVolumeDataVariable = context.createGlobalStringVariable("remoteVolumeData" + System.currentTimeMillis(), ""); @@ -280,16 +262,14 @@ private Variable createRemoteVolumeDataInputVariable(final List propertyNames = ModelUtils.getPropertyNames(nodeTemplate); @@ -343,8 +319,6 @@ private Variable fetchEnvironmentVariables(final BPELPlanContext context, final envVarXpathQuery += ",$" + refProp.getVariableName(); varContent = varContent.replace(dynamicContent + "]", ""); - - } else { String staticContent; if (startIndex == -1) { @@ -358,7 +332,6 @@ private Variable fetchEnvironmentVariables(final BPELPlanContext context, final } } envVarXpathQuery += ",';',"; - } else { final String[] splits = varContent.split(" "); final String nodeTemplateId = splits[1]; @@ -369,7 +342,6 @@ private Variable fetchEnvironmentVariables(final BPELPlanContext context, final foundEnvVar = true; final String envVarName = propName.replaceFirst("ENV_", ""); envVarXpathQuery += "'" + envVarName + "=',$" + refProp.getVariableName() + ",';',"; - } } else { foundEnvVar = true; @@ -392,16 +364,14 @@ private Variable fetchEnvironmentVariables(final BPELPlanContext context, final try { Node assignContainerEnvNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignEnvironmentVariables", - envVarXpathQuery, - envMappingVar.getVariableName()); + envVarXpathQuery, + envMappingVar.getVariableName()); assignContainerEnvNode = context.importNode(assignContainerEnvNode); context.getProvisioningPhaseElement().appendChild(assignContainerEnvNode); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -432,13 +402,10 @@ protected boolean handleWithDA(final BPELPlanContext context, final AbstractNode * Variable remoteVolumeDataVariable = null; Variable hostVolumeDataVariable = null; Variable * vmIpVariable = null; Variable vmPrivateKeyVariable = null; */ - - - context.addStringValueToPlanRequest("csarEntrypoint"); final String artifactPathQuery = this.planBuilderFragments.createXPathQueryForURLRemoteFilePath(da.getArtifactRef().getArtifactReferences() - .get(0).getReference()); + .get(0).getReference()); final String artefactVarName = "dockerContainerFile" + System.currentTimeMillis(); @@ -450,12 +417,10 @@ protected boolean handleWithDA(final BPELPlanContext context, final AbstractNode + System.currentTimeMillis(), artifactPathQuery, dockerContainerFileRefVar.getVariableName()); assignNode = context.importNode(assignNode); context.getProvisioningPhaseElement().appendChild(assignNode); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -507,13 +472,13 @@ protected boolean handleWithDA(final BPELPlanContext context, final AbstractNode } boolean check = true; - + check &= this.invokerPlugin.handle(context, dockerEngineNode.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - createDEInternalExternalPropsInput, createDEInternalExternalPropsOutput, - context.getProvisioningPhaseElement()); - + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + createDEInternalExternalPropsInput, createDEInternalExternalPropsOutput, + context.getProvisioningPhaseElement()); + check &= this.handleTerminate(context, context.getProvisioningCompensationPhaseElement()); return check; @@ -527,7 +492,6 @@ protected boolean handleWithImageId(final BPELPlanContext context, final Abstrac final Variable remoteVolumeDataVariable, final Variable hostVolumeDataVariable, final Variable vmIpVariable, final Variable vmPrivateKeyVariable) { - // map properties to input and output parameters final Map createDEInternalExternalPropsInput = new HashMap<>(); final Map createDEInternalExternalPropsOutput = new HashMap<>(); @@ -566,15 +530,15 @@ protected boolean handleWithImageId(final BPELPlanContext context, final Abstrac } boolean check = true; - + check &= this.invokerPlugin.handle(context, dockerEngineNode.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - createDEInternalExternalPropsInput, createDEInternalExternalPropsOutput, - context.getProvisioningPhaseElement()); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + createDEInternalExternalPropsInput, createDEInternalExternalPropsOutput, + context.getProvisioningPhaseElement()); check &= this.handleTerminate(context, context.getProvisioningCompensationPhaseElement()); - + return check; } @@ -582,7 +546,7 @@ public static AbstractDeploymentArtifact fetchFirstDockerContainerDA(final Abstr for (final AbstractDeploymentArtifact da : nodeTemplate.getDeploymentArtifacts()) { if (da.getArtifactType().equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE) || da.getArtifactType() - .equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE_OLD)) { + .equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE_OLD)) { return da; } } @@ -591,7 +555,7 @@ public static AbstractDeploymentArtifact fetchFirstDockerContainerDA(final Abstr for (final AbstractDeploymentArtifact da : nodeTypeImpl.getDeploymentArtifacts()) { if (da.getArtifactType().equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE) || da.getArtifactType() - .equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE_OLD)) { + .equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE_OLD)) { return da; } } diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELOpenMTCDockerContainerTypePluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELOpenMTCDockerContainerTypePluginHandler.java similarity index 81% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELOpenMTCDockerContainerTypePluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELOpenMTCDockerContainerTypePluginHandler.java index deba70ed4..a768629b2 100644 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELOpenMTCDockerContainerTypePluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/bpel/handler/BPELOpenMTCDockerContainerTypePluginHandler.java @@ -12,15 +12,14 @@ import org.opentosca.container.core.tosca.convention.Interfaces; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.core.plugins.utils.PluginUtils; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.plugins.utils.PluginUtils; import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; import org.opentosca.planbuilder.type.plugin.dockercontainer.bpel.BPELDockerContainerTypePlugin; import org.opentosca.planbuilder.type.plugin.dockercontainer.core.handler.OpenMTCDockerContainerTypePluginHandler; @@ -30,7 +29,7 @@ import org.xml.sax.SAXException; public class BPELOpenMTCDockerContainerTypePluginHandler implements - OpenMTCDockerContainerTypePluginHandler { + OpenMTCDockerContainerTypePluginHandler { private static final Logger LOG = LoggerFactory.getLogger(BPELOpenMTCDockerContainerTypePluginHandler.class); private BPELProcessFragments planBuilderFragments; private final BPELInvokerPlugin invokerPlugin = new BPELInvokerPlugin(); @@ -41,8 +40,7 @@ public class BPELOpenMTCDockerContainerTypePluginHandler implements public BPELOpenMTCDockerContainerTypePluginHandler() { try { this.planBuilderFragments = new BPELProcessFragments(); - } - catch (final ParserConfigurationException e) { + } catch (final ParserConfigurationException e) { e.printStackTrace(); } } @@ -100,10 +98,10 @@ public boolean handleOpenMTCGateway(final BPELPlanContext templateContext, if (backendNodeTemplate != null) { backendIpVar = templateContext.getPropertyVariable(backendNodeTemplate, - "Endpoint") != null ? templateContext.getPropertyVariable(backendNodeTemplate, - "Endpoint") - : templateContext.getPropertyVariable(backendNodeTemplate, - "IP"); + "Endpoint") != null ? templateContext.getPropertyVariable(backendNodeTemplate, + "Endpoint") + : templateContext.getPropertyVariable(backendNodeTemplate, + "IP"); backendCSEIdVar = templateContext.getPropertyVariable(backendNodeTemplate, "ONEM2MCSEID"); } @@ -115,12 +113,12 @@ public boolean handleOpenMTCGateway(final BPELPlanContext templateContext, // assign portmappings Node assignContainerPortsNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignPortMapping", - "concat($" - + containerPortVar.getVariableName() - + ",',',$" - + portVar.getVariableName() - + ")", - portMappingVar.getVariableName()); + "concat($" + + containerPortVar.getVariableName() + + ",',',$" + + portVar.getVariableName() + + ")", + portMappingVar.getVariableName()); assignContainerPortsNode = templateContext.importNode(assignContainerPortsNode); templateContext.getProvisioningPhaseElement().appendChild(assignContainerPortsNode); @@ -138,16 +136,14 @@ public boolean handleOpenMTCGateway(final BPELPlanContext templateContext, // assign environment variable mappings assignContainerPortsNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignEnvironmentVariables", - envVarXpathQuery, - envMappingVar.getVariableName()); + envVarXpathQuery, + envMappingVar.getVariableName()); assignContainerPortsNode = templateContext.importNode(assignContainerPortsNode); templateContext.getProvisioningPhaseElement().appendChild(assignContainerPortsNode); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -181,7 +177,7 @@ public boolean handleOpenMTCGateway(final BPELPlanContext templateContext, final AbstractDeploymentArtifact da = BPELDockerContainerTypePlugin.fetchFirstDockerContainerDA(nodeTemplate); return handleWithDA(templateContext, dockerEngineNode, da, portMappingVar, dockerEngineUrlVar, sshPortVar, - containerIpVar, containerIdVar, envMappingVar, null, null); + containerIpVar, containerIdVar, envMappingVar, null, null); } return false; @@ -193,7 +189,7 @@ private List fetchDataChannels(final PlanContext templateC for (final AbstractRelationshipTemplate relation : protocolAdapterDerviceNodeTemplate.getIngoingRelations()) { if (ModelUtils.getRelationshipTypeHierarchy(relation.getRelationshipType()) - .contains(this.pyhsicallyConnectedRelationshipType)) { + .contains(this.pyhsicallyConnectedRelationshipType)) { dataChannelNTs.add(relation.getSource()); } } @@ -280,7 +276,7 @@ public boolean handleOpenMTCProtocolAdapter(final BPELPlanContext templateContex + System.currentTimeMillis(), ""); final Variable deviceMappingVar = templateContext.createGlobalStringVariable("dockerContainerDeviceMappings" + System.currentTimeMillis(), - ""); + ""); final Variable linksVar = templateContext.createGlobalStringVariable("dockerContainerLinks" + System.currentTimeMillis(), ""); @@ -291,12 +287,12 @@ public boolean handleOpenMTCProtocolAdapter(final BPELPlanContext templateContex // assign portmappings Node assignContainerPortsNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignPortMapping", - "concat($" - + containerPortVar.getVariableName() - + ",',',$" - + portVar.getVariableName() - + ")", - portMappingVar.getVariableName()); + "concat($" + + containerPortVar.getVariableName() + + ",',',$" + + portVar.getVariableName() + + ")", + portMappingVar.getVariableName()); assignContainerPortsNode = templateContext.importNode(assignContainerPortsNode); templateContext.getProvisioningPhaseElement().appendChild(assignContainerPortsNode); @@ -307,8 +303,8 @@ public boolean handleOpenMTCProtocolAdapter(final BPELPlanContext templateContex assignContainerPortsNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignContainerIdForLinking", - queryContainerIdXpath, - gatewayContainerIdVar.getVariableName()); + queryContainerIdXpath, + gatewayContainerIdVar.getVariableName()); assignContainerPortsNode = templateContext.importNode(assignContainerPortsNode); templateContext.getProvisioningPhaseElement().appendChild(assignContainerPortsNode); @@ -325,8 +321,8 @@ public boolean handleOpenMTCProtocolAdapter(final BPELPlanContext templateContex // assign environment variable mappings assignContainerPortsNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignEnvironmentVariables", - envVarConcatXpathQuery, - envMappingVar.getVariableName()); + envVarConcatXpathQuery, + envMappingVar.getVariableName()); assignContainerPortsNode = templateContext.importNode(assignContainerPortsNode); templateContext.getProvisioningPhaseElement().appendChild(assignContainerPortsNode); @@ -334,24 +330,22 @@ public boolean handleOpenMTCProtocolAdapter(final BPELPlanContext templateContex assignContainerPortsNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignDevices", - deviceMappingConcatXpathQuery, - deviceMappingVar.getVariableName()); + deviceMappingConcatXpathQuery, + deviceMappingVar.getVariableName()); assignContainerPortsNode = templateContext.importNode(assignContainerPortsNode); templateContext.getProvisioningPhaseElement().appendChild(assignContainerPortsNode); final String linksConcatXpathQuery = "concat($" + gatewayContainerIdVar.getVariableName() + ",'')"; assignContainerPortsNode = this.planBuilderFragments.createAssignXpathQueryToStringVarFragmentAsNode("assignLinks", - linksConcatXpathQuery, - linksVar.getVariableName()); + linksConcatXpathQuery, + linksVar.getVariableName()); assignContainerPortsNode = templateContext.importNode(assignContainerPortsNode); templateContext.getProvisioningPhaseElement().appendChild(assignContainerPortsNode); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -385,7 +379,7 @@ public boolean handleOpenMTCProtocolAdapter(final BPELPlanContext templateContex final AbstractDeploymentArtifact da = BPELDockerContainerTypePlugin.fetchFirstDockerContainerDA(nodeTemplate); return handleWithDA(templateContext, dockerEngineNode, da, portMappingVar, dockerEngineUrlVar, sshPortVar, - containerIpVar, containerIdVar, envMappingVar, linksVar, deviceMappingVar); + containerIpVar, containerIdVar, envMappingVar, linksVar, deviceMappingVar); } return false; @@ -400,7 +394,7 @@ protected boolean handleWithDA(final BPELPlanContext context, final AbstractNode context.addStringValueToPlanRequest("csarEntrypoint"); final String artifactPathQuery = this.planBuilderFragments.createXPathQueryForURLRemoteFilePath(da.getArtifactRef().getArtifactReferences() - .get(0).getReference()); + .get(0).getReference()); final String artefactVarName = "dockerContainerFile" + System.currentTimeMillis(); @@ -412,12 +406,10 @@ protected boolean handleWithDA(final BPELPlanContext context, final AbstractNode + System.currentTimeMillis(), artifactPathQuery, dockerContainerFileRefVar.getVariableName()); assignNode = context.importNode(assignNode); context.getProvisioningPhaseElement().appendChild(assignNode); - } - catch (final IOException e) { + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); - } - catch (final SAXException e) { + } catch (final SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -457,11 +449,10 @@ protected boolean handleWithDA(final BPELPlanContext context, final AbstractNode } this.invokerPlugin.handle(context, dockerEngineNode.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, createDEInternalExternalPropsInput, - createDEInternalExternalPropsOutput, context.getProvisioningPhaseElement()); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, createDEInternalExternalPropsInput, + createDEInternalExternalPropsOutput, context.getProvisioningPhaseElement()); return true; } - } diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePlugin.java similarity index 89% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePlugin.java index 263e833ae..0d1dfa7fc 100644 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePlugin.java @@ -6,29 +6,28 @@ import javax.xml.namespace.QName; import javax.xml.soap.Node; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractNodeTypeImplementation; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; import org.w3c.dom.Element; import org.w3c.dom.NodeList; /** *

    - * This class represents a generic plugin to install a PhpModule on Apache HTTP Server with the - * OpenTOSCA Container Invoker Service + * This class represents a generic plugin to install a PhpModule on Apache HTTP Server with the OpenTOSCA Container + * Invoker Service *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public abstract class DockerContainerTypePlugin implements IPlanBuilderTypePlugin, - IPlanBuilderTypePlugin.NodeDependencyInformationInterface { + IPlanBuilderTypePlugin.NodeDependencyInformationInterface { private static final String PLUGIN_ID = "OpenTOSCA PlanBuilder Type Plugin DockerContainer"; @@ -36,7 +35,7 @@ public static AbstractDeploymentArtifact fetchFirstDockerContainerDA(final Abstr for (final AbstractDeploymentArtifact da : nodeTemplate.getDeploymentArtifacts()) { if (da.getArtifactType().equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE) || da.getArtifactType() - .equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE_OLD)) { + .equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE_OLD)) { return da; } } @@ -45,7 +44,7 @@ public static AbstractDeploymentArtifact fetchFirstDockerContainerDA(final Abstr for (final AbstractDeploymentArtifact da : nodeTypeImpl.getDeploymentArtifacts()) { if (da.getArtifactType().equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE) || da.getArtifactType() - .equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE_OLD)) { + .equals(DockerContainerTypePluginPluginConstants.DOCKER_CONTAINER_ARTEFACTTYPE_OLD)) { return da; } } @@ -59,7 +58,7 @@ public static AbstractNodeTemplate getDockerEngineNode(final AbstractNodeTemplat for (final AbstractNodeTemplate node : nodes) { if (org.opentosca.container.core.tosca.convention.Utils.isSupportedDockerEngineNodeType(node.getType() - .getId())) { + .getId())) { return node; } } @@ -68,7 +67,6 @@ public static AbstractNodeTemplate getDockerEngineNode(final AbstractNodeTemplat public static boolean isConnectedToDockerEnginerNode(final AbstractNodeTemplate nodeTemplate) { return DockerContainerTypePlugin.getDockerEngineNode(nodeTemplate) != null; - } @Override @@ -116,7 +114,6 @@ public boolean canHandleTerminate(AbstractNodeTemplate nodeTemplate) { return DockerContainerTypePlugin.isConnectedToDockerEnginerNode(nodeTemplate); } - @Override public boolean canHandleCreate(final AbstractNodeTemplate nodeTemplate) { // for this plugin to handle the given NodeTemplate following statements diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePluginPluginConstants.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePluginPluginConstants.java similarity index 99% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePluginPluginConstants.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePluginPluginConstants.java index 46e63de1b..3dde4f66b 100644 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePluginPluginConstants.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/DockerContainerTypePluginPluginConstants.java @@ -7,7 +7,6 @@ *
    * * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class DockerContainerTypePluginPluginConstants { diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/OpenMTCDockerContainerTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/OpenMTCDockerContainerTypePlugin.java similarity index 89% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/OpenMTCDockerContainerTypePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/OpenMTCDockerContainerTypePlugin.java index e9e5341a1..9812dd6cc 100644 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/OpenMTCDockerContainerTypePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/OpenMTCDockerContainerTypePlugin.java @@ -4,10 +4,10 @@ package org.opentosca.planbuilder.type.plugin.dockercontainer.core; import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -20,35 +20,31 @@ * */ public abstract class OpenMTCDockerContainerTypePlugin implements - org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin { + org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin { private static final String ID = "OpenTOSCA PlanBuilder Type Plugin OpenMTC DockerContainer"; public static AbstractNodeTemplate findConnectedBackend(final AbstractNodeTemplate gatewayNodeTemplate) { for (final AbstractRelationshipTemplate relationshipTemplate : gatewayNodeTemplate.getOutgoingRelations()) { if (ModelUtils.getRelationshipTypeHierarchy(relationshipTemplate.getRelationshipType()) - .contains(Types.connectsToRelationType)) { + .contains(Types.connectsToRelationType)) { if (ModelUtils.getNodeTypeHierarchy(relationshipTemplate.getTarget().getType()) - .contains(DockerContainerTypePluginPluginConstants.OPENMTC_BACKEND_SERVICE_NODETYPE)) { + .contains(DockerContainerTypePluginPluginConstants.OPENMTC_BACKEND_SERVICE_NODETYPE)) { return relationshipTemplate.getTarget(); } } - } return null; } - - public static AbstractNodeTemplate findConnectedGateway(final AbstractNodeTemplate protocolAdapterNodeTemplate) { for (final AbstractRelationshipTemplate relationshipTemplate : protocolAdapterNodeTemplate.getOutgoingRelations()) { if (ModelUtils.getRelationshipTypeHierarchy(relationshipTemplate.getRelationshipType()) - .contains(Types.connectsToRelationType)) { + .contains(Types.connectsToRelationType)) { if (ModelUtils.getNodeTypeHierarchy(relationshipTemplate.getTarget().getType()) - .contains(DockerContainerTypePluginPluginConstants.OPENMTC_GATEWAY_DOCKER_CONTAINER_NODETYPE)) { + .contains(DockerContainerTypePluginPluginConstants.OPENMTC_GATEWAY_DOCKER_CONTAINER_NODETYPE)) { return relationshipTemplate.getTarget(); } } - } return null; } @@ -177,13 +173,12 @@ public boolean canHandleGateway(final AbstractNodeTemplate nodeTemplate) { } return ModelUtils.getNodeTypeHierarchy(nodeTemplate.getType()) - .contains(DockerContainerTypePluginPluginConstants.OPENMTC_GATEWAY_DOCKER_CONTAINER_NODETYPE); - + .contains(DockerContainerTypePluginPluginConstants.OPENMTC_GATEWAY_DOCKER_CONTAINER_NODETYPE); } public boolean canHandleProtocolAdapter(final AbstractNodeTemplate nodeTemplate) { if (!ModelUtils.getNodeTypeHierarchy(nodeTemplate.getType()) - .contains(DockerContainerTypePluginPluginConstants.OPENMTC_PROTOCOL_ADAPTER_DOCKER_CONTAINER_NODETYPE)) { + .contains(DockerContainerTypePluginPluginConstants.OPENMTC_PROTOCOL_ADAPTER_DOCKER_CONTAINER_NODETYPE)) { return false; } @@ -203,5 +198,4 @@ public boolean canHandleProtocolAdapter(final AbstractNodeTemplate nodeTemplate) public String getID() { return ID; } - } diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/DockerContainerTypePluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/DockerContainerTypePluginHandler.java similarity index 76% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/DockerContainerTypePluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/DockerContainerTypePluginHandler.java index 144587be6..44d5785d6 100644 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/DockerContainerTypePluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/DockerContainerTypePluginHandler.java @@ -1,17 +1,15 @@ package org.opentosca.planbuilder.type.plugin.dockercontainer.core.handler; -import org.opentosca.planbuilder.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; /** *

    - * This class contains all the logic to add BPEL Code which installs a PhpModule on an Apache HTTP - * Server + * This class contains all the logic to add BPEL Code which installs a PhpModule on an Apache HTTP Server *

    * Copyright 2014 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * */ public interface DockerContainerTypePluginHandler { public boolean handleCreate(final T context); diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/OpenMTCDockerContainerTypePluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/OpenMTCDockerContainerTypePluginHandler.java similarity index 89% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/OpenMTCDockerContainerTypePluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/OpenMTCDockerContainerTypePluginHandler.java index db42a5df9..85d29067d 100644 --- a/org.opentosca.planbuilder.type.plugin.dockercontainer/src/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/OpenMTCDockerContainerTypePluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/java/org/opentosca/planbuilder/type/plugin/dockercontainer/core/handler/OpenMTCDockerContainerTypePluginHandler.java @@ -1,12 +1,11 @@ package org.opentosca.planbuilder.type.plugin.dockercontainer.core.handler; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; public interface OpenMTCDockerContainerTypePluginHandler { public boolean handleOpenMTCGateway(final T templateContext, final AbstractNodeTemplate backendNodeTemplate); public boolean handleOpenMTCProtocolAdapter(final T templateContext, final AbstractNodeTemplate openMtcGateway, final AbstractNodeTemplate sensorNodeTemplate); - } diff --git a/org.opentosca.planbuilder.type.plugin.dockercontainer/META-INF/resources/php_start.sh b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/resources/php_start.sh similarity index 100% rename from org.opentosca.planbuilder.type.plugin.dockercontainer/META-INF/resources/php_start.sh rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/resources/php_start.sh diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..a82707fc1 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.dockercontainer/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,14 @@ + + + + Register the beans within the planbuilder dockercontainer type plugin + + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/pom.xml new file mode 100644 index 000000000..ddb05e592 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.type.plugin.hardware + + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + diff --git a/org.opentosca.planbuilder.type.plugin.hardware/src/org/opentosca/planbuilder/type/plugin/hardware/HardwarePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/src/main/java/org/opentosca/planbuilder/type/plugin/hardware/HardwarePlugin.java similarity index 79% rename from org.opentosca.planbuilder.type.plugin.hardware/src/org/opentosca/planbuilder/type/plugin/hardware/HardwarePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/src/main/java/org/opentosca/planbuilder/type/plugin/hardware/HardwarePlugin.java index 2c8b0457c..e3fbe1cae 100644 --- a/org.opentosca.planbuilder.type.plugin.hardware/src/org/opentosca/planbuilder/type/plugin/hardware/HardwarePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/src/main/java/org/opentosca/planbuilder/type/plugin/hardware/HardwarePlugin.java @@ -1,4 +1,3 @@ - package org.opentosca.planbuilder.type.plugin.hardware; import java.util.Collection; @@ -8,12 +7,10 @@ import org.opentosca.container.core.tosca.convention.Utils; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,16 +19,14 @@ *
    * *

    - * This class implements a PlanBuilder Type Plugin for the provisioning of NodeTypes that are - * hardware components such as Sensors and Actuators. + * This class implements a PlanBuilder Type Plugin for the provisioning of NodeTypes that are hardware components such + * as Sensors and Actuators. *

    * - * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class HardwarePlugin implements IPlanBuilderTypePlugin, - IPlanBuilderTypePlugin.NodeDependencyInformationInterface { + IPlanBuilderTypePlugin.NodeDependencyInformationInterface { private final static Logger LOG = LoggerFactory.getLogger(HardwarePlugin.class); @@ -46,7 +41,7 @@ public String getID() { } @Override - public boolean handleCreate(final BPELPlanContext templateContext, AbstractNodeTemplate nodeTemplate) { + public boolean handleCreate(final BPELPlanContext templateContext, AbstractNodeTemplate nodeTemplate) { // available platforms such as Clouds and Devices are not provisioned (as of yet), therefore do // nothing here return this.canHandleCreate(nodeTemplate); @@ -72,7 +67,7 @@ public boolean handleCreate(BPELPlanContext templateContext, AbstractRelationshi @Override public Collection getCreateDependencies(AbstractNodeTemplate nodeTemplate) { Collection deps = this.getDependecies(nodeTemplate); - if (this.isSupportedType(nodeTemplate)) { + if (this.isSupportedType(nodeTemplate) & !deps.isEmpty()) { // if we can support this type we return an empty set for dependencies, because they are already // running return deps; @@ -94,7 +89,7 @@ public Collection getTerminateDependencies(AbstractNodeTem } @Override - public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemplate nodeTemplate) { + public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemplate nodeTemplate) { // handle these running components by doing nothing return this.canHandleTerminate(nodeTemplate); } @@ -119,23 +114,21 @@ public boolean canHandleTerminate(AbstractRelationshipTemplate relationshipTempl @Override public int getPriority() { return 1; - } + } private boolean isSupportedType(AbstractNodeTemplate nodeTemplate) { QName type = nodeTemplate.getType().getId(); - return Utils.isSupportedHardwareNodeType(type) | Utils.isSupportedDeviceNodeType(type); + return Utils.isSupportedHardwareNodeType(type) | Utils.isSupportedDeviceNodeType(type); } - - private Collection getDependecies(AbstractNodeTemplate nodeTemplate){ + + private Collection getDependecies(AbstractNodeTemplate nodeTemplate) { Collection deps = new HashSet(); - // if it is supported hardware is should be connected to some kind of device - for(AbstractRelationshipTemplate rel : nodeTemplate.getIngoingRelations()) { - if(ModelUtils.isCommunicationRelationshipType(rel.getType()) && Utils.isSupportedDeviceNodeType(rel.getSource().getType().getId())) { + // if it is supported hardware is should be connected to some kind of device + for (AbstractRelationshipTemplate rel : nodeTemplate.getIngoingRelations()) { + if (ModelUtils.isCommunicationRelationshipType(rel.getType()) && Utils.isSupportedDeviceNodeType(rel.getSource().getType().getId())) { deps.add(rel.getSource()); } } return deps; } - - } diff --git a/org.opentosca.planbuilder.type.plugin.hardware/META-INF/resources/assignStringVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/src/main/resources/hardware-plugin/assignStringVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.type.plugin.hardware/META-INF/resources/assignStringVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/src/main/resources/hardware-plugin/assignStringVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..9cead96af --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.hardware/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder connectsto type plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/pom.xml new file mode 100644 index 000000000..b38f5c557 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.type.plugin.mosquittoconnectsto + + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + compile + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + compile + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + compile + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + compile + + + + diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/BPELConnectsToTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/BPELConnectsToTypePlugin.java similarity index 89% rename from org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/BPELConnectsToTypePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/BPELConnectsToTypePlugin.java index 9d8f57bf8..ae08f64dc 100644 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/BPELConnectsToTypePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/bpel/BPELConnectsToTypePlugin.java @@ -5,20 +5,17 @@ import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; import org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.bpel.handler.BPELConnectsToPluginHandler; import org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.core.ConnectsToTypePlugin; /** * Copyright 2016 IAAS University of Stuttgart
    *
    - * - * This class implements a PlanBuilder Type Plugin for the RelationshipType MosquittoConnectsTo. The - * plugin looks for a connection of the given RelationshipTemplate with a Moquitto Stack which - * entails a Topic and Mosquitto node. + *

    + * This class implements a PlanBuilder Type Plugin for the RelationshipType MosquittoConnectsTo. The plugin looks for a + * connection of the given RelationshipTemplate with a Moquitto Stack which entails a Topic and Mosquitto node. * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class BPELConnectsToTypePlugin extends ConnectsToTypePlugin { @@ -27,8 +24,7 @@ public class BPELConnectsToTypePlugin extends ConnectsToTypePlugin + *
    + * + * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de + */ +public class BPELConnectsToPluginHandler implements ConnectsToTypePluginHandler { + + private final static Logger LOG = LoggerFactory.getLogger(BPELConnectsToPluginHandler.class); + private final BPELInvokerPlugin invokerPlugin = new BPELInvokerPlugin(); + + private final DocumentBuilderFactory docFactory; + private final DocumentBuilder docBuilder; + + /** + * Constructor + * + * @throws ParserConfigurationException is thrown when initializing the DOM Parsers fails + */ + public BPELConnectsToPluginHandler() throws ParserConfigurationException { + this.docFactory = DocumentBuilderFactory.newInstance(); + this.docFactory.setNamespaceAware(true); + this.docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + } + + @Override + public boolean handle(final BPELPlanContext templateContext) { + final AbstractRelationshipTemplate relationTemplate = templateContext.getRelationshipTemplate(); + + // fetch topic + final Variable topicName = templateContext.getPropertyVariable(relationTemplate.getTarget(), "Name"); + + /* fetch ip of mosquitto */ + Variable mosquittoVmIp = null; + + // find infrastructure nodes of mosquitto + List infrastructureNodes = new ArrayList<>(); + ModelUtils.getInfrastructureNodes(relationTemplate.getTarget(), infrastructureNodes); + + ModelUtils.getNodesFromNodeToSink(relationTemplate.getTarget(), infrastructureNodes); + + for (final AbstractNodeTemplate infraNode : infrastructureNodes) { + + for (final String ipPropName : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineIPPropertyNames()) { + // fetch mosquitto ip + if (templateContext.getPropertyVariable(infraNode, ipPropName) != null) { + mosquittoVmIp = templateContext.getPropertyVariable(infraNode, ipPropName); + break; + } + } + + if (mosquittoVmIp != null) { + break; + } + } + + /* fetch user, key, ip and ubuntuTemplateId of client stack */ + PropertyVariable clientVmIp = null; + PropertyVariable clientVmUser = null; + PropertyVariable clientVmPass = null; + String ubuntuTemplateId = null; + + infrastructureNodes = new ArrayList<>(); + ModelUtils.getInfrastructureNodes(relationTemplate.getSource(), infrastructureNodes); + + for (final AbstractNodeTemplate infraNode : infrastructureNodes) { + + for (final String ipPropName : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineIPPropertyNames()) { + if (templateContext.getPropertyVariable(infraNode, ipPropName) != null) { + clientVmIp = templateContext.getPropertyVariable(infraNode, ipPropName); + break; + } + } + + for (final String loginNameProp : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineLoginUserNamePropertyNames()) { + if (templateContext.getPropertyVariable(infraNode, loginNameProp) != null) { + ubuntuTemplateId = infraNode.getId(); + clientVmUser = templateContext.getPropertyVariable(infraNode, loginNameProp); + } + } + + for (final String loginPwProp : org.opentosca.container.core.tosca.convention.Utils.getSupportedVirtualMachineLoginPasswordPropertyNames()) { + if (templateContext.getPropertyVariable(infraNode, loginPwProp) != null) { + ubuntuTemplateId = infraNode.getId(); + clientVmPass = templateContext.getPropertyVariable(infraNode, loginPwProp); + } + } + } + + /* create skript */ + // the script itself + final String bashCommand = + "echo \"topicName = hostName\" > $(find ~ -maxdepth 1 -path \"*.csar\")/mosquitto_connections.txt;"; + + // add it as a var to the plan + final Variable bashCommandVariable = + templateContext.createGlobalStringVariable("addMosquittoConnection", bashCommand); + + // create bpel query which replaces topicName and hostName with real + // values + final String xpathQuery = "replace(replace($" + bashCommandVariable.getVariableName() + ",'topicName',$" + + topicName.getVariableName() + "),'hostName',$" + mosquittoVmIp.getVariableName() + ")"; + + // create bpel assign with created query + try { + // create assign and append + Node assignNode = loadAssignXpathQueryToStringVarFragmentAsNode("assignValuesToAddConnection" + + System.currentTimeMillis(), xpathQuery, bashCommandVariable.getVariableName()); + assignNode = templateContext.importNode(assignNode); + templateContext.getProvisioningPhaseElement().appendChild(assignNode); + } catch (final IOException e) { + BPELConnectsToPluginHandler.LOG.error("Couldn't load fragment from file", e); + return false; + } catch (final SAXException e) { + BPELConnectsToPluginHandler.LOG.error("Couldn't parse fragment to DOM", e); + return false; + } + + /* add logic to execute script on client machine */ + final Map runScriptRequestInputParams = new HashMap<>(); + + runScriptRequestInputParams.put("VMIP", clientVmIp); + + // these two are requested from the input message if they are not set + if (!PluginUtils.isVariableValueEmpty(clientVmUser)) { + runScriptRequestInputParams.put("VMUserName", clientVmUser); + } else { + runScriptRequestInputParams.put("VMUserName", null); + } + + if (!PluginUtils.isVariableValueEmpty(clientVmPass)) { + runScriptRequestInputParams.put("VMPrivateKey", clientVmPass); + } else { + runScriptRequestInputParams.put("VMPrivateKey", null); + } + + runScriptRequestInputParams.put("Script", bashCommandVariable); + + this.invokerPlugin.handle(templateContext, ubuntuTemplateId, true, "runScript", + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, runScriptRequestInputParams, + new HashMap(), templateContext.getProvisioningPhaseElement()); + + return true; + } + + /** + * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String variable. + * + * @param assignName the name of the BPEL assign + * @param csarEntryXpathQuery the csarEntryPoint XPath query + * @param stringVarName the variable to load the queries results into + * @return a DOM Node representing a BPEL assign element + * @throws IOException is thrown when loading internal bpel fragments fails + * @throws SAXException is thrown when parsing internal format into DOM fails + */ + public Node loadAssignXpathQueryToStringVarFragmentAsNode(final String assignName, final String xpath2Query, + final String stringVarName) throws IOException, + SAXException { + final String templateString = + loadAssignXpathQueryToStringVarFragmentAsString(assignName, xpath2Query, stringVarName); + final InputSource is = new InputSource(); + is.setCharacterStream(new StringReader(templateString)); + final Document doc = this.docBuilder.parse(is); + return doc.getFirstChild(); + } + + /** + * Loads a BPEL Assign fragment which queries the csarEntrypath from the input message into String variable. + * + * @param assignName the name of the BPEL assign + * @param xpath2Query the csarEntryPoint XPath query + * @param stringVarName the variable to load the queries results into + * @return a String containing a BPEL Assign element + * @throws IOException is thrown when reading the BPEL fragment form the resources fails + */ + public String loadAssignXpathQueryToStringVarFragmentAsString(final String assignName, final String xpath2Query, + final String stringVarName) throws IOException { + // + final URL url = getClass().getClassLoader() + .getResource("mosquittoconnectsto-plugin/assignStringVarWithXpath2Query.xml"); + String template = ResourceAccess.readResourceAsString(url); + template = template.replace("{AssignName}", assignName); + template = template.replace("{xpath2query}", xpath2Query); + template = template.replace("{stringVarName}", stringVarName); + return template; + } +} diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePlugin.java similarity index 86% rename from org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePlugin.java index 706ec26e1..27852ecd7 100644 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePlugin.java @@ -1,22 +1,20 @@ package org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.core; import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; /** * Copyright 2016 IAAS University of Stuttgart
    *
    - * - * This class implements a PlanBuilder Type Plugin for the RelationshipType MosquittoConnectsTo. The - * plugin looks for a connection of the given RelationshipTemplate with a Moquitto Stack which - * entails a Topic and Mosquitto node. + *

    + * This class implements a PlanBuilder Type Plugin for the RelationshipType MosquittoConnectsTo. The plugin looks for a + * connection of the given RelationshipTemplate with a Moquitto Stack which entails a Topic and Mosquitto node. * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public abstract class ConnectsToTypePlugin implements IPlanBuilderTypePlugin { private static final String PLUGIN_ID = "OpenTOSCA PlanBuilder Type Plugin Client connects to Mosquitto Broker"; @@ -44,7 +42,7 @@ public boolean canHandleCreate(final AbstractRelationshipTemplate relationshipTe // check the relationshipType if (!relationshipTemplate.getType() - .equals(ConnectsToTypePluginConstants.MOSQUITTO_CONNECTSTO_RELATIONSHIPTYPE)) { + .equals(ConnectsToTypePluginConstants.MOSQUITTO_CONNECTSTO_RELATIONSHIPTYPE)) { return false; } diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePluginConstants.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePluginConstants.java similarity index 96% rename from org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePluginConstants.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePluginConstants.java index fb4157863..9b4bc8eb0 100644 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePluginConstants.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/ConnectsToTypePluginConstants.java @@ -7,7 +7,6 @@ *
    * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public final class ConnectsToTypePluginConstants { @@ -20,5 +19,4 @@ public final class ConnectsToTypePluginConstants { // mosquitto public static final QName TOPIC_NODETYPE = new QName("http://opentosca.org/nodetypes", "Topic"); public static final QName MOSQUITTO_NODETYPE = new QName("http://opentosca.org/nodetypes", "Mosquitto_3.1"); - } diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/handler/ConnectsToTypePluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/handler/ConnectsToTypePluginHandler.java similarity index 80% rename from org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/handler/ConnectsToTypePluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/handler/ConnectsToTypePluginHandler.java index 4f7d5ed93..e909e0f29 100644 --- a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/handler/ConnectsToTypePluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/java/org/opentosca/planbuilder/type/plugin/mosquittoconnectsto/core/handler/ConnectsToTypePluginHandler.java @@ -1,16 +1,14 @@ package org.opentosca.planbuilder.type.plugin.mosquittoconnectsto.core.handler; -import org.opentosca.planbuilder.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; /** * Copyright 2016 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public interface ConnectsToTypePluginHandler { public boolean handle(final T templateContext); - } diff --git a/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/META-INF/resources/assignStringVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/resources/mosquittoconnectsto-plugin/assignStringVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/META-INF/resources/assignStringVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/resources/mosquittoconnectsto-plugin/assignStringVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..78a4c185e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.mosquittoconnectsto/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder connectsto type plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/pom.xml new file mode 100644 index 000000000..6400aa082 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.type.plugin.patternbased + + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + compile + + + + diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/ContainerPatternBasedHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/ContainerPatternBasedHandler.java similarity index 97% rename from org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/ContainerPatternBasedHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/ContainerPatternBasedHandler.java index bb1b2f745..c61fd31c0 100644 --- a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/ContainerPatternBasedHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/ContainerPatternBasedHandler.java @@ -55,7 +55,7 @@ public boolean isProvisionableByContainerPattern(final AbstractNodeTemplate node final Set nodesForMatching = calculateNodesForMatching(nodeTemplate); return hasCompleteMatching(nodesForMatching, getContainerPatternInterface(hostingNode), - getContainerPatternCreateMethod(hostingNode)); + getContainerPatternCreateMethod(hostingNode)); } public boolean isDeprovisionableByContainerPattern(final AbstractNodeTemplate nodeTemplate) { @@ -72,9 +72,8 @@ public boolean isDeprovisionableByContainerPattern(final AbstractNodeTemplate no final Set nodesForMatching = calculateNodesForMatching(nodeTemplate); return hasCompleteMatching(nodesForMatching, getContainerPatternInterface(hostingNode), - getContainerPatternTerminateMethod(hostingNode)); + getContainerPatternTerminateMethod(hostingNode)); } - private boolean hasContainerPatternCreateMethod(final AbstractNodeTemplate nodeTemplate) { return Objects.nonNull(getContainerPatternCreateMethod(nodeTemplate)); @@ -121,7 +120,7 @@ protected AbstractOperation getContainerPatternCreateMethod(final AbstractNodeTe } } } - // possible backwards compatibility through interfaces/operations of Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER and Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE + // possible backwards compatibility through interfaces/operations of Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER and Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE } return null; } diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/LifecyclePatternBasedHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/LifecyclePatternBasedHandler.java similarity index 94% rename from org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/LifecyclePatternBasedHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/LifecyclePatternBasedHandler.java index 215588eb7..1e8655a8c 100644 --- a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/LifecyclePatternBasedHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/LifecyclePatternBasedHandler.java @@ -23,24 +23,23 @@ public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTem Set nodesForMatching = this.getNodesForMatching(nodeTemplate); nodesForMatching = this.filterForNodesInCreation(context, nodesForMatching); - AbstractOperation op = null; boolean result = true; if (((op = this.getLifecyclePatternInstallMethod(nodeTemplate)) != null) && hasCompleteMatching(nodesForMatching, iface, op)) { - result &= invokeWithMatching(context, nodeTemplate, iface, op, nodesForMatching,elementToAppendTo); + result &= invokeWithMatching(context, nodeTemplate, iface, op, nodesForMatching, elementToAppendTo); } if (((op = this.getLifecyclePatternConfigureMethod(nodeTemplate)) != null) && hasCompleteMatching(nodesForMatching, iface, op)) { - result &= invokeWithMatching(context, nodeTemplate, iface, op, nodesForMatching,elementToAppendTo); + result &= invokeWithMatching(context, nodeTemplate, iface, op, nodesForMatching, elementToAppendTo); } if (((op = this.getLifecyclePatternStartMethod(nodeTemplate)) != null) && hasCompleteMatching(nodesForMatching, iface, op)) { - result &= invokeWithMatching(context, nodeTemplate, iface, op, nodesForMatching,elementToAppendTo); + result &= invokeWithMatching(context, nodeTemplate, iface, op, nodesForMatching, elementToAppendTo); } return result; @@ -68,7 +67,6 @@ && hasCompleteMatching(nodesForMatching, iface, op)) { return result; } - private boolean isImplementedAsScript(AbstractInterface iface, AbstractOperation op, AbstractNodeTemplate nodeTemplate) { for (AbstractNodeTypeImplementation impl : nodeTemplate.getImplementations()) { @@ -115,17 +113,17 @@ private Set getNodesForMatching(AbstractNodeTemplate nodeT ModelUtils.getNodesFromNodeToSink(nodeTemplate, Types.hostedOnRelationType, nodesForMatching); return nodesForMatching; } - + private Set filterForNodesInCreation(BPELPlanContext context, Set nodes) { Set result = new HashSet(); Collection nodesInCreation = context.getNodesInCreation(); - - for(AbstractNodeTemplate node : nodes) { - if(nodesInCreation.contains(node)) { + + for (AbstractNodeTemplate node : nodes) { + if (nodesInCreation.contains(node)) { result.add(node); } } - + return result; } @@ -274,13 +272,13 @@ private boolean hasLifecycleProvisioningMethods(AbstractNodeTemplate nodeTemplat } protected AbstractInterface getLifecyclePatternInterface(final AbstractNodeTemplate nodeTemplate) { - for (final AbstractInterface iface : nodeTemplate.getType().getInterfaces()) { - switch(iface.getName()) { + for (final AbstractInterface iface : nodeTemplate.getType().getInterfaces()) { + switch (iface.getName()) { case Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE: case Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE2: case Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE3: - return iface; - } + return iface; + } } return null; } @@ -291,12 +289,12 @@ protected AbstractOperation getLifecyclePatternStartMethod(final AbstractNodeTem protected AbstractOperation getLifecyclePatternInstallMethod(final AbstractNodeTemplate nodeTemplate) { return this.getLifecyclePatternMethod(nodeTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_INSTALL); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_INSTALL); } protected AbstractOperation getLifecyclePatternConfigureMethod(final AbstractNodeTemplate nodeTemplate) { return this.getLifecyclePatternMethod(nodeTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_CONFIGURE); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_CONFIGURE); } protected AbstractOperation getLifecyclePatternStopMethod(final AbstractNodeTemplate nodeTemplate) { @@ -305,7 +303,7 @@ protected AbstractOperation getLifecyclePatternStopMethod(final AbstractNodeTemp protected AbstractOperation getLifecyclePatternUninstallMethod(final AbstractNodeTemplate nodeTemplate) { return this.getLifecyclePatternMethod(nodeTemplate, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_UNINSTALL); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_LIFECYCLE_UNINSTALL); } private AbstractOperation getLifecyclePatternMethod(AbstractNodeTemplate nodeTemplate, String lifecycleMethod) { diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedHandler.java similarity index 94% rename from org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedHandler.java index 42d35bbe4..59248fc8f 100644 --- a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedHandler.java @@ -7,14 +7,13 @@ import java.util.Set; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.Variable; import org.opentosca.planbuilder.model.tosca.AbstractInterface; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractParameter; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Variable; import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; import org.w3c.dom.Element; @@ -62,8 +61,8 @@ protected boolean invokeOperation(final BPELPlanContext context, final ConcreteO final AbstractNodeTemplate hostingContainer, Element elementToAppendTo) { return invoker.handle(context, hostingContainer.getId(), true, matching.operationName.getName(), - matching.interfaceName.getName(), transformForInvoker(matching.inputMatching), - transformForInvoker(matching.outputMatching), elementToAppendTo); + matching.interfaceName.getName(), transformForInvoker(matching.inputMatching), + transformForInvoker(matching.outputMatching), elementToAppendTo); } private Map transformForInvoker(final Map map) { @@ -105,8 +104,6 @@ protected ConcreteOperationMatching createConcreteOperationMatching(final PlanCo } } - - for (final AbstractParameter param : abstractMatching.outputMatching.keySet()) { boolean added = false; for (final AbstractNodeTemplate nodeForMatch : matching.matchedNodes) { diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedPlugin.java similarity index 83% rename from org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedPlugin.java index b1b42fbe3..4e7e44c8c 100644 --- a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/PatternBasedPlugin.java @@ -1,4 +1,3 @@ - package org.opentosca.planbuilder.type.plugin.patternbased.bpel; import java.util.Collection; @@ -7,12 +6,10 @@ import java.util.Map; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractOperation; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,16 +18,14 @@ *
    * *

    - * This class implements a PlanBuilder Type Plugin for the provisioning of NodeType that are modeled - * based on provisioning patterns. + * This class implements a PlanBuilder Type Plugin for the provisioning of NodeType that are modeled based on + * provisioning patterns. *

    * - * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class PatternBasedPlugin implements IPlanBuilderTypePlugin, - IPlanBuilderTypePlugin.NodeDependencyInformationInterface { + IPlanBuilderTypePlugin.NodeDependencyInformationInterface { private final static Logger LOG = LoggerFactory.getLogger(PatternBasedPlugin.class); @@ -39,7 +34,7 @@ public class PatternBasedPlugin implements IPlanBuilderTypePlugin getCreateDependencies(AbstractNodeTempla deps.addAll(lifecyclePatternHandler.getMatchedNodesForProvisioning(nodeTemplate)); LOG.debug("Adding matched nodes to handle by lifecycle pattern"); return deps; - } else if(remoteMgrHandler.isProvisionableByRemoteManagerPattern(nodeTemplate)) { + } else if (remoteMgrHandler.isProvisionableByRemoteManagerPattern(nodeTemplate)) { deps.addAll(remoteMgrHandler.getNodeDependencies(nodeTemplate)); return deps; } else { @@ -224,7 +217,7 @@ public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemp AbstractOperation terminateOp = null; check &= containerPatternHandler.handleTerminate(templateContext, nodeTemplate, - templateContext.getProvisioningPhaseElement()); + templateContext.getProvisioningPhaseElement()); terminateOp = containerPatternHandler.getContainerPatternTerminateMethod(nodeTemplate); usedOps.put(terminateOp, null); @@ -232,15 +225,14 @@ public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemp LOG.debug("Adding container pattern compensation logic"); check &= containerPatternHandler.handleCreate(templateContext, nodeTemplate, - templateContext.getProvisioningCompensationPhaseElement()); + templateContext.getProvisioningCompensationPhaseElement()); createOp = containerPatternHandler.getContainerPatternCreateMethod(nodeTemplate); usedOps.put(terminateOp, createOp); } - } else if (lifecyclePatternHandler.isDeprovisionableByLifecyclePattern(nodeTemplate)) { LOG.debug("Handling by lifecycle pattern"); check &= lifecyclePatternHandler.handleTerminate(templateContext, nodeTemplate, - templateContext.getProvisioningPhaseElement()); + templateContext.getProvisioningPhaseElement()); AbstractOperation installOp = null; AbstractOperation configureOp = null; @@ -263,7 +255,7 @@ public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemp LOG.debug("Adding lifecycle pattern compensation logic"); check &= lifecyclePatternHandler.handleCreate(templateContext, nodeTemplate, - templateContext.getProvisioningCompensationPhaseElement()); + templateContext.getProvisioningCompensationPhaseElement()); installOp = lifecyclePatternHandler.getLifecyclePatternInstallMethod(nodeTemplate); configureOp = lifecyclePatternHandler.getLifecyclePatternConfigureMethod(nodeTemplate); @@ -281,25 +273,24 @@ public boolean handleTerminate(BPELPlanContext templateContext, AbstractNodeTemp } } else if (remoteManagerPatternHandler.isDeprovisionableByRemoteManagerPattern(nodeTemplate)) { check &= remoteManagerPatternHandler.handleTerminate(templateContext, nodeTemplate, - templateContext.getProvisioningPhaseElement()); + templateContext.getProvisioningPhaseElement()); AbstractOperation installOp = null; AbstractOperation resetOp = null; resetOp = remoteManagerPatternHandler.getRemoteManagerPatternResetMethod(nodeTemplate); - installOp = remoteManagerPatternHandler.getRemoteManagerPatternInstallMethod(nodeTemplate); + installOp = remoteManagerPatternHandler.getRemoteManagerPatternInstallMethod(nodeTemplate); if (remoteManagerPatternHandler.isProvisionableByRemoteManagerPattern(nodeTemplate)) { LOG.debug("Adding compensation logic for remote manager pattern"); check &= remoteManagerPatternHandler.handleCreate(templateContext, nodeTemplate, - templateContext.getProvisioningCompensationPhaseElement()); + templateContext.getProvisioningCompensationPhaseElement()); if (installOp != null & resetOp != null) { usedOps.put(resetOp, installOp); } } - } else { return false; } @@ -345,5 +336,4 @@ public boolean canHandleTerminate(AbstractRelationshipTemplate relationshipTempl public int getPriority() { return 1; } - } diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/RemoteManagerPatternBasedHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/RemoteManagerPatternBasedHandler.java similarity index 77% rename from org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/RemoteManagerPatternBasedHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/RemoteManagerPatternBasedHandler.java index cf030664a..95daf7faa 100644 --- a/org.opentosca.planbuilder.type.plugin.patternbased/src/org/opentosca/planbuilder/type/plugin/patternbased/bpel/RemoteManagerPatternBasedHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/java/org/opentosca/planbuilder/type/plugin/patternbased/bpel/RemoteManagerPatternBasedHandler.java @@ -2,7 +2,6 @@ import java.util.Collection; import java.util.HashSet; -import java.util.Objects; import java.util.Set; import org.opentosca.container.core.tosca.convention.Types; @@ -16,7 +15,7 @@ public class RemoteManagerPatternBasedHandler extends PatternBasedHandler { - public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, Element elementToAppendTo) { + public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate, Element elementToAppendTo) { final AbstractInterface iface = getRemoteManagerInterface(nodeTemplate); final AbstractOperation createOperation = getRemoteManagerInstallOperation(nodeTemplate); @@ -25,84 +24,83 @@ public boolean handleCreate(final BPELPlanContext context, final AbstractNodeTem return invokeWithMatching(context, nodeTemplate, iface, createOperation, nodesForMatching, elementToAppendTo); } - + public boolean isProvisionableByRemoteManagerPattern(AbstractNodeTemplate node) { - - if(this.getRemoteManagerInstallOperation(node) == null) { + + if (this.getRemoteManagerInstallOperation(node) == null) { return false; } - - if(this.getRemoteManagerNode(node) == null) { + + if (this.getRemoteManagerNode(node) == null) { return false; } - - + return true; } - + public Set getNodeDependencies(AbstractNodeTemplate nodeTemplate) { return this.calculateNodesForMatching(nodeTemplate); } - + private Set calculateNodesForMatching(final AbstractNodeTemplate nodeTemplate) { final Set nodesForMatching = new HashSet<>(); nodesForMatching.add(nodeTemplate); AbstractNodeTemplate mngrNode = getRemoteManagerNode(nodeTemplate); - - for(AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()){ + + for (AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { nodesForMatching.add(relation.getTarget()); } - + nodesForMatching.add(mngrNode); return nodesForMatching; } - + private AbstractNodeTemplate getRemoteManagerNode(AbstractNodeTemplate node) { - - for(AbstractRelationshipTemplate relation : node.getOutgoingRelations()) { - if(relation.getType().equals(Types.dependsOnRelationType)){ + + for (AbstractRelationshipTemplate relation : node.getOutgoingRelations()) { + if (relation.getType().equals(Types.dependsOnRelationType)) { AbstractNodeTemplate remoteMngrNode = relation.getTarget(); - if(Utils.isSupportedOSNodeType(remoteMngrNode.getType().getId())) { + if (Utils.isSupportedOSNodeType(remoteMngrNode.getType().getId())) { return remoteMngrNode; } } } - + return null; } - - private AbstractOperation getRemoteManagerInstallOperation(AbstractNodeTemplate node) { - AbstractInterface iface = this.getRemoteManagerInterface(node); - if(iface != null) { - for(AbstractOperation op : iface.getOperations()) { - if(op.getName().equals("install")) { + + private AbstractOperation getRemoteManagerInstallOperation(AbstractNodeTemplate node) { + AbstractInterface iface = this.getRemoteManagerInterface(node); + if (iface != null) { + for (AbstractOperation op : iface.getOperations()) { + if (op.getName().equals("install")) { return op; } } - } + } return null; } - + private AbstractOperation getRemoteManagerResetOperation(AbstractNodeTemplate node) { - AbstractInterface iface = this.getRemoteManagerInterface(node); - if(iface != null) { - for(AbstractOperation op : iface.getOperations()) { - if(op.getName().equals("reset")) { + AbstractInterface iface = this.getRemoteManagerInterface(node); + if (iface != null) { + for (AbstractOperation op : iface.getOperations()) { + if (op.getName().equals("reset")) { return op; } } - } + } return null; } - - private AbstractInterface getRemoteManagerInterface(AbstractNodeTemplate node) { - for(AbstractInterface iface : node.getType().getInterfaces()) { - if( iface.getName().equals("http://opentosca.org/interfaces/pattern/remotemanager")) { + + private AbstractInterface getRemoteManagerInterface(AbstractNodeTemplate node) { + for (AbstractInterface iface : node.getType().getInterfaces()) { + if (iface.getName().equals("http://opentosca.org/interfaces/pattern/remotemanager")) { return iface; } - } + } return null; } diff --git a/org.opentosca.planbuilder.type.plugin.patternbased/META-INF/resources/assignStringVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/resources/patternbased-plugin/assignStringVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.type.plugin.patternbased/META-INF/resources/assignStringVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/resources/patternbased-plugin/assignStringVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..510952d16 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.patternbased/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder connectsto type plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/pom.xml new file mode 100644 index 000000000..f9d2036ca --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.type.plugin.platforms + + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core.bpel + ${project.version} + + + diff --git a/org.opentosca.planbuilder.type.plugin.platforms/src/org/opentosca/planbuilder/type/plugin/platforms/PlatformPlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/src/main/java/org/opentosca/planbuilder/type/plugin/platforms/PlatformPlugin.java similarity index 86% rename from org.opentosca.planbuilder.type.plugin.platforms/src/org/opentosca/planbuilder/type/plugin/platforms/PlatformPlugin.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/src/main/java/org/opentosca/planbuilder/type/plugin/platforms/PlatformPlugin.java index 7d45970a0..6d21cedf0 100644 --- a/org.opentosca.planbuilder.type.plugin.platforms/src/org/opentosca/planbuilder/type/plugin/platforms/PlatformPlugin.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/src/main/java/org/opentosca/planbuilder/type/plugin/platforms/PlatformPlugin.java @@ -1,4 +1,3 @@ - package org.opentosca.planbuilder.type.plugin.platforms; import java.util.Collection; @@ -8,12 +7,9 @@ import org.opentosca.container.core.tosca.convention.Utils; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,16 +18,14 @@ *
    * *

    - * This class implements a PlanBuilder Type Plugin for the provisioning of NodeTypes that are - * platform components such as Clouds (OpenStack, AWS,..) or Devices (Raspberry Pi,..). + * This class implements a PlanBuilder Type Plugin for the provisioning of NodeTypes that are platform components such + * as Clouds (OpenStack, AWS,..) or Devices (Raspberry Pi,..). *

    * - * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class PlatformPlugin implements IPlanBuilderTypePlugin, - IPlanBuilderTypePlugin.NodeDependencyInformationInterface { + IPlanBuilderTypePlugin.NodeDependencyInformationInterface { private final static Logger LOG = LoggerFactory.getLogger(PlatformPlugin.class); @@ -129,6 +123,4 @@ private boolean isSupportedType(AbstractNodeTemplate nodeTemplate) { QName type = nodeTemplate.getType().getId(); return Utils.isSupportedCloudProviderNodeType(type) || Utils.isSupportedOSNodeType(type) || Utils.isSupportedDeviceNodeType(type); } - - } diff --git a/org.opentosca.planbuilder.type.plugin.platforms/META-INF/resources/assignStringVarWithXpath2Query.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/src/main/resources/platforms-plugin/assignStringVarWithXpath2Query.xml similarity index 100% rename from org.opentosca.planbuilder.type.plugin.platforms/META-INF/resources/assignStringVarWithXpath2Query.xml rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/src/main/resources/platforms-plugin/assignStringVarWithXpath2Query.xml diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..ca6f6606c --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.platforms/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder connectsto type plugin + + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/pom.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/pom.xml new file mode 100644 index 000000000..f33fc9743 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + + org.opentosca + org.opentosca.planbuilder + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder.type.plugin.ubuntuvm + + + + org.opentosca + org.opentosca.container.core.tosca + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.model + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.provphase.plugin.invoker + ${project.version} + + + org.opentosca + org.opentosca.planbuilder.core + ${project.version} + + + diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePlugin.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePlugin.java new file mode 100644 index 000000000..4648f1225 --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePlugin.java @@ -0,0 +1,353 @@ +package org.opentosca.planbuilder.type.plugin.ubuntuvm.bpel; + +import javax.xml.namespace.QName; + +import org.opentosca.container.core.tosca.convention.Types; +import org.opentosca.container.core.tosca.convention.Utils; +import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderPolicyAwareTypePlugin; +import org.opentosca.planbuilder.core.plugins.typebased.IPlanBuilderTypePlugin; +import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; +import org.opentosca.planbuilder.model.tosca.AbstractPolicy; +import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + *

    + * This class represents a generic plugin containing bpel logic to start a virtual machine instance with the OpenTOSCA + * Container Invoker Service + *

    + * Copyright 2016 IAAS University of Stuttgart
    + *
    + * + * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de + */ +public class BPELUbuntuVmTypePlugin implements IPlanBuilderTypePlugin, + IPlanBuilderPolicyAwareTypePlugin { + public static final QName noPublicAccessPolicyType = new QName("http://opentosca.org/policytypes", + "NoPublicAccessPolicy"); + public static final QName publicAccessPolicyType = new QName("http://opentosca.org/policytypes", + "PublicAccessPolicy"); + public static final QName onlyModeledPortsPolicyType = new QName("http://opentosca.org/policytypes", + "OnlyModeledPortsPolicyType"); + + private static final Logger LOG = LoggerFactory.getLogger(BPELUbuntuVmTypePlugin.class); + private static final String PLUGIN_ID = "OpenTOSCA PlanBuilder VM and Cloud Provider Declarative Type Plugin"; + + private final BPELUbuntuVmTypePluginHandler handler = new BPELUbuntuVmTypePluginHandler(); + + /** + * {@inheritDoc} + */ + @Override + public boolean canHandleCreate(final AbstractNodeTemplate nodeTemplate) { + return allDependenciesAreMet(nodeTemplate); + } + + @Override + public boolean canHandleTerminate(final AbstractNodeTemplate nodeTemplate) { + return allDependenciesAreMet(nodeTemplate); + } + + private boolean allDependenciesAreMet(final AbstractNodeTemplate nodeTemplate) { + if (nodeTemplate == null) { + BPELUbuntuVmTypePlugin.LOG.debug("NodeTemplate is null"); + return false; + } + if (nodeTemplate.getType() == null) { + BPELUbuntuVmTypePlugin.LOG.debug("NodeTemplate NodeType is null. NodeTemplate Id:" + nodeTemplate.getId()); + return false; + } + if (nodeTemplate.getType().getId() == null) { + BPELUbuntuVmTypePlugin.LOG.debug("NodeTemplate NodeType id is null"); + return false; + } + // this plugin can handle all referenced nodeTypes + if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) { + return true; + } else if (Utils.isSupportedVMNodeType(nodeTemplate.getType().getId())) { + // checking if this vmNode is connected to a nodeTemplate of Type + // cloud provider (ec2, openstack) or docker engine, if not this + // plugin can't handle + // this node + for (final AbstractRelationshipTemplate relationshipTemplate : nodeTemplate.getOutgoingRelations()) { + if (Utils.isSupportedCloudProviderNodeType(relationshipTemplate.getTarget().getType().getId()) + | Utils.isSupportedDockerEngineNodeType(relationshipTemplate.getTarget().getType().getId())) { + return true; + } + } + return false; + } else if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) { + // checking whether this GENERIC ubuntu NodeTemplate is connected to + // a VM + // Node, after this checking whether the VM Node is connected to a + // EC2 Node + + // check for generic UbuntuNodeType + if (nodeTemplate.getType().getId().equals(Types.ubuntuNodeType)) { + // here we check for a 3 node stack ubuntu -> vm -> cloud + // provider(ec2,openstack) + return checkIfConnectedToVMandCloudProvider(nodeTemplate); + } else { + + // here we assume that a specific ubuntu image is selected as + // the nodeType e.g. ubuntu13.10server NodeType + // so we check only for a cloud provider + return checkIfConnectedToCloudProvider(nodeTemplate); + } + } else { + return false; + } + } + + /* + * (non-Javadoc) + * + * @see org.opentosca.planbuilder.core.plugins.IPlanBuilderPolicyAwareTypePlugin# + * canHandlePolicyAware(org.opentosca.planbuilder.model.tosca. AbstractNodeTemplate) + */ + @Override + public boolean canHandlePolicyAwareCreate(final AbstractNodeTemplate nodeTemplate) { + boolean canHandle = this.canHandleCreate(nodeTemplate); + + for (final AbstractPolicy policy : nodeTemplate.getPolicies()) { + if (policy.getType().getId().equals(this.noPublicAccessPolicyType) + | policy.getType().getId().equals(this.publicAccessPolicyType)) { + if (policy.getProperties() != null + && policy.getProperties().getDOMElement().getLocalName().equals("SecurityGroup")) { + canHandle &= true; + } + } else if (policy.getType().getId().equals(this.onlyModeledPortsPolicyType)) { + canHandle &= true; + } else { + // ALL policies must be supported + canHandle &= false; + } + } + + return canHandle; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean canHandleCreate(final AbstractRelationshipTemplate relationshipTemplate) { + // this plugin doesn't handle relations + return false; + } + + @Override + public boolean canHandleTerminate(final AbstractRelationshipTemplate relationshipTemplate) { + // never handles a relationship + return false; + } + + /** + *

    + * Checks whether the given NodeTemplate is connected to another node of some Cloud Provider NodeType + *

    + * + * @param nodeTemplate any AbstractNodeTemplate + * @return true iff connected to Cloud Provider Node + */ + private boolean checkIfConnectedToCloudProvider(final AbstractNodeTemplate nodeTemplate) { + for (final AbstractRelationshipTemplate relationshipTemplate : nodeTemplate.getOutgoingRelations()) { + if (Utils.isSupportedCloudProviderNodeType(relationshipTemplate.getTarget().getType().getId())) { + return true; + } + } + return false; + } + + /** + *

    + * Checks whether there is a path from the given NodeTemplate of length 3 with the following nodes:
    The + * NodeTemplate itself
    A NodeTemplate of type {http://opentosca.org/types/declarative}VM
    A NodeTemplate of + * type {http://opentosca.org/types/declarative}EC2 or OpenStack + *

    + * + * @param nodeTemplate any AbstractNodeTemplate + * @return true if the there exists a path from the given NodeTemplate to a Cloud Provider node, else false + */ + private boolean checkIfConnectedToVMandCloudProvider(final AbstractNodeTemplate nodeTemplate) { + for (final AbstractRelationshipTemplate relationshipTemplate : nodeTemplate.getOutgoingRelations()) { + if (relationshipTemplate.getTarget().getType().getId().equals(Types.vmNodeType)) { + if (checkIfConnectedToCloudProvider(relationshipTemplate.getTarget())) { + return true; + } + } + } + return false; + } + + @Override + public String getID() { + return BPELUbuntuVmTypePlugin.PLUGIN_ID; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean handleCreate(final BPELPlanContext templateContext, final AbstractNodeTemplate nodeTemplate) { + BPELUbuntuVmTypePlugin.LOG.debug("Checking if nodeTemplate " + nodeTemplate.getId() + " can be handled"); + + // cloudprovider node is handled by doing nothing + if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) { + return true; + } + + // docker engine node is handled by doing nothing + if (Utils.isSupportedDockerEngineNodeType(nodeTemplate.getType().getId())) { + return true; + } + + // when infrastructure node arrives start handling + if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) { + // check if this node is connected to a cloud provider node type, if + // true -> append code + for (final AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { + if (Utils.isSupportedCloudProviderNodeType(relation.getTarget().getType().getId())) { + final QName nodeType = relation.getTarget().getType().getId(); + if (nodeType.equals(Types.openStackLiberty12NodeType) + || nodeType.equals(Types.openStackTrainNodeType) + || nodeType.equals(Types.vmWareVsphere55NodeType) + || nodeType.equals(Types.amazonEc2NodeType) + || nodeType.getNamespaceURI() + .equals(Types.openStackLiberty12NodeTypeGenerated.getNamespaceURI()) + && (nodeType.getLocalPart() + .startsWith(Types.openStackLiberty12NodeTypeGenerated.getLocalPart()) + || nodeType.getLocalPart().startsWith(Types.openStackTrainNodeType.getLocalPart()))) { + // bit hacky now, but until the nodeType cleanup is + // finished this should be enough right now + return this.handler.handleCreateWithCloudProviderInterface(templateContext, nodeTemplate); + } else if (relation.getTarget().getType().getId().equals(Types.localHypervisor)) { + return this.handler.handleWithLocalCloudProviderInterface(templateContext, nodeTemplate); + } else { + return this.handler.handle(templateContext, nodeTemplate); + } + } + } + return true; + } + return false; + } + + @Override + public boolean handlePolicyAwareCreate(final BPELPlanContext templateContext) { + final AbstractNodeTemplate nodeTemplate = templateContext.getNodeTemplate(); + if (nodeTemplate == null) { + return false; + } + + BPELUbuntuVmTypePlugin.LOG.debug("Checking if nodeTemplate " + nodeTemplate.getId() + " can be handled"); + + // cloudprovider node is handled by doing nothing + if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) { + return true; + } + + // docker engine node is handled by doing nothing + if (Utils.isSupportedDockerEngineNodeType(nodeTemplate.getType().getId())) { + return true; + } + + // when infrastructure node arrives start handling + if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) { + // check if this node is connected to a cloud provider node type, if + // true -> append code + for (final AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { + if (Utils.isSupportedCloudProviderNodeType(relation.getTarget().getType().getId())) { + final QName nodeType = relation.getTarget().getType().getId(); + if (nodeType.equals(Types.openStackLiberty12NodeType) + || nodeType.equals(Types.openStackTrainNodeType) + || nodeType.equals(Types.vmWareVsphere55NodeType) + || nodeType.equals(Types.amazonEc2NodeType) + || nodeType.getNamespaceURI() + .equals(Types.openStackLiberty12NodeTypeGenerated.getNamespaceURI()) + && (nodeType.getLocalPart() + .startsWith(Types.openStackLiberty12NodeTypeGenerated.getLocalPart()) + || nodeType.getLocalPart().startsWith(Types.openStackTrainNodeType.getLocalPart()))) { + // bit hacky now, but until the nodeType cleanup is + // finished this should be enough right now + return this.handler.handleCreateWithCloudProviderInterface(templateContext, nodeTemplate); + } else if (relation.getTarget().getType().getId().equals(Types.localHypervisor)) { + return this.handler.handleWithLocalCloudProviderInterface(templateContext, nodeTemplate); + } else { + return this.handler.handle(templateContext, nodeTemplate); + } + } + } + return true; + } + return false; + } + + @Override + public boolean handleTerminate(final BPELPlanContext templateContext, final AbstractNodeTemplate nodeTemplate) { + BPELUbuntuVmTypePlugin.LOG.debug("Checking if nodeTemplate " + nodeTemplate.getId() + " can be handled"); + + // cloudprovider node is handled by doing nothing + if (Utils.isSupportedCloudProviderNodeType(nodeTemplate.getType().getId())) { + return true; + } + + // docker engine node is handled by doing nothing + if (Utils.isSupportedDockerEngineNodeType(nodeTemplate.getType().getId())) { + return true; + } + + // when infrastructure node arrives start handling + if (Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType().getId())) { + // check if this node is connected to a cloud provider node type, if + // true -> append code + for (final AbstractRelationshipTemplate relation : nodeTemplate.getOutgoingRelations()) { + if (Utils.isSupportedCloudProviderNodeType(relation.getTarget().getType().getId())) { + final QName nodeType = relation.getTarget().getType().getId(); + if (nodeType.equals(Types.openStackLiberty12NodeType) + || nodeType.equals(Types.openStackTrainNodeType) + || nodeType.equals(Types.vmWareVsphere55NodeType) + || nodeType.equals(Types.amazonEc2NodeType) + || nodeType.getNamespaceURI() + .equals(Types.openStackLiberty12NodeTypeGenerated.getNamespaceURI()) + && (nodeType.getLocalPart() + .startsWith(Types.openStackLiberty12NodeTypeGenerated.getLocalPart()) + || nodeType.getLocalPart().startsWith(Types.openStackTrainNodeType.getLocalPart()))) { + // bit hacky now, but until the nodeType cleanup is + // finished this should be enough right now + return this.handler.handleTerminateWithCloudProviderInterface(templateContext, nodeTemplate, + templateContext.getProvisioningPhaseElement()); + } else if (relation.getTarget().getType().getId().equals(Types.localHypervisor)) { + return this.handler.handleWithLocalCloudProviderInterface(templateContext, nodeTemplate); + } else { + return this.handler.handle(templateContext, nodeTemplate); + } + } + } + return true; + } + return false; + } + + @Override + public boolean handleCreate(final BPELPlanContext templateContext, + final AbstractRelationshipTemplate relationshipTemplate) { + // never handles a relationship + return false; + } + + @Override + public boolean handleTerminate(final BPELPlanContext templateContext, + final AbstractRelationshipTemplate relationshipTemplate) { + // never handles a relationship + return false; + } + + @Override + public int getPriority() { + // + return 0; + } +} diff --git a/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePluginHandler.java similarity index 87% rename from org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePluginHandler.java index 5d3222122..b4134e4f9 100644 --- a/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/BPELUbuntuVmTypePluginHandler.java @@ -15,15 +15,14 @@ import org.opentosca.container.core.tosca.convention.Types; import org.opentosca.planbuilder.core.bpel.context.BPELPlanContext; import org.opentosca.planbuilder.core.bpel.fragments.BPELProcessFragments; -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; +import org.opentosca.planbuilder.core.plugins.context.PropertyVariable; +import org.opentosca.planbuilder.core.plugins.context.Variable; +import org.opentosca.planbuilder.core.plugins.utils.PluginUtils; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; import org.opentosca.planbuilder.model.tosca.AbstractPolicy; import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; import org.opentosca.planbuilder.model.utils.ModelUtils; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.PropertyVariable; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.opentosca.planbuilder.plugins.utils.PluginUtils; import org.opentosca.planbuilder.provphase.plugin.invoker.bpel.BPELInvokerPlugin; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; @@ -33,15 +32,13 @@ /** *

    * This class implements the logic to provision an EC2VM Stack, consisting of the NodeTypes - * {http://www.example.com/tosca/ServiceTemplates/EC2VM}EC2, - * {http://www.example.com/tosca/ServiceTemplates/EC2VM}VM, + * {http://www.example.com/tosca/ServiceTemplates/EC2VM}EC2, {http://www.example.com/tosca/ServiceTemplates/EC2VM}VM, * {http://www.example.com/tosca/ServiceTemplates/EC2VM}Ubuntu. *

    * Copyright 2016 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public class BPELUbuntuVmTypePluginHandler implements UbuntuVmTypePluginHandler { @@ -61,7 +58,7 @@ public class BPELUbuntuVmTypePluginHandler implements UbuntuVmTypePluginHandler< // new possible external params private final static String[] createVMInstanceExternalInputParams = {"VMKeyPairName", "HypervisorUserPassword", "HypervisorUserName", "HypervisorEndpoint", "VMImageID", "VMType", - "HypervisorTenantID", "VMUserPassword", "VMPublicKey", "VMKeyPairName"}; + "HypervisorTenantID", "VMUserPassword", "VMPublicKey", "VMKeyPairName"}; // mandatory params for the local hypervisor node private final static String[] localCreateVMInstanceExternalInputParams = @@ -73,8 +70,7 @@ public class BPELUbuntuVmTypePluginHandler implements UbuntuVmTypePluginHandler< * Creates a string representing an ubuntu image id on a cloud provider * * @param nodeType a QName of an Ubuntu ImplicitImage NodeType - * @return a String containing an ubuntuImageId, if given QName is not presenting an Ubuntu image - * then null + * @return a String containing an ubuntuImageId, if given QName is not presenting an Ubuntu image then null */ private String createUbuntuImageStringFromNodeType(final QName nodeType) { if (!org.opentosca.container.core.tosca.convention.Utils.isSupportedInfrastructureNodeType(nodeType)) { @@ -89,9 +85,9 @@ private String createUbuntuImageStringFromNodeType(final QName nodeType) { return "ubuntu-16.04"; } else if (nodeType.equals(Types.ubuntu1804ServerVmNodeType) || nodeType.getNamespaceURI().equals(Types.ubuntu1804ServerVmNodeTypeGenerated.getNamespaceURI()) - && nodeType.getLocalPart().startsWith(Types.ubuntu1804ServerVmNodeTypeGenerated.getLocalPart())) { - return "ubuntu-18.04"; - } + && nodeType.getLocalPart().startsWith(Types.ubuntu1804ServerVmNodeTypeGenerated.getLocalPart())) { + return "ubuntu-18.04"; + } final String localName = nodeType.getLocalPart(); @@ -115,8 +111,7 @@ private String createUbuntuImageStringFromNodeType(final QName nodeType) { int majorVers; try { majorVers = Integer.parseInt(leftDashSplit[1]); - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return null; } @@ -130,17 +125,13 @@ private String createUbuntuImageStringFromNodeType(final QName nodeType) { minorVers = Integer.parseInt(rightDashSplit[0]); minorVersString = String.valueOf(minorVers).trim(); - // TODO: this quick fix handles issues when minorVersion becomes a - // single digit and the amiID string will be e.g. 14.4 instead of - // 14.04 - // Maybe fix this by using some external resource for correct image - // versions + // TODO: this quick fix handles issues when minorVersion becomes a single digit and the + // amiID string will be e.g. 14.4 instead of 14.04 + // Maybe fix this by using some external resource for correct image versions if (minorVersString.length() != 2) { minorVersString = "0" + minorVersString; } - - } - catch (final NumberFormatException e) { + } catch (final NumberFormatException e) { return null; } @@ -160,7 +151,7 @@ private AbstractNodeTemplate findCloudProviderNode(final AbstractNodeTemplate no for (final AbstractNodeTemplate node : nodes) { if (org.opentosca.container.core.tosca.convention.Utils.isSupportedCloudProviderNodeType(node.getType() - .getId())) { + .getId())) { return node; } } @@ -177,15 +168,15 @@ private AbstractNodeTemplate findCloudProviderNode(final AbstractNodeTemplate no private AbstractNodeTemplate findDockerEngineNode(final AbstractNodeTemplate nodeTemplate) { // check if the given node is the docker engine node if (org.opentosca.container.core.tosca.convention.Utils.isSupportedDockerEngineNodeType(nodeTemplate.getType() - .getId())) { + .getId())) { return nodeTemplate; } // check if the given node is connected to an docker engine node for (final AbstractRelationshipTemplate relationTemplate : nodeTemplate.getOutgoingRelations()) { if (org.opentosca.container.core.tosca.convention.Utils.isSupportedDockerEngineNodeType(relationTemplate.getTarget() - .getType() - .getId())) { + .getType() + .getId())) { return relationTemplate.getTarget(); } } @@ -202,25 +193,25 @@ private AbstractNodeTemplate findDockerEngineNode(final AbstractNodeTemplate nod private AbstractNodeTemplate findUbuntuNode(final AbstractNodeTemplate nodeTemplate) { // check if the given node is the ubuntu node if (org.opentosca.container.core.tosca.convention.Utils.isSupportedInfrastructureNodeType(nodeTemplate.getType() - .getId())) { + .getId())) { return nodeTemplate; } for (final AbstractRelationshipTemplate relationTemplate : nodeTemplate.getIngoingRelations()) { // check if the given node is connected to an ubuntu node if (org.opentosca.container.core.tosca.convention.Utils.isSupportedInfrastructureNodeType(relationTemplate.getSource() - .getType() - .getId())) { + .getType() + .getId())) { return relationTemplate.getSource(); } // check if an ubuntu node is connected with the given node through // a path of length 2 for (final AbstractRelationshipTemplate relationTemplate2 : relationTemplate.getSource() - .getIngoingRelations()) { + .getIngoingRelations()) { if (org.opentosca.container.core.tosca.convention.Utils.isSupportedInfrastructureNodeType(relationTemplate2.getSource() - .getType() - .getId())) { + .getType() + .getId())) { return relationTemplate2.getSource(); } @@ -233,7 +224,7 @@ private AbstractNodeTemplate findUbuntuNode(final AbstractNodeTemplate nodeTempl /** * Adds fragments to provision a VM * - * @param context a BPELPlanContext for a EC2, VM or Ubuntu Node + * @param context a BPELPlanContext for a EC2, VM or Ubuntu Node * @param nodeTemplate the NodeTemplate on which the fragments are used * @return true iff adding the fragments was successful */ @@ -317,7 +308,6 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate if (sshUserVariable == null) { LOG.debug("Adding sshUser field to plan input"); context.addStringValueToPlanRequest("sshUser"); - } if (sshKeyVariable == null) { @@ -369,7 +359,6 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate } else { createEC2InternalExternalPropsInput.put(externalParameter, variable); } - } // generate var with random value for the correlation id @@ -391,14 +380,14 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate // needed as BPS 2.1.2 fails at returning addresses appropiate for // callback // TODO maybe do a check with BPS Connector for BPS version, because - // since vers. 3 retrieving the address of the plan works + // since vers. 3 retrieving the address of the plan works context.addStringValueToPlanRequest("planCallbackAddress_invoker"); // we'll add the logic to VM Nodes Prov phase, as we need proper updates // of properties at the InstanceDataAPI this.invokerOpPlugin.handle(context, "create", "InterfaceAmazonEC2VM", "planCallbackAddress_invoker", - createEC2InternalExternalPropsInput, createEC2InternalExternalPropsOutput); + createEC2InternalExternalPropsInput, createEC2InternalExternalPropsOutput); /* * Check whether the SSH port is open on the VM @@ -410,8 +399,8 @@ public boolean handle(final BPELPlanContext context, final AbstractNodeTemplate startRequestInputParams.put("sshKey", sshKeyVariable); this.invokerOpPlugin.handle(context, ubuntuNodeTemplate.getId(), true, "start", "InterfaceUbuntu", - startRequestInputParams, new HashMap(), - context.getProvisioningPhaseElement()); + startRequestInputParams, new HashMap(), + context.getProvisioningPhaseElement()); return true; } @@ -421,7 +410,7 @@ public boolean handleTerminateWithCloudProviderInterface(final BPELPlanContext c final List infraNodes = context.getInfrastructureNodes(); for (final AbstractNodeTemplate infraNode : infraNodes) { if (org.opentosca.container.core.tosca.convention.Utils.isSupportedCloudProviderNodeType(infraNode.getType() - .getId())) { + .getId())) { // append logic to call terminateVM method on the // node @@ -443,13 +432,10 @@ public boolean handleTerminateWithCloudProviderInterface(final BPELPlanContext c inputs.put("HypervisorUserName", hypervisorUserName); inputs.put("HypervisorUserPassword", hypervisorUserPassword); - - return this.invokerOpPlugin.handle(context, hypervisorNode.getId(),true, - org.opentosca.container.core.tosca.convention.Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER_TERMINATEVM, - org.opentosca.container.core.tosca.convention.Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER, - inputs, outputs, elementToAppendTo); - - + return this.invokerOpPlugin.handle(context, hypervisorNode.getId(), true, + org.opentosca.container.core.tosca.convention.Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER_TERMINATEVM, + org.opentosca.container.core.tosca.convention.Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER, + inputs, outputs, elementToAppendTo); } } return false; @@ -536,8 +522,7 @@ public boolean handleCreateWithCloudProviderInterface(final BPELPlanContext cont context.addStringValueToPlanRequest(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINNAME); // add an assign from input to internal property variable context.addAssignFromInput2VariableToMainAssign(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINNAME, - sshUserVariable); - + sshUserVariable); } } @@ -561,7 +546,7 @@ public boolean handleCreateWithCloudProviderInterface(final BPELPlanContext cont LOG.debug("Adding sshKey field to plan input"); context.addStringValueToPlanRequest(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINPASSWORD); context.addAssignFromInput2VariableToMainAssign(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINPASSWORD, - sshKeyVariable); + sshKeyVariable); } } @@ -623,7 +608,6 @@ public boolean handleCreateWithCloudProviderInterface(final BPELPlanContext cont } else { createEC2InternalExternalPropsInput.put(externalParameter, variable); } - } // check if there is an access policy attached @@ -656,25 +640,25 @@ public boolean handleCreateWithCloudProviderInterface(final BPELPlanContext cont // getPublicDNSReturn into the InstanceId Property of the Ubuntu // Node createEC2InternalExternalPropsOutput.put(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMINSTANCEID, - instanceIdPropWrapper); + instanceIdPropWrapper); createEC2InternalExternalPropsOutput.put(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMIP, - serverIpPropWrapper); + serverIpPropWrapper); // generate plan input message element for the plan address, this is // needed as BPS 2.1.2 fails at returning addresses appropiate for // callback // TODO maybe do a check with BPS Connector for BPS version, because - // since vers. 3 retrieving the address of the plan works + // since vers. 3 retrieving the address of the plan works context.addStringValueToPlanRequest("planCallbackAddress_invoker"); // we'll add the logic to VM Nodes Prov phase, as we need proper updates // of properties at the InstanceDataAPI this.invokerOpPlugin.handle(context, cloudProviderNodeTemplate.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER_CREATEVM, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER, - createEC2InternalExternalPropsInput, createEC2InternalExternalPropsOutput, - context.getProvisioningPhaseElement()); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER_CREATEVM, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER, + createEC2InternalExternalPropsInput, createEC2InternalExternalPropsOutput, + context.getProvisioningPhaseElement()); /* * Check whether the SSH port is open on the VM. Doing this here removes the necessity for the other @@ -691,10 +675,10 @@ public boolean handleCreateWithCloudProviderInterface(final BPELPlanContext cont startRequestOutputParams.put("WaitResult", context.createGlobalStringVariable("WaitResultDummy", "")); this.invokerOpPlugin.handle(context, ubuntuNodeTemplate.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_WAITFORAVAIL, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, startRequestInputParams, - startRequestOutputParams, context.getProvisioningPhaseElement()); - + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_WAITFORAVAIL, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, startRequestInputParams, + startRequestOutputParams, context.getProvisioningPhaseElement()); + this.handleTerminateWithCloudProviderInterface(context, ubuntuNodeTemplate, context.getProvisioningCompensationPhaseElement()); for (final AbstractPolicy policy : nodeTemplate.getPolicies()) { @@ -702,7 +686,7 @@ public boolean handleCreateWithCloudProviderInterface(final BPELPlanContext cont final List modeledPortsVariables = fetchModeledPortsOfInfrastructure(context, nodeTemplate); modeledPortsVariables.add(context.createGlobalStringVariable("vmSshPort", "22")); addIpTablesScriptLogic(context, modeledPortsVariables, serverIpPropWrapper, sshUserVariable, - sshKeyVariable, ubuntuNodeTemplate); + sshKeyVariable, ubuntuNodeTemplate); } } @@ -737,14 +721,11 @@ private void addIpTablesScriptLogic(final BPELPlanContext context, final List fetchModeledPortsOfInfrastructure(final PlanContext context, @@ -800,9 +781,7 @@ private List fetchPortPropertyVariable(final PlanContext context, /** * Provisions a Docker Ubuntu Container on a DockerEngine * - * @param context - * - * a BPELPlanContext for a DockerEngine or Ubuntu Node + * @param context a BPELPlanContext for a DockerEngine or Ubuntu Node * @param nodeTemplate the NodeTemplate on which the fragments are used * @return true iff provisioning the container was successful */ @@ -913,7 +892,7 @@ public boolean handleWithDockerEngineInterface(final BPELPlanContext context, LOG.debug("Adding sshUser field to plan input"); context.addStringValueToPlanRequest(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINNAME); context.addAssignFromInput2VariableToMainAssign(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINNAME, - sshUserVariable); + sshUserVariable); } } @@ -935,7 +914,7 @@ public boolean handleWithDockerEngineInterface(final BPELPlanContext context, LOG.debug("Adding sshKey field to plan input"); context.addStringValueToPlanRequest(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINPASSWORD); context.addAssignFromInput2VariableToMainAssign(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINPASSWORD, - sshKeyVariable); + sshKeyVariable); } } @@ -962,10 +941,10 @@ public boolean handleWithDockerEngineInterface(final BPELPlanContext context, LOG.debug(dockerEngineNodeTemplate.getId() + " " + dockerEngineNodeTemplate.getType()); this.invokerOpPlugin.handle(context, dockerEngineNodeTemplate.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, - createDEInternalExternalPropsInput, createDEInternalExternalPropsOutput, - context.getProvisioningPhaseElement()); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE_STARTCONTAINER, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_DOCKERENGINE, + createDEInternalExternalPropsInput, createDEInternalExternalPropsOutput, + context.getProvisioningPhaseElement()); /* * Check whether the SSH port is open on the VM. Doing this here removes the necessity for the other @@ -981,9 +960,9 @@ public boolean handleWithDockerEngineInterface(final BPELPlanContext context, startRequestOutputParams.put("WaitResult", context.createGlobalStringVariable("WaitResultDummy", "")); this.invokerOpPlugin.handle(context, ubuntuNodeTemplate.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_WAITFORAVAIL, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, startRequestInputParams, - startRequestOutputParams, context.getProvisioningPhaseElement()); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_WAITFORAVAIL, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, startRequestInputParams, + startRequestOutputParams, context.getProvisioningPhaseElement()); return true; } @@ -1066,8 +1045,7 @@ public boolean handleWithLocalCloudProviderInterface(final BPELPlanContext conte context.addStringValueToPlanRequest(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINNAME); // add an assign from input to internal property variable context.addAssignFromInput2VariableToMainAssign(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINNAME, - sshUserVariable); - + sshUserVariable); } } @@ -1091,7 +1069,7 @@ public boolean handleWithLocalCloudProviderInterface(final BPELPlanContext conte BPELUbuntuVmTypePluginHandler.LOG.debug("Adding sshKey field to plan input"); context.addStringValueToPlanRequest(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINPASSWORD); context.addAssignFromInput2VariableToMainAssign(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMLOGINPASSWORD, - sshKeyVariable); + sshKeyVariable); } } @@ -1154,11 +1132,9 @@ public boolean handleWithLocalCloudProviderInterface(final BPELPlanContext conte context.addAssignFromInput2VariableToMainAssign(externalParameter, variable); createEC2InternalExternalPropsInput.put(externalParameter, variable); - } else { createEC2InternalExternalPropsInput.put(externalParameter, variable); } - } // generate var with random value for the correlation id @@ -1174,25 +1150,25 @@ public boolean handleWithLocalCloudProviderInterface(final BPELPlanContext conte // getPublicDNSReturn into the InstanceId Property of the Ubuntu // Node createEC2InternalExternalPropsOutput.put(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMINSTANCEID, - instanceIdPropWrapper); + instanceIdPropWrapper); createEC2InternalExternalPropsOutput.put(Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMIP, - serverIpPropWrapper); + serverIpPropWrapper); // generate plan input message element for the plan address, this is // needed as BPS 2.1.2 fails at returning addresses appropiate for // callback // TODO maybe do a check with BPS Connector for BPS version, because - // since vers. 3 retrieving the address of the plan works + // since vers. 3 retrieving the address of the plan works context.addStringValueToPlanRequest("planCallbackAddress_invoker"); // we'll add the logic to VM Nodes Prov phase, as we need proper updates // of properties at the InstanceDataAPI this.invokerOpPlugin.handle(context, cloudProviderNodeTemplate.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER_CREATEVM, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER, - createEC2InternalExternalPropsInput, createEC2InternalExternalPropsOutput, - context.getProvisioningPhaseElement()); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER_CREATEVM, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_CLOUDPROVIDER, + createEC2InternalExternalPropsInput, createEC2InternalExternalPropsOutput, + context.getProvisioningPhaseElement()); /* * Check whether the SSH port is open on the VM. Doing this here removes the necessity for the other @@ -1208,9 +1184,9 @@ public boolean handleWithLocalCloudProviderInterface(final BPELPlanContext conte startRequestOutputParams.put("WaitResult", context.createGlobalStringVariable("WaitResultDummy", "")); this.invokerOpPlugin.handle(context, ubuntuNodeTemplate.getId(), true, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_WAITFORAVAIL, - Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, startRequestInputParams, - startRequestOutputParams, context.getProvisioningPhaseElement()); + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM_WAITFORAVAIL, + Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM, startRequestInputParams, + startRequestOutputParams, context.getProvisioningPhaseElement()); return true; } @@ -1218,7 +1194,6 @@ public boolean handleWithLocalCloudProviderInterface(final BPELPlanContext conte private Variable getUbtuntuAMIId(final BPELPlanContext context, final AbstractNodeTemplate nodeTemplate) { final PropertyVariable vmImageId = context.getPropertyVariable("VMImageID", true); - // here either the ubuntu connected to the provider this handler is // working on hasn't a version in the ID (ubuntu version must be written // in AMIId property then) or something went really wrong @@ -1228,11 +1203,10 @@ private Variable getUbtuntuAMIId(final BPELPlanContext context, final AbstractNo // context.createGlobalStringVariable("ubuntu_AMIId", // "ubuntu-13.10-server-cloudimg-amd64"); return context.createGlobalStringVariable("ubuntu_AMIId", - createUbuntuImageStringFromNodeType(nodeTemplate.getType() - .getId())); + createUbuntuImageStringFromNodeType(nodeTemplate.getType() + .getId())); } return vmImageId; } - } diff --git a/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/UbuntuVmTypePluginHandler.java b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/UbuntuVmTypePluginHandler.java similarity index 77% rename from org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/UbuntuVmTypePluginHandler.java rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/UbuntuVmTypePluginHandler.java index b355ee4c3..9c66a54e3 100644 --- a/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/UbuntuVmTypePluginHandler.java +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/java/org/opentosca/planbuilder/type/plugin/ubuntuvm/bpel/UbuntuVmTypePluginHandler.java @@ -1,27 +1,25 @@ package org.opentosca.planbuilder.type.plugin.ubuntuvm.bpel; +import org.opentosca.planbuilder.core.plugins.context.PlanContext; import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; /** *

    * This class implements the logic to provision an EC2VM Stack, consisting of the NodeTypes - * {http://www.example.com/tosca/ServiceTemplates/EC2VM}EC2, - * {http://www.example.com/tosca/ServiceTemplates/EC2VM}VM, + * {http://www.example.com/tosca/ServiceTemplates/EC2VM}EC2, {http://www.example.com/tosca/ServiceTemplates/EC2VM}VM, * {http://www.example.com/tosca/ServiceTemplates/EC2VM}Ubuntu. *

    * Copyright 2016 IAAS University of Stuttgart
    *
    * * @author Kalman Kepes - kalman.kepes@iaas.uni-stuttgart.de - * */ public interface UbuntuVmTypePluginHandler { /** * Adds fragments to provision a VM * - * @param context a TemplatePlanContext for a EC2, VM or Ubuntu Node + * @param context a TemplatePlanContext for a EC2, VM or Ubuntu Node * @param nodeTemplate the NodeTemplate on which the fragments are used * @return true iff adding the fragments was successful */ @@ -32,12 +30,9 @@ public interface UbuntuVmTypePluginHandler { /** * Provisions a Docker Ubuntu Container on a DockerEngine * - * @param context - * - * a TemplatePlanContext for a DockerEngine or Ubuntu Node + * @param context a TemplatePlanContext for a DockerEngine or Ubuntu Node * @param nodeTemplate the NodeTemplate on which the fragments are used * @return true iff provisioning the container was successful */ public boolean handleWithDockerEngineInterface(final T context, final AbstractNodeTemplate nodeTemplate); - } diff --git a/org.opentosca.planbuilder.type.plugin.ubuntuvm/META-INF/resources/iptables.sh b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/resources/iptables.sh similarity index 100% rename from org.opentosca.planbuilder.type.plugin.ubuntuvm/META-INF/resources/iptables.sh rename to org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/resources/iptables.sh diff --git a/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/resources/spring/context-planbuilder-plugin.xml b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/resources/spring/context-planbuilder-plugin.xml new file mode 100644 index 000000000..6f36db28e --- /dev/null +++ b/org.opentosca.planbuilder/org.opentosca.planbuilder.type.plugin.ubuntuvm/src/main/resources/spring/context-planbuilder-plugin.xml @@ -0,0 +1,13 @@ + + + + Register the beans within the planbuilder connectsto type plugin + + + + diff --git a/org.opentosca.planbuilder/pom.xml b/org.opentosca.planbuilder/pom.xml index fa3fd886c..13025f4c2 100644 --- a/org.opentosca.planbuilder/pom.xml +++ b/org.opentosca.planbuilder/pom.xml @@ -1,17 +1,38 @@ - - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - org.opentosca.planbuilder - eclipse-plugin - - + + + 4.0.0 + + + org.opentosca + container + 2.0.0-SNAPSHOT + + + org.opentosca.planbuilder + pom + + + org.opentosca.planbuilder.core + org.opentosca.planbuilder.core.bpel + org.opentosca.planbuilder.integration + org.opentosca.planbuilder.model + org.opentosca.planbuilder.postphase.plugin.instancedata + org.opentosca.planbuilder.postphase.plugin.situations + org.opentosca.planbuilder.postphase.plugin.vinothek + org.opentosca.planbuilder.postphase.plugin.monitoring + org.opentosca.planbuilder.provphase.plugin.ansibleoperation + org.opentosca.planbuilder.prephase.plugin.fileupload + org.opentosca.planbuilder.provphase.plugin.invoker + org.opentosca.planbuilder.selection.plugin.firstavailable + org.opentosca.planbuilder.selection.plugin.input + org.opentosca.planbuilder.selection.plugin.mosquitto.workload + org.opentosca.planbuilder.type.plugin.connectsto + org.opentosca.planbuilder.type.plugin.dockercontainer + org.opentosca.planbuilder.type.plugin.hardware + org.opentosca.planbuilder.type.plugin.mosquittoconnectsto + org.opentosca.planbuilder.type.plugin.patternbased + org.opentosca.planbuilder.type.plugin.platforms + org.opentosca.planbuilder.type.plugin.ubuntuvm + + diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractPlanBuilder.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractPlanBuilder.java deleted file mode 100644 index 3ab012dd8..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractPlanBuilder.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.opentosca.planbuilder; - -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.plugins.registry.PluginRegistry; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class AbstractPlanBuilder { - - protected final PluginRegistry pluginRegistry = new PluginRegistry(); - - private final static Logger LOG = LoggerFactory.getLogger(AbstractPlanBuilder.class); - - abstract public PlanType createdPlanType(); - - - public boolean isRunning(final AbstractNodeTemplate nodeTemplate) { - if (nodeTemplate.getProperties() != null) { - String val = nodeTemplate.getProperties().asMap().get("State"); - return val != null && val.equals("Running"); - } else { - return false; - } - } - - /** - * Returns the number of the plugins registered with this planbuilder - * - * @return integer denoting the count of plugins - */ - public int registeredPlugins() { - return this.pluginRegistry.getTypePlugins().size() + this.pluginRegistry.getDaPlugins().size() - + this.pluginRegistry.getIaPlugins().size() + this.pluginRegistry.getPostPlugins().size() - + this.pluginRegistry.getProvPlugins().size(); - } -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractSimplePlanBuilder.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractSimplePlanBuilder.java deleted file mode 100644 index cc3fb6ba2..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/AbstractSimplePlanBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.opentosca.planbuilder; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opentosca.planbuilder.model.plan.AbstractPlan; -import org.opentosca.planbuilder.model.plan.AbstractPlan.PlanType; -import org.opentosca.planbuilder.model.tosca.AbstractDefinitions; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractServiceTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class AbstractSimplePlanBuilder extends AbstractPlanBuilder { - - private final static Logger LOG = LoggerFactory.getLogger(AbstractSimplePlanBuilder.class); - - /** - *

    - * Creates a BuildPlan in WS-BPEL 2.0 for the specified values csarName, definitions and - * serviceTemplateId. Where csarName denotes the fileName of the CSAR, definitions denotes the - * Definitions document and serviceTemplateId a QName denoting the ServiceTemplate inside the - * Definitions document - *

    - * - * @param csarName the file name of the CSAR as String - * @param definitions the Definitions document as AbstractDefinitions Object - * @param serviceTemplateId a QName denoting a ServiceTemplate inside the Definitions document - * @return a complete BuildPlan for the given ServiceTemplate, if the ServiceTemplate denoted by the - * given QName isn't found inside the Definitions document null is returned instead - */ - abstract public AbstractPlan buildPlan(String csarName, AbstractDefinitions definitions, - AbstractServiceTemplate serviceTemplateId); - - /** - *

    - * Returns a List of BuildPlans for the ServiceTemplates contained in the given Definitions document - *

    - * - * @param csarName the file name of CSAR - * @param definitions a AbstractDefinitions Object denoting the Definitions document - * @return a List of Build Plans for each ServiceTemplate contained inside the Definitions document - */ - abstract public List buildPlans(String csarName, AbstractDefinitions definitions); -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/activator/Activator.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/activator/Activator.java deleted file mode 100644 index 730fa0867..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/activator/Activator.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * - */ -package org.opentosca.planbuilder.plugins.activator; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * @author kalmankepes - * - */ -public class Activator implements BundleActivator { - - public static BundleContext ctx; - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(final BundleContext context) throws Exception { - Activator.ctx = context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(final BundleContext context) throws Exception { - Activator.ctx = null; - } - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderCompensationOperationPlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderCompensationOperationPlugin.java deleted file mode 100644 index 94234bce4..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderCompensationOperationPlugin.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.opentosca.planbuilder.plugins.artifactbased; - -import java.util.Map; - -import org.opentosca.planbuilder.model.plan.bpel.BPELScope.BPELScopePhaseType; -import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Variable; - -public interface IPlanBuilderCompensationOperationPlugin - extends IPlanBuilderProvPhaseParamOperationPlugin { - - - /** - * Create BPEL code to invoke given method and additionally add compensation logic - * - * @param context the plan context for the plugin - * @param operation the operation for that this plugin should generate invocation logic - * @param ia the implementation artifact of the given operation - * @param param2propertyMapping a mapping from operation parameters to variables - * @param compensationOperation the operation which compensates the given operation - * @param compensationIa the implementation artifact of the compensation operation - * @param compensationParam2VariableMapping a mapping from compensation operation parameters to - * variables - * @return true iff generating invocation logic was successful - */ - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, - Map param2propertyMapping, - AbstractOperation compensationOperation, AbstractImplementationArtifact compensationIa, - Map compensationParam2VariableMapping); - - - /** - * Create BPEL code to invoke given method and additionally add compensation logic - * - * @param context the plan context for the plugin - * @param operation the operation for that this plugin should generate invocation logic - * @param ia the implementation artifact of the given operation - * @param param2propertyMapping a mapping from operation parameters to variables - * @param compensationOperation the operation which compensates the given operation - * @param compensationIa the implementation artifact of the compensation operation - * @param compensationParam2VariableMapping a mapping from compensation operation parameters to - * variables - * @param phase determines to which phase of the scope the operation logic should be added to - * @return true iff generating invocation logic was successful - */ - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, - Map param2propertyMapping, - AbstractOperation compensationOperation, AbstractImplementationArtifact compensationIa, - Map compensationParam2VariableMapping, BPELScopePhaseType phase); - - /** - * Create BPEL code to invoke given method and additionally add compensation logic - * - * @param context the plan context for the plugin - * @param operation the operation for that this plugin should generate invocation logic - * @param ia the implementation artifact of the given operation - * @param param2propertyMapping a mapping from operation parameters to variables - * @param param2PropertyOutputMapping a mapping from operation output parameters to variables - * @param compensationOperation the operation which compensates the given operation - * @param compensationIa the implementation artifact of the compensation operation - * @param compensationParam2VariableMapping a mapping from compensation operation parameters to - * variables - * @return true iff generating invocation logic was successful - */ - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, - Map param2propertyMapping, - Map param2PropertyOutputMapping, - AbstractOperation compensationOperation, AbstractImplementationArtifact compensationIa, - Map compensationParam2VariableMapping); - - /** - * Create BPEL code to invoke given method and additionally add compensation logic - * - * @param context the plan context for the plugin - * @param operation the operation for that this plugin should generate invocation logic - * @param ia the implementation artifact of the given operation - * @param param2propertyMapping a mapping from operation parameters to variables - * @param param2PropertyOutputMapping a mapping from operation output parameters to variables - * @param compensationOperation the operation which compensates the given operation - * @param compensationIa the implementation artifact of the compensation operation - * @param compensationParam2VariableMapping a mapping from compensation operation parameters to - * variables - * @param phase determines to which phase of the scope the operation logic should be added to - * @return true iff generating invocation logic was successful - */ - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, - Map param2propertyMapping, - Map param2PropertyOutputMapping, - AbstractOperation compensationOperation, AbstractImplementationArtifact compensationIa, - Map compensationParam2VariableMapping, BPELScopePhaseType phase); - - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderPrePhaseDAPlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderPrePhaseDAPlugin.java deleted file mode 100644 index 6473aa93b..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderPrePhaseDAPlugin.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.opentosca.planbuilder.plugins.artifactbased; - -import org.opentosca.planbuilder.model.tosca.AbstractDeploymentArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractNodeType; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPlugin; - -/** - *

    - * This interface should be implemented by Plugins which are responsible for deploying DA's inside a - * PrePhase of a TemplateBuildPlan. The deployment should be handle on an appropiate - * InfrastructureNode - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public interface IPlanBuilderPrePhaseDAPlugin extends IPlanBuilderPlugin { - - /** - * This method is used to determine whether this plugin can deploy a DA based on its type to a Node - * of the given type. - * - * @param deploymentArtifact the DA to deploy - * @param infrastructureNodeType the NodeType of an InfrastructureNode - * @return true iff when this plugin can deploy a DA of the given artifactType to a Node of the - * given nodeType - */ - public boolean canHandle(AbstractDeploymentArtifact deploymentArtifact, AbstractNodeType infrastructureNodeType); - - /** - * This method is used to add a fragment to a prephase of the nodeTemplate declared inside the given - * context. The fragment should deploy the given DA unto the given InfrastructureNode - * - * @param context a TemplatePlanContext of the Template which a Provisioning has to be created - * @param da the DeploymentArtifact to deploy - * @param infrastructureNodeTemplate the InfrastructureNodeTemplate to deploy the DA on - * @return true iff generating and adding the fragment to the PrePhase of the TemplateContext was - * successful - */ - public boolean handle(T context, AbstractDeploymentArtifact da, AbstractNodeTemplate infrastructureNodeTemplate); - - public boolean canHandleCreate(AbstractNodeTemplate nodeTemplate); - - public boolean handleCreate(T context, AbstractNodeTemplate nodeTemplate); - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderPrePhaseIAPlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderPrePhaseIAPlugin.java deleted file mode 100644 index 79cb2c16f..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderPrePhaseIAPlugin.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opentosca.planbuilder.plugins.artifactbased; - -import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractNodeType; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPlugin; - -/** - *

    - * This interface should be implemented by Plugin which can add PrePhase Fragments for IA's. The - * plugin should be able to deploy at least one ArtifactType to a specific NodeType - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public interface IPlanBuilderPrePhaseIAPlugin extends IPlanBuilderPlugin { - - /** - * This method is used to determin whether the plugin can deploy the given ArtifactType to the given - * InfrastructureNodeType - * - * @param ia an ImplementationArtifact to deploy - * @param infrastructureNodeType a NodeType which should be a InfrastructureNodeType - * @return true iff this plugin can deploy the given ArtifactTypes to the given - * InfrastructureNodeType - */ - public boolean canHandle(AbstractImplementationArtifact ia, AbstractNodeType infrastructureNodeType); - - /** - * This method is used add the fragment this plugin can generate for the given IA which must be - * deployed unto the given InfrastructureNodeTemplate - * - * @param context a TemplatePlanContext of the Template for which the fragment has to be generated - * @param ia an ImplementationArtifact of the Template inside the context - * @param infrastructureNodeTemplate an InfrastructureNodeTemplate of the template inside the - * context - * @return true iff generating and adding the fragment was successful - */ - public boolean handle(T context, AbstractImplementationArtifact ia, - AbstractNodeTemplate infrastructureNodeTemplate); -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderProvPhaseOperationPlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderProvPhaseOperationPlugin.java deleted file mode 100644 index 8c56b0ca8..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderProvPhaseOperationPlugin.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.opentosca.planbuilder.plugins.artifactbased; - -import javax.xml.namespace.QName; - -import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPlugin; - -/** - *

    - * This interface should be implemented by Plugins which can generate Fragments that implement the - * Provisioning trough TOSCA Operations on Node-/RelationshipTypes - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public interface IPlanBuilderProvPhaseOperationPlugin extends IPlanBuilderPlugin { - - /** - * This method is used determine whether the Plugin can handle Operations which are implemented by - * an IA with the given ArtifactType - * - * @param operationArtifactType the Type of the IA which implements a TOSCA Operation - * @return true iff the plugin can handle Operations that are implemented by IA of the given - * ArtifactType - */ - public boolean canHandle(QName operationArtifactType); - - /** - * This method is used to generate and add a fragment which calls an TOSCA Operations - * - * @param context the TemplateContext of the Template to call the Operation on - * @param operation the Operation to call on the Template - * @param ia the IA which implements the Operation - * @return true iff the plugin generated and added a fragment into the ProvisioningPhase in the - * TemplateContext - */ - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia); - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderProvPhaseParamOperationPlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderProvPhaseParamOperationPlugin.java deleted file mode 100644 index 63b7a1bfc..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/artifactbased/IPlanBuilderProvPhaseParamOperationPlugin.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.opentosca.planbuilder.plugins.artifactbased; - -import java.util.Map; - -import org.opentosca.planbuilder.model.tosca.AbstractImplementationArtifact; -import org.opentosca.planbuilder.model.tosca.AbstractOperation; -import org.opentosca.planbuilder.model.tosca.AbstractParameter; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.context.Variable; -import org.w3c.dom.Element; - -/** - * - *

    - * This interface should be implemented by Plugins which can generate Fragments that implement the - * Provisioning trough TOSCA Operations on Node-/RelationshipTypes with a map of operation - * parameters mapped to tosca properties. - *

    - * Copyright 2016 IAAS University of Stuttgart
    - *
    - * - * @author Kálmán Képes - kalman.kepes@iaas.uni-stuttgart.de - * - */ -public interface IPlanBuilderProvPhaseParamOperationPlugin - extends IPlanBuilderProvPhaseOperationPlugin { - - /** - * This method is used to generate and add a fragment which calls a TOSCA Operation - * - * @param context the TemplateContext of the Template to call the Operation on - * @param operation the Operation to call on the Template - * @param ia the IA which implements the Operation - * @param param2propertyMapping a mapping from operation parameters to tosca property variables - * @return true iff the plugin generated and added a fragment into the ProvisioningPhase in the - * TemplateContext - */ - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, - Map param2propertyMapping); - - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, - Map param2propertyMapping, Element elementToAppendTo); - - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, - Map param2propertyMapping, - Map param2PropertyOutputMapping); - - public boolean handle(T context, AbstractOperation operation, AbstractImplementationArtifact ia, - Map param2propertyMapping, - Map param2PropertyOutputMapping, Element elementToAppendTo); - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/registry/PluginRegistry.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/registry/PluginRegistry.java deleted file mode 100644 index fd97b85ce..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/registry/PluginRegistry.java +++ /dev/null @@ -1,381 +0,0 @@ -package org.opentosca.planbuilder.plugins.registry; - -import java.util.ArrayList; -import java.util.List; - -import org.opentosca.planbuilder.AbstractPlanBuilder; -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.activator.Activator; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseDAPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderPrePhaseIAPlugin; -import org.opentosca.planbuilder.plugins.artifactbased.IPlanBuilderProvPhaseOperationPlugin; -import org.opentosca.planbuilder.plugins.context.PlanContext; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwarePostPhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwarePrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPolicyAwareTypePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPostPhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderPrePhasePlugin; -import org.opentosca.planbuilder.plugins.typebased.IPlanBuilderTypePlugin; -import org.opentosca.planbuilder.plugins.typebased.IScalingPlanBuilderSelectionPlugin; -import org.osgi.framework.BundleContext; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; - -/** - *

    - * This class is the registry for all plugins of the PlanBuilder - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepes@iaas.uni-stuttgart.de - * - */ -public class PluginRegistry { - - private BundleContext getCtx() { - return Activator.ctx; - } - - /** - * Returns all registered GenericPlugins - * - * @return a List of IPlanBuilderTypePlugin - */ - public List> getTypePlugins() { - final List> plugins = new ArrayList<>(); - final BundleContext ctx = getCtx(); - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderTypePlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderTypePlugin) ctx.getService(ref)); - } - - } - } - catch (final InvalidSyntaxException e) { - e.printStackTrace(); - } - - return plugins; - } - - public List> getPrePlugins() { - final List> plugins = new ArrayList<>(); - final BundleContext ctx = getCtx(); - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderPrePhasePlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderPrePhasePlugin) ctx.getService(ref)); - } - - } - } - catch (final InvalidSyntaxException e) { - e.printStackTrace(); - } - - return plugins; - } - - /** - * Returns all registered ProvPhasePlugins - * - * @return a List of IPlanBuilderProvPhaseOperationPlugin - */ - public List> getProvPlugins() { - final List> plugins = new ArrayList<>(); - - final BundleContext ctx = getCtx(); - - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderProvPhaseOperationPlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderProvPhaseOperationPlugin) ctx.getService(ref)); - } - } - - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return plugins; - } - - /** - * Returns all registered PrePhaseIAPlugins - * - * @return a List of IPlanBuilderPrePhaseIAPlugin - */ - public List> getIaPlugins() { - final List> plugins = new ArrayList<>(); - - final BundleContext ctx = getCtx(); - - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderPrePhaseIAPlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderPrePhaseIAPlugin) ctx.getService(ref)); - } - } - - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return plugins; - } - - /** - * Returns all registered PrePhaseDAPlugins - * - * @return a List of IPlanBuilderPrePhaseDAPlugin - */ - public List> getDaPlugins() { - final List> plugins = new ArrayList<>(); - - final BundleContext ctx = getCtx(); - - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderPrePhasePlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderPrePhaseDAPlugin) ctx.getService(ref)); - } - } - - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return plugins; - } - - /** - * Returns all registered PostPhasePlugins - * - * @return a List of IPlanBuilderPostPhasePlugin - */ - public List> getPostPlugins() { - final List> plugins = new ArrayList<>(); - - final BundleContext ctx = getCtx(); - - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderPostPhasePlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderPostPhasePlugin) ctx.getService(ref)); - } - } - - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return plugins; - } - - /** - * Returns all registered SelectionPlugins - * - * @return a List of IScalingPlanBuilderSelectionPlugin - */ - public List> getSelectionPlugins() { - final List> plugins = new ArrayList<>(); - final BundleContext ctx = getCtx(); - - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IScalingPlanBuilderSelectionPlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IScalingPlanBuilderSelectionPlugin) ctx.getService(ref)); - } - } - - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return plugins; - } - - - - public List> getPolicyAwareTypePlugins() { - final List> plugins = new ArrayList<>(); - final BundleContext ctx = getCtx(); - - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderPolicyAwareTypePlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderPolicyAwareTypePlugin) ctx.getService(ref)); - } - } - - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return plugins; - } - - public List> getPolicyAwarePostPhasePlugins() { - final List> plugins = new ArrayList<>(); - - final BundleContext ctx = getCtx(); - - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderPolicyAwarePostPhasePlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderPolicyAwarePostPhasePlugin) ctx.getService(ref)); - } - } - - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return plugins; - } - - public List> getPolicyAwarePrePhasePlugins() { - final List> plugins = new ArrayList<>(); - - final BundleContext ctx = getCtx(); - - try { - final ServiceReference[] refs = - ctx.getAllServiceReferences(IPlanBuilderPolicyAwarePrePhasePlugin.class.getName(), null); - - if (refs != null) { - for (final ServiceReference ref : refs) { - plugins.add((IPlanBuilderPolicyAwarePrePhasePlugin) ctx.getService(ref)); - } - } - - } - catch (final InvalidSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return plugins; - } - - public boolean canTypePluginHandleCreate(final AbstractNodeTemplate nodeTemplate) { - if (this.findTypePluginForCreation(nodeTemplate) != null) { - return true; - } else { - return false; - } - } - - public boolean canTypePluginHandleCreate(final AbstractRelationshipTemplate relationshipTemplate) { - if (this.findTypePluginForCreation(relationshipTemplate) != null) { - return true; - } else { - return false; - } - } - - public IPlanBuilderPolicyAwareTypePlugin findPolicyAwareTypePluginForCreation(final AbstractNodeTemplate nodeTemplate) { - for (final IPlanBuilderPolicyAwareTypePlugin plugin : this.getPolicyAwareTypePlugins()) { - if (plugin.canHandlePolicyAwareCreate(nodeTemplate)) { - return plugin; - } - } - return null; - } - - public IPlanBuilderTypePlugin findTypePluginForTermination(final AbstractRelationshipTemplate relationshipTemplate) { - for (final IPlanBuilderTypePlugin plugin : this.getTypePlugins()) { - if (plugin.canHandleTerminate(relationshipTemplate)) { - return plugin; - } - } - return null; - } - - public IPlanBuilderTypePlugin findTypePluginForTermination(final AbstractNodeTemplate nodeTemplate) { - int highestPrio = -1; - IPlanBuilderTypePlugin candidate = null; - - for (final IPlanBuilderTypePlugin plugin : this.getTypePlugins()) { - if (plugin.canHandleTerminate(nodeTemplate)) { - if(highestPrio < plugin.getPriority()) { - candidate = plugin; - highestPrio = plugin.getPriority(); - } - } - } - return candidate; - } - - public IPlanBuilderTypePlugin findTypePluginForCreation(final AbstractNodeTemplate nodeTemplate) { - int highestPrio = -1; - IPlanBuilderTypePlugin candidate = null; - - for (final IPlanBuilderTypePlugin plugin : this.getTypePlugins()) { - if (plugin.canHandleCreate(nodeTemplate)) { - if(highestPrio < plugin.getPriority()) { - candidate = plugin; - highestPrio = plugin.getPriority(); - } - } - } - return candidate; - } - - public IPlanBuilderTypePlugin findTypePluginForCreation(final AbstractRelationshipTemplate relationshipTemplate) { - for (final IPlanBuilderTypePlugin plugin : this.getTypePlugins()) { - if (plugin.canHandleCreate(relationshipTemplate)) { - return plugin; - } - } - return null; - } - - public boolean handleCreateWithTypePlugin(final PlanContext context, final AbstractNodeTemplate nodeTemplate, - IPlanBuilderTypePlugin plugin) { - return plugin.handleCreate(context, nodeTemplate); - } - - public boolean handleCreateWithTypePlugin(final PlanContext context, - final AbstractRelationshipTemplate relationshipTemplate, - IPlanBuilderTypePlugin plugin) { - return plugin.handleCreate(context, relationshipTemplate); - } - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPlugin.java deleted file mode 100644 index 6b8a62f2e..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPlugin.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.opentosca.planbuilder.plugins.typebased; - -/** - *

    - * This the common interface for all plugins the PlanBuilder will use - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public interface IPlanBuilderPlugin { - - /** - * Returns the Id of the Plugin - * - * @return a String used to identify this Plugin - */ - public String getID(); - - /** - * Returns the priority to use this plugin by the plan builders. The higher the priority the more it - * is advised to use this plugin instead of another which also can handle the requested task (e.g. - * generating code to create an instance of a node template). The highest priority is 0, while it is - * advised that generic plugins that can handle node/relationship templates in a generic way (e.g. - * by a pattern), and only if they can, should have a lower priority than node/relation specific plugins - * - * @return an Integer denoting the priority of this plugin - */ - public int getPriority(); -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwarePostPhasePlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwarePostPhasePlugin.java deleted file mode 100644 index a72de5b07..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwarePostPhasePlugin.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.opentosca.planbuilder.plugins.typebased; - -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicy; -import org.opentosca.planbuilder.plugins.context.PlanContext; - -/** - *

    - * This interface should be implemented by Plugins which are PostPhasePlugins. PostPhasePlugins are - * used to update data outside of the BuildPlan, like Databases - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public interface IPlanBuilderPolicyAwarePostPhasePlugin extends IPlanBuilderPlugin { - - /** - * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of - * the given NodeTemplate and send it to the Component it belongs to - * - * @param context a TemplatePlanContext for accessing data inside the BuildPlan - * @param nodeTemplate the NodeTemplate the plugin should handle - * @return true if generating the Fragment of this Plugin was successful, else false - */ - public boolean handle(T context, AbstractNodeTemplate nodeTemplate, AbstractPolicy policy); - - /** - * Evaluates whether the given NodeTemplate can be handled by this post phase plugin. - * - * @param nodeTemplate An AbstractNodeTemplate - * @return true iff this plugin can handle the given nodeTemplate - */ - public boolean canHandle(AbstractNodeTemplate nodeTemplate, AbstractPolicy policy); - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwarePrePhasePlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwarePrePhasePlugin.java deleted file mode 100644 index 2cf149bac..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderPolicyAwarePrePhasePlugin.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.opentosca.planbuilder.plugins.typebased; - -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractPolicy; -import org.opentosca.planbuilder.plugins.context.PlanContext; - -/** - *

    - * This interface should be implemented by Plugins which are PostPhasePlugins. PostPhasePlugins are - * used to update data outside of the BuildPlan, like Databases - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public interface IPlanBuilderPolicyAwarePrePhasePlugin extends IPlanBuilderPlugin { - - /** - * When this method is called the Plugin should fetch relevant runtime data inside the BuildPlan of - * the given NodeTemplate and send it to the Component it belongs to - * - * @param context a TemplatePlanContext for accessing data inside the BuildPlan - * @param nodeTemplate the NodeTemplate the plugin should handle - * @return true if generating the Fragment of this Plugin was successful, else false - */ - public boolean handlePolicyAwareCreate(T context, AbstractNodeTemplate nodeTemplate, AbstractPolicy policy); - - /** - * Evaluates whether the given NodeTemplate can be handled by this post phase plugin. - * - * @param nodeTemplate An AbstractNodeTemplate - * @return true iff this plugin can handle the given nodeTemplate - */ - public boolean canHandlePolicyAwareCreate(AbstractNodeTemplate nodeTemplate, AbstractPolicy policy); - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderTypePlugin.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderTypePlugin.java deleted file mode 100644 index 2bc1ef54e..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/typebased/IPlanBuilderTypePlugin.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.opentosca.planbuilder.plugins.typebased; - -import java.util.Collection; - -import org.opentosca.planbuilder.model.tosca.AbstractNodeTemplate; -import org.opentosca.planbuilder.model.tosca.AbstractRelationshipTemplate; -import org.opentosca.planbuilder.plugins.context.PlanContext; - -/** - *

    - * This interface should be implemented by Plugins which can generate and add fragments that - * provision a complete Template - *

    - * Copyright 2013 IAAS University of Stuttgart
    - *
    - * - * @author Kalman Kepes - kepeskn@studi.informatik.uni-stuttgart.de - * - */ -public interface IPlanBuilderTypePlugin extends IPlanBuilderPlugin { - - /** - * This method should generate and add a fragment which handle the creation of the Template inside - * the TemplateContext - * - * @param templateContext a TemplateContext of a Template - * @return true iff when generating and adding fragment that handles the template completely - */ - public boolean handleCreate(T templateContext, AbstractNodeTemplate nodeTemplate); - - /** - * This method should generate and add a fragment which handle the termination of the Template - * inside the TemplateContext - * - * @param templateContext a TemplateContext of a Template - * @return true iff when generating and adding fragment that handles the template completely - */ - public boolean handleTerminate(T templateContext, AbstractNodeTemplate nodeTemplate); - - /** - * This method should generate and add a fragment which handle the creation of the Template inside - * the TemplateContext - * - * @param templateContext a TemplateContext of a Template - * @return true iff when generating and adding fragment that handles the template completely - */ - public boolean handleCreate(T templateContext, AbstractRelationshipTemplate relationshipTemplate); - - /** - * This method should generate and add a fragment which handle the termination of the Template - * inside the TemplateContext - * - * @param templateContext a TemplateContext of a Template - * @return true iff when generating and adding fragment that handles the template completely - */ - public boolean handleTerminate(T templateContext, AbstractRelationshipTemplate relationshipTemplate); - - /** - * This method should return true if the plugin can handle creation of the given nodeTemplate - * - * @param nodeTemplate the NodeTemplate to be handled by this plugin - * @return true iff this plugin can handle the given nodeTemplate - */ - public boolean canHandleCreate(AbstractNodeTemplate nodeTemplate); - - /** - * This method should return true if the plugin can handle the termination of the given nodeTemplate - * - * @param nodeTemplate the NodeTemplate to be handled by this plugin - * @return true iff this plugin can handle the given nodeTemplate - */ - public boolean canHandleTerminate(AbstractNodeTemplate nodeTemplate); - - /** - * This method should return true if the plugin can handle the creation of the given - * relationshipTemplate - * - * @param relationshipTemplate the RelationshipTemplate to be handled by this plugin - * @return true iff this can handle the given relationshipTemplate - */ - public boolean canHandleCreate(AbstractRelationshipTemplate relationshipTemplate); - - /** - * This method should return true if the plugin can handle the termination of the given - * relationshipTemplate - * - * @param relationshipTemplate the RelationshipTemplate to be handled by this plugin - * @return true iff this can handle the given relationshipTemplate - */ - public boolean canHandleTerminate(AbstractRelationshipTemplate relationshipTemplate); - - /** - * May be implemented by Type Plugins to give the planbuilder more information about needed - * dependencies to handle nodeTemplates - * - * @author kalmankepes - * - */ - public interface NodeDependencyInformationInterface { - - /** - * Returns a collection of nodeTemplates that are needed to be able to create an instance of the - * given nodeTemplate - * - * @param nodeTemplate the nodeTemplate to check its dependencies - * @return a collection of nodeTemplates that must be available for the nodeTemplate to create it by - * this plugin, if null -> the given NodeTemplate cannot be created under the context of the - * node (e.g. the topology template misses nodes) - */ - public Collection getCreateDependencies(AbstractNodeTemplate nodeTemplate); - - /** - * Returns a collection of nodeTemplates that are needed to be able to terminate an instance of the - * given nodeTemplate - * - * @param nodeTemplate the nodeTemplate to check its dependencies - * @return a collection of nodeTemplates that must be available for the nodeTemplate to terminate it - * by this plugin, if null -> the given NodeTemplate cannot be terminated under the context - * of the node (e.g. the topology template misses nodes) - */ - public Collection getTerminateDependencies(AbstractNodeTemplate nodeTemplate); - } - -} diff --git a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/utils/PluginUtils.java b/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/utils/PluginUtils.java deleted file mode 100644 index 88596819d..000000000 --- a/org.opentosca.planbuilder/src/org/opentosca/planbuilder/plugins/utils/PluginUtils.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.opentosca.planbuilder.plugins.utils; - -import org.opentosca.planbuilder.plugins.context.PropertyVariable; - -public class PluginUtils { - - /** - * Checks whether the property of the given variable is empty in the TopologyTemplate - * - * @param variable a property variable (var must belong to a topology template property) to check - * @param context the context the variable belongs to - * @return true iff the content of the given variable is empty in the topology template property - */ - public static boolean isVariableValueEmpty(final PropertyVariable variable) { - final String content = variable.getContent(); - return content == null || content.isEmpty(); - } - -} diff --git a/pom.xml b/pom.xml index 095de104b..ee3c026e9 100644 --- a/pom.xml +++ b/pom.xml @@ -1,176 +1,204 @@ - - 4.0.0 + + 4.0.0 - org.opentosca - container - 2.0.0-SNAPSHOT - pom + org.opentosca + container + 2.0.0-SNAPSHOT + pom - - 1.0.0 - UTF-8 - + + UTF-8 + 1.8 + 1.8 - - - - - org.eclipse.tycho - tycho-surefire-plugin - ${tycho-version} - - true - - - - org.eclipse.tycho - tycho-p2-repository-plugin - ${tycho-version} - - - - - - org.eclipse.tycho - tycho-maven-plugin - ${tycho-version} - true - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - true - - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - consider - force - - p2 - - org.opentosca - target-definition - ${project.version} - - - - - linux - gtk - x86 - - - linux - gtk - x86_64 - - - win32 - win32 - x86 - - - win32 - win32 - x86_64 - - - macosx - cocoa - x86_64 - - - - - - org.eclipse.tycho - tycho-source-plugin - ${tycho-version} - - - plugin-source - - plugin-source - - - - - - + v2.4.0-M1 - - target-definition - org.opentosca.container.application - org.opentosca.container.config.logging - org.opentosca.container.connector.bps - org.opentosca.container.connector.ode - org.opentosca.container.connector.winery - org.opentosca.container.control - org.opentosca.container.core - org.opentosca.container.core.impl - org.opentosca.container.core.tosca - org.opentosca.container.feature - org.opentosca.container.product - org.opentosca.container.engine.plan - org.opentosca.container.engine.plan.plugin.bpel - org.opentosca.container.engine.plan.plugin.camunda - org.opentosca.container.portability - org.opentosca.bus.management - org.opentosca.bus.management.api.osgievent - org.opentosca.bus.management.api.resthttp - org.opentosca.bus.management.api.soaphttp - org.opentosca.bus.management.deployment.plugin - org.opentosca.bus.management.deployment.plugin.script - org.opentosca.bus.management.deployment.plugin.tomcat - org.opentosca.bus.management.deployment.plugin.remote - org.opentosca.bus.management.invocation.plugin - org.opentosca.bus.management.invocation.plugin.script - org.opentosca.bus.management.invocation.plugin.rest - org.opentosca.bus.management.invocation.plugin.soaphttp - org.opentosca.bus.management.invocation.plugin.remote - org.opentosca.bus.management.service - org.opentosca.bus.management.service.impl - org.opentosca.bus.application.api.jsonhttp - org.opentosca.bus.application.api.resthttp - org.opentosca.bus.application.api.soaphttp - org.opentosca.bus.application.model - org.opentosca.bus.application.plugin.jsonhttp.service.impl - org.opentosca.bus.application.plugin.service - org.opentosca.bus.application.service - org.opentosca.bus.application.service.impl - org.opentosca.container.api - org.opentosca.planbuilder - org.opentosca.planbuilder.core.bpel - org.opentosca.planbuilder.csarhandler - org.opentosca.planbuilder.integration - org.opentosca.planbuilder.model - org.opentosca.planbuilder.service - org.opentosca.planbuilder.postphase.plugin.instancedata - org.opentosca.planbuilder.postphase.plugin.situations - org.opentosca.planbuilder.postphase.plugin.vinothek - org.opentosca.planbuilder.postphase.plugin.monitoring - org.opentosca.planbuilder.provphase.plugin.ansibleoperation - org.opentosca.planbuilder.prephase.plugin.fileupload - org.opentosca.planbuilder.provphase.plugin.invoker - org.opentosca.planbuilder.selection.plugin.firstavailable - org.opentosca.planbuilder.selection.plugin.input - org.opentosca.planbuilder.selection.plugin.mosquitto.workload - org.opentosca.planbuilder.type.plugin.connectsto - org.opentosca.planbuilder.type.plugin.dockercontainer - org.opentosca.planbuilder.type.plugin.hardware - org.opentosca.planbuilder.type.plugin.mosquittoconnectsto - org.opentosca.planbuilder.type.plugin.patternbased - org.opentosca.planbuilder.type.plugin.platforms - org.opentosca.planbuilder.type.plugin.ubuntuvm - org.opentosca.deployment.checks - org.opentosca.broker.mqtt - + 3.1.10 + 2.18.3 + 2.6 + 2.2.11 + + 2.30.1 + 4.3.18.RELEASE + 1.5.24 + + + + Central + central + https://repo1.maven.org/maven2/ + + + + Spring Plugins Public Repository + spring-plugins + https://repo.spring.io/plugins-release/ + + + + jitpack + https://jitpack.io + + + + + org.opentosca.broker.mqtt + org.opentosca.bus + org.opentosca.container.connector.ode + org.opentosca.container.connector.winery + org.opentosca.container.control + org.opentosca.container.core + org.opentosca.container.core.tosca + org.opentosca.container.engine.plan + org.opentosca.container.engine.plan.plugin.bpel + org.opentosca.container.engine.plan.plugin.camunda + org.opentosca.container.integration.tests + org.opentosca.container.war + org.opentosca.deployment.checks + org.opentosca.container.api + org.opentosca.planbuilder + org.opentosca.container.legacy + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.1.1 + + checkstyle.xml + checkstyle-suppressions.xml + UTF-8 + true + true + + + + com.thomasjensen.checkstyle.addons + checkstyle-addons + 6.0.1 + + + + + validate + validate + + true + true + + + check + + + + + + + + + + + org.slf4j + slf4j-api + 1.7.25 + + + + org.eclipse.jdt + org.eclipse.jdt.annotation + 2.1.0 + compile + + + + + + + com.google.guava + guava + 23.4-jre + + + javax.ws.rs + javax.ws.rs-api + 2.1.1 + + + + com.github.opentosca.winery + org.eclipse.winery.model.tosca + ${winery.version} + + + com.github.opentosca.winery + org.eclipse.winery.model.selfservice + ${winery.version} + + + com.github.opentosca.winery + org.eclipse.winery.accountability + ${winery.version} + + + com.sun.jersey + jersey-core + + + com.sun.jersey + jersey-client + + + com.sun.jersey.contribs + jersey-multipart + + + javax.persistence + javax.persistence-api + + + + + com.github.opentosca.winery + org.eclipse.winery.repository + ${winery.version} + + + org.web3j + core + + + com.sun.xml.bind + jaxb-impl + + + + + + + com.sun.xml.bind + jaxb-core + ${jaxb.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.version} + + + + wsdl4j + wsdl4j + 1.6.3 + + + diff --git a/target-definition/pom.xml b/target-definition/pom.xml deleted file mode 100644 index 249d829dd..000000000 --- a/target-definition/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - 4.0.0 - - - org.opentosca - container - 2.0.0-SNAPSHOT - - - target-definition - eclipse-target-definition - - diff --git a/target-definition/target-definition.target b/target-definition/target-definition.target deleted file mode 100644 index f8c3000af..000000000 --- a/target-definition/target-definition.target +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -